@terrafirmagreg-team/ui 0.1.0 → 1.2.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.
- package/package.json +14 -14
- package/src/components/blocks/button/icon-button.tsx +1 -0
- package/src/components/blocks/canvas/chevron-edge.tsx +126 -18
- package/src/components/blocks/canvas/flow-canvas.tsx +4 -0
- package/src/components/blocks/canvas/flow-toolbar.tsx +1 -0
- package/src/components/blocks/canvas/flow-viewport.tsx +1 -0
- package/src/components/blocks/fit-box.tsx +26 -0
- package/src/components/blocks/git/github-info.tsx +1 -0
- package/src/components/blocks/lang/content.tsx +40 -10
- package/src/components/blocks/lang/flag.tsx +1 -0
- package/src/components/blocks/lang/link.tsx +1 -0
- package/src/components/blocks/lang/redirect.tsx +2 -1
- package/src/components/blocks/lang/switcher.tsx +1 -0
- package/src/components/blocks/lang/untranslated-callout.tsx +4 -3
- package/src/components/blocks/lang/untranslated-chip.tsx +53 -0
- package/src/components/blocks/link/link-preview.tsx +2 -1
- package/src/components/blocks/list/row.tsx +1 -0
- package/src/components/blocks/media/glb/model.tsx +1 -0
- package/src/components/blocks/media/glb/scene.tsx +13 -12
- package/src/components/blocks/media/glb/viewer.tsx +1 -0
- package/src/components/blocks/media/image.tsx +3 -2
- package/src/components/blocks/media/slideshow.tsx +4 -3
- package/src/components/blocks/nav/breadcrumb.tsx +1 -0
- package/src/components/blocks/nav/copy-menu.tsx +37 -0
- package/src/components/blocks/nav/link.tsx +1 -0
- package/src/components/blocks/nav/site-menu.tsx +1 -0
- package/src/components/blocks/nav/site-title.tsx +1 -0
- package/src/components/blocks/nav/switcher.tsx +1 -0
- package/src/components/blocks/page/empty-state.tsx +1 -0
- package/src/components/blocks/page/heading.tsx +3 -2
- package/src/components/blocks/page/pager.tsx +110 -2
- package/src/components/blocks/readability/fields.tsx +250 -0
- package/src/components/blocks/readability/menu.tsx +74 -258
- package/src/components/blocks/readability/track.tsx +2 -1
- package/src/components/blocks/search/command.tsx +1 -0
- package/src/components/blocks/search/dialog.tsx +21 -9
- package/src/components/blocks/search/provider.tsx +2 -1
- package/src/components/blocks/sidebar.tsx +5 -5
- package/src/components/blocks/sprite.tsx +231 -0
- package/src/components/blocks/text/format-text.tsx +110 -0
- package/src/components/blocks/theme/toggle.tsx +4 -0
- package/src/components/blocks/tooltip/hint.tsx +1 -0
- package/src/components/blocks/tooltip/lazy.tsx +41 -0
- package/src/components/blocks/viewer/controls.tsx +11 -6
- package/src/components/blocks/viewer/float-bar.tsx +1 -0
- package/src/components/layouts/layout.tsx +2 -1
- package/src/components/layouts/left-sidebar/content.tsx +1 -0
- package/src/components/layouts/left-sidebar/context.tsx +1 -0
- package/src/components/layouts/left-sidebar/expand.tsx +2 -1
- package/src/components/layouts/left-sidebar/footer.tsx +10 -4
- package/src/components/layouts/left-sidebar/index.ts +1 -0
- package/src/components/layouts/left-sidebar/items.tsx +2 -1
- package/src/components/layouts/left-sidebar/search.tsx +4 -3
- package/src/components/layouts/left-sidebar/sidebar.tsx +3 -2
- package/src/components/layouts/left-sidebar/tree.tsx +1 -0
- package/src/components/layouts/right-sidebar.tsx +1 -0
- package/src/components/layouts/tree-context.tsx +1 -0
- package/src/components/mdx/accordion.tsx +3 -2
- package/src/components/mdx/banner.tsx +15 -12
- package/src/components/mdx/callout.tsx +1 -0
- package/src/components/mdx/card.tsx +12 -5
- package/src/components/mdx/codeblock.tsx +5 -4
- package/src/components/mdx/collapsible.tsx +1 -0
- package/src/components/mdx/files.tsx +1 -0
- package/src/components/mdx/glow-header.tsx +17 -3
- package/src/components/mdx/gradient-text.tsx +1 -0
- package/src/components/mdx/icon.tsx +35 -0
- package/src/components/mdx/image-zoom.tsx +5 -4
- package/src/components/mdx/math.tsx +30 -0
- package/src/components/mdx/mermaid.tsx +8 -1
- package/src/components/mdx/multiblock.tsx +1 -0
- package/src/components/mdx/preview.tsx +2 -1
- package/src/components/mdx/steps.tsx +1 -0
- package/src/components/mdx/table.tsx +1 -0
- package/src/components/mdx/tabs.tsx +2 -1
- package/src/components/mdx/type-table.tsx +7 -6
- package/src/{provider.tsx → components/provider.tsx} +1 -3
- package/src/hooks/canvas/use-flow-hover.ts +1 -0
- package/src/hooks/canvas/use-flow-viewport-persist.ts +1 -0
- package/src/hooks/page/use-fit-pages.ts +1 -0
- package/src/hooks/page/use-location-search.ts +8 -2
- package/src/hooks/page/use-page-preview.ts +2 -1
- package/src/hooks/page/use-paged-list.ts +1 -0
- package/src/hooks/readability/{provider.ts → use-readability.ts} +1 -0
- package/src/hooks/search/{dialog.ts → use-dialog.ts} +1 -0
- package/src/hooks/search/use-highlight-query.ts +8 -1
- package/src/hooks/search/{provider.ts → use-provider.ts} +1 -0
- package/src/hooks/use-async-value.ts +6 -3
- package/src/hooks/use-close-on-scroll.ts +1 -0
- package/src/hooks/use-copy-button.ts +1 -0
- package/src/hooks/use-cycle-index.ts +1 -0
- package/src/hooks/use-document-title.ts +1 -0
- package/src/hooks/use-element-size.ts +1 -0
- package/src/hooks/use-external-meta.ts +2 -1
- package/src/hooks/use-hot-key.ts +1 -0
- package/src/hooks/use-hover-follow.ts +1 -0
- package/src/hooks/use-in-view.ts +1 -0
- package/src/hooks/{lang.ts → use-lang.ts} +1 -0
- package/src/hooks/use-last-value.ts +1 -0
- package/src/hooks/{layout.ts → use-layout.ts} +1 -0
- package/src/hooks/use-marquee.ts +1 -0
- package/src/hooks/use-media-query.ts +1 -0
- package/src/hooks/use-mobile.ts +1 -0
- package/src/hooks/use-modifier-keys.ts +1 -0
- package/src/hooks/use-on-change.ts +1 -0
- package/src/hooks/use-pane-keys.ts +1 -0
- package/src/hooks/{sidebar.ts → use-sidebar.ts} +1 -0
- package/src/hooks/use-swipe.ts +1 -0
- package/src/hooks/use-tree.ts +1 -3
- package/src/hooks/viewer/use-in-float-bar.ts +1 -0
- package/src/hooks/viewer/use-viewer-prefs.ts +1 -0
- package/src/lib/canvas/edge.ts +78 -49
- package/src/lib/canvas/geometry.ts +1 -0
- package/src/lib/canvas/state.ts +1 -0
- package/src/lib/canvas/viewport.ts +1 -0
- package/src/lib/canvas/xyflow.ts +1 -0
- package/src/lib/config.ts +25 -0
- package/src/lib/mdx/callout.ts +1 -0
- package/src/lib/mdx/gradient.ts +1 -0
- package/src/lib/mdx/mermaid.ts +1 -0
- package/src/lib/media/crop-opaque.ts +1 -0
- package/src/lib/media/nearby-indexes.ts +1 -0
- package/src/lib/media/trim-transparent.ts +1 -0
- package/src/lib/readability/config.ts +1 -0
- package/src/lib/readability/spotlight.ts +1 -0
- package/src/lib/readability/store.ts +1 -0
- package/src/lib/tree.ts +1 -3
- package/src/lib/utils/cn.ts +1 -0
- package/src/lib/utils/format.ts +3 -3
- package/src/lib/utils/highlight-style.ts +10 -0
- package/src/lib/utils/history.ts +1 -0
- package/src/lib/utils/merge-refs.ts +1 -0
- package/src/lib/utils/nav-active.ts +1 -0
- package/src/lib/utils/stored-value.ts +1 -0
- package/src/lib/utils/urls.ts +2 -1
- package/src/locales/en_us.json +108 -117
- package/src/locales/pl_pl.json +33 -35
- package/src/locales/ru_ru.json +108 -117
- package/src/locales/uk_ua.json +33 -35
- package/src/locales/zh_cn.json +15 -17
- package/src/locales/zh_tw.json +15 -17
- package/src/locales.ts +1 -0
- package/src/types/canvas.ts +6 -1
- package/src/types/glb.ts +1 -0
- package/src/types/mdx-directives.ts +106 -0
- package/src/types/nav.ts +1 -0
- package/src/types/preview.ts +7 -1
- package/src/types/readability.ts +1 -0
- package/src/types/search.ts +1 -0
- package/src/types/tree.ts +1 -0
- package/src/types/viewer.ts +1 -0
- package/styles/content/base.css +198 -194
- package/styles/content/shiki.css +107 -108
- package/styles/content/typography.mjs +3637 -3941
- package/styles/content.css +5 -7
- package/styles.css +430 -413
- package/src/lib/utils/async-cache.ts +0 -32
package/src/locales/uk_ua.json
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"ui":
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"Close Banner(ui.banner_close)": "Закрити банер",
|
|
3
|
+
"Close Search(ui.search_close)": "Закрити пошук",
|
|
4
|
+
"Close Sidebar(ui.sidebar_close)": "Закрити панель",
|
|
5
|
+
"Close(ui.close)": "Закрити",
|
|
6
|
+
"Collapse Sidebar(ui.sidebar_collapse)": "Згорнути панель",
|
|
7
|
+
"Copied Anchor Link(ui.copied_anchor)": "Посилання на заголовок скопійовано",
|
|
8
|
+
"Copied Link(ui.copied_link)": "Посилання скопійовано",
|
|
9
|
+
"Copied Text(ui.copied_text)": "Текст скопійовано",
|
|
10
|
+
"Copy Anchor Link(ui.copy_anchor)": "Скопіювати посилання на заголовок",
|
|
11
|
+
"Copy Link(ui.copy_link)": "Копіювати посилання",
|
|
12
|
+
"Copy Text(ui.copy_text)": "Копіювати текст",
|
|
13
|
+
"Dark(ui.theme_dark)": "Темна",
|
|
14
|
+
"Default(ui.default)": "За замовчуванням",
|
|
15
|
+
"Image Viewer(ui.image_viewer)": "Перегляд зображення",
|
|
16
|
+
"Light(ui.theme_light)": "Світла",
|
|
17
|
+
"Next Image(ui.next_image)": "Наступне зображення",
|
|
18
|
+
"No Headings(ui.no_headings)": "Немає заголовків",
|
|
19
|
+
"No results found(ui.search_empty)": "Нічого не знайдено",
|
|
20
|
+
"Open Search(ui.open_search)": "Відкрити пошук",
|
|
21
|
+
"Open Sidebar(ui.sidebar_open)": "Відкрити панель",
|
|
22
|
+
"Parameters(ui.parameters)": "Параметри",
|
|
23
|
+
"Previous Image(ui.prev_image)": "Попереднє зображення",
|
|
24
|
+
"Prop(ui.prop)": "Властивість",
|
|
25
|
+
"Returns(ui.returns)": "Повертає",
|
|
26
|
+
"Search failed(ui.search_failed)": "Пошук не вдався",
|
|
27
|
+
"Search failed, showing results for {query}(ui.search_failed_results)": "Пошук не вдався, результати для {query}",
|
|
28
|
+
"Search(ui.search_dialog)": "Пошук",
|
|
29
|
+
"Search(ui.search_trigger)": "Пошук",
|
|
30
|
+
"System(ui.theme_system)": "Системна",
|
|
31
|
+
"Toggle Menu(ui.menu_toggle)": "Перемкнути меню",
|
|
32
|
+
"Type(ui.type)": "Тип"
|
|
33
|
+
}
|
package/src/locales/zh_cn.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"ui":
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"Close Search(ui.search_close)": "Close Search",
|
|
3
|
+
"Close Sidebar(ui.sidebar_close)": "Close Sidebar",
|
|
4
|
+
"Collapse Sidebar(ui.sidebar_collapse)": "Collapse Sidebar",
|
|
5
|
+
"Copied Anchor Link(ui.copied_anchor)": "Copied Anchor Link",
|
|
6
|
+
"Copy Anchor Link(ui.copy_anchor)": "Copy Anchor Link",
|
|
7
|
+
"No Headings(ui.no_headings)": "No Headings",
|
|
8
|
+
"No results found(ui.search_empty)": "未找到结果",
|
|
9
|
+
"Open Search(ui.open_search)": "打开搜索",
|
|
10
|
+
"Open Sidebar(ui.sidebar_open)": "Open Sidebar",
|
|
11
|
+
"Search failed(ui.search_failed)": "Search failed",
|
|
12
|
+
"Search failed, showing results for {query}(ui.search_failed_results)": "Search failed, showing results for {query}",
|
|
13
|
+
"Search(ui.search_dialog)": "搜索",
|
|
14
|
+
"Search(ui.search_trigger)": "搜索"
|
|
15
|
+
}
|
package/src/locales/zh_tw.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"ui":
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"Close Search(ui.search_close)": "Close Search",
|
|
3
|
+
"Close Sidebar(ui.sidebar_close)": "Close Sidebar",
|
|
4
|
+
"Collapse Sidebar(ui.sidebar_collapse)": "Collapse Sidebar",
|
|
5
|
+
"Copied Anchor Link(ui.copied_anchor)": "Copied Anchor Link",
|
|
6
|
+
"Copy Anchor Link(ui.copy_anchor)": "Copy Anchor Link",
|
|
7
|
+
"No Headings(ui.no_headings)": "No Headings",
|
|
8
|
+
"No results found(ui.search_empty)": "找不到結果",
|
|
9
|
+
"Open Search(ui.open_search)": "開啟搜尋",
|
|
10
|
+
"Open Sidebar(ui.sidebar_open)": "Open Sidebar",
|
|
11
|
+
"Search failed(ui.search_failed)": "Search failed",
|
|
12
|
+
"Search failed, showing results for {query}(ui.search_failed_results)": "Search failed, showing results for {query}",
|
|
13
|
+
"Search(ui.search_dialog)": "搜尋",
|
|
14
|
+
"Search(ui.search_trigger)": "搜尋"
|
|
15
|
+
}
|
package/src/locales.ts
CHANGED
package/src/types/canvas.ts
CHANGED
|
@@ -17,7 +17,11 @@ export type FlowSizedNode = {
|
|
|
17
17
|
|
|
18
18
|
export type StoredViewport = { x: number; y: number; zoom: number };
|
|
19
19
|
|
|
20
|
-
export type ChevronEdgeHighlight =
|
|
20
|
+
export type ChevronEdgeHighlight =
|
|
21
|
+
| 'incoming'
|
|
22
|
+
| 'outgoing'
|
|
23
|
+
| 'dim'
|
|
24
|
+
| undefined;
|
|
21
25
|
|
|
22
26
|
export type FlowHoverValue = {
|
|
23
27
|
id: string | null;
|
|
@@ -47,3 +51,4 @@ export type FlowToolbarProps = {
|
|
|
47
51
|
onFit?: () => void;
|
|
48
52
|
search?: { label: string; onOpen: () => void };
|
|
49
53
|
};
|
|
54
|
+
|
package/src/types/glb.ts
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { CalloutType } from '@terrafirmagreg-team/ui/components/mdx/callout';
|
|
2
|
+
|
|
3
|
+
export type IconDirectiveProps = {
|
|
4
|
+
name: string;
|
|
5
|
+
size?: number | string;
|
|
6
|
+
color?: string;
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type GradientDirectiveProps = {
|
|
12
|
+
from?: string;
|
|
13
|
+
to?: string;
|
|
14
|
+
dir?: string;
|
|
15
|
+
image?: string;
|
|
16
|
+
children: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type GlowDirectiveProps = {
|
|
21
|
+
from?: string;
|
|
22
|
+
to?: string;
|
|
23
|
+
dir?: string;
|
|
24
|
+
image?: string;
|
|
25
|
+
gradient?: boolean;
|
|
26
|
+
fade?: boolean;
|
|
27
|
+
children: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type CalloutDirectiveProps = {
|
|
32
|
+
type?: CalloutType;
|
|
33
|
+
title?: string;
|
|
34
|
+
children: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type CardDirectiveProps = {
|
|
39
|
+
title?: string;
|
|
40
|
+
icon?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
href?: string;
|
|
43
|
+
external?: boolean;
|
|
44
|
+
children?: string;
|
|
45
|
+
className?: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type BannerDirectiveProps = {
|
|
49
|
+
id?: string;
|
|
50
|
+
height?: string;
|
|
51
|
+
variant?: 'rainbow' | 'normal';
|
|
52
|
+
rainbowColors?: string[];
|
|
53
|
+
changeLayout?: boolean;
|
|
54
|
+
children?: string;
|
|
55
|
+
className?: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type TabsDirectiveProps = {
|
|
59
|
+
items?: string[];
|
|
60
|
+
defaultIndex?: number;
|
|
61
|
+
label?: string;
|
|
62
|
+
children: string;
|
|
63
|
+
className?: string;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type AccordionsDirectiveProps = {
|
|
67
|
+
multiple?: boolean;
|
|
68
|
+
defaultValue?: string | string[];
|
|
69
|
+
children: string;
|
|
70
|
+
className?: string;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type StepsDirectiveProps = {
|
|
74
|
+
children: string;
|
|
75
|
+
className?: string;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type FilesDirectiveProps = {
|
|
79
|
+
children: string;
|
|
80
|
+
className?: string;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type CodeFenceMetaProps = {
|
|
84
|
+
title?: string;
|
|
85
|
+
lineNumbers?: boolean;
|
|
86
|
+
tab?: string;
|
|
87
|
+
noCopy?: boolean;
|
|
88
|
+
twoslash?: boolean;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type MermaidDirectiveProps = {
|
|
92
|
+
chart: string;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type MathDirectiveProps = {
|
|
96
|
+
children: string;
|
|
97
|
+
block?: boolean;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type TypeTableDirectiveProps = {
|
|
101
|
+
path?: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
type?: string;
|
|
104
|
+
cwd?: boolean;
|
|
105
|
+
};
|
|
106
|
+
|
package/src/types/nav.ts
CHANGED
package/src/types/preview.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
export type PreviewIcon =
|
|
2
2
|
| { type: 'icon'; name: string }
|
|
3
|
-
| {
|
|
3
|
+
| {
|
|
4
|
+
type: 'entry';
|
|
5
|
+
kind: string;
|
|
6
|
+
id: string;
|
|
7
|
+
dataset?: { id: string; version?: string };
|
|
8
|
+
};
|
|
4
9
|
|
|
5
10
|
export type PagePreviewData = {
|
|
6
11
|
title: string;
|
|
7
12
|
description?: string;
|
|
8
13
|
icon?: PreviewIcon;
|
|
9
14
|
};
|
|
15
|
+
|
package/src/types/readability.ts
CHANGED
package/src/types/search.ts
CHANGED
package/src/types/tree.ts
CHANGED
package/src/types/viewer.ts
CHANGED