@universe-platform/ui 0.1.0-beta.24 → 0.1.0-beta.26

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
@@ -370,6 +370,118 @@ interface SmartTextCellProps {
370
370
  */
371
371
  declare const SmartTextCell: react__default.FC<SmartTextCellProps>;
372
372
 
373
+ interface PlacementConfig {
374
+ sourceTableId: string;
375
+ sourceDisplayFieldId: string;
376
+ targetTableId: string;
377
+ targetFilterField1Id: string;
378
+ targetFilterField2Id: string;
379
+ targetSelectorFieldId: string;
380
+ targetAssignmentFieldId: string;
381
+ title?: string;
382
+ statusColors?: PlacementStatusSetting[];
383
+ defaultReturnStatusId?: string;
384
+ }
385
+ interface PlacementStatusSetting {
386
+ id: string;
387
+ hex: string;
388
+ label: string;
389
+ }
390
+ declare const DEFAULT_PLACEMENT_STATUS_COLORS: PlacementStatusSetting[];
391
+ /** מחזיר את מזהה הסטטוס ההתחלתי התקף: זה שהוגדר, אחרת "3" אם קיים (תאימות לאחור), אחרת הראשון */
392
+ declare function resolveDefaultStatusId(list: PlacementStatusSetting[], wanted?: string): string;
393
+ interface PlacementSettingsProps {
394
+ config: PlacementConfig;
395
+ onChange: (newConfig: PlacementConfig) => void;
396
+ tables: Array<{
397
+ id: string;
398
+ name: string;
399
+ isGlobal?: boolean;
400
+ fields?: any[];
401
+ columns?: any[];
402
+ }>;
403
+ }
404
+ declare const PlacementStatusEditor: react__default.FC<{
405
+ config: PlacementConfig;
406
+ onChange: (newConfig: PlacementConfig) => void;
407
+ }>;
408
+ declare const PlacementSettings: react__default.FC<PlacementSettingsProps>;
409
+
410
+ interface PlacementStatusColor {
411
+ id: string;
412
+ hex: string;
413
+ label: string;
414
+ }
415
+ type ExecuteAction = (actionType: string, payload: Record<string, any>) => Promise<any>;
416
+ interface PlacementBlockProps {
417
+ settings?: any;
418
+ executeAction?: ExecuteAction;
419
+ componentId?: string;
420
+ className?: string;
421
+ config?: PlacementConfig;
422
+ fetchSourceData?: (tableId: string) => Promise<any[]>;
423
+ fetchTargetData?: (tableId: string) => Promise<any[]>;
424
+ updateAssignment?: (targetRecordId: string, sourceRecordId: string) => Promise<void>;
425
+ }
426
+ declare const PlacementBlock: react__default.FC<PlacementBlockProps>;
427
+
428
+ declare const RELATION_SEP = "::";
429
+ declare const RELATION_LABEL_KEY = "__label";
430
+ declare const NON_TEXT_TYPES: string[];
431
+ interface PlacementColumnOption {
432
+ /** הערך שנשמר ב-config (שם עמודה, או "קשר::עמודה") */
433
+ id: string;
434
+ /** מה שמוצג למשתמש */
435
+ name: string;
436
+ type?: string;
437
+ /** תיאור משני (סוג שדה / מאיזו טבלה) */
438
+ description?: string;
439
+ /** שם עמודת הקשר, אם העמודה באה מטבלה קשורה */
440
+ viaRelation?: string;
441
+ /** שם הטבלה הקשורה, אם העמודה באה מטבלה קשורה */
442
+ fromTableName?: string;
443
+ fromGlobalTable?: boolean;
444
+ }
445
+ type AnyTable = {
446
+ id: string;
447
+ name: string;
448
+ isGlobal?: boolean;
449
+ fields?: any[];
450
+ columns?: any[];
451
+ };
452
+ declare const tableColumns: (table?: {
453
+ fields?: any[];
454
+ columns?: any[];
455
+ } | null) => any[];
456
+ declare const isUserColumn: (c: any) => boolean;
457
+ declare const buildRelationRef: (relationColumn: string, field: string) => string;
458
+ declare function parseColumnRef(ref: string): {
459
+ relationColumn?: string;
460
+ field: string;
461
+ };
462
+ /** שם ידידותי להצגה: "עיר מגורים › שם העיר" */
463
+ declare const columnRefLabel: (ref: string) => string;
464
+ /**
465
+ * בונה את רשימת העמודות לבחירה בטבלה: עמודות הטבלה עצמה,
466
+ * ואחריהן (כשהן מותרות) עמודות מכל טבלה שמקושרת אליה ב-RELATION - כולל טבלאות מערכת.
467
+ * עמודות קשר מוצגות רק ברמה אחת (לא קשר בתוך קשר).
468
+ */
469
+ declare function buildColumnOptions(table: AnyTable | undefined | null, allTables: AnyTable[] | undefined, opts?: {
470
+ textOnly?: boolean;
471
+ includeRelated?: boolean;
472
+ }): PlacementColumnOption[];
473
+ /**
474
+ * מעשיר רשומות בעמודות וירטואליות מהטבלאות הקשורות, לפי relationOptions שחזר מהשרת:
475
+ * data["<קשר>::<עמודה>"] = ערך העמודה ברשומה/ות הקשורות
476
+ * data["<קשר>::__label"] = התווית (displayField) של הרשומה/ות הקשורות
477
+ * הערך המקורי של עמודת הקשר (ה-IDs) נשאר כמות שהוא, כי הוא משמש לשמירה.
478
+ */
479
+ declare function enrichRowsWithRelations<T extends {
480
+ data: Record<string, any>;
481
+ }>(rows: T[], columns: any[], relationOptions: Record<string, any[]> | undefined): T[];
482
+ /** קורא ערך עמודה (רגילה או מטבלה קשורה); עמודת קשר "חשופה" מוצגת לפי התווית שלה ולא לפי ה-ID */
483
+ declare function readColumnValue(data: Record<string, any> | undefined, ref: string): any;
484
+
373
485
  interface MetaTemplateComponent {
374
486
  type: "HEADER" | "BODY" | "FOOTER" | "BUTTONS" | string;
375
487
  format?: "TEXT" | "IMAGE" | "DOCUMENT" | "VIDEO" | string;
@@ -666,6 +778,15 @@ interface SettingsAndActionsBlockProps {
666
778
  }
667
779
  declare function SettingsAndActionsBlock({ isScanningPhoneColumns, targetPhoneOptions, phoneColumnId, setPhoneColumnId, selectedPhoneOption, autoSelectCount, setAutoSelectCount, subtableFilterColumn, setSubtableFilterColumn, subtableFilterValue, setSubtableFilterValue, subtableSendLimit, setSubtableSendLimit, subtableFilterableColumns, selectedSubtableFilterCol, getRelationOptionsForCol, relationOptions, enablePostSendAction, setEnablePostSendAction, postSendActionColumn, setPostSendActionColumn, postSendActionValue, setPostSendActionValue, setPostSendActionTargetType, postSendActionTargetOptions, selectedPostSendOption, isTestDisabled, testButtonTitle, setIsTestPromptOpen, isSendDisabled, sendButtonTitle, handleSendMessages, selectedRowIdsCount, finalRecipientCount, validMainRowsCount, isSendingBroadcast, broadcastProgress, broadcastSummary, clearBroadcastSummary, }: SettingsAndActionsBlockProps): react_jsx_runtime.JSX.Element;
668
780
 
781
+ interface FormBlockProps {
782
+ settings: any;
783
+ executeAction?: (actionType: string, payload: Record<string, any>) => Promise<any>;
784
+ componentId?: string;
785
+ className?: string;
786
+ onSuccess?: () => void;
787
+ }
788
+ declare function FormBlock({ settings: schema, executeAction, componentId, className, onSuccess }: FormBlockProps): react_jsx_runtime.JSX.Element;
789
+
669
790
  /**
670
791
  * UNIVERSE_COMPONENTS
671
792
  * Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE", "WHATSAPP")
@@ -674,6 +795,8 @@ declare function SettingsAndActionsBlock({ isScanningPhoneColumns, targetPhoneOp
674
795
  declare const UNIVERSE_COMPONENTS: {
675
796
  readonly TABLE: typeof TableBlock;
676
797
  readonly WHATSAPP: typeof WhatsAppComponent;
798
+ readonly FORM: typeof FormBlock;
799
+ readonly PLACEMENT: react.FC<PlacementBlockProps>;
677
800
  };
678
801
  type ComponentRegistry = typeof UNIVERSE_COMPONENTS;
679
802
  type UniverseComponentType = keyof ComponentRegistry;
@@ -698,4 +821,4 @@ declare function ToastProvider({ children }: {
698
821
 
699
822
  declare function useToast(): ToastContextType;
700
823
 
701
- 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, DynamicFiltersBlock, type DynamicFiltersBlockProps, LinkPickerCell, type MetaTemplateComponent, type MetaWhatsAppTemplate, type OrgRole, PASTEL_PALETTES, type PastelPalette, type RelationFilterOption, type RelationFilterPayload, RelationFilterPopover, type RelationFilterPopoverProps, RelationPickerCell, type RolePermissions, type RowStatusType, SettingsAndActionsBlock, type SettingsAndActionsBlockProps, SmartTextCell, type SplitTitleResult, TableBlock, TableBlockClient, 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, checkElementTruncation, cn, formatConflictCellValue, formatPhoneDisplay, formatTimeInput, formatTimeIso, generateWhatsAppLink, getDeterministicPastelBadge, getRolePermissions, isValidPhoneNumber, measureTextWidth, normalizePhoneForWhatsApp, normalizeRelationValue, openWhatsAppChat, parseLinkValue, parseTimeParts, resolveProtocol, sanitizePhoneNumber, splitHeaderTitle, useColumnReorder, useColumnResize, useSmartTooltip, useToast, useWhatsAppState };
824
+ export { type BaseComponentProps, ColumnHeaderTitle, type ColumnHeaderTitleProps, type ComponentCommunication, type ComponentConfig, type ComponentData, type ComponentPermissions, type ComponentRegistry, type ComponentState, type CreateRecordPayload, CreateTemplateModal, type CreateTemplateModalProps, DEFAULT_PLACEMENT_STATUS_COLORS, DatePickerCell, type DeleteRecordPayload, DynamicFiltersBlock, type DynamicFiltersBlockProps, LinkPickerCell, type MetaTemplateComponent, type MetaWhatsAppTemplate, NON_TEXT_TYPES, type OrgRole, PASTEL_PALETTES, type PastelPalette, PlacementBlock, type PlacementBlockProps, type PlacementColumnOption, type PlacementConfig, PlacementSettings, type PlacementStatusColor, PlacementStatusEditor, type PlacementStatusSetting, RELATION_LABEL_KEY, RELATION_SEP, type RelationFilterOption, type RelationFilterPayload, RelationFilterPopover, type RelationFilterPopoverProps, RelationPickerCell, type RolePermissions, type RowStatusType, SettingsAndActionsBlock, type SettingsAndActionsBlockProps, SmartTextCell, type SplitTitleResult, TableBlock, TableBlockClient, 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, buildColumnOptions, buildRelationRef, calculateMinColumnWidth, checkElementTruncation, cn, columnRefLabel, enrichRowsWithRelations, formatConflictCellValue, formatPhoneDisplay, formatTimeInput, formatTimeIso, generateWhatsAppLink, getDeterministicPastelBadge, getRolePermissions, isUserColumn, isValidPhoneNumber, measureTextWidth, normalizePhoneForWhatsApp, normalizeRelationValue, openWhatsAppChat, parseColumnRef, parseLinkValue, parseTimeParts, readColumnValue, resolveDefaultStatusId, resolveProtocol, sanitizePhoneNumber, splitHeaderTitle, tableColumns, useColumnReorder, useColumnResize, useSmartTooltip, useToast, useWhatsAppState };