@cntrl-site/sdk-nextjs 0.19.0 → 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.
@@ -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>
@@ -23,9 +23,14 @@ const CustomItem = ({ item, onResize }) => {
23
23
  return (`
24
24
  .custom-component-${item.id} {
25
25
  transition: ${(0, HoverStyles_1.getTransitions)(['angle'], hoverParams)};
26
+ height: 100%;
27
+ width: 100%;
28
+ position: absolute;
29
+ left: 0;
30
+ top: 0;
26
31
  }
27
32
  .custom-component-${item.id}:hover {
28
- ${(0, HoverStyles_1.getHoverStyles)(['angle'], hoverParams)}
33
+ ${(0, HoverStyles_1.getHoverStyles)(['angle'], hoverParams)};
29
34
  }
30
35
  `);
31
36
  })}` }))] }));
@@ -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
- // @ts-ignore
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 * 100}vw)`,
29
- letterSpacing: `${letterSpacing * 100}vw`,
30
- wordSpacing: `${wordSpacing * 100}vw`,
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk-nextjs",
3
- "version": "0.19.0",
3
+ "version": "0.19.2",
4
4
  "description": "SDK for Next.js",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/index.ts",
@@ -21,9 +21,14 @@ export const CustomItem: FC<ItemProps<TCustomItem>> = ({ item, onResize }) => {
21
21
  return (`
22
22
  .custom-component-${item.id} {
23
23
  transition: ${getTransitions<ArticleItemType.Custom>(['angle'], hoverParams)};
24
+ height: 100%;
25
+ width: 100%;
26
+ position: absolute;
27
+ left: 0;
28
+ top: 0;
24
29
  }
25
30
  .custom-component-${item.id}:hover {
26
- ${getHoverStyles<ArticleItemType.Custom>(['angle'], hoverParams)}
31
+ ${getHoverStyles<ArticleItemType.Custom>(['angle'], hoverParams)};
27
32
  }
28
33
  `);
29
34
  })}`}
@@ -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
- // @ts-ignore
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 * 100}vw)`,
30
- letterSpacing: `${letterSpacing * 100}vw`,
31
- wordSpacing: `${wordSpacing * 100}vw`,
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
  >