niuma-ui 1.2.4 → 1.2.6
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 +23 -0
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/components/RsSplitPane.impl.js +6 -2
- package/dist/index.js +442 -156
- package/dist/vite-plugins/niuma-ui-host.d.ts +32 -3
- package/dist/vite-plugins/niuma-ui-host.js +103 -36
- package/dist/vite-plugins/rewrite-named-imports.d.ts +1 -1
- package/dist/vite-plugins/rewrite-named-imports.js +1 -1
- package/package.json +3 -9
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,29 @@
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.2.6] - 2026-09-01
|
|
10
|
+
|
|
11
|
+
### 修复
|
|
12
|
+
|
|
13
|
+
- `niumaUiHost` 不再把 `reka-ui` / `@lucide/vue` / `vue-sonner` 写进宿主 `optimizeDeps.include`。这些包在 pnpm 下只装在 niuma-ui 里,cloud / site 解析不到会告警。
|
|
14
|
+
- `RsSplitPane` 的 `collapse` / `expand` 在尺寸已到位时不再提交新数组、不再重复发事件。
|
|
15
|
+
|
|
16
|
+
### 变更
|
|
17
|
+
|
|
18
|
+
- `exports` 一律指向 `dist`(含 vite-plugins)。开发仓 `pnpm install` 时若还没有 dist,`prepare` 会编一次;npm 包没有 src,不会重编。`pnpm dev` 联调源码仍由 `niumaUiHost` 改写。
|
|
19
|
+
|
|
20
|
+
## [1.2.5] - 2026-08-30
|
|
21
|
+
|
|
22
|
+
### 变更
|
|
23
|
+
|
|
24
|
+
- 发布桶 `dist/index.js` 改为带 `from` 的真实 re-export,与 `.d.ts` 同形。宿主 `import { RsButton } from 'niuma-ui'` / `export { RsButton } from '@niuma/ui'` 在 `vite build` 下走包主入口,不再依赖改写插件。
|
|
25
|
+
- `niumaUiHost` 改写只服务 `pnpm dev`(源码 HMR)。`vite build` / CI 不改写导入。
|
|
26
|
+
- `exports` 增加 `"./*": "./dist/*"`,不再手补 `lib` / `icons` 等子目录。
|
|
27
|
+
|
|
28
|
+
### 修复
|
|
29
|
+
|
|
30
|
+
- `niumaUiHost` 改写宿主 `.vue` 时只解析 `<script>`。此前把整份 SFC 交给 `es-module-lexer`,Vite 8 / Rolldown 在 `</script>` 处 `Parse error`。
|
|
31
|
+
|
|
9
32
|
## [1.2.4] - 2026-08-30
|
|
10
33
|
|
|
11
34
|
### 变更
|
package/README.en.md
CHANGED
|
@@ -19,7 +19,7 @@ Built for ops consoles, database workbenches, and internal admin UIs. Marketing
|
|
|
19
19
|
- **Rs\* components** — Button, Form, Dialog, Table, Tree, Tabs, and more
|
|
20
20
|
- **Tooling-oriented** — Monaco, CodeMirror, xterm wrappers (import carefully in light apps)
|
|
21
21
|
- **Accessible primitives** — built on [Reka UI](https://reka-ui.com/); apps only consume `niuma-ui`
|
|
22
|
-
- **Vite-friendly** —
|
|
22
|
+
- **Vite-friendly** — `import { RsButton } from 'niuma-ui'` is the public API; `niumaUiHost` is serve-only HMR
|
|
23
23
|
|
|
24
24
|
## Requirements
|
|
25
25
|
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Vue 3 **工作台**设计系统:一致的 `Rs*` 组件、`--rs-*` token,以
|
|
|
19
19
|
- **Rs\* 组件**:Button、Form、Dialog、Table、Tree、Tabs 等完整交互控件
|
|
20
20
|
- **专业工具向**:Monaco、CodeMirror、xterm 等编辑器 / 终端封装(按需引入)
|
|
21
21
|
- **无障碍与焦点**:底层基于 [Reka UI](https://reka-ui.com/),业务层只消费 `niuma-ui`
|
|
22
|
-
- **Vite
|
|
22
|
+
- **Vite 友好**:`import { RsButton } from 'niuma-ui'` 即可打包;`niumaUiHost` 只服务本机 `pnpm dev` 联调源码
|
|
23
23
|
|
|
24
24
|
## 要求
|
|
25
25
|
|
|
@@ -337,7 +337,9 @@ var RsSplitPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
337
337
|
const index = indexOfKey(key);
|
|
338
338
|
if (index < 0) return;
|
|
339
339
|
const before = sizes.value.slice();
|
|
340
|
-
|
|
340
|
+
const next = collapseSplitPane(sizes.value, constraints.value, index);
|
|
341
|
+
if (splitSizesEqual(before, next)) return;
|
|
342
|
+
commit(next);
|
|
341
343
|
emitBoundaryTransitions(before, sizes.value);
|
|
342
344
|
emit("resize-end", sizes.value.slice());
|
|
343
345
|
}
|
|
@@ -345,7 +347,9 @@ var RsSplitPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
345
347
|
const index = indexOfKey(key);
|
|
346
348
|
if (index < 0) return;
|
|
347
349
|
const before = sizes.value.slice();
|
|
348
|
-
|
|
350
|
+
const next = expandSplitPane(sizes.value, constraints.value, index, resolveExpandSize(key, index, toSize));
|
|
351
|
+
if (splitSizesEqual(before, next)) return;
|
|
352
|
+
commit(next);
|
|
349
353
|
emitBoundaryTransitions(before, sizes.value);
|
|
350
354
|
emit("resize-end", sizes.value.slice());
|
|
351
355
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,156 +1,442 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
export { DEFAULT_PAGE_SIZE_OPTIONS, EMPTY_DATE_RANGE, EMPTY_TIME_RANGE, LUCIDE_ATTRIBUTION, LUCIDE_LICENSE, MONACO_DAMENG_LANGUAGE, MONACO_GENERIC_SQL_LANGUAGE, MONACO_KINGBASE_LANGUAGE, MONACO_MONGODB_SHELL_LANGUAGE, MONACO_MYSQL_LANGUAGE, MONACO_PGSQL_LANGUAGE, MONACO_POSTGRESQL_LANGUAGE, MONACO_SQLITE_LANGUAGE, RS_COMPONENT_SIZES, RS_COMPONENT_SIZE_ICON_PX, RS_DATETIME_FORMAT, RS_DATE_FORMAT, RS_DATE_PICKER_VALUE_FORMAT_PRESETS, RS_DRAWER_MAX_VIEWPORT_RATIO, RS_DRAWER_MIN_SIZE_PX, RS_FONT_SIZES, RS_FONT_SIZE_CSS, RS_FONT_WEIGHTS, RS_FONT_WEIGHT_CSS, RS_FORM_INJECTION_KEY, RS_FORM_ITEM_INJECTION_KEY, RS_FORM_LIST_INJECTION_KEY, RS_MONACO_DEBUG, RS_RADII, RS_RADIUS_CSS, RS_SELECT_EMPTY_VALUE, RS_TABLE_ANALYTICS_SHELL, RS_TABLE_API_KEY, RS_TABLE_API_OPTIONAL_METHODS, RS_TABLE_API_REQUIRED_METHODS, RS_TABLE_API_VERSION, RS_TABLE_COMPAT_API_VERSION, RS_TABLE_FEATURE_COMPOSABLE_MAP, RS_TABLE_NULL_DRAFT, RS_TABLE_PREFIX_COL_WIDTH, RS_TABLE_PROP_DEFAULTS, RS_TABLE_STABLE_EMITS, RS_TABLE_SUMMARY_FEATURE_ID, RS_TABLE_VIEW_KEY, RS_TIME_MINUTE_FORMAT, RS_TIME_SECONDS_FORMAT, RS_TOAST_DEFAULT_GAP, RS_TOAST_DEFAULT_POSITION, RsAlert_default as RsAlert, RsAvatar_default as RsAvatar, RsBadge_default as RsBadge, RsBreadcrumb_default as RsBreadcrumb, RsButton_default as RsButton, RsCalendarGrid_default as RsCalendarGrid, RsCard_default as RsCard, RsCheckbox_default as RsCheckbox, RsCodeBlock_default as RsCodeBlock, RsCodeEditor_default as RsCodeEditor, RsConfigProvider_default as RsConfigProvider, RsConfirmDialog_default as RsConfirmDialog, RsContainer_default as RsContainer, RsContextMenu_default as RsContextMenu, RsDatePicker_default as RsDatePicker, RsDateTimePicker_default as RsDateTimePicker, RsDescriptions_default as RsDescriptions, RsDescriptionsItem_default as RsDescriptionsItem, RsDialog_default as RsDialog, RsDivider_default as RsDivider, RsDrawer_default as RsDrawer, RsDropdown_default as RsDropdown, RsDynamicTags_default as RsDynamicTags, RsEmpty_default as RsEmpty, RsForm_default as RsForm, RsFormItem_default as RsFormItem, RsFormList_default as RsFormList, RsIcon_default as RsIcon, RsInput_default as RsInput, RsInputNumber_default as RsInputNumber, RsLabel_default as RsLabel, RsLink_default as RsLink, RsLoading_default as RsLoading, RsLoadingBar_default as RsLoadingBar, RsMarkdown_default as RsMarkdown, RsMenu_default as RsMenu, RsMonacoEditor_default as RsMonacoEditor, RsPagination_default as RsPagination, RsPopover_default as RsPopover, RsProseEditor_default as RsProseEditor, RsRadio_default as RsRadio, RsRadioItem_default as RsRadioItem, RsScrollbar_default as RsScrollbar, RsSelect_default as RsSelect, RsSidebar_default as RsSidebar, RsSidebarGroup_default as RsSidebarGroup, RsSidebarItem_default as RsSidebarItem, RsSplitPane_default as RsSplitPane, RsStatCard_default as RsStatCard, RsSteps_default as RsSteps, RsSwitch_default as RsSwitch, RsTable_default as RsTable, RsTableBody_default as RsTableBody, RsTableCellEditor_default as RsTableCellEditor, RsTableColGroup_default as RsTableColGroup, RsTableHeader_default as RsTableHeader, RsTableModuleRegistry, RsTableSummaryRow_default as RsTableSummaryRow, RsTabs_default as RsTabs, RsTag_default as RsTag, RsTerminal_default as RsTerminal, RsTimePicker_default as RsTimePicker, RsTimePickerColumns_default as RsTimePickerColumns, RsToaster_default as RsToaster, RsToolbar_default as RsToolbar, RsTooltip_default as RsTooltip, RsTooltipProvider_default as RsTooltipProvider, RsTree_default as RsTree, RsUpload_default as RsUpload, RsVirtualList_default as RsVirtualList, TIME_HOUR_OPTIONS, TIME_SECOND_OPTIONS, aggregateColumnSummary, applyMonacoDebugDecorations, applySplitResize, applyTheme, assembleRsTableApi, beginClipboardPrefetch, bindRsTableViewContext, buildAnsiColorDemo, buildLocalInputRules, buildMonacoDebugDecorations, buildTabContextMenuItems, buildTableChartSeries, buildTableChartSeriesList, buildTableEntries, buildTableSummaryCells, buildTableTreeEntries, buildTableTreeNodeIndex, buildTreeNodeIndex, clampColumnWidth, clampNumber, clampPage, clampRsDrawerSize, cloneFormFieldValue, codeEditorLanguageLabel, collapseSplitPane, collectDescendantKeys, collectExpandableKeys, collectHalfCheckedKeys, collectTableTreeDescendantKeys, collectTableTreeExpandableKeys, collectTableTreeHalfCheckedKeys, compareTableValues, concatNamePath, containsEscapeSequence, copyTextToClipboard, copyTextWithExecCommand, createAnalyticsTableFeature, createBuiltinTableFeatures, createChartSeriesTableFeature, createContextMenuTableFeature, createInitialColumnWidths, createOverlayTableFeature, createPageSizeSelectOptions, createRsConfigState, createRsTableApi, createRsTableEditEmitBridge, createRsTableFeatureHost, createRsTableViewContext, createToolbarTableFeature, createTranslator, createUploadFileFromContent, defaultTreeFilterNode, downloadUploadFile, ensureMongodbShellLanguage, escapeHtml, expandSplitPane, filterTableRows, filterTableTreeRows, filterTreeNodes, fixedCellStyle, flattenTreeNodeIds, flattenVisibleCountRough, flattenVisibleTableTreeEntries, flattenVisibleTreeNodes, formatDateDisplay, formatDateParts, formatDateRangeDisplay, formatDateTimeDisplay, formatDateTimeValue, formatDateValue, formatFileSize, formatIsoUtcToLocal, formatNumberValue, formatTimeFromParts, formatTimeParts, formatTimeRangeDisplay, formatTimeUnitLabel, formatTimeValue, fromComboboxValue, fromInternalPickerValue, fromModelValue, getByNamePath, getCellValue, getInputRuleMessage, getNextTabAfterBatchClose, getNextTabAfterClose, getPageCount, getPaginationRange, getSortOrderForKey, getSortPriorityForKey, getTableTreeChildren, getTableTreeIsLeaf, getTerminalThemePalette, getTimeMinuteOptions, getTreeChildren, getTreeKey, getTreeLabel, groupTableRows, hasByNamePath, hasStableTableTreeRowKey, hasTableSummaryConfig, hasTableTreeChildren, hasTreeChildren, injectExpandRows, inputRuleMessageKeys, isCodeMirrorLightTheme, isDateRangeEmpty, isDateRangeOrdered, isDateTimeRangeOrdered, isFileAccepted, isIndexSegment, isNearScrollBottom, isNullDraft, isNumberInputInterim, isRsButtonFilledVariant, isRsDialogWidthPreset, isRsFormItemBoundControl, isRsIconName, isRsSplitPaneAutoSize, isRsTableApi, isSafeHref, isSafeImageSrc, isSelectLabeledValue, isSplitPaneCollapsed, isStepSeparatorCompleted, isTabClosable, isTabFixed, isTabRenamable, isTableRowDisabled, isTimeRangeEmpty, isTimeRangeOrdered, isTimeWithinBounds, isTreeAncestorKey, listBatchColumnTargets, listEditableCells, looksLikeIsoDateTimeWithTz, lucideIconCount, mapRsTableSeriesToEChartsOption, matchFormRuleTrigger, measureRsTablePrefixWidth, mergeTerminalTheme, mergeUploadFiles, namePathKey, navigateEditableCell, navigateGridCell, normalizeCommittedNumber, normalizeFormRules, normalizeNamePath, normalizeSelectOptions, normalizeSplitSizes, nullToEditText, openRsDialog, optionDisplayLabel, packSelectModel, parseClipboardGrid, parseColumnWidth, parseCssLengthToPx, parseDateTimeValue, parseDateValue, parseLocalDateTimeToUtcIso, parseNumberInput, parseTimeValue, prefetchClipboardText, prewarmCodeMirrorEditor, provideRsFormItemContext, provideRsFormListContext, provideRsTableView, readClipboardText, readCodeFontFamily, readCodeFontSizePx, readCssLengthPx, readCssVar, readDocumentTheme, readRootFontSizePx, readTerminalFontFamily, readTerminalFontSizePx, readTerminalFontWeight, readTerminalFontWeightBold, readTerminalThemeFromCss, removeUploadFileAt, renderMarkdown, renderMarkdownInline, reorderColumnKeys, reorderTabItems, reorderTableRows, resolveAccordionExpandedKeys, resolveBuiltinTableFeatures, resolveCodeEditorLanguage, resolveCodeEditorSize, resolveCodeEditorTheme, resolveCodeMirrorLanguage, resolveColumnOrder, resolveDialogOverlayStyle, resolveDrawerOverlayStyle, resolveEntryKey, resolveFieldRules, resolveFixedColumnStyles, resolveGridNavDirection, resolveInstanceFeatures, resolveItemSize, resolveMarkdownHeight, resolveMarkdownMode, resolveNumberPrecision, resolveOrderedColumns, resolveRowKey, resolveRsComponentSize, resolveRsDialogCssWidth, resolveRsDialogWidthPx, resolveRsDrawerDimensionCss, resolveRsDrawerSizeCss, resolveRsDrawerSizePx, resolveRuleMessage, resolveSelectAllState, resolveSelectableRowKeys, resolveSplitAutoFlags, resolveSplitConstraints, resolveStepStatus, resolveTableSize, resolveTableTreeCheckState, resolveTableTreeIndent, resolveTableTreeRowKey, resolveTableVirtualEnabled, resolveTabsToClose, resolveTerminalTheme, resolveTreeCheckState, resolveTreeFieldNames, resolveTreeFocusKey, resolveTreeIndent, resolveTreeRowHeight, resolveTreeVirtualEnabled, resolveUploadFileIcon, resolveVirtualListHeight, resolveVisibleTabValues, restoreSelectValue, roundToPrecision, rsCommonIconNames, rsConfirm, rsFeedbackIconClass, rsRadiusCss, rsToastPositions, runFormFieldRules, runInputValidation, runRsConfirmBeforeClose, runRsDialogBeforeClose, runRsDrawerBeforeClose, scrollTimeColumnToValue, selectRowKeys, selectRowKeysByClick, setByNamePath, setupMonacoWorkers, setupTableFeatures, shouldShowTreeCheckbox, slicePageData, sliceVirtualTableEntries, sliceVirtualTreeNodes, sortTableRows, sortTableRowsMulti, sortTableTreeRows, splitSizesEqual, splitTreeLabelHighlight, stepNumberValue, supportsRsButtonTone, terminalShortcutLabel, themePresets, toComboboxValue, toInternalPickerValue, toModelValue, toRangeEndpointString, toggleExpandedRowKeys, toggleMultiSortState, toggleRowSelection, toggleSelectAll, toggleSortState, toggleTableTreeCheck, toggleTreeCheck, unwrapSelectEntry, useResolvedRsComponentSize, useResolvedRsRadius, useRsConfig, useRsConfigOptional, useRsFormContext, useRsFormField, useRsFormItemContext, useRsFormListContext, useRsI18n, useRsLoadingBar, useRsTable, useRsTableA11y, useRsTableApi, useRsTableChartBridge, useRsTableColumnLayout, useRsTableColumnResize, useRsTableColumnVirtual, useRsTableColumns, useRsTableContextMenu, useRsTableCore, useRsTableEditActions, useRsTableEditLayer, useRsTableEngine, useRsTableGridKeyboard, useRsTableHeadless, useRsTableInteraction, useRsTableScrollHost, useRsTableScrollLayout, useRsTableSelectionSource, useRsTableShell, useRsTableShellChrome, useRsTableSummary, useRsTableView, useRsTableViewProvide, useRsTableVirtual, useRsToast, validateCellValueAsync, validateDateRangeValue, validateDateTimeRangeValue, validateDateTimeValue, validateDateValue, validateInputRule, validateTimeRangeValue, validateTimeValue, validateUploadFiles, writeClipboardText };
|
|
1
|
+
export { DEFAULT_PAGE_SIZE_OPTIONS } from './components/pagination-utils.js'
|
|
2
|
+
export { EMPTY_DATE_RANGE } from './components/date-picker-utils.js'
|
|
3
|
+
export { EMPTY_TIME_RANGE } from './components/time-picker-utils.js'
|
|
4
|
+
export { LUCIDE_ATTRIBUTION } from './icons/lucide.js'
|
|
5
|
+
export { LUCIDE_LICENSE } from './icons/lucide.js'
|
|
6
|
+
export { MONACO_DAMENG_LANGUAGE } from './monaco/languages/types.js'
|
|
7
|
+
export { MONACO_GENERIC_SQL_LANGUAGE } from './monaco/languages/types.js'
|
|
8
|
+
export { MONACO_KINGBASE_LANGUAGE } from './monaco/languages/types.js'
|
|
9
|
+
export { MONACO_MONGODB_SHELL_LANGUAGE } from './monaco/languages/mongodb-shell.js'
|
|
10
|
+
export { MONACO_MYSQL_LANGUAGE } from './monaco/languages/types.js'
|
|
11
|
+
export { MONACO_PGSQL_LANGUAGE } from './monaco/languages/types.js'
|
|
12
|
+
export { MONACO_POSTGRESQL_LANGUAGE } from './monaco/languages/types.js'
|
|
13
|
+
export { MONACO_SQLITE_LANGUAGE } from './monaco/languages/types.js'
|
|
14
|
+
export { RS_COMPONENT_SIZES } from './theme/types.js'
|
|
15
|
+
export { RS_COMPONENT_SIZE_ICON_PX } from './theme/types.js'
|
|
16
|
+
export { RS_DATETIME_FORMAT } from './lib/rs-dayjs.js'
|
|
17
|
+
export { RS_DATE_FORMAT } from './lib/rs-dayjs.js'
|
|
18
|
+
export { RS_DATE_PICKER_VALUE_FORMAT_PRESETS } from './components/date-picker-utils.js'
|
|
19
|
+
export { RS_DRAWER_MAX_VIEWPORT_RATIO } from './components/drawer-utils.js'
|
|
20
|
+
export { RS_DRAWER_MIN_SIZE_PX } from './components/drawer-utils.js'
|
|
21
|
+
export { RS_FONT_SIZES } from './theme/types.js'
|
|
22
|
+
export { RS_FONT_SIZE_CSS } from './theme/types.js'
|
|
23
|
+
export { RS_FONT_WEIGHTS } from './theme/types.js'
|
|
24
|
+
export { RS_FONT_WEIGHT_CSS } from './theme/types.js'
|
|
25
|
+
export { RS_FORM_INJECTION_KEY } from './components/form-utils.js'
|
|
26
|
+
export { RS_FORM_ITEM_INJECTION_KEY } from './components/form-utils.js'
|
|
27
|
+
export { RS_FORM_LIST_INJECTION_KEY } from './components/form-utils.js'
|
|
28
|
+
export { RS_MONACO_DEBUG } from './monaco/debug-decorations2.js'
|
|
29
|
+
export { RS_RADII } from './theme/types.js'
|
|
30
|
+
export { RS_RADIUS_CSS } from './theme/types.js'
|
|
31
|
+
export { RS_SELECT_EMPTY_VALUE } from './components/select-utils.js'
|
|
32
|
+
export { RS_TABLE_ANALYTICS_SHELL } from './components/table/table-features.js'
|
|
33
|
+
export { RS_TABLE_API_KEY } from './components/table/rs-table-api.js'
|
|
34
|
+
export { RS_TABLE_API_OPTIONAL_METHODS } from './components/table/rs-table-compat-matrix.js'
|
|
35
|
+
export { RS_TABLE_API_REQUIRED_METHODS } from './components/table/rs-table-compat-matrix.js'
|
|
36
|
+
export { RS_TABLE_API_VERSION } from './components/table/rs-table-api.js'
|
|
37
|
+
export { RS_TABLE_COMPAT_API_VERSION } from './components/table/rs-table-compat-matrix.js'
|
|
38
|
+
export { RS_TABLE_FEATURE_COMPOSABLE_MAP } from './components/table/table-features.js'
|
|
39
|
+
export { RS_TABLE_NULL_DRAFT } from './components/table/table-edit-utils.js'
|
|
40
|
+
export { RS_TABLE_PREFIX_COL_WIDTH } from './composables/useRsTableColumnVirtual.js'
|
|
41
|
+
export { RS_TABLE_PROP_DEFAULTS } from './components/table/rs-table-props.js'
|
|
42
|
+
export { RS_TABLE_STABLE_EMITS } from './components/table/rs-table-compat-matrix.js'
|
|
43
|
+
export { RS_TABLE_SUMMARY_FEATURE_ID } from './composables/useRsTableSummary.js'
|
|
44
|
+
export { RS_TABLE_VIEW_KEY } from './components/table/rs-table-view-context.js'
|
|
45
|
+
export { RS_TIME_MINUTE_FORMAT } from './lib/rs-dayjs.js'
|
|
46
|
+
export { RS_TIME_SECONDS_FORMAT } from './lib/rs-dayjs.js'
|
|
47
|
+
export { RS_TOAST_DEFAULT_GAP } from './components/overlay-utils.js'
|
|
48
|
+
export { RS_TOAST_DEFAULT_POSITION } from './components/overlay-utils.js'
|
|
49
|
+
export { default as RsAlert } from './components/RsAlert.js'
|
|
50
|
+
export { default as RsAvatar } from './components/RsAvatar.js'
|
|
51
|
+
export { default as RsBadge } from './components/RsBadge.js'
|
|
52
|
+
export { default as RsBreadcrumb } from './components/RsBreadcrumb.js'
|
|
53
|
+
export { default as RsButton } from './components/RsButton.js'
|
|
54
|
+
export { default as RsCalendarGrid } from './components/RsCalendarGrid.js'
|
|
55
|
+
export { default as RsCard } from './components/RsCard.js'
|
|
56
|
+
export { default as RsCheckbox } from './components/RsCheckbox.js'
|
|
57
|
+
export { default as RsCodeBlock } from './components/RsCodeBlock.js'
|
|
58
|
+
export { default as RsCodeEditor } from './components/RsCodeEditor.js'
|
|
59
|
+
export { default as RsConfigProvider } from './components/RsConfigProvider.js'
|
|
60
|
+
export { default as RsConfirmDialog } from './components/RsConfirmDialog.js'
|
|
61
|
+
export { default as RsContainer } from './components/RsContainer.js'
|
|
62
|
+
export { default as RsContextMenu } from './components/RsContextMenu.js'
|
|
63
|
+
export { default as RsDatePicker } from './components/RsDatePicker.js'
|
|
64
|
+
export { default as RsDateTimePicker } from './components/RsDateTimePicker.js'
|
|
65
|
+
export { default as RsDescriptions } from './components/RsDescriptions.js'
|
|
66
|
+
export { default as RsDescriptionsItem } from './components/RsDescriptionsItem.js'
|
|
67
|
+
export { default as RsDialog } from './components/RsDialog.js'
|
|
68
|
+
export { default as RsDivider } from './components/RsDivider.js'
|
|
69
|
+
export { default as RsDrawer } from './components/RsDrawer.js'
|
|
70
|
+
export { default as RsDropdown } from './components/RsDropdown.js'
|
|
71
|
+
export { default as RsDynamicTags } from './components/RsDynamicTags.js'
|
|
72
|
+
export { default as RsEmpty } from './components/RsEmpty.js'
|
|
73
|
+
export { default as RsForm } from './components/RsForm.js'
|
|
74
|
+
export { default as RsFormItem } from './components/RsFormItem.js'
|
|
75
|
+
export { default as RsFormList } from './components/RsFormList.js'
|
|
76
|
+
export { default as RsIcon } from './components/RsIcon.js'
|
|
77
|
+
export { default as RsInput } from './components/RsInput.js'
|
|
78
|
+
export { default as RsInputNumber } from './components/RsInputNumber.js'
|
|
79
|
+
export { default as RsLabel } from './components/RsLabel.js'
|
|
80
|
+
export { default as RsLink } from './components/RsLink.js'
|
|
81
|
+
export { default as RsLoading } from './components/RsLoading.js'
|
|
82
|
+
export { default as RsLoadingBar } from './components/RsLoadingBar.js'
|
|
83
|
+
export { default as RsMarkdown } from './components/RsMarkdown.js'
|
|
84
|
+
export { default as RsMenu } from './components/RsMenu.js'
|
|
85
|
+
export { default as RsMonacoEditor } from './components/RsMonacoEditor.js'
|
|
86
|
+
export { default as RsPagination } from './components/RsPagination.js'
|
|
87
|
+
export { default as RsPopover } from './components/RsPopover.js'
|
|
88
|
+
export { default as RsProseEditor } from './components/RsProseEditor.js'
|
|
89
|
+
export { default as RsRadio } from './components/RsRadio.js'
|
|
90
|
+
export { default as RsRadioItem } from './components/RsRadioItem.js'
|
|
91
|
+
export { default as RsScrollbar } from './components/RsScrollbar.js'
|
|
92
|
+
export { default as RsSelect } from './components/RsSelect.js'
|
|
93
|
+
export { default as RsSidebar } from './components/RsSidebar.js'
|
|
94
|
+
export { default as RsSidebarGroup } from './components/RsSidebarGroup.js'
|
|
95
|
+
export { default as RsSidebarItem } from './components/RsSidebarItem.js'
|
|
96
|
+
export { default as RsSplitPane } from './components/RsSplitPane.js'
|
|
97
|
+
export { default as RsStatCard } from './components/RsStatCard.js'
|
|
98
|
+
export { default as RsSteps } from './components/RsSteps.js'
|
|
99
|
+
export { default as RsSwitch } from './components/RsSwitch.js'
|
|
100
|
+
export { default as RsTable } from './components/RsTable.js'
|
|
101
|
+
export { default as RsTableBody } from './components/table/RsTableBody.js'
|
|
102
|
+
export { default as RsTableCellEditor } from './components/table/RsTableCellEditor.js'
|
|
103
|
+
export { default as RsTableColGroup } from './components/table/RsTableColGroup.js'
|
|
104
|
+
export { default as RsTableHeader } from './components/table/RsTableHeader.js'
|
|
105
|
+
export { RsTableModuleRegistry } from './components/table/rs-table-module-registry.js'
|
|
106
|
+
export { default as RsTableSummaryRow } from './components/table/RsTableSummaryRow.js'
|
|
107
|
+
export { default as RsTabs } from './components/RsTabs.js'
|
|
108
|
+
export { default as RsTag } from './components/RsTag.js'
|
|
109
|
+
export { default as RsTerminal } from './components/RsTerminal.js'
|
|
110
|
+
export { default as RsTimePicker } from './components/RsTimePicker.js'
|
|
111
|
+
export { default as RsTimePickerColumns } from './components/RsTimePickerColumns.js'
|
|
112
|
+
export { default as RsToaster } from './components/RsToaster.js'
|
|
113
|
+
export { default as RsToolbar } from './components/RsToolbar.js'
|
|
114
|
+
export { default as RsTooltip } from './components/RsTooltip.js'
|
|
115
|
+
export { default as RsTooltipProvider } from './components/RsTooltipProvider.js'
|
|
116
|
+
export { default as RsTree } from './components/RsTree.js'
|
|
117
|
+
export { default as RsUpload } from './components/RsUpload.js'
|
|
118
|
+
export { default as RsVirtualList } from './components/RsVirtualList.js'
|
|
119
|
+
export { TIME_HOUR_OPTIONS } from './components/time-picker-utils.js'
|
|
120
|
+
export { TIME_SECOND_OPTIONS } from './components/time-picker-utils.js'
|
|
121
|
+
export { aggregateColumnSummary } from './components/table/table-summary-utils.js'
|
|
122
|
+
export { applyMonacoDebugDecorations } from './monaco/debug-decorations2.js'
|
|
123
|
+
export { applySplitResize } from './components/split-pane-utils.js'
|
|
124
|
+
export { applyTheme } from './theme/apply.js'
|
|
125
|
+
export { assembleRsTableApi } from './composables/assembleRsTableApi.js'
|
|
126
|
+
export { beginClipboardPrefetch } from './utils/rs-clipboard.js'
|
|
127
|
+
export { bindRsTableViewContext } from './composables/bindRsTableViewContext.js'
|
|
128
|
+
export { buildAnsiColorDemo } from './components/terminal-utils.js'
|
|
129
|
+
export { buildLocalInputRules } from './components/form-rules.js'
|
|
130
|
+
export { buildMonacoDebugDecorations } from './monaco/debug-decorations2.js'
|
|
131
|
+
export { buildTabContextMenuItems } from './components/tabs-utils.js'
|
|
132
|
+
export { buildTableChartSeries } from './components/table/table-chart-utils.js'
|
|
133
|
+
export { buildTableChartSeriesList } from './components/table/table-chart-utils.js'
|
|
134
|
+
export { buildTableEntries } from './components/table-utils.js'
|
|
135
|
+
export { buildTableSummaryCells } from './components/table/table-summary-utils.js'
|
|
136
|
+
export { buildTableTreeEntries } from './components/table-utils.js'
|
|
137
|
+
export { buildTableTreeNodeIndex } from './components/table-utils.js'
|
|
138
|
+
export { buildTreeNodeIndex } from './components/tree-utils.js'
|
|
139
|
+
export { clampColumnWidth } from './components/table-utils.js'
|
|
140
|
+
export { clampNumber } from './components/input-number-utils.js'
|
|
141
|
+
export { clampPage } from './components/pagination-utils.js'
|
|
142
|
+
export { clampRsDrawerSize } from './components/drawer-utils.js'
|
|
143
|
+
export { cloneFormFieldValue } from './components/form-utils.js'
|
|
144
|
+
export { codeEditorLanguageLabel } from './components/code-editor-utils.js'
|
|
145
|
+
export { collapseSplitPane } from './components/split-pane-utils.js'
|
|
146
|
+
export { collectDescendantKeys } from './components/tree-utils.js'
|
|
147
|
+
export { collectExpandableKeys } from './components/tree-utils.js'
|
|
148
|
+
export { collectHalfCheckedKeys } from './components/tree-utils.js'
|
|
149
|
+
export { collectTableTreeDescendantKeys } from './components/table-utils.js'
|
|
150
|
+
export { collectTableTreeExpandableKeys } from './components/table-utils.js'
|
|
151
|
+
export { collectTableTreeHalfCheckedKeys } from './components/table-utils.js'
|
|
152
|
+
export { compareTableValues } from './components/table-utils.js'
|
|
153
|
+
export { concatNamePath } from './components/form-path.js'
|
|
154
|
+
export { containsEscapeSequence } from './components/terminal-utils.js'
|
|
155
|
+
export { copyTextToClipboard } from './utils/rs-clipboard.js'
|
|
156
|
+
export { copyTextWithExecCommand } from './utils/rs-clipboard.js'
|
|
157
|
+
export { createAnalyticsTableFeature } from './components/table/table-features.js'
|
|
158
|
+
export { createBuiltinTableFeatures } from './components/table/table-features.js'
|
|
159
|
+
export { createChartSeriesTableFeature } from './components/table/table-features.js'
|
|
160
|
+
export { createContextMenuTableFeature } from './components/table/table-features.js'
|
|
161
|
+
export { createInitialColumnWidths } from './components/table-utils.js'
|
|
162
|
+
export { createOverlayTableFeature } from './components/table/table-features.js'
|
|
163
|
+
export { createPageSizeSelectOptions } from './components/pagination-utils.js'
|
|
164
|
+
export { createRsConfigState } from './composables/useRsConfig.js'
|
|
165
|
+
export { createRsTableApi } from './components/table/rs-table-api.js'
|
|
166
|
+
export { createRsTableEditEmitBridge } from './composables/createRsTableEditEmitBridge.js'
|
|
167
|
+
export { createRsTableFeatureHost } from './components/table/rs-table-feature-host.js'
|
|
168
|
+
export { createRsTableViewContext } from './components/table/rs-table-view-context.js'
|
|
169
|
+
export { createToolbarTableFeature } from './components/table/table-features.js'
|
|
170
|
+
export { createTranslator } from './composables/useRsI18n.js'
|
|
171
|
+
export { createUploadFileFromContent } from './components/upload-utils.js'
|
|
172
|
+
export { defaultTreeFilterNode } from './components/tree-utils.js'
|
|
173
|
+
export { downloadUploadFile } from './components/upload-utils.js'
|
|
174
|
+
export { ensureMongodbShellLanguage } from './monaco/languages/mongodb-shell.js'
|
|
175
|
+
export { escapeHtml } from './components/markdown-utils.js'
|
|
176
|
+
export { expandSplitPane } from './components/split-pane-utils.js'
|
|
177
|
+
export { filterTableRows } from './components/table-utils.js'
|
|
178
|
+
export { filterTableTreeRows } from './components/table-utils.js'
|
|
179
|
+
export { filterTreeNodes } from './components/tree-utils.js'
|
|
180
|
+
export { fixedCellStyle } from './components/table-utils.js'
|
|
181
|
+
export { flattenTreeNodeIds } from './components/tree-utils.js'
|
|
182
|
+
export { flattenVisibleCountRough } from './composables/useRsTableVirtual.js'
|
|
183
|
+
export { flattenVisibleTableTreeEntries } from './components/table-utils.js'
|
|
184
|
+
export { flattenVisibleTreeNodes } from './components/tree-utils.js'
|
|
185
|
+
export { formatDateDisplay } from './components/date-picker-utils.js'
|
|
186
|
+
export { formatDateParts } from './components/date-picker-utils.js'
|
|
187
|
+
export { formatDateRangeDisplay } from './components/date-picker-utils.js'
|
|
188
|
+
export { formatDateTimeDisplay } from './components/date-picker-utils.js'
|
|
189
|
+
export { formatDateTimeValue } from './components/date-picker-utils.js'
|
|
190
|
+
export { formatDateValue } from './components/date-picker-utils.js'
|
|
191
|
+
export { formatFileSize } from './components/upload-utils.js'
|
|
192
|
+
export { formatIsoUtcToLocal } from './lib/iso-local-datetime.js'
|
|
193
|
+
export { formatNumberValue } from './components/input-number-utils.js'
|
|
194
|
+
export { formatTimeFromParts } from './components/time-picker-utils.js'
|
|
195
|
+
export { formatTimeParts } from './components/time-picker-utils.js'
|
|
196
|
+
export { formatTimeRangeDisplay } from './components/time-picker-utils.js'
|
|
197
|
+
export { formatTimeUnitLabel } from './components/time-picker-utils.js'
|
|
198
|
+
export { formatTimeValue } from './components/time-picker-utils.js'
|
|
199
|
+
export { fromComboboxValue } from './components/select-utils.js'
|
|
200
|
+
export { fromInternalPickerValue } from './components/date-picker-utils.js'
|
|
201
|
+
export { fromModelValue } from './components/input-number-utils.js'
|
|
202
|
+
export { getByNamePath } from './components/form-path.js'
|
|
203
|
+
export { getCellValue } from './components/table-utils.js'
|
|
204
|
+
export { getInputRuleMessage } from './components/input-rules.js'
|
|
205
|
+
export { getNextTabAfterBatchClose } from './components/tabs-utils.js'
|
|
206
|
+
export { getNextTabAfterClose } from './components/tabs-utils.js'
|
|
207
|
+
export { getPageCount } from './components/pagination-utils.js'
|
|
208
|
+
export { getPaginationRange } from './components/pagination-utils.js'
|
|
209
|
+
export { getSortOrderForKey } from './components/table-utils.js'
|
|
210
|
+
export { getSortPriorityForKey } from './components/table-utils.js'
|
|
211
|
+
export { getTableTreeChildren } from './components/table-utils.js'
|
|
212
|
+
export { getTableTreeIsLeaf } from './components/table-utils.js'
|
|
213
|
+
export { getTerminalThemePalette } from './components/terminal-utils.js'
|
|
214
|
+
export { getTimeMinuteOptions } from './components/time-picker-utils.js'
|
|
215
|
+
export { getTreeChildren } from './components/tree-utils.js'
|
|
216
|
+
export { getTreeKey } from './components/tree-utils.js'
|
|
217
|
+
export { getTreeLabel } from './components/tree-utils.js'
|
|
218
|
+
export { groupTableRows } from './components/table-utils.js'
|
|
219
|
+
export { hasByNamePath } from './components/form-path.js'
|
|
220
|
+
export { hasStableTableTreeRowKey } from './components/table-utils.js'
|
|
221
|
+
export { hasTableSummaryConfig } from './components/table/table-summary-utils.js'
|
|
222
|
+
export { hasTableTreeChildren } from './components/table-utils.js'
|
|
223
|
+
export { hasTreeChildren } from './components/tree-utils.js'
|
|
224
|
+
export { injectExpandRows } from './components/table-utils.js'
|
|
225
|
+
export { inputRuleMessageKeys } from './components/input-rules.js'
|
|
226
|
+
export { isCodeMirrorLightTheme } from './components/code-mirror-lang.js'
|
|
227
|
+
export { isDateRangeEmpty } from './components/date-picker-utils.js'
|
|
228
|
+
export { isDateRangeOrdered } from './components/date-picker-utils.js'
|
|
229
|
+
export { isDateTimeRangeOrdered } from './components/date-picker-utils.js'
|
|
230
|
+
export { isFileAccepted } from './components/upload-utils.js'
|
|
231
|
+
export { isIndexSegment } from './components/form-path.js'
|
|
232
|
+
export { isNearScrollBottom } from './components/table-utils.js'
|
|
233
|
+
export { isNullDraft } from './components/table/table-edit-utils.js'
|
|
234
|
+
export { isNumberInputInterim } from './components/input-number-utils.js'
|
|
235
|
+
export { isRsButtonFilledVariant } from './components/button-utils.js'
|
|
236
|
+
export { isRsDialogWidthPreset } from './components/dialog-utils.js'
|
|
237
|
+
export { isRsFormItemBoundControl } from './components/form-utils.js'
|
|
238
|
+
export { isRsIconName } from './icons/lucide.js'
|
|
239
|
+
export { isRsSplitPaneAutoSize } from './components/split-pane-utils.js'
|
|
240
|
+
export { isRsTableApi } from './components/table/rs-table-api.js'
|
|
241
|
+
export { isSafeHref } from './components/markdown-utils.js'
|
|
242
|
+
export { isSafeImageSrc } from './components/markdown-utils.js'
|
|
243
|
+
export { isSelectLabeledValue } from './components/select-utils.js'
|
|
244
|
+
export { isSplitPaneCollapsed } from './components/split-pane-utils.js'
|
|
245
|
+
export { isStepSeparatorCompleted } from './components/steps-utils.js'
|
|
246
|
+
export { isTabClosable } from './components/tabs-utils.js'
|
|
247
|
+
export { isTabFixed } from './components/tabs-utils.js'
|
|
248
|
+
export { isTabRenamable } from './components/tabs-utils.js'
|
|
249
|
+
export { isTableRowDisabled } from './components/table-utils.js'
|
|
250
|
+
export { isTimeRangeEmpty } from './components/time-picker-utils.js'
|
|
251
|
+
export { isTimeRangeOrdered } from './components/time-picker-utils.js'
|
|
252
|
+
export { isTimeWithinBounds } from './components/time-picker-utils.js'
|
|
253
|
+
export { isTreeAncestorKey } from './components/tree-utils.js'
|
|
254
|
+
export { listBatchColumnTargets } from './components/table/table-edit-utils.js'
|
|
255
|
+
export { listEditableCells } from './components/table/table-edit-utils.js'
|
|
256
|
+
export { looksLikeIsoDateTimeWithTz } from './lib/iso-local-datetime.js'
|
|
257
|
+
export { lucideIconCount } from './icons/lucide.js'
|
|
258
|
+
export { mapRsTableSeriesToEChartsOption } from './components/table/rs-table-echarts-adapter.js'
|
|
259
|
+
export { matchFormRuleTrigger } from './components/form-rules.js'
|
|
260
|
+
export { measureRsTablePrefixWidth } from './composables/useRsTableColumnVirtual.js'
|
|
261
|
+
export { mergeTerminalTheme } from './components/terminal-utils.js'
|
|
262
|
+
export { mergeUploadFiles } from './components/upload-utils.js'
|
|
263
|
+
export { namePathKey } from './components/form-path.js'
|
|
264
|
+
export { navigateEditableCell } from './components/table/table-edit-utils.js'
|
|
265
|
+
export { navigateGridCell } from './components/table/rs-table-grid-nav.js'
|
|
266
|
+
export { normalizeCommittedNumber } from './components/input-number-utils.js'
|
|
267
|
+
export { normalizeFormRules } from './components/form-rules.js'
|
|
268
|
+
export { normalizeNamePath } from './components/form-path.js'
|
|
269
|
+
export { normalizeSelectOptions } from './components/select-utils.js'
|
|
270
|
+
export { normalizeSplitSizes } from './components/split-pane-utils.js'
|
|
271
|
+
export { nullToEditText } from './components/table/table-edit-utils.js'
|
|
272
|
+
export { openRsDialog } from './composables/createRsDialog.js'
|
|
273
|
+
export { optionDisplayLabel } from './components/select-utils.js'
|
|
274
|
+
export { packSelectModel } from './components/select-utils.js'
|
|
275
|
+
export { parseClipboardGrid } from './components/table/table-edit-utils.js'
|
|
276
|
+
export { parseColumnWidth } from './components/table-utils.js'
|
|
277
|
+
export { parseCssLengthToPx } from './theme/css-token.js'
|
|
278
|
+
export { parseDateTimeValue } from './components/date-picker-utils.js'
|
|
279
|
+
export { parseDateValue } from './components/date-picker-utils.js'
|
|
280
|
+
export { parseLocalDateTimeToUtcIso } from './lib/iso-local-datetime.js'
|
|
281
|
+
export { parseNumberInput } from './components/input-number-utils.js'
|
|
282
|
+
export { parseTimeValue } from './components/time-picker-utils.js'
|
|
283
|
+
export { prefetchClipboardText } from './utils/rs-clipboard.js'
|
|
284
|
+
export { prewarmCodeMirrorEditor } from './components/code-mirror-lang.js'
|
|
285
|
+
export { provideRsFormItemContext } from './components/form-utils.js'
|
|
286
|
+
export { provideRsFormListContext } from './components/form-utils.js'
|
|
287
|
+
export { provideRsTableView } from './components/table/rs-table-view-context.js'
|
|
288
|
+
export { readClipboardText } from './utils/rs-clipboard.js'
|
|
289
|
+
export { readCodeFontFamily } from './theme/css-token.js'
|
|
290
|
+
export { readCodeFontSizePx } from './theme/css-token.js'
|
|
291
|
+
export { readCssLengthPx } from './theme/css-token.js'
|
|
292
|
+
export { readCssVar } from './theme/css-token.js'
|
|
293
|
+
export { readDocumentTheme } from './components/code-editor-utils.js'
|
|
294
|
+
export { readRootFontSizePx } from './theme/css-token.js'
|
|
295
|
+
export { readTerminalFontFamily } from './theme/css-token.js'
|
|
296
|
+
export { readTerminalFontSizePx } from './theme/css-token.js'
|
|
297
|
+
export { readTerminalFontWeight } from './theme/css-token.js'
|
|
298
|
+
export { readTerminalFontWeightBold } from './theme/css-token.js'
|
|
299
|
+
export { readTerminalThemeFromCss } from './components/terminal-utils.js'
|
|
300
|
+
export { removeUploadFileAt } from './components/upload-utils.js'
|
|
301
|
+
export { renderMarkdown } from './components/markdown-utils.js'
|
|
302
|
+
export { renderMarkdownInline } from './components/markdown-utils.js'
|
|
303
|
+
export { reorderColumnKeys } from './components/table-utils.js'
|
|
304
|
+
export { reorderTabItems } from './components/tabs-utils.js'
|
|
305
|
+
export { reorderTableRows } from './components/table-utils.js'
|
|
306
|
+
export { resolveAccordionExpandedKeys } from './components/tree-utils.js'
|
|
307
|
+
export { resolveBuiltinTableFeatures } from './components/table/table-features.js'
|
|
308
|
+
export { resolveCodeEditorLanguage } from './components/code-editor-utils.js'
|
|
309
|
+
export { resolveCodeEditorSize } from './components/code-editor-utils.js'
|
|
310
|
+
export { resolveCodeEditorTheme } from './components/code-editor-utils.js'
|
|
311
|
+
export { resolveCodeMirrorLanguage } from './components/code-mirror-lang.js'
|
|
312
|
+
export { resolveColumnOrder } from './components/table-utils.js'
|
|
313
|
+
export { resolveDialogOverlayStyle } from './components/dialog-utils.js'
|
|
314
|
+
export { resolveDrawerOverlayStyle } from './components/drawer-utils.js'
|
|
315
|
+
export { resolveEntryKey } from './components/table-utils.js'
|
|
316
|
+
export { resolveFieldRules } from './components/form-utils.js'
|
|
317
|
+
export { resolveFixedColumnStyles } from './components/table-utils.js'
|
|
318
|
+
export { resolveGridNavDirection } from './components/table/rs-table-grid-nav.js'
|
|
319
|
+
export { resolveInstanceFeatures } from './components/table/rs-table-module-registry.js'
|
|
320
|
+
export { resolveItemSize } from './components/virtual-list-utils.js'
|
|
321
|
+
export { resolveMarkdownHeight } from './components/markdown-utils.js'
|
|
322
|
+
export { resolveMarkdownMode } from './components/markdown-utils.js'
|
|
323
|
+
export { resolveNumberPrecision } from './components/input-number-utils.js'
|
|
324
|
+
export { resolveOrderedColumns } from './components/table-utils.js'
|
|
325
|
+
export { resolveRowKey } from './components/table-utils.js'
|
|
326
|
+
export { resolveRsComponentSize } from './components/resolve-size.js'
|
|
327
|
+
export { resolveRsDialogCssWidth } from './components/dialog-utils.js'
|
|
328
|
+
export { resolveRsDialogWidthPx } from './components/dialog-utils.js'
|
|
329
|
+
export { resolveRsDrawerDimensionCss } from './components/drawer-utils.js'
|
|
330
|
+
export { resolveRsDrawerSizeCss } from './components/drawer-utils.js'
|
|
331
|
+
export { resolveRsDrawerSizePx } from './components/drawer-utils.js'
|
|
332
|
+
export { resolveRuleMessage } from './components/form-rules.js'
|
|
333
|
+
export { resolveSelectAllState } from './components/table-utils.js'
|
|
334
|
+
export { resolveSelectableRowKeys } from './components/table-utils.js'
|
|
335
|
+
export { resolveSplitAutoFlags } from './components/split-pane-utils.js'
|
|
336
|
+
export { resolveSplitConstraints } from './components/split-pane-utils.js'
|
|
337
|
+
export { resolveStepStatus } from './components/steps-utils.js'
|
|
338
|
+
export { resolveTableSize } from './components/table-utils.js'
|
|
339
|
+
export { resolveTableTreeCheckState } from './components/table-utils.js'
|
|
340
|
+
export { resolveTableTreeIndent } from './components/table-utils.js'
|
|
341
|
+
export { resolveTableTreeRowKey } from './components/table-utils.js'
|
|
342
|
+
export { resolveTableVirtualEnabled } from './components/table-utils.js'
|
|
343
|
+
export { resolveTabsToClose } from './components/tabs-utils.js'
|
|
344
|
+
export { resolveTerminalTheme } from './components/terminal-utils.js'
|
|
345
|
+
export { resolveTreeCheckState } from './components/tree-utils.js'
|
|
346
|
+
export { resolveTreeFieldNames } from './components/tree-utils.js'
|
|
347
|
+
export { resolveTreeFocusKey } from './components/tree-utils.js'
|
|
348
|
+
export { resolveTreeIndent } from './components/tree-utils.js'
|
|
349
|
+
export { resolveTreeRowHeight } from './components/tree-utils.js'
|
|
350
|
+
export { resolveTreeVirtualEnabled } from './components/tree-utils.js'
|
|
351
|
+
export { resolveUploadFileIcon } from './components/upload-utils.js'
|
|
352
|
+
export { resolveVirtualListHeight } from './components/virtual-list-utils.js'
|
|
353
|
+
export { resolveVisibleTabValues } from './components/tabs-utils.js'
|
|
354
|
+
export { restoreSelectValue } from './components/select-utils.js'
|
|
355
|
+
export { roundToPrecision } from './components/input-number-utils.js'
|
|
356
|
+
export { rsCommonIconNames } from './icons/registry.js'
|
|
357
|
+
export { rsConfirm } from './composables/createRsDialog.js'
|
|
358
|
+
export { rsFeedbackIconClass } from './components/overlay-utils.js'
|
|
359
|
+
export { rsRadiusCss } from './components/resolve-radius.js'
|
|
360
|
+
export { rsToastPositions } from './components/overlay-utils.js'
|
|
361
|
+
export { runFormFieldRules } from './components/form-rules.js'
|
|
362
|
+
export { runInputValidation } from './components/input-rules.js'
|
|
363
|
+
export { runRsConfirmBeforeClose } from './components/dialog-utils.js'
|
|
364
|
+
export { runRsDialogBeforeClose } from './components/dialog-utils.js'
|
|
365
|
+
export { runRsDrawerBeforeClose } from './components/drawer-utils.js'
|
|
366
|
+
export { scrollTimeColumnToValue } from './components/time-picker-utils.js'
|
|
367
|
+
export { selectRowKeys } from './components/table-utils.js'
|
|
368
|
+
export { selectRowKeysByClick } from './components/table-utils.js'
|
|
369
|
+
export { setByNamePath } from './components/form-path.js'
|
|
370
|
+
export { setupMonacoWorkers } from './monaco/setup.js'
|
|
371
|
+
export { setupTableFeatures } from './components/table/table-features.js'
|
|
372
|
+
export { shouldShowTreeCheckbox } from './components/tree-utils.js'
|
|
373
|
+
export { slicePageData } from './components/pagination-utils.js'
|
|
374
|
+
export { sliceVirtualTableEntries } from './components/table-utils.js'
|
|
375
|
+
export { sliceVirtualTreeNodes } from './components/tree-utils.js'
|
|
376
|
+
export { sortTableRows } from './components/table-utils.js'
|
|
377
|
+
export { sortTableRowsMulti } from './components/table-utils.js'
|
|
378
|
+
export { sortTableTreeRows } from './components/table-utils.js'
|
|
379
|
+
export { splitSizesEqual } from './components/split-pane-utils.js'
|
|
380
|
+
export { splitTreeLabelHighlight } from './components/tree-utils.js'
|
|
381
|
+
export { stepNumberValue } from './components/input-number-utils.js'
|
|
382
|
+
export { supportsRsButtonTone } from './components/button-utils.js'
|
|
383
|
+
export { terminalShortcutLabel } from './components/terminal-utils.js'
|
|
384
|
+
export { themePresets } from './theme/presets.js'
|
|
385
|
+
export { toComboboxValue } from './components/select-utils.js'
|
|
386
|
+
export { toInternalPickerValue } from './components/date-picker-utils.js'
|
|
387
|
+
export { toModelValue } from './components/input-number-utils.js'
|
|
388
|
+
export { toRangeEndpointString } from './components/date-picker-utils.js'
|
|
389
|
+
export { toggleExpandedRowKeys } from './components/table-utils.js'
|
|
390
|
+
export { toggleMultiSortState } from './components/table-utils.js'
|
|
391
|
+
export { toggleRowSelection } from './components/table-utils.js'
|
|
392
|
+
export { toggleSelectAll } from './components/table-utils.js'
|
|
393
|
+
export { toggleSortState } from './components/table-utils.js'
|
|
394
|
+
export { toggleTableTreeCheck } from './components/table-utils.js'
|
|
395
|
+
export { toggleTreeCheck } from './components/tree-utils.js'
|
|
396
|
+
export { unwrapSelectEntry } from './components/select-utils.js'
|
|
397
|
+
export { useResolvedRsComponentSize } from './components/resolve-size.js'
|
|
398
|
+
export { useResolvedRsRadius } from './components/resolve-radius.js'
|
|
399
|
+
export { useRsConfig } from './composables/useRsConfig.js'
|
|
400
|
+
export { useRsConfigOptional } from './composables/useRsConfig.js'
|
|
401
|
+
export { useRsFormContext } from './components/form-utils.js'
|
|
402
|
+
export { useRsFormField } from './components/form-utils.js'
|
|
403
|
+
export { useRsFormItemContext } from './components/form-utils.js'
|
|
404
|
+
export { useRsFormListContext } from './components/form-utils.js'
|
|
405
|
+
export { useRsI18n } from './composables/useRsI18n.js'
|
|
406
|
+
export { useRsLoadingBar } from './composables/useRsLoadingBar.js'
|
|
407
|
+
export { useRsTable } from './composables/useRsTable.js'
|
|
408
|
+
export { useRsTableA11y } from './composables/useRsTableA11y.js'
|
|
409
|
+
export { useRsTableApi } from './composables/useRsTable.js'
|
|
410
|
+
export { useRsTableChartBridge } from './composables/useRsTableChartBridge.js'
|
|
411
|
+
export { useRsTableColumnLayout } from './composables/useRsTableColumnLayout.js'
|
|
412
|
+
export { useRsTableColumnResize } from './composables/useRsTableColumnResize.js'
|
|
413
|
+
export { useRsTableColumnVirtual } from './composables/useRsTableColumnVirtual.js'
|
|
414
|
+
export { useRsTableColumns } from './composables/useRsTableColumns.js'
|
|
415
|
+
export { useRsTableContextMenu } from './composables/useRsTableContextMenu.js'
|
|
416
|
+
export { useRsTableCore } from './composables/useRsTableCore.js'
|
|
417
|
+
export { useRsTableEditActions } from './composables/useRsTableEditActions.js'
|
|
418
|
+
export { useRsTableEditLayer } from './composables/useRsTableEditLayer.js'
|
|
419
|
+
export { useRsTableEngine } from './composables/useRsTableEngine.js'
|
|
420
|
+
export { useRsTableGridKeyboard } from './composables/useRsTableGridKeyboard.js'
|
|
421
|
+
export { useRsTableHeadless } from './composables/useRsTableHeadless.js'
|
|
422
|
+
export { useRsTableInteraction } from './composables/useRsTableInteraction.js'
|
|
423
|
+
export { useRsTableScrollHost } from './composables/useRsTableScrollHost.js'
|
|
424
|
+
export { useRsTableScrollLayout } from './composables/useRsTableScrollLayout.js'
|
|
425
|
+
export { useRsTableSelectionSource } from './composables/useRsTableSelectionSource.js'
|
|
426
|
+
export { useRsTableShell } from './composables/useRsTableShell.js'
|
|
427
|
+
export { useRsTableShellChrome } from './composables/useRsTableShellChrome.js'
|
|
428
|
+
export { useRsTableSummary } from './composables/useRsTableSummary.js'
|
|
429
|
+
export { useRsTableView } from './components/table/rs-table-view-context.js'
|
|
430
|
+
export { useRsTableViewProvide } from './composables/useRsTableViewProvide.js'
|
|
431
|
+
export { useRsTableVirtual } from './composables/useRsTableVirtual.js'
|
|
432
|
+
export { useRsToast } from './composables/useRsToast.js'
|
|
433
|
+
export { validateCellValueAsync } from './components/table/table-edit-utils.js'
|
|
434
|
+
export { validateDateRangeValue } from './components/date-range-validation.js'
|
|
435
|
+
export { validateDateTimeRangeValue } from './components/date-range-validation.js'
|
|
436
|
+
export { validateDateTimeValue } from './components/date-validation.js'
|
|
437
|
+
export { validateDateValue } from './components/date-validation.js'
|
|
438
|
+
export { validateInputRule } from './components/input-rules.js'
|
|
439
|
+
export { validateTimeRangeValue } from './components/time-range-validation.js'
|
|
440
|
+
export { validateTimeValue } from './components/time-validation.js'
|
|
441
|
+
export { validateUploadFiles } from './components/upload-utils.js'
|
|
442
|
+
export { writeClipboardText } from './utils/rs-clipboard.js'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type FilterPattern } from '@rollup/pluginutils';
|
|
2
|
+
import MagicString from 'magic-string';
|
|
2
3
|
import type { Plugin } from 'vite';
|
|
3
4
|
/** NiumaUiHostOptions 为宿主提供 include / exclude / 包根覆盖。 */
|
|
4
5
|
export type NiumaUiHostOptions = {
|
|
@@ -10,23 +11,51 @@ export type NiumaUiHostOptions = {
|
|
|
10
11
|
export type NiumaUiBinding = {
|
|
11
12
|
from: string;
|
|
12
13
|
kind: 'default' | 'named';
|
|
14
|
+
/** named 时源模块里的导出名;缺省等于对外名。 */
|
|
15
|
+
sourceName?: string;
|
|
13
16
|
};
|
|
14
17
|
/**
|
|
15
|
-
* NiumaUiHost 返回一组插件(Vite 会摊平)。
|
|
18
|
+
* NiumaUiHost 返回一组插件(Vite 会摊平)。
|
|
19
|
+
* serve 改写具名导入到源码并 alias styles;build 只补 Tailwind @source。
|
|
16
20
|
*/
|
|
17
21
|
export declare function niumaUiHost(options?: NiumaUiHostOptions): Plugin[];
|
|
18
22
|
/**
|
|
19
23
|
* ToSourceRel 把目录收成 Tailwind @source 可用的相对路径。
|
|
20
24
|
*/
|
|
21
25
|
export declare function toSourceRel(fromDir: string, targetDir: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* ScriptBlock 是一段可交给 es-module-lexer 的 ESM,start 为在原文件中的字节偏移。
|
|
28
|
+
*/
|
|
29
|
+
export type ScriptBlock = {
|
|
30
|
+
start: number;
|
|
31
|
+
code: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* ScriptBlocks 取出可交给 es-module-lexer 的 ESM 片段。
|
|
35
|
+
* 裸 .vue 是 SFC,必须先拆 script;?vue&type=script 已是脚本。
|
|
36
|
+
*/
|
|
37
|
+
export declare function scriptBlocks(code: string, id: string): ScriptBlock[];
|
|
38
|
+
/**
|
|
39
|
+
* RewriteHostModule 改写模块里对主入口的静态具名导入。
|
|
40
|
+
* Vue SFC 只处理 script 块,避免 lexer 在 template 处 Parse error。
|
|
41
|
+
*/
|
|
42
|
+
export declare function rewriteHostModule(code: string, id: string, map: Map<string, NiumaUiBinding>, targetOf: (from: string, spec: string) => string): Promise<{
|
|
43
|
+
code: string;
|
|
44
|
+
map: ReturnType<MagicString['generateMap']>;
|
|
45
|
+
} | null>;
|
|
22
46
|
/**
|
|
23
47
|
* RewriteHostStatement 改写一条已由 lexer 切出的静态 import/export。
|
|
24
48
|
* 类型-only、namespace、动态 import 原样返回 null。
|
|
25
49
|
*/
|
|
26
50
|
export declare function rewriteHostStatement(stmt: string, spec: string, map: Map<string, NiumaUiBinding>, targetOf: (from: string) => string): string | null;
|
|
51
|
+
/**
|
|
52
|
+
* EmitLiveReexportIndex 把绑定表收成带 from 的真实 re-export,与 index.d.ts 同形。
|
|
53
|
+
* 禁止输出全量 import + 本地 alias 门面。
|
|
54
|
+
*/
|
|
55
|
+
export declare function emitLiveReexportIndex(map: Map<string, NiumaUiBinding>): string;
|
|
27
56
|
/**
|
|
28
57
|
* ParseRuntimeBindings 从主入口抽出运行时导出名到文件的映射。
|
|
29
|
-
*
|
|
30
|
-
* `import RsX_default from './...'` + `export { RsX_default as RsX }`。
|
|
58
|
+
* 认源码 / 发布桶 `export { default as RsX } from './...'`,以及 Rolldown
|
|
59
|
+
* 门面 `import RsX_default from './...'` + `export { RsX_default as RsX }`。
|
|
31
60
|
*/
|
|
32
61
|
export declare function parseRuntimeBindings(source: string): Map<string, NiumaUiBinding>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 第一方宿主插件:只服务 pnpm dev(源码 HMR、styles alias、Tailwind @source)。
|
|
3
|
+
* vite build / CI 走包主入口,不改写导入。
|
|
3
4
|
* 禁止把 @niuma/ui 别名到 src/index.ts(评估整桶会灌入未使用组件 CSS)。
|
|
4
5
|
*
|
|
5
6
|
* 写法对齐 Vite / unplugin 惯例:工厂 + options、createFilter、
|
|
6
|
-
* es-module-lexer 定位静态 import/export、magic-string 保留 sourcemap
|
|
7
|
-
* apply / configResolved 区分 serve 与 build。
|
|
7
|
+
* es-module-lexer 定位静态 import/export、magic-string 保留 sourcemap。
|
|
8
8
|
*/
|
|
9
9
|
import { existsSync, readFileSync } from 'node:fs';
|
|
10
10
|
import { dirname, join, relative } from 'node:path';
|
|
@@ -14,7 +14,8 @@ import { init, parse } from 'es-module-lexer';
|
|
|
14
14
|
import MagicString from 'magic-string';
|
|
15
15
|
const SPECIFIERS = new Set(['@niuma/ui', 'niuma-ui']);
|
|
16
16
|
/**
|
|
17
|
-
* NiumaUiHost 返回一组插件(Vite 会摊平)。
|
|
17
|
+
* NiumaUiHost 返回一组插件(Vite 会摊平)。
|
|
18
|
+
* serve 改写具名导入到源码并 alias styles;build 只补 Tailwind @source。
|
|
18
19
|
*/
|
|
19
20
|
export function niumaUiHost(options = {}) {
|
|
20
21
|
const root = options.root ?? resolvePkgRoot();
|
|
@@ -23,7 +24,7 @@ export function niumaUiHost(options = {}) {
|
|
|
23
24
|
viteRoot: process.cwd(),
|
|
24
25
|
hasSrc: existsSync(join(root, 'src/index.ts')),
|
|
25
26
|
useSource: false,
|
|
26
|
-
map: loadRuntimeBindings(root),
|
|
27
|
+
map: loadRuntimeBindings(root, existsSync(join(root, 'src/index.ts'))),
|
|
27
28
|
filter: createFilter(options.include ?? [/\.([cm]?[jt]sx?|vue)(?:$|\?)/], options.exclude ?? [/\/node_modules\//]),
|
|
28
29
|
};
|
|
29
30
|
return [niumaUiHostAlias(ctx), niumaUiHostRewrite(ctx), niumaUiHostTailwindSource(ctx)];
|
|
@@ -48,6 +49,8 @@ function niumaUiHostAlias(ctx) {
|
|
|
48
49
|
: [];
|
|
49
50
|
return {
|
|
50
51
|
resolve: alias.length > 0 ? { alias } : {},
|
|
52
|
+
// 不要把 reka-ui / @lucide/vue / vue-sonner 写进 include:
|
|
53
|
+
// 它们装在 niuma-ui 下,pnpm 宿主(cloud / site)resolve 不到,Vite 会报 Failed to resolve dependency。
|
|
51
54
|
optimizeDeps: {
|
|
52
55
|
exclude: ['@niuma/ui', 'niuma-ui'],
|
|
53
56
|
},
|
|
@@ -56,44 +59,24 @@ function niumaUiHostAlias(ctx) {
|
|
|
56
59
|
};
|
|
57
60
|
}
|
|
58
61
|
/**
|
|
59
|
-
* NiumaUiHostRewrite
|
|
62
|
+
* NiumaUiHostRewrite 仅在 serve 把静态具名导入改到源码文件,供 HMR。
|
|
60
63
|
*/
|
|
61
64
|
function niumaUiHostRewrite(ctx) {
|
|
62
65
|
return {
|
|
63
66
|
name: 'niuma-ui-host:rewrite',
|
|
67
|
+
apply: 'serve',
|
|
64
68
|
enforce: 'pre',
|
|
65
69
|
configResolved(config) {
|
|
66
|
-
ctx.useSource =
|
|
70
|
+
ctx.useSource = ctx.hasSrc;
|
|
67
71
|
ctx.viteRoot = config.root;
|
|
72
|
+
ctx.map = loadRuntimeBindings(ctx.root, ctx.useSource);
|
|
68
73
|
},
|
|
69
74
|
async transform(code, id) {
|
|
70
75
|
if (!ctx.filter(id))
|
|
71
76
|
return null;
|
|
72
77
|
if (!code.includes('@niuma/ui') && !code.includes('niuma-ui'))
|
|
73
78
|
return null;
|
|
74
|
-
|
|
75
|
-
const [imports] = parse(code);
|
|
76
|
-
const s = new MagicString(code);
|
|
77
|
-
let changed = false;
|
|
78
|
-
for (const im of imports) {
|
|
79
|
-
if (im.d !== -1)
|
|
80
|
-
continue;
|
|
81
|
-
const spec = im.n;
|
|
82
|
-
if (!spec || !SPECIFIERS.has(spec))
|
|
83
|
-
continue;
|
|
84
|
-
const stmt = code.slice(im.ss, im.se);
|
|
85
|
-
const next = rewriteHostStatement(stmt, spec, ctx.map, (from) => resolveTarget(from, spec, ctx.root, ctx.useSource));
|
|
86
|
-
if (next && next !== stmt) {
|
|
87
|
-
s.overwrite(im.ss, im.se, next);
|
|
88
|
-
changed = true;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (!changed)
|
|
92
|
-
return null;
|
|
93
|
-
return {
|
|
94
|
-
code: s.toString(),
|
|
95
|
-
map: s.generateMap({ hires: 'boundary', source: id }),
|
|
96
|
-
};
|
|
79
|
+
return rewriteHostModule(code, id, ctx.map, (from, spec) => resolveTarget(from, spec, ctx.root, ctx.useSource));
|
|
97
80
|
},
|
|
98
81
|
};
|
|
99
82
|
}
|
|
@@ -148,6 +131,66 @@ export function toSourceRel(fromDir, targetDir) {
|
|
|
148
131
|
rel = `./${rel}`;
|
|
149
132
|
return rel;
|
|
150
133
|
}
|
|
134
|
+
const VUE_SCRIPT_RE = /<script\b([^>]*)>([\s\S]*?)<\/script>/gi;
|
|
135
|
+
/**
|
|
136
|
+
* ScriptBlocks 取出可交给 es-module-lexer 的 ESM 片段。
|
|
137
|
+
* 裸 .vue 是 SFC,必须先拆 script;?vue&type=script 已是脚本。
|
|
138
|
+
*/
|
|
139
|
+
export function scriptBlocks(code, id) {
|
|
140
|
+
const qIdx = id.indexOf('?');
|
|
141
|
+
const file = (qIdx === -1 ? id : id.slice(0, qIdx)).replace(/\\/g, '/');
|
|
142
|
+
const query = qIdx === -1 ? '' : id.slice(qIdx + 1);
|
|
143
|
+
if (!file.endsWith('.vue')) {
|
|
144
|
+
return [{ start: 0, code }];
|
|
145
|
+
}
|
|
146
|
+
if (query) {
|
|
147
|
+
return /(?:^|&)type=script(?:&|$)/.test(query) ? [{ start: 0, code }] : [];
|
|
148
|
+
}
|
|
149
|
+
const out = [];
|
|
150
|
+
VUE_SCRIPT_RE.lastIndex = 0;
|
|
151
|
+
let match;
|
|
152
|
+
while ((match = VUE_SCRIPT_RE.exec(code)) !== null) {
|
|
153
|
+
if (/\bsrc\s*=/.test(match[1] ?? ''))
|
|
154
|
+
continue;
|
|
155
|
+
const inner = match[2] ?? '';
|
|
156
|
+
if (!inner)
|
|
157
|
+
continue;
|
|
158
|
+
const start = match.index + match[0].length - inner.length - '</script>'.length;
|
|
159
|
+
out.push({ start, code: inner });
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* RewriteHostModule 改写模块里对主入口的静态具名导入。
|
|
165
|
+
* Vue SFC 只处理 script 块,避免 lexer 在 template 处 Parse error。
|
|
166
|
+
*/
|
|
167
|
+
export async function rewriteHostModule(code, id, map, targetOf) {
|
|
168
|
+
await init;
|
|
169
|
+
const s = new MagicString(code);
|
|
170
|
+
let changed = false;
|
|
171
|
+
for (const block of scriptBlocks(code, id)) {
|
|
172
|
+
const [imports] = parse(block.code);
|
|
173
|
+
for (const im of imports) {
|
|
174
|
+
if (im.d !== -1)
|
|
175
|
+
continue;
|
|
176
|
+
const spec = im.n;
|
|
177
|
+
if (!spec || !SPECIFIERS.has(spec))
|
|
178
|
+
continue;
|
|
179
|
+
const stmt = block.code.slice(im.ss, im.se);
|
|
180
|
+
const next = rewriteHostStatement(stmt, spec, map, (from) => targetOf(from, spec));
|
|
181
|
+
if (next && next !== stmt) {
|
|
182
|
+
s.overwrite(block.start + im.ss, block.start + im.se, next);
|
|
183
|
+
changed = true;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (!changed)
|
|
188
|
+
return null;
|
|
189
|
+
return {
|
|
190
|
+
code: s.toString(),
|
|
191
|
+
map: s.generateMap({ hires: 'boundary', source: id }),
|
|
192
|
+
};
|
|
193
|
+
}
|
|
151
194
|
/**
|
|
152
195
|
* RewriteHostStatement 改写一条已由 lexer 切出的静态 import/export。
|
|
153
196
|
* 类型-only、namespace、动态 import 原样返回 null。
|
|
@@ -239,10 +282,30 @@ function resolvePkgRoot() {
|
|
|
239
282
|
return dirname(require.resolve('niuma-ui/package.json'));
|
|
240
283
|
}
|
|
241
284
|
}
|
|
285
|
+
/**
|
|
286
|
+
* EmitLiveReexportIndex 把绑定表收成带 from 的真实 re-export,与 index.d.ts 同形。
|
|
287
|
+
* 禁止输出全量 import + 本地 alias 门面。
|
|
288
|
+
*/
|
|
289
|
+
export function emitLiveReexportIndex(map) {
|
|
290
|
+
const lines = [];
|
|
291
|
+
for (const [name, binding] of map) {
|
|
292
|
+
let from = binding.from.replace(/\\/g, '/');
|
|
293
|
+
if (!from.startsWith('.'))
|
|
294
|
+
from = `./${from}`;
|
|
295
|
+
if (binding.kind === 'default') {
|
|
296
|
+
lines.push(`export { default as ${name} } from '${from}'`);
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
const sourceName = binding.sourceName && binding.sourceName !== name ? binding.sourceName : name;
|
|
300
|
+
const inner = sourceName === name ? name : `${sourceName} as ${name}`;
|
|
301
|
+
lines.push(`export { ${inner} } from '${from}'`);
|
|
302
|
+
}
|
|
303
|
+
return `${lines.join('\n')}\n`;
|
|
304
|
+
}
|
|
242
305
|
/**
|
|
243
306
|
* ParseRuntimeBindings 从主入口抽出运行时导出名到文件的映射。
|
|
244
|
-
*
|
|
245
|
-
* `import RsX_default from './...'` + `export { RsX_default as RsX }`。
|
|
307
|
+
* 认源码 / 发布桶 `export { default as RsX } from './...'`,以及 Rolldown
|
|
308
|
+
* 门面 `import RsX_default from './...'` + `export { RsX_default as RsX }`。
|
|
246
309
|
*/
|
|
247
310
|
export function parseRuntimeBindings(source) {
|
|
248
311
|
const map = new Map();
|
|
@@ -253,7 +316,11 @@ export function parseRuntimeBindings(source) {
|
|
|
253
316
|
if (!from)
|
|
254
317
|
continue;
|
|
255
318
|
for (const spec of parseSpecifierList(match[1] ?? '')) {
|
|
256
|
-
map.set(spec.right, {
|
|
319
|
+
map.set(spec.right, {
|
|
320
|
+
from,
|
|
321
|
+
kind: spec.isDefault ? 'default' : 'named',
|
|
322
|
+
sourceName: spec.isDefault ? undefined : spec.left,
|
|
323
|
+
});
|
|
257
324
|
}
|
|
258
325
|
}
|
|
259
326
|
const locals = new Map();
|
|
@@ -318,13 +385,13 @@ function recordImportLocals(clause, from, locals) {
|
|
|
318
385
|
for (const spec of parseSpecifierList(trimmed.slice(namedStart + 1, namedEnd))) {
|
|
319
386
|
if (spec.isDefault)
|
|
320
387
|
continue;
|
|
321
|
-
locals.set(spec.right, { from, kind: 'named' });
|
|
388
|
+
locals.set(spec.right, { from, kind: 'named', sourceName: spec.left });
|
|
322
389
|
}
|
|
323
390
|
}
|
|
324
|
-
function loadRuntimeBindings(root) {
|
|
391
|
+
function loadRuntimeBindings(root, useSource) {
|
|
325
392
|
const srcIndex = join(root, 'src/index.ts');
|
|
326
393
|
const distIndex = join(root, 'dist/index.js');
|
|
327
|
-
const indexPath = existsSync(srcIndex) ? srcIndex : distIndex;
|
|
394
|
+
const indexPath = useSource && existsSync(srcIndex) ? srcIndex : existsSync(distIndex) ? distIndex : srcIndex;
|
|
328
395
|
if (!existsSync(indexPath)) {
|
|
329
396
|
throw new Error(`niumaUiHost: 未找到 ${srcIndex} 或 ${distIndex}`);
|
|
330
397
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @deprecated 请改为 `niuma-ui/vite-plugins/niuma-ui-host
|
|
2
|
+
* @deprecated 请改为 `niuma-ui/vite-plugins/niuma-ui-host`。勿新用。
|
|
3
3
|
*/
|
|
4
4
|
export { niumaUiHost, type NiumaUiHostOptions } from './niuma-ui-host.js';
|
|
5
5
|
export { niumaUiHost as rewriteNiumaUiNamedImports } from './niuma-ui-host.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "niuma-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Vue 3 工作台设计系统(Rs* 组件、--rs-* token;含可选编辑器 / 终端)",
|
|
@@ -37,13 +37,6 @@
|
|
|
37
37
|
"default": "./dist/index.js"
|
|
38
38
|
},
|
|
39
39
|
"./styles.css": "./dist/styles.css",
|
|
40
|
-
"./components/*": "./dist/components/*",
|
|
41
|
-
"./composables/*": "./dist/composables/*",
|
|
42
|
-
"./theme/*": "./dist/theme/*",
|
|
43
|
-
"./monaco/*": "./dist/monaco/*",
|
|
44
|
-
"./utils/*": "./dist/utils/*",
|
|
45
|
-
"./locale/*": "./dist/locale/*",
|
|
46
|
-
"./theme/brand.example.css": "./dist/theme/brand.example.css",
|
|
47
40
|
"./vite-plugins/monaco-zh-nls": {
|
|
48
41
|
"types": "./dist/vite-plugins/monaco-zh-nls.d.ts",
|
|
49
42
|
"import": "./dist/vite-plugins/monaco-zh-nls.js",
|
|
@@ -66,7 +59,8 @@
|
|
|
66
59
|
},
|
|
67
60
|
"./vite-prebundle/codemirror": "./dist/dev/vite-codemirror-deps.js",
|
|
68
61
|
"./vite-prebundle/xterm": "./dist/dev/vite-xterm-deps.js",
|
|
69
|
-
"./package.json": "./package.json"
|
|
62
|
+
"./package.json": "./package.json",
|
|
63
|
+
"./*": "./dist/*"
|
|
70
64
|
},
|
|
71
65
|
"files": [
|
|
72
66
|
"dist",
|