@cntrl-site/sdk-nextjs 1.9.80 → 1.9.82-alpha.0

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.
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseSizing = exports.useSizing = void 0;
4
- const isItemType_1 = require("../../utils/isItemType");
5
- const sdk_1 = require("@cntrl-site/sdk");
6
4
  const useLayoutContext_1 = require("../useLayoutContext");
7
5
  function useSizing(item) {
8
6
  const layout = (0, useLayoutContext_1.useLayoutContext)();
9
- const sizing = layout && (0, isItemType_1.isItemType)(item, sdk_1.ArticleItemType.RichText)
10
- ? item.layoutParams[layout].sizing
7
+ const layoutParams = layout ? item.layoutParams[layout] : undefined;
8
+ const sizing = layoutParams && 'sizing' in layoutParams
9
+ ? layoutParams.sizing
11
10
  : undefined;
12
11
  const sizingAxis = parseSizing(sizing);
13
12
  return sizingAxis;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk-nextjs",
3
- "version": "1.9.80",
3
+ "version": "1.9.82-alpha.0",
4
4
  "description": "SDK for Next.js",
5
5
  "author": "arsen@momdesign.nyc",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@antfu/eslint-config": "^3.8.0",
33
33
  "@cntrl-site/color": "^1.0.0",
34
- "@cntrl-site/components": "^1.0.23",
34
+ "@cntrl-site/components": "^1.0.25-alpha.0",
35
35
  "@cntrl-site/effects": "^1.4.2",
36
36
  "@cntrl-site/sdk": "^1.28.0",
37
37
  "@types/vimeo__player": "^2.18.0",
@@ -1,11 +1,11 @@
1
- import { isItemType } from '../../utils/isItemType';
2
- import { ArticleItemType, ItemAny } from '@cntrl-site/sdk';
1
+ import { ItemAny } from '@cntrl-site/sdk';
3
2
  import { useLayoutContext } from '../useLayoutContext';
4
3
 
5
4
  export function useSizing(item: ItemAny) {
6
5
  const layout = useLayoutContext();
7
- const sizing = layout && isItemType(item, ArticleItemType.RichText)
8
- ? item.layoutParams[layout].sizing
6
+ const layoutParams = layout ? item.layoutParams[layout] : undefined;
7
+ const sizing = layoutParams && 'sizing' in layoutParams
8
+ ? layoutParams.sizing
9
9
  : undefined;
10
10
  const sizingAxis = parseSizing(sizing);
11
11
  return sizingAxis;
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
- </state>
5
- </component>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/sdk-nextjs.iml" filepath="$PROJECT_DIR$/.idea/sdk-nextjs.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>