@cntrl-site/sdk-nextjs 1.2.1 → 1.2.2

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.
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,15 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="myValues">
6
+ <value>
7
+ <list size="1">
8
+ <item index="0" class="java.lang.String" itemvalue="jsx" />
9
+ </list>
10
+ </value>
11
+ </option>
12
+ <option name="myCustomValuesEnabled" value="true" />
13
+ </inspection_tool>
14
+ </profile>
15
+ </component>
@@ -94,7 +94,10 @@ const VimeoEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibili
94
94
  const isInteractive = opacity !== 0;
95
95
  (0, react_1.useEffect)(() => {
96
96
  onVisibilityChange === null || onVisibilityChange === void 0 ? void 0 : onVisibilityChange(isInteractive);
97
- }, [isInteractive, onVisibilityChange]);
97
+ if (!isInteractive && vimeoPlayer) {
98
+ vimeoPlayer.pause();
99
+ }
100
+ }, [isInteractive, onVisibilityChange, vimeoPlayer]);
98
101
  return ((0, jsx_runtime_1.jsxs)(LinkWrapper_1.LinkWrapper, { url: (_e = item.link) === null || _e === void 0 ? void 0 : _e.url, target: (_f = item.link) === null || _f === void 0 ? void 0 : _f.target, children: [(0, jsx_runtime_1.jsxs)("div", { className: `embed-video-wrapper-${item.id}`, ref: setRef, style: Object.assign(Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), { transition: (_g = wrapperStateParams === null || wrapperStateParams === void 0 ? void 0 : wrapperStateParams.transition) !== null && _g !== void 0 ? _g : 'none' }), onMouseEnter: () => {
99
102
  if (!vimeoPlayer || play !== 'on-hover')
100
103
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk-nextjs",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "SDK for Next.js",
5
5
  "author": "arsen@momdesign.nyc",
6
6
  "license": "MIT",
@@ -87,7 +87,10 @@ export const VimeoEmbedItem: FC<ItemProps<TVimeoEmbedItem>> = ({ item, sectionId
87
87
  const isInteractive = opacity !== 0;
88
88
  useEffect(() => {
89
89
  onVisibilityChange?.(isInteractive);
90
- }, [isInteractive, onVisibilityChange]);
90
+ if (!isInteractive && vimeoPlayer) {
91
+ vimeoPlayer.pause();
92
+ }
93
+ }, [isInteractive, onVisibilityChange, vimeoPlayer]);
91
94
 
92
95
  return (
93
96
  <LinkWrapper url={item.link?.url} target={item.link?.target}>
Binary file