cdp-material-sdk 0.0.5
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 +67 -0
- package/dist/DataScope-B7ffH5qN.js +106 -0
- package/dist/components/core/types.d.ts +16 -0
- package/dist/components/data-scope/DataScope.d.ts +45 -0
- package/dist/constants/event.d.ts +22 -0
- package/dist/context/DataContainerRuntimeContext.d.ts +16 -0
- package/dist/context/DataScopeContext.d.ts +51 -0
- package/dist/context/PageContext.d.ts +26 -0
- package/dist/hooks/useConcurrentLoading.d.ts +16 -0
- package/dist/hooks/useDataContainer.d.ts +61 -0
- package/dist/hooks/useDualLoading.d.ts +22 -0
- package/dist/host-react.d.ts +15 -0
- package/dist/host-react.js +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +42 -0
- package/dist/plugin.d.ts +45 -0
- package/dist/portable.d.ts +20 -0
- package/dist/portable.js +33 -0
- package/dist/protocol/adapter.d.ts +50 -0
- package/dist/protocol/common-schemas.d.ts +64 -0
- package/dist/protocol/events.d.ts +48 -0
- package/dist/protocol/manifest-types.d.ts +10 -0
- package/dist/protocol/manifest.d.ts +144 -0
- package/dist/protocol/traits.d.ts +7 -0
- package/dist/types/category.d.ts +15 -0
- package/dist/utils/mergeInitialValue.d.ts +10 -0
- package/dist/validateManifest-CYqjvQe_.js +355 -0
- package/dist/validation/validateManifest.d.ts +59 -0
- package/docs/component-development/FAQ.md +203 -0
- package/docs/component-development/README.md +176 -0
- package/docs/component-development/getting-started/01-/345/210/233/345/273/272/346/210/226/346/216/245/345/205/245/347/273/204/344/273/266/345/272/223/345/267/245/347/250/213.md +172 -0
- package/docs/component-development/getting-started/02-/345/210/233/345/273/272/347/273/204/344/273/266/345/214/205/345/271/266/346/263/250/345/206/214.md +185 -0
- package/docs/component-development/getting-started/03-/345/274/200/345/217/221/346/234/200/345/260/217/345/217/257/350/277/220/350/241/214/347/273/204/344/273/266.md +196 -0
- package/docs/component-development/getting-started/04-/346/236/204/345/273/272/345/217/221/345/270/203/344/270/216/345/256/277/344/270/273/346/216/245/345/205/245.md +147 -0
- package/docs/component-development/getting-started/05-/350/207/252/346/243/200/344/270/216/346/216/222/351/224/231.md +186 -0
- package/docs/component-development/recipes//344/275/277/347/224/250Adapter/351/200/202/351/205/215/347/273/204/344/273/266API.md +131 -0
- package/docs/component-development/recipes//345/243/260/346/230/216/344/272/213/344/273/266.md +229 -0
- package/docs/component-development/recipes//345/243/260/346/230/216/345/212/250/344/275/234/344/270/216/347/212/266/346/200/201.md +188 -0
- package/docs/component-development/recipes//345/243/260/346/230/216/345/270/203/345/261/200/345/256/271/345/231/250/347/273/204/344/273/266.md +221 -0
- package/docs/component-development/recipes//345/243/260/346/230/216/346/217/222/346/247/275.md +141 -0
- package/docs/component-development/recipes//345/243/260/346/230/216/346/225/260/346/215/256/345/255/227/346/256/265/347/273/204/344/273/266.md +147 -0
- package/docs/component-development/recipes//345/243/260/346/230/216/346/225/260/346/215/256/345/256/271/345/231/250/347/273/204/344/273/266.md +258 -0
- package/docs/component-development/recipes//346/216/245/345/205/245/347/254/254/344/270/211/346/226/271React/347/273/204/344/273/266/345/272/223.md +209 -0
- package/docs/component-development/recipes//351/205/215/347/275/256DOM/346/240/271/350/212/202/347/202/271/346/263/250/345/205/245.md +222 -0
- package/docs/component-development/recipes//351/205/215/347/275/256Loading/347/255/226/347/225/245.md +198 -0
- package/docs/component-development/recipes//351/205/215/347/275/256/350/256/276/350/256/241/345/231/250/345/205/203/344/277/241/346/201/257.md +153 -0
- package/docs/component-development/reference/ActionsState/346/250/241/345/236/213.md +124 -0
- package/docs/component-development/reference/DOM/346/240/271/350/212/202/347/202/271/346/263/250/345/205/245/346/250/241/345/236/213.md +125 -0
- package/docs/component-development/reference/Events/346/250/241/345/236/213.md +170 -0
- package/docs/component-development/reference/Loading/347/255/226/347/225/245/346/250/241/345/236/213.md +140 -0
- package/docs/component-development/reference/Manifest/345/255/227/346/256/265/345/217/202/350/200/203.md +251 -0
- package/docs/component-development/reference/SDK/345/257/274/345/205/245/350/276/271/347/225/214.md +119 -0
- package/docs/component-development/reference/Slots/346/250/241/345/236/213.md +110 -0
- package/docs/component-development/reference/Traits/350/203/275/345/212/233/346/250/241/345/236/213.md +165 -0
- package/docs/component-development/reference/validateManifest/346/240/241/351/252/214/350/247/204/345/210/231.md +171 -0
- package/docs/component-development/reference//345/274/225/346/223/216/345/237/272/347/241/200/350/203/275/345/212/233/346/250/241/345/236/213.md +70 -0
- package/docs/component-development/reference//347/244/272/344/276/213/344/273/243/347/240/201/347/264/242/345/274/225.md +163 -0
- package/package.json +67 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { CustomEventKey, EventKey, EngineEventProtocol, StandardEventKey } from './events';
|
|
2
|
+
/**
|
|
3
|
+
* 作用域上下文 — 包含所在作用域数据及索引。
|
|
4
|
+
*
|
|
5
|
+
* 例如在表格行或列表项中,record 为当前行/项数据,index 为其索引。
|
|
6
|
+
*/
|
|
7
|
+
export interface ScopeContext {
|
|
8
|
+
record: any;
|
|
9
|
+
index?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface StandardEventBinding<K extends StandardEventKey> {
|
|
12
|
+
propName?: string;
|
|
13
|
+
transform?: (...args: any[]) => EngineEventProtocol[K];
|
|
14
|
+
toScope?: (...args: any[]) => ScopeContext | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface CustomEventBinding {
|
|
17
|
+
propName?: string;
|
|
18
|
+
transform?: (...args: any[]) => unknown;
|
|
19
|
+
toScope?: (...args: any[]) => ScopeContext | undefined;
|
|
20
|
+
}
|
|
21
|
+
export interface EventAdapter<K extends StandardEventKey> extends StandardEventBinding<K> {
|
|
22
|
+
type: K;
|
|
23
|
+
}
|
|
24
|
+
export interface CustomEventAdapter extends CustomEventBinding {
|
|
25
|
+
type: CustomEventKey;
|
|
26
|
+
}
|
|
27
|
+
export type ComponentAdapterStandardEventMap = Partial<{
|
|
28
|
+
[K in StandardEventKey]: StandardEventBinding<K>;
|
|
29
|
+
}>;
|
|
30
|
+
export type ComponentAdapterCustomEventMap = Partial<Record<CustomEventKey, CustomEventBinding>>;
|
|
31
|
+
export type StandardEventAdapter = {
|
|
32
|
+
[K in StandardEventKey]: EventAdapter<K>;
|
|
33
|
+
}[StandardEventKey];
|
|
34
|
+
export interface AdapterEventSource {
|
|
35
|
+
events?: ComponentAdapterStandardEventMap;
|
|
36
|
+
customEvents?: ComponentAdapterCustomEventMap;
|
|
37
|
+
}
|
|
38
|
+
export interface NormalizedAdapterEvents {
|
|
39
|
+
standard: StandardEventAdapter[];
|
|
40
|
+
custom: CustomEventAdapter[];
|
|
41
|
+
all: Array<StandardEventAdapter | CustomEventAdapter>;
|
|
42
|
+
allKeys: EventKey[];
|
|
43
|
+
}
|
|
44
|
+
export declare function normalizeAdapterEvents(source?: AdapterEventSource | null): NormalizedAdapterEvents;
|
|
45
|
+
export interface ComponentAdapter {
|
|
46
|
+
events?: ComponentAdapterStandardEventMap;
|
|
47
|
+
customEvents?: ComponentAdapterCustomEventMap;
|
|
48
|
+
propMapping?: Record<string, string>;
|
|
49
|
+
mapProps?: (props: any) => any;
|
|
50
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
|
+
export declare const OptionItemSchema: {
|
|
3
|
+
readonly type: "object";
|
|
4
|
+
readonly properties: {
|
|
5
|
+
readonly label: {
|
|
6
|
+
readonly type: "string";
|
|
7
|
+
readonly title: "显示名称";
|
|
8
|
+
};
|
|
9
|
+
readonly value: {
|
|
10
|
+
readonly type: "string";
|
|
11
|
+
readonly title: "选项值";
|
|
12
|
+
};
|
|
13
|
+
readonly disabled: {
|
|
14
|
+
readonly type: "boolean";
|
|
15
|
+
readonly title: "是否禁用";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const OptionsSchema: {
|
|
20
|
+
readonly type: "array";
|
|
21
|
+
readonly title: "选项列表";
|
|
22
|
+
readonly items: {
|
|
23
|
+
readonly type: "object";
|
|
24
|
+
readonly properties: {
|
|
25
|
+
readonly label: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly title: "显示名称";
|
|
28
|
+
};
|
|
29
|
+
readonly value: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly title: "选项值";
|
|
32
|
+
};
|
|
33
|
+
readonly disabled: {
|
|
34
|
+
readonly type: "boolean";
|
|
35
|
+
readonly title: "是否禁用";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare const RemoteOptionConfigSchema: {
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
readonly title: "远程选项配置";
|
|
43
|
+
readonly properties: {
|
|
44
|
+
readonly panelCode: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly title: "面板代码";
|
|
47
|
+
};
|
|
48
|
+
readonly fieldName: {
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
readonly title: "字段名称";
|
|
51
|
+
};
|
|
52
|
+
readonly condition: {
|
|
53
|
+
readonly type: "object";
|
|
54
|
+
readonly title: "查询条件";
|
|
55
|
+
readonly description: "声明式查询条件,支持表达式绑定。";
|
|
56
|
+
readonly additionalProperties: {
|
|
57
|
+
readonly type: "string";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export type OptionItem = FromSchema<typeof OptionItemSchema>;
|
|
63
|
+
export type Options = FromSchema<typeof OptionsSchema>;
|
|
64
|
+
export type RemoteOptionConfig = FromSchema<typeof RemoteOptionConfigSchema>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ENGINE_EVENT_TYPE } from '../constants/event';
|
|
2
|
+
export interface EngineEventProtocol {
|
|
3
|
+
[ENGINE_EVENT_TYPE.MOUNT]: void;
|
|
4
|
+
[ENGINE_EVENT_TYPE.UNMOUNT]: void;
|
|
5
|
+
[ENGINE_EVENT_TYPE.CLICK]: void;
|
|
6
|
+
[ENGINE_EVENT_TYPE.FOCUS]: void;
|
|
7
|
+
[ENGINE_EVENT_TYPE.BLUR]: void;
|
|
8
|
+
[ENGINE_EVENT_TYPE.VALUE_CHANGE]: {
|
|
9
|
+
newValue: any;
|
|
10
|
+
oldValue: any;
|
|
11
|
+
};
|
|
12
|
+
[ENGINE_EVENT_TYPE.ITEM_CLICK]: {
|
|
13
|
+
index: number;
|
|
14
|
+
item: Record<string, any>;
|
|
15
|
+
};
|
|
16
|
+
[ENGINE_EVENT_TYPE.ITEM_DOUBLE_CLICK]: {
|
|
17
|
+
index: number;
|
|
18
|
+
item: Record<string, any>;
|
|
19
|
+
};
|
|
20
|
+
[ENGINE_EVENT_TYPE.ITEM_RIGHT_CLICK]: {
|
|
21
|
+
index: number;
|
|
22
|
+
item: Record<string, any>;
|
|
23
|
+
};
|
|
24
|
+
[ENGINE_EVENT_TYPE.ITEM_LONG_PRESS]: {
|
|
25
|
+
index: number;
|
|
26
|
+
item: Record<string, any>;
|
|
27
|
+
};
|
|
28
|
+
[ENGINE_EVENT_TYPE.DATA_FETCH]: {
|
|
29
|
+
panelCode: string;
|
|
30
|
+
condition?: Record<string, any>;
|
|
31
|
+
keyword?: string;
|
|
32
|
+
pageNo?: number;
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
orderBy?: Array<Record<string, unknown>>;
|
|
35
|
+
advancedConditions?: Record<string, unknown>;
|
|
36
|
+
fieldInfo?: {
|
|
37
|
+
fieldName: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export type StandardEventKey = keyof EngineEventProtocol;
|
|
42
|
+
export type CustomEventKey = `${string}:${string}`;
|
|
43
|
+
export type EventKey = StandardEventKey | CustomEventKey;
|
|
44
|
+
export declare const STANDARD_EVENT_KEYS: StandardEventKey[];
|
|
45
|
+
export declare function isStandardEventKey(type: string): type is StandardEventKey;
|
|
46
|
+
export declare function isCustomEventKey(type: string): type is CustomEventKey;
|
|
47
|
+
export type EventPayload<K extends StandardEventKey> = EngineEventProtocol[K];
|
|
48
|
+
export type EngineEventHandler<K extends StandardEventKey> = EngineEventProtocol[K] extends void ? () => void : (params: EngineEventProtocol[K]) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
2
|
+
export type ManifestProps<S extends JSONSchema> = FromSchema<S>;
|
|
3
|
+
export type ExtractManifestProps<M extends {
|
|
4
|
+
props?: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
}> = M extends {
|
|
9
|
+
props: infer S extends JSONSchema;
|
|
10
|
+
} ? FromSchema<S> : Record<string, never>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
2
|
+
import type { ComponentAdapter } from './adapter';
|
|
3
|
+
import type { CustomEventKey, EventKey, StandardEventKey } from './events';
|
|
4
|
+
import type { ComponentTrait } from './traits';
|
|
5
|
+
import type { ComponentCategory } from '../types/category';
|
|
6
|
+
export declare const DYNAMIC_ENUM_KEY = "x-dynamic-enum";
|
|
7
|
+
export declare const SLOT_KEY = "x-slot";
|
|
8
|
+
export declare const INJECT_PATH_ROOT = "$root";
|
|
9
|
+
/** useImperativeHandle 中用于暴露组件运行时状态的保留 key */
|
|
10
|
+
export declare const COMPONENT_STATE_KEY: "__state";
|
|
11
|
+
export interface DynamicEnumConfig {
|
|
12
|
+
source: string;
|
|
13
|
+
valueKey: string;
|
|
14
|
+
labelKey: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ExtendedJSONSchema7 extends JSONSchema7 {
|
|
17
|
+
[DYNAMIC_ENUM_KEY]?: DynamicEnumConfig;
|
|
18
|
+
[SLOT_KEY]?: boolean;
|
|
19
|
+
allowedTabs?: string[];
|
|
20
|
+
'x-editableSelectOptions'?: Array<{
|
|
21
|
+
value: string;
|
|
22
|
+
label: string;
|
|
23
|
+
}>;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface StandardEventDeclaration {
|
|
27
|
+
title?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
deprecated?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface CustomEventDeclaration extends StandardEventDeclaration {
|
|
32
|
+
payloadSchema: JSONSchema7;
|
|
33
|
+
}
|
|
34
|
+
export interface EventSpec extends StandardEventDeclaration {
|
|
35
|
+
type: StandardEventKey;
|
|
36
|
+
}
|
|
37
|
+
export interface CustomEventSpec extends CustomEventDeclaration {
|
|
38
|
+
type: CustomEventKey;
|
|
39
|
+
}
|
|
40
|
+
export type ManifestStandardEventMap = Partial<Record<StandardEventKey, StandardEventDeclaration>>;
|
|
41
|
+
export type ManifestCustomEventMap = Partial<Record<CustomEventKey, CustomEventDeclaration>>;
|
|
42
|
+
export interface ManifestEventSource {
|
|
43
|
+
events?: ManifestStandardEventMap;
|
|
44
|
+
customEvents?: ManifestCustomEventMap;
|
|
45
|
+
}
|
|
46
|
+
export interface NormalizedManifestEvents {
|
|
47
|
+
standard: EventSpec[];
|
|
48
|
+
custom: CustomEventSpec[];
|
|
49
|
+
all: Array<EventSpec | CustomEventSpec>;
|
|
50
|
+
allKeys: EventKey[];
|
|
51
|
+
}
|
|
52
|
+
export declare function normalizeManifestEvents(source?: ManifestEventSource | null): NormalizedManifestEvents;
|
|
53
|
+
export interface ObjectSchema extends JSONSchema7 {
|
|
54
|
+
type: 'object';
|
|
55
|
+
properties: Record<string, ExtendedJSONSchema7>;
|
|
56
|
+
}
|
|
57
|
+
export interface ActionSpec {
|
|
58
|
+
title: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
params?: ObjectSchema;
|
|
61
|
+
returns?: JSONSchema7;
|
|
62
|
+
ai?: {
|
|
63
|
+
scenario?: string;
|
|
64
|
+
tips?: string[];
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface StateSpec {
|
|
68
|
+
title: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
schema: JSONSchema7;
|
|
71
|
+
}
|
|
72
|
+
export interface AIUsageSpec {
|
|
73
|
+
tips?: string[];
|
|
74
|
+
warnings?: string[];
|
|
75
|
+
}
|
|
76
|
+
export declare const LOADING_STRATEGY: {
|
|
77
|
+
readonly NATIVE: "native";
|
|
78
|
+
readonly WRAPPER: "wrapper";
|
|
79
|
+
readonly NONE: "none";
|
|
80
|
+
};
|
|
81
|
+
export type LoadingStrategy = typeof LOADING_STRATEGY[keyof typeof LOADING_STRATEGY];
|
|
82
|
+
export declare const LOADING_WRAPPER_TYPE: {
|
|
83
|
+
readonly SPIN: "spin";
|
|
84
|
+
readonly SKELETON: "skeleton";
|
|
85
|
+
readonly WAVE: "wave";
|
|
86
|
+
};
|
|
87
|
+
export type LoadingWrapperType = typeof LOADING_WRAPPER_TYPE[keyof typeof LOADING_WRAPPER_TYPE] | (string & {});
|
|
88
|
+
export declare const LOADING_PROP_NAME = "loading";
|
|
89
|
+
export interface EnginePolicies {
|
|
90
|
+
render?: {
|
|
91
|
+
injection?: {
|
|
92
|
+
rootPath?: string;
|
|
93
|
+
};
|
|
94
|
+
loading?: {
|
|
95
|
+
strategy: LoadingStrategy;
|
|
96
|
+
propName?: string;
|
|
97
|
+
wrapperType?: LoadingWrapperType;
|
|
98
|
+
wrapperProps?: Record<string, any>;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export interface SlotDefinition {
|
|
103
|
+
title: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
defaultEnabled?: boolean;
|
|
106
|
+
allowedChildren?: string[];
|
|
107
|
+
scoped?: boolean;
|
|
108
|
+
scopeDescription?: string;
|
|
109
|
+
dynamic?: boolean;
|
|
110
|
+
dynamicSource?: string;
|
|
111
|
+
dynamicFilter?: string;
|
|
112
|
+
dynamicKey?: string;
|
|
113
|
+
dynamicTitle?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface ComponentManifest {
|
|
116
|
+
type: string;
|
|
117
|
+
alias?: string[];
|
|
118
|
+
adapter?: ComponentAdapter;
|
|
119
|
+
engine?: EnginePolicies;
|
|
120
|
+
meta: {
|
|
121
|
+
title: string;
|
|
122
|
+
category: ComponentCategory;
|
|
123
|
+
valueSchema?: JSONSchema7;
|
|
124
|
+
icon?: string;
|
|
125
|
+
description?: string;
|
|
126
|
+
hiddenInComponentList?: boolean;
|
|
127
|
+
subGroup?: string;
|
|
128
|
+
};
|
|
129
|
+
traits?: ComponentTrait[];
|
|
130
|
+
nesting?: {
|
|
131
|
+
allowedChildren?: string[];
|
|
132
|
+
allowedParents?: string[];
|
|
133
|
+
maxChildren?: number;
|
|
134
|
+
minChildren?: number;
|
|
135
|
+
};
|
|
136
|
+
props?: ObjectSchema;
|
|
137
|
+
slots?: Record<string, SlotDefinition>;
|
|
138
|
+
events?: ManifestStandardEventMap;
|
|
139
|
+
customEvents?: ManifestCustomEventMap;
|
|
140
|
+
actions?: Record<string, ActionSpec>;
|
|
141
|
+
_componentActionKeys?: readonly string[];
|
|
142
|
+
state?: Record<string, StateSpec>;
|
|
143
|
+
usage?: AIUsageSpec;
|
|
144
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const COMPONENT_TRAIT: {
|
|
2
|
+
readonly DATA_FIELD: "Data.Field";
|
|
3
|
+
readonly DATA_CONTAINER: "Data.Container";
|
|
4
|
+
readonly LAYOUT_CONTAINER: "Layout.Container";
|
|
5
|
+
readonly INTERACTION_CLICKABLE: "Interaction.Clickable";
|
|
6
|
+
};
|
|
7
|
+
export type ComponentTrait = typeof COMPONENT_TRAIT[keyof typeof COMPONENT_TRAIT];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const COMPONENT_CATEGORY: {
|
|
2
|
+
readonly GENERAL: "General";
|
|
3
|
+
readonly FLOAT: "Float";
|
|
4
|
+
readonly LAYOUT: "Layout";
|
|
5
|
+
readonly DATA_ENTRY: "DataEntry";
|
|
6
|
+
readonly DATA_DISPLAY: "DataDisplay";
|
|
7
|
+
readonly CHART: "Chart";
|
|
8
|
+
readonly BUSINESS: "Business";
|
|
9
|
+
readonly SHELL: "Shell";
|
|
10
|
+
readonly PAGE: "Page";
|
|
11
|
+
readonly DEV: "Dev";
|
|
12
|
+
readonly HTML_TEMPLATE: "HtmlTemplate";
|
|
13
|
+
};
|
|
14
|
+
export type ComponentCategory = typeof COMPONENT_CATEGORY[keyof typeof COMPONENT_CATEGORY];
|
|
15
|
+
export declare const CATEGORY_LABELS: Record<ComponentCategory, string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mergeComponentInitialValue — 组件初始值合并工具
|
|
3
|
+
*
|
|
4
|
+
* 从宿主 pageStore 移植的完整合并语义,确保 SDK 中 useDataContainer 的
|
|
5
|
+
* runtime fallback 与宿主 initComponentData 保持一致。
|
|
6
|
+
*
|
|
7
|
+
* 维护要求:任何初始值合并规则的调整都应同步到此处,
|
|
8
|
+
* 避免 SDK 侧 getContainerData()/containerData 与宿主 initComponentData 的语义漂移。
|
|
9
|
+
*/
|
|
10
|
+
export declare const mergeComponentInitialValue: (existingValue: unknown, initialValue: unknown) => unknown;
|