@riebeckite/plugin-garden-explorer 0.0.31 → 0.0.33
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 +6 -6
- package/README_ja.md +20 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -5
- package/dist/src/garden-explorer.d.ts +2 -2
- package/dist/src/garden-explorer.server.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ tag/folder filters, and note details in a single page.
|
|
|
9
9
|
|
|
10
10
|
## Overview
|
|
11
11
|
|
|
12
|
-
`
|
|
12
|
+
`gardenExplorer()` provides an interactive `GardenExplorer` component with
|
|
13
13
|
three panels:
|
|
14
14
|
|
|
15
15
|
- **Explorer** — search box plus optional tag and folder filter chips (with
|
|
@@ -61,11 +61,11 @@ of rescanning the vault in the browser.
|
|
|
61
61
|
|
|
62
62
|
```ts
|
|
63
63
|
import { defineConfig } from "@riebeckite/core";
|
|
64
|
-
import {
|
|
64
|
+
import { gardenExplorer } from "@riebeckite/plugin-garden-explorer";
|
|
65
65
|
|
|
66
66
|
export default defineConfig({
|
|
67
67
|
// ...
|
|
68
|
-
plugins: [
|
|
68
|
+
plugins: [gardenExplorer()],
|
|
69
69
|
});
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -73,7 +73,7 @@ With configuration:
|
|
|
73
73
|
|
|
74
74
|
```ts
|
|
75
75
|
plugins: [
|
|
76
|
-
|
|
76
|
+
gardenExplorer({
|
|
77
77
|
layout: "force",
|
|
78
78
|
depth: 1,
|
|
79
79
|
showTags: true,
|
|
@@ -86,7 +86,7 @@ plugins: [
|
|
|
86
86
|
];
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
`
|
|
89
|
+
`gardenExplorer()` registers the `/explore` page type and bundles
|
|
90
90
|
`style.css` and its client hydrator into the app. A catch-all route using
|
|
91
91
|
`resolveRiebeckiteRoute()` and `pluginPageSsgParams()` renders and emits it;
|
|
92
92
|
no plugin-specific application route is needed. The page is server-rendered
|
|
@@ -132,7 +132,7 @@ explorer/detail structure and links in semantic lists.
|
|
|
132
132
|
|
|
133
133
|
## Exports
|
|
134
134
|
|
|
135
|
-
- `
|
|
135
|
+
- `gardenExplorer(options?)` — plugin factory
|
|
136
136
|
- `GardenExplorer` — interactive explorer component (default export of
|
|
137
137
|
`components/garden-explorer.tsx`)
|
|
138
138
|
- `getGardenExplorerData({ manifest, config, resolveTitle, options? })` — builds
|
package/README_ja.md
CHANGED
|
@@ -8,39 +8,39 @@
|
|
|
8
8
|
|
|
9
9
|
## 用意される画面
|
|
10
10
|
|
|
11
|
-
`
|
|
11
|
+
`gardenExplorer()` は、次の三つの領域を持つ `GardenExplorer` コンポーネントとスタイルを提供します。
|
|
12
12
|
|
|
13
13
|
- **一覧**: キーワード検索、任意表示のタグ・フォルダーフィルター、該当ノートの一覧
|
|
14
|
-
- **グラフ**: 公開ノートと内部リンクを表示する SVG グラフ。Local / Global の切り替え、
|
|
14
|
+
- **グラフ**: 公開ノートと内部リンクを表示する SVG グラフ。Local / Global の切り替え、Force / Radial レイアウト、ホバー時の隣接ノート強調、ノードのドラッグ、ホイール / ボタンによるズームに対応します。キャンバスのパン、リセット、クリックでの記事移動にも対応します
|
|
15
15
|
- **詳細**: 選択したノートのリンク、タグ、抜粋、関連ノート
|
|
16
16
|
|
|
17
17
|
選択状態は `?note=`、`?tag=`、`?folder=` として URL に反映されます。表示中の状態をそのまま共有できます。
|
|
18
18
|
|
|
19
|
-
`getGardenExplorerData()` は `manifest.discoverableEntries` と `manifest.graph` から表示データを作ります。見出し、本文テキストの先頭 4,000
|
|
19
|
+
`getGardenExplorerData()` は `manifest.discoverableEntries` と `manifest.graph` から表示データを作ります。見出し、本文テキストの先頭 4,000 文字、タグ、フォルダー、外向きリンク、被リンクを含みます。グラフのノードは公開・発見可能なページと解決済みのノートリンクだけなので、未公開・除外・存在しないページは表示されません。
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
一覧パネルに表示するノートは、UI 性能のため先頭 80 件に制限します。Global Graph は絞り込み後の全ノートを使用します。URL で選択されたノートが先頭 80 件の外にある場合、Global Graph で保持されます。
|
|
22
22
|
|
|
23
23
|
## Local Graph と Global Graph
|
|
24
24
|
|
|
25
|
-
- **Local Graph** は選択中のノートを起点に、`depth`
|
|
25
|
+
- **Local Graph** は選択中のノートを起点に、`depth` で指定したホップ数までの隣接ノートを表示します。既定値は `depth: 1` で、Obsidian / Quartz と同じく直接の外向きリンクと被リンクを見る用途に合わせています。`depth: 0` では選択中のノートだけを表示します。
|
|
26
26
|
- **Global Graph** は現在の検索・タグ・フォルダー条件で絞り込まれた公開ノート全体と、その公開内部リンクを表示します。
|
|
27
27
|
|
|
28
|
-
操作感は Obsidian の Graph View
|
|
28
|
+
操作感は Obsidian の Graph View に寄せています。ただし、ブラウザで Vault を走査し直すことはありません。代わりに、Riebeckite の Page System、公開マニフェスト、パーマリンク、Content Graph をそのまま使います。
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## レイアウト
|
|
31
31
|
|
|
32
|
-
- **Force layout
|
|
33
|
-
- **Radial layout
|
|
32
|
+
- **Force レイアウト**(`layout: "force"`、既定): 小さな組み込み実装です。反発力、リンク距離、中心化、減衰、安定化を計算します。重い依存は追加していません。大きなグラフ(300 ノード以上)では Force レイアウトの計算時間が目立つようになり、ツールバーに警告が表示されます。大きな Global Graph には Radial レイアウトの使用を推奨します。500 ノード以上では、ユーザーの明示的な承認なしに Force レイアウトは実行されません。
|
|
33
|
+
- **Radial レイアウト**(`layout: "radial"`): 既存の Riebeckite の放射状レイアウトを使います。コンパクトで決定的な見た目にしたい場合に使えます。近似線形時間で動作し、数千ノードでも瞬時に描画できます。
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## 設定とページへの配置
|
|
36
36
|
|
|
37
37
|
```ts
|
|
38
38
|
import { defineConfig } from "@riebeckite/core";
|
|
39
|
-
import {
|
|
39
|
+
import { gardenExplorer } from "@riebeckite/plugin-garden-explorer";
|
|
40
40
|
|
|
41
41
|
export default defineConfig({
|
|
42
42
|
// ...
|
|
43
|
-
plugins: [
|
|
43
|
+
plugins: [gardenExplorer()],
|
|
44
44
|
});
|
|
45
45
|
```
|
|
46
46
|
|
|
@@ -48,7 +48,7 @@ export default defineConfig({
|
|
|
48
48
|
|
|
49
49
|
```ts
|
|
50
50
|
plugins: [
|
|
51
|
-
|
|
51
|
+
gardenExplorer({
|
|
52
52
|
layout: "force",
|
|
53
53
|
depth: 1,
|
|
54
54
|
showTags: true,
|
|
@@ -61,9 +61,9 @@ plugins: [
|
|
|
61
61
|
];
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
`
|
|
64
|
+
`gardenExplorer()` は `/explore` の Page Type、スタイル、クライアント側のハイドレーターを登録します。`resolveRiebeckiteRoute()` と `pluginPageSsgParams()` を使う共通 catch-all ルートが表示と SSG を担当します。そのため、プラグイン固有のルートは不要です。ページはまずサーバーで描画し、読み込み後に登録済みのクライアントエントリがグラフ、フィルター、URL 状態をハイドレーションします。
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
コンポーネントを別のサイトが用意するコンポーネントに埋め込む場合だけ、マニフェストから表示用データを作って渡します。
|
|
67
67
|
|
|
68
68
|
```tsx
|
|
69
69
|
import GardenExplorer, {
|
|
@@ -81,23 +81,23 @@ const data = getGardenExplorerData({
|
|
|
81
81
|
return <GardenExplorer data={data} />;
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
`GardenExplorer`
|
|
84
|
+
`GardenExplorer` はブラウザで操作するクライアントコンポーネントです。サーバー描画時にも、周辺の一覧・詳細パネルはセマンティックなリンク一覧として読み取れる構造を残します。
|
|
85
85
|
|
|
86
86
|
## データに含まれる範囲
|
|
87
87
|
|
|
88
|
-
`getGardenExplorerData()` は公開済みエントリーから、見出し、本文テキストの先頭 4,000
|
|
88
|
+
`getGardenExplorerData()` は公開済みエントリーから、見出し、本文テキストの先頭 4,000 文字、タグ、フォルダー、外向きリンク、被リンクを集めます。本文全体をクライアントへ渡さないため、検索用のデータ量を抑えられます。
|
|
89
89
|
|
|
90
|
-
- `notes`:
|
|
90
|
+
- `notes`: タイトル順の公開ノート。フォルダー、外向きリンク、被リンクを含む
|
|
91
91
|
- `edges`: 公開ノート間のグラフの辺
|
|
92
92
|
- `tags`: 件数の多い順のタグ
|
|
93
93
|
- `folders`: 名前順のフォルダー。ルート直下のノートは `Root`
|
|
94
|
-
- `options`:
|
|
94
|
+
- `options`: ハイドレーション後のコンポーネントが使う解決済みグラフ設定
|
|
95
95
|
|
|
96
96
|
探索画面の検索はプラグイン内で完結しており、`@riebeckite/plugin-search` は不要です。
|
|
97
97
|
|
|
98
98
|
## 主なエクスポート
|
|
99
99
|
|
|
100
|
-
- `
|
|
100
|
+
- `gardenExplorer(options?)`: プラグインを作成する
|
|
101
101
|
- `GardenExplorer`: 探索画面のコンポーネント
|
|
102
102
|
- `getGardenExplorerData({ manifest, config, resolveTitle, options? })`: 表示データを構築する
|
|
103
103
|
- 型: `GardenExplorerData`、`GardenExplorerEdge`、`GardenExplorerFolder`、`GardenExplorerGraphLayout`、`GardenExplorerGraphMode`、`GardenExplorerNote`、`GardenExplorerOptions`、`GardenExplorerPluginOptions`、`GardenExplorerTag`
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import type { GardenExplorerPluginOptions } from "./src/garden-explorer.js";
|
|
|
2
2
|
export { default as GardenExplorer } from "./components/garden-explorer.js";
|
|
3
3
|
export type { GardenExplorerData, GardenExplorerEdge, GardenExplorerFolder, GardenExplorerNote, GardenExplorerOptions, GardenExplorerPluginOptions, GardenExplorerTag, } from "./src/garden-explorer.js";
|
|
4
4
|
export { getGardenExplorerData } from "./src/garden-explorer.server.js";
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function gardenExplorer(options?: GardenExplorerPluginOptions): import("@riebeckite/core").RiebeckitePlugin<unknown>;
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
import { createClientEntry, definePlugin } from "@riebeckite/core";
|
|
3
3
|
|
|
4
4
|
// src/garden-explorer.server.ts
|
|
5
|
-
import {
|
|
6
|
-
buildGraphEdges
|
|
7
|
-
} from "@riebeckite/core";
|
|
5
|
+
import { buildGraphEdges } from "@riebeckite/core/client";
|
|
8
6
|
var MAX_BODY_LENGTH = 4e3;
|
|
9
7
|
function getGardenExplorerData(args) {
|
|
10
8
|
const graph = args.manifest.graph;
|
|
@@ -874,7 +872,7 @@ function renderGardenExplorerPage(data, siteTitle) {
|
|
|
874
872
|
}
|
|
875
873
|
|
|
876
874
|
// index.ts
|
|
877
|
-
function
|
|
875
|
+
function gardenExplorer(options = {}) {
|
|
878
876
|
return definePlugin({
|
|
879
877
|
name: "garden-explorer",
|
|
880
878
|
assets: [
|
|
@@ -920,6 +918,6 @@ function gardenExplorerPlugin(options = {}) {
|
|
|
920
918
|
}
|
|
921
919
|
export {
|
|
922
920
|
GardenExplorer,
|
|
923
|
-
|
|
921
|
+
gardenExplorer,
|
|
924
922
|
getGardenExplorerData
|
|
925
923
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphEdge } from "@riebeckite/core";
|
|
1
|
+
import type { GraphEdge } from "@riebeckite/core/client";
|
|
2
2
|
type GardenExplorerSearchFields = {
|
|
3
3
|
slug: string;
|
|
4
4
|
permalink: string;
|
|
@@ -15,7 +15,7 @@ export type GardenExplorerNote = GardenExplorerSearchFields & {
|
|
|
15
15
|
backlinks: string[];
|
|
16
16
|
};
|
|
17
17
|
export type GardenExplorerEdge = GraphEdge;
|
|
18
|
-
|
|
18
|
+
type GardenExplorerGraphLayout = "force" | "radial";
|
|
19
19
|
export type GardenExplorerGraphMode = "local" | "global";
|
|
20
20
|
export type GardenExplorerOptions = {
|
|
21
21
|
layout: GardenExplorerGraphLayout;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ContentManifest, ResolvedRiebeckiteConfig } from "@riebeckite/core";
|
|
2
2
|
import type { GardenExplorerData, GardenExplorerOptions, GardenExplorerPluginOptions } from "./garden-explorer.js";
|
|
3
3
|
type TitleResolver = (slug: string, title: unknown) => string;
|
|
4
4
|
export declare function getGardenExplorerData(args: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-garden-explorer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"./style.css": "./style.css"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"@riebeckite/core": "0.0.33",
|
|
31
|
+
"hono": "^4.12.25"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|