pb-sxp-ui 1.0.98 → 1.0.100

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.
Files changed (102) hide show
  1. package/dist/index.cjs +396 -181
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +23 -20
  4. package/dist/index.js +397 -181
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +396 -181
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/ExpandableText.js +3 -2
  15. package/es/core/components/SxpPageRender/Hashtag/index.js +3 -1
  16. package/es/core/components/SxpPageRender/Navbar.js +4 -1
  17. package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
  18. package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  19. package/es/core/components/SxpPageRender/WaterFall/List.js +21 -10
  20. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +24 -13
  21. package/es/core/components/SxpPageRender/index.d.ts +1 -0
  22. package/es/core/components/SxpPageRender/index.js +2 -1
  23. package/es/core/context/EditorDataProvider.d.ts +1 -0
  24. package/es/core/context/EditorDataProvider.js +2 -1
  25. package/es/core/utils/tool.d.ts +5 -0
  26. package/es/core/utils/tool.js +43 -0
  27. package/es/index.d.ts +0 -1
  28. package/es/index.js +0 -1
  29. package/es/materials/sxp/HashTag/settingRender.d.ts +19 -22
  30. package/es/materials/sxp/HashTag/settingRender.js +31 -13
  31. package/es/materials/sxp/popup/AppointForm/Form.d.ts +14 -0
  32. package/es/materials/sxp/popup/AppointForm/Form.js +8 -0
  33. package/es/materials/sxp/popup/AppointForm/index.js +25 -20
  34. package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +9 -20
  35. package/es/materials/sxp/popup/AppointForm/settingRender.js +31 -13
  36. package/es/materials/sxp/popup/CommodityDetail/index.js +13 -4
  37. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +19 -22
  38. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +31 -13
  39. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +16 -5
  40. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +19 -22
  41. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +31 -13
  42. package/es/materials/sxp/popup/Prompt/index.js +4 -1
  43. package/es/materials/sxp/popup/Prompt/settingRender.d.ts +10 -8
  44. package/es/materials/sxp/popup/Prompt/settingRender.js +16 -8
  45. package/es/materials/sxp/template/Appoint/index.js +4 -1
  46. package/es/materials/sxp/template/Commodity/index.js +7 -2
  47. package/es/materials/sxp/template/CommodityDiro/index.js +8 -3
  48. package/es/materials/sxp/template/CommodityDiroNew/index.js +7 -2
  49. package/es/materials/sxp/template/Link/index.js +4 -1
  50. package/es/materials/sxp/template/MultiCommodity/index.js +7 -2
  51. package/es/materials/sxp/template/MultiCommodityDiro/index.js +8 -3
  52. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -2
  53. package/es/materials/sxp/template/components/Img.js +1 -1
  54. package/es/materials/sxp/template/components/settingRender.d.ts +16 -24
  55. package/es/materials/sxp/template/components/settingRender.js +30 -12
  56. package/lib/core/components/SxpPageRender/ExpandableText.js +3 -2
  57. package/lib/core/components/SxpPageRender/Hashtag/index.js +3 -1
  58. package/lib/core/components/SxpPageRender/Navbar.js +4 -1
  59. package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
  60. package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  61. package/lib/core/components/SxpPageRender/WaterFall/List.js +21 -10
  62. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +24 -13
  63. package/lib/core/components/SxpPageRender/index.d.ts +1 -0
  64. package/lib/core/components/SxpPageRender/index.js +2 -1
  65. package/lib/core/context/EditorDataProvider.d.ts +1 -0
  66. package/lib/core/context/EditorDataProvider.js +2 -1
  67. package/lib/core/utils/tool.d.ts +5 -0
  68. package/lib/core/utils/tool.js +45 -1
  69. package/lib/index.d.ts +0 -1
  70. package/lib/index.js +1 -3
  71. package/lib/materials/sxp/HashTag/settingRender.d.ts +19 -22
  72. package/lib/materials/sxp/HashTag/settingRender.js +31 -13
  73. package/lib/materials/sxp/popup/AppointForm/Form.d.ts +14 -0
  74. package/lib/materials/sxp/popup/AppointForm/Form.js +11 -0
  75. package/lib/materials/sxp/popup/AppointForm/index.js +24 -19
  76. package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +9 -20
  77. package/lib/materials/sxp/popup/AppointForm/settingRender.js +31 -14
  78. package/lib/materials/sxp/popup/CommodityDetail/index.js +13 -4
  79. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +19 -22
  80. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +31 -13
  81. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +16 -5
  82. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +19 -22
  83. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +31 -13
  84. package/lib/materials/sxp/popup/Prompt/index.js +4 -1
  85. package/lib/materials/sxp/popup/Prompt/settingRender.d.ts +10 -8
  86. package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -9
  87. package/lib/materials/sxp/template/Appoint/index.js +4 -1
  88. package/lib/materials/sxp/template/Commodity/index.js +7 -2
  89. package/lib/materials/sxp/template/CommodityDiro/index.js +8 -3
  90. package/lib/materials/sxp/template/CommodityDiroNew/index.js +7 -2
  91. package/lib/materials/sxp/template/Link/index.js +4 -1
  92. package/lib/materials/sxp/template/MultiCommodity/index.js +7 -2
  93. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +8 -3
  94. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -2
  95. package/lib/materials/sxp/template/components/Img.js +1 -1
  96. package/lib/materials/sxp/template/components/settingRender.d.ts +16 -24
  97. package/lib/materials/sxp/template/components/settingRender.js +30 -12
  98. package/package.json +1 -1
  99. package/es/materials/sxp/defaultSetting.d.ts +0 -8
  100. package/es/materials/sxp/defaultSetting.js +0 -6
  101. package/lib/materials/sxp/defaultSetting.d.ts +0 -8
  102. package/lib/materials/sxp/defaultSetting.js +0 -9
@@ -2,4 +2,9 @@ declare function uuid(len: number, radix: number): string;
2
2
  declare const getIndexByblockType: (type: string, index: number) => number | "initial";
3
3
  export declare const generateRandomString: (length: number) => string;
4
4
  export declare const getUid: () => string;
5
+ interface IfontType {
6
+ 'fontFamily-cn': string;
7
+ 'fontFamily-en': string;
8
+ }
9
+ export declare const setFontForText: (textContent?: string | null, style?: IfontType | any) => string;
5
10
  export { uuid, getIndexByblockType };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIndexByblockType = exports.uuid = exports.getUid = exports.generateRandomString = void 0;
3
+ exports.getIndexByblockType = exports.uuid = exports.setFontForText = exports.getUid = exports.generateRandomString = void 0;
4
4
  const uuid_1 = require("uuid");
5
5
  function uuid(len, radix) {
6
6
  const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
@@ -52,3 +52,47 @@ const getUid = () => {
52
52
  return uid;
53
53
  };
54
54
  exports.getUid = getUid;
55
+ const setFontForText = (textContent, style) => {
56
+ if (!textContent)
57
+ return '';
58
+ let content = '';
59
+ const cn = style === null || style === void 0 ? void 0 : style['fontFamily-cn'];
60
+ const en = style === null || style === void 0 ? void 0 : style['fontFamily-en'];
61
+ if (!cn && !en) {
62
+ return textContent;
63
+ }
64
+ let text = textContent;
65
+ const chineseRegex = /[\u4e00-\u9fa5]/g;
66
+ const englishRegex = /[^\u4e00-\u9fa5]/g;
67
+ const cnStyle = `font-family:${cn !== null && cn !== void 0 ? cn : 'inherit'}`;
68
+ const enStyle = `font-family:${en !== null && en !== void 0 ? en : 'inherit'}`;
69
+ const fn = (str) => {
70
+ let chineseStartIndex = str.search(chineseRegex);
71
+ let englishStartIndex = str.search(englishRegex);
72
+ if (chineseStartIndex !== -1 && englishStartIndex !== -1 && chineseStartIndex < englishStartIndex) {
73
+ content += `<span style="${cnStyle}">${str.substring(chineseStartIndex, englishStartIndex)}</span>`;
74
+ text = str.substring(englishStartIndex, str === null || str === void 0 ? void 0 : str.length);
75
+ }
76
+ if (chineseStartIndex !== -1 && englishStartIndex !== -1 && chineseStartIndex > englishStartIndex) {
77
+ content += `<span style="${enStyle}">${str.substring(englishStartIndex, chineseStartIndex)}</span>`;
78
+ text = str.substring(chineseStartIndex, str === null || str === void 0 ? void 0 : str.length);
79
+ }
80
+ if (chineseStartIndex === -1) {
81
+ content += `<span style="${enStyle}">${str.substring(englishStartIndex, str === null || str === void 0 ? void 0 : str.length)}</span>`;
82
+ text = '';
83
+ return false;
84
+ }
85
+ if (englishStartIndex === -1) {
86
+ content += `<span style="${cnStyle}">${str.substring(chineseStartIndex, str === null || str === void 0 ? void 0 : str.length)}</span>`;
87
+ text = '';
88
+ return false;
89
+ }
90
+ return true;
91
+ };
92
+ let w = true;
93
+ while (w) {
94
+ w = fn(text);
95
+ }
96
+ return content;
97
+ };
98
+ exports.setFontForText = setFontForText;
package/lib/index.d.ts CHANGED
@@ -8,5 +8,4 @@ export { default as SxpDataSourceProvider } from './core/context/SxpDataSourcePr
8
8
  export { default as SxpPageCore } from './core/components/SxpPageCore';
9
9
  export { default as EditorDataProvider } from './core/context/EditorDataProvider';
10
10
  export { useEditorDataProvider } from './core/context/EditorDataProvider';
11
- export { default as defaultSetting } from './materials/sxp/defaultSetting';
12
11
  export default Pagebuilder;
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultSetting = exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.DiyPortalPreview = exports.SxpPageRender = exports.materials = exports.core = void 0;
3
+ exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.DiyPortalPreview = exports.SxpPageRender = exports.materials = exports.core = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Pagebuilder_1 = require("./core/Pagebuilder");
6
6
  exports.core = tslib_1.__importStar(require("./core"));
@@ -19,6 +19,4 @@ var EditorDataProvider_1 = require("./core/context/EditorDataProvider");
19
19
  Object.defineProperty(exports, "EditorDataProvider", { enumerable: true, get: function () { return tslib_1.__importDefault(EditorDataProvider_1).default; } });
20
20
  var EditorDataProvider_2 = require("./core/context/EditorDataProvider");
21
21
  Object.defineProperty(exports, "useEditorDataProvider", { enumerable: true, get: function () { return EditorDataProvider_2.useEditorDataProvider; } });
22
- var defaultSetting_1 = require("./materials/sxp/defaultSetting");
23
- Object.defineProperty(exports, "defaultSetting", { enumerable: true, get: function () { return tslib_1.__importDefault(defaultSetting_1).default; } });
24
22
  exports.default = Pagebuilder_1.Pagebuilder;
@@ -38,27 +38,25 @@ declare const _default: ({
38
38
  } | {
39
39
  type: string;
40
40
  label: string;
41
- child: ({
41
+ child: {
42
42
  type: string;
43
43
  name: string[];
44
- options?: undefined;
45
- initialValue?: undefined;
46
- addonAfter?: undefined;
47
- } | {
44
+ bottomText: string;
45
+ }[];
46
+ options?: undefined;
47
+ name?: undefined;
48
+ initialValue?: undefined;
49
+ } | {
50
+ type: string;
51
+ label: string;
52
+ child: ({
48
53
  type: string;
49
- options: {
50
- label: string;
51
- value: string;
52
- }[];
53
54
  name: string[];
54
- initialValue: string;
55
55
  addonAfter?: undefined;
56
56
  } | {
57
57
  type: string;
58
58
  addonAfter: string;
59
59
  name: string[];
60
- options?: undefined;
61
- initialValue?: undefined;
62
60
  })[];
63
61
  options?: undefined;
64
62
  name?: undefined;
@@ -105,19 +103,19 @@ declare const _default: ({
105
103
  } | {
106
104
  type: string;
107
105
  label: string;
108
- child: ({
106
+ child: {
109
107
  type: string;
110
108
  name: string[];
111
- initialValue: string;
112
- options?: undefined;
113
- addonAfter?: undefined;
114
- } | {
109
+ bottomText: string;
110
+ }[];
111
+ name?: undefined;
112
+ initialValue?: undefined;
113
+ } | {
114
+ type: string;
115
+ label: string;
116
+ child: ({
115
117
  type: string;
116
118
  name: string[];
117
- options: {
118
- label: string;
119
- value: string;
120
- }[];
121
119
  initialValue: string;
122
120
  addonAfter?: undefined;
123
121
  } | {
@@ -125,7 +123,6 @@ declare const _default: ({
125
123
  name: string[];
126
124
  addonAfter: string;
127
125
  initialValue?: undefined;
128
- options?: undefined;
129
126
  })[];
130
127
  name?: undefined;
131
128
  initialValue?: undefined;
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
- var _a, _b;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
- const defaultSetting_1 = require("../defaultSetting");
5
3
  exports.default = [
6
4
  {
7
5
  title: 'Banner',
@@ -70,14 +68,24 @@ exports.default = [
70
68
  label: '标题字体',
71
69
  child: [
72
70
  {
73
- type: 'Color',
74
- name: ['color']
71
+ type: 'Select',
72
+ name: ['fontFamily-cn'],
73
+ bottomText: '中文字体'
75
74
  },
76
75
  {
77
76
  type: 'Select',
78
- options: defaultSetting_1.fontOptions,
79
- name: ['fontFamily'],
80
- initialValue: (_a = defaultSetting_1.fontOptions === null || defaultSetting_1.fontOptions === void 0 ? void 0 : defaultSetting_1.fontOptions[0]) === null || _a === void 0 ? void 0 : _a.value
77
+ name: ['fontFamily-en'],
78
+ bottomText: '英文/其他字体'
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ type: 'Group',
84
+ label: '',
85
+ child: [
86
+ {
87
+ type: 'Color',
88
+ name: ['color']
81
89
  },
82
90
  {
83
91
  type: 'Number',
@@ -144,15 +152,25 @@ exports.default = [
144
152
  label: '字体',
145
153
  child: [
146
154
  {
147
- type: 'Color',
148
- name: ['props', 'buttonStyle', 'color'],
149
- initialValue: '#fff'
155
+ type: 'Select',
156
+ name: ['props', 'buttonStyle', 'fontFamily-cn'],
157
+ bottomText: '中文字体'
150
158
  },
151
159
  {
152
160
  type: 'Select',
153
- name: ['props', 'buttonStyle', 'fontFamily'],
154
- options: defaultSetting_1.fontOptions,
155
- initialValue: (_b = defaultSetting_1.fontOptions === null || defaultSetting_1.fontOptions === void 0 ? void 0 : defaultSetting_1.fontOptions[0]) === null || _b === void 0 ? void 0 : _b.value
161
+ name: ['props', 'buttonStyle', 'fontFamily-en'],
162
+ bottomText: '英文/其他字体'
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ type: 'Group',
168
+ label: '',
169
+ child: [
170
+ {
171
+ type: 'Color',
172
+ name: ['props', 'buttonStyle', 'color'],
173
+ initialValue: '#fff'
156
174
  },
157
175
  {
158
176
  type: 'Number',
@@ -0,0 +1,14 @@
1
+ import { IAppointFormProps } from '.';
2
+ import React from 'react';
3
+ interface IFormProps {
4
+ columns?: {
5
+ title?: string;
6
+ dataIndex?: string;
7
+ valueType?: string;
8
+ key?: string;
9
+ }[];
10
+ layout?: IAppointFormProps['layoutType'];
11
+ onChange?: (data: Record<string, any>) => void;
12
+ }
13
+ declare const _default: React.NamedExoticComponent<IFormProps>;
14
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = require("react");
5
+ const react_2 = tslib_1.__importDefault(require("react"));
6
+ const Form = ({ layout, columns, onChange }) => {
7
+ return (react_2.default.createElement(react_2.default.Fragment, null, columns === null || columns === void 0 ? void 0 : columns.map((item, index) => (react_2.default.createElement("div", { key: index, className: 'pb-appoint-form-container-item', style: { flexDirection: layout === 'horizontal' ? 'row' : 'column' } },
8
+ layout !== 'inline' && react_2.default.createElement("label", { className: 'pb-appoint-form-container-label' }, item === null || item === void 0 ? void 0 : item.title),
9
+ (item === null || item === void 0 ? void 0 : item.valueType) === 'text' && (react_2.default.createElement("input", { className: 'pb-appoint-form-container-input', type: 'text', placeholder: layout === 'inline' ? item === null || item === void 0 ? void 0 : item.title : '请输入', name: item === null || item === void 0 ? void 0 : item.dataIndex, onChange: onChange })))))));
10
+ };
11
+ exports.default = (0, react_1.memo)(Form);
@@ -7,11 +7,12 @@ const lodash_1 = require("lodash");
7
7
  const hooks_1 = require("../../../../core/hooks");
8
8
  require("./index.less");
9
9
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
10
+ const tool_1 = require("../../../../core/utils/tool");
11
+ const Form_1 = tslib_1.__importDefault(require("./Form"));
10
12
  const AppointForm = (_a) => {
11
- var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, isExternalLink, isPopup, onClick, onClose, submitButtonStyle } = _a, props = tslib_1.__rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "isExternalLink", "isPopup", "onClick", "onClose", "submitButtonStyle"]);
13
+ var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType = 'inline', isExternalLink, isPopup, onClick, onClose, submitButtonStyle } = _a, props = tslib_1.__rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "isExternalLink", "isPopup", "onClick", "onClose", "submitButtonStyle"]);
12
14
  const { submitForm, popupDetailData } = (0, hooks_1.useSxpDataSource)();
13
15
  const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
14
- const formRef = (0, react_1.useRef)();
15
16
  const [loading, setLoading] = (0, react_1.useState)(false);
16
17
  const defaultColumns = (0, react_1.useMemo)(() => [
17
18
  {
@@ -39,27 +40,26 @@ const AppointForm = (_a) => {
39
40
  key: '4'
40
41
  }
41
42
  ], []);
43
+ const [formData, setFormData] = (0, react_1.useState)({});
42
44
  const columnsData = (0, react_1.useMemo)(() => {
43
- if (layoutType === undefined) {
44
- const list = (0, lodash_1.cloneDeep)(columns) || defaultColumns;
45
- return list === null || list === void 0 ? void 0 : list.map((obj) => (Object.assign(Object.assign({}, obj), { title: undefined, fieldProps: { placeholder: obj === null || obj === void 0 ? void 0 : obj.title } })));
46
- }
47
- else {
48
- return (0, lodash_1.cloneDeep)(columns) || defaultColumns;
49
- }
50
- }, [layoutType, columns, defaultColumns]);
45
+ return (0, lodash_1.cloneDeep)(columns) || defaultColumns;
46
+ }, [columns, defaultColumns]);
47
+ const handleChange = (0, react_1.useCallback)((e) => {
48
+ const { name, value } = e.target;
49
+ setFormData(Object.assign(Object.assign({}, formData), { [name]: value }));
50
+ }, [formData]);
51
51
  const handleSubmit = (0, lodash_1.debounce)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
52
- var _b, _c, _d, _e, _f, _g;
53
- const vals = yield ((_b = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _b === void 0 ? void 0 : _b.getFieldsValue());
52
+ var _b, _c, _d, _e, _f;
53
+ const vals = formData;
54
54
  if (!vals)
55
55
  return;
56
- const arr = (_d = (_c = Object.keys(vals)) === null || _c === void 0 ? void 0 : _c.map((key) => {
56
+ const arr = (_c = (_b = Object.keys(vals)) === null || _b === void 0 ? void 0 : _b.map((key) => {
57
57
  var _a;
58
58
  return ({
59
59
  name: key,
60
60
  value: (_a = vals[key]) !== null && _a !== void 0 ? _a : ''
61
61
  });
62
- })) === null || _d === void 0 ? void 0 : _d.filter((item) => item === null || item === void 0 ? void 0 : item.value);
62
+ })) === null || _c === void 0 ? void 0 : _c.filter((item) => item === null || item === void 0 ? void 0 : item.value);
63
63
  if (!arr || !(arr === null || arr === void 0 ? void 0 : arr.length))
64
64
  return;
65
65
  setLoading(true);
@@ -68,8 +68,8 @@ const AppointForm = (_a) => {
68
68
  if (res) {
69
69
  if (isExternalLink) {
70
70
  const data = popupDetailData;
71
- const product = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProduct;
72
- const cta = (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.bindCta;
71
+ const product = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct;
72
+ const cta = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta;
73
73
  const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
74
74
  jumpToWeb(data, product, cta, position);
75
75
  }
@@ -80,10 +80,15 @@ const AppointForm = (_a) => {
80
80
  }
81
81
  }), 1000);
82
82
  return (react_1.default.createElement("div", { className: 'pb-appoint-form' },
83
- react_1.default.createElement("div", { className: `pb-appoint-form-title ${(0, css_1.css)(Object.assign({}, textStyle))}` }, title),
83
+ react_1.default.createElement("div", { className: `pb-appoint-form-title ${(0, css_1.css)(Object.assign({}, textStyle))}`, dangerouslySetInnerHTML: {
84
+ __html: (0, tool_1.setFontForText)(title, textStyle)
85
+ } }),
84
86
  react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign({}, style)) }, props),
85
- react_1.default.createElement("div", { className: 'pb-appoint-form-container' })),
87
+ react_1.default.createElement("div", { className: 'pb-appoint-form-container' },
88
+ react_1.default.createElement(Form_1.default, { columns: columnsData, layout: layoutType, onChange: handleChange }))),
86
89
  react_1.default.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
87
- react_1.default.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? react_1.default.createElement(react_1.default.Fragment, null, "loading...") : submitText))));
90
+ react_1.default.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle), dangerouslySetInnerHTML: {
91
+ __html: (0, tool_1.setFontForText)(loading ? 'loading...' : submitText, submitButtonStyle)
92
+ } }))));
88
93
  };
89
94
  exports.default = (0, react_1.memo)(AppointForm);
@@ -15,27 +15,24 @@ declare const _default: ({
15
15
  } | {
16
16
  type: string;
17
17
  label: string;
18
- child: ({
18
+ child: {
19
19
  type: string;
20
20
  name: string[];
21
- options?: undefined;
22
- initialValue?: undefined;
23
- addonAfter?: undefined;
24
- } | {
21
+ bottomText: string;
22
+ }[];
23
+ name?: undefined;
24
+ options?: undefined;
25
+ } | {
26
+ type: string;
27
+ label: string;
28
+ child: ({
25
29
  type: string;
26
30
  name: string[];
27
- options: {
28
- label: string;
29
- value: string;
30
- }[];
31
- initialValue: string;
32
31
  addonAfter?: undefined;
33
32
  } | {
34
33
  type: string;
35
34
  name: string[];
36
35
  addonAfter: string;
37
- options?: undefined;
38
- initialValue?: undefined;
39
36
  })[];
40
37
  name?: undefined;
41
38
  options?: undefined;
@@ -58,20 +55,12 @@ declare const _default: ({
58
55
  type: string;
59
56
  name: string[];
60
57
  initialValue: string;
61
- options?: undefined;
62
- addonAfter?: undefined;
63
- } | {
64
- type: string;
65
- name: string[];
66
- options: any[];
67
- initialValue: any;
68
58
  addonAfter?: undefined;
69
59
  } | {
70
60
  type: string;
71
61
  name: string[];
72
62
  addonAfter: string;
73
63
  initialValue: number;
74
- options?: undefined;
75
64
  })[];
76
65
  name?: undefined;
77
66
  options?: undefined;
@@ -1,8 +1,5 @@
1
1
  "use strict";
2
- var _a, _b, _c;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
- const tslib_1 = require("tslib");
5
- const defaultSetting_1 = tslib_1.__importStar(require("../../defaultSetting"));
6
3
  exports.default = [
7
4
  {
8
5
  type: 'Text',
@@ -22,14 +19,24 @@ exports.default = [
22
19
  label: '标题字体',
23
20
  child: [
24
21
  {
25
- type: 'Color',
26
- name: ['textStyle', 'color']
22
+ type: 'Select',
23
+ name: ['testStyle', 'fontFamily-cn'],
24
+ bottomText: '中文字体'
27
25
  },
28
26
  {
29
27
  type: 'Select',
30
- name: ['textStyle', 'fontFamily'],
31
- options: defaultSetting_1.fontOptions,
32
- initialValue: (_a = defaultSetting_1.fontOptions === null || defaultSetting_1.fontOptions === void 0 ? void 0 : defaultSetting_1.fontOptions[0]) === null || _a === void 0 ? void 0 : _a.value
28
+ name: ['testStyle', 'fontFamily-en'],
29
+ bottomText: '英文/其他字体'
30
+ }
31
+ ]
32
+ },
33
+ {
34
+ type: 'Group',
35
+ label: '',
36
+ child: [
37
+ {
38
+ type: 'Color',
39
+ name: ['textStyle', 'color']
33
40
  },
34
41
  {
35
42
  type: 'Number',
@@ -77,15 +84,25 @@ exports.default = [
77
84
  label: '提交按钮字体',
78
85
  child: [
79
86
  {
80
- type: 'Color',
81
- name: ['props', 'submitButtonStyle', 'color'],
82
- initialValue: '#fff'
87
+ type: 'Select',
88
+ name: ['props', 'submitButtonStyle', 'fontFamily-cn'],
89
+ bottomText: '中文字体'
83
90
  },
84
91
  {
85
92
  type: 'Select',
86
- name: ['props', 'submitButtonStyle', 'fontFamily'],
87
- options: defaultSetting_1.default === null || defaultSetting_1.default === void 0 ? void 0 : defaultSetting_1.default.fontOptions,
88
- initialValue: (_c = (_b = defaultSetting_1.default === null || defaultSetting_1.default === void 0 ? void 0 : defaultSetting_1.default.fontOptions) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value
93
+ name: ['props', 'submitButtonStyle', 'fontFamily-en'],
94
+ bottomText: '英文/其他字体'
95
+ }
96
+ ]
97
+ },
98
+ {
99
+ type: 'Group',
100
+ label: '',
101
+ child: [
102
+ {
103
+ type: 'Color',
104
+ name: ['props', 'submitButtonStyle', 'color'],
105
+ initialValue: '#fff'
89
106
  },
90
107
  {
91
108
  type: 'Number',
@@ -11,6 +11,7 @@ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
11
11
  const Modal_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/Modal"));
12
12
  const ExpandableText_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/ExpandableText"));
13
13
  const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
14
+ const tool_1 = require("../../../../core/utils/tool");
14
15
  const CommodityDetail = (_a) => {
15
16
  var _b, _c, _d, _e, _f, _g, _h, _j, _k;
16
17
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
@@ -64,9 +65,15 @@ const CommodityDetail = (_a) => {
64
65
  const renderContent = ({ isPost }) => {
65
66
  var _a, _b, _c;
66
67
  return (react_1.default.createElement("div", null,
67
- react_1.default.createElement("div", { className: 'pb-commondity-content-collection', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === '') }, (_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock'),
68
- react_1.default.createElement("div", { className: 'pb-commondity-content-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
69
- react_1.default.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
68
+ react_1.default.createElement("div", { className: 'pb-commondity-content-collection', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), dangerouslySetInnerHTML: {
69
+ __html: (0, tool_1.setFontForText)((_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
70
+ } }),
71
+ react_1.default.createElement("div", { className: 'pb-commondity-content-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title), dangerouslySetInnerHTML: {
72
+ __html: (0, tool_1.setFontForText)((_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
73
+ } }),
74
+ react_1.default.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), dangerouslySetInnerHTML: {
75
+ __html: (0, tool_1.setFontForText)(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
76
+ } }),
70
77
  react_1.default.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
71
78
  react_1.default.createElement(ExpandableText_1.default, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
72
79
  bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
@@ -76,7 +83,9 @@ const CommodityDetail = (_a) => {
76
83
  };
77
84
  const renderBtn = () => {
78
85
  var _a, _b;
79
- return (react_1.default.createElement(react_1.default.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website'))));
86
+ return (react_1.default.createElement(react_1.default.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle, dangerouslySetInnerHTML: {
87
+ __html: (0, tool_1.setFontForText)((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
88
+ } }))));
80
89
  };
81
90
  const getStyle = (0, react_1.useCallback)((style) => {
82
91
  if (style === null || style === void 0 ? void 0 : style.lineClamp) {
@@ -62,27 +62,25 @@ declare const _default: ({
62
62
  } | {
63
63
  type: string;
64
64
  label: string;
65
- child: ({
65
+ child: {
66
66
  type: string;
67
67
  name: string[];
68
- options?: undefined;
69
- initialValue?: undefined;
70
- addonAfter?: undefined;
71
- } | {
68
+ bottomText: string;
69
+ }[];
70
+ options?: undefined;
71
+ name?: undefined;
72
+ initialValue?: undefined;
73
+ } | {
74
+ type: string;
75
+ label: string;
76
+ child: ({
72
77
  type: string;
73
- options: {
74
- label: string;
75
- value: string;
76
- }[];
77
78
  name: string[];
78
- initialValue: string;
79
79
  addonAfter?: undefined;
80
80
  } | {
81
81
  type: string;
82
82
  addonAfter: string;
83
83
  name: string[];
84
- options?: undefined;
85
- initialValue?: undefined;
86
84
  })[];
87
85
  options?: undefined;
88
86
  name?: undefined;
@@ -136,19 +134,19 @@ declare const _default: ({
136
134
  } | {
137
135
  type: string;
138
136
  label: string;
139
- child: ({
137
+ child: {
140
138
  type: string;
141
139
  name: string[];
142
- initialValue: string;
143
- options?: undefined;
144
- addonAfter?: undefined;
145
- } | {
140
+ bottomText: string;
141
+ }[];
142
+ name?: undefined;
143
+ initialValue?: undefined;
144
+ } | {
145
+ type: string;
146
+ label: string;
147
+ child: ({
146
148
  type: string;
147
149
  name: string[];
148
- options: {
149
- label: string;
150
- value: string;
151
- }[];
152
150
  initialValue: string;
153
151
  addonAfter?: undefined;
154
152
  } | {
@@ -156,7 +154,6 @@ declare const _default: ({
156
154
  name: string[];
157
155
  addonAfter: string;
158
156
  initialValue?: undefined;
159
- options?: undefined;
160
157
  })[];
161
158
  name?: undefined;
162
159
  initialValue?: undefined;