@tnotesjs/ui 0.1.0

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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -0
  3. package/package.json +68 -0
  4. package/src/components/BilibiliVideo/BilibiliVideo.vue +55 -0
  5. package/src/components/Footprints/Footprints.vue +339 -0
  6. package/src/components/Footprints/parse.ts +122 -0
  7. package/src/components/Mermaid/Mermaid.vue +553 -0
  8. package/src/components/Mermaid/icons/icon__center_off.svg +1 -0
  9. package/src/components/Mermaid/icons/icon__center_on.svg +1 -0
  10. package/src/components/Mermaid/icons/icon__check.svg +3 -0
  11. package/src/components/Mermaid/icons/icon__clipboard.svg +8 -0
  12. package/src/components/Mermaid/icons/icon__fullscreen.svg +1 -0
  13. package/src/components/Mermaid/icons/icon__fullscreen_exit.svg +1 -0
  14. package/src/components/Mindmap/FocusBreadcrumbs.test.ts +265 -0
  15. package/src/components/Mindmap/FocusBreadcrumbs.vue +436 -0
  16. package/src/components/Mindmap/InlineRuns.ts +25 -0
  17. package/src/components/Mindmap/Mindmap.vue +1210 -0
  18. package/src/components/Mindmap/MindmapOutlineNode.vue +62 -0
  19. package/src/components/Mindmap/MindmapViewIcon.vue +41 -0
  20. package/src/components/Mindmap/editor/AppIcon.vue +107 -0
  21. package/src/components/Mindmap/editor/CanvasContextMenu.vue +157 -0
  22. package/src/components/Mindmap/editor/LinkPopover.vue +83 -0
  23. package/src/components/Mindmap/editor/MarkdownView.vue +163 -0
  24. package/src/components/Mindmap/editor/MindmapView.vue +253 -0
  25. package/src/components/Mindmap/editor/OutlineView.vue +2494 -0
  26. package/src/components/Mindmap/editor/RichInlineEditor.vue +393 -0
  27. package/src/components/Mindmap/editor/SelectionToolbar.vue +191 -0
  28. package/src/components/Mindmap/editor/canvasClipboard.ts +6 -0
  29. package/src/components/Mindmap/editor/imagePaste.ts +32 -0
  30. package/src/components/Mindmap/editor/mindmapClipboard.ts +93 -0
  31. package/src/components/Mindmap/editor/outlineDrag.ts +29 -0
  32. package/src/components/Mindmap/editor/platform.ts +18 -0
  33. package/src/components/Mindmap/expandLevel.ts +28 -0
  34. package/src/components/Mindmap/icons/icon__fullscreen.svg +1 -0
  35. package/src/components/Mindmap/icons/icon__fullscreen_exit.svg +1 -0
  36. package/src/components/Mindmap/icons/icon__zoom_fit.svg +1 -0
  37. package/src/components/Mindmap/markdown.ts +83 -0
  38. package/src/components/Mindmap/wheelInteraction.ts +7 -0
  39. package/src/components/NotesTable/NotesTable.vue +119 -0
  40. package/src/components/NotesTable/types.ts +6 -0
  41. package/src/components/WordList/RightClickMenu.vue +106 -0
  42. package/src/components/WordList/WordList.vue +692 -0
  43. package/src/components/WordList/wordListFeatures.ts +38 -0
  44. package/src/index.ts +30 -0
  45. package/src/styles/tokens.css +35 -0
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Capability flags for WordList. Defaults are full (web / core).
3
+ * Hosts that need a quieter preview (e.g. Desk) pass WORD_LIST_FEATURES_STATIC.
4
+ */
5
+ export interface WordListFeatures {
6
+ /** Hover / pinned definition cards. */
7
+ enableCards: boolean
8
+ /** Fetch & preload dictionary markdown for cards / failed-word styling. */
9
+ enableWordData: boolean
10
+ /** Context-menu "Pin". */
11
+ enableContextMenuPin: boolean
12
+ /** Context-menu "Auto Show Card". */
13
+ enableContextMenuAutoShowCard: boolean
14
+ }
15
+
16
+ export const WORD_LIST_FEATURES_FULL: Readonly<WordListFeatures> = Object.freeze({
17
+ enableCards: true,
18
+ enableWordData: true,
19
+ enableContextMenuPin: true,
20
+ enableContextMenuAutoShowCard: true
21
+ })
22
+
23
+ /** Preview-safe preset: list + check + pronounce; no cards / network / pin / auto-card. */
24
+ export const WORD_LIST_FEATURES_STATIC: Readonly<WordListFeatures> = Object.freeze({
25
+ enableCards: false,
26
+ enableWordData: false,
27
+ enableContextMenuPin: false,
28
+ enableContextMenuAutoShowCard: false
29
+ })
30
+
31
+ export function resolveWordListFeatures(
32
+ partial?: Partial<WordListFeatures> | null
33
+ ): WordListFeatures {
34
+ return {
35
+ ...WORD_LIST_FEATURES_FULL,
36
+ ...(partial ?? {})
37
+ }
38
+ }
package/src/index.ts ADDED
@@ -0,0 +1,30 @@
1
+ export { default as BilibiliVideo } from './components/BilibiliVideo/BilibiliVideo.vue'
2
+ export { default as WordList } from './components/WordList/WordList.vue'
3
+ export { default as Mermaid } from './components/Mermaid/Mermaid.vue'
4
+ export { default as Mindmap } from './components/Mindmap/Mindmap.vue'
5
+ export { default as FocusBreadcrumbs } from './components/Mindmap/FocusBreadcrumbs.vue'
6
+ export { default as NotesTable } from './components/NotesTable/NotesTable.vue'
7
+ export { default as Footprints } from './components/Footprints/Footprints.vue'
8
+ export {
9
+ WORD_LIST_FEATURES_FULL,
10
+ WORD_LIST_FEATURES_STATIC,
11
+ resolveWordListFeatures
12
+ } from './components/WordList/wordListFeatures'
13
+ export type { WordListFeatures } from './components/WordList/wordListFeatures'
14
+ export {
15
+ normalizeMindmapMarkdown,
16
+ parseMindmapFence,
17
+ parseMindmapReference
18
+ } from './components/Mindmap/markdown'
19
+ export type {
20
+ MindmapFenceOptions,
21
+ MindmapReference,
22
+ NormalizeMindmapOptions
23
+ } from './components/Mindmap/markdown'
24
+ export type { NotesTableRow } from './components/NotesTable/types'
25
+ export {
26
+ parseFootprintsSource,
27
+ rebuildFootprintsSource,
28
+ parseFootprintsDatetime
29
+ } from './components/Footprints/parse'
30
+ export type { FootprintsPayload } from './components/Footprints/parse'
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Host-neutral design tokens for @tnotesjs/ui.
3
+ * VitePress themes should alias these to --vp-*; Desk aliases to --editor-*.
4
+ */
5
+ :root {
6
+ --tn-c-brand: #3451b2;
7
+ --tn-c-text: #213547;
8
+ --tn-c-text-2: #476582;
9
+ --tn-c-bg: #ffffff;
10
+ --tn-c-bg-soft: #f6f6f7;
11
+ --tn-c-bg-elv: #ffffff;
12
+ --tn-c-divider: #e2e2e3;
13
+ --tn-c-danger: #cb2a2a;
14
+ --tn-c-success-soft: #e3f9e5;
15
+ --tn-c-danger-soft: #fde8e8;
16
+ --tn-c-default-soft: #e8e8e9;
17
+ --tn-shadow-2: 0 4px 12px rgba(0, 0, 0, 0.12);
18
+ --tn-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
19
+ }
20
+
21
+ html.dark,
22
+ html[data-theme='dark'] {
23
+ --tn-c-brand: #a8b1ff;
24
+ --tn-c-text: #dfdfd6;
25
+ --tn-c-text-2: #98989f;
26
+ --tn-c-bg: #1b1b1f;
27
+ --tn-c-bg-soft: #161618;
28
+ --tn-c-bg-elv: #202127;
29
+ --tn-c-divider: #2e2e32;
30
+ --tn-c-danger: #f66f81;
31
+ --tn-c-success-soft: #1c3b2a;
32
+ --tn-c-danger-soft: #3b1c1c;
33
+ --tn-c-default-soft: #2e2e32;
34
+ --tn-shadow-2: 0 4px 12px rgba(0, 0, 0, 0.45);
35
+ }