@cntrl-site/sdk-nextjs 0.19.1 → 0.19.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.
|
@@ -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
|
@@ -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
|
>
|