@lumal/cockpit 0.0.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +103 -0
- package/dist/cockpit.css +2 -0
- package/dist/createCockpitRegistry-D5F4d5By.js +30 -0
- package/dist/createCockpitRegistry-DHr9nXJY.cjs +1 -0
- package/dist/designer.cjs +1 -0
- package/dist/designer.js +2282 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +30 -0
- package/dist/registry.cjs +1 -0
- package/dist/registry.js +2 -0
- package/dist/resolveComponent-BF1aCxAk.cjs +1 -0
- package/dist/resolveComponent-QbJRsdxR.js +308 -0
- package/dist/runtime-CXiih7DE.js +627 -0
- package/dist/runtime-wzWMTWrS.cjs +1 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.js +3 -0
- package/dist/src/composables/index.d.ts +9 -0
- package/dist/src/composables/index.d.ts.map +1 -0
- package/dist/src/composables/useCanvasScale.d.ts +30 -0
- package/dist/src/composables/useCanvasScale.d.ts.map +1 -0
- package/dist/src/composables/useCockpit.d.ts +14 -0
- package/dist/src/composables/useCockpit.d.ts.map +1 -0
- package/dist/src/composables/useCockpitAutoRefresh.d.ts +27 -0
- package/dist/src/composables/useCockpitAutoRefresh.d.ts.map +1 -0
- package/dist/src/composables/useCockpitContext.d.ts +16 -0
- package/dist/src/composables/useCockpitContext.d.ts.map +1 -0
- package/dist/src/composables/useCockpitRefresh.d.ts +9 -0
- package/dist/src/composables/useCockpitRefresh.d.ts.map +1 -0
- package/dist/src/config/defaults.d.ts +19 -0
- package/dist/src/config/defaults.d.ts.map +1 -0
- package/dist/src/config/index.d.ts +13 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/migrate.d.ts +6 -0
- package/dist/src/config/migrate.d.ts.map +1 -0
- package/dist/src/config/normalize.d.ts +3 -0
- package/dist/src/config/normalize.d.ts.map +1 -0
- package/dist/src/config/validate.d.ts +8 -0
- package/dist/src/config/validate.d.ts.map +1 -0
- package/dist/src/designer/CockpitComponentLibrary.vue.d.ts +16 -0
- package/dist/src/designer/CockpitComponentLibrary.vue.d.ts.map +1 -0
- package/dist/src/designer/CockpitLayoutEditor.vue.d.ts +34 -0
- package/dist/src/designer/CockpitLayoutEditor.vue.d.ts.map +1 -0
- package/dist/src/designer/CockpitWidgetDropZone.vue.d.ts +45 -0
- package/dist/src/designer/CockpitWidgetDropZone.vue.d.ts.map +1 -0
- package/dist/src/designer/CockpitWidgetPreview.vue.d.ts +19 -0
- package/dist/src/designer/CockpitWidgetPreview.vue.d.ts.map +1 -0
- package/dist/src/designer/LumalCockpitDesigner.vue.d.ts +41 -0
- package/dist/src/designer/LumalCockpitDesigner.vue.d.ts.map +1 -0
- package/dist/src/designer/confirmWidgetReplacement.d.ts +3 -0
- package/dist/src/designer/confirmWidgetReplacement.d.ts.map +1 -0
- package/dist/src/designer/index.d.ts +13 -0
- package/dist/src/designer/index.d.ts.map +1 -0
- package/dist/src/designer/types.d.ts +13 -0
- package/dist/src/designer/types.d.ts.map +1 -0
- package/dist/src/designer/useCockpitDraft.d.ts +50 -0
- package/dist/src/designer/useCockpitDraft.d.ts.map +1 -0
- package/dist/src/index.d.ts +22 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/messaging/createCockpitMessageBus.d.ts +16 -0
- package/dist/src/messaging/createCockpitMessageBus.d.ts.map +1 -0
- package/dist/src/messaging/index.d.ts +5 -0
- package/dist/src/messaging/index.d.ts.map +1 -0
- package/dist/src/messaging/topics.d.ts +10 -0
- package/dist/src/messaging/topics.d.ts.map +1 -0
- package/dist/src/messaging/types.d.ts +24 -0
- package/dist/src/messaging/types.d.ts.map +1 -0
- package/dist/src/registry/createCockpitRegistry.d.ts +4 -0
- package/dist/src/registry/createCockpitRegistry.d.ts.map +1 -0
- package/dist/src/registry/index.d.ts +3 -0
- package/dist/src/registry/index.d.ts.map +1 -0
- package/dist/src/registry/types.d.ts +20 -0
- package/dist/src/registry/types.d.ts.map +1 -0
- package/dist/src/runtime/CockpitErrorBoundary.vue.d.ts +26 -0
- package/dist/src/runtime/CockpitErrorBoundary.vue.d.ts.map +1 -0
- package/dist/src/runtime/LumalCockpit.vue.d.ts +105 -0
- package/dist/src/runtime/LumalCockpit.vue.d.ts.map +1 -0
- package/dist/src/runtime/LumalCockpitCanvas.vue.d.ts +47 -0
- package/dist/src/runtime/LumalCockpitCanvas.vue.d.ts.map +1 -0
- package/dist/src/runtime/LumalCockpitCard.vue.d.ts +31 -0
- package/dist/src/runtime/LumalCockpitCard.vue.d.ts.map +1 -0
- package/dist/src/runtime/LumalCockpitContainer.vue.d.ts +12 -0
- package/dist/src/runtime/LumalCockpitContainer.vue.d.ts.map +1 -0
- package/dist/src/runtime/LumalCockpitRegion.vue.d.ts +11 -0
- package/dist/src/runtime/LumalCockpitRegion.vue.d.ts.map +1 -0
- package/dist/src/runtime/LumalCockpitWidgetHost.vue.d.ts +12 -0
- package/dist/src/runtime/LumalCockpitWidgetHost.vue.d.ts.map +1 -0
- package/dist/src/runtime/card.d.ts +16 -0
- package/dist/src/runtime/card.d.ts.map +1 -0
- package/dist/src/runtime/context.d.ts +25 -0
- package/dist/src/runtime/context.d.ts.map +1 -0
- package/dist/src/runtime/index.d.ts +19 -0
- package/dist/src/runtime/index.d.ts.map +1 -0
- package/dist/src/runtime/resolveComponent.d.ts +13 -0
- package/dist/src/runtime/resolveComponent.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +83 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/validate-DkC_IHrC.js +94 -0
- package/dist/validate-KSzm5SZW.cjs +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCockpitRegistry.d.ts","sourceRoot":"","sources":["../../../src/registry/createCockpitRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAA2B,MAAM,SAAS,CAAA;AAEvE,qDAAqD;AAErD,wBAAgB,qBAAqB,IAAI,eAAe,CAkCvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/registry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,YAAY,EACV,sBAAsB,EACtB,eAAe,EACf,uBAAuB,GACxB,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
/***********************模块注册表*********************/
|
|
3
|
+
export type CockpitComponentLoader = Component | (() => Promise<unknown>);
|
|
4
|
+
export interface CockpitWidgetDefinition {
|
|
5
|
+
type: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
group?: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
thumbnail?: string;
|
|
11
|
+
component: CockpitComponentLoader;
|
|
12
|
+
}
|
|
13
|
+
export interface CockpitRegistry {
|
|
14
|
+
registerWidget: (definition: CockpitWidgetDefinition) => void;
|
|
15
|
+
registerWidgets: (definitions: CockpitWidgetDefinition[]) => void;
|
|
16
|
+
unregisterWidget: (type: string) => void;
|
|
17
|
+
resolveWidget: (type: string) => CockpitWidgetDefinition | undefined;
|
|
18
|
+
listWidgets: () => readonly CockpitWidgetDefinition[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/registry/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,mDAAmD;AAGnD,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;AAEzE,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,sBAAsB,CAAA;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,CAAC,UAAU,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC7D,eAAe,EAAE,CAAC,WAAW,EAAE,uBAAuB,EAAE,KAAK,IAAI,CAAA;IACjE,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,uBAAuB,GAAG,SAAS,CAAA;IACpE,WAAW,EAAE,MAAM,SAAS,uBAAuB,EAAE,CAAA;CACtD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare function retry(): Promise<void>;
|
|
2
|
+
declare var __VLS_1: {
|
|
3
|
+
error: unknown;
|
|
4
|
+
retry: typeof retry;
|
|
5
|
+
}, __VLS_16: {
|
|
6
|
+
key: number;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
error?: (props: typeof __VLS_1) => any;
|
|
10
|
+
} & {
|
|
11
|
+
default?: (props: typeof __VLS_16) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
error: (error: unknown) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
16
|
+
onError?: ((error: unknown) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=CockpitErrorBoundary.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CockpitErrorBoundary.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/CockpitErrorBoundary.vue"],"names":[],"mappings":"AAoFA,iBAAe,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpC;AAqFD,QAAA,IAAI,OAAO;;;CAAU,EAAE,QAAQ;;CAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC1C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;;;;iFAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { CockpitRegistry } from '../registry/types';
|
|
2
|
+
import type { CockpitConfig, CockpitNodeSelectPayload, CockpitRenderMode, CockpitThemeMode, CockpitViewportMode } from '../types';
|
|
3
|
+
import type { CockpitCardComponent } from './card';
|
|
4
|
+
import { createCockpitMessageBus } from '../messaging/createCockpitMessageBus';
|
|
5
|
+
/***********************驾驶舱运行时主组件*********************/
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
config: CockpitConfig;
|
|
8
|
+
registry: CockpitRegistry;
|
|
9
|
+
baseWidth?: number;
|
|
10
|
+
baseHeight?: number;
|
|
11
|
+
cachePages?: boolean;
|
|
12
|
+
renderMode?: CockpitRenderMode;
|
|
13
|
+
viewportMode?: CockpitViewportMode;
|
|
14
|
+
messageBus?: ReturnType<typeof createCockpitMessageBus>;
|
|
15
|
+
cardComponent?: CockpitCardComponent;
|
|
16
|
+
/** 是否启用右上角全局自动刷新开关(默认关闭,由消费方 opt-in)。 */
|
|
17
|
+
autoRefresh?: boolean;
|
|
18
|
+
/** 自动刷新间隔(ms),默认 5 分钟。 */
|
|
19
|
+
autoRefreshIntervalMs?: number;
|
|
20
|
+
};
|
|
21
|
+
declare function enterFullscreen(): Promise<void>;
|
|
22
|
+
declare function exitFullscreen(): Promise<void>;
|
|
23
|
+
declare function toggleTheme(): void;
|
|
24
|
+
declare function requestConfigure(): void;
|
|
25
|
+
type __VLS_ModelProps = {
|
|
26
|
+
'activeLayoutId'?: string | undefined;
|
|
27
|
+
'themeMode'?: CockpitThemeMode;
|
|
28
|
+
'autoRefreshEnabled'?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
31
|
+
declare var __VLS_1: {
|
|
32
|
+
error: {};
|
|
33
|
+
}, __VLS_3: {}, __VLS_12: {}, __VLS_15: {
|
|
34
|
+
title: string;
|
|
35
|
+
}, __VLS_29: {}, __VLS_32: {
|
|
36
|
+
context: import("..").CockpitBaseContext;
|
|
37
|
+
layout: import("..").CockpitLayoutConfig;
|
|
38
|
+
}, __VLS_35: {
|
|
39
|
+
layout: import("..").CockpitLayoutConfig;
|
|
40
|
+
region: import("..").CockpitRegionConfig;
|
|
41
|
+
side: string;
|
|
42
|
+
}, __VLS_38: {
|
|
43
|
+
layout: import("..").CockpitLayoutConfig;
|
|
44
|
+
region: import("..").CockpitRegionConfig;
|
|
45
|
+
side: string;
|
|
46
|
+
}, __VLS_40: {
|
|
47
|
+
configure: typeof requestConfigure;
|
|
48
|
+
};
|
|
49
|
+
type __VLS_Slots = {} & {
|
|
50
|
+
error?: (props: typeof __VLS_1) => any;
|
|
51
|
+
} & {
|
|
52
|
+
empty?: (props: typeof __VLS_3) => any;
|
|
53
|
+
} & {
|
|
54
|
+
'header-prefix'?: (props: typeof __VLS_12) => any;
|
|
55
|
+
} & {
|
|
56
|
+
'header-title'?: (props: typeof __VLS_15) => any;
|
|
57
|
+
} & {
|
|
58
|
+
'header-actions'?: (props: typeof __VLS_29) => any;
|
|
59
|
+
} & {
|
|
60
|
+
center?: (props: typeof __VLS_32) => any;
|
|
61
|
+
} & {
|
|
62
|
+
left?: (props: typeof __VLS_35) => any;
|
|
63
|
+
} & {
|
|
64
|
+
right?: (props: typeof __VLS_38) => any;
|
|
65
|
+
} & {
|
|
66
|
+
'configure-trigger'?: (props: typeof __VLS_40) => any;
|
|
67
|
+
};
|
|
68
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
69
|
+
enterFullscreen: typeof enterFullscreen;
|
|
70
|
+
exitFullscreen: typeof exitFullscreen;
|
|
71
|
+
messages: import("..").CockpitMessageBus;
|
|
72
|
+
toggleTheme: typeof toggleTheme;
|
|
73
|
+
refreshNow: (reason?: import("..").CockpitRefreshPayload["reason"]) => void;
|
|
74
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
75
|
+
configure: () => any;
|
|
76
|
+
configError: (error: unknown) => any;
|
|
77
|
+
nodeSelect: (payload: CockpitNodeSelectPayload) => any;
|
|
78
|
+
"update:activeLayoutId": (value: string | undefined) => any;
|
|
79
|
+
"update:themeMode": (value: CockpitThemeMode) => any;
|
|
80
|
+
"update:autoRefreshEnabled": (value: boolean) => any;
|
|
81
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
82
|
+
onConfigure?: (() => any) | undefined;
|
|
83
|
+
onConfigError?: ((error: unknown) => any) | undefined;
|
|
84
|
+
onNodeSelect?: ((payload: CockpitNodeSelectPayload) => any) | undefined;
|
|
85
|
+
"onUpdate:activeLayoutId"?: ((value: string | undefined) => any) | undefined;
|
|
86
|
+
"onUpdate:themeMode"?: ((value: CockpitThemeMode) => any) | undefined;
|
|
87
|
+
"onUpdate:autoRefreshEnabled"?: ((value: boolean) => any) | undefined;
|
|
88
|
+
}>, {
|
|
89
|
+
baseWidth: number;
|
|
90
|
+
baseHeight: number;
|
|
91
|
+
viewportMode: CockpitViewportMode;
|
|
92
|
+
cachePages: boolean;
|
|
93
|
+
renderMode: CockpitRenderMode;
|
|
94
|
+
autoRefresh: boolean;
|
|
95
|
+
autoRefreshIntervalMs: number;
|
|
96
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
97
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
98
|
+
declare const _default: typeof __VLS_export;
|
|
99
|
+
export default _default;
|
|
100
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
101
|
+
new (): {
|
|
102
|
+
$slots: S;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=LumalCockpit.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LumalCockpit.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/LumalCockpit.vue"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CockpitCenterContext, CockpitLayoutConfig, CockpitViewportMode } from '../types';
|
|
2
|
+
/***********************基准画布*********************/
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
title: string;
|
|
5
|
+
baseWidth: number;
|
|
6
|
+
baseHeight: number;
|
|
7
|
+
layout: CockpitLayoutConfig;
|
|
8
|
+
centerContext: CockpitCenterContext;
|
|
9
|
+
viewportMode: CockpitViewportMode;
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_1: {}, __VLS_3: {
|
|
12
|
+
title: string;
|
|
13
|
+
}, __VLS_5: {}, __VLS_7: {
|
|
14
|
+
context: import("..").CockpitBaseContext;
|
|
15
|
+
layout: CockpitLayoutConfig;
|
|
16
|
+
}, __VLS_9: {
|
|
17
|
+
layout: CockpitLayoutConfig;
|
|
18
|
+
region: import("..").CockpitRegionConfig;
|
|
19
|
+
side: string;
|
|
20
|
+
}, __VLS_16: {
|
|
21
|
+
layout: CockpitLayoutConfig;
|
|
22
|
+
region: import("..").CockpitRegionConfig;
|
|
23
|
+
side: string;
|
|
24
|
+
};
|
|
25
|
+
type __VLS_Slots = {} & {
|
|
26
|
+
'header-prefix'?: (props: typeof __VLS_1) => any;
|
|
27
|
+
} & {
|
|
28
|
+
'header-title'?: (props: typeof __VLS_3) => any;
|
|
29
|
+
} & {
|
|
30
|
+
'header-actions'?: (props: typeof __VLS_5) => any;
|
|
31
|
+
} & {
|
|
32
|
+
center?: (props: typeof __VLS_7) => any;
|
|
33
|
+
} & {
|
|
34
|
+
left?: (props: typeof __VLS_9) => any;
|
|
35
|
+
} & {
|
|
36
|
+
right?: (props: typeof __VLS_16) => any;
|
|
37
|
+
};
|
|
38
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=LumalCockpitCanvas.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LumalCockpitCanvas.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/LumalCockpitCanvas.vue"],"names":[],"mappings":"AA+FA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAK9F,kDAAkD;AAElD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,mBAAmB,CAAA;IAC3B,aAAa,EAAE,oBAAoB,CAAA;IACnC,YAAY,EAAE,mBAAmB,CAAA;CAClC,CAAC;AA0JF,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO;;CAAU,EAAE,OAAO,IAAU,EAAE,OAAO;;;CAAU,EAAE,OAAO;;;;CAAU,EAAE,QAAQ;;;;CAAY,CAAE;AACzH,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACpD;IAAE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACnD;IAAE,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACrD;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACzC;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAO9C,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CockpitWidgetInstance } from '../types';
|
|
2
|
+
import type { CockpitCardProps, CockpitCardTab } from './card';
|
|
3
|
+
type __VLS_Slots = {
|
|
4
|
+
default?: (props: {
|
|
5
|
+
activeTabId: string | undefined;
|
|
6
|
+
}) => unknown;
|
|
7
|
+
title?: (props: {
|
|
8
|
+
title: string | undefined;
|
|
9
|
+
widget: CockpitWidgetInstance | undefined;
|
|
10
|
+
}) => unknown;
|
|
11
|
+
tab?: (props: {
|
|
12
|
+
tab: CockpitCardTab;
|
|
13
|
+
active: boolean;
|
|
14
|
+
}) => unknown;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<CockpitCardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
"update:activeTabId": (activeTabId: string) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<CockpitCardProps> & Readonly<{
|
|
19
|
+
"onUpdate:activeTabId"?: ((activeTabId: string) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
tabs: CockpitCardTab[];
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=LumalCockpitCard.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LumalCockpitCard.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/LumalCockpitCard.vue"],"names":[],"mappings":"AAwIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAe9D,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,KAAK,OAAO,CAAA;IACjE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,MAAM,EAAE,qBAAqB,GAAG,SAAS,CAAA;KAAE,KAAK,OAAO,CAAA;IACpG,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAA;CACnE,CAAC;AAsLF,QAAA,MAAM,UAAU;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CockpitGridColumnConfig, CockpitGridRowConfig, CockpitSide } from '../types';
|
|
2
|
+
/***********************网格行运行时*********************/
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
columns: CockpitGridColumnConfig[];
|
|
5
|
+
layoutId: string;
|
|
6
|
+
row: CockpitGridRowConfig;
|
|
7
|
+
side: CockpitSide;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=LumalCockpitContainer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LumalCockpitContainer.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/LumalCockpitContainer.vue"],"names":[],"mappings":"AAmHA,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAM1F,oDAAoD;AAEpD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,uBAAuB,EAAE,CAAA;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,oBAAoB,CAAA;IACzB,IAAI,EAAE,WAAW,CAAA;CAClB,CAAC;AAiNF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CockpitRegionConfig, CockpitSide } from '../types';
|
|
2
|
+
/***********************左右网格区域*********************/
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
layoutId: string;
|
|
5
|
+
region: CockpitRegionConfig;
|
|
6
|
+
side: CockpitSide;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=LumalCockpitRegion.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LumalCockpitRegion.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/LumalCockpitRegion.vue"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAIhE,oDAAoD;AAEpD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,mBAAmB,CAAA;IAC3B,IAAI,EAAE,WAAW,CAAA;CAClB,CAAC;AA8DF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CockpitWidgetInstance } from '../types';
|
|
2
|
+
/***********************业务模块 Host*********************/
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
layoutId: string;
|
|
5
|
+
side: 'left' | 'right';
|
|
6
|
+
widget: CockpitWidgetInstance;
|
|
7
|
+
embedded?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=LumalCockpitWidgetHost.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LumalCockpitWidgetHost.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/LumalCockpitWidgetHost.vue"],"names":[],"mappings":"AAyGA,OAAO,KAAK,EAAsB,qBAAqB,EAAE,MAAM,UAAU,CAAA;AASzE,uDAAuD;AAGvD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,MAAM,EAAE,qBAAqB,CAAA;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAiNF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { CockpitWidgetInstance } from '../types';
|
|
3
|
+
/***********************公共 Card 协议*********************/
|
|
4
|
+
export interface CockpitCardTab {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
widget: CockpitWidgetInstance;
|
|
8
|
+
}
|
|
9
|
+
export interface CockpitCardProps {
|
|
10
|
+
title?: string;
|
|
11
|
+
widget?: CockpitWidgetInstance;
|
|
12
|
+
tabs?: CockpitCardTab[];
|
|
13
|
+
activeTabId?: string;
|
|
14
|
+
}
|
|
15
|
+
export type CockpitCardComponent = Component<CockpitCardProps>;
|
|
16
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/runtime/card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAErD,wDAAwD;AAExD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,qBAAqB,CAAA;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,IAAI,CAAC,EAAE,cAAc,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { InjectionKey, Slots } from 'vue';
|
|
2
|
+
import type { CockpitMessageBus } from '../messaging/types';
|
|
3
|
+
import type { CockpitRegistry } from '../registry/types';
|
|
4
|
+
import type { CockpitRenderMode } from '../types';
|
|
5
|
+
import type { CockpitCardComponent } from './card';
|
|
6
|
+
/***********************运行时内部环境上下文*********************/
|
|
7
|
+
/**
|
|
8
|
+
* 由 LumalCockpit 向整棵运行时子树提供的稳定环境。
|
|
9
|
+
* 不含 categoryId / pageId,这些随页面变化,通过 props 下传。
|
|
10
|
+
*/
|
|
11
|
+
export interface CockpitRuntimeEnv {
|
|
12
|
+
cockpitId: string;
|
|
13
|
+
mode: CockpitRenderMode;
|
|
14
|
+
registry: CockpitRegistry;
|
|
15
|
+
messages: CockpitMessageBus;
|
|
16
|
+
/** 是否在页面切换后保留组件状态 */
|
|
17
|
+
cachePages: boolean;
|
|
18
|
+
/** 宿主传入的插槽,供深层 Host 渲染降级/自定义内容 */
|
|
19
|
+
slots: Slots;
|
|
20
|
+
/** 普通模块与合并模块共用的 Card 实现 */
|
|
21
|
+
cardComponent: CockpitCardComponent;
|
|
22
|
+
}
|
|
23
|
+
export declare const cockpitRuntimeEnvKey: InjectionKey<CockpitRuntimeEnv>;
|
|
24
|
+
export declare function useCockpitRuntimeEnv(): CockpitRuntimeEnv;
|
|
25
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/runtime/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAGlD,wDAAwD;AAExD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,iBAAiB,CAAA;IACvB,QAAQ,EAAE,eAAe,CAAA;IACzB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,qBAAqB;IACrB,UAAU,EAAE,OAAO,CAAA;IACnB,kCAAkC;IAClC,KAAK,EAAE,KAAK,CAAA;IACZ,2BAA2B;IAC3B,aAAa,EAAE,oBAAoB,CAAA;CACpC;AAED,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,iBAAiB,CAAuC,CAAA;AAExG,wBAAgB,oBAAoB,IAAI,iBAAiB,CAKxD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import LumalCockpitComp from './LumalCockpit.vue';
|
|
3
|
+
import LumalCockpitCardComp from './LumalCockpitCard.vue';
|
|
4
|
+
/***********************导出*********************/
|
|
5
|
+
export declare const LumalCockpit: typeof LumalCockpitComp & {
|
|
6
|
+
install: (app: App) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const LumalCockpitCard: typeof LumalCockpitCardComp & {
|
|
9
|
+
install: (app: App) => void;
|
|
10
|
+
};
|
|
11
|
+
export type { CockpitCardComponent, CockpitCardProps, CockpitCardTab } from './card';
|
|
12
|
+
export { cockpitRuntimeEnvKey, useCockpitRuntimeEnv } from './context';
|
|
13
|
+
export type { CockpitRuntimeEnv } from './context';
|
|
14
|
+
export { default as LumalCockpitCanvas } from './LumalCockpitCanvas.vue';
|
|
15
|
+
export { default as LumalCockpitContainer } from './LumalCockpitContainer.vue';
|
|
16
|
+
export { default as LumalCockpitRegion } from './LumalCockpitRegion.vue';
|
|
17
|
+
export { default as LumalCockpitWidgetHost } from './LumalCockpitWidgetHost.vue';
|
|
18
|
+
export { resolveCockpitComponent } from './resolveComponent';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,oBAAoB,MAAM,wBAAwB,CAAA;AAezD,gDAAgD;AAChD,eAAO,MAAM,YAAY,EAGpB,OAAO,gBAAgB,GAAG;IAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;CAAE,CAAA;AAE9D,eAAO,MAAM,gBAAgB,EAGxB,OAAO,oBAAoB,GAAG;IAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;CAAE,CAAA;AAElE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACpF,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { CockpitComponentLoader } from '../registry/types';
|
|
3
|
+
/**
|
|
4
|
+
* 将注册定义中的 component 解析为可渲染的 Vue 组件。
|
|
5
|
+
*
|
|
6
|
+
* - 函数视为异步 loader,用 defineAsyncComponent 包装以支持代码分割;
|
|
7
|
+
* 同一 loader 记忆化,避免每次渲染重新定义导致状态丢失。
|
|
8
|
+
* - 其余(SFC / 组件对象)直接返回。
|
|
9
|
+
*
|
|
10
|
+
* 加载或渲染失败不在此处处理,交由 Host 的错误边界统一降级并提供重试。
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveCockpitComponent(loader: CockpitComponentLoader): Component;
|
|
13
|
+
//# sourceMappingURL=resolveComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveComponent.d.ts","sourceRoot":"","sources":["../../../src/runtime/resolveComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAO/D;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,sBAAsB,GAAG,SAAS,CAWjF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { CockpitMessageBus } from '../messaging/types';
|
|
2
|
+
/***********************公开配置模型*********************/
|
|
3
|
+
export type CockpitSide = 'left' | 'right';
|
|
4
|
+
export interface CockpitWidgetInstance {
|
|
5
|
+
id: string;
|
|
6
|
+
type: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CockpitGridColumnConfig {
|
|
10
|
+
id: string;
|
|
11
|
+
/** 由区域宽按列数均分后的列宽像素(运行时/预览用,不单独编辑)。 */
|
|
12
|
+
width: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CockpitGridCellConfig {
|
|
15
|
+
id: string;
|
|
16
|
+
/** 未设置时渲染为空槽。 */
|
|
17
|
+
widget?: CockpitWidgetInstance;
|
|
18
|
+
}
|
|
19
|
+
export type CockpitGridRowMode = 'grid' | 'tabs';
|
|
20
|
+
export interface CockpitGridRowConfig {
|
|
21
|
+
id: string;
|
|
22
|
+
/** 区域内的行高百分比,所有行标准化后恒为 100。 */
|
|
23
|
+
height: number;
|
|
24
|
+
mode: CockpitGridRowMode;
|
|
25
|
+
/** grid 行按列顺序保存一个单元格。tabs 行为空数组。 */
|
|
26
|
+
cells: CockpitGridCellConfig[];
|
|
27
|
+
/** tabs 行保存同一整行可切换的模块。grid 行为空数组。 */
|
|
28
|
+
widgets: CockpitWidgetInstance[];
|
|
29
|
+
activeWidgetId?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CockpitRegionConfig {
|
|
32
|
+
/** 1920 基准画布中的区域总宽像素;列宽按列数均分。 */
|
|
33
|
+
width: number;
|
|
34
|
+
columns: CockpitGridColumnConfig[];
|
|
35
|
+
rows: CockpitGridRowConfig[];
|
|
36
|
+
}
|
|
37
|
+
export interface CockpitLayoutConfig {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
left: CockpitRegionConfig;
|
|
41
|
+
right: CockpitRegionConfig;
|
|
42
|
+
}
|
|
43
|
+
export interface CockpitConfig {
|
|
44
|
+
schemaVersion: number;
|
|
45
|
+
id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
activeLayoutId?: string;
|
|
48
|
+
layouts: CockpitLayoutConfig[];
|
|
49
|
+
}
|
|
50
|
+
/***********************组件运行时协议*********************/
|
|
51
|
+
export type CockpitThemeMode = 'light' | 'dark';
|
|
52
|
+
export type CockpitRenderMode = 'runtime' | 'design';
|
|
53
|
+
export type CockpitViewportMode = 'scale' | 'vwvh' | 'external';
|
|
54
|
+
export type CockpitNodeKind = 'layout' | 'region' | 'column' | 'row' | 'cell' | 'widget';
|
|
55
|
+
export interface CockpitNodeSelectPayload {
|
|
56
|
+
kind: CockpitNodeKind;
|
|
57
|
+
id: string;
|
|
58
|
+
side?: CockpitSide;
|
|
59
|
+
}
|
|
60
|
+
export interface CockpitBaseContext {
|
|
61
|
+
cockpitId: string;
|
|
62
|
+
layoutId: string;
|
|
63
|
+
instanceId: string;
|
|
64
|
+
mode: CockpitRenderMode;
|
|
65
|
+
messages: CockpitMessageBus;
|
|
66
|
+
}
|
|
67
|
+
export type CockpitCenterContext = CockpitBaseContext;
|
|
68
|
+
export type CockpitWidgetContext = CockpitBaseContext;
|
|
69
|
+
/***********************Designer 事件负载*********************/
|
|
70
|
+
export interface CockpitDesignerSavePayload {
|
|
71
|
+
config: CockpitConfig;
|
|
72
|
+
/** 本次保存时正在编辑的布局,便于消费方做局部持久化或即时反馈。 */
|
|
73
|
+
layout: CockpitLayoutConfig;
|
|
74
|
+
}
|
|
75
|
+
/***********************配置校验问题*********************/
|
|
76
|
+
export type CockpitConfigIssueLevel = 'error' | 'warning';
|
|
77
|
+
export interface CockpitConfigIssue {
|
|
78
|
+
level: CockpitConfigIssueLevel;
|
|
79
|
+
message: string;
|
|
80
|
+
/** 关联到具体结构节点的 id 路径,用于在 Designer 中定位。 */
|
|
81
|
+
path?: string[];
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import "./resolveComponent-QbJRsdxR.js";
|
|
2
|
+
//#region src/config/validate.ts
|
|
3
|
+
function e(e, t, n, r, i) {
|
|
4
|
+
e.has(n) && t.push({
|
|
5
|
+
level: "error",
|
|
6
|
+
message: `${r} 存在重复 id:${n}`,
|
|
7
|
+
path: i
|
|
8
|
+
}), e.add(n);
|
|
9
|
+
}
|
|
10
|
+
function t(t, n, r, i, a) {
|
|
11
|
+
t.height > 0 || a.push({
|
|
12
|
+
level: "error",
|
|
13
|
+
message: "行高必须大于 0%。",
|
|
14
|
+
path: r
|
|
15
|
+
}), t.mode === "grid" && t.cells.length !== n.columns.length && a.push({
|
|
16
|
+
level: "error",
|
|
17
|
+
message: "普通行的单元格数量必须与列数一致。",
|
|
18
|
+
path: r
|
|
19
|
+
}), t.mode === "tabs" && t.cells.length && a.push({
|
|
20
|
+
level: "error",
|
|
21
|
+
message: "Tab 行不能保留普通单元格。",
|
|
22
|
+
path: r
|
|
23
|
+
}), (t.mode === "tabs" ? t.widgets : t.cells.flatMap((e) => e.widget ? [e.widget] : [])).forEach((t) => {
|
|
24
|
+
e(i, a, t.id, "模块实例", [...r, t.id]), t.type.trim() || a.push({
|
|
25
|
+
level: "error",
|
|
26
|
+
message: "模块类型不能为空。",
|
|
27
|
+
path: [...r, t.id]
|
|
28
|
+
});
|
|
29
|
+
}), t.mode === "tabs" && t.activeWidgetId && !t.widgets.some((e) => e.id === t.activeWidgetId) && a.push({
|
|
30
|
+
level: "error",
|
|
31
|
+
message: "当前 Tab 不存在。",
|
|
32
|
+
path: r
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function n(n, r, i, a) {
|
|
36
|
+
n.columns.length || a.push({
|
|
37
|
+
level: "error",
|
|
38
|
+
message: "区域至少需要一列。",
|
|
39
|
+
path: r
|
|
40
|
+
}), n.rows.length || a.push({
|
|
41
|
+
level: "error",
|
|
42
|
+
message: "区域至少需要一行。",
|
|
43
|
+
path: r
|
|
44
|
+
}), n.width > 0 || a.push({
|
|
45
|
+
level: "error",
|
|
46
|
+
message: "区域宽度必须大于 0 像素。",
|
|
47
|
+
path: r
|
|
48
|
+
});
|
|
49
|
+
let o = /* @__PURE__ */ new Set(), s = n.columns.reduce((e, t) => e + t.width, 0);
|
|
50
|
+
n.columns.forEach((t) => {
|
|
51
|
+
e(o, a, t.id, "列", [...r, t.id]), t.width > 0 || a.push({
|
|
52
|
+
level: "error",
|
|
53
|
+
message: "列宽必须大于 0 像素。",
|
|
54
|
+
path: [...r, t.id]
|
|
55
|
+
});
|
|
56
|
+
}), n.columns.length && n.width > 0 && s !== n.width && a.push({
|
|
57
|
+
level: "error",
|
|
58
|
+
message: "列宽总和必须等于区域宽度。",
|
|
59
|
+
path: r
|
|
60
|
+
});
|
|
61
|
+
let c = /* @__PURE__ */ new Set();
|
|
62
|
+
n.rows.forEach((o) => {
|
|
63
|
+
e(c, a, o.id, "行", [...r, o.id]), t(o, n, [...r, o.id], i, a);
|
|
64
|
+
});
|
|
65
|
+
let l = n.rows.reduce((e, t) => e + t.height, 0);
|
|
66
|
+
Math.abs(l - 100) > .01 && a.push({
|
|
67
|
+
level: "error",
|
|
68
|
+
message: "区域行高总和必须为 100%。",
|
|
69
|
+
path: r
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function r(t) {
|
|
73
|
+
let r = [];
|
|
74
|
+
t.schemaVersion !== 3 && r.push({
|
|
75
|
+
level: "error",
|
|
76
|
+
message: "配置版本必须为 v3。"
|
|
77
|
+
}), t.layouts.length || r.push({
|
|
78
|
+
level: "error",
|
|
79
|
+
message: "驾驶舱至少需要一个布局。"
|
|
80
|
+
});
|
|
81
|
+
let i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
82
|
+
return t.layouts.forEach((t) => {
|
|
83
|
+
e(i, r, t.id, "布局", [t.id]), t.title.trim() || r.push({
|
|
84
|
+
level: "error",
|
|
85
|
+
message: "布局名称不能为空。",
|
|
86
|
+
path: [t.id]
|
|
87
|
+
}), n(t.left, [t.id, "left"], a, r), n(t.right, [t.id, "right"], a, r);
|
|
88
|
+
}), {
|
|
89
|
+
valid: !r.some((e) => e.level === "error"),
|
|
90
|
+
issues: r
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { r as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./resolveComponent-BF1aCxAk.cjs");function e(e,t,n,r,i){e.has(n)&&t.push({level:`error`,message:`${r} 存在重复 id:${n}`,path:i}),e.add(n)}function t(t,n,r,i,a){t.height>0||a.push({level:`error`,message:`行高必须大于 0%。`,path:r}),t.mode===`grid`&&t.cells.length!==n.columns.length&&a.push({level:`error`,message:`普通行的单元格数量必须与列数一致。`,path:r}),t.mode===`tabs`&&t.cells.length&&a.push({level:`error`,message:`Tab 行不能保留普通单元格。`,path:r}),(t.mode===`tabs`?t.widgets:t.cells.flatMap(e=>e.widget?[e.widget]:[])).forEach(t=>{e(i,a,t.id,`模块实例`,[...r,t.id]),t.type.trim()||a.push({level:`error`,message:`模块类型不能为空。`,path:[...r,t.id]})}),t.mode===`tabs`&&t.activeWidgetId&&!t.widgets.some(e=>e.id===t.activeWidgetId)&&a.push({level:`error`,message:`当前 Tab 不存在。`,path:r})}function n(n,r,i,a){n.columns.length||a.push({level:`error`,message:`区域至少需要一列。`,path:r}),n.rows.length||a.push({level:`error`,message:`区域至少需要一行。`,path:r}),n.width>0||a.push({level:`error`,message:`区域宽度必须大于 0 像素。`,path:r});let o=new Set,s=n.columns.reduce((e,t)=>e+t.width,0);n.columns.forEach(t=>{e(o,a,t.id,`列`,[...r,t.id]),t.width>0||a.push({level:`error`,message:`列宽必须大于 0 像素。`,path:[...r,t.id]})}),n.columns.length&&n.width>0&&s!==n.width&&a.push({level:`error`,message:`列宽总和必须等于区域宽度。`,path:r});let c=new Set;n.rows.forEach(o=>{e(c,a,o.id,`行`,[...r,o.id]),t(o,n,[...r,o.id],i,a)});let l=n.rows.reduce((e,t)=>e+t.height,0);Math.abs(l-100)>.01&&a.push({level:`error`,message:`区域行高总和必须为 100%。`,path:r})}function r(t){let r=[];t.schemaVersion!==3&&r.push({level:`error`,message:`配置版本必须为 v3。`}),t.layouts.length||r.push({level:`error`,message:`驾驶舱至少需要一个布局。`});let i=new Set,a=new Set;return t.layouts.forEach(t=>{e(i,r,t.id,`布局`,[t.id]),t.title.trim()||r.push({level:`error`,message:`布局名称不能为空。`,path:[t.id]}),n(t.left,[t.id,`left`],a,r),n(t.right,[t.id,`right`],a,r)}),{valid:!r.some(e=>e.level===`error`),issues:r}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|