@yklyklpackages/message-card 0.4.0 → 0.6.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/dist/components/MessageCard.d.ts +3 -1
- package/dist/components/MessageCard.d.ts.map +1 -1
- package/dist/components/action/types.d.ts +2 -2
- package/dist/components/action/types.d.ts.map +1 -1
- package/dist/components/core/LayoutWrapper.d.ts.map +1 -1
- package/dist/components/core/LeafWrapper.d.ts.map +1 -1
- package/dist/components/message/MessageContainer.d.ts +3 -1
- package/dist/components/message/MessageContainer.d.ts.map +1 -1
- package/dist/components/theme/ScreenTheme375.d.ts.map +1 -1
- package/dist/components/theme/ThemeContext.d.ts +1 -0
- package/dist/components/theme/ThemeContext.d.ts.map +1 -1
- package/dist/components/theme/defaultTheme.d.ts.map +1 -1
- package/dist/components/utils/constants.d.ts +1 -0
- package/dist/components/utils/constants.d.ts.map +1 -1
- package/dist/index.cjs +98 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +98 -37
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +98 -37
- package/dist/index.umd.js.map +1 -1
- package/package.json +8 -9
|
@@ -2,6 +2,7 @@ import { MessageTemplate } from '@jdh-cross/message-template-engine';
|
|
|
2
2
|
import { Theme } from '@jdh-cross/markdown';
|
|
3
3
|
import { CustomLayoutComponentProps, CustomRenderComponentProps } from './types/component';
|
|
4
4
|
import { ActionHandler } from './action/types';
|
|
5
|
+
import { BaseActionConfig } from '@jdh-cross/aui-types/action';
|
|
5
6
|
|
|
6
7
|
export interface MessageCardProps {
|
|
7
8
|
templateJson?: MessageTemplate | string;
|
|
@@ -22,7 +23,7 @@ export interface MessageCardProps {
|
|
|
22
23
|
/**
|
|
23
24
|
* 外部注入的 Action 处理器
|
|
24
25
|
*/
|
|
25
|
-
externalActions?: Record<string, ActionHandler<
|
|
26
|
+
externalActions?: Record<string, ActionHandler<BaseActionConfig>>;
|
|
26
27
|
/**
|
|
27
28
|
* 主题(可选),传入则以 Provider 包裹实现运行时主题覆盖
|
|
28
29
|
*/
|
|
@@ -40,6 +41,7 @@ export interface MessageCardProps {
|
|
|
40
41
|
* 自定义布局组件
|
|
41
42
|
*/
|
|
42
43
|
customLayoutComponent?: Record<string, React.FC<CustomLayoutComponentProps>>;
|
|
44
|
+
devicePixelRatio?: number;
|
|
43
45
|
}
|
|
44
46
|
declare const _default: import('react').ForwardRefExoticComponent<MessageCardProps & import('react').RefAttributes<unknown>>;
|
|
45
47
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageCard.d.ts","sourceRoot":"","sources":["../../src/components/MessageCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageCard.d.ts","sourceRoot":"","sources":["../../src/components/MessageCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IAExC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEnC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAClE;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAC7E;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAE7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;;AA0CD,wBAAuC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ActionConfig,
|
|
2
|
+
import { ActionConfig, exposureTrackActionConfig } from '@jdh-cross/aui-types/action';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 设置本地数据的函数类型
|
|
@@ -27,7 +27,7 @@ export type showPopupConfig = {
|
|
|
27
27
|
/**
|
|
28
28
|
* 所有支持的动作配置类型的联合类型
|
|
29
29
|
*/
|
|
30
|
-
export type AllActionConfigs = ActionConfig
|
|
30
|
+
export type AllActionConfigs = ActionConfig;
|
|
31
31
|
/**
|
|
32
32
|
* Action Context 的值类型定义
|
|
33
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/action/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/action/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EACV,YAAY,EAOZ,yBAAyB,EAE1B,MAAM,6BAA6B,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CACpC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAC1C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE;QACN,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE;QACN,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;QAC/B,MAAM,CAAC,EAAE,GAAG,CAAC;KACd,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,cAAc,EAAE,CACd,OAAO,EAAE,YAAY,EAAE,EACvB,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,KACtB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnB;;;OAGG;IACH,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;IAEnC;;;;OAIG;IACH,oBAAoB,EAAE,CAAC,MAAM,EAAE,yBAAyB,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/E;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,gBAAgB,IAAI,CAChD,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,oBAAoB,KAC1B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;CACtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/core/LayoutWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAa7D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGrE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;CAC9E;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"LayoutWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/core/LayoutWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAa7D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGrE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;CAC9E;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuFtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeafWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/core/LeafWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAKV,0BAA0B,EAC3B,MAAM,oBAAoB,CAAC;AAgB5B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;CAC9E;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"LeafWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/core/LeafWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAKV,0BAA0B,EAC3B,MAAM,oBAAoB,CAAC;AAgB5B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;CAC9E;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAsGlD,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { MessageTemplate } from '@jdh-cross/message-template-engine';
|
|
3
3
|
import { CustomLayoutComponentProps, CustomRenderComponentProps, ThemeConfig } from '../types/component';
|
|
4
4
|
import { ActionHandler } from '../action/types';
|
|
5
|
+
import { BaseActionConfig } from '@jdh-cross/aui-types/action';
|
|
5
6
|
|
|
6
7
|
export interface MessageContainerProps {
|
|
7
8
|
/**
|
|
@@ -22,7 +23,7 @@ export interface MessageContainerProps {
|
|
|
22
23
|
/**
|
|
23
24
|
* 外部注入的 Action 处理器
|
|
24
25
|
*/
|
|
25
|
-
externalActions?: Record<string, ActionHandler<
|
|
26
|
+
externalActions?: Record<string, ActionHandler<BaseActionConfig>>;
|
|
26
27
|
/**
|
|
27
28
|
* 主题(可选),传入则以 Provider 包裹实现运行时主题覆盖
|
|
28
29
|
*/
|
|
@@ -40,6 +41,7 @@ export interface MessageContainerProps {
|
|
|
40
41
|
* 自定义布局组件
|
|
41
42
|
*/
|
|
42
43
|
customLayoutComponent?: Record<string, React.FC<CustomLayoutComponentProps>>;
|
|
44
|
+
devicePixelRatio?: number;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* 消息容器
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageContainer.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAO1E,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAE1B,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAM5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageContainer.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAO1E,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAE1B,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAM5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAIpE,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,EAAE,eAAe,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAClE;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAC7E;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAE7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA0I5D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenTheme375.d.ts","sourceRoot":"","sources":["../../../src/components/theme/ScreenTheme375.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"ScreenTheme375.d.ts","sourceRoot":"","sources":["../../../src/components/theme/ScreenTheme375.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,eAAO,MAAM,YAAY,EAAE,KAoD1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../src/components/theme/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../src/components/theme/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAOhD,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAwBzE,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,KAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../../src/components/theme/defaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../../src/components/theme/defaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,eAAO,MAAM,YAAY,EAAE,KAoD1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEjE,eAAO,MAAM,YAAY,EAAE,UAAU,EAKpC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,UAAU,EASpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAKzD,CAAC;AAGF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAGvD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAGD,eAAO,MAAM,UAAU;;;;;;;;;CAStB,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEjE,eAAO,MAAM,YAAY,EAAE,UAAU,EAKpC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,UAAU,EASpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAKzD,CAAC;AAGF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAGvD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAGD,eAAO,MAAM,UAAU;;;;;;;;;CAStB,CAAC;AAEF,eAAO,MAAM,aAAa,MAAM,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -166,7 +166,7 @@ function JSONSafeParse(str, defaultValue) {
|
|
|
166
166
|
}
|
|
167
167
|
return defaultValue;
|
|
168
168
|
}
|
|
169
|
-
const defaultTheme$
|
|
169
|
+
const defaultTheme$2 = {
|
|
170
170
|
fontSize: {
|
|
171
171
|
FontSizes_JDH_Headline1: 46,
|
|
172
172
|
FontSizes_JDH_Headline2: 34,
|
|
@@ -183,6 +183,9 @@ const defaultTheme$1 = {
|
|
|
183
183
|
Color_JDH_Red_Price: "#FF0F23",
|
|
184
184
|
Color_JDH_Red_Discount: "#FF0F23",
|
|
185
185
|
Color_JDH_Green_Success: "#67CC52",
|
|
186
|
+
Color_JDH_Green_Background: "#17CB8E1F",
|
|
187
|
+
Color_JDH_Red_Background: "#FF0F231F",
|
|
188
|
+
Color_JDH_Yellow_Background: "#FF80001F",
|
|
186
189
|
Color_JDH_Gray_Headline: "#222222",
|
|
187
190
|
Color_JDH_Gray_Text: "#222222",
|
|
188
191
|
Color_JDH_Gray_SecondText: "#575859",
|
|
@@ -208,14 +211,68 @@ const defaultTheme$1 = {
|
|
|
208
211
|
Spacing_JDH_xxs: 4
|
|
209
212
|
},
|
|
210
213
|
borderRadius: {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
Radius_JDH_xxl: 32,
|
|
215
|
+
Radius_JDH_xl: 24,
|
|
216
|
+
Radius_JDH_lg: 16,
|
|
217
|
+
Radius_JDH_sm: 8,
|
|
218
|
+
Radius_JDH_xs: 6
|
|
219
|
+
},
|
|
220
|
+
components: {}
|
|
221
|
+
};
|
|
222
|
+
const defaultTheme$1 = {
|
|
223
|
+
fontSize: {
|
|
224
|
+
FontSizes_JDH_Headline1: 23,
|
|
225
|
+
FontSizes_JDH_Headline2: 17,
|
|
226
|
+
FontSizes_JDH_Title: 15,
|
|
227
|
+
FontSizes_JDH_Text: 14,
|
|
228
|
+
FontSizes_JDH_AccentText: 12,
|
|
229
|
+
FontSizes_JDH_TagText: 10
|
|
230
|
+
},
|
|
231
|
+
color: {
|
|
232
|
+
Color_JDH_Primary: "#17CB8E",
|
|
233
|
+
Color_JDH_Accent1: "#FF8000",
|
|
234
|
+
Color_JDH_Accent2: "#73B0FF",
|
|
235
|
+
Color_JDH_Red_Danger: "#FF0F23",
|
|
236
|
+
Color_JDH_Red_Price: "#FF0F23",
|
|
237
|
+
Color_JDH_Red_Discount: "#FF0F23",
|
|
238
|
+
Color_JDH_Green_Success: "#67CC52",
|
|
239
|
+
Color_JDH_Green_Background: "#17CB8E1F",
|
|
240
|
+
Color_JDH_Red_Background: "#FF0F231F",
|
|
241
|
+
Color_JDH_Yellow_Background: "#FF80001F",
|
|
242
|
+
Color_JDH_Gray_Headline: "#222222",
|
|
243
|
+
Color_JDH_Gray_Text: "#222222",
|
|
244
|
+
Color_JDH_Gray_SecondText: "#575859",
|
|
245
|
+
Color_JDH_Gray_AccentText: "#858687",
|
|
246
|
+
Color_JDH_Gray_DividingLine: "#D3D3D3",
|
|
247
|
+
Color_JDH_Gray_Background: "#F5F5F6",
|
|
248
|
+
Color_JDH_Gray_CardBackground: "#E5E9EB",
|
|
249
|
+
Color_JDH_Gray_Card: "#FFFFFF",
|
|
250
|
+
Color_JDH_Gray_Mask: "#00000080"
|
|
251
|
+
},
|
|
252
|
+
fontWeight: {
|
|
253
|
+
FontWeight_JDH_Normal: 400,
|
|
254
|
+
FontWeight_JDH_Medium: 500
|
|
255
|
+
},
|
|
256
|
+
space: {
|
|
257
|
+
Spacing_JDH_4xl: 16,
|
|
258
|
+
Spacing_JDH_xxxl: 14,
|
|
259
|
+
Spacing_JDH_xxl: 12,
|
|
260
|
+
Spacing_JDH_xl: 10,
|
|
261
|
+
Spacing_JDH_lg: 8,
|
|
262
|
+
Spacing_JDH_sm: 6,
|
|
263
|
+
Spacing_JDH_xs: 4,
|
|
264
|
+
Spacing_JDH_xxs: 2
|
|
265
|
+
},
|
|
266
|
+
borderRadius: {
|
|
267
|
+
Radius_JDH_xxl: 16,
|
|
268
|
+
Radius_JDH_xl: 12,
|
|
269
|
+
Radius_JDH_lg: 8,
|
|
270
|
+
Radius_JDH_sm: 4,
|
|
271
|
+
Radius_JDH_xs: 3
|
|
216
272
|
},
|
|
217
273
|
components: {}
|
|
218
274
|
};
|
|
275
|
+
const DEFAULT_SCALE = 0.5;
|
|
219
276
|
var __defProp$v = Object.defineProperty;
|
|
220
277
|
var __defProps$q = Object.defineProperties;
|
|
221
278
|
var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
|
|
@@ -235,13 +292,14 @@ var __spreadValues$s = (a, b) => {
|
|
|
235
292
|
return a;
|
|
236
293
|
};
|
|
237
294
|
var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
|
|
238
|
-
const ThemeContext = React.createContext(defaultTheme$
|
|
295
|
+
const ThemeContext = React.createContext(defaultTheme$2);
|
|
239
296
|
const ThemeProvider = ({
|
|
297
|
+
scale = DEFAULT_SCALE,
|
|
240
298
|
theme,
|
|
241
299
|
children
|
|
242
300
|
}) => {
|
|
243
301
|
const merged = React.useMemo(() => {
|
|
244
|
-
const base = defaultTheme$1;
|
|
302
|
+
const base = scale <= DEFAULT_SCALE ? defaultTheme$2 : defaultTheme$1;
|
|
245
303
|
return __spreadProps$q(__spreadValues$s({}, base), {
|
|
246
304
|
fontSize: __spreadValues$s(__spreadValues$s({}, base.fontSize), (theme == null ? void 0 : theme.fontSize) || {}),
|
|
247
305
|
color: __spreadValues$s(__spreadValues$s({}, base.color), (theme == null ? void 0 : theme.color) || {}),
|
|
@@ -5498,6 +5556,16 @@ const LayoutWrapper = ({
|
|
|
5498
5556
|
if (!node2) return null;
|
|
5499
5557
|
const { layoutType, props, subType } = node2;
|
|
5500
5558
|
const layoutProps = props;
|
|
5559
|
+
if (typeof (customLayoutComponent == null ? void 0 : customLayoutComponent[subType]) !== "undefined") {
|
|
5560
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5561
|
+
CustomLayout,
|
|
5562
|
+
{
|
|
5563
|
+
customComponent: customLayoutComponent[subType],
|
|
5564
|
+
props: layoutProps,
|
|
5565
|
+
children
|
|
5566
|
+
}
|
|
5567
|
+
);
|
|
5568
|
+
}
|
|
5501
5569
|
switch (subType) {
|
|
5502
5570
|
case "full-row":
|
|
5503
5571
|
return /* @__PURE__ */ jsxRuntime.jsx(FullRowLayout, __spreadProps$c(__spreadValues$e({ props: layoutProps }, { originProps }), { children }));
|
|
@@ -5522,14 +5590,7 @@ const LayoutWrapper = ({
|
|
|
5522
5590
|
case "scroll-view":
|
|
5523
5591
|
return /* @__PURE__ */ jsxRuntime.jsx(ScrollViewLayout, __spreadProps$c(__spreadValues$e({}, node2), { children }));
|
|
5524
5592
|
default:
|
|
5525
|
-
return
|
|
5526
|
-
CustomLayout,
|
|
5527
|
-
{
|
|
5528
|
-
customComponent: customLayoutComponent[subType],
|
|
5529
|
-
props: layoutProps,
|
|
5530
|
-
children
|
|
5531
|
-
}
|
|
5532
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(UnknownRenderer, { type: String(layoutType), prefix: "未知布局类型" });
|
|
5593
|
+
return /* @__PURE__ */ jsxRuntime.jsx(UnknownRenderer, { type: String(layoutType), prefix: "未知布局类型" });
|
|
5533
5594
|
}
|
|
5534
5595
|
};
|
|
5535
5596
|
const isPlainObject$1 = (obj) => Object.prototype.toString.call(obj) === "[object Object]";
|
|
@@ -29985,6 +30046,15 @@ const LeafWrapper = ({
|
|
|
29985
30046
|
);
|
|
29986
30047
|
if (!node2) return null;
|
|
29987
30048
|
const { renderType, props, subType } = node2;
|
|
30049
|
+
if (typeof (customRenderComponent == null ? void 0 : customRenderComponent[subType]) !== "undefined") {
|
|
30050
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30051
|
+
CustomRenderFromProps,
|
|
30052
|
+
{
|
|
30053
|
+
props,
|
|
30054
|
+
component: customRenderComponent[subType]
|
|
30055
|
+
}
|
|
30056
|
+
);
|
|
30057
|
+
}
|
|
29988
30058
|
switch (subType) {
|
|
29989
30059
|
case "text":
|
|
29990
30060
|
return /* @__PURE__ */ jsxRuntime.jsx(TextRender, __spreadValues$4({}, props));
|
|
@@ -30048,13 +30118,7 @@ const LeafWrapper = ({
|
|
|
30048
30118
|
return /* @__PURE__ */ jsxRuntime.jsx(CustomRenderFromIM, __spreadProps$3(__spreadValues$4({}, props), { originProps }));
|
|
30049
30119
|
}
|
|
30050
30120
|
default:
|
|
30051
|
-
return
|
|
30052
|
-
CustomRenderFromProps,
|
|
30053
|
-
{
|
|
30054
|
-
props,
|
|
30055
|
-
component: customRenderComponent[subType]
|
|
30056
|
-
}
|
|
30057
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(UnknownRenderer, { type: String(renderType), prefix: "未知渲染类型" });
|
|
30121
|
+
return /* @__PURE__ */ jsxRuntime.jsx(UnknownRenderer, { type: String(renderType), prefix: "未知渲染类型" });
|
|
30058
30122
|
}
|
|
30059
30123
|
};
|
|
30060
30124
|
const ComponentRenderer = ({
|
|
@@ -30145,6 +30209,11 @@ const MessageContainer = (props) => {
|
|
|
30145
30209
|
} = props;
|
|
30146
30210
|
const { template, referenceComponentList, data } = component;
|
|
30147
30211
|
const { editorMode: editorMode2 } = useForEditor({});
|
|
30212
|
+
const responsiveValue = React.useMemo(() => {
|
|
30213
|
+
return {
|
|
30214
|
+
scale: props.devicePixelRatio ? 1 / props.devicePixelRatio : DEFAULT_SCALE
|
|
30215
|
+
};
|
|
30216
|
+
}, []);
|
|
30148
30217
|
const [values, setValues] = React.useState({});
|
|
30149
30218
|
const [dsValues, setDsValues] = React.useState({});
|
|
30150
30219
|
const [nodes, setNodes] = React.useState([]);
|
|
@@ -30214,7 +30283,7 @@ const MessageContainer = (props) => {
|
|
|
30214
30283
|
},
|
|
30215
30284
|
[onAction]
|
|
30216
30285
|
);
|
|
30217
|
-
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
30286
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx(ResponsiveContext.Provider, { value: responsiveValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30218
30287
|
ActionProvider,
|
|
30219
30288
|
{
|
|
30220
30289
|
onAction,
|
|
@@ -30243,11 +30312,8 @@ const MessageContainer = (props) => {
|
|
|
30243
30312
|
)
|
|
30244
30313
|
] })
|
|
30245
30314
|
}
|
|
30246
|
-
);
|
|
30247
|
-
|
|
30248
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { theme, children: content });
|
|
30249
|
-
}
|
|
30250
|
-
return content;
|
|
30315
|
+
) });
|
|
30316
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { scale: responsiveValue.scale, theme, children: content });
|
|
30251
30317
|
};
|
|
30252
30318
|
var __defProp$5 = Object.defineProperty;
|
|
30253
30319
|
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -33950,11 +34016,6 @@ var __spreadValues$1 = (a, b) => {
|
|
|
33950
34016
|
};
|
|
33951
34017
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
33952
34018
|
const MessageCard = (props) => {
|
|
33953
|
-
const responsiveValue = React.useMemo(() => {
|
|
33954
|
-
return {
|
|
33955
|
-
scale: 0.5
|
|
33956
|
-
};
|
|
33957
|
-
}, []);
|
|
33958
34019
|
const {
|
|
33959
34020
|
templateJson,
|
|
33960
34021
|
templateData,
|
|
@@ -33965,7 +34026,7 @@ const MessageCard = (props) => {
|
|
|
33965
34026
|
theme
|
|
33966
34027
|
} = useMessageCardLogic(props);
|
|
33967
34028
|
const { data = {} } = props;
|
|
33968
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
34029
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "message-card-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33969
34030
|
Render,
|
|
33970
34031
|
__spreadValues$1({
|
|
33971
34032
|
component: __spreadProps(__spreadValues$1({}, templateJson), {
|
|
@@ -33986,7 +34047,7 @@ const MessageCard = (props) => {
|
|
|
33986
34047
|
},
|
|
33987
34048
|
externalActions: props.externalActions
|
|
33988
34049
|
}, props)
|
|
33989
|
-
) })
|
|
34050
|
+
) });
|
|
33990
34051
|
};
|
|
33991
34052
|
const MessageCard_default = React.forwardRef(MessageCard);
|
|
33992
34053
|
var __defProp = Object.defineProperty;
|
|
@@ -34015,7 +34076,7 @@ exports.MessageContainer = MessageContainer;
|
|
|
34015
34076
|
exports.ThemeProvider = ThemeProvider;
|
|
34016
34077
|
exports.createRenderComponent = createRenderComponent;
|
|
34017
34078
|
exports.default = MessageCard_default;
|
|
34018
|
-
exports.defaultTheme = defaultTheme$
|
|
34079
|
+
exports.defaultTheme = defaultTheme$2;
|
|
34019
34080
|
exports.isLayoutNode = isLayoutNode;
|
|
34020
34081
|
exports.isRenderNode = isRenderNode;
|
|
34021
34082
|
exports.useTheme = useTheme$1;
|