@universe-platform/ui 0.1.0-beta.25 → 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/globals.css CHANGED
@@ -44,9 +44,12 @@
44
44
  --color-emerald-900: oklch(37.8% 0.077 168.94);
45
45
  --color-emerald-950: oklch(26.2% 0.051 172.552);
46
46
  --color-teal-50: oklch(98.4% 0.014 180.72);
47
+ --color-teal-100: oklch(95.3% 0.051 180.801);
47
48
  --color-teal-200: oklch(91% 0.096 180.426);
48
49
  --color-teal-500: oklch(70.4% 0.14 182.503);
49
50
  --color-teal-700: oklch(51.1% 0.096 186.391);
51
+ --color-teal-800: oklch(43.7% 0.078 188.216);
52
+ --color-teal-900: oklch(38.6% 0.063 188.416);
50
53
  --color-cyan-50: oklch(98.4% 0.019 200.873);
51
54
  --color-cyan-200: oklch(91.7% 0.08 205.041);
52
55
  --color-cyan-700: oklch(52% 0.105 223.128);
@@ -71,6 +74,7 @@
71
74
  --color-indigo-200: oklch(87% 0.065 274.039);
72
75
  --color-indigo-600: oklch(51.1% 0.262 276.966);
73
76
  --color-indigo-700: oklch(45.7% 0.24 277.023);
77
+ --color-indigo-900: oklch(35.9% 0.144 278.697);
74
78
  --color-violet-50: oklch(96.9% 0.016 293.756);
75
79
  --color-violet-100: oklch(94.3% 0.029 294.588);
76
80
  --color-violet-200: oklch(89.4% 0.057 293.283);
@@ -105,6 +109,7 @@
105
109
  --color-slate-700: oklch(37.2% 0.044 257.287);
106
110
  --color-slate-800: oklch(27.9% 0.041 260.031);
107
111
  --color-slate-900: oklch(20.8% 0.042 265.755);
112
+ --color-gray-50: oklch(98.5% 0.002 247.839);
108
113
  --color-black: #000;
109
114
  --color-white: #fff;
110
115
  --spacing: 0.25rem;
@@ -120,6 +125,8 @@
120
125
  --text-sm--line-height: calc(1.25 / 0.875);
121
126
  --text-base: 1rem;
122
127
  --text-base--line-height: calc(1.5 / 1);
128
+ --text-lg: 1.125rem;
129
+ --text-lg--line-height: calc(1.75 / 1.125);
123
130
  --text-xl: 1.25rem;
124
131
  --text-xl--line-height: calc(1.75 / 1.25);
125
132
  --text-2xl: 1.5rem;
@@ -447,6 +454,9 @@
447
454
  .mt-2 {
448
455
  margin-top: calc(var(--spacing) * 2);
449
456
  }
457
+ .mt-3 {
458
+ margin-top: calc(var(--spacing) * 3);
459
+ }
450
460
  .mt-6 {
451
461
  margin-top: calc(var(--spacing) * 6);
452
462
  }
@@ -459,6 +469,9 @@
459
469
  .mr-1 {
460
470
  margin-right: var(--spacing);
461
471
  }
472
+ .mr-2 {
473
+ margin-right: calc(var(--spacing) * 2);
474
+ }
462
475
  .mb-0\.5 {
463
476
  margin-bottom: calc(var(--spacing) * 0.5);
464
477
  }
@@ -495,6 +508,12 @@
495
508
  .ml-2 {
496
509
  margin-left: calc(var(--spacing) * 2);
497
510
  }
511
+ .line-clamp-2 {
512
+ overflow: hidden;
513
+ display: -webkit-box;
514
+ -webkit-box-orient: vertical;
515
+ -webkit-line-clamp: 2;
516
+ }
498
517
  .block {
499
518
  display: block;
500
519
  }
@@ -576,12 +595,18 @@
576
595
  .h-\[18px\] {
577
596
  height: 18px;
578
597
  }
598
+ .h-\[550px\] {
599
+ height: 550px;
600
+ }
579
601
  .h-\[calc\(100vh-420px\)\] {
580
602
  height: calc(100vh - 420px);
581
603
  }
582
604
  .h-full {
583
605
  height: 100%;
584
606
  }
607
+ .max-h-32 {
608
+ max-height: calc(var(--spacing) * 32);
609
+ }
585
610
  .max-h-48 {
586
611
  max-height: calc(var(--spacing) * 48);
587
612
  }
@@ -624,6 +649,9 @@
624
649
  .min-h-\[320px\] {
625
650
  min-height: 320px;
626
651
  }
652
+ .min-h-\[850px\] {
653
+ min-height: 850px;
654
+ }
627
655
  .min-h-\[inherit\] {
628
656
  min-height: inherit;
629
657
  }
@@ -747,6 +775,9 @@
747
775
  .shrink-0 {
748
776
  flex-shrink: 0;
749
777
  }
778
+ .basis-0 {
779
+ flex-basis: 0;
780
+ }
750
781
  .table-auto {
751
782
  table-layout: auto;
752
783
  }
@@ -823,6 +854,9 @@
823
854
  .grid-cols-2 {
824
855
  grid-template-columns: repeat(2, minmax(0, 1fr));
825
856
  }
857
+ .grid-cols-3 {
858
+ grid-template-columns: repeat(3, minmax(0, 1fr));
859
+ }
826
860
  .grid-cols-7 {
827
861
  grid-template-columns: repeat(7, minmax(0, 1fr));
828
862
  }
@@ -943,6 +977,19 @@
943
977
  margin-block-end: calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)));
944
978
  }
945
979
  }
980
+ .space-y-6 {
981
+ :where(& > :not(:last-child)) {
982
+ --tw-space-y-reverse: 0;
983
+ margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));
984
+ margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)));
985
+ }
986
+ }
987
+ .gap-x-6 {
988
+ column-gap: calc(var(--spacing) * 6);
989
+ }
990
+ .gap-y-1\.5 {
991
+ row-gap: calc(var(--spacing) * 1.5);
992
+ }
946
993
  .divide-y {
947
994
  :where(& > :not(:last-child)) {
948
995
  --tw-divide-y-reverse: 0;
@@ -1055,6 +1102,9 @@
1055
1102
  .border-amber-400 {
1056
1103
  border-color: var(--color-amber-400);
1057
1104
  }
1105
+ .border-blue-100 {
1106
+ border-color: var(--color-blue-100);
1107
+ }
1058
1108
  .border-blue-200 {
1059
1109
  border-color: var(--color-blue-200);
1060
1110
  }
@@ -1181,9 +1231,18 @@
1181
1231
  border-color: color-mix(in oklab, var(--color-slate-700) 60%, transparent);
1182
1232
  }
1183
1233
  }
1234
+ .border-teal-100 {
1235
+ border-color: var(--color-teal-100);
1236
+ }
1184
1237
  .border-teal-200 {
1185
1238
  border-color: var(--color-teal-200);
1186
1239
  }
1240
+ .border-teal-200\/60 {
1241
+ border-color: color-mix(in srgb, oklch(91% 0.096 180.426) 60%, transparent);
1242
+ @supports (color: color-mix(in lab, red, red)) {
1243
+ border-color: color-mix(in oklab, var(--color-teal-200) 60%, transparent);
1244
+ }
1245
+ }
1187
1246
  .border-transparent {
1188
1247
  border-color: transparent;
1189
1248
  }
@@ -1211,6 +1270,9 @@
1211
1270
  .bg-amber-100 {
1212
1271
  background-color: var(--color-amber-100);
1213
1272
  }
1273
+ .bg-amber-400 {
1274
+ background-color: var(--color-amber-400);
1275
+ }
1214
1276
  .bg-blue-50 {
1215
1277
  background-color: var(--color-blue-50);
1216
1278
  }
@@ -1220,6 +1282,12 @@
1220
1282
  background-color: color-mix(in oklab, var(--color-blue-50) 40%, transparent);
1221
1283
  }
1222
1284
  }
1285
+ .bg-blue-50\/80 {
1286
+ background-color: color-mix(in srgb, oklch(97% 0.014 254.604) 80%, transparent);
1287
+ @supports (color: color-mix(in lab, red, red)) {
1288
+ background-color: color-mix(in oklab, var(--color-blue-50) 80%, transparent);
1289
+ }
1290
+ }
1223
1291
  .bg-blue-100 {
1224
1292
  background-color: var(--color-blue-100);
1225
1293
  }
@@ -1289,12 +1357,21 @@
1289
1357
  .bg-fuchsia-50 {
1290
1358
  background-color: var(--color-fuchsia-50);
1291
1359
  }
1360
+ .bg-gray-50 {
1361
+ background-color: var(--color-gray-50);
1362
+ }
1292
1363
  .bg-green-50 {
1293
1364
  background-color: var(--color-green-50);
1294
1365
  }
1295
1366
  .bg-indigo-50 {
1296
1367
  background-color: var(--color-indigo-50);
1297
1368
  }
1369
+ .bg-indigo-50\/60 {
1370
+ background-color: color-mix(in srgb, oklch(96.2% 0.018 272.314) 60%, transparent);
1371
+ @supports (color: color-mix(in lab, red, red)) {
1372
+ background-color: color-mix(in oklab, var(--color-indigo-50) 60%, transparent);
1373
+ }
1374
+ }
1298
1375
  .bg-lime-50 {
1299
1376
  background-color: var(--color-lime-50);
1300
1377
  }
@@ -1409,6 +1486,12 @@
1409
1486
  .bg-teal-50 {
1410
1487
  background-color: var(--color-teal-50);
1411
1488
  }
1489
+ .bg-teal-50\/40 {
1490
+ background-color: color-mix(in srgb, oklch(98.4% 0.014 180.72) 40%, transparent);
1491
+ @supports (color: color-mix(in lab, red, red)) {
1492
+ background-color: color-mix(in oklab, var(--color-teal-50) 40%, transparent);
1493
+ }
1494
+ }
1412
1495
  .bg-transparent {
1413
1496
  background-color: transparent;
1414
1497
  }
@@ -1556,12 +1639,18 @@
1556
1639
  .pt-2\.5 {
1557
1640
  padding-top: calc(var(--spacing) * 2.5);
1558
1641
  }
1642
+ .pt-3 {
1643
+ padding-top: calc(var(--spacing) * 3);
1644
+ }
1559
1645
  .pt-4 {
1560
1646
  padding-top: calc(var(--spacing) * 4);
1561
1647
  }
1562
1648
  .pr-0\.5 {
1563
1649
  padding-right: calc(var(--spacing) * 0.5);
1564
1650
  }
1651
+ .pr-1 {
1652
+ padding-right: var(--spacing);
1653
+ }
1565
1654
  .pr-2 {
1566
1655
  padding-right: calc(var(--spacing) * 2);
1567
1656
  }
@@ -1642,6 +1731,10 @@
1642
1731
  font-size: var(--text-base);
1643
1732
  line-height: var(--tw-leading, var(--text-base--line-height));
1644
1733
  }
1734
+ .text-lg {
1735
+ font-size: var(--text-lg);
1736
+ line-height: var(--tw-leading, var(--text-lg--line-height));
1737
+ }
1645
1738
  .text-sm {
1646
1739
  font-size: var(--text-sm);
1647
1740
  line-height: var(--tw-leading, var(--text-sm--line-height));
@@ -1779,6 +1872,9 @@
1779
1872
  .text-indigo-700 {
1780
1873
  color: var(--color-indigo-700);
1781
1874
  }
1875
+ .text-indigo-900 {
1876
+ color: var(--color-indigo-900);
1877
+ }
1782
1878
  .text-lime-700 {
1783
1879
  color: var(--color-lime-700);
1784
1880
  }
@@ -1842,6 +1938,12 @@
1842
1938
  .text-teal-700 {
1843
1939
  color: var(--color-teal-700);
1844
1940
  }
1941
+ .text-teal-800 {
1942
+ color: var(--color-teal-800);
1943
+ }
1944
+ .text-teal-900 {
1945
+ color: var(--color-teal-900);
1946
+ }
1845
1947
  .text-violet-600 {
1846
1948
  color: var(--color-violet-600);
1847
1949
  }
@@ -1877,6 +1979,9 @@
1877
1979
  .accent-\[\#0d9488\] {
1878
1980
  accent-color: #0d9488;
1879
1981
  }
1982
+ .accent-blue-600 {
1983
+ accent-color: var(--color-blue-600);
1984
+ }
1880
1985
  .opacity-0 {
1881
1986
  opacity: 0%;
1882
1987
  }
@@ -1947,6 +2052,9 @@
1947
2052
  --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-teal-500) 20%, transparent) var(--tw-shadow-alpha), transparent);
1948
2053
  }
1949
2054
  }
2055
+ .ring-blue-100 {
2056
+ --tw-ring-color: var(--color-blue-100);
2057
+ }
1950
2058
  .ring-emerald-500\/20 {
1951
2059
  --tw-ring-color: color-mix(in srgb, oklch(69.6% 0.17 162.48) 20%, transparent);
1952
2060
  @supports (color: color-mix(in lab, red, red)) {
@@ -2035,6 +2143,10 @@
2035
2143
  --tw-ease: var(--ease-out);
2036
2144
  transition-timing-function: var(--ease-out);
2037
2145
  }
2146
+ .outline-none {
2147
+ --tw-outline-style: none;
2148
+ outline-style: none;
2149
+ }
2038
2150
  .select-all {
2039
2151
  -webkit-user-select: all;
2040
2152
  user-select: all;
@@ -2143,6 +2255,16 @@
2143
2255
  }
2144
2256
  }
2145
2257
  }
2258
+ .hover\:scale-110 {
2259
+ &:hover {
2260
+ @media (hover: hover) {
2261
+ --tw-scale-x: 110%;
2262
+ --tw-scale-y: 110%;
2263
+ --tw-scale-z: 110%;
2264
+ scale: var(--tw-scale-x) var(--tw-scale-y);
2265
+ }
2266
+ }
2267
+ }
2146
2268
  .hover\:border-amber-400 {
2147
2269
  &:hover {
2148
2270
  @media (hover: hover) {
@@ -2195,6 +2317,13 @@
2195
2317
  }
2196
2318
  }
2197
2319
  }
2320
+ .hover\:bg-amber-500 {
2321
+ &:hover {
2322
+ @media (hover: hover) {
2323
+ background-color: var(--color-amber-500);
2324
+ }
2325
+ }
2326
+ }
2198
2327
  .hover\:bg-black\/10 {
2199
2328
  &:hover {
2200
2329
  @media (hover: hover) {
@@ -2648,6 +2777,11 @@
2648
2777
  cursor: not-allowed;
2649
2778
  }
2650
2779
  }
2780
+ .disabled\:opacity-30 {
2781
+ &:disabled {
2782
+ opacity: 30%;
2783
+ }
2784
+ }
2651
2785
  .disabled\:opacity-40 {
2652
2786
  &:disabled {
2653
2787
  opacity: 40%;
@@ -2704,6 +2838,11 @@
2704
2838
  line-height: var(--tw-leading, var(--text-base--line-height));
2705
2839
  }
2706
2840
  }
2841
+ .md\:grid-cols-2 {
2842
+ @media (width >= 48rem) {
2843
+ grid-template-columns: repeat(2, minmax(0, 1fr));
2844
+ }
2845
+ }
2707
2846
  .lg\:col-span-3 {
2708
2847
  @media (width >= 64rem) {
2709
2848
  grid-column: span 3 / span 3;
@@ -2719,6 +2858,21 @@
2719
2858
  grid-column: span 5 / span 5;
2720
2859
  }
2721
2860
  }
2861
+ .lg\:w-1\/2 {
2862
+ @media (width >= 64rem) {
2863
+ width: calc(1 / 2 * 100%);
2864
+ }
2865
+ }
2866
+ .lg\:w-1\/3 {
2867
+ @media (width >= 64rem) {
2868
+ width: calc(1 / 3 * 100%);
2869
+ }
2870
+ }
2871
+ .lg\:w-2\/3 {
2872
+ @media (width >= 64rem) {
2873
+ width: calc(2 / 3 * 100%);
2874
+ }
2875
+ }
2722
2876
  .lg\:grid-cols-1 {
2723
2877
  @media (width >= 64rem) {
2724
2878
  grid-template-columns: repeat(1, minmax(0, 1fr));
@@ -2729,6 +2883,11 @@
2729
2883
  grid-template-columns: repeat(12, minmax(0, 1fr));
2730
2884
  }
2731
2885
  }
2886
+ .lg\:flex-row {
2887
+ @media (width >= 64rem) {
2888
+ flex-direction: row;
2889
+ }
2890
+ }
2732
2891
  }
2733
2892
  @property --tw-translate-x {
2734
2893
  syntax: "*";
package/dist/index.d.mts 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;
@@ -684,6 +796,7 @@ declare const UNIVERSE_COMPONENTS: {
684
796
  readonly TABLE: typeof TableBlock;
685
797
  readonly WHATSAPP: typeof WhatsAppComponent;
686
798
  readonly FORM: typeof FormBlock;
799
+ readonly PLACEMENT: react.FC<PlacementBlockProps>;
687
800
  };
688
801
  type ComponentRegistry = typeof UNIVERSE_COMPONENTS;
689
802
  type UniverseComponentType = keyof ComponentRegistry;
@@ -708,4 +821,4 @@ declare function ToastProvider({ children }: {
708
821
 
709
822
  declare function useToast(): ToastContextType;
710
823
 
711
- 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 };
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;
@@ -684,6 +796,7 @@ declare const UNIVERSE_COMPONENTS: {
684
796
  readonly TABLE: typeof TableBlock;
685
797
  readonly WHATSAPP: typeof WhatsAppComponent;
686
798
  readonly FORM: typeof FormBlock;
799
+ readonly PLACEMENT: react.FC<PlacementBlockProps>;
687
800
  };
688
801
  type ComponentRegistry = typeof UNIVERSE_COMPONENTS;
689
802
  type UniverseComponentType = keyof ComponentRegistry;
@@ -708,4 +821,4 @@ declare function ToastProvider({ children }: {
708
821
 
709
822
  declare function useToast(): ToastContextType;
710
823
 
711
- 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 };