@open-mercato/core 0.6.6-develop.6314.1.c7b8291aa2 → 0.6.6-develop.6317.1.b3be10ab84

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 (26) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/modules/customers/ai-tools/_shared.js +158 -0
  3. package/dist/modules/customers/ai-tools/_shared.js.map +7 -0
  4. package/dist/modules/customers/ai-tools/companies-pack.js +15 -121
  5. package/dist/modules/customers/ai-tools/companies-pack.js.map +2 -2
  6. package/dist/modules/customers/ai-tools/people-pack.js +9 -107
  7. package/dist/modules/customers/ai-tools/people-pack.js.map +2 -2
  8. package/dist/modules/customers/components/calendar/CalendarScreen.js +1 -0
  9. package/dist/modules/customers/components/calendar/CalendarScreen.js.map +2 -2
  10. package/dist/modules/customers/components/calendar/EventPeekPopover.js +12 -1
  11. package/dist/modules/customers/components/calendar/EventPeekPopover.js.map +2 -2
  12. package/dist/modules/customers/components/calendar/TimeGrid.js +3 -0
  13. package/dist/modules/customers/components/calendar/TimeGrid.js.map +2 -2
  14. package/dist/modules/customers/components/calendar/types.js.map +1 -1
  15. package/package.json +7 -7
  16. package/src/modules/customers/ai-tools/_shared.ts +270 -0
  17. package/src/modules/customers/ai-tools/companies-pack.ts +17 -157
  18. package/src/modules/customers/ai-tools/people-pack.ts +11 -133
  19. package/src/modules/customers/components/calendar/CalendarScreen.tsx +1 -0
  20. package/src/modules/customers/components/calendar/EventPeekPopover.tsx +29 -11
  21. package/src/modules/customers/components/calendar/TimeGrid.tsx +3 -0
  22. package/src/modules/customers/components/calendar/types.ts +1 -0
  23. package/src/modules/customers/i18n/de.json +1 -0
  24. package/src/modules/customers/i18n/en.json +1 -0
  25. package/src/modules/customers/i18n/es.json +1 -0
  26. package/src/modules/customers/i18n/pl.json +1 -0
@@ -499,6 +499,7 @@ export function CalendarScreen() {
499
499
  showWeekends={preferences.showWeekends}
500
500
  showConflicts={preferences.conflictWarnings}
501
501
  aiSummaries={preferences.aiSummaries}
502
+ canManage={canManage}
502
503
  highlightItemId={highlightItemId}
503
504
  onItemClick={openEditEditor}
504
505
  onJoin={handleJoin}
@@ -5,6 +5,7 @@ import { Sparkles } from 'lucide-react'
5
5
  import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
6
6
  import { Button } from '@open-mercato/ui/primitives/button'
7
7
  import { Popover, PopoverContent, PopoverTrigger } from '@open-mercato/ui/primitives/popover'
8
+ import { SimpleTooltip } from '@open-mercato/ui/primitives/tooltip'
8
9
  import { formatTimeRange } from './EventBlock'
9
10
  import type { CalendarItem, CalendarPlatform } from './types'
10
11
 
@@ -20,6 +21,7 @@ export type EventPeekPopoverProps = {
20
21
  open: boolean
21
22
  joinUrl: string | null
22
23
  aiSummaries: boolean
24
+ canManage?: boolean
23
25
  onOpenChange(open: boolean): void
24
26
  onJoin(item: CalendarItem): void
25
27
  onEdit(item: CalendarItem): void
@@ -31,6 +33,7 @@ export function EventPeekPopover({
31
33
  open,
32
34
  joinUrl,
33
35
  aiSummaries,
36
+ canManage = true,
34
37
  onOpenChange,
35
38
  onJoin,
36
39
  onEdit,
@@ -81,17 +84,32 @@ export function EventPeekPopover({
81
84
  {t('customers.calendar.peek.join', 'Join')}
82
85
  </Button>
83
86
  ) : null}
84
- <Button
85
- type="button"
86
- size="sm"
87
- variant="secondary"
88
- onClick={() => {
89
- onOpenChange(false)
90
- onEdit(item)
91
- }}
92
- >
93
- {t('customers.calendar.peek.edit', 'Edit')}
94
- </Button>
87
+ {canManage ? (
88
+ <Button
89
+ type="button"
90
+ size="sm"
91
+ variant="secondary"
92
+ onClick={() => {
93
+ onOpenChange(false)
94
+ onEdit(item)
95
+ }}
96
+ >
97
+ {t('customers.calendar.peek.edit', 'Edit')}
98
+ </Button>
99
+ ) : (
100
+ <SimpleTooltip
101
+ content={t(
102
+ 'customers.calendar.peek.editForbidden',
103
+ "You don't have permission to edit events",
104
+ )}
105
+ >
106
+ <span className="inline-flex">
107
+ <Button type="button" size="sm" variant="secondary" disabled className="pointer-events-none">
108
+ {t('customers.calendar.peek.edit', 'Edit')}
109
+ </Button>
110
+ </span>
111
+ </SimpleTooltip>
112
+ )}
95
113
  </div>
96
114
  </div>
97
115
  </PopoverContent>
@@ -160,6 +160,7 @@ export function TimeGrid({
160
160
  showWeekends,
161
161
  showConflicts,
162
162
  aiSummaries,
163
+ canManage = true,
163
164
  highlightItemId,
164
165
  onItemClick,
165
166
  onJoin,
@@ -351,6 +352,7 @@ export function TimeGrid({
351
352
  open={selectedId === item.id}
352
353
  joinUrl={resolveJoinUrl(item.location)}
353
354
  aiSummaries={aiSummaries}
355
+ canManage={canManage}
354
356
  onOpenChange={(open) => setSelectedId(open ? item.id : null)}
355
357
  onJoin={onJoin}
356
358
  onEdit={onItemClick}
@@ -462,6 +464,7 @@ export function TimeGrid({
462
464
  open={selectedId === block.item.id}
463
465
  joinUrl={resolveJoinUrl(block.item.location)}
464
466
  aiSummaries={aiSummaries}
467
+ canManage={canManage}
465
468
  onOpenChange={(open) => setSelectedId(open ? block.item.id : null)}
466
469
  onJoin={onJoin}
467
470
  onEdit={onItemClick}
@@ -87,6 +87,7 @@ export interface TimeGridProps {
87
87
  showWeekends: boolean
88
88
  showConflicts: boolean
89
89
  aiSummaries: boolean
90
+ canManage?: boolean
90
91
  highlightItemId?: string | null
91
92
  onItemClick(item: CalendarItem): void
92
93
  onJoin(item: CalendarItem): void
@@ -312,6 +312,7 @@
312
312
  "customers.calendar.peek.attendee": "1 Teilnehmer",
313
313
  "customers.calendar.peek.attendees": "{count} Teilnehmer",
314
314
  "customers.calendar.peek.edit": "Bearbeiten",
315
+ "customers.calendar.peek.editForbidden": "Sie haben keine Berechtigung, Termine zu bearbeiten",
315
316
  "customers.calendar.peek.join": "Beitreten",
316
317
  "customers.calendar.platform.meet": "Meet",
317
318
  "customers.calendar.platform.slack": "Slack",
@@ -312,6 +312,7 @@
312
312
  "customers.calendar.peek.attendee": "1 attendee",
313
313
  "customers.calendar.peek.attendees": "{count} attendees",
314
314
  "customers.calendar.peek.edit": "Edit",
315
+ "customers.calendar.peek.editForbidden": "You don't have permission to edit events",
315
316
  "customers.calendar.peek.join": "Join",
316
317
  "customers.calendar.platform.meet": "Meet",
317
318
  "customers.calendar.platform.slack": "Slack",
@@ -312,6 +312,7 @@
312
312
  "customers.calendar.peek.attendee": "1 asistente",
313
313
  "customers.calendar.peek.attendees": "{count} asistentes",
314
314
  "customers.calendar.peek.edit": "Editar",
315
+ "customers.calendar.peek.editForbidden": "No tienes permiso para editar eventos",
315
316
  "customers.calendar.peek.join": "Unirse",
316
317
  "customers.calendar.platform.meet": "Meet",
317
318
  "customers.calendar.platform.slack": "Slack",
@@ -312,6 +312,7 @@
312
312
  "customers.calendar.peek.attendee": "1 uczestnik",
313
313
  "customers.calendar.peek.attendees": "{count} uczestników",
314
314
  "customers.calendar.peek.edit": "Edytuj",
315
+ "customers.calendar.peek.editForbidden": "Nie masz uprawnień do edycji wydarzeń",
315
316
  "customers.calendar.peek.join": "Dołącz",
316
317
  "customers.calendar.platform.meet": "Meet",
317
318
  "customers.calendar.platform.slack": "Slack",