@nyaruka/temba-components 0.163.0 → 0.165.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 (66) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/DEV_DATA.md +11 -11
  3. package/README.md +4 -4
  4. package/TEST_OPTIMIZATION.md +8 -11
  5. package/dist/locales/es.js +4 -0
  6. package/dist/locales/es.js.map +1 -1
  7. package/dist/locales/fr.js +4 -0
  8. package/dist/locales/fr.js.map +1 -1
  9. package/dist/locales/pt.js +4 -0
  10. package/dist/locales/pt.js.map +1 -1
  11. package/dist/static/svg/index.svg +1 -1
  12. package/dist/temba-components.js +5266 -3031
  13. package/dist/temba-components.js.map +1 -1
  14. package/orca/setup.sh +2 -2
  15. package/package.json +13 -18
  16. package/scripts/dev-data-sync.mjs +4 -4
  17. package/src/Icons.ts +3 -2
  18. package/src/display/Chat.ts +3 -2
  19. package/src/display/Lightbox.ts +57 -109
  20. package/src/display/ProgressBar.ts +15 -2
  21. package/src/display/Thumbnail.ts +34 -7
  22. package/src/form/Compose.ts +31 -1
  23. package/src/form/ContactSearch.ts +229 -126
  24. package/src/interfaces.ts +131 -2
  25. package/src/layout/Card.ts +336 -0
  26. package/src/layout/CardLayout.ts +425 -0
  27. package/src/layout/CardStack.ts +131 -0
  28. package/src/layout/Dialog.ts +33 -24
  29. package/src/layout/HeaderBar.ts +41 -0
  30. package/src/layout/PageHeader.ts +5 -6
  31. package/src/layout/Resizer.ts +20 -0
  32. package/src/list/BroadcastList.ts +912 -0
  33. package/src/list/CampaignList.ts +144 -0
  34. package/src/list/ContactList.ts +3 -1
  35. package/src/list/ContentList.ts +46 -10
  36. package/src/list/FieldList.ts +1057 -0
  37. package/src/list/FlowList.ts +31 -7
  38. package/src/list/MsgList.ts +18 -12
  39. package/src/list/SortableList.ts +52 -8
  40. package/src/list/TembaList.ts +8 -0
  41. package/src/list/TembaMenu.ts +5 -38
  42. package/src/list/TriggerList.ts +538 -0
  43. package/src/live/CampaignEvents.ts +1108 -0
  44. package/src/live/ContactChat.ts +7 -1
  45. package/src/live/ContactDetails.ts +20 -14
  46. package/src/live/ContactFieldEditor.ts +7 -3
  47. package/src/live/ContactFields.ts +1 -1
  48. package/src/live/ContactNameFetch.ts +5 -2
  49. package/src/live/ContactNotepad.ts +88 -2
  50. package/src/live/ContactStoreElement.ts +15 -3
  51. package/src/live/ContactTimeline.ts +28 -7
  52. package/src/locales/es.ts +4 -0
  53. package/src/locales/fr.ts +4 -0
  54. package/src/locales/pt.ts +4 -0
  55. package/src/utils.ts +19 -0
  56. package/static/svg/index.svg +1 -1
  57. package/static/svg/packs/2-temba/star-filled.svg +3 -0
  58. package/static/svg/work/traced/star-filled.svg +1 -0
  59. package/static/svg/work/used/star-filled.svg +3 -0
  60. package/stress-test.js +3 -3
  61. package/temba-modules.ts +18 -0
  62. package/web-dev-server.config.mjs +54 -0
  63. package/web-test-runner.config.mjs +1 -1
  64. package/xliff/es.xlf +12 -0
  65. package/xliff/fr.xlf +12 -0
  66. package/xliff/pt.xlf +12 -0
@@ -70,6 +70,8 @@ export class PageHeader extends RapidElement {
70
70
  }
71
71
  .title {
72
72
  font-size: 15.5px;
73
+ /* slotted contact names render at the title's size */
74
+ --contact-name-font-size: 15.5px;
73
75
  font-weight: var(--w-semibold);
74
76
  color: var(--text-1);
75
77
  line-height: 1.25;
@@ -139,10 +141,6 @@ export class PageHeader extends RapidElement {
139
141
  .menu-button.primary:hover {
140
142
  background: var(--accent-700);
141
143
  }
142
- .menu-button[disabled] {
143
- opacity: 0.45;
144
- cursor: not-allowed;
145
- }
146
144
 
147
145
  /* Overflow toggle — the trailing ⋮ that opens the rest of the
148
146
  menu items. Plain icon button, matches the list's Search. */
@@ -282,7 +280,9 @@ export class PageHeader extends RapidElement {
282
280
  * origin — same payload the standalone content menu emits, so the
283
281
  * host's existing menu handling keeps working. */
284
282
  private handleItemClicked(item: ContentMenuItem, event: MouseEvent): void {
285
- if (item.disabled) return;
283
+ // note: item.disabled does NOT make the item inert — in the content
284
+ // menu contract it means the opened modal starts with its submit
285
+ // disabled (hosts pass it through to showModax)
286
286
  const el = event.currentTarget as Element;
287
287
  const rect = el?.getBoundingClientRect();
288
288
  this.fireCustomEvent(CustomEventType.Selection, {
@@ -300,7 +300,6 @@ export class PageHeader extends RapidElement {
300
300
  (button) => html`
301
301
  <div
302
302
  class="menu-button ${button.primary ? 'primary' : ''}"
303
- ?disabled=${button.disabled}
304
303
  @click=${(e: MouseEvent) => this.handleItemClicked(button, e)}
305
304
  >
306
305
  ${button.label}
@@ -10,6 +10,9 @@ export class Resizer extends ResizeElement {
10
10
  display: block;
11
11
  position: relative;
12
12
  width: var(--box-width, 200px);
13
+ /* hold the drag-clamp floor against flex compression too, so
14
+ shrinking the browser can't squeeze us below minWidth */
15
+ min-width: var(--box-min-width, 200px);
13
16
  --resizer-handle-size: 15px;
14
17
  }
15
18
 
@@ -69,6 +72,20 @@ export class Resizer extends ResizeElement {
69
72
  this.stopResize = this.stopResize.bind(this);
70
73
  }
71
74
 
75
+ protected willUpdate(
76
+ changes: PropertyValueMap<any> | Map<PropertyKey, unknown>
77
+ ): void {
78
+ super.willUpdate(changes);
79
+ // clamp programmatic width sets (e.g. a stored width restored on
80
+ // load) the same way drags are clamped
81
+ if (changes.has('currentWidth') && this.currentWidth != null) {
82
+ this.currentWidth = Math.min(
83
+ Math.max(this.currentWidth, this.minWidth),
84
+ this.maxWidth
85
+ );
86
+ }
87
+ }
88
+
72
89
  protected updated(
73
90
  _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>
74
91
  ): void {
@@ -76,6 +93,9 @@ export class Resizer extends ResizeElement {
76
93
  if (_changedProperties.has('currentWidth')) {
77
94
  this.style.setProperty('--box-width', `${this.currentWidth}px`);
78
95
  }
96
+ if (_changedProperties.has('minWidth')) {
97
+ this.style.setProperty('--box-min-width', `${this.minWidth}px`);
98
+ }
79
99
  }
80
100
 
81
101
  public setWidth(width: number) {