niuma-ui 1.0.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/CHANGELOG.md +29 -0
- package/LICENSE +202 -0
- package/NOTICE +25 -0
- package/README.en.md +99 -0
- package/README.md +161 -0
- package/package.json +106 -0
- package/src/__tests__/RsBadge.spec.ts +40 -0
- package/src/__tests__/RsBreadcrumb.spec.ts +172 -0
- package/src/__tests__/RsButton.spec.ts +108 -0
- package/src/__tests__/RsCalendarGrid.spec.ts +82 -0
- package/src/__tests__/RsCard.spec.ts +97 -0
- package/src/__tests__/RsCheckbox.spec.ts +36 -0
- package/src/__tests__/RsCodeEditor.spec.ts +111 -0
- package/src/__tests__/RsConfirmDialog.spec.ts +158 -0
- package/src/__tests__/RsContainer.spec.ts +89 -0
- package/src/__tests__/RsContextMenu.spec.ts +118 -0
- package/src/__tests__/RsDatePicker.spec.ts +88 -0
- package/src/__tests__/RsDateTimePicker.spec.ts +69 -0
- package/src/__tests__/RsDialog.spec.ts +404 -0
- package/src/__tests__/RsDrawer.spec.ts +145 -0
- package/src/__tests__/RsDropdown.spec.ts +135 -0
- package/src/__tests__/RsEmpty.spec.ts +99 -0
- package/src/__tests__/RsForm.spec.ts +173 -0
- package/src/__tests__/RsIcon.spec.ts +244 -0
- package/src/__tests__/RsInput.spec.ts +269 -0
- package/src/__tests__/RsInputNumber.spec.ts +118 -0
- package/src/__tests__/RsLabel.spec.ts +106 -0
- package/src/__tests__/RsLink.spec.ts +49 -0
- package/src/__tests__/RsLoading.spec.ts +84 -0
- package/src/__tests__/RsMarkdown.spec.ts +143 -0
- package/src/__tests__/RsMenu.spec.ts +119 -0
- package/src/__tests__/RsNewComponents.spec.ts +17 -0
- package/src/__tests__/RsPagination.spec.ts +158 -0
- package/src/__tests__/RsPopover.spec.ts +126 -0
- package/src/__tests__/RsScrollbar.spec.ts +53 -0
- package/src/__tests__/RsSelect.spec.ts +291 -0
- package/src/__tests__/RsSidebar.spec.ts +119 -0
- package/src/__tests__/RsSplitPane.spec.ts +177 -0
- package/src/__tests__/RsStatCard.spec.ts +79 -0
- package/src/__tests__/RsSteps.spec.ts +125 -0
- package/src/__tests__/RsTable.perf.spec.ts +103 -0
- package/src/__tests__/RsTable.spec.ts +1135 -0
- package/src/__tests__/RsTabs.spec.ts +328 -0
- package/src/__tests__/RsTerminal.spec.ts +218 -0
- package/src/__tests__/RsTimePicker.spec.ts +77 -0
- package/src/__tests__/RsToaster.spec.ts +95 -0
- package/src/__tests__/RsToolbar.spec.ts +75 -0
- package/src/__tests__/RsTooltip.spec.ts +111 -0
- package/src/__tests__/RsTree.spec.ts +572 -0
- package/src/__tests__/RsUpload.spec.ts +160 -0
- package/src/__tests__/RsVirtualList.spec.ts +77 -0
- package/src/__tests__/date-picker-utils.spec.ts +70 -0
- package/src/__tests__/dialog-viewport.spec.ts +38 -0
- package/src/__tests__/iso-local-datetime.spec.ts +58 -0
- package/src/__tests__/rs-clipboard.spec.ts +142 -0
- package/src/__tests__/setup.ts +12 -0
- package/src/__tests__/split-pane-utils.spec.ts +136 -0
- package/src/__tests__/table-drag.spec.ts +35 -0
- package/src/__tests__/table-edit-utils.spec.ts +194 -0
- package/src/__tests__/table-utils.spec.ts +286 -0
- package/src/__tests__/theme.spec.ts +22 -0
- package/src/__tests__/tree-utils.spec.ts +234 -0
- package/src/__tests__/useTableCellTooltip.spec.ts +101 -0
- package/src/components/RsAvatar.vue +115 -0
- package/src/components/RsBadge.vue +59 -0
- package/src/components/RsBreadcrumb.vue +65 -0
- package/src/components/RsBreadcrumbItems.vue +36 -0
- package/src/components/RsButton.vue +393 -0
- package/src/components/RsCalendarGrid.vue +284 -0
- package/src/components/RsCard.vue +237 -0
- package/src/components/RsCheckbox.vue +189 -0
- package/src/components/RsCodeBlock.vue +278 -0
- package/src/components/RsCodeEditor.vue +597 -0
- package/src/components/RsConfigProvider.vue +92 -0
- package/src/components/RsConfirmDialog.vue +178 -0
- package/src/components/RsContainer.vue +235 -0
- package/src/components/RsContextMenu.vue +238 -0
- package/src/components/RsContextMenuItems.vue +77 -0
- package/src/components/RsDatePicker.vue +756 -0
- package/src/components/RsDateTimePicker.vue +42 -0
- package/src/components/RsDialog.vue +486 -0
- package/src/components/RsDrawer.vue +175 -0
- package/src/components/RsDropdown.vue +252 -0
- package/src/components/RsDropdownItems.vue +90 -0
- package/src/components/RsEmpty.vue +107 -0
- package/src/components/RsForm.vue +131 -0
- package/src/components/RsIcon.vue +104 -0
- package/src/components/RsInput.vue +1101 -0
- package/src/components/RsInputNumber.vue +532 -0
- package/src/components/RsLabel.vue +54 -0
- package/src/components/RsLink.vue +106 -0
- package/src/components/RsLoading.vue +171 -0
- package/src/components/RsMarkdown.vue +329 -0
- package/src/components/RsMenu.vue +256 -0
- package/src/components/RsMenuItems.vue +125 -0
- package/src/components/RsMonacoEditor.vue +541 -0
- package/src/components/RsPagination.vue +184 -0
- package/src/components/RsPopover.vue +77 -0
- package/src/components/RsProseEditor.vue +160 -0
- package/src/components/RsScrollbar.vue +171 -0
- package/src/components/RsSelect.vue +1045 -0
- package/src/components/RsSidebar.vue +121 -0
- package/src/components/RsSidebarGroup.vue +32 -0
- package/src/components/RsSidebarItem.vue +72 -0
- package/src/components/RsSplitPane.vue +619 -0
- package/src/components/RsStatCard.vue +85 -0
- package/src/components/RsSteps.vue +138 -0
- package/src/components/RsTable.vue +2664 -0
- package/src/components/RsTableColgroup.vue +17 -0
- package/src/components/RsTableHeaderRow.vue +30 -0
- package/src/components/RsTabs.vue +951 -0
- package/src/components/RsTerminal.vue +697 -0
- package/src/components/RsTimePicker.vue +554 -0
- package/src/components/RsTimePickerColumns.vue +226 -0
- package/src/components/RsToaster.vue +396 -0
- package/src/components/RsToolbar.vue +135 -0
- package/src/components/RsTooltip.vue +142 -0
- package/src/components/RsTooltipProvider.vue +20 -0
- package/src/components/RsTree.vue +1248 -0
- package/src/components/RsUpload.vue +279 -0
- package/src/components/RsVirtualList.vue +217 -0
- package/src/components/avatar-utils.ts +19 -0
- package/src/components/breadcrumb-utils.ts +19 -0
- package/src/components/class-utils.ts +29 -0
- package/src/components/code-editor-utils.ts +106 -0
- package/src/components/code-mirror-completion.ts +40 -0
- package/src/components/code-mirror-diagnostics.ts +52 -0
- package/src/components/code-mirror-ghost.ts +158 -0
- package/src/components/code-mirror-inline-edit.ts +55 -0
- package/src/components/code-mirror-intel.ts +81 -0
- package/src/components/code-mirror-lang.ts +128 -0
- package/src/components/context-menu-utils.ts +20 -0
- package/src/components/date-picker-utils.ts +284 -0
- package/src/components/date-range-validation.ts +29 -0
- package/src/components/date-validation.ts +38 -0
- package/src/components/dialog-viewport.ts +48 -0
- package/src/components/dialog-window.ts +253 -0
- package/src/components/dropdown-utils.ts +31 -0
- package/src/components/form-utils.ts +77 -0
- package/src/components/input-number-utils.ts +128 -0
- package/src/components/input-rules.ts +84 -0
- package/src/components/loading-utils.ts +8 -0
- package/src/components/markdown-utils.ts +126 -0
- package/src/components/menu-utils.ts +48 -0
- package/src/components/overlay-utils.ts +47 -0
- package/src/components/pagination-utils.ts +38 -0
- package/src/components/popover-utils.ts +8 -0
- package/src/components/reka.ts +106 -0
- package/src/components/resolve-radius.ts +22 -0
- package/src/components/resolve-size.ts +29 -0
- package/src/components/scrollbar-utils.ts +10 -0
- package/src/components/select-utils.ts +72 -0
- package/src/components/split-pane-utils.ts +187 -0
- package/src/components/steps-utils.ts +22 -0
- package/src/components/table/RsTableBodyRow.vue +287 -0
- package/src/components/table/RsTableCell.vue +239 -0
- package/src/components/table/RsTableCellContent.ts +18 -0
- package/src/components/table/RsTableCellEditor.vue +351 -0
- package/src/components/table/RsTableEditGutter.vue +54 -0
- package/src/components/table/RsTableHeaderFilter.vue +107 -0
- package/src/components/table/RsTableRowStatus.vue +69 -0
- package/src/components/table/rs-table.css +1141 -0
- package/src/components/table/table-context-menu.ts +53 -0
- package/src/components/table/table-edit-utils.ts +496 -0
- package/src/components/table/table-keys.ts +12 -0
- package/src/components/table-drag.ts +215 -0
- package/src/components/table-utils.ts +950 -0
- package/src/components/tabs-utils.ts +107 -0
- package/src/components/terminal-utils.ts +301 -0
- package/src/components/terminal-wheel.ts +49 -0
- package/src/components/time-picker-utils.ts +167 -0
- package/src/components/time-range-validation.ts +23 -0
- package/src/components/time-validation.ts +20 -0
- package/src/components/tree-utils.ts +518 -0
- package/src/components/upload-utils.ts +55 -0
- package/src/components/virtual-list-utils.ts +17 -0
- package/src/composables/useClickOutside.ts +22 -0
- package/src/composables/useRsConfig.ts +91 -0
- package/src/composables/useRsI18n.ts +22 -0
- package/src/composables/useRsTabsNav.ts +187 -0
- package/src/composables/useRsToast.ts +48 -0
- package/src/composables/useTableCellTooltip.ts +239 -0
- package/src/composables/useTableEdit.ts +271 -0
- package/src/composables/useTableRowHighlight.ts +50 -0
- package/src/dev/vite-codemirror-deps.ts +20 -0
- package/src/icons/custom/api.ts +54 -0
- package/src/icons/custom/clickhouse.ts +52 -0
- package/src/icons/custom/dameng.ts +83 -0
- package/src/icons/custom/ftp.ts +61 -0
- package/src/icons/custom/kingbase.ts +52 -0
- package/src/icons/custom/mongodb.ts +50 -0
- package/src/icons/custom/mysql.ts +51 -0
- package/src/icons/custom/oracle.ts +52 -0
- package/src/icons/custom/redis.ts +51 -0
- package/src/icons/custom/sqlite.ts +50 -0
- package/src/icons/custom/sqlserver.ts +52 -0
- package/src/icons/custom/vastbase.ts +57 -0
- package/src/icons/lucide.ts +78 -0
- package/src/icons/registry.ts +35 -0
- package/src/index.ts +425 -0
- package/src/lib/iso-local-datetime.ts +152 -0
- package/src/lib/rs-dayjs.ts +56 -0
- package/src/locale/messages.ts +362 -0
- package/src/locale/types.ts +5 -0
- package/src/monaco/debug-decorations.css +20 -0
- package/src/monaco/debug-decorations.ts +70 -0
- package/src/monaco/index.ts +22 -0
- package/src/monaco/languages/index.ts +21 -0
- package/src/monaco/languages/mongodb-shell.ts +125 -0
- package/src/monaco/languages/types.ts +55 -0
- package/src/monaco/setup.ts +101 -0
- package/src/styles.css +1040 -0
- package/src/theme/apply.ts +12 -0
- package/src/theme/brand.example.css +37 -0
- package/src/theme/presets.ts +69 -0
- package/src/theme/types.ts +81 -0
- package/src/utils/rs-clipboard.ts +272 -0
- package/src/vite-env.d.ts +7 -0
- package/vite-plugins/monaco-zh-nls.ts +101 -0
- package/vite-plugins/silence-antlr-parse-console.ts +29 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import type { RsLocaleMessages } from './types'
|
|
2
|
+
|
|
3
|
+
export const zhCN: RsLocaleMessages = {
|
|
4
|
+
'select.placeholder': '请选择',
|
|
5
|
+
'select.searchPlaceholder': '搜索…',
|
|
6
|
+
'select.empty': '无匹配结果',
|
|
7
|
+
'select.loading': '加载中…',
|
|
8
|
+
'select.clear': '清空',
|
|
9
|
+
'select.createOption': '使用 “{query}”',
|
|
10
|
+
'dropdown.placeholder': '请选择',
|
|
11
|
+
'breadcrumb.label': '面包屑',
|
|
12
|
+
'breadcrumb.separator': '分隔符',
|
|
13
|
+
'menu.label': '导航菜单',
|
|
14
|
+
'menu.expandSubmenu': '展开子菜单',
|
|
15
|
+
'menu.collapseSubmenu': '收起子菜单',
|
|
16
|
+
'input.required': '此项为必填',
|
|
17
|
+
'input.formatInvalid': '格式不正确',
|
|
18
|
+
'input.rule.email': '请输入有效的邮箱地址',
|
|
19
|
+
'input.rule.number': '请输入有效数字',
|
|
20
|
+
'input.rule.integer': '请输入整数',
|
|
21
|
+
'input.rule.phone': '请输入有效的 11 位手机号',
|
|
22
|
+
'input.rule.url': '请输入有效的 URL(需以 http:// 或 https:// 开头)',
|
|
23
|
+
'input.rule.minComplexity': '密码至少 8 位,且包含字母与数字',
|
|
24
|
+
'input.clear': '清除',
|
|
25
|
+
'input.showPassword': '显示密码',
|
|
26
|
+
'input.hidePassword': '隐藏密码',
|
|
27
|
+
'inputNumber.increase': '增加',
|
|
28
|
+
'inputNumber.decrease': '减少',
|
|
29
|
+
'common.confirm': '确认',
|
|
30
|
+
'common.cancel': '取消',
|
|
31
|
+
'common.remove': '移除',
|
|
32
|
+
'dialog.close': '关闭',
|
|
33
|
+
'dialog.fullscreen': '全屏',
|
|
34
|
+
'dialog.restore': '还原',
|
|
35
|
+
'confirm.title': '确认操作?',
|
|
36
|
+
'confirm.description': '此操作可能无法撤销,请确认后继续。',
|
|
37
|
+
'loading.label': '加载中',
|
|
38
|
+
'tabs.label': '标签页',
|
|
39
|
+
'tabs.add': '新建标签页',
|
|
40
|
+
'tabs.close': '关闭 {label}',
|
|
41
|
+
'tabs.more': '更多',
|
|
42
|
+
'tabs.rename': '重命名标签页',
|
|
43
|
+
'tabs.renamePlaceholder': '输入标签名称',
|
|
44
|
+
'tabs.scrollPrev': '向前滚动标签',
|
|
45
|
+
'tabs.scrollNext': '向后滚动标签',
|
|
46
|
+
'tabs.dragHandle': '拖动排序',
|
|
47
|
+
'pagination.label': '分页',
|
|
48
|
+
'pagination.prev': '上一页',
|
|
49
|
+
'pagination.next': '下一页',
|
|
50
|
+
'pagination.page': '页',
|
|
51
|
+
'pagination.summary': '共 {total} 条',
|
|
52
|
+
'pagination.jumpTo': '跳至',
|
|
53
|
+
'pagination.jumpPageSuffix': '页',
|
|
54
|
+
'pagination.jumpConfirm': '确定',
|
|
55
|
+
'table.loading': '加载中…',
|
|
56
|
+
'table.empty': '暂无数据',
|
|
57
|
+
'table.loadingMore': '加载更多…',
|
|
58
|
+
'table.selectAll': '全选',
|
|
59
|
+
'table.selectRow': '选择行',
|
|
60
|
+
'table.index': '#',
|
|
61
|
+
'table.expandRow': '展开行',
|
|
62
|
+
'table.collapseRow': '收起行',
|
|
63
|
+
'table.dragColumn': '拖拽调整列顺序',
|
|
64
|
+
'table.dragRow': '拖拽调整行顺序',
|
|
65
|
+
'table.rowCommit': '提交本行变更',
|
|
66
|
+
'table.gutterCommit': '提交',
|
|
67
|
+
'table.rowRollback': '撤销本行变更',
|
|
68
|
+
'table.rowStatus': '行状态',
|
|
69
|
+
'table.copyCell': '复制单元格',
|
|
70
|
+
'table.copyRow': '复制行',
|
|
71
|
+
'table.filterColumn': '筛选 {title}',
|
|
72
|
+
'table.filterPlaceholder': '输入筛选…',
|
|
73
|
+
'table.filterClear': '清除',
|
|
74
|
+
'table.filterApply': '确定',
|
|
75
|
+
'table.nullValue': '(NULL)',
|
|
76
|
+
'table.setNull': '设为 NULL',
|
|
77
|
+
'table.editHint': 'F2 编辑 · Tab 下一格 · Ctrl+0 NULL · Ctrl+Z 撤销',
|
|
78
|
+
'table.editTextarea': '单元格多行文本',
|
|
79
|
+
'upload.label': '点击或拖拽文件到此处上传',
|
|
80
|
+
'upload.browse': '或点击浏览本地文件',
|
|
81
|
+
'datePicker.placeholder': '选择日期',
|
|
82
|
+
'datePicker.rangePlaceholder': '选择日期范围',
|
|
83
|
+
'datePicker.clear': '清空日期',
|
|
84
|
+
'datePicker.prevMonth': '上个月',
|
|
85
|
+
'datePicker.nextMonth': '下个月',
|
|
86
|
+
'datePicker.today': '今天',
|
|
87
|
+
'datePicker.rangeToday': '今天',
|
|
88
|
+
'datePicker.confirm': '确定',
|
|
89
|
+
'datePicker.separator': ' ~ ',
|
|
90
|
+
'datePicker.rangeStart': '开始日期',
|
|
91
|
+
'datePicker.rangeEnd': '结束日期',
|
|
92
|
+
'dateTimePicker.placeholder': '选择日期时间',
|
|
93
|
+
'dateTimePicker.rangePlaceholder': '选择日期时间范围',
|
|
94
|
+
'dateTimePicker.time': '时间',
|
|
95
|
+
'dateTimePicker.now': '此刻',
|
|
96
|
+
'dateTimePicker.clear': '清空',
|
|
97
|
+
'dateTimePicker.rangeStart': '开始时间',
|
|
98
|
+
'dateTimePicker.rangeEnd': '结束时间',
|
|
99
|
+
'timePicker.placeholder': '选择时间',
|
|
100
|
+
'timePicker.embeddedPlaceholder': '选择',
|
|
101
|
+
'timePicker.rangePlaceholder': '选择时间范围',
|
|
102
|
+
'timePicker.hour': '时',
|
|
103
|
+
'timePicker.minute': '分',
|
|
104
|
+
'timePicker.second': '秒',
|
|
105
|
+
'timePicker.now': '此刻',
|
|
106
|
+
'timePicker.rangePreset': '朝九晚六',
|
|
107
|
+
'timePicker.clear': '清空',
|
|
108
|
+
'timePicker.rangeClear': '清空',
|
|
109
|
+
'timePicker.confirm': '确定',
|
|
110
|
+
'timePicker.separator': ' ~ ',
|
|
111
|
+
'timePicker.rangeStart': '开始时间',
|
|
112
|
+
'timePicker.rangeEnd': '结束时间',
|
|
113
|
+
'tree.label': '树形控件',
|
|
114
|
+
'tree.expand': '展开节点',
|
|
115
|
+
'tree.collapse': '收起节点',
|
|
116
|
+
'tree.check': '勾选节点',
|
|
117
|
+
'tree.empty': '暂无数据',
|
|
118
|
+
'tree.drag': '拖拽排序',
|
|
119
|
+
'split.label': '面板分割',
|
|
120
|
+
'split.resize': '拖动调整面板尺寸',
|
|
121
|
+
'terminal.copy': '复制',
|
|
122
|
+
'terminal.paste': '粘贴',
|
|
123
|
+
'terminal.selectAll': '全选',
|
|
124
|
+
'terminal.clear': '清空终端',
|
|
125
|
+
'terminal.askAi': '询问 AI',
|
|
126
|
+
'playground.brand': 'Niuma UI',
|
|
127
|
+
'playground.subtitle': 'Vue 3 组件演示',
|
|
128
|
+
'playground.nav.label': '组件导航',
|
|
129
|
+
'playground.nav.start': '开始',
|
|
130
|
+
'playground.nav.overview': '首页',
|
|
131
|
+
'playground.nav.components': '组件',
|
|
132
|
+
'playground.nav.basic': '基础',
|
|
133
|
+
'playground.nav.form': '表单',
|
|
134
|
+
'playground.nav.navigation': '导航与布局',
|
|
135
|
+
'playground.nav.feedback': '浮层与反馈',
|
|
136
|
+
'playground.nav.data': '数据展示',
|
|
137
|
+
'playground.nav.editor': '编辑器',
|
|
138
|
+
'playground.nav.lab': '实验室',
|
|
139
|
+
'playground.nav.search': '搜索组件…',
|
|
140
|
+
'playground.nav.empty': '没有匹配的组件',
|
|
141
|
+
'playground.nav.toggle': '打开导航',
|
|
142
|
+
'playground.theme.label': '主题',
|
|
143
|
+
'playground.theme.dark': 'Dark',
|
|
144
|
+
'playground.theme.light': 'Light',
|
|
145
|
+
'playground.locale.label': '语言',
|
|
146
|
+
'playground.demo.testFile': '单元测试',
|
|
147
|
+
'playground.demo.showCode': '查看代码',
|
|
148
|
+
'playground.demo.hideCode': '隐藏代码',
|
|
149
|
+
'playground.demo.api': 'API',
|
|
150
|
+
'playground.demo.api.name': '属性',
|
|
151
|
+
'playground.demo.api.type': '类型',
|
|
152
|
+
'playground.demo.api.default': '默认值',
|
|
153
|
+
'playground.demo.api.desc': '说明',
|
|
154
|
+
'playground.index.title': '为运维台与桌面工具打造的 Vue 3 设计系统',
|
|
155
|
+
'playground.index.intro': '一致的 Rs* 组件、--rs-* 设计 token,以及面向控制台场景的表格、树与编辑器能力。',
|
|
156
|
+
'playground.index.cta.install': '安装',
|
|
157
|
+
'playground.index.cta.browse': '浏览组件',
|
|
158
|
+
'playground.index.install': '安装',
|
|
159
|
+
'playground.index.installHint': '通过包管理器安装后,引入样式并包裹 RsConfigProvider。',
|
|
160
|
+
'playground.index.quickStart': '快速开始',
|
|
161
|
+
'playground.index.quickStartHint': '业务侧只从 niuma-ui 导入,不要直接依赖 reka-ui。',
|
|
162
|
+
'playground.index.featured': '精选组件',
|
|
163
|
+
'playground.index.featuredHint': '从高频能力开始体验交互与主题。',
|
|
164
|
+
'playground.index.dev': '开发者索引',
|
|
165
|
+
'playground.index.devHint': '演示页与单元测试对照,便于贡献与回归。',
|
|
166
|
+
'playground.index.column.component': '组件',
|
|
167
|
+
'playground.index.column.demo': '演示页',
|
|
168
|
+
'playground.index.column.test': '单元测试',
|
|
169
|
+
'playground.index.hint': '本地启动',
|
|
170
|
+
'codeBlock.copy': '复制',
|
|
171
|
+
'codeBlock.copied': '已复制',
|
|
172
|
+
'codeBlock.download': '下载',
|
|
173
|
+
'markdown.edit': '编辑',
|
|
174
|
+
'markdown.preview': '预览',
|
|
175
|
+
'markdown.split': '分栏',
|
|
176
|
+
'markdown.modes': 'Markdown 视图',
|
|
177
|
+
'markdown.placeholder': '支持 Markdown(标题、列表、链接、代码块…)',
|
|
178
|
+
'markdown.empty': '暂无内容',
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export const enUS: RsLocaleMessages = {
|
|
182
|
+
'select.placeholder': 'Select',
|
|
183
|
+
'select.searchPlaceholder': 'Search…',
|
|
184
|
+
'select.empty': 'No results',
|
|
185
|
+
'select.loading': 'Loading…',
|
|
186
|
+
'select.clear': 'Clear',
|
|
187
|
+
'select.createOption': 'Use “{query}”',
|
|
188
|
+
'dropdown.placeholder': 'Select',
|
|
189
|
+
'breadcrumb.label': 'Breadcrumb',
|
|
190
|
+
'breadcrumb.separator': 'Separator',
|
|
191
|
+
'menu.label': 'Navigation menu',
|
|
192
|
+
'menu.expandSubmenu': 'Expand submenu',
|
|
193
|
+
'menu.collapseSubmenu': 'Collapse submenu',
|
|
194
|
+
'input.required': 'This field is required',
|
|
195
|
+
'input.formatInvalid': 'Invalid format',
|
|
196
|
+
'input.rule.email': 'Enter a valid email address',
|
|
197
|
+
'input.rule.number': 'Enter a valid number',
|
|
198
|
+
'input.rule.integer': 'Enter an integer',
|
|
199
|
+
'input.rule.phone': 'Enter a valid 11-digit mobile number',
|
|
200
|
+
'input.rule.url': 'Enter a valid URL starting with http:// or https://',
|
|
201
|
+
'input.rule.minComplexity': 'Password must be at least 8 characters with letters and numbers',
|
|
202
|
+
'input.clear': 'Clear',
|
|
203
|
+
'input.showPassword': 'Show password',
|
|
204
|
+
'input.hidePassword': 'Hide password',
|
|
205
|
+
'inputNumber.increase': 'Increase',
|
|
206
|
+
'inputNumber.decrease': 'Decrease',
|
|
207
|
+
'common.confirm': 'Confirm',
|
|
208
|
+
'common.cancel': 'Cancel',
|
|
209
|
+
'common.remove': 'Remove',
|
|
210
|
+
'dialog.close': 'Close',
|
|
211
|
+
'dialog.fullscreen': 'Fullscreen',
|
|
212
|
+
'dialog.restore': 'Restore',
|
|
213
|
+
'confirm.title': 'Confirm action?',
|
|
214
|
+
'confirm.description': 'This action may not be reversible. Please confirm before continuing.',
|
|
215
|
+
'loading.label': 'Loading',
|
|
216
|
+
'tabs.label': 'Tabs',
|
|
217
|
+
'tabs.add': 'Add tab',
|
|
218
|
+
'tabs.close': 'Close {label}',
|
|
219
|
+
'tabs.more': 'More',
|
|
220
|
+
'tabs.rename': 'Rename tab',
|
|
221
|
+
'tabs.renamePlaceholder': 'Enter tab name',
|
|
222
|
+
'tabs.scrollPrev': 'Scroll tabs backward',
|
|
223
|
+
'tabs.scrollNext': 'Scroll tabs forward',
|
|
224
|
+
'tabs.dragHandle': 'Drag to reorder',
|
|
225
|
+
'pagination.label': 'Pagination',
|
|
226
|
+
'pagination.prev': 'Previous',
|
|
227
|
+
'pagination.next': 'Next',
|
|
228
|
+
'pagination.page': 'page',
|
|
229
|
+
'pagination.summary': 'Total {total} items',
|
|
230
|
+
'pagination.jumpTo': 'Go to',
|
|
231
|
+
'pagination.jumpPageSuffix': 'page',
|
|
232
|
+
'pagination.jumpConfirm': 'Go',
|
|
233
|
+
'table.loading': 'Loading…',
|
|
234
|
+
'table.empty': 'No data',
|
|
235
|
+
'table.loadingMore': 'Loading more…',
|
|
236
|
+
'table.selectAll': 'Select all',
|
|
237
|
+
'table.selectRow': 'Select row',
|
|
238
|
+
'table.index': '#',
|
|
239
|
+
'table.expandRow': 'Expand row',
|
|
240
|
+
'table.collapseRow': 'Collapse row',
|
|
241
|
+
'table.dragColumn': 'Drag to reorder column',
|
|
242
|
+
'table.dragRow': 'Drag to reorder row',
|
|
243
|
+
'table.rowCommit': 'Commit row changes',
|
|
244
|
+
'table.gutterCommit': 'Commit',
|
|
245
|
+
'table.rowRollback': 'Revert row changes',
|
|
246
|
+
'table.rowStatus': 'Row status',
|
|
247
|
+
'table.copyCell': 'Copy cell',
|
|
248
|
+
'table.copyRow': 'Copy row',
|
|
249
|
+
'table.filterColumn': 'Filter {title}',
|
|
250
|
+
'table.filterPlaceholder': 'Filter…',
|
|
251
|
+
'table.filterClear': 'Clear',
|
|
252
|
+
'table.filterApply': 'Apply',
|
|
253
|
+
'table.nullValue': '(NULL)',
|
|
254
|
+
'table.setNull': 'Set NULL',
|
|
255
|
+
'table.editHint': 'F2 edit · Tab next · Ctrl+0 NULL · Ctrl+Z undo',
|
|
256
|
+
'table.editTextarea': 'Cell multiline text',
|
|
257
|
+
'upload.label': 'Click or drag files here to upload',
|
|
258
|
+
'upload.browse': 'or click to browse files',
|
|
259
|
+
'datePicker.placeholder': 'Select date',
|
|
260
|
+
'datePicker.rangePlaceholder': 'Select date range',
|
|
261
|
+
'datePicker.clear': 'Clear date',
|
|
262
|
+
'datePicker.prevMonth': 'Previous month',
|
|
263
|
+
'datePicker.nextMonth': 'Next month',
|
|
264
|
+
'datePicker.today': 'Today',
|
|
265
|
+
'datePicker.rangeToday': 'Today',
|
|
266
|
+
'datePicker.confirm': 'Confirm',
|
|
267
|
+
'datePicker.separator': ' – ',
|
|
268
|
+
'datePicker.rangeStart': 'Start date',
|
|
269
|
+
'datePicker.rangeEnd': 'End date',
|
|
270
|
+
'dateTimePicker.placeholder': 'Select date and time',
|
|
271
|
+
'dateTimePicker.rangePlaceholder': 'Select date-time range',
|
|
272
|
+
'dateTimePicker.time': 'Time',
|
|
273
|
+
'dateTimePicker.now': 'Now',
|
|
274
|
+
'dateTimePicker.clear': 'Clear',
|
|
275
|
+
'dateTimePicker.rangeStart': 'Start time',
|
|
276
|
+
'dateTimePicker.rangeEnd': 'End time',
|
|
277
|
+
'timePicker.placeholder': 'Select time',
|
|
278
|
+
'timePicker.embeddedPlaceholder': 'Select',
|
|
279
|
+
'timePicker.rangePlaceholder': 'Select time range',
|
|
280
|
+
'timePicker.hour': 'Hour',
|
|
281
|
+
'timePicker.minute': 'Min',
|
|
282
|
+
'timePicker.second': 'Sec',
|
|
283
|
+
'timePicker.now': 'Now',
|
|
284
|
+
'timePicker.rangePreset': '9:00 – 18:00',
|
|
285
|
+
'timePicker.clear': 'Clear',
|
|
286
|
+
'timePicker.rangeClear': 'Clear',
|
|
287
|
+
'timePicker.confirm': 'Confirm',
|
|
288
|
+
'timePicker.separator': ' – ',
|
|
289
|
+
'timePicker.rangeStart': 'Start time',
|
|
290
|
+
'timePicker.rangeEnd': 'End time',
|
|
291
|
+
'tree.label': 'Tree',
|
|
292
|
+
'tree.expand': 'Expand node',
|
|
293
|
+
'tree.collapse': 'Collapse node',
|
|
294
|
+
'tree.check': 'Check node',
|
|
295
|
+
'tree.empty': 'No data',
|
|
296
|
+
'tree.drag': 'Drag to reorder',
|
|
297
|
+
'split.label': 'Split panes',
|
|
298
|
+
'split.resize': 'Drag to resize panes',
|
|
299
|
+
'terminal.copy': 'Copy',
|
|
300
|
+
'terminal.paste': 'Paste',
|
|
301
|
+
'terminal.selectAll': 'Select All',
|
|
302
|
+
'terminal.clear': 'Clear Terminal',
|
|
303
|
+
'terminal.askAi': 'Ask AI',
|
|
304
|
+
'playground.brand': 'Niuma UI',
|
|
305
|
+
'playground.subtitle': 'Vue 3 component demos',
|
|
306
|
+
'playground.nav.label': 'Component navigation',
|
|
307
|
+
'playground.nav.start': 'Start',
|
|
308
|
+
'playground.nav.overview': 'Home',
|
|
309
|
+
'playground.nav.components': 'Components',
|
|
310
|
+
'playground.nav.basic': 'Basic',
|
|
311
|
+
'playground.nav.form': 'Form',
|
|
312
|
+
'playground.nav.navigation': 'Navigation & layout',
|
|
313
|
+
'playground.nav.feedback': 'Overlay & feedback',
|
|
314
|
+
'playground.nav.data': 'Data display',
|
|
315
|
+
'playground.nav.editor': 'Editors',
|
|
316
|
+
'playground.nav.lab': 'Lab',
|
|
317
|
+
'playground.nav.search': 'Search components…',
|
|
318
|
+
'playground.nav.empty': 'No matching components',
|
|
319
|
+
'playground.nav.toggle': 'Open navigation',
|
|
320
|
+
'playground.theme.label': 'Theme',
|
|
321
|
+
'playground.theme.dark': 'Dark',
|
|
322
|
+
'playground.theme.light': 'Light',
|
|
323
|
+
'playground.locale.label': 'Language',
|
|
324
|
+
'playground.demo.testFile': 'Unit test',
|
|
325
|
+
'playground.demo.showCode': 'Show code',
|
|
326
|
+
'playground.demo.hideCode': 'Hide code',
|
|
327
|
+
'playground.demo.api': 'API',
|
|
328
|
+
'playground.demo.api.name': 'Prop',
|
|
329
|
+
'playground.demo.api.type': 'Type',
|
|
330
|
+
'playground.demo.api.default': 'Default',
|
|
331
|
+
'playground.demo.api.desc': 'Description',
|
|
332
|
+
'playground.index.title': 'A Vue 3 design system for ops consoles and desktop tools',
|
|
333
|
+
'playground.index.intro': 'Consistent Rs* components, --rs-* tokens, plus table, tree, and editor capabilities for console UIs.',
|
|
334
|
+
'playground.index.cta.install': 'Install',
|
|
335
|
+
'playground.index.cta.browse': 'Browse components',
|
|
336
|
+
'playground.index.install': 'Install',
|
|
337
|
+
'playground.index.installHint': 'Install the package, import styles, and wrap your app with RsConfigProvider.',
|
|
338
|
+
'playground.index.quickStart': 'Quick start',
|
|
339
|
+
'playground.index.quickStartHint': 'Import only from niuma-ui — do not depend on reka-ui directly.',
|
|
340
|
+
'playground.index.featured': 'Featured',
|
|
341
|
+
'playground.index.featuredHint': 'Start with high-traffic components to explore interaction and theming.',
|
|
342
|
+
'playground.index.dev': 'Developer index',
|
|
343
|
+
'playground.index.devHint': 'Demo pages mapped to unit tests for contribution and regression.',
|
|
344
|
+
'playground.index.column.component': 'Component',
|
|
345
|
+
'playground.index.column.demo': 'Demo',
|
|
346
|
+
'playground.index.column.test': 'Unit test',
|
|
347
|
+
'playground.index.hint': 'Local start',
|
|
348
|
+
'codeBlock.copy': 'Copy',
|
|
349
|
+
'codeBlock.copied': 'Copied!',
|
|
350
|
+
'codeBlock.download': 'Download',
|
|
351
|
+
'markdown.edit': 'Edit',
|
|
352
|
+
'markdown.preview': 'Preview',
|
|
353
|
+
'markdown.split': 'Split',
|
|
354
|
+
'markdown.modes': 'Markdown view',
|
|
355
|
+
'markdown.placeholder': 'Markdown supported (headings, lists, links, code…)',
|
|
356
|
+
'markdown.empty': 'Nothing to preview',
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export const localeMap = {
|
|
360
|
+
'zh-CN': zhCN,
|
|
361
|
+
'en-US': enUS,
|
|
362
|
+
} as const
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monaco 调试装饰(glyph / 行装饰)。
|
|
3
|
+
* 选择器勿绑死 .cgmr / .cldr:Monaco 版本间 class 组合会变,类名本身即可命中。
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.monaco-editor .rs-monaco-debug-bp {
|
|
7
|
+
background: no-repeat center center !important;
|
|
8
|
+
background-size: 10px 10px !important;
|
|
9
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='5' fill='%23e51400'/%3E%3C/svg%3E") !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.monaco-editor .rs-monaco-debug-stack {
|
|
13
|
+
background: no-repeat left 1px center !important;
|
|
14
|
+
background-size: 9px 11px !important;
|
|
15
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='11' viewBox='0 0 9 11'%3E%3Cpath d='M0 0L9 5.5L0 11Z' fill='%23f5a623'/%3E%3C/svg%3E") !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.monaco-editor .rs-monaco-debug-current-line {
|
|
19
|
+
background: color-mix(in srgb, #f59e0b 16%, transparent) !important;
|
|
20
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monaco 调试装饰:glyph 断点 + 行装饰箭头 + 整行高亮。
|
|
3
|
+
* Monaco / VS Code 同源能力;业务只传行号,样式与 decoration 构造在本包。
|
|
4
|
+
*/
|
|
5
|
+
import type { editor as MonacoEditor } from 'monaco-editor'
|
|
6
|
+
import './debug-decorations.css'
|
|
7
|
+
|
|
8
|
+
export const RS_MONACO_DEBUG = {
|
|
9
|
+
bpGlyph: 'rs-monaco-debug-bp',
|
|
10
|
+
stackDeco: 'rs-monaco-debug-stack',
|
|
11
|
+
currentLine: 'rs-monaco-debug-current-line',
|
|
12
|
+
} as const
|
|
13
|
+
|
|
14
|
+
export interface MonacoDebugDecorationState {
|
|
15
|
+
/** 1-based 当前执行行;0 / 省略表示无 */
|
|
16
|
+
currentLine?: number
|
|
17
|
+
/** 1-based 断点行 */
|
|
18
|
+
breakpointLines?: number[]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** 构造调试 decorations(不调用 editor)。 */
|
|
22
|
+
export function buildMonacoDebugDecorations(
|
|
23
|
+
monaco: typeof import('monaco-editor'),
|
|
24
|
+
state: MonacoDebugDecorationState,
|
|
25
|
+
): MonacoEditor.IModelDeltaDecoration[] {
|
|
26
|
+
const decos: MonacoEditor.IModelDeltaDecoration[] = []
|
|
27
|
+
const stickiness = monaco.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
|
|
28
|
+
|
|
29
|
+
for (const line of state.breakpointLines ?? []) {
|
|
30
|
+
if (line <= 0) continue
|
|
31
|
+
decos.push({
|
|
32
|
+
range: new monaco.Range(line, 1, line, 1),
|
|
33
|
+
options: {
|
|
34
|
+
glyphMarginClassName: RS_MONACO_DEBUG.bpGlyph,
|
|
35
|
+
glyphMarginHoverMessage: { value: 'Breakpoint' },
|
|
36
|
+
stickiness,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const cur = state.currentLine ?? 0
|
|
42
|
+
if (cur > 0) {
|
|
43
|
+
decos.push({
|
|
44
|
+
range: new monaco.Range(cur, 1, cur, 1),
|
|
45
|
+
options: {
|
|
46
|
+
isWholeLine: true,
|
|
47
|
+
className: RS_MONACO_DEBUG.currentLine,
|
|
48
|
+
// 箭头放在 linesDecorations,比 glyph 更易与行号垂直对齐
|
|
49
|
+
linesDecorationsClassName: RS_MONACO_DEBUG.stackDeco,
|
|
50
|
+
overviewRuler: {
|
|
51
|
+
color: 'rgba(245, 158, 11, 0.85)',
|
|
52
|
+
position: monaco.editor.OverviewRulerLane.Center,
|
|
53
|
+
},
|
|
54
|
+
stickiness,
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return decos
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** 应用调试装饰,返回新的 decoration ids。 */
|
|
63
|
+
export function applyMonacoDebugDecorations(
|
|
64
|
+
editor: MonacoEditor.IStandaloneCodeEditor,
|
|
65
|
+
monaco: typeof import('monaco-editor'),
|
|
66
|
+
prevIds: string[],
|
|
67
|
+
state: MonacoDebugDecorationState,
|
|
68
|
+
): string[] {
|
|
69
|
+
return editor.deltaDecorations(prevIds, buildMonacoDebugDecorations(monaco, state))
|
|
70
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { setupMonacoWorkers } from './setup'
|
|
2
|
+
export type {
|
|
3
|
+
MonacoBuiltinLanguage,
|
|
4
|
+
MonacoLanguage,
|
|
5
|
+
MonacoSqlLanguageId,
|
|
6
|
+
} from './languages'
|
|
7
|
+
export {
|
|
8
|
+
ensureMongodbShellLanguage,
|
|
9
|
+
MONACO_MONGODB_SHELL_LANGUAGE,
|
|
10
|
+
MONACO_GENERIC_SQL_LANGUAGE,
|
|
11
|
+
MONACO_MYSQL_LANGUAGE,
|
|
12
|
+
MONACO_DAMENG_LANGUAGE,
|
|
13
|
+
MONACO_KINGBASE_LANGUAGE,
|
|
14
|
+
MONACO_PGSQL_LANGUAGE,
|
|
15
|
+
MONACO_SQLITE_LANGUAGE,
|
|
16
|
+
} from './languages'
|
|
17
|
+
export {
|
|
18
|
+
applyMonacoDebugDecorations,
|
|
19
|
+
buildMonacoDebugDecorations,
|
|
20
|
+
RS_MONACO_DEBUG,
|
|
21
|
+
} from './debug-decorations'
|
|
22
|
+
export type { MonacoDebugDecorationState } from './debug-decorations'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
MonacoBuiltinLanguage,
|
|
3
|
+
MonacoLanguage,
|
|
4
|
+
MonacoSqlLanguageId,
|
|
5
|
+
} from './types'
|
|
6
|
+
export {
|
|
7
|
+
MONACO_PGSQL_LANGUAGE,
|
|
8
|
+
MONACO_MYSQL_LANGUAGE,
|
|
9
|
+
MONACO_DAMENG_LANGUAGE,
|
|
10
|
+
MONACO_KINGBASE_LANGUAGE,
|
|
11
|
+
MONACO_CLICKHOUSE_LANGUAGE,
|
|
12
|
+
MONACO_SQLITE_LSP_LANGUAGE,
|
|
13
|
+
MONACO_SQLSERVER_LANGUAGE,
|
|
14
|
+
MONACO_ORACLE_LANGUAGE,
|
|
15
|
+
MONACO_SQLITE_LANGUAGE,
|
|
16
|
+
MONACO_GENERIC_SQL_LANGUAGE,
|
|
17
|
+
} from './types'
|
|
18
|
+
export {
|
|
19
|
+
ensureMongodbShellLanguage,
|
|
20
|
+
MONACO_MONGODB_SHELL_LANGUAGE,
|
|
21
|
+
} from './mongodb-shell'
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/** MongoDB Shell 专用 Monaco 语言(避免走未配置完整的 JS/TS Language Service)。 */
|
|
2
|
+
export const MONACO_MONGODB_SHELL_LANGUAGE = 'mongodb-shell'
|
|
3
|
+
|
|
4
|
+
let registered = false
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 注册 mongodb-shell:JS 风格着色与括号,不挂 TypeScript Worker。
|
|
8
|
+
* Shell 补全由 completionRequest 提供,与内置 TS 补全隔离。
|
|
9
|
+
*/
|
|
10
|
+
export function ensureMongodbShellLanguage(monaco: typeof import('monaco-editor')): void {
|
|
11
|
+
if (registered) return
|
|
12
|
+
registered = true
|
|
13
|
+
|
|
14
|
+
monaco.languages.register({ id: MONACO_MONGODB_SHELL_LANGUAGE })
|
|
15
|
+
monaco.languages.setLanguageConfiguration(MONACO_MONGODB_SHELL_LANGUAGE, {
|
|
16
|
+
comments: { lineComment: '//', blockComment: ['/*', '*/'] },
|
|
17
|
+
brackets: [
|
|
18
|
+
['{', '}'],
|
|
19
|
+
['[', ']'],
|
|
20
|
+
['(', ')'],
|
|
21
|
+
],
|
|
22
|
+
autoClosingPairs: [
|
|
23
|
+
{ open: '{', close: '}' },
|
|
24
|
+
{ open: '[', close: ']' },
|
|
25
|
+
{ open: '(', close: ')' },
|
|
26
|
+
{ open: "'", close: "'" },
|
|
27
|
+
{ open: '"', close: '"' },
|
|
28
|
+
{ open: '`', close: '`' },
|
|
29
|
+
],
|
|
30
|
+
surroundingPairs: [
|
|
31
|
+
{ open: '{', close: '}' },
|
|
32
|
+
{ open: '[', close: ']' },
|
|
33
|
+
{ open: '(', close: ')' },
|
|
34
|
+
{ open: "'", close: "'" },
|
|
35
|
+
{ open: '"', close: '"' },
|
|
36
|
+
{ open: '`', close: '`' },
|
|
37
|
+
],
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
monaco.languages.setMonarchTokensProvider(MONACO_MONGODB_SHELL_LANGUAGE, {
|
|
41
|
+
defaultToken: '',
|
|
42
|
+
tokenPostfix: '.mongodb-shell',
|
|
43
|
+
keywords: [
|
|
44
|
+
'db',
|
|
45
|
+
'use',
|
|
46
|
+
'show',
|
|
47
|
+
'help',
|
|
48
|
+
'exit',
|
|
49
|
+
'true',
|
|
50
|
+
'false',
|
|
51
|
+
'null',
|
|
52
|
+
'undefined',
|
|
53
|
+
'function',
|
|
54
|
+
'return',
|
|
55
|
+
'const',
|
|
56
|
+
'let',
|
|
57
|
+
'var',
|
|
58
|
+
'if',
|
|
59
|
+
'else',
|
|
60
|
+
'for',
|
|
61
|
+
'while',
|
|
62
|
+
'new',
|
|
63
|
+
'typeof',
|
|
64
|
+
],
|
|
65
|
+
typeKeywords: ['ObjectId', 'ISODate', 'NumberLong', 'NumberInt', 'NumberDecimal', 'UUID', 'BinData', 'Timestamp', 'MinKey', 'MaxKey', 'DBRef'],
|
|
66
|
+
operators: ['<=', '>=', '==', '!=', '===', '!==', '=>', '+', '-', '*', '/', '%', '&&', '||', '!', '?', ':', '='],
|
|
67
|
+
symbols: /[=><!~?:&|+\-*/^%]+/,
|
|
68
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
69
|
+
tokenizer: {
|
|
70
|
+
root: [
|
|
71
|
+
[/[{}]/, 'delimiter.bracket'],
|
|
72
|
+
[/[[\]]/, 'delimiter.array'],
|
|
73
|
+
[/[()]/, 'delimiter.parenthesis'],
|
|
74
|
+
[/[a-zA-Z_$][\w$]*/, {
|
|
75
|
+
cases: {
|
|
76
|
+
'@typeKeywords': 'type',
|
|
77
|
+
'@keywords': 'keyword',
|
|
78
|
+
'@default': 'identifier',
|
|
79
|
+
},
|
|
80
|
+
}],
|
|
81
|
+
[/\$[a-zA-Z_][\w$]*/, 'variable.predefined'],
|
|
82
|
+
[/\d*\.\d+([eE][-+]?\d+)?/, 'number.float'],
|
|
83
|
+
[/0[xX][0-9a-fA-F]+/, 'number.hex'],
|
|
84
|
+
[/\d+/, 'number'],
|
|
85
|
+
[/"([^"\\]|\\.)*$/, 'string.invalid'],
|
|
86
|
+
[/'([^'\\]|\\.)*$/, 'string.invalid'],
|
|
87
|
+
[/"/, 'string', '@string_double'],
|
|
88
|
+
[/'/, 'string', '@string_single'],
|
|
89
|
+
[/`/, 'string', '@string_backtick'],
|
|
90
|
+
[/\/\*/, 'comment', '@comment'],
|
|
91
|
+
[/\/\/.*$/, 'comment'],
|
|
92
|
+
[/[;,.]/, 'delimiter'],
|
|
93
|
+
[/@symbols/, {
|
|
94
|
+
cases: {
|
|
95
|
+
'@operators': 'operator',
|
|
96
|
+
'@default': '',
|
|
97
|
+
},
|
|
98
|
+
}],
|
|
99
|
+
],
|
|
100
|
+
comment: [
|
|
101
|
+
[/[^/*]+/, 'comment'],
|
|
102
|
+
[/\*\//, 'comment', '@pop'],
|
|
103
|
+
[/[/*]/, 'comment'],
|
|
104
|
+
],
|
|
105
|
+
string_double: [
|
|
106
|
+
[/[^\\"]+/, 'string'],
|
|
107
|
+
[/@escapes/, 'string.escape'],
|
|
108
|
+
[/\\./, 'string.escape.invalid'],
|
|
109
|
+
[/"/, 'string', '@pop'],
|
|
110
|
+
],
|
|
111
|
+
string_single: [
|
|
112
|
+
[/[^\\']+/, 'string'],
|
|
113
|
+
[/@escapes/, 'string.escape'],
|
|
114
|
+
[/\\./, 'string.escape.invalid'],
|
|
115
|
+
[/'/, 'string', '@pop'],
|
|
116
|
+
],
|
|
117
|
+
string_backtick: [
|
|
118
|
+
[/[^\\`]+/, 'string'],
|
|
119
|
+
[/@escapes/, 'string.escape'],
|
|
120
|
+
[/\\./, 'string.escape.invalid'],
|
|
121
|
+
[/`/, 'string', '@pop'],
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
})
|
|
125
|
+
}
|