@universe-platform/ui 0.1.0-beta.15 → 0.1.0-beta.17
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/globals.css +669 -15
- package/dist/index.d.mts +150 -5
- package/dist/index.d.ts +150 -5
- package/dist/index.js +7552 -1203
- package/dist/index.mjs +7549 -1184
- package/dist/phone.d.mts +8 -1
- package/dist/phone.d.ts +8 -1
- package/dist/phone.js +14 -0
- package/dist/phone.mjs +13 -0
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
|
@@ -3,9 +3,13 @@ import { ColumnDef } from './columns';
|
|
|
3
3
|
export { BaseColumnDef, COLUMN_CAPABILITIES, COLUMN_DEFAULT_INPUT_CONFIG, COLUMN_TYPES, COLUMN_TYPE_LABELS, ColumnCapabilities, ColumnConfig, ColumnConfigMap, ColumnDef, ColumnDefaultInputConfig, ColumnInfo, ColumnType, CurrencyConfig, ExtendedColumnInfo, GoogleContactConfig, GoogleContactNamePart, PhoneConfig, RelationConfig, SubTableConfig, TEXT_REPRESENTABLE_TYPES, TextRepresentableColumnType, TypedColumnDef, isTextRepresentable } from './columns';
|
|
4
4
|
import { RecordData, CellValue } from './records';
|
|
5
5
|
export { CellValue, ColumnValueMap, DriveFileValue, GoogleContactValue, LinkValue, RecordData, SubTableEntryValue, SubTableResolvedEntryValue } from './records';
|
|
6
|
-
|
|
6
|
+
import { WhatsAppConfig } from './pages';
|
|
7
|
+
export { BaseComponent, ComponentType, EditorApp, EditorPage, PageComponent, PageInput, TableComponent, WhatsAppConfig } from './pages';
|
|
7
8
|
import { SchemaDef } from './schema';
|
|
8
9
|
export { SchemaDef, TableMeta } from './schema';
|
|
10
|
+
import { TemplateIdentity } from './whatsappValidation';
|
|
11
|
+
export * from './whatsappValidation';
|
|
12
|
+
export { StatusConfig, TemplateIdentity, TemplateValidationParams, TemplateValidationResult, extractUniqueVariableIndices, extractVariableIndices, findVariableAtPosition, formatFileSize, getNextVariableIndex, getStatusConfig, hasBracketSpaces, hasConsecutiveVariables, hasFloatingVariables, hasInsufficientContextBetweenVariables, isDuplicateTemplate, isDuplicateTemplateName, isValidTemplateName, isWordToken, reindexVariables, sanitizeTemplateNameInput, seamlessVariableEngine, validateSequentialVariables, validateTemplateBody, validateWhatsAppTemplate, validateWordToVariableRatio } from './whatsappValidation';
|
|
9
13
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
10
14
|
import * as react from 'react';
|
|
11
15
|
import react__default, { ReactNode } from 'react';
|
|
@@ -26,6 +30,36 @@ declare function openWhatsAppChat(phone: string, defaultCountryCode?: string): v
|
|
|
26
30
|
*/
|
|
27
31
|
declare function formatPhoneDisplay(phone: string): string;
|
|
28
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Phone number sanitization, validation, and WhatsApp link generation utilities.
|
|
35
|
+
* Pure functions with zero React or DOM dependencies for universal (server & client) usage.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Sanitizes phone numbers by stripping whitespace, dashes, and non-numeric characters,
|
|
39
|
+
* preserving a leading '+' if present.
|
|
40
|
+
*/
|
|
41
|
+
declare function sanitizePhoneNumber(phone: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Validates whether a phone number is valid (after sanitization).
|
|
44
|
+
* Supports Israeli formats (e.g. 0501234567, 031234567) and international formats (+972..., 9-15 digits).
|
|
45
|
+
*/
|
|
46
|
+
declare function isValidPhoneNumber(phone: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Generates an official wa.me WhatsApp direct message link.
|
|
49
|
+
*
|
|
50
|
+
* @param phone Raw or sanitized phone number
|
|
51
|
+
* @param defaultCountryCode Defaults to Israeli code '972'
|
|
52
|
+
* @returns WhatsApp URL or null if phone is empty
|
|
53
|
+
*/
|
|
54
|
+
declare function generateWhatsAppLink(phone: string, defaultCountryCode?: string): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Normalizes a phone number for WhatsApp sending (E.164 without leading '+').
|
|
57
|
+
* - Strips spaces, dashes, and special characters.
|
|
58
|
+
* - If it starts with '05' (10 digits), replaces the leading '0' with '972' (e.g., '0586812807' -> '972586812807').
|
|
59
|
+
* - If it starts with '+', strips the '+'.
|
|
60
|
+
*/
|
|
61
|
+
declare function normalizePhoneForWhatsApp(phone: string): string;
|
|
62
|
+
|
|
29
63
|
interface PastelPalette {
|
|
30
64
|
bg: string;
|
|
31
65
|
text: string;
|
|
@@ -78,16 +112,23 @@ interface RolePermissions {
|
|
|
78
112
|
permissions: ComponentPermissions;
|
|
79
113
|
readOnly: boolean;
|
|
80
114
|
}
|
|
81
|
-
declare function getRolePermissions(role?: OrgRole |
|
|
115
|
+
declare function getRolePermissions(role?: OrgRole | null): RolePermissions;
|
|
82
116
|
|
|
83
117
|
interface TableConfig extends SchemaDef {
|
|
84
118
|
}
|
|
85
119
|
type TableData = RecordData[];
|
|
120
|
+
type RowStatusType = "success" | "failed" | "skipped" | "partial";
|
|
86
121
|
interface TableBlockProps extends Partial<BaseComponentProps<TableData, TableConfig>> {
|
|
87
122
|
exportAction?: (payload: any) => Promise<any>;
|
|
88
|
-
role?: OrgRole |
|
|
123
|
+
role?: OrgRole | null;
|
|
89
124
|
permissions?: ComponentPermissions;
|
|
90
125
|
readOnly?: boolean;
|
|
126
|
+
onSelectionChange?: (selectedIds: string[]) => void;
|
|
127
|
+
rowStatusMap?: Record<string, {
|
|
128
|
+
status: RowStatusType;
|
|
129
|
+
tooltip?: string;
|
|
130
|
+
} | RowStatusType>;
|
|
131
|
+
editModelUrl?: string;
|
|
91
132
|
}
|
|
92
133
|
interface CreateRecordPayload {
|
|
93
134
|
records: RecordData[];
|
|
@@ -264,13 +305,117 @@ interface RelationFilterPopoverProps {
|
|
|
264
305
|
}
|
|
265
306
|
declare function RelationFilterPopover({ isOpen, onClose, column, triggerRect, options, filterValue, selectedValues, onSelectionChange, isLoading, }: RelationFilterPopoverProps): react_jsx_runtime.JSX.Element | null;
|
|
266
307
|
|
|
308
|
+
/**
|
|
309
|
+
* useSmartTooltip - Reusable hook for detecting text truncation and rendering
|
|
310
|
+
* a custom portal tooltip bubble strictly when content is clipped (scrollWidth > clientWidth).
|
|
311
|
+
*/
|
|
312
|
+
declare function useSmartTooltip<T extends HTMLElement = HTMLElement>(): {
|
|
313
|
+
targetRef: react__default.RefObject<T | null>;
|
|
314
|
+
checkTruncation: () => boolean;
|
|
315
|
+
handleMouseEnter: () => void;
|
|
316
|
+
handleMouseLeave: () => void;
|
|
317
|
+
hideBubble: () => void;
|
|
318
|
+
renderTooltip: (text?: string, dir?: "ltr" | "rtl" | "auto") => react__default.ReactPortal | null;
|
|
319
|
+
isTruncated: boolean;
|
|
320
|
+
showBubble: boolean;
|
|
321
|
+
};
|
|
322
|
+
interface TruncatedTooltipProps {
|
|
323
|
+
text: string;
|
|
324
|
+
tooltipText?: string;
|
|
325
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
326
|
+
className?: string;
|
|
327
|
+
wrapperClassName?: string;
|
|
328
|
+
children?: react__default.ReactNode;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* TruncatedTooltip - A text container that applies ellipsis truncation
|
|
332
|
+
* and only displays a custom portal tooltip when text overflows horizontal bounds.
|
|
333
|
+
* Expands to full cell dimensions (w-full h-full min-h-[inherit]) for reliable hover detection.
|
|
334
|
+
* No native browser title attribute is rendered.
|
|
335
|
+
*/
|
|
336
|
+
declare const TruncatedTooltip: react__default.FC<TruncatedTooltipProps>;
|
|
337
|
+
interface SmartTextCellProps {
|
|
338
|
+
value: any;
|
|
339
|
+
onChange?: (val: any) => void;
|
|
340
|
+
readOnly?: boolean;
|
|
341
|
+
type?: 'text' | 'number' | 'tel';
|
|
342
|
+
placeholder?: string;
|
|
343
|
+
className?: string;
|
|
344
|
+
prefix?: react__default.ReactNode;
|
|
345
|
+
suffix?: react__default.ReactNode;
|
|
346
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
347
|
+
tooltipText?: string;
|
|
348
|
+
step?: string;
|
|
349
|
+
onFocus?: (e: react__default.FocusEvent<HTMLInputElement>) => void;
|
|
350
|
+
onBlur?: (e: react__default.FocusEvent<HTMLInputElement>) => void;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* SmartTextCell - Text cell with intelligent hover tooltip.
|
|
354
|
+
* Only displays the custom portal tooltip bubble if the text is actually
|
|
355
|
+
* clipped/truncated within its visible boundary (scrollWidth > clientWidth).
|
|
356
|
+
* Native title attributes are omitted to prevent duplicate tooltips.
|
|
357
|
+
*/
|
|
358
|
+
declare const SmartTextCell: react__default.FC<SmartTextCellProps>;
|
|
359
|
+
|
|
360
|
+
interface MetaTemplateComponent {
|
|
361
|
+
type: "HEADER" | "BODY" | "FOOTER" | "BUTTONS" | string;
|
|
362
|
+
format?: "TEXT" | "IMAGE" | "DOCUMENT" | "VIDEO" | string;
|
|
363
|
+
text?: string;
|
|
364
|
+
example?: {
|
|
365
|
+
header_handle?: string[];
|
|
366
|
+
body_text?: string[][];
|
|
367
|
+
[key: string]: any;
|
|
368
|
+
};
|
|
369
|
+
[key: string]: any;
|
|
370
|
+
}
|
|
371
|
+
interface MetaWhatsAppTemplate {
|
|
372
|
+
id: string;
|
|
373
|
+
name: string;
|
|
374
|
+
status: "APPROVED" | "PENDING" | "IN_REVIEW" | "REJECTED" | "PAUSED" | string;
|
|
375
|
+
category: "MARKETING" | "UTILITY" | string;
|
|
376
|
+
language: string;
|
|
377
|
+
components?: MetaTemplateComponent[];
|
|
378
|
+
[key: string]: any;
|
|
379
|
+
}
|
|
380
|
+
type WhatsAppData = any;
|
|
381
|
+
interface WhatsAppComponentProps extends Partial<BaseComponentProps<WhatsAppData, WhatsAppConfig>> {
|
|
382
|
+
permissions?: ComponentPermissions;
|
|
383
|
+
orgId?: string;
|
|
384
|
+
organizationId?: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* WhatsAppComponent
|
|
389
|
+
* High-level orchestrator for the WhatsApp messaging interface.
|
|
390
|
+
* Coordinates template selection, dynamic filters, recipient settings/actions,
|
|
391
|
+
* and the embedded data grid.
|
|
392
|
+
*/
|
|
393
|
+
declare function WhatsAppComponent(props: WhatsAppComponentProps): react_jsx_runtime.JSX.Element;
|
|
394
|
+
|
|
395
|
+
interface CreateTemplateModalProps {
|
|
396
|
+
isOpen: boolean;
|
|
397
|
+
onClose: () => void;
|
|
398
|
+
onSuccess: () => void;
|
|
399
|
+
existingTemplateNames?: string[];
|
|
400
|
+
existingTemplates?: TemplateIdentity[];
|
|
401
|
+
executeAction?: (actionType: string, payload: Record<string, any>) => Promise<any>;
|
|
402
|
+
orgId?: string;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* CreateTemplateModal
|
|
406
|
+
* Enterprise modal dialog for authoring and submitting WhatsApp message templates
|
|
407
|
+
* with atomic variable deletion, flexible editing, and strict word-to-variable ratio validation.
|
|
408
|
+
*/
|
|
409
|
+
declare function CreateTemplateModal({ isOpen, onClose, onSuccess, existingTemplateNames, existingTemplates, executeAction, orgId, }: CreateTemplateModalProps): react_jsx_runtime.JSX.Element | null;
|
|
410
|
+
|
|
267
411
|
/**
|
|
268
412
|
* UNIVERSE_COMPONENTS
|
|
269
|
-
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE")
|
|
413
|
+
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE", "WHATSAPP")
|
|
270
414
|
* to their respective React component implementation.
|
|
271
415
|
*/
|
|
272
416
|
declare const UNIVERSE_COMPONENTS: {
|
|
273
417
|
readonly TABLE: typeof TableBlock;
|
|
418
|
+
readonly WHATSAPP: typeof WhatsAppComponent;
|
|
274
419
|
};
|
|
275
420
|
type ComponentRegistry = typeof UNIVERSE_COMPONENTS;
|
|
276
421
|
type UniverseComponentType = keyof ComponentRegistry;
|
|
@@ -295,4 +440,4 @@ declare function ToastProvider({ children }: {
|
|
|
295
440
|
|
|
296
441
|
declare function useToast(): ToastContextType;
|
|
297
442
|
|
|
298
|
-
export { type BaseComponentProps, ColumnHeaderTitle, type ColumnHeaderTitleProps, type ComponentCommunication, type ComponentConfig, type ComponentData, type ComponentPermissions, type ComponentRegistry, type ComponentState, type CreateRecordPayload, DatePickerCell, type DeleteRecordPayload, LinkPickerCell, type OrgRole, PASTEL_PALETTES, type PastelPalette, type RelationFilterOption, type RelationFilterPayload, RelationFilterPopover, type RelationFilterPopoverProps, RelationPickerCell, type RolePermissions, type SplitTitleResult, TableBlock, type TableBlockProps, type TableConfig, type TableData, TimePickerCell, ToastContext, type ToastContextType, type ToastItem, ToastProvider, UNIVERSE_COMPONENTS, type UniverseComponentType, type UpdateRecordPayload, type UseColumnReorderOptions, type UseColumnResizeOptions, calculateMinColumnWidth, cn, formatConflictCellValue, formatPhoneDisplay, formatTimeInput, formatTimeIso, getDeterministicPastelBadge, getRolePermissions, measureTextWidth, normalizeRelationValue, openWhatsAppChat, parseLinkValue, parseTimeParts, resolveProtocol, splitHeaderTitle, useColumnReorder, useColumnResize, useToast };
|
|
443
|
+
export { type BaseComponentProps, ColumnHeaderTitle, type ColumnHeaderTitleProps, type ComponentCommunication, type ComponentConfig, type ComponentData, type ComponentPermissions, type ComponentRegistry, type ComponentState, type CreateRecordPayload, CreateTemplateModal, type CreateTemplateModalProps, DatePickerCell, type DeleteRecordPayload, LinkPickerCell, type MetaTemplateComponent, type MetaWhatsAppTemplate, type OrgRole, PASTEL_PALETTES, type PastelPalette, type RelationFilterOption, type RelationFilterPayload, RelationFilterPopover, type RelationFilterPopoverProps, RelationPickerCell, type RolePermissions, type RowStatusType, SmartTextCell, type SplitTitleResult, TableBlock, type TableBlockProps, type TableConfig, type TableData, TimePickerCell, ToastContext, type ToastContextType, type ToastItem, ToastProvider, TruncatedTooltip, UNIVERSE_COMPONENTS, type UniverseComponentType, type UpdateRecordPayload, type UseColumnReorderOptions, type UseColumnResizeOptions, WhatsAppComponent, type WhatsAppComponentProps, type WhatsAppData, calculateMinColumnWidth, cn, formatConflictCellValue, formatPhoneDisplay, formatTimeInput, formatTimeIso, generateWhatsAppLink, getDeterministicPastelBadge, getRolePermissions, isValidPhoneNumber, measureTextWidth, normalizePhoneForWhatsApp, normalizeRelationValue, openWhatsAppChat, parseLinkValue, parseTimeParts, resolveProtocol, sanitizePhoneNumber, splitHeaderTitle, useColumnReorder, useColumnResize, useSmartTooltip, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,13 @@ import { ColumnDef } from './columns';
|
|
|
3
3
|
export { BaseColumnDef, COLUMN_CAPABILITIES, COLUMN_DEFAULT_INPUT_CONFIG, COLUMN_TYPES, COLUMN_TYPE_LABELS, ColumnCapabilities, ColumnConfig, ColumnConfigMap, ColumnDef, ColumnDefaultInputConfig, ColumnInfo, ColumnType, CurrencyConfig, ExtendedColumnInfo, GoogleContactConfig, GoogleContactNamePart, PhoneConfig, RelationConfig, SubTableConfig, TEXT_REPRESENTABLE_TYPES, TextRepresentableColumnType, TypedColumnDef, isTextRepresentable } from './columns';
|
|
4
4
|
import { RecordData, CellValue } from './records';
|
|
5
5
|
export { CellValue, ColumnValueMap, DriveFileValue, GoogleContactValue, LinkValue, RecordData, SubTableEntryValue, SubTableResolvedEntryValue } from './records';
|
|
6
|
-
|
|
6
|
+
import { WhatsAppConfig } from './pages';
|
|
7
|
+
export { BaseComponent, ComponentType, EditorApp, EditorPage, PageComponent, PageInput, TableComponent, WhatsAppConfig } from './pages';
|
|
7
8
|
import { SchemaDef } from './schema';
|
|
8
9
|
export { SchemaDef, TableMeta } from './schema';
|
|
10
|
+
import { TemplateIdentity } from './whatsappValidation';
|
|
11
|
+
export * from './whatsappValidation';
|
|
12
|
+
export { StatusConfig, TemplateIdentity, TemplateValidationParams, TemplateValidationResult, extractUniqueVariableIndices, extractVariableIndices, findVariableAtPosition, formatFileSize, getNextVariableIndex, getStatusConfig, hasBracketSpaces, hasConsecutiveVariables, hasFloatingVariables, hasInsufficientContextBetweenVariables, isDuplicateTemplate, isDuplicateTemplateName, isValidTemplateName, isWordToken, reindexVariables, sanitizeTemplateNameInput, seamlessVariableEngine, validateSequentialVariables, validateTemplateBody, validateWhatsAppTemplate, validateWordToVariableRatio } from './whatsappValidation';
|
|
9
13
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
10
14
|
import * as react from 'react';
|
|
11
15
|
import react__default, { ReactNode } from 'react';
|
|
@@ -26,6 +30,36 @@ declare function openWhatsAppChat(phone: string, defaultCountryCode?: string): v
|
|
|
26
30
|
*/
|
|
27
31
|
declare function formatPhoneDisplay(phone: string): string;
|
|
28
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Phone number sanitization, validation, and WhatsApp link generation utilities.
|
|
35
|
+
* Pure functions with zero React or DOM dependencies for universal (server & client) usage.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Sanitizes phone numbers by stripping whitespace, dashes, and non-numeric characters,
|
|
39
|
+
* preserving a leading '+' if present.
|
|
40
|
+
*/
|
|
41
|
+
declare function sanitizePhoneNumber(phone: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Validates whether a phone number is valid (after sanitization).
|
|
44
|
+
* Supports Israeli formats (e.g. 0501234567, 031234567) and international formats (+972..., 9-15 digits).
|
|
45
|
+
*/
|
|
46
|
+
declare function isValidPhoneNumber(phone: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Generates an official wa.me WhatsApp direct message link.
|
|
49
|
+
*
|
|
50
|
+
* @param phone Raw or sanitized phone number
|
|
51
|
+
* @param defaultCountryCode Defaults to Israeli code '972'
|
|
52
|
+
* @returns WhatsApp URL or null if phone is empty
|
|
53
|
+
*/
|
|
54
|
+
declare function generateWhatsAppLink(phone: string, defaultCountryCode?: string): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Normalizes a phone number for WhatsApp sending (E.164 without leading '+').
|
|
57
|
+
* - Strips spaces, dashes, and special characters.
|
|
58
|
+
* - If it starts with '05' (10 digits), replaces the leading '0' with '972' (e.g., '0586812807' -> '972586812807').
|
|
59
|
+
* - If it starts with '+', strips the '+'.
|
|
60
|
+
*/
|
|
61
|
+
declare function normalizePhoneForWhatsApp(phone: string): string;
|
|
62
|
+
|
|
29
63
|
interface PastelPalette {
|
|
30
64
|
bg: string;
|
|
31
65
|
text: string;
|
|
@@ -78,16 +112,23 @@ interface RolePermissions {
|
|
|
78
112
|
permissions: ComponentPermissions;
|
|
79
113
|
readOnly: boolean;
|
|
80
114
|
}
|
|
81
|
-
declare function getRolePermissions(role?: OrgRole |
|
|
115
|
+
declare function getRolePermissions(role?: OrgRole | null): RolePermissions;
|
|
82
116
|
|
|
83
117
|
interface TableConfig extends SchemaDef {
|
|
84
118
|
}
|
|
85
119
|
type TableData = RecordData[];
|
|
120
|
+
type RowStatusType = "success" | "failed" | "skipped" | "partial";
|
|
86
121
|
interface TableBlockProps extends Partial<BaseComponentProps<TableData, TableConfig>> {
|
|
87
122
|
exportAction?: (payload: any) => Promise<any>;
|
|
88
|
-
role?: OrgRole |
|
|
123
|
+
role?: OrgRole | null;
|
|
89
124
|
permissions?: ComponentPermissions;
|
|
90
125
|
readOnly?: boolean;
|
|
126
|
+
onSelectionChange?: (selectedIds: string[]) => void;
|
|
127
|
+
rowStatusMap?: Record<string, {
|
|
128
|
+
status: RowStatusType;
|
|
129
|
+
tooltip?: string;
|
|
130
|
+
} | RowStatusType>;
|
|
131
|
+
editModelUrl?: string;
|
|
91
132
|
}
|
|
92
133
|
interface CreateRecordPayload {
|
|
93
134
|
records: RecordData[];
|
|
@@ -264,13 +305,117 @@ interface RelationFilterPopoverProps {
|
|
|
264
305
|
}
|
|
265
306
|
declare function RelationFilterPopover({ isOpen, onClose, column, triggerRect, options, filterValue, selectedValues, onSelectionChange, isLoading, }: RelationFilterPopoverProps): react_jsx_runtime.JSX.Element | null;
|
|
266
307
|
|
|
308
|
+
/**
|
|
309
|
+
* useSmartTooltip - Reusable hook for detecting text truncation and rendering
|
|
310
|
+
* a custom portal tooltip bubble strictly when content is clipped (scrollWidth > clientWidth).
|
|
311
|
+
*/
|
|
312
|
+
declare function useSmartTooltip<T extends HTMLElement = HTMLElement>(): {
|
|
313
|
+
targetRef: react__default.RefObject<T | null>;
|
|
314
|
+
checkTruncation: () => boolean;
|
|
315
|
+
handleMouseEnter: () => void;
|
|
316
|
+
handleMouseLeave: () => void;
|
|
317
|
+
hideBubble: () => void;
|
|
318
|
+
renderTooltip: (text?: string, dir?: "ltr" | "rtl" | "auto") => react__default.ReactPortal | null;
|
|
319
|
+
isTruncated: boolean;
|
|
320
|
+
showBubble: boolean;
|
|
321
|
+
};
|
|
322
|
+
interface TruncatedTooltipProps {
|
|
323
|
+
text: string;
|
|
324
|
+
tooltipText?: string;
|
|
325
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
326
|
+
className?: string;
|
|
327
|
+
wrapperClassName?: string;
|
|
328
|
+
children?: react__default.ReactNode;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* TruncatedTooltip - A text container that applies ellipsis truncation
|
|
332
|
+
* and only displays a custom portal tooltip when text overflows horizontal bounds.
|
|
333
|
+
* Expands to full cell dimensions (w-full h-full min-h-[inherit]) for reliable hover detection.
|
|
334
|
+
* No native browser title attribute is rendered.
|
|
335
|
+
*/
|
|
336
|
+
declare const TruncatedTooltip: react__default.FC<TruncatedTooltipProps>;
|
|
337
|
+
interface SmartTextCellProps {
|
|
338
|
+
value: any;
|
|
339
|
+
onChange?: (val: any) => void;
|
|
340
|
+
readOnly?: boolean;
|
|
341
|
+
type?: 'text' | 'number' | 'tel';
|
|
342
|
+
placeholder?: string;
|
|
343
|
+
className?: string;
|
|
344
|
+
prefix?: react__default.ReactNode;
|
|
345
|
+
suffix?: react__default.ReactNode;
|
|
346
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
347
|
+
tooltipText?: string;
|
|
348
|
+
step?: string;
|
|
349
|
+
onFocus?: (e: react__default.FocusEvent<HTMLInputElement>) => void;
|
|
350
|
+
onBlur?: (e: react__default.FocusEvent<HTMLInputElement>) => void;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* SmartTextCell - Text cell with intelligent hover tooltip.
|
|
354
|
+
* Only displays the custom portal tooltip bubble if the text is actually
|
|
355
|
+
* clipped/truncated within its visible boundary (scrollWidth > clientWidth).
|
|
356
|
+
* Native title attributes are omitted to prevent duplicate tooltips.
|
|
357
|
+
*/
|
|
358
|
+
declare const SmartTextCell: react__default.FC<SmartTextCellProps>;
|
|
359
|
+
|
|
360
|
+
interface MetaTemplateComponent {
|
|
361
|
+
type: "HEADER" | "BODY" | "FOOTER" | "BUTTONS" | string;
|
|
362
|
+
format?: "TEXT" | "IMAGE" | "DOCUMENT" | "VIDEO" | string;
|
|
363
|
+
text?: string;
|
|
364
|
+
example?: {
|
|
365
|
+
header_handle?: string[];
|
|
366
|
+
body_text?: string[][];
|
|
367
|
+
[key: string]: any;
|
|
368
|
+
};
|
|
369
|
+
[key: string]: any;
|
|
370
|
+
}
|
|
371
|
+
interface MetaWhatsAppTemplate {
|
|
372
|
+
id: string;
|
|
373
|
+
name: string;
|
|
374
|
+
status: "APPROVED" | "PENDING" | "IN_REVIEW" | "REJECTED" | "PAUSED" | string;
|
|
375
|
+
category: "MARKETING" | "UTILITY" | string;
|
|
376
|
+
language: string;
|
|
377
|
+
components?: MetaTemplateComponent[];
|
|
378
|
+
[key: string]: any;
|
|
379
|
+
}
|
|
380
|
+
type WhatsAppData = any;
|
|
381
|
+
interface WhatsAppComponentProps extends Partial<BaseComponentProps<WhatsAppData, WhatsAppConfig>> {
|
|
382
|
+
permissions?: ComponentPermissions;
|
|
383
|
+
orgId?: string;
|
|
384
|
+
organizationId?: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* WhatsAppComponent
|
|
389
|
+
* High-level orchestrator for the WhatsApp messaging interface.
|
|
390
|
+
* Coordinates template selection, dynamic filters, recipient settings/actions,
|
|
391
|
+
* and the embedded data grid.
|
|
392
|
+
*/
|
|
393
|
+
declare function WhatsAppComponent(props: WhatsAppComponentProps): react_jsx_runtime.JSX.Element;
|
|
394
|
+
|
|
395
|
+
interface CreateTemplateModalProps {
|
|
396
|
+
isOpen: boolean;
|
|
397
|
+
onClose: () => void;
|
|
398
|
+
onSuccess: () => void;
|
|
399
|
+
existingTemplateNames?: string[];
|
|
400
|
+
existingTemplates?: TemplateIdentity[];
|
|
401
|
+
executeAction?: (actionType: string, payload: Record<string, any>) => Promise<any>;
|
|
402
|
+
orgId?: string;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* CreateTemplateModal
|
|
406
|
+
* Enterprise modal dialog for authoring and submitting WhatsApp message templates
|
|
407
|
+
* with atomic variable deletion, flexible editing, and strict word-to-variable ratio validation.
|
|
408
|
+
*/
|
|
409
|
+
declare function CreateTemplateModal({ isOpen, onClose, onSuccess, existingTemplateNames, existingTemplates, executeAction, orgId, }: CreateTemplateModalProps): react_jsx_runtime.JSX.Element | null;
|
|
410
|
+
|
|
267
411
|
/**
|
|
268
412
|
* UNIVERSE_COMPONENTS
|
|
269
|
-
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE")
|
|
413
|
+
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE", "WHATSAPP")
|
|
270
414
|
* to their respective React component implementation.
|
|
271
415
|
*/
|
|
272
416
|
declare const UNIVERSE_COMPONENTS: {
|
|
273
417
|
readonly TABLE: typeof TableBlock;
|
|
418
|
+
readonly WHATSAPP: typeof WhatsAppComponent;
|
|
274
419
|
};
|
|
275
420
|
type ComponentRegistry = typeof UNIVERSE_COMPONENTS;
|
|
276
421
|
type UniverseComponentType = keyof ComponentRegistry;
|
|
@@ -295,4 +440,4 @@ declare function ToastProvider({ children }: {
|
|
|
295
440
|
|
|
296
441
|
declare function useToast(): ToastContextType;
|
|
297
442
|
|
|
298
|
-
export { type BaseComponentProps, ColumnHeaderTitle, type ColumnHeaderTitleProps, type ComponentCommunication, type ComponentConfig, type ComponentData, type ComponentPermissions, type ComponentRegistry, type ComponentState, type CreateRecordPayload, DatePickerCell, type DeleteRecordPayload, LinkPickerCell, type OrgRole, PASTEL_PALETTES, type PastelPalette, type RelationFilterOption, type RelationFilterPayload, RelationFilterPopover, type RelationFilterPopoverProps, RelationPickerCell, type RolePermissions, type SplitTitleResult, TableBlock, type TableBlockProps, type TableConfig, type TableData, TimePickerCell, ToastContext, type ToastContextType, type ToastItem, ToastProvider, UNIVERSE_COMPONENTS, type UniverseComponentType, type UpdateRecordPayload, type UseColumnReorderOptions, type UseColumnResizeOptions, calculateMinColumnWidth, cn, formatConflictCellValue, formatPhoneDisplay, formatTimeInput, formatTimeIso, getDeterministicPastelBadge, getRolePermissions, measureTextWidth, normalizeRelationValue, openWhatsAppChat, parseLinkValue, parseTimeParts, resolveProtocol, splitHeaderTitle, useColumnReorder, useColumnResize, useToast };
|
|
443
|
+
export { type BaseComponentProps, ColumnHeaderTitle, type ColumnHeaderTitleProps, type ComponentCommunication, type ComponentConfig, type ComponentData, type ComponentPermissions, type ComponentRegistry, type ComponentState, type CreateRecordPayload, CreateTemplateModal, type CreateTemplateModalProps, DatePickerCell, type DeleteRecordPayload, LinkPickerCell, type MetaTemplateComponent, type MetaWhatsAppTemplate, type OrgRole, PASTEL_PALETTES, type PastelPalette, type RelationFilterOption, type RelationFilterPayload, RelationFilterPopover, type RelationFilterPopoverProps, RelationPickerCell, type RolePermissions, type RowStatusType, SmartTextCell, type SplitTitleResult, TableBlock, type TableBlockProps, type TableConfig, type TableData, TimePickerCell, ToastContext, type ToastContextType, type ToastItem, ToastProvider, TruncatedTooltip, UNIVERSE_COMPONENTS, type UniverseComponentType, type UpdateRecordPayload, type UseColumnReorderOptions, type UseColumnResizeOptions, WhatsAppComponent, type WhatsAppComponentProps, type WhatsAppData, calculateMinColumnWidth, cn, formatConflictCellValue, formatPhoneDisplay, formatTimeInput, formatTimeIso, generateWhatsAppLink, getDeterministicPastelBadge, getRolePermissions, isValidPhoneNumber, measureTextWidth, normalizePhoneForWhatsApp, normalizeRelationValue, openWhatsAppChat, parseLinkValue, parseTimeParts, resolveProtocol, sanitizePhoneNumber, splitHeaderTitle, useColumnReorder, useColumnResize, useSmartTooltip, useToast };
|