@trii/components 3.1.13 → 3.1.14

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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { IContact, IBusiness, IContactAddress, IIntegrationButton } from '@trii/types/dist/Contacts';
3
+ import { IContact, IBusiness, IContactAddress, IIntegrationButton, IContactField, Property } from '@trii/types/dist/Contacts';
4
4
  import { Spaces } from '@trii/types';
5
5
  import { SxProps, Theme } from '@mui/material';
6
6
  import { IContact as IContact$1, IBusiness as IBusiness$1 } from '@trii/types/dist/Contacts/contacts';
@@ -776,6 +776,31 @@ declare const DEFAULT_LIGHT_ICON_COLOR = "#334155";
776
776
  declare const DEFAULT_DARK_ICON_COLOR = "#e2e8f0";
777
777
  declare function resolveButtonIconColor(colors: ButtonIconColors, mode: "light" | "dark"): string | undefined;
778
778
 
779
+ interface HighlightedContactFieldsProps {
780
+ fields: IContactField[];
781
+ properties: Property[];
782
+ user?: {
783
+ dateFormat?: string;
784
+ timeFormat?: string;
785
+ } | null;
786
+ title?: string;
787
+ }
788
+ /** Shared read-only highlights for contact/company records and conversation sidebars. */
789
+ declare function HighlightedContactFields({ fields, properties, user, title, }: HighlightedContactFieldsProps): react_jsx_runtime.JSX.Element;
790
+
791
+ interface ContactMessageMediaProps {
792
+ baseUrl: string;
793
+ spaceId: string;
794
+ /** Contact ID, not a business ID. Choose a linked contact for business histories. */
795
+ contactId: string;
796
+ resolveMediaUrl: (url: string) => Promise<string>;
797
+ language?: string;
798
+ dateFormat?: string;
799
+ timeFormat?: string;
800
+ height?: number | string;
801
+ }
802
+ declare function ContactMessageMedia(props: ContactMessageMediaProps): react_jsx_runtime.JSX.Element;
803
+
779
804
  declare const i18nInstance: i18next.i18n;
780
805
 
781
806
  /**
@@ -953,4 +978,4 @@ declare const darkBlue: Theme;
953
978
  /** @deprecated Use darkTheme. */
954
979
  declare const darkBlack: Theme;
955
980
 
956
- export { AsyncContent, type AsyncContentProps, type AsyncData, type AsyncState, type AsyncStatus, BUTTON_ICONS, BUTTON_ICON_CATEGORIES, type ButtonIconCategory, type ButtonIconColors, type ButtonIconDefinition, type Calendar, type Contact, ContactInfoPopup, ChatDetailsSidebar as ContactSidebar, type ChatDetailsSidebarProps as ContactSidebarProps, DEFAULT_BUTTON_ICON, DEFAULT_DARK_ICON_COLOR, DEFAULT_LIGHT_ICON_COLOR, EditContactModal, type EditContactModalProps, type EditContactMode, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, type EventData, EventsDialog, type EventsDialogProps, IntegrationButtonIcon, type IntegrationButtonIconProps, type IsEmptyFn, type ItemType, type LegacyThemeName, type ModalMode, MuiComponentsConfig, type MuiComponentsConfigOptions, type Notification, PanelErrorBoundary, type PanelErrorBoundaryProps, type ResolvedTheme, type SidebarChatIntegration, type StartConversationTarget, THEME_PREFERENCES, type TaskData, type ThemeName, type ThemePreference, type ThemeRootState, type ThemeState, type UseAsyncDataResult, asyncIdle, asyncRequestFailed, asyncRequestStarted, asyncRequestSucceeded, darkBlack, darkBlue, darkTheme, defaultIsEmpty, deriveAsyncState, findButtonIcon, getErrorMessage, i18nInstance as i18n, isStale, isValidThemeName, lightAmber, lightBlue, lightBlueIndigo, lightBrown, lightGray, lightGreen, lightLime, lightOrange, lightPink, lightPurple, lightRed, lightTeal, lightTheme, lightYellow, normalizeIconSearch, normalizeThemePreference, observeThemePreference, resolveButtonIconColor, resolveThemePreference, selectDarkTheme, selectTheme, selectThemePreference, selectThemeToggleStatus, selectedDarkTheme, selectedTheme, systemThemeChanged, _default as themeReducer, toggleModeTheme, toggleTheme, updateTheme, useAsyncData };
981
+ export { AsyncContent, type AsyncContentProps, type AsyncData, type AsyncState, type AsyncStatus, BUTTON_ICONS, BUTTON_ICON_CATEGORIES, type ButtonIconCategory, type ButtonIconColors, type ButtonIconDefinition, type Calendar, type Contact, ContactInfoPopup, ContactMessageMedia, type ContactMessageMediaProps, ChatDetailsSidebar as ContactSidebar, type ChatDetailsSidebarProps as ContactSidebarProps, DEFAULT_BUTTON_ICON, DEFAULT_DARK_ICON_COLOR, DEFAULT_LIGHT_ICON_COLOR, EditContactModal, type EditContactModalProps, type EditContactMode, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, type EventData, EventsDialog, type EventsDialogProps, HighlightedContactFields, type HighlightedContactFieldsProps, IntegrationButtonIcon, type IntegrationButtonIconProps, type IsEmptyFn, type ItemType, type LegacyThemeName, type ModalMode, MuiComponentsConfig, type MuiComponentsConfigOptions, type Notification, PanelErrorBoundary, type PanelErrorBoundaryProps, type ResolvedTheme, type SidebarChatIntegration, type StartConversationTarget, THEME_PREFERENCES, type TaskData, type ThemeName, type ThemePreference, type ThemeRootState, type ThemeState, type UseAsyncDataResult, asyncIdle, asyncRequestFailed, asyncRequestStarted, asyncRequestSucceeded, darkBlack, darkBlue, darkTheme, defaultIsEmpty, deriveAsyncState, findButtonIcon, getErrorMessage, i18nInstance as i18n, isStale, isValidThemeName, lightAmber, lightBlue, lightBlueIndigo, lightBrown, lightGray, lightGreen, lightLime, lightOrange, lightPink, lightPurple, lightRed, lightTeal, lightTheme, lightYellow, normalizeIconSearch, normalizeThemePreference, observeThemePreference, resolveButtonIconColor, resolveThemePreference, selectDarkTheme, selectTheme, selectThemePreference, selectThemeToggleStatus, selectedDarkTheme, selectedTheme, systemThemeChanged, _default as themeReducer, toggleModeTheme, toggleTheme, updateTheme, useAsyncData };
@@ -0,0 +1,12 @@
1
+ export interface ContactMessageMediaProps {
2
+ baseUrl: string;
3
+ spaceId: string;
4
+ /** Contact ID, not a business ID. Choose a linked contact for business histories. */
5
+ contactId: string;
6
+ resolveMediaUrl: (url: string) => Promise<string>;
7
+ language?: string;
8
+ dateFormat?: string;
9
+ timeFormat?: string;
10
+ height?: number | string;
11
+ }
12
+ export default function ContactMessageMedia(props: ContactMessageMediaProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,14 @@
1
- import { Property } from '@trii/types/dist/Contacts';
1
+ import { Property, IContactField } from '@trii/types/dist/Contacts';
2
2
  interface Props {
3
3
  properties: Property[];
4
4
  compact?: boolean;
5
5
  }
6
6
  declare const Properties: ({ properties, compact }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare function PropertyValues({ properties, compact, fields: customContactFields, user, }: Props & {
8
+ fields: IContactField[];
9
+ user?: {
10
+ dateFormat?: string;
11
+ timeFormat?: string;
12
+ } | null;
13
+ }): import("react/jsx-runtime").JSX.Element;
7
14
  export default Properties;
@@ -1,4 +1,9 @@
1
1
  import React from 'react';
2
+ import type { MediaResource } from '../../../../context/SidebarDataContext';
3
+ export declare function MediaPanel({ media, expanded }: {
4
+ media: MediaResource;
5
+ expanded?: boolean;
6
+ }): import("react/jsx-runtime").JSX.Element;
2
7
  declare const ContactMedia: React.ForwardRefExoticComponent<{
3
8
  contactId: string;
4
9
  defaultExpanded?: boolean;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ export interface MediaEnvironment {
3
+ resolveMediaUrl: (url: string) => Promise<string>;
4
+ currentUser?: {
5
+ dateFormat?: string;
6
+ timeFormat?: string;
7
+ } | null;
8
+ }
9
+ export declare const MediaEnvironmentContext: import("react").Context<MediaEnvironment>;
10
+ export declare function useMediaEnvironment(): MediaEnvironment;
@@ -36,5 +36,6 @@ export declare const SidebarIdentityProvider: ({ children, }: {
36
36
  children: ReactNode;
37
37
  }) => import("react/jsx-runtime").JSX.Element;
38
38
  export declare function useSidebarIdentity(): SidebarIdentityValue;
39
+ export declare function useOptionalSidebarIdentity(): SidebarIdentityValue;
39
40
  /** Solo para tests: descarta la identidad cacheada entre casos. */
40
41
  export declare function __resetIdentityCache(): void;
@@ -0,0 +1,3 @@
1
+ import type { MediaResource } from '../context/SidebarDataContext';
2
+ import type { SidebarApiConfig } from '../context/SidebarPropsContext';
3
+ export default function useContactMedia(api: SidebarApiConfig, contactId: string | null): MediaResource;
@@ -13,6 +13,7 @@ type Props = {
13
13
  baseUrl?: string;
14
14
  spaceId?: string;
15
15
  onEntityUpdated?: (entity: unknown) => void;
16
+ onEditingChange?: (editing: boolean) => void;
16
17
  };
17
- declare const EntityCustomFieldLabel: ({ property, entity, entityType, entityId, customContactFields, userTrii, baseUrl, spaceId, onEntityUpdated, }: Props) => import("react/jsx-runtime").JSX.Element;
18
+ declare const EntityCustomFieldLabel: ({ property, entity, entityType, entityId, customContactFields, userTrii, baseUrl, spaceId, onEntityUpdated, onEditingChange, }: Props) => import("react/jsx-runtime").JSX.Element;
18
19
  export default EntityCustomFieldLabel;
@@ -0,0 +1,12 @@
1
+ import type { IContactField, Property } from '@trii/types/dist/Contacts';
2
+ export interface HighlightedContactFieldsProps {
3
+ fields: IContactField[];
4
+ properties: Property[];
5
+ user?: {
6
+ dateFormat?: string;
7
+ timeFormat?: string;
8
+ } | null;
9
+ title?: string;
10
+ }
11
+ /** Shared read-only highlights for contact/company records and conversation sidebars. */
12
+ export default function HighlightedContactFields({ fields, properties, user, title, }: HighlightedContactFieldsProps): import("react/jsx-runtime").JSX.Element;
@@ -15,3 +15,7 @@ export type { PanelErrorBoundaryProps } from './PanelErrorBoundary';
15
15
  export { default as ContactSidebar } from './ContactSidebar';
16
16
  export type { ContactSidebarProps, SidebarChatIntegration, StartConversationTarget, } from './ContactSidebar';
17
17
  export * from './IntegrationButtonIcon';
18
+ export { default as HighlightedContactFields } from './HighlightedContactFields';
19
+ export type { HighlightedContactFieldsProps } from './HighlightedContactFields';
20
+ export { default as ContactMessageMedia } from './ContactMessageMedia';
21
+ export type { ContactMessageMediaProps } from './ContactMessageMedia';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/components",
3
- "version": "3.1.13",
3
+ "version": "3.1.14",
4
4
  "description": "Trii components package",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",