@gem-sdk/components 2.1.4 → 2.1.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.
@@ -251,19 +251,7 @@ const Dialog = ({ setting, children, builderProps, builderAttrs, style })=>{
251
251
  style
252
252
  ]);
253
253
  const borderStyle = React.useMemo(()=>{
254
- return Object.keys(style ?? {}).filter((key)=>[
255
- '--bw',
256
- '--bw-mobile',
257
- '--bw-tablet',
258
- '--bc',
259
- '--b',
260
- '--bs',
261
- '--radius',
262
- '--bblr',
263
- '--bbrr',
264
- '--btlr',
265
- '--btrr'
266
- ].includes(key)).reduce((curr, key)=>({
254
+ return Object.keys(style ?? {}).filter((key)=>common.advancedBorderStyle.includes(key)).reduce((curr, key)=>({
267
255
  ...curr,
268
256
  [key]: style?.[key]
269
257
  }), {});
@@ -28,19 +28,7 @@ const Dialog = ({ setting, children, builderProps, style, advanced })=>{
28
28
  ...curr,
29
29
  [key]: style?.[key]
30
30
  }), {});
31
- const borderStyle = Object.keys(style ?? {}).filter((key)=>[
32
- '--bw',
33
- '--bw-mobile',
34
- '--bw-tablet',
35
- '--bc',
36
- '--b',
37
- '--bs',
38
- '--radius',
39
- '--bblr',
40
- '--bbrr',
41
- '--btlr',
42
- '--btrr'
43
- ].includes(key)).reduce((curr, key)=>({
31
+ const borderStyle = Object.keys(style ?? {}).filter((key)=>common.advancedBorderStyle.includes(key)).reduce((curr, key)=>({
44
32
  ...curr,
45
33
  [key]: style?.[key]
46
34
  }), {});
@@ -9,6 +9,35 @@ const isShowModal = (startDate, numberOfDay = 0)=>{
9
9
  const diff = Math.abs(c / 24 / 60 / 60 / 1000);
10
10
  return diff >= numberOfDay;
11
11
  };
12
+ const advancedBorderStyle = [
13
+ '--bw',
14
+ '--bw-mobile',
15
+ '--bw-tablet',
16
+ '--bc',
17
+ '--bc-tablet',
18
+ '--bc-mobile',
19
+ '--b',
20
+ '--b-tablet',
21
+ '--b-mobile',
22
+ '--bs',
23
+ '--bs-tablet',
24
+ '--bs-mobile',
25
+ '--radius',
26
+ '--radius-tablet',
27
+ '--radius-mobile',
28
+ '--bblr',
29
+ '--bbrr',
30
+ '--btlr',
31
+ '--btrr',
32
+ '--bblr-tablet',
33
+ '--bbrr-tablet',
34
+ '--btlr-tablet',
35
+ '--btrr-tablet',
36
+ '--bblr-mobile',
37
+ '--bbrr-mobile',
38
+ '--btlr-mobile',
39
+ '--btrr-mobile'
40
+ ];
12
41
  const isMobile = (userAgent)=>{
13
42
  if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) {
14
43
  return true;
@@ -46,6 +75,7 @@ const inheritStyleBody = {
46
75
  };
47
76
  const bodyDialogClass = 'gp-h-full gp-w-full gp-overflow-y-auto gp-overflow-x-hidden !gp-max-h-screen';
48
77
 
78
+ exports.advancedBorderStyle = advancedBorderStyle;
49
79
  exports.bodyDialogClass = bodyDialogClass;
50
80
  exports.getPropertyByDevice = getPropertyByDevice;
51
81
  exports.heightStyle = heightStyle;
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { useModalStore, useEditorMode, useInteraction, globalEvent, makeWidth, cls, makeStyle, getGlobalColorResponsiveStyle, makeStyleResponsive, composeRadius, getStyleBackgroundByDevice, isEmptyChildren, filterToolbarPreview } from '@gem-sdk/core';
3
3
  import { useMemo, useRef, useState, useCallback, useEffect } from 'react';
4
- import { isShowModal, isMobile, heightStyle, removeHeightPercentForContent, inheritStyleBody, bodyDialogClass } from '../helpers/common.js';
4
+ import { isShowModal, isMobile, advancedBorderStyle, heightStyle, removeHeightPercentForContent, inheritStyleBody, bodyDialogClass } from '../helpers/common.js';
5
5
  import { useScrollPercentage } from '../hooks/use-scroll-percentage.js';
6
6
  import ChildrenDroppable from '../../grid/components/ChildrenDroppable.js';
7
7
  import { ELEMENT_Z_INDEX } from '../../common/const.js';
@@ -247,19 +247,7 @@ const Dialog = ({ setting, children, builderProps, builderAttrs, style })=>{
247
247
  style
248
248
  ]);
249
249
  const borderStyle = useMemo(()=>{
250
- return Object.keys(style ?? {}).filter((key)=>[
251
- '--bw',
252
- '--bw-mobile',
253
- '--bw-tablet',
254
- '--bc',
255
- '--b',
256
- '--bs',
257
- '--radius',
258
- '--bblr',
259
- '--bbrr',
260
- '--btlr',
261
- '--btrr'
262
- ].includes(key)).reduce((curr, key)=>({
250
+ return Object.keys(style ?? {}).filter((key)=>advancedBorderStyle.includes(key)).reduce((curr, key)=>({
263
251
  ...curr,
264
252
  [key]: style?.[key]
265
253
  }), {});
@@ -1,6 +1,6 @@
1
1
  import { makeWidth, template, cls, RenderIf, makeStyle, getGlobalColorResponsiveStyle, makeStyleResponsive, composeRadius, getStyleBackgroundByDevice, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
2
  import { isTransparentColor } from '../../helpers.js';
3
- import { heightStyle, removeHeightPercentForContent, inheritStyleBody, bodyDialogClass } from '../helpers/common.js';
3
+ import { advancedBorderStyle, heightStyle, removeHeightPercentForContent, inheritStyleBody, bodyDialogClass } from '../helpers/common.js';
4
4
  import 'react/jsx-runtime';
5
5
  import { ELEMENT_Z_INDEX } from '../../common/const.js';
6
6
 
@@ -24,19 +24,7 @@ const Dialog = ({ setting, children, builderProps, style, advanced })=>{
24
24
  ...curr,
25
25
  [key]: style?.[key]
26
26
  }), {});
27
- const borderStyle = Object.keys(style ?? {}).filter((key)=>[
28
- '--bw',
29
- '--bw-mobile',
30
- '--bw-tablet',
31
- '--bc',
32
- '--b',
33
- '--bs',
34
- '--radius',
35
- '--bblr',
36
- '--bbrr',
37
- '--btlr',
38
- '--btrr'
39
- ].includes(key)).reduce((curr, key)=>({
27
+ const borderStyle = Object.keys(style ?? {}).filter((key)=>advancedBorderStyle.includes(key)).reduce((curr, key)=>({
40
28
  ...curr,
41
29
  [key]: style?.[key]
42
30
  }), {});
@@ -7,6 +7,35 @@ const isShowModal = (startDate, numberOfDay = 0)=>{
7
7
  const diff = Math.abs(c / 24 / 60 / 60 / 1000);
8
8
  return diff >= numberOfDay;
9
9
  };
10
+ const advancedBorderStyle = [
11
+ '--bw',
12
+ '--bw-mobile',
13
+ '--bw-tablet',
14
+ '--bc',
15
+ '--bc-tablet',
16
+ '--bc-mobile',
17
+ '--b',
18
+ '--b-tablet',
19
+ '--b-mobile',
20
+ '--bs',
21
+ '--bs-tablet',
22
+ '--bs-mobile',
23
+ '--radius',
24
+ '--radius-tablet',
25
+ '--radius-mobile',
26
+ '--bblr',
27
+ '--bbrr',
28
+ '--btlr',
29
+ '--btrr',
30
+ '--bblr-tablet',
31
+ '--bbrr-tablet',
32
+ '--btlr-tablet',
33
+ '--btrr-tablet',
34
+ '--bblr-mobile',
35
+ '--bbrr-mobile',
36
+ '--btlr-mobile',
37
+ '--btrr-mobile'
38
+ ];
10
39
  const isMobile = (userAgent)=>{
11
40
  if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) {
12
41
  return true;
@@ -44,4 +73,4 @@ const inheritStyleBody = {
44
73
  };
45
74
  const bodyDialogClass = 'gp-h-full gp-w-full gp-overflow-y-auto gp-overflow-x-hidden !gp-max-h-screen';
46
75
 
47
- export { bodyDialogClass, getPropertyByDevice, heightStyle, inheritStyleBody, isMobile, isShowModal, removeHeightPercentForContent };
76
+ export { advancedBorderStyle, bodyDialogClass, getPropertyByDevice, heightStyle, inheritStyleBody, isMobile, isShowModal, removeHeightPercentForContent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",