@weavy/uikit-react 26.0.3 → 27.1.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.
Files changed (40) hide show
  1. package/changelog.md +29 -0
  2. package/dist/types/blocks/WyChat.d.ts +4 -2
  3. package/dist/types/blocks/WyComments.d.ts +4 -2
  4. package/dist/types/blocks/WyComponent.d.ts +6 -2
  5. package/dist/types/blocks/WyCopilot.d.ts +18 -0
  6. package/dist/types/blocks/WyFiles.d.ts +4 -2
  7. package/dist/types/blocks/WyMessenger.d.ts +1 -1
  8. package/dist/types/blocks/WyNotificationToasts.d.ts +4 -2
  9. package/dist/types/blocks/WyNotifications.d.ts +4 -2
  10. package/dist/types/blocks/WyPosts.d.ts +4 -2
  11. package/dist/types/blocks/index.d.ts +2 -0
  12. package/dist/types/components/WyAttachment.d.ts +1 -1
  13. package/dist/types/components/WyConversation.d.ts +0 -3
  14. package/dist/types/components/WyFilesList.d.ts +2 -1
  15. package/dist/types/components/WyImageGrid.d.ts +1 -1
  16. package/dist/types/components/WyPreview.d.ts +1 -1
  17. package/dist/types/hooks/useWeavyContext.d.ts +21 -0
  18. package/dist/weavy.bundle.js +1176 -1203
  19. package/dist/weavy.cjs +1267 -1294
  20. package/dist/weavy.es5.esm.js +1 -1
  21. package/dist/weavy.es5.umd.cjs +1 -1
  22. package/dist/weavy.mjs +16502 -15503
  23. package/dist/weavy.umd.cjs +1193 -1220
  24. package/lib/blocks/WyChat.tsx +5 -2
  25. package/lib/blocks/WyComments.tsx +5 -2
  26. package/lib/blocks/WyComponent.tsx +8 -1
  27. package/lib/blocks/WyCopilot.tsx +34 -0
  28. package/lib/blocks/WyFiles.tsx +5 -2
  29. package/lib/blocks/WyMessenger.tsx +1 -1
  30. package/lib/blocks/WyNotificationToasts.tsx +5 -2
  31. package/lib/blocks/WyNotifications.tsx +5 -2
  32. package/lib/blocks/WyPosts.tsx +7 -3
  33. package/lib/blocks/index.ts +2 -0
  34. package/lib/components/WyAttachment.tsx +1 -1
  35. package/lib/components/WyConversation.tsx +0 -9
  36. package/lib/components/WyFilesList.tsx +1 -1
  37. package/lib/components/WyImageGrid.tsx +1 -1
  38. package/lib/components/WyPreview.tsx +1 -1
  39. package/lib/hooks/useWeavyContext.ts +21 -0
  40. package/package.json +22 -23
package/changelog.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog for Weavy
2
2
 
3
+ ## v27.1.0
4
+
5
+ <time>2025-04-05</time>
6
+
7
+ * Fixed an issue with app name property not being registered from UIKit.
8
+ * Made the `wy-app` event available generally in all contextual Weavy components.
9
+ * Improved some event types.
10
+
11
+ ## v27.0.0
12
+
13
+ <time>2025-03-27</time>
14
+
15
+ * Added Bots API for managing chat bots
16
+ * Added `<wy-copilot>` component for contextual conversations with chat bots.
17
+ * Added method to remove a user's copy of a private chat.
18
+ * Added `features` property to uikit components.
19
+ * Added feature option to enable typing indicators and read receipts on the `<wy-chat>` component.
20
+ * Added `reactions` property to configure reactions on individual components or on the `<wy-context>`.
21
+
22
+ ###### Breaking Changes
23
+
24
+ * Bots are no longer managed via the Users API. You should use the dedicated Bots API instead.
25
+ * Changed how features are toggled ui the kit. Features are now opt-in using a single `features` property with a space separated list of features. It defaults to a predefined set of features when not configured. This replaces the previous opt-out properties.
26
+ * The `<wy-comments>` component now defaults to having the meetings feature disabled. Enable it by configuring the `features` property.
27
+ * Custom reactions are now configured by setting the `reactions` property to a space separated string of unicode emojis.
28
+ * Removed unused `is_suspended` property from users.
29
+ * Removed the redundant `display_name` property from users and apps. Use the `name` property instead.
30
+ * Replaced `directory_id` with `directory.id` in JSON responses.
31
+
3
32
  ## v26.0.3
4
33
 
5
34
  <time>2025-02-20</time>
@@ -1,7 +1,9 @@
1
1
  import { EventName, WebComponentProps } from '@lit/react';
2
2
  import { WY_CHAT_TAGNAME, WyChat as WyChatWC } from '@weavy/uikit-web';
3
- import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.types.js';
3
+ import { WyAppEventType } from '@weavy/uikit-web/dist/types/types/app.events.js';
4
+ import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.js';
4
5
  export declare const WyChat: import('@lit/react').ReactWebComponent<WyChatWC, {
6
+ onWyApp: EventName<WyAppEventType>;
5
7
  onWyPreviewOpen: EventName<WyPreviewOpenEventType>;
6
8
  }>;
7
9
  declare module "react" {
@@ -11,4 +13,4 @@ declare module "react" {
11
13
  }
12
14
  }
13
15
  }
14
- export type { WyPreviewOpenEventType };
16
+ export type { WyAppEventType, WyPreviewOpenEventType };
@@ -1,7 +1,9 @@
1
1
  import { EventName, WebComponentProps } from '@lit/react';
2
2
  import { WY_COMMENTS_TAGNAME, WyComments as WyCommentsWC } from '@weavy/uikit-web';
3
- import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.types.js';
3
+ import { WyAppEventType } from '@weavy/uikit-web/dist/types/types/app.events.js';
4
+ import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.js';
4
5
  export declare const WyComments: import('@lit/react').ReactWebComponent<WyCommentsWC, {
6
+ onWyApp: EventName<WyAppEventType>;
5
7
  onWyPreviewOpen: EventName<WyPreviewOpenEventType>;
6
8
  }>;
7
9
  declare module "react" {
@@ -11,4 +13,4 @@ declare module "react" {
11
13
  }
12
14
  }
13
15
  }
14
- export type { WyPreviewOpenEventType };
16
+ export type { WyAppEventType, WyPreviewOpenEventType };
@@ -1,6 +1,9 @@
1
- import { WebComponentProps } from '@lit/react';
1
+ import { EventName, WebComponentProps } from '@lit/react';
2
2
  import { WY_COMPONENT_TAGNAME, WyComponent as WyComponentWC } from '@weavy/uikit-web';
3
- export declare const WyComponent: import('@lit/react').ReactWebComponent<WyComponentWC, {}>;
3
+ import { WyAppEventType } from '@weavy/uikit-web/dist/types/types/app.events.js';
4
+ export declare const WyComponent: import('@lit/react').ReactWebComponent<WyComponentWC, {
5
+ onWyApp: EventName<WyAppEventType>;
6
+ }>;
4
7
  declare module "react" {
5
8
  namespace JSX {
6
9
  interface IntrinsicElements {
@@ -8,3 +11,4 @@ declare module "react" {
8
11
  }
9
12
  }
10
13
  }
14
+ export type { WyAppEventType };
@@ -0,0 +1,18 @@
1
+ import { EventName, WebComponentProps } from '@lit/react';
2
+ import { WY_COPILOT_TAGNAME, WyCopilot as WyCopilotWC } from '@weavy/uikit-web';
3
+ import { WyAppEventType } from '@weavy/uikit-web/dist/types/types/app.events.js';
4
+ import { WyMessageEventType } from '@weavy/uikit-web/dist/types/types/messages.events.js';
5
+ import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.js';
6
+ export declare const WyCopilot: import('@lit/react').ReactWebComponent<WyCopilotWC, {
7
+ onWyApp: EventName<WyAppEventType>;
8
+ onWyMessage: EventName<WyMessageEventType>;
9
+ onWyPreviewOpen: EventName<WyPreviewOpenEventType>;
10
+ }>;
11
+ declare module "react" {
12
+ namespace JSX {
13
+ interface IntrinsicElements {
14
+ [WY_COPILOT_TAGNAME]: WebComponentProps<WyCopilotWC>;
15
+ }
16
+ }
17
+ }
18
+ export type { WyPreviewOpenEventType, WyAppEventType, WyMessageEventType };
@@ -1,7 +1,9 @@
1
1
  import { EventName, WebComponentProps } from '@lit/react';
2
2
  import { WY_FILES_TAGNAME, WyFiles as WyFilesWC } from '@weavy/uikit-web';
3
- import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.types.js';
3
+ import { WyAppEventType } from '@weavy/uikit-web/dist/types/types/app.events.js';
4
+ import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.js';
4
5
  export declare const WyFiles: import('@lit/react').ReactWebComponent<WyFilesWC, {
6
+ onWyApp: EventName<WyAppEventType>;
5
7
  onWyPreviewOpen: EventName<WyPreviewOpenEventType>;
6
8
  }>;
7
9
  declare module "react" {
@@ -11,4 +13,4 @@ declare module "react" {
11
13
  }
12
14
  }
13
15
  }
14
- export type { WyPreviewOpenEventType };
16
+ export type { WyAppEventType, WyPreviewOpenEventType };
@@ -1,6 +1,6 @@
1
1
  import { EventName, WebComponentProps } from '@lit/react';
2
2
  import { WY_MESSENGER_TAGNAME, WyMessenger as WyMessengerWC } from '@weavy/uikit-web';
3
- import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.types.js';
3
+ import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.js';
4
4
  export declare const WyMessenger: import('@lit/react').ReactWebComponent<WyMessengerWC, {
5
5
  onWyPreviewOpen: EventName<WyPreviewOpenEventType>;
6
6
  }>;
@@ -1,7 +1,9 @@
1
1
  import { EventName, WebComponentProps } from '@lit/react';
2
2
  import { WY_NOTIFICATION_TOASTS_TAGNAME, WyNotificationToasts as WyNotificationToastsWC } from '@weavy/uikit-web';
3
- import { WyLinkEventType, WyNotificationEventType } from '@weavy/uikit-web/dist/types/types/notifications.types.d.ts';
3
+ import { WyLinkEventType, WyNotificationEventType } from '@weavy/uikit-web/dist/types/types/notifications.events.d.ts';
4
+ import { WyAppEventType } from '@weavy/uikit-web/dist/types/types/app.events.js';
4
5
  export declare const WyNotificationToasts: import('@lit/react').ReactWebComponent<WyNotificationToastsWC, {
6
+ onWyApp: EventName<WyAppEventType>;
5
7
  onWyLink: EventName<WyLinkEventType>;
6
8
  onWyNotification: EventName<WyNotificationEventType>;
7
9
  }>;
@@ -12,4 +14,4 @@ declare module "react" {
12
14
  }
13
15
  }
14
16
  }
15
- export type { WyLinkEventType };
17
+ export type { WyAppEventType, WyLinkEventType };
@@ -1,7 +1,9 @@
1
1
  import { EventName, WebComponentProps } from '@lit/react';
2
2
  import { WY_NOTIFICATIONS_TAGNAME, WyNotifications as WyNotificationsWC } from '@weavy/uikit-web';
3
- import { WyLinkEventType } from '@weavy/uikit-web/dist/types/types/notifications.types.d.ts';
3
+ import { WyLinkEventType } from '@weavy/uikit-web/dist/types/types/notifications.events.d.ts';
4
+ import { WyAppEventType } from '@weavy/uikit-web/dist/types/types/app.events.js';
4
5
  export declare const WyNotifications: import('@lit/react').ReactWebComponent<WyNotificationsWC, {
6
+ onWyApp: EventName<WyAppEventType>;
5
7
  onWyLink: EventName<WyLinkEventType>;
6
8
  }>;
7
9
  declare module "react" {
@@ -11,4 +13,4 @@ declare module "react" {
11
13
  }
12
14
  }
13
15
  }
14
- export type { WyLinkEventType };
16
+ export type { WyAppEventType, WyLinkEventType };
@@ -1,7 +1,9 @@
1
1
  import { EventName, WebComponentProps } from '@lit/react';
2
2
  import { WY_POSTS_TAGNAME, WyPosts as WyPostsWC } from '@weavy/uikit-web';
3
- import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.types.js';
3
+ import { WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.js';
4
+ import { WyAppEventType } from '@weavy/uikit-web/dist/types/types/app.events.js';
4
5
  export declare const WyPosts: import('@lit/react').ReactWebComponent<WyPostsWC, {
6
+ onWyApp: EventName<WyAppEventType>;
5
7
  onWyPreviewOpen: EventName<WyPreviewOpenEventType>;
6
8
  }>;
7
9
  declare module "react" {
@@ -11,4 +13,4 @@ declare module "react" {
11
13
  }
12
14
  }
13
15
  }
14
- export type { WyPreviewOpenEventType };
16
+ export type { WyAppEventType, WyPreviewOpenEventType };
@@ -1,7 +1,9 @@
1
+ export { Feature } from '@weavy/uikit-web/lib/types/features.types.ts';
1
2
  export * from './WyChat';
2
3
  export * from './WyComments';
3
4
  export * from './WyComponent';
4
5
  export * from './WyContext';
6
+ export * from './WyCopilot';
5
7
  export * from './WyFiles';
6
8
  export * from './WyMessenger';
7
9
  export * from './WyNotifications';
@@ -1,6 +1,6 @@
1
1
  import { EventName } from '@lit/react';
2
2
  import { WeavyComponents } from '@weavy/uikit-web';
3
- import { FileOpenEventType } from '@weavy/uikit-web/dist/types/types/files.types.d.ts';
3
+ import { FileOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.d.ts';
4
4
  export declare const WyAttachment: import('@lit/react').ReactWebComponent<WeavyComponents.WyAttachment, {}>;
5
5
  export declare const WyAttachmentsList: import('@lit/react').ReactWebComponent<WeavyComponents.WyAttachmentsList, {
6
6
  onFileOpen: EventName<FileOpenEventType>;
@@ -3,9 +3,6 @@ import { WeavyComponents } from '@weavy/uikit-web';
3
3
  export declare const WyConversation: import('@lit/react').ReactWebComponent<WeavyComponents.WyConversation, {
4
4
  onReleaseFocus: EventName<CustomEvent>;
5
5
  }>;
6
- export declare const WyConversationExtended: import('@lit/react').ReactWebComponent<WeavyComponents.WyConversationExtended, {
7
- onReleaseFocus: EventName<CustomEvent>;
8
- }>;
9
6
  export declare const WyConversationAppbar: import('@lit/react').ReactWebComponent<WeavyComponents.WyConversationAppbar, {
10
7
  onReleaseFocus: EventName<CustomEvent>;
11
8
  }>;
@@ -1,6 +1,7 @@
1
1
  import { EventName } from '@lit/react';
2
2
  import { WeavyComponents } from '@weavy/uikit-web';
3
- import { FileOpenEventType, FileOrderType, FileType } from '@weavy/uikit-web/dist/types/types/files.types.d.ts';
3
+ import { FileOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.d.ts';
4
+ import { FileOrderType, FileType } from '@weavy/uikit-web/dist/types/types/files.types.d.ts';
4
5
  export declare const WyFilesList: import('@lit/react').ReactWebComponent<WeavyComponents.WyFilesList, {
5
6
  onFileOpen: EventName<FileOpenEventType>;
6
7
  onOrder: EventName<CustomEvent<{
@@ -1,6 +1,6 @@
1
1
  import { EventName } from '@lit/react';
2
2
  import { WeavyComponents } from '@weavy/uikit-web';
3
- import { FileOpenEventType } from '@weavy/uikit-web/dist/types/types/files.types.d.ts';
3
+ import { FileOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.d.ts';
4
4
  export declare const WyImageGrid: import('@lit/react').ReactWebComponent<WeavyComponents.WyImageGrid, {
5
5
  onFileOpen: EventName<FileOpenEventType>;
6
6
  }>;
@@ -1,6 +1,6 @@
1
1
  import { EventName } from '@lit/react';
2
2
  import { WeavyComponents } from '@weavy/uikit-web';
3
- import { WyPreviewCloseEventType, WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.types.js';
3
+ import { WyPreviewCloseEventType, WyPreviewOpenEventType } from '@weavy/uikit-web/dist/types/types/files.events.js';
4
4
  export declare const WyPreview: import('@lit/react').ReactWebComponent<WeavyComponents.WyPreview, {
5
5
  onReleaseFocus: EventName<CustomEvent>;
6
6
  onWyPreviewOpen: EventName<WyPreviewOpenEventType>;
@@ -9,6 +9,27 @@ import { Context } from '@weavy/uikit-web/dist/types/contexts/index.js';
9
9
  * @param ref { React.RefObject | HTMLElement } - Reference object that needs to be placed in the DOM.
10
10
  * @param context { Context } - The context to use. Defaults to WeavyContext from ukit-web.
11
11
  * @returns Weavy instance
12
+ * @example
13
+ * import React, { useRef } from "react"
14
+ * import { useWeavyContext } from "@weavy/uikit-react"
15
+ *
16
+ * export const MyComponent = () => {
17
+ * const domRef = useRef(null)
18
+ * const weavy = useWeavyContext(domRef)
19
+ *
20
+ * useEffect(() => {
21
+ * if (weavy) {
22
+ * console.log("We got weavy", weavy.version)
23
+ * }
24
+ * }, [weavy])
25
+ *
26
+ * // ...
27
+ * return (
28
+ * <>
29
+ * <span ref={domRef}></span>
30
+ * </>
31
+ * )
32
+ * }
12
33
  */
13
34
  export declare function useWeavyContext<TContext extends Context<unknown, unknown> = typeof WeavyContext, TElement extends HTMLElement = HTMLElement>(ref: React.RefObject<TElement> | TElement | null, context?: TContext): import('@weavy/uikit-web').WeavyType | import('@weavy/uikit-web/dist/types/utils/context/create-context.js').ContextType<TContext> | undefined;
14
35
  export type { Context };