@cntrl-site/sdk-nextjs 1.9.79 → 1.9.81
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
|
|
10
|
-
|
|
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.
|
|
3
|
+
"version": "1.9.81",
|
|
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.
|
|
34
|
+
"@cntrl-site/components": "^1.0.24",
|
|
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 {
|
|
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
|
|
8
|
-
|
|
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;
|