@gem-sdk/core 1.53.0-dev.11 → 1.53.0-dev.15

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.
@@ -12,6 +12,16 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
12
12
  if (props.type === 'section') return null;
13
13
  const style = composeAdvanceStyle.composeAdvanceStyle(props.advanced, props.tag, pageType);
14
14
  const advanced = props.advanced;
15
+ const interactionAttributes = ()=>{
16
+ let result = {};
17
+ if (props.advanced?.displayInitInteraction !== undefined) {
18
+ result = {
19
+ 'display-init': props.advanced?.displayInitInteraction === false ? 'hide' : 'show',
20
+ 'gp-interaction-wrapper': ''
21
+ };
22
+ }
23
+ return result;
24
+ };
15
25
  if (constant.disableWrap.includes(props.tag) && /*#__PURE__*/ react.isValidElement(children)) {
16
26
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
17
27
  children: [
@@ -23,7 +33,11 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
23
33
  className: advanced?.cssClass,
24
34
  ...children.props,
25
35
  style,
26
- advanced
36
+ advanced,
37
+ builderAttrs: {
38
+ ...children.props.builderAttrs,
39
+ ...interactionAttributes()
40
+ }
27
41
  })
28
42
  ]
29
43
  });
@@ -36,6 +50,7 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
36
50
  }),
37
51
  /*#__PURE__*/ jsxRuntime.jsx("div", {
38
52
  style: style,
53
+ ...interactionAttributes(),
39
54
  className: `${props.uid} ${advanced?.cssClass}`,
40
55
  children: children
41
56
  })
@@ -215,7 +215,7 @@ const RenderCustomCode = (item)=>{
215
215
  };
216
216
  const appendAnimation = (props, liquid)=>{
217
217
  const { advanced, tag } = props;
218
- const { animation, op: opacity, hasAnimationInteraction, displayInitInteraction = true } = advanced ?? {};
218
+ const { animation, op: opacity, hasAnimationInteraction, displayInitInteraction } = advanced ?? {};
219
219
  const getAnimationType = (settings, type)=>{
220
220
  return settings?.triggerConfig?.[type]?.animation ?? 'none';
221
221
  };
@@ -243,7 +243,8 @@ const appendAnimation = (props, liquid)=>{
243
243
  };
244
244
  return render.template`
245
245
  <gp-animation
246
- display-init="${!displayInitInteraction ? 'hide' : 'show'}"
246
+ gp-interaction-wrapper
247
+ display-init="${displayInitInteraction === false ? 'hide' : 'show'}"
247
248
  gp-data='${JSON.stringify({
248
249
  config: animation,
249
250
  tag,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const isLocalEnv = process.env.NEXT_CONVERT_ENV === 'local';
3
+ const isLocalEnv = true;
4
4
  const baseAssetURL = process.env.GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
5
5
 
6
6
  exports.baseAssetURL = baseAssetURL;
@@ -8,6 +8,16 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
8
8
  if (props.type === 'section') return null;
9
9
  const style = composeAdvanceStyle(props.advanced, props.tag, pageType);
10
10
  const advanced = props.advanced;
11
+ const interactionAttributes = ()=>{
12
+ let result = {};
13
+ if (props.advanced?.displayInitInteraction !== undefined) {
14
+ result = {
15
+ 'display-init': props.advanced?.displayInitInteraction === false ? 'hide' : 'show',
16
+ 'gp-interaction-wrapper': ''
17
+ };
18
+ }
19
+ return result;
20
+ };
11
21
  if (disableWrap.includes(props.tag) && /*#__PURE__*/ isValidElement(children)) {
12
22
  return /*#__PURE__*/ jsxs(Fragment, {
13
23
  children: [
@@ -19,7 +29,11 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
19
29
  className: advanced?.cssClass,
20
30
  ...children.props,
21
31
  style,
22
- advanced
32
+ advanced,
33
+ builderAttrs: {
34
+ ...children.props.builderAttrs,
35
+ ...interactionAttributes()
36
+ }
23
37
  })
24
38
  ]
25
39
  });
@@ -32,6 +46,7 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
32
46
  }),
33
47
  /*#__PURE__*/ jsx("div", {
34
48
  style: style,
49
+ ...interactionAttributes(),
35
50
  className: `${props.uid} ${advanced?.cssClass}`,
36
51
  children: children
37
52
  })
@@ -211,7 +211,7 @@ const RenderCustomCode = (item)=>{
211
211
  };
212
212
  const appendAnimation = (props, liquid)=>{
213
213
  const { advanced, tag } = props;
214
- const { animation, op: opacity, hasAnimationInteraction, displayInitInteraction = true } = advanced ?? {};
214
+ const { animation, op: opacity, hasAnimationInteraction, displayInitInteraction } = advanced ?? {};
215
215
  const getAnimationType = (settings, type)=>{
216
216
  return settings?.triggerConfig?.[type]?.animation ?? 'none';
217
217
  };
@@ -239,7 +239,8 @@ const appendAnimation = (props, liquid)=>{
239
239
  };
240
240
  return template`
241
241
  <gp-animation
242
- display-init="${!displayInitInteraction ? 'hide' : 'show'}"
242
+ gp-interaction-wrapper
243
+ display-init="${displayInitInteraction === false ? 'hide' : 'show'}"
243
244
  gp-data='${JSON.stringify({
244
245
  config: animation,
245
246
  tag,
@@ -1,4 +1,4 @@
1
- const isLocalEnv = process.env.NEXT_CONVERT_ENV === 'local';
1
+ const isLocalEnv = true;
2
2
  const baseAssetURL = process.env.GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
3
3
 
4
4
  export { baseAssetURL, isLocalEnv };
@@ -38096,7 +38096,7 @@ declare const removePaddingYInStyle: (style?: React.CSSProperties) => {
38096
38096
  vectorEffect?: csstype.Property.VectorEffect | undefined;
38097
38097
  };
38098
38098
 
38099
- declare const isLocalEnv: boolean;
38099
+ declare const isLocalEnv = true;
38100
38100
  declare const baseAssetURL: string;
38101
38101
 
38102
38102
  declare const convertHTML: (str: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.53.0-dev.11",
3
+ "version": "1.53.0-dev.15",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@gem-sdk/adapter-shopify": "1.53.0-dev.4",
31
- "@gem-sdk/styles": "1.53.0-dev.8",
31
+ "@gem-sdk/styles": "1.53.0-dev.14",
32
32
  "@types/classnames": "^2.3.1"
33
33
  },
34
34
  "dependencies": {