@ng-doc/app 22.1.0 → 22.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/LICENSE +21 -0
- package/fesm2022/ng-doc-app-classes-content-controller.mjs +22 -4
- package/fesm2022/ng-doc-app-classes-content-controller.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +36 -12
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-api-list.mjs +7 -5
- package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs +5 -3
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-code.mjs +6 -4
- package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-command-palette.mjs +35 -27
- package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-copy-button.mjs +6 -4
- package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs +19 -4
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-frame.mjs +195 -12
- package/fesm2022/ng-doc-app-components-demo-frame.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-pane.mjs +2 -2
- package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo.mjs +49 -12
- package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +5 -3
- package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +4 -2
- package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs +5 -3
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-image-viewer.mjs +5 -3
- package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-navbar.mjs +4 -2
- package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-navigation.mjs +5 -3
- package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs +2 -2
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page.mjs +83 -16
- package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-playground.mjs +743 -108
- package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-root.mjs +51 -4
- package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search-result.mjs +8 -6
- package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search.mjs +7 -5
- package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-sidebar.mjs +4 -3
- package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs +7 -5
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-toc.mjs +4 -2
- package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
- package/fesm2022/ng-doc-app-constants.mjs +11 -1
- package/fesm2022/ng-doc-app-constants.mjs.map +1 -1
- package/fesm2022/ng-doc-app-demo-app.mjs +618 -15
- package/fesm2022/ng-doc-app-demo-app.mjs.map +1 -1
- package/fesm2022/ng-doc-app-helpers.mjs +125 -6
- package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +29 -18
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-texts.mjs +53 -0
- package/fesm2022/ng-doc-app-providers-texts.mjs.map +1 -0
- package/fesm2022/ng-doc-app-providers.mjs +1 -0
- package/fesm2022/ng-doc-app-providers.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +27 -2
- package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-highlighter.mjs +8 -5
- package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-shortcuts.mjs +38 -4
- package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -1
- package/fesm2022/ng-doc-app-texts-ar.mjs +238 -0
- package/fesm2022/ng-doc-app-texts-ar.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-de.mjs +205 -0
- package/fesm2022/ng-doc-app-texts-de.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-es.mjs +205 -0
- package/fesm2022/ng-doc-app-texts-es.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-fr.mjs +205 -0
- package/fesm2022/ng-doc-app-texts-fr.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-hi.mjs +219 -0
- package/fesm2022/ng-doc-app-texts-hi.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-ja.mjs +205 -0
- package/fesm2022/ng-doc-app-texts-ja.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-ko.mjs +205 -0
- package/fesm2022/ng-doc-app-texts-ko.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-pt-br.mjs +205 -0
- package/fesm2022/ng-doc-app-texts-pt-br.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-ru.mjs +231 -0
- package/fesm2022/ng-doc-app-texts-ru.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-uk.mjs +231 -0
- package/fesm2022/ng-doc-app-texts-uk.mjs.map +1 -0
- package/fesm2022/ng-doc-app-texts-zh.mjs +205 -0
- package/fesm2022/ng-doc-app-texts-zh.mjs.map +1 -0
- package/fesm2022/ng-doc-app-tokens.mjs +214 -1
- package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-json-control.mjs +90 -0
- package/fesm2022/ng-doc-app-type-controls-json-control.mjs.map +1 -0
- package/fesm2022/ng-doc-app-type-controls-list-control.mjs +792 -0
- package/fesm2022/ng-doc-app-type-controls-list-control.mjs.map +1 -0
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +5 -3
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls.mjs +2 -0
- package/fesm2022/ng-doc-app-type-controls.mjs.map +1 -1
- package/package.json +59 -3
- package/styles/global.css +1 -0
- package/styles/main.css +1 -0
- package/types/ng-doc-app-classes-default-search-engine.d.ts +11 -0
- package/types/ng-doc-app-classes-root-page.d.ts +5 -0
- package/types/ng-doc-app-components-api-list.d.ts +3 -1
- package/types/ng-doc-app-components-breadcrumb.d.ts +2 -1
- package/types/ng-doc-app-components-code.d.ts +2 -0
- package/types/ng-doc-app-components-command-palette.d.ts +3 -1
- package/types/ng-doc-app-components-copy-button.d.ts +3 -1
- package/types/ng-doc-app-components-demo-displayer.d.ts +13 -1
- package/types/ng-doc-app-components-demo-frame.d.ts +62 -3
- package/types/ng-doc-app-components-demo.d.ts +27 -8
- package/types/ng-doc-app-components-fullscreen-button.d.ts +2 -0
- package/types/ng-doc-app-components-fullscreen-toggle.d.ts +2 -0
- package/types/ng-doc-app-components-heading-anchor.d.ts +2 -0
- package/types/ng-doc-app-components-image-viewer.d.ts +2 -0
- package/types/ng-doc-app-components-navbar.d.ts +2 -0
- package/types/ng-doc-app-components-page-navigation.d.ts +2 -1
- package/types/ng-doc-app-components-page.d.ts +10 -1
- package/types/ng-doc-app-components-playground.d.ts +241 -44
- package/types/ng-doc-app-components-root.d.ts +18 -0
- package/types/ng-doc-app-components-search-result.d.ts +2 -0
- package/types/ng-doc-app-components-search.d.ts +2 -0
- package/types/ng-doc-app-components-sidebar.d.ts +2 -1
- package/types/ng-doc-app-components-theme-toggle.d.ts +4 -1
- package/types/ng-doc-app-components-toc.d.ts +2 -1
- package/types/ng-doc-app-constants.d.ts +11 -1
- package/types/ng-doc-app-demo-app.d.ts +211 -3
- package/types/ng-doc-app-helpers.d.ts +56 -3
- package/types/ng-doc-app-interfaces.d.ts +621 -3
- package/types/ng-doc-app-providers-ng-doc-app.d.ts +6 -0
- package/types/ng-doc-app-providers-texts.d.ts +28 -0
- package/types/ng-doc-app-providers.d.ts +1 -0
- package/types/ng-doc-app-services-content-scroll-intent.d.ts +11 -1
- package/types/ng-doc-app-services-highlighter.d.ts +3 -1
- package/types/ng-doc-app-services-shortcuts.d.ts +16 -0
- package/types/ng-doc-app-texts-ar.d.ts +13 -0
- package/types/ng-doc-app-texts-de.d.ts +12 -0
- package/types/ng-doc-app-texts-es.d.ts +12 -0
- package/types/ng-doc-app-texts-fr.d.ts +12 -0
- package/types/ng-doc-app-texts-hi.d.ts +12 -0
- package/types/ng-doc-app-texts-ja.d.ts +12 -0
- package/types/ng-doc-app-texts-ko.d.ts +12 -0
- package/types/ng-doc-app-texts-pt-br.d.ts +12 -0
- package/types/ng-doc-app-texts-ru.d.ts +12 -0
- package/types/ng-doc-app-texts-uk.d.ts +12 -0
- package/types/ng-doc-app-texts-zh.d.ts +12 -0
- package/types/ng-doc-app-tokens.d.ts +21 -2
- package/types/ng-doc-app-type-controls-json-control.d.ts +38 -0
- package/types/ng-doc-app-type-controls-list-control.d.ts +313 -0
- package/types/ng-doc-app-type-controls-type-alias-control.d.ts +2 -1
- package/types/ng-doc-app-type-controls.d.ts +2 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Simplified Chinese texts of NgDoc, for `provideNgDocTexts(NG_DOC_TEXTS_ZH)`. Pass your own
|
|
3
|
+
* changes after them: `provideNgDocTexts(NG_DOC_TEXTS_ZH, { search: { placeholder: '…' } })`.
|
|
4
|
+
*
|
|
5
|
+
* These translations welcome corrections: open an issue or a pull request at
|
|
6
|
+
* https://github.com/ng-doc/ng-doc that names the text (its group and key) and your wording.
|
|
7
|
+
*/
|
|
8
|
+
const NG_DOC_TEXTS_ZH = Object.freeze({
|
|
9
|
+
blockquote: Object.freeze({
|
|
10
|
+
note: '备注',
|
|
11
|
+
warning: '警告',
|
|
12
|
+
alert: '危险',
|
|
13
|
+
success: '成功',
|
|
14
|
+
}),
|
|
15
|
+
pane: Object.freeze({
|
|
16
|
+
resizer: '调整窗格大小',
|
|
17
|
+
}),
|
|
18
|
+
combobox: Object.freeze({
|
|
19
|
+
placeholder: '选择值',
|
|
20
|
+
}),
|
|
21
|
+
search: Object.freeze({
|
|
22
|
+
placeholder: '搜索文档…',
|
|
23
|
+
label: ({ shortcut }) => `搜索(${shortcut})`,
|
|
24
|
+
shortcutMac: '⌘K',
|
|
25
|
+
shortcutOther: 'Ctrl K',
|
|
26
|
+
resultGuides: '指南',
|
|
27
|
+
resultApi: 'API',
|
|
28
|
+
resultUnknown: '未知',
|
|
29
|
+
nothingFound: '未找到任何结果…',
|
|
30
|
+
}),
|
|
31
|
+
searchPalette: Object.freeze({
|
|
32
|
+
dialogLabel: '搜索',
|
|
33
|
+
inputLabel: '搜索文档',
|
|
34
|
+
inputPlaceholder: '搜索指南、API 和操作…',
|
|
35
|
+
scopesLabel: '搜索范围',
|
|
36
|
+
scopeAll: '全部',
|
|
37
|
+
scopeGuides: '指南',
|
|
38
|
+
scopeApi: 'API',
|
|
39
|
+
scopeActions: '操作',
|
|
40
|
+
resultsLabel: '结果',
|
|
41
|
+
sectionTopMatches: '最佳匹配',
|
|
42
|
+
sectionGuides: '指南',
|
|
43
|
+
sectionApi: 'API',
|
|
44
|
+
sectionActions: '操作',
|
|
45
|
+
searching: '正在搜索…',
|
|
46
|
+
failed: '搜索失败,请重试。',
|
|
47
|
+
failedStatus: '搜索失败。',
|
|
48
|
+
noResults: ({ query }) => `未找到“${query}”的结果`,
|
|
49
|
+
typeToSearch: '输入内容以搜索。',
|
|
50
|
+
typeToSearchGuides: '输入内容以搜索指南。',
|
|
51
|
+
typeToSearchApi: '输入内容以搜索 API。',
|
|
52
|
+
typeApi: 'API',
|
|
53
|
+
typeGuide: '指南',
|
|
54
|
+
typeAction: '操作',
|
|
55
|
+
actionKeepsOpen: '更改设置并保持搜索打开。',
|
|
56
|
+
actionRunsImmediately: '立即执行。',
|
|
57
|
+
shortcut: '快捷键',
|
|
58
|
+
openSymbolPage: '打开符号页面',
|
|
59
|
+
open: '打开',
|
|
60
|
+
statusScope: ({ scope }) => `范围:${scope}。`,
|
|
61
|
+
statusResults: ({ scope, count }) => `范围:${scope},${count} 个结果。`,
|
|
62
|
+
statusNoResults: ({ scope, query }) => `范围:${scope},未找到“${query}”的结果。`,
|
|
63
|
+
keyEscape: 'Esc',
|
|
64
|
+
keyTab: 'Tab',
|
|
65
|
+
footerNavigate: '导航',
|
|
66
|
+
footerScopes: '范围和设置',
|
|
67
|
+
footerSlash: '也可打开搜索',
|
|
68
|
+
shortcutsSwitch: '单键快捷键',
|
|
69
|
+
shortcutsSwitchTitle: '单字符快捷键:/ [ ] F L T',
|
|
70
|
+
actionToggleTheme: '切换深色模式',
|
|
71
|
+
actionToggleThemeKeywords: '主题 深色 浅色 暗色 亮色 模式 深色模式 浅色模式 暗黑模式 夜间模式 外观 theme dark light mode',
|
|
72
|
+
actionCopyLink: '复制此页面的链接',
|
|
73
|
+
actionCopyLinkKeywords: '复制 链接 复制链接 网址 地址 分享 copy link url share',
|
|
74
|
+
actionShortcutsOn: '开启单键快捷键',
|
|
75
|
+
actionShortcutsOff: '关闭单键快捷键',
|
|
76
|
+
actionShortcutsKeywords: '键盘 快捷键 按键 单键 单键快捷键 keyboard shortcuts keys single',
|
|
77
|
+
}),
|
|
78
|
+
copy: Object.freeze({
|
|
79
|
+
copy: '复制到剪贴板',
|
|
80
|
+
copied: '已复制!',
|
|
81
|
+
copyCode: '复制代码',
|
|
82
|
+
copyLinkToSection: '复制章节链接',
|
|
83
|
+
}),
|
|
84
|
+
demo: Object.freeze({
|
|
85
|
+
viewsLabel: '演示视图',
|
|
86
|
+
preview: '预览',
|
|
87
|
+
widthsLabel: '预览宽度',
|
|
88
|
+
widthFull: '全宽',
|
|
89
|
+
width480: '480 像素宽',
|
|
90
|
+
width280: '280 像素宽',
|
|
91
|
+
readoutFull: '100% × auto',
|
|
92
|
+
readout480: '480 × auto',
|
|
93
|
+
readout280: '280 × auto',
|
|
94
|
+
openInNewTab: '在新标签页中打开',
|
|
95
|
+
frameTitle: ({ name }) => `${name} 演示`,
|
|
96
|
+
showCode: '显示代码',
|
|
97
|
+
hideCode: '隐藏代码',
|
|
98
|
+
code: '代码',
|
|
99
|
+
loading: '正在加载演示。',
|
|
100
|
+
failed: '演示未能加载。',
|
|
101
|
+
openFrameInNewTab: '在新标签页中打开',
|
|
102
|
+
openFullscreenRoute: '在新标签页中打开演示',
|
|
103
|
+
fullscreen: '全屏',
|
|
104
|
+
exitFullscreen: '退出全屏',
|
|
105
|
+
themePage: '页面主题',
|
|
106
|
+
themeLabel: ({ current, next }) => `演示主题:${current}。切换到${next}`,
|
|
107
|
+
themeTooltip: ({ current }) => `演示主题:${current}`,
|
|
108
|
+
}),
|
|
109
|
+
playground: Object.freeze({
|
|
110
|
+
title: '演练场',
|
|
111
|
+
reset: '重置',
|
|
112
|
+
recreate: '重新创建',
|
|
113
|
+
recreateHint: '每当某个输入发生变化时都重新创建演示',
|
|
114
|
+
content: '内容',
|
|
115
|
+
settings: '设置',
|
|
116
|
+
defaultValue: '默认',
|
|
117
|
+
resetToDefault: '重置为默认值',
|
|
118
|
+
addItem: '添加项',
|
|
119
|
+
addValue: ({ value }) => `添加“${value}”`,
|
|
120
|
+
removeItem: ({ item }) => `移除 ${item}`,
|
|
121
|
+
editItem: ({ item }) => `编辑 ${item}`,
|
|
122
|
+
itemKeys: '按 Alt+左方向键或 Alt+右方向键移动,按 Delete 移除',
|
|
123
|
+
editKeys: '按 Enter 或 F2 编辑',
|
|
124
|
+
itemMoved: ({ item, position, count }) => `${item}:第 ${position} 项,共 ${count} 项`,
|
|
125
|
+
suggestions: '建议',
|
|
126
|
+
noMatches: '没有匹配项',
|
|
127
|
+
invalidNumber: '不是数字',
|
|
128
|
+
invalidJson: '无效的 JSON',
|
|
129
|
+
frameTitle: ({ id, target }) => `${id} 演练场:${target}`,
|
|
130
|
+
inPageControl: ({ input }) => `此演练场在页面中运行,因为 \`${input}\` 的控件不支持在 iframe 中运行。`,
|
|
131
|
+
inPageValue: ({ input, reason }) => `此演练场在页面中运行,因为 \`${input}\` 的值(${reason})无法发送到其 iframe。`,
|
|
132
|
+
inPageDefault: ({ input }) => `此演练场在页面中运行,因为 \`${input}\` 的默认值无法发送到其 iframe。`,
|
|
133
|
+
inPageTooLong: '此演练场在页面中运行,因为其值过长,无法放入其 iframe 的 URL。',
|
|
134
|
+
inPageSelector: ({ selector }) => `此演练场在页面中运行,因为 \`${selector}\` 不是其目标的选择器。`,
|
|
135
|
+
inPageFrameError: ({ message }) => `此演练场在页面中运行,因为其 iframe 出错:${message}`,
|
|
136
|
+
inPageFrameSilent: '此演练场在页面中运行,因为其 iframe 未能加载。',
|
|
137
|
+
missing: '此演练场不存在。',
|
|
138
|
+
}),
|
|
139
|
+
navigation: Object.freeze({
|
|
140
|
+
skipToContent: '跳到内容',
|
|
141
|
+
openMenu: '打开导航',
|
|
142
|
+
closeMenu: '关闭导航',
|
|
143
|
+
sidebar: '文档',
|
|
144
|
+
breadcrumbs: '面包屑导航',
|
|
145
|
+
pages: '上一页和下一页',
|
|
146
|
+
previous: '上一页',
|
|
147
|
+
next: '下一页',
|
|
148
|
+
}),
|
|
149
|
+
page: Object.freeze({
|
|
150
|
+
copyLink: '复制此页面的链接',
|
|
151
|
+
linkCopied: '链接已复制',
|
|
152
|
+
copyLinkTooltip: '复制链接',
|
|
153
|
+
linkCopiedTooltip: '已复制',
|
|
154
|
+
edit: '编辑此页面',
|
|
155
|
+
viewSource: '查看页面源代码',
|
|
156
|
+
viewSourceTooltip: '查看源代码',
|
|
157
|
+
backTo: ({ title }) => `返回${title ?? '页面'}`,
|
|
158
|
+
back: '返回',
|
|
159
|
+
}),
|
|
160
|
+
content: Object.freeze({
|
|
161
|
+
openImage: ({ alt }) => `打开图片:${alt}`,
|
|
162
|
+
codeLines: ({ ranges }) => `第 ${ranges} 行`,
|
|
163
|
+
}),
|
|
164
|
+
toc: Object.freeze({
|
|
165
|
+
symbol: '符号',
|
|
166
|
+
onThisPage: '本页内容',
|
|
167
|
+
readingProgress: '阅读进度',
|
|
168
|
+
backToTop: '返回顶部',
|
|
169
|
+
copyLink: '复制链接',
|
|
170
|
+
copied: '已复制',
|
|
171
|
+
edit: '编辑此页面',
|
|
172
|
+
}),
|
|
173
|
+
theme: Object.freeze({
|
|
174
|
+
auto: '自动',
|
|
175
|
+
light: '浅色',
|
|
176
|
+
dark: '深色',
|
|
177
|
+
label: ({ current, next }) => `${current}主题。切换到${next}`,
|
|
178
|
+
tooltip: ({ current }) => `${current}主题`,
|
|
179
|
+
}),
|
|
180
|
+
apiList: Object.freeze({
|
|
181
|
+
title: 'API 参考',
|
|
182
|
+
summary: ({ declarations, scopes }) => `${scopes} 个范围中共 ${declarations} 个声明。`,
|
|
183
|
+
filterPlaceholder: '按名称筛选',
|
|
184
|
+
filterPlaceholderWithDescriptions: '按名称或描述筛选',
|
|
185
|
+
filterLabel: '按名称筛选声明',
|
|
186
|
+
filterLabelWithDescriptions: '按名称或描述筛选声明',
|
|
187
|
+
groupBy: '分组依据',
|
|
188
|
+
groupByKind: '种类',
|
|
189
|
+
groupByScope: '范围',
|
|
190
|
+
kindsLabel: '按种类筛选',
|
|
191
|
+
allKinds: '全部',
|
|
192
|
+
scopeNote: ({ scope }) => `仅显示 ${scope}。`,
|
|
193
|
+
showEveryScope: '显示所有范围',
|
|
194
|
+
noDescription: '无描述',
|
|
195
|
+
empty: '没有匹配的声明。',
|
|
196
|
+
failed: '无法加载 API 列表。',
|
|
197
|
+
}),
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Generated bundle index. Do not edit.
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
export { NG_DOC_TEXTS_ZH };
|
|
205
|
+
//# sourceMappingURL=ng-doc-app-texts-zh.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-app-texts-zh.mjs","sources":["../../../../libs/app/texts/zh/texts.ts","../../../../libs/app/texts/zh/ng-doc-app-texts-zh.ts"],"sourcesContent":["import type { NgDocTexts } from '@ng-doc/app/interfaces';\n\n/**\n * The Simplified Chinese texts of NgDoc, for `provideNgDocTexts(NG_DOC_TEXTS_ZH)`. Pass your own\n * changes after them: `provideNgDocTexts(NG_DOC_TEXTS_ZH, { search: { placeholder: '…' } })`.\n *\n * These translations welcome corrections: open an issue or a pull request at\n * https://github.com/ng-doc/ng-doc that names the text (its group and key) and your wording.\n */\nexport const NG_DOC_TEXTS_ZH: NgDocTexts = Object.freeze({\n blockquote: Object.freeze({\n note: '备注',\n warning: '警告',\n alert: '危险',\n success: '成功',\n }),\n pane: Object.freeze({\n resizer: '调整窗格大小',\n }),\n combobox: Object.freeze({\n placeholder: '选择值',\n }),\n search: Object.freeze({\n placeholder: '搜索文档…',\n label: ({ shortcut }: { shortcut: string }) => `搜索(${shortcut})`,\n shortcutMac: '⌘K',\n shortcutOther: 'Ctrl K',\n resultGuides: '指南',\n resultApi: 'API',\n resultUnknown: '未知',\n nothingFound: '未找到任何结果…',\n }),\n searchPalette: Object.freeze({\n dialogLabel: '搜索',\n inputLabel: '搜索文档',\n inputPlaceholder: '搜索指南、API 和操作…',\n scopesLabel: '搜索范围',\n scopeAll: '全部',\n scopeGuides: '指南',\n scopeApi: 'API',\n scopeActions: '操作',\n resultsLabel: '结果',\n sectionTopMatches: '最佳匹配',\n sectionGuides: '指南',\n sectionApi: 'API',\n sectionActions: '操作',\n searching: '正在搜索…',\n failed: '搜索失败,请重试。',\n failedStatus: '搜索失败。',\n noResults: ({ query }: { query: string }) => `未找到“${query}”的结果`,\n typeToSearch: '输入内容以搜索。',\n typeToSearchGuides: '输入内容以搜索指南。',\n typeToSearchApi: '输入内容以搜索 API。',\n typeApi: 'API',\n typeGuide: '指南',\n typeAction: '操作',\n actionKeepsOpen: '更改设置并保持搜索打开。',\n actionRunsImmediately: '立即执行。',\n shortcut: '快捷键',\n openSymbolPage: '打开符号页面',\n open: '打开',\n statusScope: ({ scope }: { scope: string }) => `范围:${scope}。`,\n statusResults: ({ scope, count }: { scope: string; count: number }) =>\n `范围:${scope},${count} 个结果。`,\n statusNoResults: ({ scope, query }: { scope: string; query: string }) =>\n `范围:${scope},未找到“${query}”的结果。`,\n keyEscape: 'Esc',\n keyTab: 'Tab',\n footerNavigate: '导航',\n footerScopes: '范围和设置',\n footerSlash: '也可打开搜索',\n shortcutsSwitch: '单键快捷键',\n shortcutsSwitchTitle: '单字符快捷键:/ [ ] F L T',\n actionToggleTheme: '切换深色模式',\n actionToggleThemeKeywords:\n '主题 深色 浅色 暗色 亮色 模式 深色模式 浅色模式 暗黑模式 夜间模式 外观 theme dark light mode',\n actionCopyLink: '复制此页面的链接',\n actionCopyLinkKeywords: '复制 链接 复制链接 网址 地址 分享 copy link url share',\n actionShortcutsOn: '开启单键快捷键',\n actionShortcutsOff: '关闭单键快捷键',\n actionShortcutsKeywords: '键盘 快捷键 按键 单键 单键快捷键 keyboard shortcuts keys single',\n }),\n copy: Object.freeze({\n copy: '复制到剪贴板',\n copied: '已复制!',\n copyCode: '复制代码',\n copyLinkToSection: '复制章节链接',\n }),\n demo: Object.freeze({\n viewsLabel: '演示视图',\n preview: '预览',\n widthsLabel: '预览宽度',\n widthFull: '全宽',\n width480: '480 像素宽',\n width280: '280 像素宽',\n readoutFull: '100% × auto',\n readout480: '480 × auto',\n readout280: '280 × auto',\n openInNewTab: '在新标签页中打开',\n frameTitle: ({ name }: { name: string }) => `${name} 演示`,\n showCode: '显示代码',\n hideCode: '隐藏代码',\n code: '代码',\n loading: '正在加载演示。',\n failed: '演示未能加载。',\n openFrameInNewTab: '在新标签页中打开',\n openFullscreenRoute: '在新标签页中打开演示',\n fullscreen: '全屏',\n exitFullscreen: '退出全屏',\n themePage: '页面主题',\n themeLabel: ({ current, next }: { current: string; next: string }) =>\n `演示主题:${current}。切换到${next}`,\n themeTooltip: ({ current }: { current: string }) => `演示主题:${current}`,\n }),\n playground: Object.freeze({\n title: '演练场',\n reset: '重置',\n recreate: '重新创建',\n recreateHint: '每当某个输入发生变化时都重新创建演示',\n content: '内容',\n settings: '设置',\n defaultValue: '默认',\n resetToDefault: '重置为默认值',\n addItem: '添加项',\n addValue: ({ value }: { value: string }) => `添加“${value}”`,\n removeItem: ({ item }: { item: string }) => `移除 ${item}`,\n editItem: ({ item }: { item: string }) => `编辑 ${item}`,\n itemKeys: '按 Alt+左方向键或 Alt+右方向键移动,按 Delete 移除',\n editKeys: '按 Enter 或 F2 编辑',\n itemMoved: ({ item, position, count }: { item: string; position: number; count: number }) =>\n `${item}:第 ${position} 项,共 ${count} 项`,\n suggestions: '建议',\n noMatches: '没有匹配项',\n invalidNumber: '不是数字',\n invalidJson: '无效的 JSON',\n frameTitle: ({ id, target }: { id: string; target: string }) => `${id} 演练场:${target}`,\n inPageControl: ({ input }: { input: string }) =>\n `此演练场在页面中运行,因为 \\`${input}\\` 的控件不支持在 iframe 中运行。`,\n inPageValue: ({ input, reason }: { input: string; reason: string }) =>\n `此演练场在页面中运行,因为 \\`${input}\\` 的值(${reason})无法发送到其 iframe。`,\n inPageDefault: ({ input }: { input: string }) =>\n `此演练场在页面中运行,因为 \\`${input}\\` 的默认值无法发送到其 iframe。`,\n inPageTooLong: '此演练场在页面中运行,因为其值过长,无法放入其 iframe 的 URL。',\n inPageSelector: ({ selector }: { selector: string }) =>\n `此演练场在页面中运行,因为 \\`${selector}\\` 不是其目标的选择器。`,\n inPageFrameError: ({ message }: { message: string }) =>\n `此演练场在页面中运行,因为其 iframe 出错:${message}`,\n inPageFrameSilent: '此演练场在页面中运行,因为其 iframe 未能加载。',\n missing: '此演练场不存在。',\n }),\n navigation: Object.freeze({\n skipToContent: '跳到内容',\n openMenu: '打开导航',\n closeMenu: '关闭导航',\n sidebar: '文档',\n breadcrumbs: '面包屑导航',\n pages: '上一页和下一页',\n previous: '上一页',\n next: '下一页',\n }),\n page: Object.freeze({\n copyLink: '复制此页面的链接',\n linkCopied: '链接已复制',\n copyLinkTooltip: '复制链接',\n linkCopiedTooltip: '已复制',\n edit: '编辑此页面',\n viewSource: '查看页面源代码',\n viewSourceTooltip: '查看源代码',\n backTo: ({ title }: { title?: string }) => `返回${title ?? '页面'}`,\n back: '返回',\n }),\n content: Object.freeze({\n openImage: ({ alt }: { alt: string }) => `打开图片:${alt}`,\n codeLines: ({ ranges }: { count: number; ranges: string }) => `第 ${ranges} 行`,\n }),\n toc: Object.freeze({\n symbol: '符号',\n onThisPage: '本页内容',\n readingProgress: '阅读进度',\n backToTop: '返回顶部',\n copyLink: '复制链接',\n copied: '已复制',\n edit: '编辑此页面',\n }),\n theme: Object.freeze({\n auto: '自动',\n light: '浅色',\n dark: '深色',\n label: ({ current, next }: { current: string; next: string }) =>\n `${current}主题。切换到${next}`,\n tooltip: ({ current }: { current: string }) => `${current}主题`,\n }),\n apiList: Object.freeze({\n title: 'API 参考',\n summary: ({ declarations, scopes }: { declarations: number; scopes: number }) =>\n `${scopes} 个范围中共 ${declarations} 个声明。`,\n filterPlaceholder: '按名称筛选',\n filterPlaceholderWithDescriptions: '按名称或描述筛选',\n filterLabel: '按名称筛选声明',\n filterLabelWithDescriptions: '按名称或描述筛选声明',\n groupBy: '分组依据',\n groupByKind: '种类',\n groupByScope: '范围',\n kindsLabel: '按种类筛选',\n allKinds: '全部',\n scopeNote: ({ scope }: { scope: string }) => `仅显示 ${scope}。`,\n showEveryScope: '显示所有范围',\n noDescription: '无描述',\n empty: '没有匹配的声明。',\n failed: '无法加载 API 列表。',\n }),\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAEA;;;;;;AAMG;AACI,MAAM,eAAe,GAAe,MAAM,CAAC,MAAM,CAAC;AACvD,IAAA,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC;AACxB,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,OAAO,EAAE,IAAI;KACd,CAAC;AACF,IAAA,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;AAClB,QAAA,OAAO,EAAE,QAAQ;KAClB,CAAC;AACF,IAAA,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;AACtB,QAAA,WAAW,EAAE,KAAK;KACnB,CAAC;AACF,IAAA,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;AACpB,QAAA,WAAW,EAAE,OAAO;QACpB,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAwB,KAAK,CAAA,GAAA,EAAM,QAAQ,CAAA,CAAA,CAAG;AAChE,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,aAAa,EAAE,QAAQ;AACvB,QAAA,YAAY,EAAE,IAAI;AAClB,QAAA,SAAS,EAAE,KAAK;AAChB,QAAA,aAAa,EAAE,IAAI;AACnB,QAAA,YAAY,EAAE,UAAU;KACzB,CAAC;AACF,IAAA,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC;AAC3B,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,UAAU,EAAE,MAAM;AAClB,QAAA,gBAAgB,EAAE,eAAe;AACjC,QAAA,WAAW,EA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Y,EAAE,MAAM,EAA4C,KAC1E,CAAA,EAAG,MAAM,CAAA,OAAA,EAAU,YAAY,CAAA,KAAA,CAAO;AACxC,QAAA,iBAAiB,EAAE,OAAO;AAC1B,QAAA,iCAAiC,EAAE,UAAU;AAC7C,QAAA,WAAW,EAAE,SAAS;AACtB,QAAA,2BAA2B,EAAE,YAAY;AACzC,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,YAAY,EAAE,IAAI;AAClB,QAAA,UAAU,EAAE,OAAO;AACnB,QAAA,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,CAAC,EAAE,KAAK,EAAqB,KAAK,CAAA,IAAA,EAAO,KAAK,CAAA,CAAA,CAAG;AAC5D,QAAA,cAAc,EAAE,QAAQ;AACxB,QAAA,aAAa,EAAE,KAAK;AACpB,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,MAAM,EAAE,cAAc;KACvB,CAAC;AACH,CAAA;;ACnND;;AAEG;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
import { asArray } from '@ng-doc/core/helpers/as-array';
|
|
3
|
+
import { NG_DOC_UI_KIT_DEFAULT_TEXTS } from '@ng-doc/ui-kit/texts';
|
|
3
4
|
|
|
4
5
|
/** Enables one delayed anchor replay after asynchronous NgDoc content is processed. */
|
|
5
6
|
const NG_DOC_CONTENT_ANCHOR_SCROLLING = new InjectionToken('NG_DOC_CONTENT_ANCHOR_SCROLLING', { providedIn: 'root', factory: () => false });
|
|
@@ -43,11 +44,223 @@ const NG_DOC_ROUTE_PREFIX = new InjectionToken('NG_DOC_ROUTE_PREFIX');
|
|
|
43
44
|
|
|
44
45
|
const NG_DOC_SHIKI_THEME = new InjectionToken('NG_DOC_SHIKI_THEME');
|
|
45
46
|
|
|
47
|
+
/**
|
|
48
|
+
* The English texts of the NgDoc application. They are the texts NgDoc showed before the texts
|
|
49
|
+
* could be changed, so an application that changes none renders as before.
|
|
50
|
+
*/
|
|
51
|
+
const NG_DOC_DEFAULT_TEXTS = Object.freeze({
|
|
52
|
+
...NG_DOC_UI_KIT_DEFAULT_TEXTS,
|
|
53
|
+
search: Object.freeze({
|
|
54
|
+
placeholder: 'Search docs…',
|
|
55
|
+
label: ({ shortcut }) => `Search (${shortcut})`,
|
|
56
|
+
shortcutMac: '⌘K',
|
|
57
|
+
shortcutOther: 'Ctrl K',
|
|
58
|
+
resultGuides: 'Guides',
|
|
59
|
+
resultApi: 'API',
|
|
60
|
+
resultUnknown: 'Unknown',
|
|
61
|
+
nothingFound: 'Nothing was found...',
|
|
62
|
+
}),
|
|
63
|
+
searchPalette: Object.freeze({
|
|
64
|
+
dialogLabel: 'Search',
|
|
65
|
+
inputLabel: 'Search the documentation',
|
|
66
|
+
inputPlaceholder: 'Search guides, API and actions…',
|
|
67
|
+
scopesLabel: 'Search scope',
|
|
68
|
+
scopeAll: 'All',
|
|
69
|
+
scopeGuides: 'Guides',
|
|
70
|
+
scopeApi: 'API',
|
|
71
|
+
scopeActions: 'Actions',
|
|
72
|
+
resultsLabel: 'Results',
|
|
73
|
+
sectionTopMatches: 'Top matches',
|
|
74
|
+
sectionGuides: 'Guides',
|
|
75
|
+
sectionApi: 'API',
|
|
76
|
+
sectionActions: 'Actions',
|
|
77
|
+
searching: 'Searching…',
|
|
78
|
+
failed: 'Search failed. Try again.',
|
|
79
|
+
failedStatus: 'Search failed.',
|
|
80
|
+
noResults: ({ query }) => `No results for “${query}”`,
|
|
81
|
+
typeToSearch: 'Type to search.',
|
|
82
|
+
typeToSearchGuides: 'Type to search the guides.',
|
|
83
|
+
typeToSearchApi: 'Type to search the API.',
|
|
84
|
+
typeApi: 'API',
|
|
85
|
+
typeGuide: 'Guide',
|
|
86
|
+
typeAction: 'Action',
|
|
87
|
+
actionKeepsOpen: 'Changes the setting and keeps the search open.',
|
|
88
|
+
actionRunsImmediately: 'Runs immediately.',
|
|
89
|
+
shortcut: 'Shortcut',
|
|
90
|
+
openSymbolPage: 'open symbol page',
|
|
91
|
+
open: 'open',
|
|
92
|
+
statusScope: ({ scope }) => `${scope} scope.`,
|
|
93
|
+
statusResults: ({ scope, count }) => `${scope} scope: ${count} ${count === 1 ? 'result' : 'results'}.`,
|
|
94
|
+
statusNoResults: ({ scope, query }) => `${scope} scope: no results for “${query}”.`,
|
|
95
|
+
keyEscape: 'Esc',
|
|
96
|
+
keyTab: 'Tab',
|
|
97
|
+
footerNavigate: 'navigate',
|
|
98
|
+
footerScopes: 'scopes and settings',
|
|
99
|
+
footerSlash: 'also opens search',
|
|
100
|
+
shortcutsSwitch: 'Single-key shortcuts',
|
|
101
|
+
shortcutsSwitchTitle: 'Single-character shortcuts: / [ ] F L T',
|
|
102
|
+
actionToggleTheme: 'Toggle dark mode',
|
|
103
|
+
actionToggleThemeKeywords: 'theme dark light mode',
|
|
104
|
+
actionCopyLink: 'Copy link to this page',
|
|
105
|
+
actionCopyLinkKeywords: 'copy link url share',
|
|
106
|
+
actionShortcutsOn: 'Turn on single-key shortcuts',
|
|
107
|
+
actionShortcutsOff: 'Turn off single-key shortcuts',
|
|
108
|
+
actionShortcutsKeywords: 'keyboard shortcuts keys single',
|
|
109
|
+
}),
|
|
110
|
+
copy: Object.freeze({
|
|
111
|
+
copy: 'Copy to clipboard',
|
|
112
|
+
copied: 'Copied!',
|
|
113
|
+
copyCode: 'Copy code',
|
|
114
|
+
copyLinkToSection: 'Copy link to section',
|
|
115
|
+
}),
|
|
116
|
+
demo: Object.freeze({
|
|
117
|
+
viewsLabel: 'Demo view',
|
|
118
|
+
preview: 'Preview',
|
|
119
|
+
widthsLabel: 'Preview width',
|
|
120
|
+
widthFull: 'Full width',
|
|
121
|
+
width480: '480 pixels wide',
|
|
122
|
+
width280: '280 pixels wide',
|
|
123
|
+
readoutFull: '100% × auto',
|
|
124
|
+
readout480: '480 × auto',
|
|
125
|
+
readout280: '280 × auto',
|
|
126
|
+
openInNewTab: 'Open in a new tab',
|
|
127
|
+
frameTitle: ({ name }) => `${name} demo`,
|
|
128
|
+
showCode: 'Show code',
|
|
129
|
+
hideCode: 'Hide code',
|
|
130
|
+
code: 'Code',
|
|
131
|
+
loading: 'Loading the demo.',
|
|
132
|
+
failed: 'The demo did not load.',
|
|
133
|
+
openFrameInNewTab: 'Open it in a new tab',
|
|
134
|
+
openFullscreenRoute: 'Open demo in a new tab',
|
|
135
|
+
fullscreen: 'Fullscreen',
|
|
136
|
+
exitFullscreen: 'Exit fullscreen',
|
|
137
|
+
themePage: 'Page theme',
|
|
138
|
+
themeLabel: ({ current, next }) => `Demo theme: ${current}. Switch to ${next}`,
|
|
139
|
+
themeTooltip: ({ current }) => `Demo theme: ${current}`,
|
|
140
|
+
}),
|
|
141
|
+
playground: Object.freeze({
|
|
142
|
+
title: 'Playground',
|
|
143
|
+
reset: 'Reset',
|
|
144
|
+
recreate: 'Recreate',
|
|
145
|
+
recreateHint: 'Recreates the demo every time one of the inputs changes',
|
|
146
|
+
content: 'Content',
|
|
147
|
+
settings: 'Settings',
|
|
148
|
+
defaultValue: 'default',
|
|
149
|
+
resetToDefault: 'Reset to the default value',
|
|
150
|
+
addItem: 'Add item',
|
|
151
|
+
addValue: ({ value }) => `Add “${value}”`,
|
|
152
|
+
removeItem: ({ item }) => `Remove ${item}`,
|
|
153
|
+
editItem: ({ item }) => `Edit ${item}`,
|
|
154
|
+
itemKeys: 'Alt+Left or Alt+Right to move, Delete to remove',
|
|
155
|
+
editKeys: 'Enter or F2 to edit',
|
|
156
|
+
itemMoved: ({ item, position, count }) => `${item}: ${position} of ${count}`,
|
|
157
|
+
suggestions: 'Suggestions',
|
|
158
|
+
noMatches: 'No matches',
|
|
159
|
+
invalidNumber: 'Not a number',
|
|
160
|
+
invalidJson: 'Invalid JSON',
|
|
161
|
+
frameTitle: ({ id, target }) => `${id} playground: ${target}`,
|
|
162
|
+
inPageControl: ({ input }) => `This playground runs in the page because the control of \`${input}\` doesn't support it.`,
|
|
163
|
+
inPageValue: ({ input, reason }) => `This playground runs in the page because the value of \`${input}\` (${reason}) can't be sent to its frame.`,
|
|
164
|
+
inPageDefault: ({ input }) => `This playground runs in the page because the default value of \`${input}\` can't be sent to its frame.`,
|
|
165
|
+
inPageTooLong: 'This playground runs in the page because its values are too long for the URL of its frame.',
|
|
166
|
+
inPageSelector: ({ selector }) => `This playground runs in the page because \`${selector}\` is not a selector of its target.`,
|
|
167
|
+
inPageFrameError: ({ message }) => `This playground runs in the page because its frame failed: ${message}`,
|
|
168
|
+
inPageFrameSilent: 'This playground runs in the page because its frame did not load.',
|
|
169
|
+
missing: 'This playground does not exist.',
|
|
170
|
+
}),
|
|
171
|
+
navigation: Object.freeze({
|
|
172
|
+
skipToContent: 'Skip to content',
|
|
173
|
+
openMenu: 'Open navigation',
|
|
174
|
+
closeMenu: 'Close navigation',
|
|
175
|
+
sidebar: 'Documentation',
|
|
176
|
+
breadcrumbs: 'Breadcrumb',
|
|
177
|
+
pages: 'Previous and next page',
|
|
178
|
+
previous: 'Previous',
|
|
179
|
+
next: 'Next',
|
|
180
|
+
}),
|
|
181
|
+
page: Object.freeze({
|
|
182
|
+
copyLink: 'Copy link to this page',
|
|
183
|
+
linkCopied: 'Link copied',
|
|
184
|
+
copyLinkTooltip: 'Copy link',
|
|
185
|
+
linkCopiedTooltip: 'Copied',
|
|
186
|
+
edit: 'Edit this page',
|
|
187
|
+
viewSource: 'View the page source',
|
|
188
|
+
viewSourceTooltip: 'View source',
|
|
189
|
+
backTo: ({ title }) => `Back to ${title ?? 'the page'}`,
|
|
190
|
+
back: 'Back',
|
|
191
|
+
}),
|
|
192
|
+
content: Object.freeze({
|
|
193
|
+
openImage: ({ alt }) => `Open image: ${alt}`,
|
|
194
|
+
codeLines: ({ count, ranges }) => `${count === 1 ? 'Line' : 'Lines'} ${ranges}`,
|
|
195
|
+
}),
|
|
196
|
+
toc: Object.freeze({
|
|
197
|
+
symbol: 'Symbol',
|
|
198
|
+
onThisPage: 'On this page',
|
|
199
|
+
readingProgress: 'Reading progress',
|
|
200
|
+
backToTop: 'Back to top',
|
|
201
|
+
copyLink: 'Copy link',
|
|
202
|
+
copied: 'Copied',
|
|
203
|
+
edit: 'Edit this page',
|
|
204
|
+
}),
|
|
205
|
+
theme: Object.freeze({
|
|
206
|
+
auto: 'Auto',
|
|
207
|
+
light: 'Light',
|
|
208
|
+
dark: 'Dark',
|
|
209
|
+
label: ({ current, next }) => `${current} theme. Switch to ${next.toLowerCase()}`,
|
|
210
|
+
tooltip: ({ current }) => `${current} theme`,
|
|
211
|
+
}),
|
|
212
|
+
apiList: Object.freeze({
|
|
213
|
+
title: 'API References',
|
|
214
|
+
summary: ({ declarations, scopes }) => `${declarations} declarations in ${scopes} ${scopes === 1 ? 'scope' : 'scopes'}.`,
|
|
215
|
+
filterPlaceholder: 'Filter by name',
|
|
216
|
+
filterPlaceholderWithDescriptions: 'Filter by name or description',
|
|
217
|
+
filterLabel: 'Filter declarations by name',
|
|
218
|
+
filterLabelWithDescriptions: 'Filter declarations by name or description',
|
|
219
|
+
groupBy: 'Group by',
|
|
220
|
+
groupByKind: 'Kind',
|
|
221
|
+
groupByScope: 'Scope',
|
|
222
|
+
kindsLabel: 'Filter by kind',
|
|
223
|
+
allKinds: 'All',
|
|
224
|
+
scopeNote: ({ scope }) => `Showing ${scope} only.`,
|
|
225
|
+
showEveryScope: 'Show every scope',
|
|
226
|
+
noDescription: 'No description',
|
|
227
|
+
empty: 'No declarations match.',
|
|
228
|
+
failed: 'The API list could not be loaded.',
|
|
229
|
+
}),
|
|
230
|
+
});
|
|
231
|
+
/**
|
|
232
|
+
* The texts the NgDoc application shows. It resolves to `NG_DOC_DEFAULT_TEXTS` unless
|
|
233
|
+
* `provideNgDocTexts` changes them. Inject it to show the same texts in your own components.
|
|
234
|
+
*/
|
|
235
|
+
const NG_DOC_TEXTS = new InjectionToken('NG_DOC_TEXTS', { providedIn: 'root', factory: () => NG_DOC_DEFAULT_TEXTS });
|
|
236
|
+
/**
|
|
237
|
+
* Applies changes to texts: each group of each change replaces the texts it sets, in order, so a
|
|
238
|
+
* later change wins. A text set to `undefined` keeps its value. The result is frozen.
|
|
239
|
+
* @param texts - The texts to change.
|
|
240
|
+
* @param overrides - The changes, the last one winning.
|
|
241
|
+
* @returns New texts; `texts` and the changes are left as they are.
|
|
242
|
+
*/
|
|
243
|
+
function mergeNgDocTexts(texts, ...overrides) {
|
|
244
|
+
const merged = { ...texts };
|
|
245
|
+
for (const override of overrides) {
|
|
246
|
+
for (const [group, values] of Object.entries(override ?? {})) {
|
|
247
|
+
const defined = Object.entries((values ?? {})).filter(([, value]) => value !== undefined);
|
|
248
|
+
if (defined.length) {
|
|
249
|
+
merged[group] = { ...merged[group], ...Object.fromEntries(defined) };
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
for (const group of Object.keys(merged)) {
|
|
254
|
+
merged[group] = Object.freeze(merged[group]);
|
|
255
|
+
}
|
|
256
|
+
return Object.freeze(merged);
|
|
257
|
+
}
|
|
258
|
+
|
|
46
259
|
const NG_DOC_TYPE_CONTROL = new InjectionToken('NG_DOC_TYPE_CONTROL');
|
|
47
260
|
|
|
48
261
|
/**
|
|
49
262
|
* Generated bundle index. Do not edit.
|
|
50
263
|
*/
|
|
51
264
|
|
|
52
|
-
export { NG_DOC_CONTENT_ANCHOR_SCROLLING, NG_DOC_CONTENT_SCROLL_POSITION_RESTORATION, NG_DOC_CONTEXT, NG_DOC_MERMAID, NG_DOC_PAGE_CUSTOM_PROCESSOR, NG_DOC_PAGE_PROCESSOR, NG_DOC_PAGE_SKELETON, NG_DOC_ROUTE_PREFIX, NG_DOC_SHIKI_THEME, NG_DOC_TYPE_CONTROL, provideMainPageProcessor, providePageProcessor };
|
|
265
|
+
export { NG_DOC_CONTENT_ANCHOR_SCROLLING, NG_DOC_CONTENT_SCROLL_POSITION_RESTORATION, NG_DOC_CONTEXT, NG_DOC_DEFAULT_TEXTS, NG_DOC_MERMAID, NG_DOC_PAGE_CUSTOM_PROCESSOR, NG_DOC_PAGE_PROCESSOR, NG_DOC_PAGE_SKELETON, NG_DOC_ROUTE_PREFIX, NG_DOC_SHIKI_THEME, NG_DOC_TEXTS, NG_DOC_TYPE_CONTROL, mergeNgDocTexts, provideMainPageProcessor, providePageProcessor };
|
|
53
266
|
//# sourceMappingURL=ng-doc-app-tokens.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-tokens.mjs","sources":["../../../../libs/app/tokens/content-anchor-scrolling.ts","../../../../libs/app/tokens/content-scroll-position-restoration.ts","../../../../libs/app/tokens/context.ts","../../../../libs/app/tokens/mermaid.ts","../../../../libs/app/tokens/page-processor.ts","../../../../libs/app/tokens/page-skeleton.ts","../../../../libs/app/tokens/route-prefix.ts","../../../../libs/app/tokens/shiki-theme.ts","../../../../libs/app/tokens/type-control.ts","../../../../libs/app/tokens/ng-doc-app-tokens.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** Enables one delayed anchor replay after asynchronous NgDoc content is processed. */\nexport const NG_DOC_CONTENT_ANCHOR_SCROLLING = new InjectionToken<boolean>(\n 'NG_DOC_CONTENT_ANCHOR_SCROLLING',\n { providedIn: 'root', factory: () => false },\n);\n","import { InjectionToken } from '@angular/core';\n\nexport type NgDocContentScrollPositionRestoration = 'enabled' | 'top' | 'disabled';\n\n/** Declares whether delayed NgDoc content may replay a missed saved scroll position. */\nexport const NG_DOC_CONTENT_SCROLL_POSITION_RESTORATION =\n new InjectionToken<NgDocContentScrollPositionRestoration>(\n 'NG_DOC_CONTENT_SCROLL_POSITION_RESTORATION',\n { providedIn: 'root', factory: () => 'disabled' },\n );\n","import { InjectionToken } from '@angular/core';\nimport { NgDocContext } from '@ng-doc/app/interfaces';\n\nexport const NG_DOC_CONTEXT: InjectionToken<NgDocContext> = new InjectionToken<NgDocContext>(\n\t'NG_DOC_CONTEXT',\n);\n","import { InjectionToken } from '@angular/core';\nimport type { Mermaid } from 'mermaid';\n\nexport const NG_DOC_MERMAID = new InjectionToken<Mermaid>('NG_DOC_MERMAID');\n","import { InjectionToken, Provider } from '@angular/core';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\n\nexport const NG_DOC_PAGE_PROCESSOR: InjectionToken<NgDocPageProcessor<unknown>> =\n new InjectionToken<NgDocPageProcessor<unknown>>('NG_DOC_PAGE_PROCESSOR');\nexport const NG_DOC_PAGE_CUSTOM_PROCESSOR: InjectionToken<NgDocPageProcessor<unknown>> =\n new InjectionToken<NgDocPageProcessor<unknown>>('NG_DOC_PAGE_CUSTOM_PROCESSOR');\n\n/**\n * Provide a main processor to replace html nodes with an Angular component.\n * Main processors are run before custom processors.\n * @param processors - The processor to provide.\n */\nexport function provideMainPageProcessor(\n processors: NgDocPageProcessor<unknown> | Array<NgDocPageProcessor<unknown>>,\n): Provider[] {\n return asArray(processors).map((processor) => ({\n provide: NG_DOC_PAGE_PROCESSOR,\n useValue: processor,\n multi: true,\n }));\n}\n\n/**\n * Provide a processor to replace html nodes with an Angular component.\n * @param processors - The processor to provide.\n */\nexport function providePageProcessor<T>(\n processors: NgDocPageProcessor<T> | Array<NgDocPageProcessor<T>>,\n): Provider[] {\n return asArray(processors).map((processor) => ({\n provide: NG_DOC_PAGE_CUSTOM_PROCESSOR,\n useValue: processor,\n multi: true,\n }));\n}\n","import { InjectionToken } from '@angular/core';\nimport { NgDocPageSkeleton } from '@ng-doc/app/interfaces';\n\nexport const NG_DOC_PAGE_SKELETON: InjectionToken<NgDocPageSkeleton> =\n\tnew InjectionToken<NgDocPageSkeleton>('NG_DOC_PAGE_SKELETON');\n","import { InjectionToken } from '@angular/core';\n\nexport const NG_DOC_ROUTE_PREFIX = new InjectionToken<string>('NG_DOC_ROUTE_PREFIX');\n","import { InjectionToken } from '@angular/core';\n\nexport interface NgDocShikiTheme {\n light: string;\n dark: string;\n}\n\nexport const NG_DOC_SHIKI_THEME = new InjectionToken<NgDocShikiTheme>('NG_DOC_SHIKI_THEME');\n","import { InjectionToken } from '@angular/core';\nimport { NgDocTypeControl } from '@ng-doc/app/interfaces';\n\nexport const NG_DOC_TYPE_CONTROL: InjectionToken<NgDocTypeControl> =\n\tnew InjectionToken<NgDocTypeControl>('NG_DOC_TYPE_CONTROL');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;MACa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EACjC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,EAAE;;ACD9C;MACa,0CAA0C,GACrD,IAAI,cAAc,CAChB,4CAA4C,EAC5C,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,EAAE;;MCLxC,cAAc,GAAiC,IAAI,cAAc,CAC7E,gBAAgB;;MCDJ,cAAc,GAAG,IAAI,cAAc,CAAU,gBAAgB;;MCC7D,qBAAqB,GAChC,IAAI,cAAc,CAA8B,uBAAuB;MAC5D,4BAA4B,GACvC,IAAI,cAAc,CAA8B,8BAA8B;AAEhF;;;;AAIG;AACG,SAAU,wBAAwB,CACtC,UAA4E,EAAA;AAE5E,IAAA,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,MAAM;AAC7C,QAAA,OAAO,EAAE,qBAAqB;AAC9B,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,KAAK,EAAE,IAAI;AACZ,KAAA,CAAC,CAAC;AACL;AAEA;;;AAGG;AACG,SAAU,oBAAoB,CAClC,UAAgE,EAAA;AAEhE,IAAA,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,MAAM;AAC7C,QAAA,OAAO,EAAE,4BAA4B;AACrC,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,KAAK,EAAE,IAAI;AACZ,KAAA,CAAC,CAAC;AACL;;MCjCa,oBAAoB,GAChC,IAAI,cAAc,CAAoB,sBAAsB;;MCFhD,mBAAmB,GAAG,IAAI,cAAc,CAAS,qBAAqB;;MCKtE,kBAAkB,GAAG,IAAI,cAAc,CAAkB,oBAAoB;;MCJ7E,mBAAmB,GAC/B,IAAI,cAAc,CAAmB,qBAAqB;;ACJ3D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-doc-app-tokens.mjs","sources":["../../../../libs/app/tokens/content-anchor-scrolling.ts","../../../../libs/app/tokens/content-scroll-position-restoration.ts","../../../../libs/app/tokens/context.ts","../../../../libs/app/tokens/mermaid.ts","../../../../libs/app/tokens/page-processor.ts","../../../../libs/app/tokens/page-skeleton.ts","../../../../libs/app/tokens/route-prefix.ts","../../../../libs/app/tokens/shiki-theme.ts","../../../../libs/app/tokens/texts.ts","../../../../libs/app/tokens/type-control.ts","../../../../libs/app/tokens/ng-doc-app-tokens.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** Enables one delayed anchor replay after asynchronous NgDoc content is processed. */\nexport const NG_DOC_CONTENT_ANCHOR_SCROLLING = new InjectionToken<boolean>(\n 'NG_DOC_CONTENT_ANCHOR_SCROLLING',\n { providedIn: 'root', factory: () => false },\n);\n","import { InjectionToken } from '@angular/core';\n\nexport type NgDocContentScrollPositionRestoration = 'enabled' | 'top' | 'disabled';\n\n/** Declares whether delayed NgDoc content may replay a missed saved scroll position. */\nexport const NG_DOC_CONTENT_SCROLL_POSITION_RESTORATION =\n new InjectionToken<NgDocContentScrollPositionRestoration>(\n 'NG_DOC_CONTENT_SCROLL_POSITION_RESTORATION',\n { providedIn: 'root', factory: () => 'disabled' },\n );\n","import { InjectionToken } from '@angular/core';\nimport { NgDocContext } from '@ng-doc/app/interfaces';\n\nexport const NG_DOC_CONTEXT: InjectionToken<NgDocContext> = new InjectionToken<NgDocContext>(\n\t'NG_DOC_CONTEXT',\n);\n","import { InjectionToken } from '@angular/core';\nimport type { Mermaid } from 'mermaid';\n\nexport const NG_DOC_MERMAID = new InjectionToken<Mermaid>('NG_DOC_MERMAID');\n","import { InjectionToken, Provider } from '@angular/core';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\n\nexport const NG_DOC_PAGE_PROCESSOR: InjectionToken<NgDocPageProcessor<unknown>> =\n new InjectionToken<NgDocPageProcessor<unknown>>('NG_DOC_PAGE_PROCESSOR');\nexport const NG_DOC_PAGE_CUSTOM_PROCESSOR: InjectionToken<NgDocPageProcessor<unknown>> =\n new InjectionToken<NgDocPageProcessor<unknown>>('NG_DOC_PAGE_CUSTOM_PROCESSOR');\n\n/**\n * Provide a main processor to replace html nodes with an Angular component.\n * Main processors are run before custom processors.\n * @param processors - The processor to provide.\n */\nexport function provideMainPageProcessor(\n processors: NgDocPageProcessor<unknown> | Array<NgDocPageProcessor<unknown>>,\n): Provider[] {\n return asArray(processors).map((processor) => ({\n provide: NG_DOC_PAGE_PROCESSOR,\n useValue: processor,\n multi: true,\n }));\n}\n\n/**\n * Provide a processor to replace html nodes with an Angular component.\n * @param processors - The processor to provide.\n */\nexport function providePageProcessor<T>(\n processors: NgDocPageProcessor<T> | Array<NgDocPageProcessor<T>>,\n): Provider[] {\n return asArray(processors).map((processor) => ({\n provide: NG_DOC_PAGE_CUSTOM_PROCESSOR,\n useValue: processor,\n multi: true,\n }));\n}\n","import { InjectionToken } from '@angular/core';\nimport { NgDocPageSkeleton } from '@ng-doc/app/interfaces';\n\nexport const NG_DOC_PAGE_SKELETON: InjectionToken<NgDocPageSkeleton> =\n\tnew InjectionToken<NgDocPageSkeleton>('NG_DOC_PAGE_SKELETON');\n","import { InjectionToken } from '@angular/core';\n\nexport const NG_DOC_ROUTE_PREFIX = new InjectionToken<string>('NG_DOC_ROUTE_PREFIX');\n","import { InjectionToken } from '@angular/core';\n\nexport interface NgDocShikiTheme {\n light: string;\n dark: string;\n}\n\nexport const NG_DOC_SHIKI_THEME = new InjectionToken<NgDocShikiTheme>('NG_DOC_SHIKI_THEME');\n","import { InjectionToken } from '@angular/core';\nimport type { NgDocTexts, NgDocTextsOverrides } from '@ng-doc/app/interfaces';\nimport { NG_DOC_UI_KIT_DEFAULT_TEXTS } from '@ng-doc/ui-kit/texts';\n\n/**\n * The English texts of the NgDoc application. They are the texts NgDoc showed before the texts\n * could be changed, so an application that changes none renders as before.\n */\nexport const NG_DOC_DEFAULT_TEXTS: NgDocTexts = Object.freeze({\n ...NG_DOC_UI_KIT_DEFAULT_TEXTS,\n search: Object.freeze({\n placeholder: 'Search docs…',\n label: ({ shortcut }: { shortcut: string }) => `Search (${shortcut})`,\n shortcutMac: '⌘K',\n shortcutOther: 'Ctrl K',\n resultGuides: 'Guides',\n resultApi: 'API',\n resultUnknown: 'Unknown',\n nothingFound: 'Nothing was found...',\n }),\n searchPalette: Object.freeze({\n dialogLabel: 'Search',\n inputLabel: 'Search the documentation',\n inputPlaceholder: 'Search guides, API and actions…',\n scopesLabel: 'Search scope',\n scopeAll: 'All',\n scopeGuides: 'Guides',\n scopeApi: 'API',\n scopeActions: 'Actions',\n resultsLabel: 'Results',\n sectionTopMatches: 'Top matches',\n sectionGuides: 'Guides',\n sectionApi: 'API',\n sectionActions: 'Actions',\n searching: 'Searching…',\n failed: 'Search failed. Try again.',\n failedStatus: 'Search failed.',\n noResults: ({ query }: { query: string }) => `No results for “${query}”`,\n typeToSearch: 'Type to search.',\n typeToSearchGuides: 'Type to search the guides.',\n typeToSearchApi: 'Type to search the API.',\n typeApi: 'API',\n typeGuide: 'Guide',\n typeAction: 'Action',\n actionKeepsOpen: 'Changes the setting and keeps the search open.',\n actionRunsImmediately: 'Runs immediately.',\n shortcut: 'Shortcut',\n openSymbolPage: 'open symbol page',\n open: 'open',\n statusScope: ({ scope }: { scope: string }) => `${scope} scope.`,\n statusResults: ({ scope, count }: { scope: string; count: number }) =>\n `${scope} scope: ${count} ${count === 1 ? 'result' : 'results'}.`,\n statusNoResults: ({ scope, query }: { scope: string; query: string }) =>\n `${scope} scope: no results for “${query}”.`,\n keyEscape: 'Esc',\n keyTab: 'Tab',\n footerNavigate: 'navigate',\n footerScopes: 'scopes and settings',\n footerSlash: 'also opens search',\n shortcutsSwitch: 'Single-key shortcuts',\n shortcutsSwitchTitle: 'Single-character shortcuts: / [ ] F L T',\n actionToggleTheme: 'Toggle dark mode',\n actionToggleThemeKeywords: 'theme dark light mode',\n actionCopyLink: 'Copy link to this page',\n actionCopyLinkKeywords: 'copy link url share',\n actionShortcutsOn: 'Turn on single-key shortcuts',\n actionShortcutsOff: 'Turn off single-key shortcuts',\n actionShortcutsKeywords: 'keyboard shortcuts keys single',\n }),\n copy: Object.freeze({\n copy: 'Copy to clipboard',\n copied: 'Copied!',\n copyCode: 'Copy code',\n copyLinkToSection: 'Copy link to section',\n }),\n demo: Object.freeze({\n viewsLabel: 'Demo view',\n preview: 'Preview',\n widthsLabel: 'Preview width',\n widthFull: 'Full width',\n width480: '480 pixels wide',\n width280: '280 pixels wide',\n readoutFull: '100% × auto',\n readout480: '480 × auto',\n readout280: '280 × auto',\n openInNewTab: 'Open in a new tab',\n frameTitle: ({ name }: { name: string }) => `${name} demo`,\n showCode: 'Show code',\n hideCode: 'Hide code',\n code: 'Code',\n loading: 'Loading the demo.',\n failed: 'The demo did not load.',\n openFrameInNewTab: 'Open it in a new tab',\n openFullscreenRoute: 'Open demo in a new tab',\n fullscreen: 'Fullscreen',\n exitFullscreen: 'Exit fullscreen',\n themePage: 'Page theme',\n themeLabel: ({ current, next }: { current: string; next: string }) =>\n `Demo theme: ${current}. Switch to ${next}`,\n themeTooltip: ({ current }: { current: string }) => `Demo theme: ${current}`,\n }),\n playground: Object.freeze({\n title: 'Playground',\n reset: 'Reset',\n recreate: 'Recreate',\n recreateHint: 'Recreates the demo every time one of the inputs changes',\n content: 'Content',\n settings: 'Settings',\n defaultValue: 'default',\n resetToDefault: 'Reset to the default value',\n addItem: 'Add item',\n addValue: ({ value }: { value: string }) => `Add “${value}”`,\n removeItem: ({ item }: { item: string }) => `Remove ${item}`,\n editItem: ({ item }: { item: string }) => `Edit ${item}`,\n itemKeys: 'Alt+Left or Alt+Right to move, Delete to remove',\n editKeys: 'Enter or F2 to edit',\n itemMoved: ({ item, position, count }: { item: string; position: number; count: number }) =>\n `${item}: ${position} of ${count}`,\n suggestions: 'Suggestions',\n noMatches: 'No matches',\n invalidNumber: 'Not a number',\n invalidJson: 'Invalid JSON',\n frameTitle: ({ id, target }: { id: string; target: string }) => `${id} playground: ${target}`,\n inPageControl: ({ input }: { input: string }) =>\n `This playground runs in the page because the control of \\`${input}\\` doesn't support it.`,\n inPageValue: ({ input, reason }: { input: string; reason: string }) =>\n `This playground runs in the page because the value of \\`${input}\\` (${reason}) can't be sent to its frame.`,\n inPageDefault: ({ input }: { input: string }) =>\n `This playground runs in the page because the default value of \\`${input}\\` can't be sent to its frame.`,\n inPageTooLong:\n 'This playground runs in the page because its values are too long for the URL of its frame.',\n inPageSelector: ({ selector }: { selector: string }) =>\n `This playground runs in the page because \\`${selector}\\` is not a selector of its target.`,\n inPageFrameError: ({ message }: { message: string }) =>\n `This playground runs in the page because its frame failed: ${message}`,\n inPageFrameSilent: 'This playground runs in the page because its frame did not load.',\n missing: 'This playground does not exist.',\n }),\n navigation: Object.freeze({\n skipToContent: 'Skip to content',\n openMenu: 'Open navigation',\n closeMenu: 'Close navigation',\n sidebar: 'Documentation',\n breadcrumbs: 'Breadcrumb',\n pages: 'Previous and next page',\n previous: 'Previous',\n next: 'Next',\n }),\n page: Object.freeze({\n copyLink: 'Copy link to this page',\n linkCopied: 'Link copied',\n copyLinkTooltip: 'Copy link',\n linkCopiedTooltip: 'Copied',\n edit: 'Edit this page',\n viewSource: 'View the page source',\n viewSourceTooltip: 'View source',\n backTo: ({ title }: { title?: string }) => `Back to ${title ?? 'the page'}`,\n back: 'Back',\n }),\n content: Object.freeze({\n openImage: ({ alt }: { alt: string }) => `Open image: ${alt}`,\n codeLines: ({ count, ranges }: { count: number; ranges: string }) =>\n `${count === 1 ? 'Line' : 'Lines'} ${ranges}`,\n }),\n toc: Object.freeze({\n symbol: 'Symbol',\n onThisPage: 'On this page',\n readingProgress: 'Reading progress',\n backToTop: 'Back to top',\n copyLink: 'Copy link',\n copied: 'Copied',\n edit: 'Edit this page',\n }),\n theme: Object.freeze({\n auto: 'Auto',\n light: 'Light',\n dark: 'Dark',\n label: ({ current, next }: { current: string; next: string }) =>\n `${current} theme. Switch to ${next.toLowerCase()}`,\n tooltip: ({ current }: { current: string }) => `${current} theme`,\n }),\n apiList: Object.freeze({\n title: 'API References',\n summary: ({ declarations, scopes }: { declarations: number; scopes: number }) =>\n `${declarations} declarations in ${scopes} ${scopes === 1 ? 'scope' : 'scopes'}.`,\n filterPlaceholder: 'Filter by name',\n filterPlaceholderWithDescriptions: 'Filter by name or description',\n filterLabel: 'Filter declarations by name',\n filterLabelWithDescriptions: 'Filter declarations by name or description',\n groupBy: 'Group by',\n groupByKind: 'Kind',\n groupByScope: 'Scope',\n kindsLabel: 'Filter by kind',\n allKinds: 'All',\n scopeNote: ({ scope }: { scope: string }) => `Showing ${scope} only.`,\n showEveryScope: 'Show every scope',\n noDescription: 'No description',\n empty: 'No declarations match.',\n failed: 'The API list could not be loaded.',\n }),\n});\n\n/**\n * The texts the NgDoc application shows. It resolves to `NG_DOC_DEFAULT_TEXTS` unless\n * `provideNgDocTexts` changes them. Inject it to show the same texts in your own components.\n */\nexport const NG_DOC_TEXTS: InjectionToken<NgDocTexts> = new InjectionToken<NgDocTexts>(\n 'NG_DOC_TEXTS',\n { providedIn: 'root', factory: () => NG_DOC_DEFAULT_TEXTS },\n);\n\n/**\n * Applies changes to texts: each group of each change replaces the texts it sets, in order, so a\n * later change wins. A text set to `undefined` keeps its value. The result is frozen.\n * @param texts - The texts to change.\n * @param overrides - The changes, the last one winning.\n * @returns New texts; `texts` and the changes are left as they are.\n */\nexport function mergeNgDocTexts(\n texts: NgDocTexts,\n ...overrides: readonly NgDocTextsOverrides[]\n): NgDocTexts {\n const merged: Record<string, Record<string, unknown>> = { ...texts } as unknown as Record<\n string,\n Record<string, unknown>\n >;\n\n for (const override of overrides) {\n for (const [group, values] of Object.entries(override ?? {})) {\n const defined = Object.entries((values ?? {}) as Record<string, unknown>).filter(\n ([, value]: [string, unknown]) => value !== undefined,\n );\n\n if (defined.length) {\n merged[group] = { ...merged[group], ...Object.fromEntries(defined) };\n }\n }\n }\n\n for (const group of Object.keys(merged)) {\n merged[group] = Object.freeze(merged[group]);\n }\n\n return Object.freeze(merged) as unknown as NgDocTexts;\n}\n","import { InjectionToken } from '@angular/core';\nimport { NgDocTypeControl } from '@ng-doc/app/interfaces';\n\nexport const NG_DOC_TYPE_CONTROL: InjectionToken<NgDocTypeControl> =\n\tnew InjectionToken<NgDocTypeControl>('NG_DOC_TYPE_CONTROL');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAEA;MACa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EACjC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,EAAE;;ACD9C;MACa,0CAA0C,GACrD,IAAI,cAAc,CAChB,4CAA4C,EAC5C,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,EAAE;;MCLxC,cAAc,GAAiC,IAAI,cAAc,CAC7E,gBAAgB;;MCDJ,cAAc,GAAG,IAAI,cAAc,CAAU,gBAAgB;;MCC7D,qBAAqB,GAChC,IAAI,cAAc,CAA8B,uBAAuB;MAC5D,4BAA4B,GACvC,IAAI,cAAc,CAA8B,8BAA8B;AAEhF;;;;AAIG;AACG,SAAU,wBAAwB,CACtC,UAA4E,EAAA;AAE5E,IAAA,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,MAAM;AAC7C,QAAA,OAAO,EAAE,qBAAqB;AAC9B,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,KAAK,EAAE,IAAI;AACZ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AAI,EAAE,EAA6B,CAAC,MAAM,CAC9E,CAAC,GAAG,KAAK,CAAoB,KAAK,KAAK,KAAK,SAAS,CACtD;AAED,YAAA,IAAI,OAAO,CAAC,MAAM,EAAE;AAClB,gBAAA,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;YACtE;QACF;IACF;IAEA,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AACvC,QAAA,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9C;AAEA,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAA0B;AACvD;;MCjPa,mBAAmB,GAC/B,IAAI,cAAc,CAAmB,qBAAqB;;ACJ3D;;AAEG;;;;"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, computed, inject, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { NG_DOC_TEXTS } from '@ng-doc/app/tokens';
|
|
4
|
+
import { DIControl } from 'di-controls';
|
|
5
|
+
|
|
6
|
+
/** The value of no text yet: no value has been written to the control. */
|
|
7
|
+
const NOTHING = Symbol('NOTHING');
|
|
8
|
+
let nextId = 0;
|
|
9
|
+
/**
|
|
10
|
+
* The playground control of array inputs that have no list control, such as `Item[]` or
|
|
11
|
+
* `[string, number]`: a text area that holds the value as JSON.
|
|
12
|
+
*
|
|
13
|
+
* Text that parses sets the value; while the text is not JSON, the field is marked as invalid and
|
|
14
|
+
* the input keeps its last valid value. An empty field is `undefined`, and the value that the
|
|
15
|
+
* playground writes is shown as JSON again, so the text and the value always match. It edits any
|
|
16
|
+
* value that JSON can hold, so it can also be registered for an object type.
|
|
17
|
+
*/
|
|
18
|
+
class NgDocJsonControlComponent extends DIControl {
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
/** The text of the field. */
|
|
22
|
+
this.text = signal('', /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** Whether the text is not JSON. */
|
|
25
|
+
this.invalid = signal(false, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/** The rows of the field: its lines, from 2 to 10. */
|
|
28
|
+
this.rows = computed(() => Math.min(Math.max(this.text().split('\n').length, 2), 10), /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
30
|
+
this.texts = inject(NG_DOC_TEXTS).playground;
|
|
31
|
+
/** ID of the message that describes invalid text. */
|
|
32
|
+
this.errorId = `ng-doc-json-control-error-${nextId++}`;
|
|
33
|
+
/** The value that the text stands for. */
|
|
34
|
+
this.textValue = NOTHING;
|
|
35
|
+
}
|
|
36
|
+
writeValue(value) {
|
|
37
|
+
super.writeValue(value);
|
|
38
|
+
// The form writes back each value the control reports. That value is the text already, which
|
|
39
|
+
// must stay as the reader typed it (spaces, line breaks), so only another value replaces it.
|
|
40
|
+
if (value !== this.textValue || this.invalid()) {
|
|
41
|
+
this.textValue = value;
|
|
42
|
+
this.text.set(toJson(value));
|
|
43
|
+
this.invalid.set(false);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Sets the value from the text of the field, when it is JSON.
|
|
48
|
+
* @param text - The text of the field.
|
|
49
|
+
*/
|
|
50
|
+
edit(text) {
|
|
51
|
+
this.text.set(text);
|
|
52
|
+
let value;
|
|
53
|
+
try {
|
|
54
|
+
value = text.trim() === '' ? undefined : JSON.parse(text);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
this.invalid.set(true);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.invalid.set(false);
|
|
61
|
+
this.textValue = value;
|
|
62
|
+
this.updateModel(value);
|
|
63
|
+
}
|
|
64
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocJsonControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
65
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocJsonControlComponent, isStandalone: true, selector: "ng-doc-json-control", usesInheritance: true, ngImport: i0, template: "<textarea\n #field\n class=\"ng-doc-json-control-field\"\n spellcheck=\"false\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n [rows]=\"rows()\"\n [value]=\"text()\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"invalid() ? errorId : null\"\n (input)=\"edit(field.value)\"\n (blur)=\"touch()\"></textarea>\n@if (invalid()) {\n <span class=\"ng-doc-json-control-error\" [id]=\"errorId\">{{ texts.invalidJson }}</span>\n}\n", styles: [":host{display:flex;flex-direction:column;gap:var(--ng-doc-space-1);width:100%;min-width:0}.ng-doc-json-control-field{box-sizing:border-box;width:100%;min-width:0;margin:0;padding:var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 1.5);resize:vertical;border:var(--ng-doc-input-border);border-radius:var(--ng-doc-floated-border-radius);outline:none;background-color:var(--ng-doc-input-background-color);color:var(--ng-doc-text);font-family:var(--ng-doc-code-font);font-size:13px;line-height:18px}.ng-doc-json-control-field:hover:not(:disabled){border:var(--ng-doc-input-border-hover)}.ng-doc-json-control-field:focus-visible{box-shadow:var(--ng-doc-focus-ring)}.ng-doc-json-control-field[aria-invalid=true]{border-color:var(--ng-doc-alert)}.ng-doc-json-control-error{font-size:12px;line-height:16px;color:var(--ng-doc-alert)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
66
|
+
}
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocJsonControlComponent, decorators: [{
|
|
68
|
+
type: Component,
|
|
69
|
+
args: [{ selector: 'ng-doc-json-control', changeDetection: ChangeDetectionStrategy.OnPush, template: "<textarea\n #field\n class=\"ng-doc-json-control-field\"\n spellcheck=\"false\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n [rows]=\"rows()\"\n [value]=\"text()\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"invalid() ? errorId : null\"\n (input)=\"edit(field.value)\"\n (blur)=\"touch()\"></textarea>\n@if (invalid()) {\n <span class=\"ng-doc-json-control-error\" [id]=\"errorId\">{{ texts.invalidJson }}</span>\n}\n", styles: [":host{display:flex;flex-direction:column;gap:var(--ng-doc-space-1);width:100%;min-width:0}.ng-doc-json-control-field{box-sizing:border-box;width:100%;min-width:0;margin:0;padding:var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 1.5);resize:vertical;border:var(--ng-doc-input-border);border-radius:var(--ng-doc-floated-border-radius);outline:none;background-color:var(--ng-doc-input-background-color);color:var(--ng-doc-text);font-family:var(--ng-doc-code-font);font-size:13px;line-height:18px}.ng-doc-json-control-field:hover:not(:disabled){border:var(--ng-doc-input-border-hover)}.ng-doc-json-control-field:focus-visible{box-shadow:var(--ng-doc-focus-ring)}.ng-doc-json-control-field[aria-invalid=true]{border-color:var(--ng-doc-alert)}.ng-doc-json-control-error{font-size:12px;line-height:16px;color:var(--ng-doc-alert)}\n"] }]
|
|
70
|
+
}], ctorParameters: () => [] });
|
|
71
|
+
/**
|
|
72
|
+
* The text of a value: JSON with two-space indents, or nothing for `undefined` and for values that
|
|
73
|
+
* JSON can't hold.
|
|
74
|
+
* @param value - The value.
|
|
75
|
+
*/
|
|
76
|
+
function toJson(value) {
|
|
77
|
+
try {
|
|
78
|
+
return JSON.stringify(value, null, 2) ?? '';
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Generated bundle index. Do not edit.
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
export { NgDocJsonControlComponent };
|
|
90
|
+
//# sourceMappingURL=ng-doc-app-type-controls-json-control.mjs.map
|