@cntrl-site/components 0.0.1 → 0.0.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.
Files changed (156) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +2 -2
  3. package/dist/{sdk/Components → Components}/ControlSlider/ControlSlider.d.ts +1 -1
  4. package/dist/{sdk/Components → Components}/ControlSlider/ControlSliderComponent.d.ts +9 -12
  5. package/dist/{sdk/Components → Components}/ImageRevealSlider/ControlImageRevealSliderComponent.d.ts +9 -0
  6. package/dist/{sdk/Components → Components}/ImageRevealSlider/ImageRevealSlider.d.ts +1 -1
  7. package/dist/Components/components.d.ts +2 -0
  8. package/dist/components.css +1 -1
  9. package/dist/index.d.ts +2 -33
  10. package/dist/index.js +81 -6401
  11. package/dist/index.mjs +73 -6376
  12. package/package.json +68 -92
  13. package/dist/cli.d.ts +0 -10
  14. package/dist/sdk/Client/Client.d.ts +0 -32
  15. package/dist/sdk/Client/Client.test.d.ts +0 -1
  16. package/dist/sdk/Client/__mock__/articleMock.d.ts +0 -2
  17. package/dist/sdk/Client/__mock__/keyframesMock.d.ts +0 -2
  18. package/dist/sdk/Client/__mock__/projectMock.d.ts +0 -2
  19. package/dist/sdk/Components/components.d.ts +0 -2
  20. package/dist/sdk/FontFaceGenerator/FontFaceGenerator.d.ts +0 -6
  21. package/dist/sdk/FontFaceGenerator/FontFaceGenerator.test.d.ts +0 -1
  22. package/dist/sdk/ScrollPlaybackVideoManager/ScrollPlaybackVideoManager.d.ts +0 -31
  23. package/dist/sdk/VideoDecoder/VideoDecoder.d.ts +0 -12
  24. package/dist/sdk/schemas/article/Article.schema.d.ts +0 -328
  25. package/dist/sdk/schemas/article/FillLayer.schema.d.ts +0 -186
  26. package/dist/sdk/schemas/article/Interaction.schema.d.ts +0 -103
  27. package/dist/sdk/schemas/article/Item.schema.d.ts +0 -40
  28. package/dist/sdk/schemas/article/ItemArea.schema.d.ts +0 -36
  29. package/dist/sdk/schemas/article/ItemBase.schema.d.ts +0 -137
  30. package/dist/sdk/schemas/article/ItemState.schema.d.ts +0 -15723
  31. package/dist/sdk/schemas/article/RichTextItem.schema.d.ts +0 -1372
  32. package/dist/sdk/schemas/article/Section.schema.d.ts +0 -176
  33. package/dist/sdk/schemas/keyframe/Keyframes.schema.d.ts +0 -2000
  34. package/dist/sdk/schemas/project/Layout.schema.d.ts +0 -17
  35. package/dist/sdk/schemas/project/Project.schema.d.ts +0 -253
  36. package/dist/sdk/schemas/shared/FillLayer.schema.d.ts +0 -186
  37. package/dist/sdk/types/article/Article.d.ts +0 -7
  38. package/dist/sdk/types/article/ArticleItemType.d.ts +0 -13
  39. package/dist/sdk/types/article/CompoundSettings.d.ts +0 -6
  40. package/dist/sdk/types/article/FX.d.ts +0 -23
  41. package/dist/sdk/types/article/Interaction.d.ts +0 -28
  42. package/dist/sdk/types/article/Item.d.ts +0 -250
  43. package/dist/sdk/types/article/ItemArea.d.ts +0 -36
  44. package/dist/sdk/types/article/ItemState.d.ts +0 -78
  45. package/dist/sdk/types/article/RichText.d.ts +0 -40
  46. package/dist/sdk/types/article/Section.d.ts +0 -37
  47. package/dist/sdk/types/keyframe/Keyframe.d.ts +0 -86
  48. package/dist/sdk/types/project/Fonts.d.ts +0 -22
  49. package/dist/sdk/types/project/Layout.d.ts +0 -6
  50. package/dist/sdk/types/project/Meta.d.ts +0 -9
  51. package/dist/sdk/types/project/Page.d.ts +0 -11
  52. package/dist/sdk/types/project/Project.d.ts +0 -17
  53. package/dist/sdk-nextjs/common/useCurrentLayout.d.ts +0 -6
  54. package/dist/sdk-nextjs/common/useExemplary.d.ts +0 -1
  55. package/dist/sdk-nextjs/common/useItemFXData.d.ts +0 -8
  56. package/dist/sdk-nextjs/common/useKeyframeValue.d.ts +0 -8
  57. package/dist/sdk-nextjs/common/useRegisterResize.d.ts +0 -1
  58. package/dist/sdk-nextjs/components/Article.d.ts +0 -9
  59. package/dist/sdk-nextjs/components/ArticleWrapper.d.ts +0 -2
  60. package/dist/sdk-nextjs/components/Head.d.ts +0 -9
  61. package/dist/sdk-nextjs/components/LayoutStyle.d.ts +0 -9
  62. package/dist/sdk-nextjs/components/Page.d.ts +0 -15
  63. package/dist/sdk-nextjs/components/ScrollPlaybackVideo.d.ts +0 -14
  64. package/dist/sdk-nextjs/components/Section/Section.d.ts +0 -11
  65. package/dist/sdk-nextjs/components/Section/SectionImage.d.ts +0 -14
  66. package/dist/sdk-nextjs/components/Section/SectionVideo.d.ts +0 -17
  67. package/dist/sdk-nextjs/components/Section/useSectionColor.d.ts +0 -4
  68. package/dist/sdk-nextjs/components/Section/useSectionHeightMap.d.ts +0 -3
  69. package/dist/sdk-nextjs/components/items/CodeEmbedItem/CodeEmbedItem.d.ts +0 -5
  70. package/dist/sdk-nextjs/components/items/CodeEmbedItem/useCodeEmbedItem.d.ts +0 -7
  71. package/dist/sdk-nextjs/components/items/ComponentItem/ComponentItem.d.ts +0 -4
  72. package/dist/sdk-nextjs/components/items/ComponentItem/useComponentItem.d.ts +0 -5
  73. package/dist/sdk-nextjs/components/items/CompoundItem/CompoundChild.d.ts +0 -9
  74. package/dist/sdk-nextjs/components/items/CompoundItem/CompoundItem.d.ts +0 -4
  75. package/dist/sdk-nextjs/components/items/CompoundItem/useCompoundItem.d.ts +0 -4
  76. package/dist/sdk-nextjs/components/items/CustomItem/CustomItem.d.ts +0 -4
  77. package/dist/sdk-nextjs/components/items/EmbedVideoItem/VimeoEmbed.d.ts +0 -4
  78. package/dist/sdk-nextjs/components/items/EmbedVideoItem/YoutubeEmbed.d.ts +0 -4
  79. package/dist/sdk-nextjs/components/items/EmbedVideoItem/useEmbedVideoItem.d.ts +0 -6
  80. package/dist/sdk-nextjs/components/items/FileItem/ImageItem.d.ts +0 -4
  81. package/dist/sdk-nextjs/components/items/FileItem/VideoItem.d.ts +0 -4
  82. package/dist/sdk-nextjs/components/items/FileItem/useFileItem.d.ts +0 -8
  83. package/dist/sdk-nextjs/components/items/GroupItem/GroupItem.d.ts +0 -4
  84. package/dist/sdk-nextjs/components/items/GroupItem/useGroupItem.d.ts +0 -5
  85. package/dist/sdk-nextjs/components/items/Item.d.ts +0 -20
  86. package/dist/sdk-nextjs/components/items/LinkWrapper.d.ts +0 -8
  87. package/dist/sdk-nextjs/components/items/RectangleItem/RectangleItem.d.ts +0 -4
  88. package/dist/sdk-nextjs/components/items/RectangleItem/useRectangleItem.d.ts +0 -9
  89. package/dist/sdk-nextjs/components/items/RichTextItem/RichTextItem.d.ts +0 -4
  90. package/dist/sdk-nextjs/components/items/RichTextItem/useRichTextItem.d.ts +0 -3
  91. package/dist/sdk-nextjs/components/items/RichTextWrapper.d.ts +0 -7
  92. package/dist/sdk-nextjs/components/items/itemsMap.d.ts +0 -4
  93. package/dist/sdk-nextjs/components/items/useDraggable.d.ts +0 -17
  94. package/dist/sdk-nextjs/components/items/useItemAngle.d.ts +0 -2
  95. package/dist/sdk-nextjs/components/items/useItemArea.d.ts +0 -12
  96. package/dist/sdk-nextjs/components/items/useItemPointerEvents.d.ts +0 -4
  97. package/dist/sdk-nextjs/components/items/useItemScale.d.ts +0 -2
  98. package/dist/sdk-nextjs/components/items/useItemTriggers.d.ts +0 -6
  99. package/dist/sdk-nextjs/components/items/useRichTextItemValues.d.ts +0 -9
  100. package/dist/sdk-nextjs/components/items/useSizing.d.ts +0 -8
  101. package/dist/sdk-nextjs/components/items/useStickyItemTop.d.ts +0 -2
  102. package/dist/sdk-nextjs/components/useLayoutContext.d.ts +0 -1
  103. package/dist/sdk-nextjs/interactions/CSSPropertyNameMap.d.ts +0 -4
  104. package/dist/sdk-nextjs/interactions/InteractionsRegistry.d.ts +0 -39
  105. package/dist/sdk-nextjs/interactions/ItemInteractionCtrl.d.ts +0 -21
  106. package/dist/sdk-nextjs/interactions/getTransition.d.ts +0 -9
  107. package/dist/sdk-nextjs/interactions/types.d.ts +0 -34
  108. package/dist/sdk-nextjs/interactions/useItemInteractionCtrl.d.ts +0 -2
  109. package/dist/sdk-nextjs/provider/ArticleRectContext.d.ts +0 -2
  110. package/dist/sdk-nextjs/provider/CntrlContext.d.ts +0 -2
  111. package/dist/sdk-nextjs/provider/CntrlProvider.d.ts +0 -2
  112. package/dist/sdk-nextjs/provider/CntrlSdkContext.d.ts +0 -31
  113. package/dist/sdk-nextjs/provider/CustomItemRegistry.d.ts +0 -6
  114. package/dist/sdk-nextjs/provider/CustomItemTypes.d.ts +0 -2
  115. package/dist/sdk-nextjs/provider/CustomSectionRegistry.d.ts +0 -15
  116. package/dist/sdk-nextjs/provider/InteractionsContext.d.ts +0 -10
  117. package/dist/sdk-nextjs/provider/Keyframes.d.ts +0 -6
  118. package/dist/sdk-nextjs/provider/KeyframesContext.d.ts +0 -2
  119. package/dist/sdk-nextjs/provider/LayoutContext.d.ts +0 -1
  120. package/dist/sdk-nextjs/provider/WebGLContextManagerContext.d.ts +0 -2
  121. package/dist/sdk-nextjs/provider/defaultContext.d.ts +0 -2
  122. package/dist/sdk-nextjs/provider/useCntrlContext.d.ts +0 -2
  123. package/dist/sdk-nextjs/utils/Animator/Animator.d.ts +0 -43
  124. package/dist/sdk-nextjs/utils/ArticleRectManager/ArticleRectObserver.d.ts +0 -25
  125. package/dist/sdk-nextjs/utils/ArticleRectManager/useArticleRectObserver.d.ts +0 -2
  126. package/dist/sdk-nextjs/utils/ArticleRectManager/useSectionRegistry.d.ts +0 -1
  127. package/dist/sdk-nextjs/utils/EventEmitter.d.ts +0 -11
  128. package/dist/sdk-nextjs/utils/RichTextConverter/RichTextConverter.d.ts +0 -11
  129. package/dist/sdk-nextjs/utils/ScaleAnchorMap.d.ts +0 -11
  130. package/dist/sdk-nextjs/utils/StickyManager/StickyManager.d.ts +0 -10
  131. package/dist/sdk-nextjs/utils/Youtube/YouTubeIframeApiLoader.d.ts +0 -10
  132. package/dist/sdk-nextjs/utils/Youtube/YoutubeIframeApi.d.ts +0 -89
  133. package/dist/sdk-nextjs/utils/Youtube/useYouTubeIframeApi.d.ts +0 -2
  134. package/dist/sdk-nextjs/utils/areFillsVisible/areFillsVisible.d.ts +0 -23
  135. package/dist/sdk-nextjs/utils/areFillsVisible/areFillsVisible.test.d.ts +0 -1
  136. package/dist/sdk-nextjs/utils/binSearchInsertAt.d.ts +0 -5
  137. package/dist/sdk-nextjs/utils/castObject.d.ts +0 -5
  138. package/dist/sdk-nextjs/utils/checkOverflowClipSupport.d.ts +0 -1
  139. package/dist/sdk-nextjs/utils/effects/useImageFx.d.ts +0 -7
  140. package/dist/sdk-nextjs/utils/effects/useVideoFx.d.ts +0 -7
  141. package/dist/sdk-nextjs/utils/getAnchoredItemTop.d.ts +0 -2
  142. package/dist/sdk-nextjs/utils/getCompoundBoundaryStyles.d.ts +0 -12
  143. package/dist/sdk-nextjs/utils/getFill.d.ts +0 -2
  144. package/dist/sdk-nextjs/utils/getFontFamilyValue.d.ts +0 -1
  145. package/dist/sdk-nextjs/utils/getInvertedRanges.d.ts +0 -10
  146. package/dist/sdk-nextjs/utils/getItemTopStyle.d.ts +0 -2
  147. package/dist/sdk-nextjs/utils/getStyleFromItemStateAndParams.d.ts +0 -1
  148. package/dist/sdk-nextjs/utils/getValidYoutubeUrl.d.ts +0 -1
  149. package/dist/sdk-nextjs/utils/isItemType.d.ts +0 -3
  150. package/dist/sdk-nextjs/utils/rangeMap.d.ts +0 -1
  151. package/dist/sdk-nextjs/utils/useElementRect.d.ts +0 -1
  152. package/dist/utils.d.ts +0 -3
  153. /package/dist/{sdk/Components → Components}/helpers/RichTextRenderer/RichTextRenderer.d.ts +0 -0
  154. /package/dist/{sdk/Components → Components}/helpers/SvgImage/SvgImage.d.ts +0 -0
  155. /package/dist/{sdk/Components → Components}/utils/scalingValue.d.ts +0 -0
  156. /package/dist/{sdk/types/component → types}/Component.d.ts +0 -0
@@ -1,14 +0,0 @@
1
- import { default as React, FC } from 'react';
2
- type PlaybackParams = {
3
- from: number;
4
- to: number;
5
- };
6
- interface Props {
7
- sectionId: string;
8
- src: string;
9
- playbackParams: PlaybackParams | null;
10
- style?: React.CSSProperties;
11
- className: string;
12
- }
13
- export declare const ScrollPlaybackVideo: FC<Props>;
14
- export {};
@@ -1,11 +0,0 @@
1
- import { FC, ReactElement } from 'react';
2
- import { SectionHeight, Section as TSection } from '../../../sdk/types/article/Section';
3
- type SectionChild = ReactElement<any, any>;
4
- interface Props {
5
- section: TSection;
6
- children: SectionChild[];
7
- data?: any;
8
- }
9
- export declare const Section: FC<Props>;
10
- export declare function getSectionHeight(heightData: SectionHeight): string;
11
- export {};
@@ -1,14 +0,0 @@
1
- import { FC } from 'react';
2
- export type TSectionImage = {
3
- url: string;
4
- type: 'image';
5
- size: string;
6
- position: string;
7
- offsetX: number | null;
8
- };
9
- interface Props {
10
- media: TSectionImage;
11
- sectionId: string;
12
- }
13
- export declare const SectionImage: FC<Props>;
14
- export {};
@@ -1,17 +0,0 @@
1
- import { FC } from 'react';
2
- export type TSectionVideo = {
3
- url: string;
4
- size: string;
5
- type: 'video';
6
- play: 'on-click' | 'auto';
7
- position: string;
8
- coverUrl: string | null;
9
- offsetX: number | null;
10
- };
11
- interface Props {
12
- container: HTMLDivElement;
13
- sectionId: string;
14
- media: TSectionVideo;
15
- }
16
- export declare const SectionVideo: FC<Props>;
17
- export {};
@@ -1,4 +0,0 @@
1
- import { CntrlColor } from '@cntrl-site/color';
2
- type LayoutIdentifier = string;
3
- export declare const useSectionColor: (colorData: Record<LayoutIdentifier, string | null>) => CntrlColor;
4
- export {};
@@ -1,3 +0,0 @@
1
- import { SectionHeight } from '../../../sdk/types/article/Section';
2
- export declare const useSectionHeightData: (sectionId: string) => Record<string, string>;
3
- export declare function getSectionHeightMap(sectionHeight: Record<string, SectionHeight>): Record<string, string>;
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemProps } from '../Item';
3
- import { CodeEmbedItem as TCodeEmbedItem } from '../../../../sdk/types/article/Item';
4
- export declare const CodeEmbedItem: FC<ItemProps<TCodeEmbedItem>>;
5
- export declare function decodeBase64(str: string): string;
@@ -1,7 +0,0 @@
1
- import { CodeEmbedItem } from '../../../../sdk/types/article/Item';
2
- import { AreaAnchor } from '../../../../sdk/types/article/ItemArea';
3
- export declare function useCodeEmbedItem(item: CodeEmbedItem, sectionId: string): {
4
- anchor: AreaAnchor;
5
- blur: number | undefined;
6
- opacity: number | undefined;
7
- };
@@ -1,4 +0,0 @@
1
- import { ItemProps } from '../Item';
2
- import { FC } from 'react';
3
- import { ComponentItem as TComponentItem } from '../../../../sdk/types/article/Item';
4
- export declare const ComponentItem: FC<ItemProps<TComponentItem>>;
@@ -1,5 +0,0 @@
1
- import { ComponentItem } from '../../../../sdk/types/article/Item';
2
- export declare function useComponentItem(item: ComponentItem, sectionId: string): {
3
- opacity: number | undefined;
4
- blur: number | undefined;
5
- };
@@ -1,9 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemAny } from '../../../../sdk/types/article/Item';
3
- interface ChildItemProps {
4
- item: ItemAny;
5
- sectionId: string;
6
- isParentVisible?: boolean;
7
- }
8
- export declare const CompoundChild: FC<ChildItemProps>;
9
- export {};
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemProps } from '../Item';
3
- import { CompoundItem as TCompoundItem } from '../../../../sdk/types/article/Item';
4
- export declare const CompoundItem: FC<ItemProps<TCompoundItem>>;
@@ -1,4 +0,0 @@
1
- import { CompoundItem } from '../../../../sdk/types/article/Item';
2
- export declare function useCompoundItem(item: CompoundItem, sectionId: string): {
3
- opacity: number | undefined;
4
- };
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemProps } from '../Item';
3
- import { CustomItem as TCustomItem } from '../../../../sdk/types/article/Item';
4
- export declare const CustomItem: FC<ItemProps<TCustomItem>>;
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemProps } from '../Item';
3
- import { VimeoEmbedItem as TVimeoEmbedItem } from '../../../../sdk/types/article/Item';
4
- export declare const VimeoEmbedItem: FC<ItemProps<TVimeoEmbedItem>>;
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemProps } from '../Item';
3
- import { YoutubeEmbedItem as TYoutubeEmbedItem } from '../../../../sdk/types/article/Item';
4
- export declare const YoutubeEmbedItem: FC<ItemProps<TYoutubeEmbedItem>>;
@@ -1,6 +0,0 @@
1
- import { VimeoEmbedItem, YoutubeEmbedItem } from '../../../../sdk/types/article/Item';
2
- export declare const useEmbedVideoItem: (item: VimeoEmbedItem | YoutubeEmbedItem, sectionId: string) => {
3
- radius: number | undefined;
4
- blur: number | undefined;
5
- opacity: number | undefined;
6
- };
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemProps } from '../Item';
3
- import { ImageItem as TImageItem } from '../../../../sdk/types/article/Item';
4
- export declare const ImageItem: FC<ItemProps<TImageItem>>;
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemProps } from '../Item';
3
- import { VideoItem as TVideoItem } from '../../../../sdk/types/article/Item';
4
- export declare const VideoItem: FC<ItemProps<TVideoItem>>;
@@ -1,8 +0,0 @@
1
- import { ImageItem, VideoItem } from '../../../../sdk/types/article/Item';
2
- export declare function useFileItem(item: ImageItem | VideoItem, sectionId: string): {
3
- radius: number | undefined;
4
- strokeWidth: number | undefined;
5
- opacity: number | undefined;
6
- strokeFill: import('../../../../sdk/types/article/Item').FillLayer[] | undefined;
7
- blur: number | undefined;
8
- };
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemProps } from '../Item';
3
- import { GroupItem as TGroupItem } from '../../../../sdk/types/article/Item';
4
- export declare const GroupItem: FC<ItemProps<TGroupItem>>;
@@ -1,5 +0,0 @@
1
- import { GroupItem } from '../../../../sdk/types/article/Item';
2
- export declare function useGroupItem(item: GroupItem, sectionId: string): {
3
- opacity: number | undefined;
4
- blur: number | undefined;
5
- };
@@ -1,20 +0,0 @@
1
- import { FC } from 'react';
2
- import { useItemInteractionCtrl } from '../../interactions/useItemInteractionCtrl';
3
- import { ItemAny } from '../../../sdk/types/article/Item';
4
- export interface ItemProps<I extends ItemAny> {
5
- item: I;
6
- sectionId: string;
7
- articleHeight?: number;
8
- onResize?: (height: number) => void;
9
- interactionCtrl?: ReturnType<typeof useItemInteractionCtrl>;
10
- onVisibilityChange: (isVisible: boolean) => void;
11
- isInCompound?: boolean;
12
- }
13
- export interface ItemWrapperProps {
14
- item: ItemAny;
15
- sectionId: string;
16
- articleHeight?: number;
17
- isInGroup?: boolean;
18
- isParentVisible?: boolean;
19
- }
20
- export declare const Item: FC<ItemWrapperProps>;
@@ -1,8 +0,0 @@
1
- import { default as React, ReactElement, ReactNode } from 'react';
2
- interface Props {
3
- url?: string;
4
- children: ReactElement | ReactNode[];
5
- target?: string;
6
- }
7
- export declare const LinkWrapper: React.FC<Props>;
8
- export {};
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { ItemProps } from '../Item';
3
- import { RectangleItem as TRectangleItem } from '../../../../sdk/types/article/Item';
4
- export declare const RectangleItem: FC<ItemProps<TRectangleItem>>;
@@ -1,9 +0,0 @@
1
- import { FillLayer, RectangleItem } from '../../../../sdk/types/article/Item';
2
- export declare function useRectangleItem(item: RectangleItem, sectionId: string): {
3
- fill: FillLayer[] | undefined;
4
- strokeWidth: number | undefined;
5
- radius: number | undefined;
6
- strokeFill: FillLayer[] | undefined;
7
- blur: number | undefined;
8
- backdropBlur: number | undefined;
9
- };
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { RichTextItem as TRichTextItem } from '../../../../sdk/types/article/Item';
3
- import { ItemProps } from '../Item';
4
- export declare const RichTextItem: FC<ItemProps<TRichTextItem>>;
@@ -1,3 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { RichTextItem } from '../../../../sdk/types/article/Item';
3
- export declare const useRichTextItem: (item: RichTextItem) => [ReactNode[], string];
@@ -1,7 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- interface RTWrapperProps {
3
- isRichText: boolean;
4
- transformOrigin?: string;
5
- }
6
- export declare const RichTextWrapper: FC<PropsWithChildren<RTWrapperProps>>;
7
- export {};
@@ -1,4 +0,0 @@
1
- import { ComponentType } from 'react';
2
- import { ItemProps } from './Item';
3
- import { ArticleItemType } from '../../../sdk/types/article/ArticleItemType';
4
- export declare const itemsMap: Record<ArticleItemType, ComponentType<ItemProps<any>>>;
@@ -1,17 +0,0 @@
1
- export declare function useDraggable(data: {
2
- draggableRef: HTMLElement | null | undefined;
3
- isEnabled: boolean;
4
- }, dragHandler?: DragHandler, preventDragOnChildren?: boolean): void;
5
- interface DragState {
6
- drag: boolean;
7
- startX: number;
8
- startY: number;
9
- currentX: number;
10
- currentY: number;
11
- pivotX: number;
12
- pivotY: number;
13
- lastX: number;
14
- lastY: number;
15
- }
16
- type DragHandler = (state: DragState, prevState?: DragState) => void;
17
- export {};
@@ -1,2 +0,0 @@
1
- import { ItemAny } from '../../../sdk/types/article/Item';
2
- export declare const useItemAngle: (item: ItemAny, sectionId: string) => number | undefined;
@@ -1,12 +0,0 @@
1
- import { ItemAny } from '../../../sdk/types/article/Item';
2
- export declare function useItemArea(item: ItemAny, sectionId: string, stateValues: {
3
- top?: number;
4
- left?: number;
5
- width?: number;
6
- height?: number;
7
- }): {
8
- width: number | undefined;
9
- height: number | undefined;
10
- top: number | undefined;
11
- left: number | undefined;
12
- };
@@ -1,4 +0,0 @@
1
- export declare function useItemPointerEvents(pointerEvents: 'never' | 'when_visible' | 'always', isParentVisible: boolean): {
2
- allowPointerEvents: boolean;
3
- handleVisibilityChange: (isVisible: boolean) => void;
4
- };
@@ -1,2 +0,0 @@
1
- import { ItemAny } from '../../../sdk/types/article/Item';
2
- export declare const useItemScale: (item: ItemAny, sectionId: string) => number | undefined;
@@ -1,6 +0,0 @@
1
- import { ItemInteractionCtrl } from '../../interactions/types';
2
- export declare function useItemTriggers(interactionCtrl: ItemInteractionCtrl | undefined): {
3
- onClick: () => void;
4
- onMouseEnter: () => void;
5
- onMouseLeave: () => void;
6
- };
@@ -1,9 +0,0 @@
1
- import { RichTextItem } from '../../../sdk/types/article/Item';
2
- export declare const useRichTextItemValues: (item: RichTextItem, sectionId: string) => {
3
- blur: number | undefined;
4
- letterSpacing: number | undefined;
5
- wordSpacing: number | undefined;
6
- color: string | undefined;
7
- fontSize: number | undefined;
8
- lineHeight: number | undefined;
9
- };
@@ -1,8 +0,0 @@
1
- import { ItemAny } from '../../../sdk/types/article/Item';
2
- export declare function useSizing(item: ItemAny): Axis;
3
- export declare function parseSizing(sizing?: string): Axis;
4
- interface Axis {
5
- x: 'manual' | 'auto';
6
- y: 'manual' | 'auto';
7
- }
8
- export {};
@@ -1,2 +0,0 @@
1
- import { ItemAny } from '../../../sdk/types/article/Item';
2
- export declare function useStickyItemTop(item: ItemAny, sectionId: string, stateTop?: number): number;
@@ -1 +0,0 @@
1
- export declare function useLayoutContext(): string | undefined;
@@ -1,4 +0,0 @@
1
- import { ArticleItemType } from '../../sdk/types/article/ArticleItemType';
2
- import { ItemState } from '../../sdk/types/article/ItemState';
3
- export declare const CSSPropertyNameMap: Record<keyof ItemState<ArticleItemType>, string>;
4
- export declare function getStyleKeysFromCSSProperty(cssProp: string): string[];
@@ -1,39 +0,0 @@
1
- import { InteractionsRegistryPort, ItemInteractionCtrl } from './types';
2
- import { InteractionItemTrigger } from '../../sdk/types/article/Interaction';
3
- import { Article } from '../../sdk/types/article/Article';
4
- export declare class InteractionsRegistry implements InteractionsRegistryPort {
5
- private ctrls;
6
- private items;
7
- private interactions;
8
- private stateItemsIdsMap;
9
- private interactionStateMap;
10
- private itemsStages;
11
- private activeStateIdInteractionIdMap;
12
- constructor(article: Article, layoutId: string);
13
- register(itemId: ItemId, ctrl: ItemInteractionCtrl): void;
14
- getStatePropsForItem(itemId: string): StateProps;
15
- getItemAvailableTriggers(itemId: string): Set<InteractionItemTrigger['type']>;
16
- notifyLoad(): void;
17
- notifyScroll(position: number): void;
18
- notifyItemTrigger(itemId: string, triggerType: TriggerType): void;
19
- notifyTransitionStartForItems(itemsIds: string[], activeStateId: string): void;
20
- notifyTransitionEnd(itemId: string): void;
21
- private getCurrentStateByInteractionId;
22
- private setCurrentStateForInteraction;
23
- private getActiveInteractionState;
24
- private notifyItemCtrlsChange;
25
- private unpackItems;
26
- private getNestedItems;
27
- private getDefaultItemStages;
28
- }
29
- type TriggerType = InteractionItemTrigger['type'];
30
- type ItemId = string;
31
- type StateProps = Record<string, {
32
- value?: string | number;
33
- transition?: {
34
- timing: string;
35
- duration: number;
36
- delay: number;
37
- };
38
- }>;
39
- export {};
@@ -1,21 +0,0 @@
1
- import { InteractionsRegistryPort, ItemInteractionCtrl } from './types';
2
- import { InteractionItemTrigger } from '../../sdk/types/article/Interaction';
3
- export declare class ItemInteractionController implements ItemInteractionCtrl {
4
- private itemId;
5
- private registry;
6
- private onChange;
7
- private transitionsInProgress;
8
- private actionReceiver;
9
- constructor(itemId: string, registry: InteractionsRegistryPort, onChange: () => void);
10
- getState<T>(keys: string[]): {
11
- styles: Record<string, T>;
12
- transition: string;
13
- };
14
- getHasTrigger(itemId: string, triggerType: InteractionItemTrigger['type']): boolean;
15
- sendTrigger(type: 'click' | 'hover-in' | 'hover-out'): void;
16
- receiveAction(type: 'play' | 'pause'): void;
17
- setActionReceiver(action: (type: 'play' | 'pause') => void): void;
18
- handleTransitionStart: (types: string[]) => void;
19
- handleTransitionEnd: (cssPropKey: string) => void;
20
- receiveChange(): void;
21
- }
@@ -1,9 +0,0 @@
1
- export declare function getTransition(state: Record<string, StateInfo>, keys: string[]): string;
2
- type StateInfo = {
3
- transition?: {
4
- duration: number;
5
- delay: number;
6
- timing: string;
7
- };
8
- };
9
- export {};
@@ -1,34 +0,0 @@
1
- import { ArticleItemType } from '../../sdk/types/article/ArticleItemType';
2
- import { InteractionItemTrigger } from '../../sdk/types/article/Interaction';
3
- import { ItemState } from '../../sdk/types/article/ItemState';
4
- export interface ItemInteractionCtrl {
5
- getState<T>(keys: string[]): StateCSSInfo<T>;
6
- getHasTrigger(itemId: string, triggerType: InteractionItemTrigger['type']): boolean;
7
- sendTrigger(type: 'click' | 'hover-in' | 'hover-out'): void;
8
- handleTransitionEnd?: (styleKey: string) => void;
9
- handleTransitionStart?: (styleKeys: string[]) => void;
10
- receiveChange: () => void;
11
- receiveAction: (type: 'play' | 'pause') => void;
12
- setActionReceiver: (action: (type: 'play' | 'pause') => void) => void;
13
- }
14
- export interface InteractionsRegistryPort {
15
- register(itemId: string, ctrl: ItemInteractionCtrl): void;
16
- getStatePropsForItem(itemId: string): StateProps<unknown>;
17
- getItemAvailableTriggers(itemId: string): Set<InteractionItemTrigger['type']>;
18
- notifyItemTrigger(itemId: string, type: TriggerType): void;
19
- notifyTransitionEnd(itemId: string): void;
20
- }
21
- type StateCSSInfo<T> = {
22
- styles: Partial<Record<string, T>>;
23
- transition?: string;
24
- };
25
- type StateProps<T> = Record<keyof ItemState<ArticleItemType>, {
26
- value?: T;
27
- transition?: {
28
- timing: string;
29
- duration: number;
30
- delay: number;
31
- };
32
- }>;
33
- type TriggerType = 'click' | 'hover-in' | 'hover-out';
34
- export {};
@@ -1,2 +0,0 @@
1
- import { ItemInteractionCtrl } from './types';
2
- export declare function useItemInteractionCtrl(itemId: string): ItemInteractionCtrl | undefined;
@@ -1,2 +0,0 @@
1
- import { ArticleRectObserver } from '../utils/ArticleRectManager/ArticleRectObserver';
2
- export declare const ArticleRectContext: import('react').Context<ArticleRectObserver | null>;
@@ -1,2 +0,0 @@
1
- import { CntrlSdkContext } from './CntrlSdkContext';
2
- export declare const CntrlContext: import('react').Context<CntrlSdkContext>;
@@ -1,2 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- export declare const CntrlProvider: FC<PropsWithChildren<{}>>;
@@ -1,31 +0,0 @@
1
- import { Article } from '../../sdk/types/article/Article';
2
- import { Section, SectionHeight } from '../../sdk/types/article/Section';
3
- import { Layout } from '../../sdk/types/project/Layout';
4
- import { Project } from '../../sdk/types/project/Project';
5
- import { CustomItemRegistry } from './CustomItemRegistry';
6
- import { CustomSectionRegistry } from './CustomSectionRegistry';
7
- import { Component as TComponent } from '../../sdk/types/component/Component';
8
- interface SdkContextInitProps {
9
- project: Project;
10
- article: Article;
11
- }
12
- export declare class CntrlSdkContext {
13
- readonly customItems: CustomItemRegistry;
14
- readonly customSections: CustomSectionRegistry;
15
- private _layouts;
16
- private _fonts?;
17
- private sectionHeightMap;
18
- private components;
19
- constructor(customItems: CustomItemRegistry, customSections: CustomSectionRegistry);
20
- resolveSectionData(sections: Section[]): Promise<Record<string, any>>;
21
- init({ project, article }: SdkContextInitProps): void;
22
- setLayouts(layouts: Layout[]): void;
23
- private setComponents;
24
- private setFonts;
25
- setSectionsHeight(sections: Section[]): void;
26
- getSectionHeightData(sectionId: string): Record<string, SectionHeight> | undefined;
27
- get layouts(): Layout[];
28
- get fonts(): Project['fonts'] | undefined;
29
- getComponent(id: string): TComponent | undefined;
30
- }
31
- export {};
@@ -1,6 +0,0 @@
1
- import { CustomItemComponent } from './CustomItemTypes';
2
- export declare class CustomItemRegistry {
3
- private definitions;
4
- define<T extends string>(type: T, component: CustomItemComponent<T>): this;
5
- get(type: string): CustomItemComponent<string> | undefined;
6
- }
@@ -1,2 +0,0 @@
1
- import { FC } from 'react';
2
- export type CustomItemComponent<T extends string> = FC<{}>;
@@ -1,15 +0,0 @@
1
- import { default as React, PropsWithChildren } from 'react';
2
- export declare class CustomSectionRegistry {
3
- private definitions;
4
- define<TData>(name: string, section: CustomSection<TData>): this;
5
- getComponent(name: string): CustomSectionComponent<any> | undefined;
6
- getResolver(name: string): (() => Promise<any>) | undefined;
7
- }
8
- type CustomSection<TData = {}> = {
9
- component: CustomSectionComponent<TData>;
10
- dataResolver?: () => Promise<TData>;
11
- };
12
- type CustomSectionComponent<TData> = React.FC<PropsWithChildren<{
13
- data: TData;
14
- }>>;
15
- export {};
@@ -1,10 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- import { InteractionsRegistry } from '../interactions/InteractionsRegistry';
3
- import { Article } from '../../sdk/types/article/Article';
4
- export declare const InteractionsContext: import('react').Context<InteractionsRegistry | undefined>;
5
- interface Props {
6
- article: Article;
7
- }
8
- export declare const InteractionsProvider: FC<PropsWithChildren<Props>>;
9
- export declare function useInteractionsRegistry(): InteractionsRegistry | undefined;
10
- export {};
@@ -1,6 +0,0 @@
1
- import { KeyframeAny } from '../../sdk/types/keyframe/Keyframe';
2
- export declare class Keyframes {
3
- private keyframes;
4
- constructor(keyframes?: KeyframeAny[]);
5
- getItemKeyframes(itemId: string): KeyframeAny[];
6
- }
@@ -1,2 +0,0 @@
1
- import { Keyframes } from './Keyframes';
2
- export declare const KeyframesContext: import('react').Context<Keyframes>;
@@ -1 +0,0 @@
1
- export declare const LayoutContext: import('react').Context<string | undefined>;
@@ -1,2 +0,0 @@
1
- import { WebGLContextManager } from '@cntrl-site/effects';
2
- export declare const WebglContextManagerContext: import('react').Context<WebGLContextManager>;
@@ -1,2 +0,0 @@
1
- import { CntrlSdkContext } from './CntrlSdkContext';
2
- export declare const cntrlSdkContext: CntrlSdkContext;
@@ -1,2 +0,0 @@
1
- import { CntrlSdkContext } from './CntrlSdkContext';
2
- export declare function useCntrlContext(): CntrlSdkContext;
@@ -1,43 +0,0 @@
1
- import { KeyframeType, KeyframeValueMap } from '../../../sdk/types/keyframe/Keyframe';
2
- import { FillLayer } from '../../../sdk/types/article/Item';
3
- export interface AnimationData<T extends KeyframeType> {
4
- position: number;
5
- value: KeyframeValueMap[T];
6
- type: T;
7
- }
8
- interface PositionKeyframes<T extends KeyframeType> {
9
- start: AnimationData<T>;
10
- end: AnimationData<T>;
11
- }
12
- export type KeyframesMap = {
13
- [T in KeyframeType]: AnimationData<T>[];
14
- };
15
- export declare class Animator {
16
- private keyframes;
17
- private static pushKeyframeToMap;
18
- private keyframesMap;
19
- constructor(keyframes: AnimationData<KeyframeType>[]);
20
- getFXParams(valuesMap: Record<string, number>, pos: number): KeyframeValueMap[KeyframeType.FXParams];
21
- getDimensions(values: KeyframeValueMap[KeyframeType.Dimensions], pos: number): KeyframeValueMap[KeyframeType.Dimensions];
22
- getPositions(values: KeyframeValueMap[KeyframeType.Position], pos: number): KeyframeValueMap[KeyframeType.Position];
23
- getBorderFill(values: KeyframeValueMap[KeyframeType.BorderFill], pos: number): FillLayer[];
24
- getFill(values: KeyframeValueMap[KeyframeType.Fill], pos: number): FillLayer[];
25
- getRadius(values: KeyframeValueMap[KeyframeType.BorderRadius], pos: number): KeyframeValueMap[KeyframeType.BorderRadius];
26
- getBorderWidth(values: KeyframeValueMap[KeyframeType.BorderWidth], pos: number): KeyframeValueMap[KeyframeType.BorderWidth];
27
- getRotation(values: KeyframeValueMap[KeyframeType.Rotation], pos: number): KeyframeValueMap[KeyframeType.Rotation];
28
- getOpacity(values: KeyframeValueMap[KeyframeType.Opacity], pos: number): KeyframeValueMap[KeyframeType.Opacity];
29
- getScale(values: KeyframeValueMap[KeyframeType.Scale], pos: number): KeyframeValueMap[KeyframeType.Scale];
30
- getBlur(values: KeyframeValueMap[KeyframeType.Blur], pos: number): KeyframeValueMap[KeyframeType.Blur];
31
- getBackdropBlur(values: KeyframeValueMap[KeyframeType.BackdropBlur], pos: number): KeyframeValueMap[KeyframeType.BackdropBlur];
32
- getTextColor(values: KeyframeValueMap[KeyframeType.TextColor], pos: number): KeyframeValueMap[KeyframeType.TextColor];
33
- getLetterSpacing(values: KeyframeValueMap[KeyframeType.LetterSpacing], pos: number): KeyframeValueMap[KeyframeType.LetterSpacing];
34
- getWordSpacing(values: KeyframeValueMap[KeyframeType.WordSpacing], pos: number): KeyframeValueMap[KeyframeType.WordSpacing];
35
- getStartEnd<T extends KeyframeType>(position: number, keyframes: AnimationData<T>[]): PositionKeyframes<T>;
36
- private fillKeyframesMap;
37
- private getRangeColor;
38
- private getRangeGradient;
39
- private interpolateFillLayerArray;
40
- private interpolateFillLayer;
41
- private interpolateColorStops;
42
- }
43
- export {};