@cntrl-site/sdk-nextjs 0.19.1 → 0.19.3
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.
- package/cntrl-site-sdk-nextjs-0.19.3.tgz +0 -0
- package/lib/components/Item.js +1 -1
- package/lib/components/items/RectangleItem.js +1 -2
- package/lib/components/items/RichTextItem.js +5 -3
- package/package.json +1 -1
- package/src/components/Item.tsx +1 -1
- package/src/components/items/RectangleItem.tsx +1 -2
- package/src/components/items/RichTextItem.tsx +5 -3
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -15
|
Binary file
|
package/lib/components/Item.js
CHANGED
|
@@ -94,7 +94,7 @@ const Item = ({ item, sectionId, articleHeight }) => {
|
|
|
94
94
|
if (!layout)
|
|
95
95
|
return null;
|
|
96
96
|
const styles = {
|
|
97
|
-
top: stickyTop
|
|
97
|
+
top: `${stickyTop * 100}vw`,
|
|
98
98
|
height: isRichText && itemHeight ? `${itemHeight * 100}vw` : 'unset'
|
|
99
99
|
};
|
|
100
100
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `item-wrapper-${item.id}`, ref: itemWrapperRef, style: isInitialRef.current ? {} : Object.assign({ top, left }, (wrapperHeight !== undefined ? { height: `${wrapperHeight * 100}vw` } : {})) }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ suppressHydrationWarning: true, className: `item-${item.id}`, style: isInitialRef.current ? {} : styles }, { children: (0, jsx_runtime_1.jsx)(RichTextWrapper, Object.assign({ isRichText: isRichText }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `item-${item.id}-inner`, style: {
|
|
@@ -34,8 +34,7 @@ const RectangleItem = ({ item, sectionId, onResize }) => {
|
|
|
34
34
|
transform: `rotate(${angle}deg)`,
|
|
35
35
|
filter: blur !== 0 ? `blur(${blur * 100}vw)` : 'unset',
|
|
36
36
|
backdropFilter: backdropFilterValue,
|
|
37
|
-
|
|
38
|
-
'-webkit-backdrop-filter': backdropFilterValue,
|
|
37
|
+
WebkitBackdropFilter: backdropFilterValue,
|
|
39
38
|
} }), (0, jsx_runtime_1.jsx)(style_1.default, Object.assign({ id: id }, { children: `
|
|
40
39
|
@supports not (color: oklch(42% 0.3 90 / 1)) {
|
|
41
40
|
.rectangle-${item.id} {
|
|
@@ -15,6 +15,7 @@ const HoverStyles_1 = require("../../utils/HoverStyles/HoverStyles");
|
|
|
15
15
|
const useRichTextItemValues_1 = require("./useRichTextItemValues");
|
|
16
16
|
const useRegisterResize_1 = require("../../common/useRegisterResize");
|
|
17
17
|
const getFontFamilyValue_1 = require("../../utils/getFontFamilyValue");
|
|
18
|
+
const useExemplary_1 = require("../../common/useExemplary");
|
|
18
19
|
const RichTextItem = ({ item, sectionId, onResize }) => {
|
|
19
20
|
const [content, styles] = (0, useRichTextItem_1.useRichTextItem)(item);
|
|
20
21
|
const id = (0, react_1.useId)();
|
|
@@ -22,12 +23,13 @@ const RichTextItem = ({ item, sectionId, onResize }) => {
|
|
|
22
23
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
23
24
|
const { angle, blur, wordSpacing, letterSpacing, color } = (0, useRichTextItemValues_1.useRichTextItemValues)(item, sectionId);
|
|
24
25
|
const textColor = (0, react_1.useMemo)(() => color_1.CntrlColor.parse(color), [color]);
|
|
26
|
+
const exemplary = (0, useExemplary_1.useExemplary)();
|
|
25
27
|
(0, useRegisterResize_1.useRegisterResize)(ref, onResize);
|
|
26
28
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ ref: setRef, className: `rich-text-wrapper-${item.id}`, style: {
|
|
27
29
|
transform: `rotate(${angle}deg)`,
|
|
28
|
-
filter: `blur(${blur *
|
|
29
|
-
letterSpacing: `${letterSpacing *
|
|
30
|
-
wordSpacing: `${wordSpacing *
|
|
30
|
+
filter: `blur(${blur * exemplary}px)`,
|
|
31
|
+
letterSpacing: `${letterSpacing * exemplary}px`,
|
|
32
|
+
wordSpacing: `${wordSpacing * exemplary}px`,
|
|
31
33
|
color: `${textColor.toCss()}`
|
|
32
34
|
} }, { children: content })), (0, jsx_runtime_1.jsxs)(style_1.default, Object.assign({ id: id }, { children: [styles, `${(0, sdk_1.getLayoutStyles)(layouts, [item.state.hover], ([hoverParams]) => {
|
|
33
35
|
return (`
|
package/package.json
CHANGED
package/src/components/Item.tsx
CHANGED
|
@@ -117,7 +117,7 @@ export const Item: FC<ItemWrapperProps> = ({ item, sectionId, articleHeight }) =
|
|
|
117
117
|
|
|
118
118
|
if (!layout) return null;
|
|
119
119
|
const styles = {
|
|
120
|
-
top: stickyTop
|
|
120
|
+
top: `${stickyTop * 100}vw`,
|
|
121
121
|
height: isRichText && itemHeight ? `${itemHeight * 100}vw` : 'unset'
|
|
122
122
|
};
|
|
123
123
|
|
|
@@ -35,8 +35,7 @@ export const RectangleItem: FC<ItemProps<TRectangleItem>> = ({ item, sectionId,
|
|
|
35
35
|
transform: `rotate(${angle}deg)`,
|
|
36
36
|
filter: blur !== 0 ? `blur(${blur * 100}vw)` : 'unset',
|
|
37
37
|
backdropFilter: backdropFilterValue,
|
|
38
|
-
|
|
39
|
-
'-webkit-backdrop-filter': backdropFilterValue,
|
|
38
|
+
WebkitBackdropFilter: backdropFilterValue,
|
|
40
39
|
}}
|
|
41
40
|
/>
|
|
42
41
|
<JSXStyle id={id}>{`
|
|
@@ -9,6 +9,7 @@ import { getHoverStyles, getTransitions } from '../../utils/HoverStyles/HoverSty
|
|
|
9
9
|
import { useRichTextItemValues } from './useRichTextItemValues';
|
|
10
10
|
import { useRegisterResize } from "../../common/useRegisterResize";
|
|
11
11
|
import { getFontFamilyValue } from '../../utils/getFontFamilyValue';
|
|
12
|
+
import { useExemplary } from '../../common/useExemplary';
|
|
12
13
|
|
|
13
14
|
export const RichTextItem: FC<ItemProps<TRichTextItem>> = ({ item, sectionId, onResize }) => {
|
|
14
15
|
const [content, styles] = useRichTextItem(item);
|
|
@@ -17,6 +18,7 @@ export const RichTextItem: FC<ItemProps<TRichTextItem>> = ({ item, sectionId, on
|
|
|
17
18
|
const { layouts } = useCntrlContext();
|
|
18
19
|
const { angle, blur, wordSpacing, letterSpacing, color } = useRichTextItemValues(item, sectionId);
|
|
19
20
|
const textColor = useMemo(() => CntrlColor.parse(color), [color]);
|
|
21
|
+
const exemplary = useExemplary();
|
|
20
22
|
useRegisterResize(ref, onResize);
|
|
21
23
|
|
|
22
24
|
return (
|
|
@@ -26,9 +28,9 @@ export const RichTextItem: FC<ItemProps<TRichTextItem>> = ({ item, sectionId, on
|
|
|
26
28
|
className={`rich-text-wrapper-${item.id}`}
|
|
27
29
|
style={{
|
|
28
30
|
transform: `rotate(${angle}deg)`,
|
|
29
|
-
filter: `blur(${blur *
|
|
30
|
-
letterSpacing: `${letterSpacing *
|
|
31
|
-
wordSpacing: `${wordSpacing *
|
|
31
|
+
filter: `blur(${blur * exemplary}px)`,
|
|
32
|
+
letterSpacing: `${letterSpacing * exemplary}px`,
|
|
33
|
+
wordSpacing: `${wordSpacing * exemplary}px`,
|
|
32
34
|
color: `${textColor.toCss()}`
|
|
33
35
|
}}
|
|
34
36
|
>
|
|
@@ -1,15 +0,0 @@
|
|
|
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>
|