@gem-sdk/components 2.5.11 → 2.5.13

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.
@@ -23,6 +23,16 @@ const Coupon = ({ setting, builderProps, builderAttrs, style, styles, advanced,
23
23
  hover: styles?.hasBoxShadowBtn?.hover,
24
24
  normal: styles?.hasBoxShadowBtn?.normal
25
25
  };
26
+ const handleSetDefaultState = ()=>{
27
+ setCurrentState({
28
+ backgroundColor,
29
+ textColor,
30
+ roundedBtn,
31
+ borderBtn,
32
+ boxShadowBtn
33
+ });
34
+ setDefaultLabelState(defaultLabel);
35
+ };
26
36
  const changeStateILP = ()=>{
27
37
  setDefaultLabelState(clickedLabel);
28
38
  navigator.clipboard.writeText(copyContent ?? '').catch(function(error) {
@@ -56,16 +66,20 @@ const Coupon = ({ setting, builderProps, builderAttrs, style, styles, advanced,
56
66
  } : currentState.boxShadowBtn
57
67
  });
58
68
  setTimeout(()=>{
59
- setDefaultLabelState(defaultLabel);
60
- setCurrentState({
61
- backgroundColor,
62
- textColor,
63
- roundedBtn,
64
- borderBtn,
65
- boxShadowBtn
66
- });
69
+ handleSetDefaultState();
67
70
  }, 1000);
68
71
  };
72
+ React.useEffect(()=>{
73
+ handleSetDefaultState();
74
+ // eslint-disable-next-line react-hooks/exhaustive-deps
75
+ }, [
76
+ backgroundColor,
77
+ textColor,
78
+ roundedBtn,
79
+ borderBtn,
80
+ boxShadowBtn,
81
+ defaultLabel
82
+ ]);
69
83
  return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
70
84
  children: /*#__PURE__*/ jsxRuntime.jsx(Button.default, {
71
85
  builderProps: builderProps,
@@ -47,6 +47,11 @@ const config = {
47
47
  type: 'input',
48
48
  default: ''
49
49
  },
50
+ {
51
+ id: 'productHandle',
52
+ type: 'product-handle',
53
+ hide: true
54
+ },
50
55
  {
51
56
  id: 'widgetType',
52
57
  label: 'Choose widget',
@@ -47,6 +47,11 @@ const config = {
47
47
  type: 'input',
48
48
  default: ''
49
49
  },
50
+ {
51
+ id: 'productHandle',
52
+ type: 'product-handle',
53
+ hide: true
54
+ },
50
55
  {
51
56
  id: 'install',
52
57
  type: 'open-link',
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { useEditorMode } from '@gem-sdk/core';
3
3
  import Button from '../../button/components/Button.js';
4
- import { useState } from 'react';
4
+ import { useState, useEffect } from 'react';
5
5
 
6
6
  const Coupon = ({ setting, builderProps, builderAttrs, style, styles, advanced, children })=>{
7
7
  const mode = useEditorMode();
@@ -19,6 +19,16 @@ const Coupon = ({ setting, builderProps, builderAttrs, style, styles, advanced,
19
19
  hover: styles?.hasBoxShadowBtn?.hover,
20
20
  normal: styles?.hasBoxShadowBtn?.normal
21
21
  };
22
+ const handleSetDefaultState = ()=>{
23
+ setCurrentState({
24
+ backgroundColor,
25
+ textColor,
26
+ roundedBtn,
27
+ borderBtn,
28
+ boxShadowBtn
29
+ });
30
+ setDefaultLabelState(defaultLabel);
31
+ };
22
32
  const changeStateILP = ()=>{
23
33
  setDefaultLabelState(clickedLabel);
24
34
  navigator.clipboard.writeText(copyContent ?? '').catch(function(error) {
@@ -52,16 +62,20 @@ const Coupon = ({ setting, builderProps, builderAttrs, style, styles, advanced,
52
62
  } : currentState.boxShadowBtn
53
63
  });
54
64
  setTimeout(()=>{
55
- setDefaultLabelState(defaultLabel);
56
- setCurrentState({
57
- backgroundColor,
58
- textColor,
59
- roundedBtn,
60
- borderBtn,
61
- boxShadowBtn
62
- });
65
+ handleSetDefaultState();
63
66
  }, 1000);
64
67
  };
68
+ useEffect(()=>{
69
+ handleSetDefaultState();
70
+ // eslint-disable-next-line react-hooks/exhaustive-deps
71
+ }, [
72
+ backgroundColor,
73
+ textColor,
74
+ roundedBtn,
75
+ borderBtn,
76
+ boxShadowBtn,
77
+ defaultLabel
78
+ ]);
65
79
  return /*#__PURE__*/ jsx(Fragment, {
66
80
  children: /*#__PURE__*/ jsx(Button, {
67
81
  builderProps: builderProps,
@@ -43,6 +43,11 @@ const config = {
43
43
  type: 'input',
44
44
  default: ''
45
45
  },
46
+ {
47
+ id: 'productHandle',
48
+ type: 'product-handle',
49
+ hide: true
50
+ },
46
51
  {
47
52
  id: 'widgetType',
48
53
  label: 'Choose widget',
@@ -43,6 +43,11 @@ const config = {
43
43
  type: 'input',
44
44
  default: ''
45
45
  },
46
+ {
47
+ id: 'productHandle',
48
+ type: 'product-handle',
49
+ hide: true
50
+ },
46
51
  {
47
52
  id: 'install',
48
53
  type: 'open-link',
@@ -2456,6 +2456,7 @@ type RechargeSubscriptionsProps = BaseProps<{
2456
2456
  align?: ObjectDevices<AlignProp>;
2457
2457
  openApp?: any;
2458
2458
  install?: any;
2459
+ productHandle?: string;
2459
2460
  }>;
2460
2461
  declare const RechargeSubscriptions$1: React.FC<RechargeSubscriptionsProps>;
2461
2462
 
@@ -2986,6 +2987,7 @@ type SubifySubscriptionsAppProps = BaseProps<{
2986
2987
  install?: any;
2987
2988
  appBlockId?: string;
2988
2989
  widgetType?: string;
2990
+ productHandle?: string;
2989
2991
  }>;
2990
2992
  declare const SubifySubscriptionsApp$1: React.FC<SubifySubscriptionsAppProps>;
2991
2993
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.5.11",
3
+ "version": "2.5.13",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -21,7 +21,7 @@
21
21
  "format": "prettier --write \"./src/**/*.{ts,tsx}\""
22
22
  },
23
23
  "devDependencies": {
24
- "@gem-sdk/core": "2.5.11",
24
+ "@gem-sdk/core": "2.5.12",
25
25
  "@gem-sdk/styles": "2.4.8",
26
26
  "@types/react-transition-group": "^4.4.5"
27
27
  },