@pstdio/ui 0.5.2 → 0.6.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 (45) hide show
  1. package/dist/{MermaidComponent-DDCxR-Gs.js → MermaidComponent-D7Baqkwx.js} +2 -2
  2. package/dist/{MermaidComponent-DDCxR-Gs.js.map → MermaidComponent-D7Baqkwx.js.map} +1 -1
  3. package/dist/chat-ui.js +11 -9
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/activity/activity-avatar.d.ts +9 -0
  6. package/dist/components/activity/activity-comment.d.ts +19 -0
  7. package/dist/components/activity/activity-composer.d.ts +18 -0
  8. package/dist/components/activity/activity-event.d.ts +12 -0
  9. package/dist/components/activity/activity-root.d.ts +15 -0
  10. package/dist/components/activity/activity-timeline.d.ts +6 -0
  11. package/dist/components/activity/activity.types.d.ts +5 -0
  12. package/dist/components/activity/index.d.ts +25 -0
  13. package/dist/components/chat-ui/components/ai-conversation.d.ts +4 -4
  14. package/dist/components/rich-text/shared/editor-config.d.ts +1 -0
  15. package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/floating-toolbar-buttons.d.ts +16 -0
  16. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/commands.d.ts +2 -0
  17. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/index.d.ts +3 -0
  18. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/link-editor-content.d.ts +18 -0
  19. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/link-edit-state.d.ts +1 -0
  20. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/selection-link-url.d.ts +2 -0
  21. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/setFloatingElemPos.d.ts +1 -1
  22. package/dist/components/rich-text/shared/transformers/markdown-transformers-test-utils.d.ts +3 -0
  23. package/dist/components/rich-text/shared/transformers/markdown-transformers.d.ts +1 -0
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.js +2047 -1786
  26. package/dist/index.js.map +1 -1
  27. package/dist/{rich-message-DeJwzVeV.js → rich-message-33DPxuWJ.js} +502 -464
  28. package/dist/rich-message-33DPxuWJ.js.map +1 -0
  29. package/dist/rich-text.js +738 -414
  30. package/dist/rich-text.js.map +1 -1
  31. package/dist/style.css +1 -1
  32. package/dist/theme/recipes/alert.d.ts +1 -1
  33. package/dist/theme/recipes/dialog.d.ts +1 -1
  34. package/dist/theme/recipes/drawer.d.ts +1 -1
  35. package/dist/theme/recipes/menu.d.ts +1 -1
  36. package/dist/theme/recipes/popover.d.ts +1 -1
  37. package/dist/theme/tokens/borders.d.ts +6 -24
  38. package/dist/theme/tokens/colors.d.ts +168 -168
  39. package/dist/theme/tokens/shadows.d.ts +5 -5
  40. package/dist/{theme-Dq4r3aRE.js → theme-0SQvHr1t.js} +140 -158
  41. package/dist/theme-0SQvHr1t.js.map +1 -0
  42. package/dist/theme.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/rich-message-DeJwzVeV.js.map +0 -1
  45. package/dist/theme-Dq4r3aRE.js.map +0 -1
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { ActivityActor } from './activity.types';
3
+ export interface ActivityAvatarProps {
4
+ actor?: ActivityActor;
5
+ icon?: ReactNode;
6
+ color?: string;
7
+ background?: string;
8
+ }
9
+ export declare const ActivityAvatar: (props: ActivityAvatarProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { HTMLChakraProps } from '@chakra-ui/react';
2
+ import { ReactNode } from 'react';
3
+ import { ActivityActor } from './activity.types';
4
+ export interface ActivityCommentProps extends Omit<HTMLChakraProps<"article">, "title"> {
5
+ actor: ActivityActor;
6
+ timestamp?: ReactNode;
7
+ actions?: ReactNode;
8
+ replies?: ReactNode;
9
+ composer?: ReactNode;
10
+ children: ReactNode;
11
+ }
12
+ export interface ActivityReplyProps extends Omit<HTMLChakraProps<"div">, "title"> {
13
+ actor: ActivityActor;
14
+ timestamp?: ReactNode;
15
+ actions?: ReactNode;
16
+ children: ReactNode;
17
+ }
18
+ export declare const ActivityReply: (props: ActivityReplyProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const ActivityComment: (props: ActivityCommentProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { HTMLChakraProps } from '@chakra-ui/react';
2
+ import { ReactNode } from 'react';
3
+ import { ActivityActor } from './activity.types';
4
+ export interface ActivityComposerProps extends Omit<HTMLChakraProps<"form">, "onChange" | "onSubmit"> {
5
+ actor?: ActivityActor;
6
+ value?: string;
7
+ defaultValue?: string;
8
+ placeholder?: string;
9
+ variant?: "standalone" | "inline";
10
+ minRows?: number;
11
+ attachLabel?: string;
12
+ submitLabel?: string;
13
+ actions?: ReactNode;
14
+ onAttach?: () => void;
15
+ onChange?: (value: string) => void;
16
+ onSubmit?: (value: string) => void;
17
+ }
18
+ export declare const ActivityComposer: (props: ActivityComposerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { TimelineItemProps } from '@chakra-ui/react';
2
+ import { ReactNode } from 'react';
3
+ import { ActivityActor } from './activity.types';
4
+ export interface ActivityEventProps extends Omit<TimelineItemProps, "title"> {
5
+ actor?: ActivityActor;
6
+ icon?: ReactNode;
7
+ iconColor?: string;
8
+ iconBackground?: string;
9
+ timestamp?: ReactNode;
10
+ children: ReactNode;
11
+ }
12
+ export declare const ActivityEvent: (props: ActivityEventProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { StackProps } from '@chakra-ui/react';
2
+ import { ReactNode } from 'react';
3
+ export interface ActivityRootProps extends StackProps {
4
+ children: ReactNode;
5
+ }
6
+ export interface ActivityHeaderProps extends Omit<StackProps, "title"> {
7
+ title?: ReactNode;
8
+ actions?: ReactNode;
9
+ }
10
+ export interface ActivityFeedProps extends StackProps {
11
+ children: ReactNode;
12
+ }
13
+ export declare const ActivityRoot: (props: ActivityRootProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const ActivityHeader: (props: ActivityHeaderProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const ActivityFeed: (props: ActivityFeedProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { TimelineRootProps } from '@chakra-ui/react';
2
+ import { ReactNode } from 'react';
3
+ export interface ActivityTimelineProps extends TimelineRootProps {
4
+ children: ReactNode;
5
+ }
6
+ export declare const ActivityTimeline: (props: ActivityTimelineProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export interface ActivityActor {
2
+ name: string;
3
+ avatarSrc?: string;
4
+ avatarAlt?: string;
5
+ }
@@ -0,0 +1,25 @@
1
+ import { ActivityAvatar } from './activity-avatar';
2
+ import { ActivityComment, ActivityReply } from './activity-comment';
3
+ import { ActivityComposer } from './activity-composer';
4
+ import { ActivityEvent } from './activity-event';
5
+ import { ActivityFeed, ActivityHeader, ActivityRoot } from './activity-root';
6
+ import { ActivityTimeline } from './activity-timeline';
7
+ export type { ActivityActor } from './activity.types';
8
+ export type { ActivityAvatarProps } from './activity-avatar';
9
+ export type { ActivityCommentProps, ActivityReplyProps } from './activity-comment';
10
+ export type { ActivityComposerProps } from './activity-composer';
11
+ export type { ActivityEventProps } from './activity-event';
12
+ export type { ActivityFeedProps, ActivityHeaderProps, ActivityRootProps } from './activity-root';
13
+ export type { ActivityTimelineProps } from './activity-timeline';
14
+ export { ActivityAvatar, ActivityComment, ActivityComposer, ActivityEvent, ActivityFeed, ActivityHeader, ActivityReply, ActivityRoot, ActivityTimeline, };
15
+ export declare const Activity: {
16
+ Root: (props: import('./activity-root').ActivityRootProps) => import("react/jsx-runtime").JSX.Element;
17
+ Header: (props: import('./activity-root').ActivityHeaderProps) => import("react/jsx-runtime").JSX.Element;
18
+ Feed: (props: import('./activity-root').ActivityFeedProps) => import("react/jsx-runtime").JSX.Element;
19
+ Timeline: (props: import('./activity-timeline').ActivityTimelineProps) => import("react/jsx-runtime").JSX.Element;
20
+ Event: (props: import('./activity-event').ActivityEventProps) => import("react/jsx-runtime").JSX.Element;
21
+ Comment: (props: import('./activity-comment').ActivityCommentProps) => import("react/jsx-runtime").JSX.Element;
22
+ Reply: (props: import('./activity-comment').ActivityReplyProps) => import("react/jsx-runtime").JSX.Element;
23
+ Composer: (props: import('./activity-composer').ActivityComposerProps) => import("react/jsx-runtime").JSX.Element;
24
+ Avatar: (props: import('./activity-avatar').ActivityAvatarProps) => import("react/jsx-runtime").JSX.Element;
25
+ };
@@ -9,13 +9,13 @@ export declare const conversationRootDefaultProps: {
9
9
  readonly role: "log";
10
10
  };
11
11
  export declare const ConversationRoot: import('@chakra-ui/react').ChakraComponent<import('react').ElementType, {
12
- title?: string | undefined | undefined;
13
12
  color?: string | undefined | undefined;
14
13
  translate?: "yes" | "no" | undefined | undefined;
15
14
  content?: string | undefined | undefined;
16
15
  resize?: import('use-stick-to-bottom').Animation | undefined;
17
16
  slot?: string | undefined | undefined;
18
17
  style?: import('react').CSSProperties | undefined;
18
+ title?: string | undefined | undefined;
19
19
  defaultChecked?: boolean | undefined | undefined;
20
20
  defaultValue?: string | number | readonly string[] | undefined;
21
21
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -24,7 +24,7 @@ export declare const ConversationRoot: import('@chakra-ui/react').ChakraComponen
24
24
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
25
25
  autoFocus?: boolean | undefined | undefined;
26
26
  className?: string | undefined | undefined;
27
- contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
27
+ contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
28
28
  contextMenu?: string | undefined | undefined;
29
29
  dir?: string | undefined | undefined;
30
30
  draggable?: (boolean | "true" | "false") | undefined;
@@ -309,13 +309,13 @@ export declare const conversationScrollButtonContainerDefaultProps: {
309
309
  export declare const ConversationScrollButton: (props: ConversationScrollButtonProps) => false | import("react/jsx-runtime").JSX.Element;
310
310
  export declare const ChatPrimitives: {
311
311
  readonly Root: import('@chakra-ui/react').ChakraComponent<import('react').ElementType, {
312
- title?: string | undefined | undefined;
313
312
  color?: string | undefined | undefined;
314
313
  translate?: "yes" | "no" | undefined | undefined;
315
314
  content?: string | undefined | undefined;
316
315
  resize?: import('use-stick-to-bottom').Animation | undefined;
317
316
  slot?: string | undefined | undefined;
318
317
  style?: import('react').CSSProperties | undefined;
318
+ title?: string | undefined | undefined;
319
319
  defaultChecked?: boolean | undefined | undefined;
320
320
  defaultValue?: string | number | readonly string[] | undefined;
321
321
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -324,7 +324,7 @@ export declare const ChatPrimitives: {
324
324
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
325
325
  autoFocus?: boolean | undefined | undefined;
326
326
  className?: string | undefined | undefined;
327
- contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
327
+ contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
328
328
  contextMenu?: string | undefined | undefined;
329
329
  dir?: string | undefined | undefined;
330
330
  draggable?: (boolean | "true" | "false") | undefined;
@@ -1,4 +1,5 @@
1
1
  import { Klass, LexicalNode } from 'lexical';
2
2
  export declare const editorNodes: Array<Klass<LexicalNode>>;
3
+ export declare const baseEditorTransformers: import('@lexical/markdown').Transformer[];
3
4
  export declare const editorTransformers: import('@lexical/markdown').Transformer[];
4
5
  export declare const editorTheme: import('lexical').EditorThemeClasses;
@@ -0,0 +1,16 @@
1
+ import { LexicalEditor } from 'lexical';
2
+ import { BlockType } from './resolve-block-type';
3
+ interface FloatingToolbarButtonsProps {
4
+ editor: LexicalEditor;
5
+ blockType: BlockType;
6
+ isBold: boolean;
7
+ isItalic: boolean;
8
+ isUnderline: boolean;
9
+ isLink: boolean;
10
+ formatHeading: (headingSize: "h1" | "h2" | "h3") => void;
11
+ formatList: (type: "bullet" | "number" | "check") => void;
12
+ formatCodeBlock: () => void;
13
+ insertLink: () => void;
14
+ }
15
+ export declare function FloatingToolbarButtons(props: FloatingToolbarButtonsProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,2 @@
1
+ import { LexicalCommand } from 'lexical';
2
+ export declare const TOGGLE_LINK_EDIT_MODE_COMMAND: LexicalCommand<boolean>;
@@ -0,0 +1,3 @@
1
+ export { TOGGLE_LINK_EDIT_MODE_COMMAND } from './commands';
2
+ export { default as LinkEditorPlugin } from './LinkEditorPlugin';
3
+ export { default as LinkPlugin } from './LinkPlugin';
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ interface LinkEditorContentProps {
3
+ isActive: boolean;
4
+ isLinkEditMode: boolean;
5
+ editedLinkUrl: string;
6
+ editedLinkUrlIsValid: boolean;
7
+ linkUrl: string;
8
+ href: string;
9
+ inputRef: React.RefObject<HTMLInputElement | null>;
10
+ onEditedLinkUrlChange: (url: string) => void;
11
+ onInputKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
12
+ onClose: () => void;
13
+ onSubmit: () => void;
14
+ onEdit: () => void;
15
+ onRemove: () => void;
16
+ }
17
+ export declare function LinkEditorContent(props: LinkEditorContentProps): import("react/jsx-runtime").JSX.Element | null;
18
+ export {};
@@ -0,0 +1 @@
1
+ export declare function shouldCancelLinkEdit(isLinkEditMode: boolean, isLink: boolean, linkUrl: string): boolean;
@@ -0,0 +1,2 @@
1
+ import { RangeSelection } from 'lexical';
2
+ export declare function getSelectionLinkUrl(selection: RangeSelection): string;
@@ -1 +1 @@
1
- export declare function setFloatingElemPos(targetRect: DOMRect | null, floatingElem: HTMLElement, anchorElem: HTMLElement, verticalGap?: number, horizontalOffset?: number): void;
1
+ export declare function setFloatingElemPos(targetRect: DOMRect | null, floatingElem: HTMLElement, anchorElem: HTMLElement, verticalGap?: number, horizontalOffset?: number, placement?: "above" | "legacy"): void;
@@ -0,0 +1,3 @@
1
+ import { editorTransformers } from '../editor-config';
2
+ export { editorTransformers };
3
+ export declare function createHeadlessEditor(): import('lexical').LexicalEditor;
@@ -3,6 +3,7 @@ import { TextNode } from 'lexical';
3
3
  export declare const TABLE: ElementTransformer;
4
4
  export declare const UNDERLINE_INS_TAG: TextMatchTransformer;
5
5
  export declare const UNDERLINE_U_TAG: TextMatchTransformer;
6
+ export declare const LINK: TextMatchTransformer;
6
7
  export declare const BARE_URL: TextMatchTransformer;
7
8
  export declare const TRANSFORMERS_EXTENDED: (Readonly<{
8
9
  dependencies: Array<import('lexical').Klass<import('lexical').LexicalNode>>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { ChakraProvider } from '@chakra-ui/react';
2
+ export type { ActivityActor, ActivityAvatarProps, ActivityCommentProps, ActivityComposerProps, ActivityEventProps, ActivityFeedProps, ActivityHeaderProps, ActivityReplyProps, ActivityRootProps, ActivityTimelineProps, } from './components/activity';
3
+ export { Activity, ActivityAvatar, ActivityComment, ActivityComposer, ActivityEvent, ActivityFeed, ActivityHeader, ActivityReply, ActivityRoot, ActivityTimeline, } from './components/activity';
2
4
  export type { AlertProps } from './components/alert';
3
5
  export { AlertMessage } from './components/alert';
4
6
  export { AttachedPanel } from './components/attached-panel';