@gem-sdk/components 2.0.0-dev.466 → 2.0.0-dev.468

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.
@@ -62,6 +62,11 @@ const ArticleContent = ({ styles, builderProps })=>{
62
62
  ...core.getGlobalColorStateStyle('c', styles?.color),
63
63
  ...core.makeStyleResponsive('ta', styles?.textAlign),
64
64
  ...hasLineClamp && !open ? core.makeStyleResponsive('line-clamp', styles?.lineClamp) : {},
65
+ ...core.getStyleShadow({
66
+ value: styles?.typo?.custom?.textShadow,
67
+ styleAppliedFor: 'text-shadow',
68
+ isEnableShadow: styles?.typo?.custom?.hasShadowText
69
+ }),
65
70
  ...core.makeStyle({
66
71
  tt: styles?.transform
67
72
  }),
@@ -19,7 +19,12 @@ const ArticleContent = ({ styles, builderProps })=>{
19
19
  };
20
20
  const collapseStyle = {
21
21
  ...defaultStyle,
22
- ...core.makeStyleResponsive('line-clamp', core.makeLineClamp(styles?.lineClamp, styles?.hasLineClamp))
22
+ ...core.makeStyleResponsive('line-clamp', core.makeLineClamp(styles?.lineClamp, styles?.hasLineClamp)),
23
+ ...core.getStyleShadow({
24
+ value: styles?.typo?.custom?.textShadow,
25
+ styleAppliedFor: 'text-shadow',
26
+ isEnableShadow: styles?.typo?.custom?.hasShadowText
27
+ })
23
28
  };
24
29
  return core.template`
25
30
  <gp-article-content data-id="${builderProps?.uid}" >
@@ -11,12 +11,13 @@ const uiV2 = [
11
11
  en: 'Prefix'
12
12
  },
13
13
  getValueFromSettingID: 'prefix',
14
+ iconName: 'gp-prefix',
14
15
  type: 'combo',
15
16
  defaultValueWhenClear: '',
16
17
  controls: [
17
18
  {
18
19
  label: {
19
- en: 'Content'
20
+ en: 'Prefix'
20
21
  },
21
22
  type: 'control',
22
23
  setting: {
@@ -21,10 +21,7 @@ const ArticleDatePresets = [
21
21
  },
22
22
  styles: {
23
23
  typo: {
24
- type: 'paragraph-3',
25
- attrs: {
26
- color: '#212121'
27
- }
24
+ type: 'paragraph-3'
28
25
  }
29
26
  }
30
27
  }
@@ -180,7 +180,7 @@ const uiV2 = [
180
180
  },
181
181
  {
182
182
  label: {
183
- en: 'Quality'
183
+ en: 'Optimize LCP'
184
184
  },
185
185
  controls: [
186
186
  {
@@ -194,7 +194,7 @@ const uiV2 = [
194
194
  {
195
195
  layout: 'horizontal',
196
196
  label: {
197
- en: ' '
197
+ en: 'Quality'
198
198
  },
199
199
  conditionDisplay: 'qualityType == "custom"',
200
200
  setting: {
@@ -55,21 +55,21 @@ const uiV2 = [
55
55
  noRecordHistory: true
56
56
  }
57
57
  }
58
- },
58
+ }
59
+ ]
60
+ },
61
+ {
62
+ label: {
63
+ en: 'SEO'
64
+ },
65
+ controls: [
59
66
  {
60
67
  label: {
61
- en: 'SEO'
68
+ en: 'HTML tag'
62
69
  },
63
- controls: [
64
- {
65
- label: {
66
- en: 'HTML tag'
67
- },
68
- setting: {
69
- id: 'htmlTag'
70
- }
71
- }
72
- ]
70
+ setting: {
71
+ id: 'htmlTag'
72
+ }
73
73
  }
74
74
  ]
75
75
  }
@@ -57,7 +57,7 @@ const BaseVariant = (props)=>{
57
57
  return core.template`
58
58
  <div
59
59
  class="${wrapperTextClasses}"
60
- style="${isColorType ? getColorStyleLiquid() : ''} ${wrapperTextStyle}">
60
+ style="${isColorType ? getColorStyleLiquid() : ''} ${_function.getStyleOfObject(wrapperTextStyle)}">
61
61
  ${system.If(isUploadImageType, `<svg width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="2" fill="#D6D6D6"></circle><path d="M0.196854 10.6453L2.40968 8.05946C2.4846 7.97175 2.57719 7.9008 2.68141 7.85124C2.78562 7.80168 2.89913 7.77461 3.01452 7.77181C3.12991 7.76902 3.2446 7.79055 3.3511 7.835C3.45761 7.87945 3.55353 7.94583 3.63262 8.02981L4.66733 9.12714L8.71205 4.29464C8.79123 4.19995 8.89077 4.1243 9.00325 4.07333C9.11573 4.02236 9.23827 3.99737 9.36176 4.00022C9.48524 4.00307 9.6065 4.03369 9.71651 4.08979C9.82651 4.1459 9.92245 4.22605 9.99717 4.32429L14.8329 10.6772C14.9254 10.7989 14.982 10.9441 14.9964 11.0962C15.0107 11.2484 14.9823 11.4016 14.9144 11.5385C14.8464 11.6754 14.7415 11.7907 14.6115 11.8713C14.4815 11.952 14.3316 11.9948 14.1786 11.995L0.822048 12C0.664945 11.9999 0.511148 11.9549 0.378853 11.8703C0.246557 11.7857 0.141299 11.6649 0.0755311 11.5224C0.00976323 11.3799 -0.013762 11.2216 0.00773837 11.0661C0.0292388 10.9107 0.0948652 10.7646 0.196854 10.6453Z" fill="#D6D6D6"></path></svg>`, ' ')}
62
62
  <span class="${textClasses}" style="${textStyle}">{{value}}</span>
63
63
  </div>
@@ -185,15 +185,6 @@ const SettingUIV2 = [
185
185
  state: 'normal'
186
186
  }
187
187
  },
188
- {
189
- label: {
190
- en: 'Has Shadow'
191
- },
192
- setting: {
193
- id: 'optionHasShadow',
194
- state: 'active'
195
- }
196
- },
197
188
  {
198
189
  label: {
199
190
  en: 'Shadow'
@@ -359,7 +350,6 @@ const SettingUIV2 = [
359
350
  label: {
360
351
  en: 'Sold out style'
361
352
  },
362
- conditionDisplay: "optionType !== 'groupOption'",
363
353
  controls: [
364
354
  {
365
355
  label: {
@@ -386,6 +376,84 @@ const SettingUIV2 = [
386
376
  }
387
377
  ]
388
378
  },
379
+ {
380
+ label: {
381
+ en: 'Shape'
382
+ },
383
+ controls: [
384
+ {
385
+ label: {
386
+ en: 'Border'
387
+ },
388
+ setting: {
389
+ id: 'border',
390
+ state: 'normal'
391
+ }
392
+ },
393
+ {
394
+ label: {
395
+ en: 'Corner'
396
+ },
397
+ setting: {
398
+ id: 'rounded',
399
+ state: 'normal'
400
+ }
401
+ },
402
+ {
403
+ label: {
404
+ en: 'Shadow'
405
+ },
406
+ setting: {
407
+ id: 'boxShadow',
408
+ state: 'normal'
409
+ },
410
+ options: {
411
+ updateFields: [
412
+ {
413
+ field: 'enable',
414
+ settingId: 'advanced.hasBoxShadow',
415
+ state: 'normal'
416
+ }
417
+ ]
418
+ },
419
+ controlChangeTrigger: {
420
+ settings: [
421
+ {
422
+ condition: `boxShadow.normal.enable === true`,
423
+ source: [
424
+ 'boxShadow',
425
+ 'hasBoxShadow'
426
+ ],
427
+ action: {
428
+ controlId: 'hasBoxShadow',
429
+ groupType: 'advanced',
430
+ controlType: 'advanced',
431
+ state: 'normal',
432
+ newValue: true
433
+ }
434
+ },
435
+ {
436
+ condition: `boxShadow.normal.enable === false`,
437
+ source: [
438
+ 'boxShadow',
439
+ 'hasBoxShadow'
440
+ ],
441
+ action: {
442
+ controlId: 'hasBoxShadow',
443
+ groupType: 'advanced',
444
+ controlType: 'advanced',
445
+ state: 'normal',
446
+ newValue: false
447
+ }
448
+ }
449
+ ],
450
+ options: {
451
+ noRecordHistory: true
452
+ }
453
+ }
454
+ }
455
+ ]
456
+ },
389
457
  {
390
458
  label: {
391
459
  en: 'Display condition'
@@ -439,7 +507,7 @@ const SettingUIV2 = [
439
507
  options: {
440
508
  labelVariant: 'primary',
441
509
  fullWidth: true,
442
- disableMessage: `Align is not supported when width is 100%`
510
+ disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
443
511
  }
444
512
  }
445
513
  ]
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
- import { useArticleStore, useCurrentDevice, getResponsiveValueByScreen, composeTypographyClassName, composeTypographyStyle, isSafari, cls, getGlobalColorStateStyle, makeStyleResponsive, makeStyle } from '@gem-sdk/core';
3
+ import { useArticleStore, useCurrentDevice, getResponsiveValueByScreen, composeTypographyClassName, composeTypographyStyle, isSafari, cls, getGlobalColorStateStyle, makeStyleResponsive, getStyleShadow, makeStyle } from '@gem-sdk/core';
4
4
  import { useState, useRef, useEffect } from 'react';
5
5
 
6
6
  const ArticleContent = ({ styles, builderProps })=>{
@@ -58,6 +58,11 @@ const ArticleContent = ({ styles, builderProps })=>{
58
58
  ...getGlobalColorStateStyle('c', styles?.color),
59
59
  ...makeStyleResponsive('ta', styles?.textAlign),
60
60
  ...hasLineClamp && !open ? makeStyleResponsive('line-clamp', styles?.lineClamp) : {},
61
+ ...getStyleShadow({
62
+ value: styles?.typo?.custom?.textShadow,
63
+ styleAppliedFor: 'text-shadow',
64
+ isEnableShadow: styles?.typo?.custom?.hasShadowText
65
+ }),
61
66
  ...makeStyle({
62
67
  tt: styles?.transform
63
68
  }),
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { composeTypographyClassName, composeTypographyStyle, makeStyleResponsive, getGlobalColorStateStyle, makeStyle, makeLineClamp, template, cls, getGlobalColorStateClass, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
+ import { composeTypographyClassName, composeTypographyStyle, makeStyleResponsive, getGlobalColorStateStyle, makeStyle, makeLineClamp, getStyleShadow, template, cls, getGlobalColorStateClass, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
3
3
  import { getSettingPreloadData } from '../../helpers.js';
4
4
 
5
5
  const ArticleContent = ({ styles, builderProps })=>{
@@ -15,7 +15,12 @@ const ArticleContent = ({ styles, builderProps })=>{
15
15
  };
16
16
  const collapseStyle = {
17
17
  ...defaultStyle,
18
- ...makeStyleResponsive('line-clamp', makeLineClamp(styles?.lineClamp, styles?.hasLineClamp))
18
+ ...makeStyleResponsive('line-clamp', makeLineClamp(styles?.lineClamp, styles?.hasLineClamp)),
19
+ ...getStyleShadow({
20
+ value: styles?.typo?.custom?.textShadow,
21
+ styleAppliedFor: 'text-shadow',
22
+ isEnableShadow: styles?.typo?.custom?.hasShadowText
23
+ })
19
24
  };
20
25
  return template`
21
26
  <gp-article-content data-id="${builderProps?.uid}" >
@@ -9,12 +9,13 @@ const uiV2 = [
9
9
  en: 'Prefix'
10
10
  },
11
11
  getValueFromSettingID: 'prefix',
12
+ iconName: 'gp-prefix',
12
13
  type: 'combo',
13
14
  defaultValueWhenClear: '',
14
15
  controls: [
15
16
  {
16
17
  label: {
17
- en: 'Content'
18
+ en: 'Prefix'
18
19
  },
19
20
  type: 'control',
20
21
  setting: {
@@ -19,10 +19,7 @@ const ArticleDatePresets = [
19
19
  },
20
20
  styles: {
21
21
  typo: {
22
- type: 'paragraph-3',
23
- attrs: {
24
- color: '#212121'
25
- }
22
+ type: 'paragraph-3'
26
23
  }
27
24
  }
28
25
  }
@@ -178,7 +178,7 @@ const uiV2 = [
178
178
  },
179
179
  {
180
180
  label: {
181
- en: 'Quality'
181
+ en: 'Optimize LCP'
182
182
  },
183
183
  controls: [
184
184
  {
@@ -192,7 +192,7 @@ const uiV2 = [
192
192
  {
193
193
  layout: 'horizontal',
194
194
  label: {
195
- en: ' '
195
+ en: 'Quality'
196
196
  },
197
197
  conditionDisplay: 'qualityType == "custom"',
198
198
  setting: {
@@ -53,21 +53,21 @@ const uiV2 = [
53
53
  noRecordHistory: true
54
54
  }
55
55
  }
56
- },
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ label: {
61
+ en: 'SEO'
62
+ },
63
+ controls: [
57
64
  {
58
65
  label: {
59
- en: 'SEO'
66
+ en: 'HTML tag'
60
67
  },
61
- controls: [
62
- {
63
- label: {
64
- en: 'HTML tag'
65
- },
66
- setting: {
67
- id: 'htmlTag'
68
- }
69
- }
70
- ]
68
+ setting: {
69
+ id: 'htmlTag'
70
+ }
71
71
  }
72
72
  ]
73
73
  }
@@ -53,7 +53,7 @@ const BaseVariant = (props)=>{
53
53
  return template`
54
54
  <div
55
55
  class="${wrapperTextClasses}"
56
- style="${isColorType ? getColorStyleLiquid() : ''} ${wrapperTextStyle}">
56
+ style="${isColorType ? getColorStyleLiquid() : ''} ${getStyleOfObject(wrapperTextStyle)}">
57
57
  ${If(isUploadImageType, `<svg width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="2" fill="#D6D6D6"></circle><path d="M0.196854 10.6453L2.40968 8.05946C2.4846 7.97175 2.57719 7.9008 2.68141 7.85124C2.78562 7.80168 2.89913 7.77461 3.01452 7.77181C3.12991 7.76902 3.2446 7.79055 3.3511 7.835C3.45761 7.87945 3.55353 7.94583 3.63262 8.02981L4.66733 9.12714L8.71205 4.29464C8.79123 4.19995 8.89077 4.1243 9.00325 4.07333C9.11573 4.02236 9.23827 3.99737 9.36176 4.00022C9.48524 4.00307 9.6065 4.03369 9.71651 4.08979C9.82651 4.1459 9.92245 4.22605 9.99717 4.32429L14.8329 10.6772C14.9254 10.7989 14.982 10.9441 14.9964 11.0962C15.0107 11.2484 14.9823 11.4016 14.9144 11.5385C14.8464 11.6754 14.7415 11.7907 14.6115 11.8713C14.4815 11.952 14.3316 11.9948 14.1786 11.995L0.822048 12C0.664945 11.9999 0.511148 11.9549 0.378853 11.8703C0.246557 11.7857 0.141299 11.6649 0.0755311 11.5224C0.00976323 11.3799 -0.013762 11.2216 0.00773837 11.0661C0.0292388 10.9107 0.0948652 10.7646 0.196854 10.6453Z" fill="#D6D6D6"></path></svg>`, ' ')}
58
58
  <span class="${textClasses}" style="${textStyle}">{{value}}</span>
59
59
  </div>
@@ -183,15 +183,6 @@ const SettingUIV2 = [
183
183
  state: 'normal'
184
184
  }
185
185
  },
186
- {
187
- label: {
188
- en: 'Has Shadow'
189
- },
190
- setting: {
191
- id: 'optionHasShadow',
192
- state: 'active'
193
- }
194
- },
195
186
  {
196
187
  label: {
197
188
  en: 'Shadow'
@@ -357,7 +348,6 @@ const SettingUIV2 = [
357
348
  label: {
358
349
  en: 'Sold out style'
359
350
  },
360
- conditionDisplay: "optionType !== 'groupOption'",
361
351
  controls: [
362
352
  {
363
353
  label: {
@@ -384,6 +374,84 @@ const SettingUIV2 = [
384
374
  }
385
375
  ]
386
376
  },
377
+ {
378
+ label: {
379
+ en: 'Shape'
380
+ },
381
+ controls: [
382
+ {
383
+ label: {
384
+ en: 'Border'
385
+ },
386
+ setting: {
387
+ id: 'border',
388
+ state: 'normal'
389
+ }
390
+ },
391
+ {
392
+ label: {
393
+ en: 'Corner'
394
+ },
395
+ setting: {
396
+ id: 'rounded',
397
+ state: 'normal'
398
+ }
399
+ },
400
+ {
401
+ label: {
402
+ en: 'Shadow'
403
+ },
404
+ setting: {
405
+ id: 'boxShadow',
406
+ state: 'normal'
407
+ },
408
+ options: {
409
+ updateFields: [
410
+ {
411
+ field: 'enable',
412
+ settingId: 'advanced.hasBoxShadow',
413
+ state: 'normal'
414
+ }
415
+ ]
416
+ },
417
+ controlChangeTrigger: {
418
+ settings: [
419
+ {
420
+ condition: `boxShadow.normal.enable === true`,
421
+ source: [
422
+ 'boxShadow',
423
+ 'hasBoxShadow'
424
+ ],
425
+ action: {
426
+ controlId: 'hasBoxShadow',
427
+ groupType: 'advanced',
428
+ controlType: 'advanced',
429
+ state: 'normal',
430
+ newValue: true
431
+ }
432
+ },
433
+ {
434
+ condition: `boxShadow.normal.enable === false`,
435
+ source: [
436
+ 'boxShadow',
437
+ 'hasBoxShadow'
438
+ ],
439
+ action: {
440
+ controlId: 'hasBoxShadow',
441
+ groupType: 'advanced',
442
+ controlType: 'advanced',
443
+ state: 'normal',
444
+ newValue: false
445
+ }
446
+ }
447
+ ],
448
+ options: {
449
+ noRecordHistory: true
450
+ }
451
+ }
452
+ }
453
+ ]
454
+ },
387
455
  {
388
456
  label: {
389
457
  en: 'Display condition'
@@ -437,7 +505,7 @@ const SettingUIV2 = [
437
505
  options: {
438
506
  labelVariant: 'primary',
439
507
  fullWidth: true,
440
- disableMessage: `Align is not supported when width is 100%`
508
+ disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
441
509
  }
442
510
  }
443
511
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.466",
3
+ "version": "2.0.0-dev.468",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -23,7 +23,7 @@
23
23
  "update-img-src-3rd": "node ./scripts/update-img-src-3rd.js"
24
24
  },
25
25
  "devDependencies": {
26
- "@gem-sdk/core": "2.0.0-dev.464",
26
+ "@gem-sdk/core": "2.0.0-dev.468",
27
27
  "@gem-sdk/styles": "2.0.0-dev.464",
28
28
  "@gem-sdk/system": "2.0.0-dev.464",
29
29
  "@types/react-transition-group": "^4.4.5"