@yklyklpackages/message-card 0.0.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 +73 -0
- package/dist/components/MessageCard.d.ts +3 -0
- package/dist/components/MessageCard.d.ts.map +1 -0
- package/dist/components/action/ActionContext.d.ts +25 -0
- package/dist/components/action/ActionContext.d.ts.map +1 -0
- package/dist/components/action/RenderActionWrapper.d.ts +11 -0
- package/dist/components/action/RenderActionWrapper.d.ts.map +1 -0
- package/dist/components/cache/CacheStorage.d.ts +36 -0
- package/dist/components/cache/CacheStorage.d.ts.map +1 -0
- package/dist/components/cache/TemplateCache.d.ts +48 -0
- package/dist/components/cache/TemplateCache.d.ts.map +1 -0
- package/dist/components/cache/TemplateRequestPool.d.ts +13 -0
- package/dist/components/cache/TemplateRequestPool.d.ts.map +1 -0
- package/dist/components/cache/dataAdapter.d.ts +9 -0
- package/dist/components/cache/dataAdapter.d.ts.map +1 -0
- package/dist/components/cache/index.d.ts +6 -0
- package/dist/components/cache/index.d.ts.map +1 -0
- package/dist/components/cache/types.d.ts +78 -0
- package/dist/components/cache/types.d.ts.map +1 -0
- package/dist/components/core/ComponentRenderer.d.ts +18 -0
- package/dist/components/core/ComponentRenderer.d.ts.map +1 -0
- package/dist/components/core/LayoutWrapper.d.ts +10 -0
- package/dist/components/core/LayoutWrapper.d.ts.map +1 -0
- package/dist/components/core/LeafWrapper.d.ts +15 -0
- package/dist/components/core/LeafWrapper.d.ts.map +1 -0
- package/dist/components/core/templateAdapter.d.ts +5 -0
- package/dist/components/core/templateAdapter.d.ts.map +1 -0
- package/dist/components/hooks.d.ts +16 -0
- package/dist/components/hooks.d.ts.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/layout/AbsoluteViewLayout.d.ts +14 -0
- package/dist/components/layout/AbsoluteViewLayout.d.ts.map +1 -0
- package/dist/components/layout/AnimationLayout/index.d.ts +13 -0
- package/dist/components/layout/AnimationLayout/index.d.ts.map +1 -0
- package/dist/components/layout/AnimationLayout.d.ts +13 -0
- package/dist/components/layout/AnimationLayout.d.ts.map +1 -0
- package/dist/components/layout/FourColumnLayout.d.ts +16 -0
- package/dist/components/layout/FourColumnLayout.d.ts.map +1 -0
- package/dist/components/layout/FullRowLayout.d.ts +19 -0
- package/dist/components/layout/FullRowLayout.d.ts.map +1 -0
- package/dist/components/layout/MultipleColumnLayout.d.ts +20 -0
- package/dist/components/layout/MultipleColumnLayout.d.ts.map +1 -0
- package/dist/components/layout/ThreeColumnCenterFullLayout.d.ts +16 -0
- package/dist/components/layout/ThreeColumnCenterFullLayout.d.ts.map +1 -0
- package/dist/components/layout/ThreeColumnLayout.d.ts +16 -0
- package/dist/components/layout/ThreeColumnLayout.d.ts.map +1 -0
- package/dist/components/layout/TwoColumnLayout.d.ts +16 -0
- package/dist/components/layout/TwoColumnLayout.d.ts.map +1 -0
- package/dist/components/layout/TwoColumnLeftFullLayout.d.ts +16 -0
- package/dist/components/layout/TwoColumnLeftFullLayout.d.ts.map +1 -0
- package/dist/components/layout/TwoColumnRightFullLayout.d.ts +16 -0
- package/dist/components/layout/TwoColumnRightFullLayout.d.ts.map +1 -0
- package/dist/components/message/MessageContainer.d.ts +41 -0
- package/dist/components/message/MessageContainer.d.ts.map +1 -0
- package/dist/components/render/Checkbox.d.ts +14 -0
- package/dist/components/render/Checkbox.d.ts.map +1 -0
- package/dist/components/render/CustomRenderer/index.d.ts +2 -0
- package/dist/components/render/CustomRenderer/index.d.ts.map +1 -0
- package/dist/components/render/DashLine.d.ts +17 -0
- package/dist/components/render/DashLine.d.ts.map +1 -0
- package/dist/components/render/DividerRender.d.ts +15 -0
- package/dist/components/render/DividerRender.d.ts.map +1 -0
- package/dist/components/render/Image.d.ts +11 -0
- package/dist/components/render/Image.d.ts.map +1 -0
- package/dist/components/render/Input.d.ts +14 -0
- package/dist/components/render/Input.d.ts.map +1 -0
- package/dist/components/render/Markdown.d.ts +6 -0
- package/dist/components/render/Markdown.d.ts.map +1 -0
- package/dist/components/render/Radio.d.ts +14 -0
- package/dist/components/render/Radio.d.ts.map +1 -0
- package/dist/components/render/Select.d.ts +14 -0
- package/dist/components/render/Select.d.ts.map +1 -0
- package/dist/components/render/Text.d.ts +11 -0
- package/dist/components/render/Text.d.ts.map +1 -0
- package/dist/components/render/TextList.d.ts +15 -0
- package/dist/components/render/TextList.d.ts.map +1 -0
- package/dist/components/render/UnknownRenderer/index.d.ts +8 -0
- package/dist/components/render/UnknownRenderer/index.d.ts.map +1 -0
- package/dist/components/theme/ThemeContext.d.ts +9 -0
- package/dist/components/theme/ThemeContext.d.ts.map +1 -0
- package/dist/components/theme/defaultTheme.d.ts +4 -0
- package/dist/components/theme/defaultTheme.d.ts.map +1 -0
- package/dist/components/theme.d.ts +4 -0
- package/dist/components/theme.d.ts.map +1 -0
- package/dist/components/types/component.d.ts +97 -0
- package/dist/components/types/component.d.ts.map +1 -0
- package/dist/components/useTemplate.d.ts +16 -0
- package/dist/components/useTemplate.d.ts.map +1 -0
- package/dist/components/utils/ResponsiveContext.d.ts +7 -0
- package/dist/components/utils/ResponsiveContext.d.ts.map +1 -0
- package/dist/components/utils/commonHelpers.d.ts +5 -0
- package/dist/components/utils/commonHelpers.d.ts.map +1 -0
- package/dist/components/utils/constants.d.ts +21 -0
- package/dist/components/utils/constants.d.ts.map +1 -0
- package/dist/components/utils/containerHoc.d.ts +16 -0
- package/dist/components/utils/containerHoc.d.ts.map +1 -0
- package/dist/components/utils/eventHelpers.d.ts +16 -0
- package/dist/components/utils/eventHelpers.d.ts.map +1 -0
- package/dist/components/utils/hoc.d.ts +6 -0
- package/dist/components/utils/hoc.d.ts.map +1 -0
- package/dist/components/utils/styleHelpers.d.ts +78 -0
- package/dist/components/utils/styleHelpers.d.ts.map +1 -0
- package/dist/components/utils/useForEditor.d.ts +9 -0
- package/dist/components/utils/useForEditor.d.ts.map +1 -0
- package/dist/components/validator/ComponentValidator.d.ts +17 -0
- package/dist/components/validator/ComponentValidator.d.ts.map +1 -0
- package/dist/index.cjs +33869 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +33853 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +33870 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ILayoutCommonProps, IRenderCommonProps } from '@jdh-cross/aui-types';
|
|
3
|
+
import { Theme, LayoutProps, CommonProps } from '../types/component';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 设置统一尺寸(默认宽度100%,高度按内容)
|
|
7
|
+
*/
|
|
8
|
+
export declare const applySize: (props?: CommonProps, scale?: number) => CSSProperties;
|
|
9
|
+
/**
|
|
10
|
+
* 组合基础样式:size + 对齐 + 自定义 style
|
|
11
|
+
*/
|
|
12
|
+
export declare const baseContainerStyle: (props?: CommonProps, scale?: number) => CSSProperties;
|
|
13
|
+
/**
|
|
14
|
+
* gap 处理(容器样式 + 子项间距样式计算)
|
|
15
|
+
* - 在小程序端(Weapp),不可靠的 gap 属性改用 margin 方案
|
|
16
|
+
* - horizontal: true 表示横向布局(Two/Three/Four),false 表示纵向(FullRow)
|
|
17
|
+
*/
|
|
18
|
+
export declare const containerGapStyle: (gap?: number) => CSSProperties;
|
|
19
|
+
export declare const childGapStyle: (index: number, count: number, gap?: number, horizontal?: boolean, scale?: number) => CSSProperties;
|
|
20
|
+
/**
|
|
21
|
+
* padding处理
|
|
22
|
+
* 将 padding 参数转换为内联样式
|
|
23
|
+
* - 数字:统一四边
|
|
24
|
+
* - 二元组:[vertical, horizontal]
|
|
25
|
+
* - 三元组:[top, horizontal, bottom]
|
|
26
|
+
* - 四元组:[top, right, bottom, left]
|
|
27
|
+
*/
|
|
28
|
+
export declare const resolveSpace: (val: string | number | undefined, theme: Theme, scale?: number) => string | number | undefined;
|
|
29
|
+
export declare const paddingToStyle: (padding: ILayoutCommonProps["padding"] | undefined, theme: Theme, scale?: number) => CSSProperties;
|
|
30
|
+
export declare const marginToStyle: (margin: ILayoutCommonProps["margin"] | undefined, theme: Theme, scale?: number) => CSSProperties;
|
|
31
|
+
/**
|
|
32
|
+
* 主题相关辅助:文本样式
|
|
33
|
+
*/
|
|
34
|
+
export declare const textStyleFromTheme: (theme: Theme, opts?: IRenderCommonProps & {
|
|
35
|
+
lineHeight?: number | string;
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
}, scale?: number) => CSSProperties;
|
|
38
|
+
/**
|
|
39
|
+
* flex布局处理
|
|
40
|
+
*/
|
|
41
|
+
export declare const justifyContentToStyle: (alignItems?: ILayoutCommonProps["alignItems"], justifyContent?: ILayoutCommonProps["justifyContent"]) => CSSProperties;
|
|
42
|
+
export declare const borderRadiusToStyle: (borderRadius: any, theme: any, scale?: number) => CSSProperties;
|
|
43
|
+
export declare const borderToStyle: (border: ILayoutCommonProps["border"], theme: Theme, scale?: number) => CSSProperties;
|
|
44
|
+
/**
|
|
45
|
+
* 图片适配(objectFit)
|
|
46
|
+
*/
|
|
47
|
+
export declare const imageStyleFromProps: (props: {
|
|
48
|
+
width?: number | string;
|
|
49
|
+
height?: number | string;
|
|
50
|
+
fit?: CSSProperties["objectFit"];
|
|
51
|
+
display?: string;
|
|
52
|
+
style?: CSSProperties;
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}, theme: Theme, scale?: number) => CSSProperties;
|
|
55
|
+
export declare const imageViewStyleFromProps: (props: any, theme: any, scale?: number) => CSSProperties;
|
|
56
|
+
/**
|
|
57
|
+
* 等分列宽
|
|
58
|
+
*/
|
|
59
|
+
export declare const fractionWidth: (percent: string) => CSSProperties;
|
|
60
|
+
/**
|
|
61
|
+
* 构建布局子项容器基础样式
|
|
62
|
+
*/
|
|
63
|
+
export declare const buildItemContainerStyle: (index: number, count: number, props?: LayoutProps, horizontal?: boolean, scale?: number) => CSSProperties;
|
|
64
|
+
/**
|
|
65
|
+
* 构建布局容器的基础样式(flex)
|
|
66
|
+
*/
|
|
67
|
+
export declare const buildLayoutContainerStyle: (props: ILayoutCommonProps | undefined, direction: "column" | "row" | undefined, theme: Theme, scale?: number) => CSSProperties;
|
|
68
|
+
/**
|
|
69
|
+
* 定位布局容器的基础样式
|
|
70
|
+
*/
|
|
71
|
+
export declare const buildAbsoluteLayoutStyle: (props: ILayoutCommonProps | undefined, direction: "column" | "row" | undefined, theme: Theme, scale?: number) => CSSProperties;
|
|
72
|
+
/**
|
|
73
|
+
* 样式字符串计算方法
|
|
74
|
+
* 支持传入'2 2px 0 0',也支持[2,"2px"],或者'2px'/2,以及0的情况。
|
|
75
|
+
* 遇到数值和2px要把2提取出来,通过Transform转换为新的值。
|
|
76
|
+
*/
|
|
77
|
+
export declare const runStyle: (val: string | number | (string | number)[] | undefined, scale?: number) => string | number;
|
|
78
|
+
//# sourceMappingURL=styleHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/utils/styleHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,SAAS,GACpB,QAAQ,WAAW,EACnB,QAAO,MAAU,KAChB,aAMF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,WAAW,EACnB,QAAO,MAAU,KAChB,aAMF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,aAMhD,CAAC;A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EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,EACD,OAAO,KAAK,EACZ,QAAO,MAAU,KAChB,aAaF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,UAAK,EAAE,UAAK,EAAE,QAAO,MAAU,kBAMtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,aAE9C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,MAAM,EACb,OAAO,MAAM,EACb,QAAQ,WAAW,EACnB,oBAAkB,EAClB,QAAO,MAAU,KAChB,aAkBF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,kBAAkB,GAAG,SAAS,EACrC,WAAW,QAAQ,GAAG,KAAK,GAAG,SAAS,EACvC,OAAO,KAAK,EACZ,QAAO,MAAU,KAChB,aAmBF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,kBAAkB,GAAG,SAAS,EACrC,WAAW,QAAQ,GAAG,KAAK,GAAG,SAAS,EACvC,OAAO,KAAK,EACZ,QAAO,MAAU,KAChB,aAmBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GACnB,KAAK,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,EACtD,QAAO,MAAU,KAChB,MAAM,GAAG,MAgCX,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const useForEditor: (props?: Record<string, any>, ref?: React.RefObject<any>) => {
|
|
2
|
+
editorMode: boolean;
|
|
3
|
+
ref: import('react').RefObject<any>;
|
|
4
|
+
onMouseEnter: (e?: React.MouseEvent<HTMLDivElement>) => void;
|
|
5
|
+
onMouseLeave: (e?: React.MouseEvent<HTMLDivElement>) => void;
|
|
6
|
+
onClick: (e?: React.MouseEvent<HTMLDivElement>) => void;
|
|
7
|
+
};
|
|
8
|
+
export default useForEditor;
|
|
9
|
+
//# sourceMappingURL=useForEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForEditor.d.ts","sourceRoot":"","sources":["../../../src/components/utils/useForEditor.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,YAAY,GAChB,QAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,MAAM,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;;;uBAgDnB,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;uBAQhC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;kBAQhC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;CAaxC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IComponentNode } from '@jdh-cross/aui-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 校验规则:
|
|
5
|
+
* - 渲染组件(type=render)下的任意层级子节点,不得出现布局组件(type=layout)
|
|
6
|
+
* - 同时给出清晰路径,便于定位
|
|
7
|
+
*/
|
|
8
|
+
export interface ValidateResult {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
errors: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare const validateTree: (nodes: IComponentNode[], rootLabel?: string) => ValidateResult;
|
|
13
|
+
/**
|
|
14
|
+
* 在渲染递归前/过程中调用,用于即时抛错
|
|
15
|
+
*/
|
|
16
|
+
export declare const assertTreeValid: (nodes: IComponentNode[], label?: string) => void;
|
|
17
|
+
//# sourceMappingURL=ComponentValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentValidator.d.ts","sourceRoot":"","sources":["../../../src/components/validator/ComponentValidator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D;;;;GAIG;AAEH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAID,eAAO,MAAM,YAAY,GACvB,OAAO,cAAc,EAAE,EACvB,kBAAkB,KACjB,cAsDF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,cAAc,EAAE,EAAE,QAAQ,MAAM,SAQtE,CAAC"}
|