@meduza/ui-kit-2 0.1.59 → 0.1.60

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.59",
2
+ "version": "0.1.60",
3
3
  "license": "MIT",
4
4
  "description": "UIKit for Meduza",
5
5
  "repository": "https://github.com/meduza-corp/ui-kit-2.git",
@@ -1,11 +1,12 @@
1
1
  import React from 'react'
2
+ import { CallToActions } from '../types'
2
3
  export interface MetaContainerProps {
3
4
  block: any
4
5
  styleContext: string[] | string
5
6
  isRead: boolean | undefined
6
7
  isListened: boolean | undefined
7
8
  isInBookmarks: boolean | undefined
8
- bookmarkAction?: (service: string, place: string) => void
9
+ bookmarkAction?: (service: CallToActions, place: string) => void
9
10
  lightBox?: () => void
10
11
  lang: 'ru' | 'en'
11
12
  }
@@ -1,4 +1,5 @@
1
1
  import { ImageProps } from '../Image/Image.types'
2
+ import { CallToActions, LightboxContext } from '../types'
2
3
 
3
4
  export type lightBox = {
4
5
  show: (image?: ImageProps['optimized'], alt?: ImageProps['alt']) => void
@@ -12,6 +13,6 @@ export interface RawHtmlBlockProps {
12
13
  isRead?: boolean | undefined
13
14
  isListened?: boolean | undefined
14
15
  isInBookmarks?: boolean | undefined
15
- bookmarkAction?: (service: string, place: string) => void
16
- lightBox?: lightBox | null
16
+ bookmarkAction?: (service: CallToActions, place: string) => void
17
+ lightBox?: LightboxContext | null | undefined
17
18
  }
@@ -1,17 +1,12 @@
1
- import { ImageProps } from '../Image/Image.types'
1
+ import { CallToActions, LightboxContext } from '../types'
2
2
 
3
- export type lightBox = {
4
- show: (image?: ImageProps['optimized'], alt?: ImageProps['alt']) => void
5
- hide: () => void
6
- visible: boolean
7
- }
8
3
  export interface RenderBlocksProps {
9
4
  block: any
10
5
  styleContext?: any
11
6
  isRead?: boolean
12
7
  isListened?: boolean
13
8
  isInBookmarks?: boolean
14
- bookmarkAction?: (service: string, place: string) => void
15
- lightBox?: lightBox | null
9
+ bookmarkAction?: (service: CallToActions, place: string) => void
10
+ lightBox?: LightboxContext | null | undefined
16
11
  lang?: 'ru' | 'en'
17
12
  }
package/src/types.ts CHANGED
@@ -4,3 +4,20 @@ export interface OptimizedImageItem {
4
4
  '1x_webp': string
5
5
  '2x_webp': string
6
6
  }
7
+
8
+ export type CallToActions =
9
+ | 'fb'
10
+ | 'tw'
11
+ | 'vk'
12
+ | 'ok'
13
+ | 'tg'
14
+ | 'wp'
15
+ | 'reaction'
16
+ | 'bookmark'
17
+ | 'cross'
18
+
19
+ export interface LightboxContext {
20
+ show: (image?: OptimizedImageItem, alt?: string) => void
21
+ hide: () => void
22
+ visible: boolean
23
+ }