tee3apps-cms-sdk-react 0.0.35 → 0.0.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tee3apps-cms-sdk-react",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "Uses JSON to dynamically generate and render UI pages in a website",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var resolve = require('@rollup/plugin-node-resolve');
6
+ var commonjs = require('@rollup/plugin-commonjs');
7
+ var typescript = require('@rollup/plugin-typescript');
8
+ var dts = require('rollup-plugin-dts');
9
+ var terser = require('@rollup/plugin-terser');
10
+ var peerDepsExternal = require('rollup-plugin-peer-deps-external');
11
+ var postcss = require('rollup-plugin-postcss');
12
+
13
+ const packageJson = require("./package.json");
14
+
15
+ var rollup_config = [
16
+ {
17
+ input: "src/index.ts",
18
+ output: [
19
+ {
20
+ file: packageJson.main,
21
+ format: "cjs",
22
+ sourcemap: true,
23
+ },
24
+ {
25
+ file: packageJson.module,
26
+ format: "esm",
27
+ sourcemap: true,
28
+ },
29
+ ],
30
+ plugins: [
31
+ peerDepsExternal(),
32
+ resolve(),
33
+ commonjs(),
34
+ typescript({ tsconfig: "./tsconfig.json" }),
35
+ terser(),
36
+ postcss(),
37
+ ],
38
+ external: ["react", "react-dom"],
39
+ },
40
+ {
41
+ input: "src/index.ts",
42
+ output: [{ file: packageJson.types }],
43
+ plugins: [dts.default()],
44
+ external: [/\.css$/],
45
+ },
46
+ ];
47
+
48
+ exports.default = rollup_config;
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var resolve = require('@rollup/plugin-node-resolve');
6
+ var commonjs = require('@rollup/plugin-commonjs');
7
+ var typescript = require('@rollup/plugin-typescript');
8
+ var dts = require('rollup-plugin-dts');
9
+ var terser = require('@rollup/plugin-terser');
10
+ var peerDepsExternal = require('rollup-plugin-peer-deps-external');
11
+ var postcss = require('rollup-plugin-postcss');
12
+
13
+ const packageJson = require("./package.json");
14
+
15
+ var rollup_config = [
16
+ {
17
+ input: "src/index.ts",
18
+ output: [
19
+ {
20
+ file: packageJson.main,
21
+ format: "cjs",
22
+ sourcemap: true,
23
+ },
24
+ {
25
+ file: packageJson.module,
26
+ format: "esm",
27
+ sourcemap: true,
28
+ },
29
+ ],
30
+ plugins: [
31
+ peerDepsExternal(),
32
+ resolve(),
33
+ commonjs(),
34
+ typescript({ tsconfig: "./tsconfig.json" }),
35
+ terser(),
36
+ postcss(),
37
+ ],
38
+ external: ["react", "react-dom"],
39
+ },
40
+ {
41
+ input: "src/index.ts",
42
+ output: [{ file: packageJson.types }],
43
+ plugins: [dts.default()],
44
+ external: [/\.css$/],
45
+ },
46
+ ];
47
+
48
+ exports.default = rollup_config;
package/src/Page.tsx CHANGED
@@ -124,7 +124,7 @@ const Page = ({ data, showsp = true, showdiscount = true }: any) => {
124
124
  deviceMode={deviceMode} />;
125
125
  }
126
126
  case 'RichTextBoxComponent':
127
- return <RichTextComponent key={compIndex} props={component.props as RichTextComponentProps} />;
127
+ return <RichTextComponent key={compIndex} props={component.props as RichTextComponentProps} deviceMode={deviceMode} />;
128
128
  default:
129
129
  return null;
130
130
  }
@@ -30,6 +30,7 @@ interface RowProps {
30
30
  nowrap: boolean;
31
31
  bgsize: React.CSSProperties['backgroundSize'];
32
32
  mode: DeviceModes;
33
+ idname:string;
33
34
  }
34
35
 
35
36
  interface RowComponentProps {
@@ -132,7 +133,8 @@ const getJustifyContent = (): React.CSSProperties['justifyContent'] => {
132
133
  };
133
134
 
134
135
  return (
135
- <div
136
+ <section
137
+ id={props.idname}
136
138
  style={{
137
139
  minHeight: getRowMinHeight(),
138
140
  backgroundColor: props.bgColor,
@@ -159,7 +161,7 @@ const getJustifyContent = (): React.CSSProperties['justifyContent'] => {
159
161
  }}
160
162
  >
161
163
  {children}
162
- </div>
164
+ </section>
163
165
  );
164
166
  };
165
167
 
@@ -247,18 +247,20 @@ const GroupBrandComponent: React.FC<GroupBrandComponentMainProps> = ({ props, de
247
247
  <>
248
248
  <style>
249
249
  {`
250
- .groupBrandCarousel::-webkit-scrollbar {
251
- display: none;
250
+ ${!isHorizontalScroll ? `
251
+ .GroupBrandComponent .groupBrandCarousel::-webkit-scrollbar {
252
+ display: none !important;
252
253
  }
253
- .groupBrandCarousel {
254
- scrollbar-width: none;
255
- -ms-overflow-style: none;
254
+ .GroupBrandComponent .groupBrandCarousel {
255
+ scrollbar-width: none !important;
256
+ -ms-overflow-style: none !important;
256
257
  }
258
+ ` : ''}
257
259
  `}
258
260
  </style>
259
261
  <div
260
262
  style={{
261
- border: '1px solid #e1e1e1',
263
+ // border: '1px solid #e1e1e1',
262
264
  width: '100%',
263
265
  maxWidth: '100%',
264
266
  borderRadius: '0px',
@@ -349,7 +351,7 @@ const GroupBrandComponent: React.FC<GroupBrandComponentMainProps> = ({ props, de
349
351
  <div
350
352
  style={{
351
353
  display: currentLayout === 'NONE' ? 'flex' : 'block',
352
- overflowX: currentLayout === 'NONE' ? (isHorizontalScroll ? 'auto' : 'hidden') : 'visible',
354
+ overflowX: 'auto',
353
355
  overflowY: currentLayout === 'NONE' ? 'hidden' : 'visible',
354
356
  alignItems: currentLayout === 'NONE' ? 'stretch' : undefined,
355
357
  gap: currentLayout === 'NONE' ? '12px' : '0',
@@ -283,18 +283,20 @@ const GroupCategoryComponent: React.FC<GroupCategoryComponentMainProps> = ({ pro
283
283
  <>
284
284
  <style>
285
285
  {`
286
- .groupCategoryCarousel::-webkit-scrollbar {
287
- display: none;
286
+ ${!isHorizontalScroll ? `
287
+ .GroupCategoryComponent .groupCategoryCarousel::-webkit-scrollbar {
288
+ display: none !important;
288
289
  }
289
- .groupCategoryCarousel {
290
- scrollbar-width: none;
291
- -ms-overflow-style: none;
290
+ .GroupCategoryComponent .groupCategoryCarousel {
291
+ scrollbar-width: none !important;
292
+ -ms-overflow-style: none !important;
292
293
  }
294
+ ` : ''}
293
295
  `}
294
296
  </style>
295
297
  <div
296
298
  style={{
297
- border: '1px solid #e1e1e1',
299
+ // border: '1px solid #e1e1e1',
298
300
  width: '100%',
299
301
  maxWidth: '100%',
300
302
  borderRadius: '0px',
@@ -385,7 +387,7 @@ const GroupCategoryComponent: React.FC<GroupCategoryComponentMainProps> = ({ pro
385
387
  <div
386
388
  style={{
387
389
  display: currentLayout === 'NONE' ? 'flex' : 'block',
388
- overflowX: currentLayout === 'NONE' ? (isHorizontalScroll ? 'auto' : 'hidden') : 'visible',
390
+ overflowX: 'auto',
389
391
  overflowY: currentLayout === 'NONE' ? 'hidden' : 'visible',
390
392
  alignItems: currentLayout === 'NONE' ? 'stretch' : undefined,
391
393
  gap: currentLayout === 'NONE' ? '12px' : '0',
@@ -425,18 +425,22 @@ const GroupImageList: React.FC<GroupImageListMainProps> = ({
425
425
  <>
426
426
  <style>
427
427
  {`
428
- .scrollable-container::-webkit-scrollbar {
429
- display: none;
428
+ ${!isHorizontalScroll ? `
429
+ .GroupImageListComponent .scrollable-container::-webkit-scrollbar,
430
+ .GroupImageListComponent .groupImageCarousel::-webkit-scrollbar {
431
+ display: none !important;
430
432
  }
431
- .scrollable-container {
432
- scrollbar-width: none;
433
- -ms-overflow-style: none;
433
+ .GroupImageListComponent .scrollable-container,
434
+ .GroupImageListComponent .groupImageCarousel {
435
+ scrollbar-width: none !important;
436
+ -ms-overflow-style: none !important;
434
437
  }
438
+ ` : ''}
435
439
  `}
436
440
  </style>
437
441
  <div
438
442
  style={{
439
- border: '1px solid #e1e1e1',
443
+ // border: '1px solid #e1e1e1',
440
444
  width: '100%',
441
445
  maxWidth: '100%',
442
446
  borderRadius: '0px',
@@ -549,7 +553,7 @@ const GroupImageList: React.FC<GroupImageListMainProps> = ({
549
553
  style={{
550
554
  display: 'flex',
551
555
  gap: '12px',
552
- overflowX: isHorizontalScroll ? 'auto' : 'hidden',
556
+ overflowX: 'auto',
553
557
  overflowY: 'hidden',
554
558
  alignItems: 'stretch',
555
559
  width: '100%',
@@ -645,7 +649,7 @@ const GroupImageList: React.FC<GroupImageListMainProps> = ({
645
649
  </div>
646
650
  ) : null
647
651
  ) : (
648
- <div style={{ textAlign: 'center', color: '#666', padding: '40px', width: '100%', border: '2px dashed #ddd', borderRadius: '8px', backgroundColor: '#f9f9f9' }}>
652
+ <div style={{ textAlign: 'center', color: '#666', padding: '40px', width: '100%', border: '2px dashed #ddd', borderRadius: '8px', backgroundColor: '#fff' }}>
649
653
  <p>No images available.</p>
650
654
  </div>
651
655
  )}
@@ -452,18 +452,22 @@ const GroupVideoList: React.FC<GroupVideoListMainProps> = ({ props, deviceMode =
452
452
 
453
453
  return (
454
454
  <>
455
- <style>{`
456
- .groupVideoCarousel::-webkit-scrollbar {
457
- display: none;
458
- }
459
- .groupVideoCarousel {
460
- scrollbar-width: none;
461
- -ms-overflow-style: none;
462
- }
463
- `}</style>
455
+ <style>
456
+ {`
457
+ ${!isHorizontalScroll ? `
458
+ .GroupVideoListComponent .groupVideoCarousel::-webkit-scrollbar {
459
+ display: none !important;
460
+ }
461
+ .GroupVideoListComponent .groupVideoCarousel {
462
+ scrollbar-width: none !important;
463
+ -ms-overflow-style: none !important;
464
+ }
465
+ ` : ''}
466
+ `}
467
+ </style>
464
468
  <div
465
469
  style={{
466
- border: '1px solid #e1e1e1',
470
+ // border: '1px solid #e1e1e1',
467
471
  width: '100%',
468
472
  maxWidth: '100%',
469
473
  borderRadius: '0px',
@@ -554,7 +558,7 @@ const GroupVideoList: React.FC<GroupVideoListMainProps> = ({ props, deviceMode =
554
558
  <div
555
559
  style={{
556
560
  display: currentLayout === 'NONE' ? 'flex' : 'block',
557
- overflowX: currentLayout === 'NONE' ? (isHorizontalScroll ? 'auto' : 'hidden') : 'visible',
561
+ overflowX: 'auto',
558
562
  overflowY: currentLayout === 'NONE' ? 'hidden' : (boxHeight ? 'auto' : 'visible'),
559
563
  gap: currentLayout === 'NONE' ? '12px' : '0',
560
564
  padding: '12px',
@@ -1,13 +1,21 @@
1
1
  import React from 'react';
2
2
 
3
3
  export interface RichTextComponentProps {
4
- content: {
5
- all: string;
4
+ content?: {
5
+ all?: string;
6
+ } | string;
7
+ mode?: {
8
+ [key: string]: {
9
+ content: string;
10
+ };
6
11
  };
7
12
  }
8
13
 
9
- const RichTextComponent: React.FC<{ props: RichTextComponentProps }> = ({ props }) => {
10
- const htmlContent = props?.content?.all || props?.content;
14
+ const RichTextComponent: React.FC<{ props: RichTextComponentProps; deviceMode?: string }> = ({ props, deviceMode = 'web' }) => {
15
+ const modeData = props?.mode?.[deviceMode] as { content?: string } | undefined;
16
+ const contentAll = typeof props?.content === 'string' ? props?.content : props?.content?.all;
17
+
18
+ const htmlContent = modeData?.content || contentAll || '';
11
19
 
12
20
  return (
13
21
  <div
@@ -4,7 +4,7 @@
4
4
  display: flex;
5
5
  justify-content: center;
6
6
  align-items: center;
7
- background-color: #f4f4f4;
7
+ background-color: #fff;
8
8
  overflow: hidden;
9
9
  box-sizing: border-box;
10
10
  }