@semcore/notice-bubble 16.3.0-prerelease.3 → 16.3.0

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.
@@ -1,32 +1,25 @@
1
1
  import type { PortalProps, BoxProps } from '@semcore/base-components';
2
- import type { UnknownProperties, Intergalactic } from '@semcore/core';
2
+ import type { Intergalactic } from '@semcore/core';
3
3
  import type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';
4
- import type { NodeByRef } from '@semcore/core/lib/utils/ref';
5
4
  import type { RefObject } from 'react';
6
- /** @deprecated */
7
- export interface INoticeBubbleContainerProps extends NoticeBubbleContainerProps, UnknownProperties {
8
- }
9
5
  /**
10
6
  * @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer()
11
7
  */
12
8
  export type NoticeBubbleContainerPortalProps = PortalProps;
13
9
  export type NoticeBubbleContainerProps = BoxProps & NoticeBubbleContainerPortalProps & {
14
- /** Ref or element to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */
15
- containerNode?: NodeByRef | null;
10
+ /** Ref to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */
11
+ containerNode?: HTMLElement | null;
16
12
  /** Manager copy */
17
13
  manager?: NoticeBubbleManagerClass;
18
14
  /** Specifies the locale for i18n support */
19
15
  locale?: string;
20
16
  };
21
17
  export type NoticeBubbleViewItemProps = NoticeBubbleProps & {
22
- containerNode?: NodeByRef;
18
+ containerNode?: HTMLElement;
23
19
  animationDuration: number;
24
20
  getI18nText: ReturnType<typeof useI18n>;
25
21
  styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement> | undefined;
26
22
  };
27
- /** @deprecated */
28
- export interface INoticeBubbleProps extends NoticeBubbleProps, UnknownProperties {
29
- }
30
23
  export type NoticeBubbleProps = BoxProps & {
31
24
  /** Notice type */
32
25
  type?: 'info' | 'warning';
@@ -65,38 +58,23 @@ export type NoticeBubbleProps = BoxProps & {
65
58
  manager?: NoticeBubbleManagerClass;
66
59
  icon?: React.ReactElement;
67
60
  };
68
- /** @deprecated */
69
- export interface INoticeBubbleInfoProps extends NoticeBubbleInfoProps, UnknownProperties {
70
- }
71
61
  export type NoticeBubbleInfoProps = NoticeBubbleProps & {
72
62
  readonly type?: 'info';
73
63
  };
74
- /** @deprecated */
75
- export interface INoticeBubbleWarningProps extends NoticeBubbleWarningProps, UnknownProperties {
76
- }
77
64
  export type NoticeBubbleWarningProps = NoticeBubbleProps & {
78
65
  readonly type?: 'warning';
79
66
  };
80
67
  export type AddedNoticeMeta = {
81
68
  uid: number;
82
- update: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => boolean;
69
+ update: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => Promise<AddedNoticeMeta>;
83
70
  remove: () => boolean;
84
71
  ref: RefObject<HTMLElement>;
85
- focus: () => void;
86
72
  };
87
- /** @deprecated */
88
- export interface INoticeBubbleManager extends NoticeBubbleManagerClass, UnknownProperties {
89
- }
90
73
  export type NoticeBubbleManagerClass = {
91
74
  /**
92
75
  * Creates and shows a notice.
93
76
  * */
94
77
  add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => AddedNoticeMeta;
95
- /**
96
- * Updates notice by uid.
97
- * @deprecated use replace instead.
98
- */
99
- update: (uid: number, props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;
100
78
  /**
101
79
  * Removes notice by uid.
102
80
  * */
@@ -110,21 +88,4 @@ export type NoticeBubbleManagerClass = {
110
88
  */
111
89
  replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;
112
90
  };
113
- /**
114
- * @deprecated use `NoticeBubbleManager` instead.
115
- * */
116
- export declare const NoticeBubble: Intergalactic.Component<'div', NoticeBubbleInfoProps>;
117
- /**
118
- * @deprecated use `NoticeBubbleManager` instead.
119
- * */
120
- export declare const NoticeBubbleWarning: Intergalactic.Component<'div', NoticeBubbleWarningProps>;
121
- export declare const NoticeBubbleContainer: Intergalactic.Component<'div', NoticeBubbleContainerProps> & {
122
- /**
123
- * @deprecated use `NoticeBubbleManager` instead.
124
- * */
125
- Info: typeof NoticeBubble;
126
- /**
127
- * @deprecated use `NoticeBubbleManager` instead.
128
- * */
129
- Warning: typeof NoticeBubbleWarning;
130
- };
91
+ export declare const NoticeBubbleContainer: Intergalactic.Component<'div', NoticeBubbleContainerProps>;
@@ -10,13 +10,11 @@ declare class NoticeBubbleManager implements NoticeBubbleManagerClass {
10
10
  private items;
11
11
  private emitter;
12
12
  private counter;
13
- private replaceTimer;
14
13
  addListener(fn: (items: NoticeItem[]) => void): () => void;
15
14
  private emit;
16
15
  add(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): AddedNoticeMeta;
17
- update(uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): boolean;
18
- replace(uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): void;
19
- replaceLast(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): void;
16
+ replace(uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): Promise<AddedNoticeMeta>;
17
+ replaceLast(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): Promise<AddedNoticeMeta>;
20
18
  remove(uid: number): boolean;
21
19
  }
22
20
  declare const noticeBubbleDefaultManager: NoticeBubbleManager;
@@ -3,6 +3,5 @@ import type { NoticeBubbleContainerProps, NoticeBubbleInfoProps, NoticeBubbleWar
3
3
  import { default as noticeBubbleDefaultManager } from './NoticeBubbleManager';
4
4
  export * from './NoticeBubble';
5
5
  export * from './NoticeBubbleManager';
6
- export default noticeBubbleDefaultManager;
7
6
  export { NoticeBubbleContainer, noticeBubbleDefaultManager };
8
7
  export type { NoticeBubbleContainerProps, NoticeBubbleInfoProps, NoticeBubbleWarningProps, AddedNoticeMeta, };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/notice-bubble",
3
3
  "description": "Semrush NoticeBubble Component",
4
- "version": "16.3.0-prerelease.3",
4
+ "version": "16.3.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,14 +14,14 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/icon": "16.8.0-prerelease.3",
18
- "@semcore/portal": "16.1.0-prerelease.3",
19
- "@semcore/flex-box": "16.1.0-prerelease.3",
20
- "@semcore/animation": "16.1.0-prerelease.3",
21
- "@semcore/button": "16.1.0-prerelease.3"
17
+ "@semcore/icon": "16.8.0",
18
+ "@semcore/portal": "16.1.0",
19
+ "@semcore/flex-box": "16.1.0",
20
+ "@semcore/animation": "16.1.0",
21
+ "@semcore/button": "16.1.0"
22
22
  },
23
23
  "peerDependencies": {
24
- "@semcore/base-components": "^16.6.0-prerelease.3"
24
+ "@semcore/base-components": "^16.6.0"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",
@@ -29,9 +29,9 @@
29
29
  "directory": "semcore/notice-bubble"
30
30
  },
31
31
  "devDependencies": {
32
+ "@semcore/core": "16.6.0",
32
33
  "@semcore/testing-utils": "1.0.0",
33
- "@semcore/core": "16.6.0-prerelease.3",
34
- "@semcore/base-components": "16.6.0-prerelease.3"
34
+ "@semcore/base-components": "16.6.0"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "pnpm semcore-builder && pnpm vite build"