@kdesigner/amis-vue 0.0.0-alpha.1

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 ADDED
@@ -0,0 +1,53 @@
1
+ # @kdesigner/omni
2
+
3
+ ![License](https://img.shields.io/badge/license-MIT-blue.svg)
4
+ ![TypeScript](https://img.shields.io/badge/typescript-%5E5.9.2-blue.svg)
5
+ ![Version](https://img.shields.io/npm/v/@kdesigner/omni.svg)
6
+
7
+ KDesigner 通用工具库 - 框架无关的通用工具集合。
8
+
9
+ ## ✨ 特性
10
+
11
+ - 🛠️ **框架无关** - 可在任何前端框架(React, Vue, 原生 JS)中使用
12
+ - 🛡️ **TypeScript** - 100% TS 编写,提供完备的类型推导
13
+ - 🧩 **模块化设计** - 支持按需引入,减少打包体积
14
+ - 📦 **丰富的功能** - 包含日期处理、URL 解析、数据转换等常用工具
15
+ - 🔌 **AMIS 兼容** - 提供对 AMIS 和 AMIS-Vue 的适配增强
16
+
17
+ ## 📦 安装
18
+
19
+ ```bash
20
+ pnpm add @kdesigner/omni
21
+ ```
22
+
23
+ ## 🚀 快速开始
24
+
25
+ ```typescript
26
+ import { formatTime, getUrlParams } from '@kdesigner/omni'
27
+
28
+ // 时间格式化
29
+ console.log(formatTime(new Date()))
30
+
31
+ // URL 参数解析
32
+ console.log(getUrlParams(window.location.search))
33
+ ```
34
+
35
+ ## 🛠 开发与构建
36
+
37
+ ```bash
38
+ # 安装依赖
39
+ pnpm install
40
+
41
+ # 监视模式开发
42
+ pnpm dev
43
+
44
+ # 构建产物
45
+ pnpm build
46
+
47
+ # 运行测试
48
+ pnpm test
49
+ ```
50
+
51
+ ## 📝 许可证
52
+
53
+ MIT
@@ -0,0 +1,190 @@
1
+
2
+ .page-editor-root {
3
+ position: fixed;
4
+ inset: 0;
5
+ z-index: 2100;
6
+ background: var(--color-bg, #fff);
7
+ }
8
+
9
+ .app-loading[data-v-a382f6ec] {
10
+ display: flex;
11
+ width: 100%;
12
+ height: 100%;
13
+ min-height: 160px;
14
+ align-items: center;
15
+ justify-content: center;
16
+ background: var(--color-bg, #fafafa);
17
+ }
18
+ .app-loading-spinner[data-v-a382f6ec] {
19
+ width: 28px;
20
+ height: 28px;
21
+ border-radius: 50%;
22
+ border: 2px solid var(--color-border, rgba(0, 0, 0, 0.12));
23
+ border-top-color: var(--color-fg, #111);
24
+ animation: app-loading-spin-a382f6ec 0.7s linear infinite;
25
+ }
26
+ html[data-theme='dark'] .app-loading[data-v-a382f6ec] {
27
+ background: var(--color-bg, #111);
28
+ }
29
+ html[data-theme='dark'] .app-loading-spinner[data-v-a382f6ec] {
30
+ border-color: var(--color-border, rgba(255, 255, 255, 0.16));
31
+ border-top-color: var(--color-fg, #ededed);
32
+ }
33
+ @keyframes app-loading-spin-a382f6ec {
34
+ to {
35
+ transform: rotate(360deg);
36
+ }
37
+ }
38
+
39
+ .page-debugger {
40
+ position: fixed;
41
+ top: 56px;
42
+ right: 16px;
43
+ z-index: 1000;
44
+ display: inline-flex;
45
+ align-items: center;
46
+ gap: 4px;
47
+ padding: 4px;
48
+ border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
49
+ border-radius: 8px;
50
+ background: var(--color-bg, #fff);
51
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
52
+ }
53
+ .page-debugger.is-dragging {
54
+ opacity: 0.92;
55
+ }
56
+ .debug-handle {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ width: 18px;
61
+ height: 28px;
62
+ padding: 0;
63
+ border: none;
64
+ border-radius: 4px;
65
+ background: transparent;
66
+ color: var(--color-fg-subtle, #999);
67
+ font-size: 12px;
68
+ line-height: 1;
69
+ letter-spacing: -2px;
70
+ cursor: grab;
71
+ touch-action: none;
72
+ user-select: none;
73
+ }
74
+ .debug-handle:hover {
75
+ color: var(--color-fg-muted, #666);
76
+ background: var(--color-hover, rgba(0, 0, 0, 0.04));
77
+ }
78
+ .page-debugger.is-dragging .debug-handle {
79
+ cursor: grabbing;
80
+ }
81
+ .debug-btn {
82
+ width: 28px;
83
+ height: 28px;
84
+ padding: 0;
85
+ border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
86
+ border-radius: 6px;
87
+ background: transparent;
88
+ color: var(--color-fg-muted, #666);
89
+ font-size: 12px;
90
+ font-weight: 600;
91
+ letter-spacing: 0;
92
+ line-height: 1;
93
+ cursor: pointer;
94
+ transition:
95
+ color 0.15s ease,
96
+ background 0.15s ease,
97
+ border-color 0.15s ease;
98
+ }
99
+ .debug-btn:hover {
100
+ color: var(--color-fg, #111);
101
+ background: var(--color-hover, rgba(0, 0, 0, 0.04));
102
+ border-color: var(--color-fg-muted, #999);
103
+ }
104
+ .schema-modal-root {
105
+ position: fixed;
106
+ inset: 0;
107
+ z-index: 2000;
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ padding: 24px;
112
+ }
113
+ .schema-modal-mask {
114
+ position: absolute;
115
+ inset: 0;
116
+ background: rgba(0, 0, 0, 0.35);
117
+ }
118
+ .schema-modal-panel {
119
+ position: relative;
120
+ z-index: 1;
121
+ display: flex;
122
+ flex-direction: column;
123
+ width: min(720px, 100%);
124
+ max-height: min(80vh, 720px);
125
+ overflow: hidden;
126
+ border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
127
+ border-radius: 10px;
128
+ background: var(--color-bg, #fff);
129
+ box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
130
+ }
131
+ .schema-modal-header {
132
+ display: flex;
133
+ flex-shrink: 0;
134
+ align-items: center;
135
+ justify-content: space-between;
136
+ gap: 12px;
137
+ height: 48px;
138
+ padding: 0 14px 0 16px;
139
+ border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
140
+ }
141
+ .schema-modal-title {
142
+ margin: 0;
143
+ font-size: 15px;
144
+ font-weight: 600;
145
+ color: var(--color-fg, #111);
146
+ }
147
+ .schema-modal-close {
148
+ width: 28px;
149
+ height: 28px;
150
+ border: none;
151
+ border-radius: 6px;
152
+ background: transparent;
153
+ color: var(--color-fg-muted, #666);
154
+ font-size: 20px;
155
+ line-height: 1;
156
+ cursor: pointer;
157
+ }
158
+ .schema-modal-close:hover {
159
+ background: var(--color-hover, rgba(0, 0, 0, 0.04));
160
+ color: var(--color-fg, #111);
161
+ }
162
+ .schema-modal-body {
163
+ flex: 1;
164
+ min-height: 0;
165
+ overflow: auto;
166
+ padding: 12px 16px 16px;
167
+ }
168
+ body.is-modalOpened .ant-popover {
169
+ z-index: 1400;
170
+ }
171
+
172
+ .cxd-Pagination > li > a, .cxd-Pagination > li > span {
173
+ height: auto;
174
+ }
175
+
176
+ .cxd-Table--autoFillHeight .cxd-Table-footToolbar {
177
+ padding: 0;
178
+ }
179
+
180
+ .cxd-Panel.no-heading > .cxd-Panel-heading {
181
+ display: none;
182
+ }
183
+
184
+ .cxd-Panel.actions-center > .cxd-Panel-footerWrap > .cxd-Panel-btnToolbar {
185
+ text-align: center;
186
+ }
187
+
188
+ .cxd-TreeControl.h-full > .cxd-Tree {
189
+ max-height: none;
190
+ }
@@ -0,0 +1,39 @@
1
+ declare const _default: {
2
+ type: string;
3
+ 'xui:schema': string;
4
+ body: {
5
+ type: string;
6
+ title: null;
7
+ actions: ({
8
+ label: string;
9
+ type: string;
10
+ actionType: string;
11
+ level: string;
12
+ api: {
13
+ url: string;
14
+ messages: {
15
+ success: string;
16
+ };
17
+ };
18
+ } | {
19
+ label: string;
20
+ type: string;
21
+ actionType: string;
22
+ level: string;
23
+ api: string;
24
+ })[];
25
+ body: ({
26
+ type: string;
27
+ name: string;
28
+ placeholder: string;
29
+ visibleOn: string;
30
+ } | {
31
+ type: string;
32
+ name: string;
33
+ placeholder: {};
34
+ visibleOn: string;
35
+ })[];
36
+ };
37
+ };
38
+ export default _default;
39
+ //# sourceMappingURL=debugger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debugger.d.ts","sourceRoot":"","sources":["../../src/debug/debugger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAwDC"}
@@ -0,0 +1,3 @@
1
+ export { default as XuiDebugger } from './XuiDebugger.vue';
2
+ export { default as debuggerSchema } from './debugger';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { ActionObject, ButtonSchema, RendererProps, SchemaApi } from 'amis';
2
+ import { FeedbackDialog, SchemaReload } from 'amis/lib/Schema';
3
+ import { default as React } from 'react';
4
+ interface XuiPageEditorButtonSchema extends ButtonSchema {
5
+ actionType: 'popEditor';
6
+ initApi: SchemaApi;
7
+ rollbackApi?: SchemaApi;
8
+ api: SchemaApi;
9
+ feedback?: FeedbackDialog;
10
+ reload?: SchemaReload;
11
+ redirect?: string;
12
+ ignoreConfirm?: boolean;
13
+ /**
14
+ * 是否开启请求隔离, 主要用于隔离联动CRUD, Service的请求
15
+ */
16
+ isolateScope?: boolean;
17
+ }
18
+ type XuiPageEditorButtonProps = RendererProps & XuiPageEditorButtonSchema;
19
+ type ButtonState = {
20
+ dialogVisible: boolean;
21
+ };
22
+ export declare class XuiPageEditorButton extends React.Component<XuiPageEditorButtonProps, ButtonState> {
23
+ dialogComponent: any;
24
+ savePageSource: (data: any) => Promise<any>;
25
+ getPageSource: () => Promise<any>;
26
+ rollbackPageSource: () => Promise<any>;
27
+ constructor(props: XuiPageEditorButtonProps);
28
+ handleAction(e: React.MouseEvent<any>, action: ActionObject): any;
29
+ render(): React.FunctionComponentElement<{
30
+ children?: React.ReactNode | undefined;
31
+ }>;
32
+ }
33
+ export {};
34
+ //# sourceMappingURL=XuiPageEditor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;;;CAuBP"}
@@ -0,0 +1,5 @@
1
+ export { default as AmisPageEditor } from './AmisPageEditor.vue';
2
+ export { default as XuiPageEditor } from './XuiPageEditor.vue';
3
+ export { default as XuiPageEditorDialog } from './XuiPageEditorDialog.vue';
4
+ export { default as XuiLoading } from './XuiLoading.vue';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGxD,OAAO,uBAAuB,CAAA"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 本包模块聚合入口:页面渲染 / 编辑器 / 调试 / 运行时适配
3
+ * 对外仍经 lib.ts → index.ts 透出,保持 @kdesigner/amis-vue 顶层 API 不变
4
+ */
5
+ export { AmisPageEditor, XuiPageEditor, XuiLoading } from './editor';
6
+ export { AmisSchemaPage, XuiSchemaPage, XuiPage } from './page';
7
+ export { AmisToast } from './toast';
8
+ export { createEnv, AmisVueComponent } from './runtime';
9
+ export type { ReactPageOptions, VueControlProps } from './runtime';
10
+ export * from './runtime/react-adapter';
11
+ //# sourceMappingURL=exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAClE,cAAc,yBAAyB,CAAA;AAGvC,OAAO,WAAW,CAAA;AAClB,OAAO,UAAU,CAAA"}