@pactor-app/ui 1.1.0 → 1.3.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/README.md +27 -31
- package/dist/{chunk-BZSRLTQQ.js → chunk-7KC6DMKH.js} +8 -8
- package/dist/chunk-EVGIS2ZE.js +614 -0
- package/dist/{chunk-F3H23KYG.js → chunk-F42SGQNW.js} +31 -93
- package/dist/chunk-L4Z7MNYY.js +1197 -0
- package/dist/{chunk-6B5ZX7L3.js → chunk-P54Y23AP.js} +201 -597
- package/dist/{chunk-GV5R6TUT.js → chunk-TDVG7MZ5.js} +180 -49
- package/dist/{chunk-BVHAP22U.js → chunk-UKA7C3JP.js} +213 -486
- package/dist/chunk-WKJUCGV4.js +78 -0
- package/dist/components/index.cjs +1023 -695
- package/dist/components/index.d.cts +37 -19
- package/dist/components/index.d.ts +37 -19
- package/dist/components/index.js +20 -18
- package/dist/index.cjs +1359 -913
- package/dist/index.d.cts +3 -36
- package/dist/index.d.ts +3 -36
- package/dist/index.js +40 -47
- package/dist/interaction/index.cjs +17 -13
- package/dist/interaction/index.d.cts +13 -16
- package/dist/interaction/index.d.ts +13 -16
- package/dist/interaction/index.js +7 -7
- package/dist/layout/index.cjs +1084 -63
- package/dist/layout/index.d.cts +98 -20
- package/dist/layout/index.d.ts +98 -20
- package/dist/layout/index.js +18 -16
- package/dist/ui/index.cjs +1688 -533
- package/dist/ui/index.d.cts +130 -16
- package/dist/ui/index.d.ts +130 -16
- package/dist/ui/index.js +485 -26
- package/package.json +6 -5
- package/styles.css +936 -107
- package/dist/chunk-6JNCDPGS.js +0 -257
- package/dist/chunk-GL7IO22L.js +0 -225
- package/dist/chunk-RQHJBTEU.js +0 -10
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export { AdminBrand, AdminLayoutBreakpoint, AdminLayoutConfig, AdminLayoutMode, AdminLayoutProps, BlankLayoutProps, LandingLayoutProps, LayoutComponent, LayoutRegistry, LoginBrand, LoginLayoutProps, ShadcnAdminLayout, ShadcnBlankLayout, ShadcnLandingLayout, ShadcnLoginLayout, collectDefaultOpenKeys, findMenuChain, registerShadcnLayouts, resolveLayout } from './layout/index.cjs';
|
|
5
|
-
import { ShadcnInteractionProvider, ShadcnOverlayHost } from './interaction/index.cjs';
|
|
6
|
-
export { InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, OverlayConfig, OverlayEntry, OverlayHostProps, OverlayListener, OverlayManager, ResolvePageFn, UiBridge, UiMessage, UiModal, createUiBridge, registerInteractionActions } from './interaction/index.cjs';
|
|
1
|
+
export { Accordion, AccordionItemData, AccordionProps, Alert, AlertDialog, AlertDialogProps, AlertProps, AlertVariant, AspectRatio, AspectRatioProps, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Breadcrumb, BreadcrumbItemData, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, ButtonVariant, Calendar, CalendarProps, Card, CardProps, Carousel, CarouselImage, CarouselItemData, CarouselProps, Chart, ChartProps, ChartType, ChatInput, ChatInputProps, Checkbox, CheckboxProps, Collapsible, CollapsibleProps, Combobox, ComboboxOption, ComboboxProps, Command, CommandGroupData, CommandItemData, CommandProps, Content, ContentProps, ContextMenu, ContextMenuItemData, ContextMenuProps, DataTable, DataTableColumn, DataTablePagination, DataTableProps, DataTableSort, DataTableSortOrder, Dialog, DialogProps, Drawer, DrawerPlacement, DrawerProps, DropdownMenu, DropdownMenuItemData, DropdownMenuProps, Empty, EmptyProps, Field, FieldProps, FieldRule, Flex, FlexProps, Footer, FooterProps, Form, FormContextValue, FormProps, Grid, GridProps, Header, HeaderBrandPosition, HeaderDropdown, HeaderDropdownItem, HeaderLocale, HeaderMenuItem, HeaderProps, HeaderUser, HeaderUserItem, HoverCard, HoverCardProps, ICONS, Icon, IconProps, IconSize, Input, InputGroup, InputGroupProps, InputOTP, InputOTPProps, InputProps, Item, ItemProps, Kbd, KbdProps, Label, LabelProps, Layout, LayoutProps, Link, LinkProps, Menu, MenuItem, MenuProps, Menubar, MenubarLeafItem, MenubarMenuData, MenubarProps, NavigationMenu, NavigationMenuChildItem, NavigationMenuItemData, NavigationMenuProps, Page, PageProps, Pagination, PaginationProps, Popover, PopoverProps, Progress, ProgressProps, RadioGroup, RadioGroupOption, RadioGroupProps, RailTooltip, Resizable, ResizablePanelData, ResizableProps, ScrollArea, ScrollAreaProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, SheetSide, Sidebar, SidebarBrand, SidebarNavItem, SidebarProps, Sider, SiderProps, Skeleton, SkeletonProps, SkeletonShape, Slider, SliderProps, Sonner, SonnerProps, Spinner, SpinnerProps, SpinnerSize, Statistic, StatisticProps, Switch, SwitchProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, Text, TextProps, TextType, Textarea, TextareaProps, Toggle, ToggleGroup, ToggleGroupOption, ToggleGroupProps, ToggleProps, Tooltip, TooltipProps, Typography, TypographyProps, TypographyVariant, builtinComponents, createComponentRegistry, normalizeIconName, registerBuiltinComponents, useFormContext, useSidebarDrawer } from './components/index.cjs';
|
|
2
|
+
export { AdminBrand, AdminLayout, AdminLayoutBreakpoint, AdminLayoutConfig, AdminLayoutMode, AdminLayoutProps, BlankLayout, BlankLayoutProps, ChatLayout, ChatLayoutBrand, ChatLayoutMenuItem, ChatLayoutProps, LandingLayout, LandingLayoutProps, LayoutComponent, LayoutRegistry, LoginBrand, LoginLayout, LoginLayoutProps, collectDefaultOpenKeys, createLayoutRegistry, findMenuChain, registerBuiltinLayouts, resolveLayout } from './layout/index.cjs';
|
|
3
|
+
export { InteractionProvider, InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, OverlayConfig, OverlayEntry, OverlayHost, OverlayHostProps, OverlayListener, OverlayManager, ResolvePageFn, UiBridge, UiMessage, UiModal, createUiBridge, registerInteractionActions } from './interaction/index.cjs';
|
|
7
4
|
import '@pactor-app/runtime';
|
|
8
5
|
import 'react';
|
|
9
6
|
import '@pactor-app/core';
|
|
@@ -14,33 +11,3 @@ import '@base-ui/react/toggle';
|
|
|
14
11
|
import 'class-variance-authority';
|
|
15
12
|
import '@pactor-app/permission';
|
|
16
13
|
import '@pactor-app/router';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* shadcn UI kit 预设对象:一次性提供 @pactor-app/app `ui` 选项的三个槽位
|
|
20
|
-
* (组件注册表工厂 / 布局注册表工厂 / 交互层组件对),实现整站 shadcn 切换:
|
|
21
|
-
*
|
|
22
|
-
* ```ts
|
|
23
|
-
* import { createPactorApplication } from '@pactor-app/app';
|
|
24
|
-
* import { shadcnUiKit } from '@pactor-app/ui';
|
|
25
|
-
* import '@pactor-app/ui/styles.css';
|
|
26
|
-
*
|
|
27
|
-
* createPactorApplication({
|
|
28
|
-
* appId: 'risk-admin',
|
|
29
|
-
* api: { baseURL: '/api/runtime' },
|
|
30
|
-
* ui: shadcnUiKit,
|
|
31
|
-
* });
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* 细粒度选项(componentRegistry / layoutRegistry / interactionKit)优先级
|
|
35
|
-
* 高于预设对应槽位,可逐槽位覆盖。
|
|
36
|
-
*/
|
|
37
|
-
declare const shadcnUiKit: {
|
|
38
|
-
componentRegistry: typeof createShadcnComponentRegistry;
|
|
39
|
-
layoutRegistry: typeof createShadcnLayoutRegistry;
|
|
40
|
-
interactionKit: {
|
|
41
|
-
Provider: typeof ShadcnInteractionProvider;
|
|
42
|
-
OverlayHost: typeof ShadcnOverlayHost;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export { ShadcnInteractionProvider, ShadcnOverlayHost, createShadcnComponentRegistry, createShadcnLayoutRegistry, shadcnUiKit };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export { AdminBrand, AdminLayoutBreakpoint, AdminLayoutConfig, AdminLayoutMode, AdminLayoutProps, BlankLayoutProps, LandingLayoutProps, LayoutComponent, LayoutRegistry, LoginBrand, LoginLayoutProps, ShadcnAdminLayout, ShadcnBlankLayout, ShadcnLandingLayout, ShadcnLoginLayout, collectDefaultOpenKeys, findMenuChain, registerShadcnLayouts, resolveLayout } from './layout/index.js';
|
|
5
|
-
import { ShadcnInteractionProvider, ShadcnOverlayHost } from './interaction/index.js';
|
|
6
|
-
export { InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, OverlayConfig, OverlayEntry, OverlayHostProps, OverlayListener, OverlayManager, ResolvePageFn, UiBridge, UiMessage, UiModal, createUiBridge, registerInteractionActions } from './interaction/index.js';
|
|
1
|
+
export { Accordion, AccordionItemData, AccordionProps, Alert, AlertDialog, AlertDialogProps, AlertProps, AlertVariant, AspectRatio, AspectRatioProps, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Breadcrumb, BreadcrumbItemData, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, ButtonVariant, Calendar, CalendarProps, Card, CardProps, Carousel, CarouselImage, CarouselItemData, CarouselProps, Chart, ChartProps, ChartType, ChatInput, ChatInputProps, Checkbox, CheckboxProps, Collapsible, CollapsibleProps, Combobox, ComboboxOption, ComboboxProps, Command, CommandGroupData, CommandItemData, CommandProps, Content, ContentProps, ContextMenu, ContextMenuItemData, ContextMenuProps, DataTable, DataTableColumn, DataTablePagination, DataTableProps, DataTableSort, DataTableSortOrder, Dialog, DialogProps, Drawer, DrawerPlacement, DrawerProps, DropdownMenu, DropdownMenuItemData, DropdownMenuProps, Empty, EmptyProps, Field, FieldProps, FieldRule, Flex, FlexProps, Footer, FooterProps, Form, FormContextValue, FormProps, Grid, GridProps, Header, HeaderBrandPosition, HeaderDropdown, HeaderDropdownItem, HeaderLocale, HeaderMenuItem, HeaderProps, HeaderUser, HeaderUserItem, HoverCard, HoverCardProps, ICONS, Icon, IconProps, IconSize, Input, InputGroup, InputGroupProps, InputOTP, InputOTPProps, InputProps, Item, ItemProps, Kbd, KbdProps, Label, LabelProps, Layout, LayoutProps, Link, LinkProps, Menu, MenuItem, MenuProps, Menubar, MenubarLeafItem, MenubarMenuData, MenubarProps, NavigationMenu, NavigationMenuChildItem, NavigationMenuItemData, NavigationMenuProps, Page, PageProps, Pagination, PaginationProps, Popover, PopoverProps, Progress, ProgressProps, RadioGroup, RadioGroupOption, RadioGroupProps, RailTooltip, Resizable, ResizablePanelData, ResizableProps, ScrollArea, ScrollAreaProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, SheetSide, Sidebar, SidebarBrand, SidebarNavItem, SidebarProps, Sider, SiderProps, Skeleton, SkeletonProps, SkeletonShape, Slider, SliderProps, Sonner, SonnerProps, Spinner, SpinnerProps, SpinnerSize, Statistic, StatisticProps, Switch, SwitchProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, Text, TextProps, TextType, Textarea, TextareaProps, Toggle, ToggleGroup, ToggleGroupOption, ToggleGroupProps, ToggleProps, Tooltip, TooltipProps, Typography, TypographyProps, TypographyVariant, builtinComponents, createComponentRegistry, normalizeIconName, registerBuiltinComponents, useFormContext, useSidebarDrawer } from './components/index.js';
|
|
2
|
+
export { AdminBrand, AdminLayout, AdminLayoutBreakpoint, AdminLayoutConfig, AdminLayoutMode, AdminLayoutProps, BlankLayout, BlankLayoutProps, ChatLayout, ChatLayoutBrand, ChatLayoutMenuItem, ChatLayoutProps, LandingLayout, LandingLayoutProps, LayoutComponent, LayoutRegistry, LoginBrand, LoginLayout, LoginLayoutProps, collectDefaultOpenKeys, createLayoutRegistry, findMenuChain, registerBuiltinLayouts, resolveLayout } from './layout/index.js';
|
|
3
|
+
export { InteractionProvider, InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, OverlayConfig, OverlayEntry, OverlayHost, OverlayHostProps, OverlayListener, OverlayManager, ResolvePageFn, UiBridge, UiMessage, UiModal, createUiBridge, registerInteractionActions } from './interaction/index.js';
|
|
7
4
|
import '@pactor-app/runtime';
|
|
8
5
|
import 'react';
|
|
9
6
|
import '@pactor-app/core';
|
|
@@ -14,33 +11,3 @@ import '@base-ui/react/toggle';
|
|
|
14
11
|
import 'class-variance-authority';
|
|
15
12
|
import '@pactor-app/permission';
|
|
16
13
|
import '@pactor-app/router';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* shadcn UI kit 预设对象:一次性提供 @pactor-app/app `ui` 选项的三个槽位
|
|
20
|
-
* (组件注册表工厂 / 布局注册表工厂 / 交互层组件对),实现整站 shadcn 切换:
|
|
21
|
-
*
|
|
22
|
-
* ```ts
|
|
23
|
-
* import { createPactorApplication } from '@pactor-app/app';
|
|
24
|
-
* import { shadcnUiKit } from '@pactor-app/ui';
|
|
25
|
-
* import '@pactor-app/ui/styles.css';
|
|
26
|
-
*
|
|
27
|
-
* createPactorApplication({
|
|
28
|
-
* appId: 'risk-admin',
|
|
29
|
-
* api: { baseURL: '/api/runtime' },
|
|
30
|
-
* ui: shadcnUiKit,
|
|
31
|
-
* });
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* 细粒度选项(componentRegistry / layoutRegistry / interactionKit)优先级
|
|
35
|
-
* 高于预设对应槽位,可逐槽位覆盖。
|
|
36
|
-
*/
|
|
37
|
-
declare const shadcnUiKit: {
|
|
38
|
-
componentRegistry: typeof createShadcnComponentRegistry;
|
|
39
|
-
layoutRegistry: typeof createShadcnLayoutRegistry;
|
|
40
|
-
interactionKit: {
|
|
41
|
-
Provider: typeof ShadcnInteractionProvider;
|
|
42
|
-
OverlayHost: typeof ShadcnOverlayHost;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export { ShadcnInteractionProvider, ShadcnOverlayHost, createShadcnComponentRegistry, createShadcnLayoutRegistry, shadcnUiKit };
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Card,
|
|
13
13
|
Carousel,
|
|
14
14
|
Chart,
|
|
15
|
+
ChatInput,
|
|
15
16
|
Checkbox,
|
|
16
17
|
Collapsible,
|
|
17
18
|
Combobox,
|
|
@@ -38,7 +39,6 @@ import {
|
|
|
38
39
|
Label,
|
|
39
40
|
Layout,
|
|
40
41
|
Link,
|
|
41
|
-
Menu,
|
|
42
42
|
Menubar,
|
|
43
43
|
NavigationMenu,
|
|
44
44
|
Page,
|
|
@@ -46,13 +46,11 @@ import {
|
|
|
46
46
|
Popover,
|
|
47
47
|
Progress,
|
|
48
48
|
RadioGroup,
|
|
49
|
-
RailTooltip,
|
|
50
49
|
Resizable,
|
|
51
50
|
ScrollArea,
|
|
52
51
|
Select,
|
|
53
52
|
Separator,
|
|
54
53
|
Sheet,
|
|
55
|
-
Sidebar,
|
|
56
54
|
Sider,
|
|
57
55
|
Skeleton,
|
|
58
56
|
Slider,
|
|
@@ -68,57 +66,53 @@ import {
|
|
|
68
66
|
ToggleGroup,
|
|
69
67
|
Tooltip,
|
|
70
68
|
Typography,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
useFormContext
|
|
75
|
-
|
|
76
|
-
} from "./chunk-6B5ZX7L3.js";
|
|
69
|
+
builtinComponents,
|
|
70
|
+
createComponentRegistry,
|
|
71
|
+
registerBuiltinComponents,
|
|
72
|
+
useFormContext
|
|
73
|
+
} from "./chunk-P54Y23AP.js";
|
|
77
74
|
import {
|
|
75
|
+
InteractionProvider,
|
|
78
76
|
OVERLAY_CANCEL_PAYLOAD,
|
|
77
|
+
OverlayHost,
|
|
79
78
|
OverlayManager,
|
|
80
|
-
ShadcnInteractionProvider,
|
|
81
|
-
ShadcnOverlayHost,
|
|
82
79
|
createUiBridge,
|
|
83
80
|
registerInteractionActions
|
|
84
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-7KC6DMKH.js";
|
|
85
82
|
import {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
AdminLayout,
|
|
84
|
+
BlankLayout,
|
|
85
|
+
ChatLayout,
|
|
86
|
+
LandingLayout,
|
|
87
|
+
LoginLayout,
|
|
90
88
|
collectDefaultOpenKeys,
|
|
91
|
-
|
|
89
|
+
createLayoutRegistry,
|
|
92
90
|
findMenuChain,
|
|
93
|
-
|
|
91
|
+
registerBuiltinLayouts,
|
|
94
92
|
resolveLayout
|
|
95
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-TDVG7MZ5.js";
|
|
96
94
|
import {
|
|
97
95
|
ICONS,
|
|
98
96
|
Icon,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
layoutRegistry: createShadcnLayoutRegistry,
|
|
110
|
-
interactionKit: {
|
|
111
|
-
Provider: ShadcnInteractionProvider,
|
|
112
|
-
OverlayHost: ShadcnOverlayHost
|
|
113
|
-
}
|
|
114
|
-
};
|
|
97
|
+
Menu,
|
|
98
|
+
RailTooltip,
|
|
99
|
+
Sidebar,
|
|
100
|
+
normalizeIconName,
|
|
101
|
+
useSidebarDrawer
|
|
102
|
+
} from "./chunk-EVGIS2ZE.js";
|
|
103
|
+
import "./chunk-UKA7C3JP.js";
|
|
104
|
+
import "./chunk-F42SGQNW.js";
|
|
105
|
+
import "./chunk-L4Z7MNYY.js";
|
|
106
|
+
import "./chunk-WKJUCGV4.js";
|
|
115
107
|
export {
|
|
116
108
|
Accordion,
|
|
109
|
+
AdminLayout,
|
|
117
110
|
Alert,
|
|
118
111
|
AlertDialog,
|
|
119
112
|
AspectRatio,
|
|
120
113
|
Avatar,
|
|
121
114
|
Badge,
|
|
115
|
+
BlankLayout,
|
|
122
116
|
Breadcrumb,
|
|
123
117
|
Button,
|
|
124
118
|
ButtonGroup,
|
|
@@ -126,6 +120,8 @@ export {
|
|
|
126
120
|
Card,
|
|
127
121
|
Carousel,
|
|
128
122
|
Chart,
|
|
123
|
+
ChatInput,
|
|
124
|
+
ChatLayout,
|
|
129
125
|
Checkbox,
|
|
130
126
|
Collapsible,
|
|
131
127
|
Combobox,
|
|
@@ -149,15 +145,19 @@ export {
|
|
|
149
145
|
Input,
|
|
150
146
|
InputGroup,
|
|
151
147
|
InputOTP,
|
|
148
|
+
InteractionProvider,
|
|
152
149
|
Item,
|
|
153
150
|
Kbd,
|
|
154
151
|
Label,
|
|
152
|
+
LandingLayout,
|
|
155
153
|
Layout,
|
|
156
154
|
Link,
|
|
155
|
+
LoginLayout,
|
|
157
156
|
Menu,
|
|
158
157
|
Menubar,
|
|
159
158
|
NavigationMenu,
|
|
160
159
|
OVERLAY_CANCEL_PAYLOAD,
|
|
160
|
+
OverlayHost,
|
|
161
161
|
OverlayManager,
|
|
162
162
|
Page,
|
|
163
163
|
Pagination,
|
|
@@ -169,12 +169,6 @@ export {
|
|
|
169
169
|
ScrollArea,
|
|
170
170
|
Select,
|
|
171
171
|
Separator,
|
|
172
|
-
ShadcnAdminLayout,
|
|
173
|
-
ShadcnBlankLayout,
|
|
174
|
-
ShadcnInteractionProvider,
|
|
175
|
-
ShadcnLandingLayout,
|
|
176
|
-
ShadcnLoginLayout,
|
|
177
|
-
ShadcnOverlayHost,
|
|
178
172
|
Sheet,
|
|
179
173
|
Sidebar,
|
|
180
174
|
Sider,
|
|
@@ -192,18 +186,17 @@ export {
|
|
|
192
186
|
ToggleGroup,
|
|
193
187
|
Tooltip,
|
|
194
188
|
Typography,
|
|
189
|
+
builtinComponents,
|
|
195
190
|
collectDefaultOpenKeys,
|
|
196
|
-
|
|
197
|
-
|
|
191
|
+
createComponentRegistry,
|
|
192
|
+
createLayoutRegistry,
|
|
198
193
|
createUiBridge,
|
|
199
194
|
findMenuChain,
|
|
200
195
|
normalizeIconName,
|
|
196
|
+
registerBuiltinComponents,
|
|
197
|
+
registerBuiltinLayouts,
|
|
201
198
|
registerInteractionActions,
|
|
202
|
-
registerShadcnComponents,
|
|
203
|
-
registerShadcnLayouts,
|
|
204
199
|
resolveLayout,
|
|
205
|
-
shadcnComponents,
|
|
206
|
-
shadcnUiKit,
|
|
207
200
|
useFormContext,
|
|
208
201
|
useSidebarDrawer
|
|
209
202
|
};
|
|
@@ -30,10 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/interaction/index.ts
|
|
31
31
|
var interaction_exports = {};
|
|
32
32
|
__export(interaction_exports, {
|
|
33
|
+
InteractionProvider: () => InteractionProvider,
|
|
33
34
|
OVERLAY_CANCEL_PAYLOAD: () => OVERLAY_CANCEL_PAYLOAD,
|
|
35
|
+
OverlayHost: () => OverlayHost,
|
|
34
36
|
OverlayManager: () => OverlayManager,
|
|
35
|
-
ShadcnInteractionProvider: () => ShadcnInteractionProvider,
|
|
36
|
-
ShadcnOverlayHost: () => ShadcnOverlayHost,
|
|
37
37
|
createUiBridge: () => createUiBridge,
|
|
38
38
|
registerInteractionActions: () => registerInteractionActions
|
|
39
39
|
});
|
|
@@ -230,16 +230,20 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
230
230
|
variant: {
|
|
231
231
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
232
232
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20",
|
|
233
|
-
outline: "border border-border bg-
|
|
233
|
+
outline: "border border-border bg-card hover:bg-accent hover:text-accent-foreground",
|
|
234
234
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
235
235
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
236
236
|
link: "text-primary underline-offset-4 hover:underline"
|
|
237
237
|
},
|
|
238
238
|
size: {
|
|
239
239
|
default: "h-9 px-4 py-2",
|
|
240
|
+
xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
240
241
|
sm: "h-8 gap-1.5 rounded-md px-3 text-xs",
|
|
241
242
|
lg: "h-10 rounded-md px-6",
|
|
242
|
-
icon: "size-9"
|
|
243
|
+
icon: "size-9",
|
|
244
|
+
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
245
|
+
"icon-sm": "size-8",
|
|
246
|
+
"icon-lg": "size-10"
|
|
243
247
|
}
|
|
244
248
|
},
|
|
245
249
|
defaultVariants: {
|
|
@@ -306,7 +310,7 @@ function DialogOverlay({
|
|
|
306
310
|
{
|
|
307
311
|
"data-slot": "dialog-overlay",
|
|
308
312
|
className: cn(
|
|
309
|
-
"fixed inset-0 z-50 bg-
|
|
313
|
+
"fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
310
314
|
className
|
|
311
315
|
),
|
|
312
316
|
...props
|
|
@@ -326,7 +330,7 @@ function DialogContent({
|
|
|
326
330
|
{
|
|
327
331
|
"data-slot": "dialog-content",
|
|
328
332
|
className: cn(
|
|
329
|
-
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-
|
|
333
|
+
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 sm:max-w-lg",
|
|
330
334
|
className
|
|
331
335
|
),
|
|
332
336
|
...props,
|
|
@@ -413,7 +417,7 @@ var toastTypeClass = {
|
|
|
413
417
|
info: "border-l-4 border-l-info",
|
|
414
418
|
warning: "border-l-4 border-l-warning"
|
|
415
419
|
};
|
|
416
|
-
function
|
|
420
|
+
function InteractionProvider({
|
|
417
421
|
bridge,
|
|
418
422
|
children
|
|
419
423
|
}) {
|
|
@@ -547,7 +551,7 @@ function DrawerOverlay({
|
|
|
547
551
|
import_vaul.Drawer.Overlay,
|
|
548
552
|
{
|
|
549
553
|
"data-slot": "drawer-overlay",
|
|
550
|
-
className: cn("fixed inset-0 z-50 bg-
|
|
554
|
+
className: cn("fixed inset-0 z-50 bg-(--overlay-background)", className),
|
|
551
555
|
...props
|
|
552
556
|
}
|
|
553
557
|
);
|
|
@@ -564,7 +568,7 @@ function DrawerContent({
|
|
|
564
568
|
{
|
|
565
569
|
"data-slot": "drawer-content",
|
|
566
570
|
className: cn(
|
|
567
|
-
"group/drawer-content fixed z-50 flex h-auto flex-col border-border bg-
|
|
571
|
+
"group/drawer-content fixed z-50 flex h-auto flex-col border-border bg-popover",
|
|
568
572
|
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
569
573
|
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
570
574
|
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
@@ -612,7 +616,7 @@ function toCssWidth(width) {
|
|
|
612
616
|
}
|
|
613
617
|
return typeof width === "number" ? `${width}px` : width;
|
|
614
618
|
}
|
|
615
|
-
function
|
|
619
|
+
function OverlayHost({ manager, resolvePage }) {
|
|
616
620
|
const renderer = (0, import_runtime3.useRenderer)();
|
|
617
621
|
const stack = (0, import_react2.useSyncExternalStore)(
|
|
618
622
|
(onChange) => manager.subscribe(onChange),
|
|
@@ -771,7 +775,7 @@ function PageOverlayBody({
|
|
|
771
775
|
if (!resolvePage) {
|
|
772
776
|
setError(
|
|
773
777
|
new Error(
|
|
774
|
-
`[@pactor-app/ui] page overlay\uFF08pageId: "${entry.page?.pageId}"\uFF09\u9700\u8981
|
|
778
|
+
`[@pactor-app/ui] page overlay\uFF08pageId: "${entry.page?.pageId}"\uFF09\u9700\u8981 OverlayHost \u6CE8\u5165 resolvePage`
|
|
775
779
|
)
|
|
776
780
|
);
|
|
777
781
|
return;
|
|
@@ -818,10 +822,10 @@ function PageOverlayBody({
|
|
|
818
822
|
}
|
|
819
823
|
// Annotate the CommonJS export names for ESM import in node:
|
|
820
824
|
0 && (module.exports = {
|
|
825
|
+
InteractionProvider,
|
|
821
826
|
OVERLAY_CANCEL_PAYLOAD,
|
|
827
|
+
OverlayHost,
|
|
822
828
|
OverlayManager,
|
|
823
|
-
ShadcnInteractionProvider,
|
|
824
|
-
ShadcnOverlayHost,
|
|
825
829
|
createUiBridge,
|
|
826
830
|
registerInteractionActions
|
|
827
831
|
});
|
|
@@ -84,8 +84,7 @@ declare class OverlayManager {
|
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* modal 实例(结构化类型,仅声明本包用到的 API):
|
|
87
|
-
* 由 InteractionProvider
|
|
88
|
-
* 在 mount 时注入 UiBridge。
|
|
87
|
+
* 由 InteractionProvider 在 mount 时注入 UiBridge。
|
|
89
88
|
*/
|
|
90
89
|
interface UiModal {
|
|
91
90
|
confirm(config: {
|
|
@@ -140,18 +139,16 @@ interface InteractionProviderProps {
|
|
|
140
139
|
children?: ReactNode;
|
|
141
140
|
}
|
|
142
141
|
/**
|
|
143
|
-
*
|
|
144
|
-
* (antd 版)契约一致——mount 时向 UiBridge 注入自绘实现:
|
|
142
|
+
* InteractionProvider:mount 时向 UiBridge 注入自绘实现:
|
|
145
143
|
*
|
|
146
144
|
* - `modal.confirm({ title, content, onOk, onCancel })`:vendored shadcn
|
|
147
|
-
* Dialog
|
|
148
|
-
* Modal.confirm);
|
|
145
|
+
* Dialog 渲染确认框,确定/取消回调后关闭(先关闭再回调);
|
|
149
146
|
* - `message.{success,error,info,warning}`:toast 栈(容器固定右上角,
|
|
150
147
|
* 自动约 3s 消失,类型色条读语义令牌)。
|
|
151
148
|
*
|
|
152
|
-
* unmount 时清空 bridge
|
|
149
|
+
* unmount 时清空 bridge,动作退化为受控失败。
|
|
153
150
|
*/
|
|
154
|
-
declare function
|
|
151
|
+
declare function InteractionProvider({ bridge, children, }: InteractionProviderProps): React.JSX.Element;
|
|
155
152
|
|
|
156
153
|
/**
|
|
157
154
|
* page overlay 的页面加载函数(通常包装 @pactor-app/resource loader):
|
|
@@ -164,17 +161,17 @@ interface OverlayHostProps {
|
|
|
164
161
|
resolvePage?: ResolvePageFn;
|
|
165
162
|
}
|
|
166
163
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
164
|
+
* OverlayHost:订阅 OverlayManager 堆栈逐条渲染;type 为 modal 用
|
|
165
|
+
* vendored shadcn Dialog、drawer 用 vendored drawer 原语(vaul,与 DSL
|
|
166
|
+
* 弹层适配器同一套 src/ui 原语,design D4);title/width 原样应用;
|
|
167
|
+
* UI 取消(X / 遮罩 / Escape)触发取消语义 close(resolve
|
|
168
|
+
* `{ success: false }`)。
|
|
172
169
|
*
|
|
173
|
-
*
|
|
170
|
+
* 必须位于 PageRuntime 的 React Context 之内;DSL content
|
|
174
171
|
* 经当前 Renderer 的 `renderChildren` 渲染,作用域注入
|
|
175
172
|
* `{ params: entry.params, parent: 父作用域快照 }`;page overlay 经注入的
|
|
176
173
|
* resolvePage 加载并创建共享宿主 registries 的子 PageRuntime。
|
|
177
174
|
*/
|
|
178
|
-
declare function
|
|
175
|
+
declare function OverlayHost({ manager, resolvePage }: OverlayHostProps): React.JSX.Element;
|
|
179
176
|
|
|
180
|
-
export { type InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, type OverlayConfig, type OverlayEntry, type OverlayHostProps, type OverlayListener, OverlayManager, type ResolvePageFn,
|
|
177
|
+
export { InteractionProvider, type InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, type OverlayConfig, type OverlayEntry, OverlayHost, type OverlayHostProps, type OverlayListener, OverlayManager, type ResolvePageFn, type UiBridge, type UiMessage, type UiModal, createUiBridge, registerInteractionActions };
|
|
@@ -84,8 +84,7 @@ declare class OverlayManager {
|
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* modal 实例(结构化类型,仅声明本包用到的 API):
|
|
87
|
-
* 由 InteractionProvider
|
|
88
|
-
* 在 mount 时注入 UiBridge。
|
|
87
|
+
* 由 InteractionProvider 在 mount 时注入 UiBridge。
|
|
89
88
|
*/
|
|
90
89
|
interface UiModal {
|
|
91
90
|
confirm(config: {
|
|
@@ -140,18 +139,16 @@ interface InteractionProviderProps {
|
|
|
140
139
|
children?: ReactNode;
|
|
141
140
|
}
|
|
142
141
|
/**
|
|
143
|
-
*
|
|
144
|
-
* (antd 版)契约一致——mount 时向 UiBridge 注入自绘实现:
|
|
142
|
+
* InteractionProvider:mount 时向 UiBridge 注入自绘实现:
|
|
145
143
|
*
|
|
146
144
|
* - `modal.confirm({ title, content, onOk, onCancel })`:vendored shadcn
|
|
147
|
-
* Dialog
|
|
148
|
-
* Modal.confirm);
|
|
145
|
+
* Dialog 渲染确认框,确定/取消回调后关闭(先关闭再回调);
|
|
149
146
|
* - `message.{success,error,info,warning}`:toast 栈(容器固定右上角,
|
|
150
147
|
* 自动约 3s 消失,类型色条读语义令牌)。
|
|
151
148
|
*
|
|
152
|
-
* unmount 时清空 bridge
|
|
149
|
+
* unmount 时清空 bridge,动作退化为受控失败。
|
|
153
150
|
*/
|
|
154
|
-
declare function
|
|
151
|
+
declare function InteractionProvider({ bridge, children, }: InteractionProviderProps): React.JSX.Element;
|
|
155
152
|
|
|
156
153
|
/**
|
|
157
154
|
* page overlay 的页面加载函数(通常包装 @pactor-app/resource loader):
|
|
@@ -164,17 +161,17 @@ interface OverlayHostProps {
|
|
|
164
161
|
resolvePage?: ResolvePageFn;
|
|
165
162
|
}
|
|
166
163
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
164
|
+
* OverlayHost:订阅 OverlayManager 堆栈逐条渲染;type 为 modal 用
|
|
165
|
+
* vendored shadcn Dialog、drawer 用 vendored drawer 原语(vaul,与 DSL
|
|
166
|
+
* 弹层适配器同一套 src/ui 原语,design D4);title/width 原样应用;
|
|
167
|
+
* UI 取消(X / 遮罩 / Escape)触发取消语义 close(resolve
|
|
168
|
+
* `{ success: false }`)。
|
|
172
169
|
*
|
|
173
|
-
*
|
|
170
|
+
* 必须位于 PageRuntime 的 React Context 之内;DSL content
|
|
174
171
|
* 经当前 Renderer 的 `renderChildren` 渲染,作用域注入
|
|
175
172
|
* `{ params: entry.params, parent: 父作用域快照 }`;page overlay 经注入的
|
|
176
173
|
* resolvePage 加载并创建共享宿主 registries 的子 PageRuntime。
|
|
177
174
|
*/
|
|
178
|
-
declare function
|
|
175
|
+
declare function OverlayHost({ manager, resolvePage }: OverlayHostProps): React.JSX.Element;
|
|
179
176
|
|
|
180
|
-
export { type InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, type OverlayConfig, type OverlayEntry, type OverlayHostProps, type OverlayListener, OverlayManager, type ResolvePageFn,
|
|
177
|
+
export { InteractionProvider, type InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, type OverlayConfig, type OverlayEntry, OverlayHost, type OverlayHostProps, type OverlayListener, OverlayManager, type ResolvePageFn, type UiBridge, type UiMessage, type UiModal, createUiBridge, registerInteractionActions };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
InteractionProvider,
|
|
2
3
|
OVERLAY_CANCEL_PAYLOAD,
|
|
4
|
+
OverlayHost,
|
|
3
5
|
OverlayManager,
|
|
4
|
-
ShadcnInteractionProvider,
|
|
5
|
-
ShadcnOverlayHost,
|
|
6
6
|
createUiBridge,
|
|
7
7
|
registerInteractionActions
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-7KC6DMKH.js";
|
|
9
|
+
import "../chunk-F42SGQNW.js";
|
|
10
|
+
import "../chunk-WKJUCGV4.js";
|
|
11
11
|
export {
|
|
12
|
+
InteractionProvider,
|
|
12
13
|
OVERLAY_CANCEL_PAYLOAD,
|
|
14
|
+
OverlayHost,
|
|
13
15
|
OverlayManager,
|
|
14
|
-
ShadcnInteractionProvider,
|
|
15
|
-
ShadcnOverlayHost,
|
|
16
16
|
createUiBridge,
|
|
17
17
|
registerInteractionActions
|
|
18
18
|
};
|