@cntrl-site/sdk-nextjs 1.9.53-0 → 1.9.53-1
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/lib/components/Section/Section.js +2 -1
- package/lib/components/items/CodeEmbedItem/CodeEmbedItem.js +2 -1
- package/lib/components/items/CompoundItem/CompoundChild.js +2 -1
- package/lib/components/items/CompoundItem/CompoundItem.js +2 -1
- package/lib/components/items/EmbedVideoItem/VimeoEmbed.js +2 -1
- package/lib/components/items/EmbedVideoItem/YoutubeEmbed.js +2 -1
- package/lib/components/items/FileItem/ImageItem.js +2 -1
- package/lib/components/items/FileItem/VideoItem.js +2 -1
- package/lib/components/items/GroupItem/GroupItem.js +2 -1
- package/lib/components/items/Item.js +2 -1
- package/lib/components/items/RectangleItem/RectangleItem.js +2 -1
- package/lib/components/items/RichTextItem/RichTextItem.js +2 -1
- package/package.json +1 -1
- package/src/components/Section/Section.tsx +2 -1
- package/src/components/items/CodeEmbedItem/CodeEmbedItem.tsx +2 -1
- package/src/components/items/CompoundItem/CompoundChild.tsx +2 -1
- package/src/components/items/CompoundItem/CompoundItem.tsx +2 -1
- package/src/components/items/EmbedVideoItem/VimeoEmbed.tsx +2 -1
- package/src/components/items/EmbedVideoItem/YoutubeEmbed.tsx +2 -1
- package/src/components/items/FileItem/ImageItem.tsx +2 -1
- package/src/components/items/FileItem/VideoItem.tsx +2 -1
- package/src/components/items/GroupItem/GroupItem.tsx +2 -1
- package/src/components/items/Item.tsx +2 -1
- package/src/components/items/RectangleItem/RectangleItem.tsx +2 -1
- package/src/components/items/RichTextItem/RichTextItem.tsx +2 -1
|
@@ -18,7 +18,8 @@ const checkOverflowClipSupport_1 = require("../../utils/checkOverflowClipSupport
|
|
|
18
18
|
const DEFAULT_COLOR = 'rgba(0, 0, 0, 0)';
|
|
19
19
|
const Section = ({ section, data, children, zIndex }) => {
|
|
20
20
|
var _a;
|
|
21
|
-
const
|
|
21
|
+
const reactId = (0, react_1.useId)();
|
|
22
|
+
const id = `${reactId}-section-${section.id}`;
|
|
22
23
|
const sectionRef = (0, react_1.useRef)(null);
|
|
23
24
|
const { layouts, customSections } = (0, useCntrlContext_1.useCntrlContext)();
|
|
24
25
|
const layout = (0, useLayoutContext_1.useLayoutContext)();
|
|
@@ -27,7 +27,8 @@ const stylesMap = {
|
|
|
27
27
|
};
|
|
28
28
|
const CodeEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
29
29
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
30
|
-
const
|
|
30
|
+
const reactId = (0, react_1.useId)();
|
|
31
|
+
const id = `${reactId}-codeembed-${item.id}`;
|
|
31
32
|
const { layouts, fonts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
32
33
|
const fontGoogleTags = fonts === null || fonts === void 0 ? void 0 : fonts.google;
|
|
33
34
|
const fontAdobeTags = fonts === null || fonts === void 0 ? void 0 : fonts.adobe;
|
|
@@ -25,7 +25,8 @@ const useItemArea_1 = require("../useItemArea");
|
|
|
25
25
|
const noop = () => null;
|
|
26
26
|
const CompoundChild = ({ item, sectionId, isParentVisible = true }) => {
|
|
27
27
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
28
|
-
const
|
|
28
|
+
const reactId = (0, react_1.useId)();
|
|
29
|
+
const id = `${reactId}-compound-${item.id}`;
|
|
29
30
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
30
31
|
const layout = (0, useLayoutContext_1.useLayoutContext)();
|
|
31
32
|
const exemplary = (0, useExemplary_1.useExemplary)();
|
|
@@ -19,7 +19,8 @@ const useItemGeometry_1 = require("../../../ItemGeometry/useItemGeometry");
|
|
|
19
19
|
const ItemGeometryContext_1 = require("../../../ItemGeometry/ItemGeometryContext");
|
|
20
20
|
const CompoundItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
21
21
|
var _a, _b, _c, _d, _e;
|
|
22
|
-
const
|
|
22
|
+
const reactId = (0, react_1.useId)();
|
|
23
|
+
const id = `${reactId}-compounditem-${item.id}`;
|
|
23
24
|
const { items } = item;
|
|
24
25
|
const itemIds = items ? items.map(item => item.id) : [];
|
|
25
26
|
const itemAngle = (0, useItemAngle_1.useItemAngle)(item, sectionId);
|
|
@@ -28,7 +28,8 @@ const useLayoutContext_1 = require("../../useLayoutContext");
|
|
|
28
28
|
const useItemGeometry_1 = require("../../../ItemGeometry/useItemGeometry");
|
|
29
29
|
const VimeoEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
30
30
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
31
|
-
const
|
|
31
|
+
const reactId = (0, react_1.useId)();
|
|
32
|
+
const id = `${reactId}-vimeo-${item.id}`;
|
|
32
33
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
33
34
|
const { radius: itemRadius, blur: itemBlur, opacity: itemOpacity } = (0, useEmbedVideoItem_1.useEmbedVideoItem)(item, sectionId);
|
|
34
35
|
const layoutId = (0, useLayoutContext_1.useLayoutContext)();
|
|
@@ -20,7 +20,8 @@ const useLayoutContext_1 = require("../../useLayoutContext");
|
|
|
20
20
|
const useItemGeometry_1 = require("../../../ItemGeometry/useItemGeometry");
|
|
21
21
|
const YoutubeEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
22
22
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
23
|
-
const
|
|
23
|
+
const reactId = (0, react_1.useId)();
|
|
24
|
+
const id = `${reactId}-youtube-${item.id}`;
|
|
24
25
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
25
26
|
const { url } = item.commonParams;
|
|
26
27
|
const layoutId = (0, useLayoutContext_1.useLayoutContext)();
|
|
@@ -22,7 +22,8 @@ const getFill_1 = require("../../../utils/getFill");
|
|
|
22
22
|
const useItemGeometry_1 = require("../../../ItemGeometry/useItemGeometry");
|
|
23
23
|
const ImageItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
24
24
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
25
|
-
const
|
|
25
|
+
const reactId = (0, react_1.useId)();
|
|
26
|
+
const id = `${reactId}-image-${item.id}`;
|
|
26
27
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
27
28
|
const layoutId = (0, useLayoutContext_1.useLayoutContext)();
|
|
28
29
|
const { radius: itemRadius, strokeWidth: itemStrokeWidth, opacity: itemOpacity, strokeFill: itemStrokeFill, blur: itemBlur } = (0, useFileItem_1.useFileItem)(item, sectionId);
|
|
@@ -23,7 +23,8 @@ const getFill_1 = require("../../../utils/getFill");
|
|
|
23
23
|
const useItemGeometry_1 = require("../../../ItemGeometry/useItemGeometry");
|
|
24
24
|
const VideoItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
25
25
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
26
|
-
const
|
|
26
|
+
const reactId = (0, react_1.useId)();
|
|
27
|
+
const id = `${reactId}-video-${item.id}`;
|
|
27
28
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
28
29
|
const layoutId = (0, useLayoutContext_1.useLayoutContext)();
|
|
29
30
|
const { radius: itemRadius, strokeWidth: itemStrokeWidth, strokeFill: itemStrokeFill, opacity: itemOpacity, blur: itemBlur } = (0, useFileItem_1.useFileItem)(item, sectionId);
|
|
@@ -20,7 +20,8 @@ const useItemGeometry_1 = require("../../../ItemGeometry/useItemGeometry");
|
|
|
20
20
|
const ItemGeometryContext_1 = require("../../../ItemGeometry/ItemGeometryContext");
|
|
21
21
|
const GroupItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange, isInCompound }) => {
|
|
22
22
|
var _a, _b, _c, _d, _e, _f;
|
|
23
|
-
const
|
|
23
|
+
const reactId = (0, react_1.useId)();
|
|
24
|
+
const id = `${reactId}-group-${item.id}`;
|
|
24
25
|
const { items } = item;
|
|
25
26
|
const itemIds = items ? items.map(item => item.id) : [];
|
|
26
27
|
const itemAngle = (0, useItemAngle_1.useItemAngle)(item, sectionId);
|
|
@@ -40,7 +40,8 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
|
|
|
40
40
|
const itemInnerRef = (0, react_1.useRef)(null);
|
|
41
41
|
const rectObserver = (0, react_1.useContext)(ArticleRectContext_1.ArticleRectContext);
|
|
42
42
|
const keyframesRepo = (0, react_1.useContext)(KeyframesContext_1.KeyframesContext);
|
|
43
|
-
const
|
|
43
|
+
const reactId = (0, react_1.useId)();
|
|
44
|
+
const id = `${reactId}-item-${item.id}`;
|
|
44
45
|
const keyframes = (0, react_1.useMemo)(() => keyframesRepo.getItemKeyframes(item.id), [keyframesRepo, item.id]);
|
|
45
46
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
46
47
|
const layout = (0, useLayoutContext_1.useLayoutContext)();
|
|
@@ -20,7 +20,8 @@ const areFillsVisible_1 = require("../../../utils/areFillsVisible/areFillsVisibl
|
|
|
20
20
|
const useItemGeometry_1 = require("../../../ItemGeometry/useItemGeometry");
|
|
21
21
|
const RectangleItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
22
22
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
23
|
-
const
|
|
23
|
+
const reactId = (0, react_1.useId)();
|
|
24
|
+
const id = `${reactId}-rect-${item.id}`;
|
|
24
25
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
25
26
|
const { fill: itemFill, radius: itemRadius, strokeWidth: itemStrokeWidth, strokeFill: itemStrokeFill, blur: itemBlur, backdropBlur: itemBackdropBlur } = (0, useRectangleItem_1.useRectangleItem)(item, sectionId);
|
|
26
27
|
const itemAngle = (0, useItemAngle_1.useItemAngle)(item, sectionId);
|
|
@@ -22,7 +22,8 @@ const useItemGeometry_1 = require("../../../ItemGeometry/useItemGeometry");
|
|
|
22
22
|
const RichTextGeometryController_1 = require("../../../ItemGeometry/RichTextGeometryController");
|
|
23
23
|
const RichTextItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
24
24
|
var _a, _b, _c, _d;
|
|
25
|
-
const
|
|
25
|
+
const reactId = (0, react_1.useId)();
|
|
26
|
+
const id = `${reactId}-richtext-${item.id}`;
|
|
26
27
|
const [ref, setRef] = (0, react_1.useState)(null);
|
|
27
28
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
28
29
|
const itemAngle = (0, useItemAngle_1.useItemAngle)(item, sectionId);
|
package/package.json
CHANGED
|
@@ -26,7 +26,8 @@ interface Props {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const Section: FC<Props> = ({ section, data, children, zIndex }) => {
|
|
29
|
-
const
|
|
29
|
+
const reactId = useId();
|
|
30
|
+
const id = `${reactId}-section-${section.id}`;
|
|
30
31
|
const sectionRef = useRef<HTMLDivElement | null>(null);
|
|
31
32
|
const { layouts, customSections } = useCntrlContext();
|
|
32
33
|
const layout = useLayoutContext();
|
|
@@ -22,7 +22,8 @@ const stylesMap = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const CodeEmbedItem: FC<ItemProps<TCodeEmbedItem>> = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
25
|
-
const
|
|
25
|
+
const reactId = useId();
|
|
26
|
+
const id = `${reactId}-codeembed-${item.id}`;
|
|
26
27
|
const { layouts, fonts } = useCntrlContext();
|
|
27
28
|
const fontGoogleTags = fonts?.google;
|
|
28
29
|
const fontAdobeTags = fonts?.adobe;
|
|
@@ -36,7 +36,8 @@ interface ChildItemProps {
|
|
|
36
36
|
const noop = () => null;
|
|
37
37
|
|
|
38
38
|
export const CompoundChild: FC<ChildItemProps> = ({ item, sectionId, isParentVisible = true }) => {
|
|
39
|
-
const
|
|
39
|
+
const reactId = useId();
|
|
40
|
+
const id = `${reactId}-compound-${item.id}`;
|
|
40
41
|
const { layouts } = useCntrlContext();
|
|
41
42
|
const layout = useLayoutContext();
|
|
42
43
|
const exemplary = useExemplary();
|
|
@@ -13,7 +13,8 @@ import { useItemGeometry } from '../../../ItemGeometry/useItemGeometry';
|
|
|
13
13
|
import { ItemGeometryContext } from '../../../ItemGeometry/ItemGeometryContext';
|
|
14
14
|
|
|
15
15
|
export const CompoundItem: FC<ItemProps<TCompoundItem>> = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
16
|
-
const
|
|
16
|
+
const reactId = useId();
|
|
17
|
+
const id = `${reactId}-compounditem-${item.id}`;
|
|
17
18
|
const { items } = item;
|
|
18
19
|
const itemIds = items ? items.map(item => item.id) : [];
|
|
19
20
|
const itemAngle = useItemAngle(item, sectionId);
|
|
@@ -15,7 +15,8 @@ import { useLayoutContext } from '../../useLayoutContext';
|
|
|
15
15
|
import { useItemGeometry } from '../../../ItemGeometry/useItemGeometry';
|
|
16
16
|
|
|
17
17
|
export const VimeoEmbedItem: FC<ItemProps<TVimeoEmbedItem>> = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
18
|
-
const
|
|
18
|
+
const reactId = useId();
|
|
19
|
+
const id = `${reactId}-vimeo-${item.id}`;
|
|
19
20
|
const { layouts } = useCntrlContext();
|
|
20
21
|
const {
|
|
21
22
|
radius: itemRadius,
|
|
@@ -15,7 +15,8 @@ import { useLayoutContext } from '../../useLayoutContext';
|
|
|
15
15
|
import { useItemGeometry } from '../../../ItemGeometry/useItemGeometry';
|
|
16
16
|
|
|
17
17
|
export const YoutubeEmbedItem: FC<ItemProps<TYoutubeEmbedItem>> = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
18
|
-
const
|
|
18
|
+
const reactId = useId();
|
|
19
|
+
const id = `${reactId}-youtube-${item.id}`;
|
|
19
20
|
const { layouts } = useCntrlContext();
|
|
20
21
|
const { url } = item.commonParams;
|
|
21
22
|
const layoutId = useLayoutContext();
|
|
@@ -16,7 +16,8 @@ import { getFill } from '../../../utils/getFill';
|
|
|
16
16
|
import { useItemGeometry } from '../../../ItemGeometry/useItemGeometry';
|
|
17
17
|
|
|
18
18
|
export const ImageItem: FC<ItemProps<TImageItem>> = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
19
|
-
const
|
|
19
|
+
const reactId = useId();
|
|
20
|
+
const id = `${reactId}-image-${item.id}`;
|
|
20
21
|
const { layouts } = useCntrlContext();
|
|
21
22
|
const layoutId = useLayoutContext();
|
|
22
23
|
const {
|
|
@@ -17,7 +17,8 @@ import { getFill } from '../../../utils/getFill';
|
|
|
17
17
|
import { useItemGeometry } from '../../../ItemGeometry/useItemGeometry';
|
|
18
18
|
|
|
19
19
|
export const VideoItem: FC<ItemProps<TVideoItem>> = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
20
|
-
const
|
|
20
|
+
const reactId = useId();
|
|
21
|
+
const id = `${reactId}-video-${item.id}`;
|
|
21
22
|
const { layouts } = useCntrlContext();
|
|
22
23
|
const layoutId = useLayoutContext();
|
|
23
24
|
const {
|
|
@@ -13,7 +13,8 @@ import { useItemGeometry } from '../../../ItemGeometry/useItemGeometry';
|
|
|
13
13
|
import { ItemGeometryContext } from '../../../ItemGeometry/ItemGeometryContext';
|
|
14
14
|
|
|
15
15
|
export const GroupItem: FC<ItemProps<TGroupItem>> = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange, isInCompound }) => {
|
|
16
|
-
const
|
|
16
|
+
const reactId = useId();
|
|
17
|
+
const id = `${reactId}-group-${item.id}`;
|
|
17
18
|
const { items } = item;
|
|
18
19
|
const itemIds = items ? items.map(item => item.id) : [];
|
|
19
20
|
const itemAngle = useItemAngle(item, sectionId);
|
|
@@ -68,7 +68,8 @@ export const Item: FC<ItemWrapperProps> = ({ item, sectionId, articleHeight, isP
|
|
|
68
68
|
const itemInnerRef = useRef<HTMLDivElement | null>(null);
|
|
69
69
|
const rectObserver = useContext(ArticleRectContext);
|
|
70
70
|
const keyframesRepo = useContext(KeyframesContext);
|
|
71
|
-
const
|
|
71
|
+
const reactId = useId();
|
|
72
|
+
const id = `${reactId}-item-${item.id}`;
|
|
72
73
|
const keyframes = useMemo(() => keyframesRepo.getItemKeyframes(item.id), [keyframesRepo, item.id]);
|
|
73
74
|
const { layouts } = useCntrlContext();
|
|
74
75
|
const layout = useLayoutContext();
|
|
@@ -14,7 +14,8 @@ import { areFillsVisible } from '../../../utils/areFillsVisible/areFillsVisible'
|
|
|
14
14
|
import { useItemGeometry } from '../../../ItemGeometry/useItemGeometry';
|
|
15
15
|
|
|
16
16
|
export const RectangleItem: FC<ItemProps<TRectangleItem>> = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
17
|
-
const
|
|
17
|
+
const reactId = useId();
|
|
18
|
+
const id = `${reactId}-rect-${item.id}`;
|
|
18
19
|
const { layouts } = useCntrlContext();
|
|
19
20
|
const {
|
|
20
21
|
fill: itemFill,
|
|
@@ -16,7 +16,8 @@ import { useItemGeometry } from '../../../ItemGeometry/useItemGeometry';
|
|
|
16
16
|
import { RichTextGeometryController } from '../../../ItemGeometry/RichTextGeometryController';
|
|
17
17
|
|
|
18
18
|
export const RichTextItem: FC<ItemProps<TRichTextItem>> = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
|
|
19
|
-
const
|
|
19
|
+
const reactId = useId();
|
|
20
|
+
const id = `${reactId}-richtext-${item.id}`;
|
|
20
21
|
const [ref, setRef] = useState<HTMLDivElement | null>(null);
|
|
21
22
|
const { layouts } = useCntrlContext();
|
|
22
23
|
const itemAngle = useItemAngle(item, sectionId);
|