@open-mercato/core 0.6.4-develop.4178.1.aad9ddaa95 → 0.6.4-develop.4210.1.d412061cfe

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 (99) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/modules/api_docs/frontend/docs/api/Explorer.js +14 -14
  3. package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
  4. package/dist/modules/attachments/components/AttachmentContentPreview.js +2 -2
  5. package/dist/modules/attachments/components/AttachmentContentPreview.js.map +2 -2
  6. package/dist/modules/audit_logs/backend/audit-logs/page.js +3 -3
  7. package/dist/modules/audit_logs/backend/audit-logs/page.js.map +2 -2
  8. package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js +3 -7
  9. package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js.map +2 -2
  10. package/dist/modules/customers/components/detail/ActivityCard.js +2 -2
  11. package/dist/modules/customers/components/detail/ActivityCard.js.map +2 -2
  12. package/dist/modules/customers/components/detail/AssignRoleDialog.js +34 -49
  13. package/dist/modules/customers/components/detail/AssignRoleDialog.js.map +2 -2
  14. package/dist/modules/customers/components/detail/ChangelogEntryRow.js +2 -2
  15. package/dist/modules/customers/components/detail/ChangelogEntryRow.js.map +2 -2
  16. package/dist/modules/customers/components/detail/CompanyDetailHeader.js +10 -1
  17. package/dist/modules/customers/components/detail/CompanyDetailHeader.js.map +2 -2
  18. package/dist/modules/customers/components/detail/DealLinkedEntitiesTab.js +7 -51
  19. package/dist/modules/customers/components/detail/DealLinkedEntitiesTab.js.map +2 -2
  20. package/dist/modules/customers/components/detail/DetailTabsLayout.js +1 -1
  21. package/dist/modules/customers/components/detail/DetailTabsLayout.js.map +2 -2
  22. package/dist/modules/customers/components/detail/ManageTagsDialog.js +25 -33
  23. package/dist/modules/customers/components/detail/ManageTagsDialog.js.map +2 -2
  24. package/dist/modules/customers/components/detail/PersonCard.js +3 -2
  25. package/dist/modules/customers/components/detail/PersonCard.js.map +2 -2
  26. package/dist/modules/customers/components/detail/PersonDetailHeader.js +3 -2
  27. package/dist/modules/customers/components/detail/PersonDetailHeader.js.map +2 -2
  28. package/dist/modules/customers/components/detail/RoleAssignmentRow.js +4 -5
  29. package/dist/modules/customers/components/detail/RoleAssignmentRow.js.map +2 -2
  30. package/dist/modules/customers/components/detail/utils.js +0 -7
  31. package/dist/modules/customers/components/detail/utils.js.map +2 -2
  32. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js +3 -8
  33. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js.map +2 -2
  34. package/dist/modules/dictionaries/components/AppearanceSelector.js +3 -4
  35. package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
  36. package/dist/modules/integrations/backend/integrations/[id]/page.js +17 -17
  37. package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
  38. package/dist/modules/planner/backend/planner/availability-rulesets/[id]/page.js +1 -1
  39. package/dist/modules/planner/backend/planner/availability-rulesets/[id]/page.js.map +2 -2
  40. package/dist/modules/planner/components/AvailabilityRulesEditor.js +65 -1
  41. package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
  42. package/dist/modules/planner/lib/deleteAvailabilityRuleSet.js +20 -0
  43. package/dist/modules/planner/lib/deleteAvailabilityRuleSet.js.map +7 -0
  44. package/dist/modules/resources/backend/resources/resources/[id]/page.js +2 -2
  45. package/dist/modules/resources/backend/resources/resources/[id]/page.js.map +2 -2
  46. package/dist/modules/sales/api/quotes/accept/route.js +14 -37
  47. package/dist/modules/sales/api/quotes/accept/route.js.map +3 -3
  48. package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js +1 -1
  49. package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js.map +2 -2
  50. package/dist/modules/sales/backend/sales/documents/[id]/page.js +1 -1
  51. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
  52. package/dist/modules/sales/commands/documents.js +6 -2
  53. package/dist/modules/sales/commands/documents.js.map +2 -2
  54. package/dist/modules/staff/backend/staff/team-members/[id]/page.js +3 -2
  55. package/dist/modules/staff/backend/staff/team-members/[id]/page.js.map +2 -2
  56. package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js +1 -1
  57. package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js.map +2 -2
  58. package/dist/modules/translations/components/TranslationDrawerAction.js +27 -65
  59. package/dist/modules/translations/components/TranslationDrawerAction.js.map +2 -2
  60. package/dist/modules/translations/components/TranslationManager.js +2 -2
  61. package/dist/modules/translations/components/TranslationManager.js.map +2 -2
  62. package/dist/modules/translations/widgets/injection/translation-manager/widget.client.js +54 -92
  63. package/dist/modules/translations/widgets/injection/translation-manager/widget.client.js.map +2 -2
  64. package/package.json +7 -7
  65. package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +14 -14
  66. package/src/modules/attachments/components/AttachmentContentPreview.tsx +2 -2
  67. package/src/modules/audit_logs/backend/audit-logs/page.tsx +3 -3
  68. package/src/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.tsx +4 -8
  69. package/src/modules/customers/components/detail/ActivityCard.tsx +2 -4
  70. package/src/modules/customers/components/detail/AssignRoleDialog.tsx +28 -55
  71. package/src/modules/customers/components/detail/ChangelogEntryRow.tsx +6 -4
  72. package/src/modules/customers/components/detail/CompanyDetailHeader.tsx +7 -3
  73. package/src/modules/customers/components/detail/DealLinkedEntitiesTab.tsx +11 -49
  74. package/src/modules/customers/components/detail/DetailTabsLayout.tsx +1 -1
  75. package/src/modules/customers/components/detail/ManageTagsDialog.tsx +27 -36
  76. package/src/modules/customers/components/detail/PersonCard.tsx +3 -4
  77. package/src/modules/customers/components/detail/PersonDetailHeader.tsx +3 -4
  78. package/src/modules/customers/components/detail/RoleAssignmentRow.tsx +4 -7
  79. package/src/modules/customers/components/detail/utils.ts +0 -7
  80. package/src/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.tsx +4 -9
  81. package/src/modules/dictionaries/components/AppearanceSelector.tsx +3 -4
  82. package/src/modules/integrations/backend/integrations/[id]/page.tsx +21 -21
  83. package/src/modules/planner/backend/planner/availability-rulesets/[id]/page.tsx +1 -1
  84. package/src/modules/planner/components/AvailabilityRulesEditor.tsx +62 -0
  85. package/src/modules/planner/lib/deleteAvailabilityRuleSet.ts +35 -0
  86. package/src/modules/resources/backend/resources/resources/[id]/page.tsx +2 -2
  87. package/src/modules/sales/api/quotes/accept/route.ts +22 -38
  88. package/src/modules/sales/backend/sales/channels/[channelId]/edit/page.tsx +1 -1
  89. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +1 -1
  90. package/src/modules/sales/commands/documents.ts +16 -2
  91. package/src/modules/staff/backend/staff/team-members/[id]/page.tsx +3 -2
  92. package/src/modules/staff/backend/staff/teams/[id]/edit/page.tsx +1 -1
  93. package/src/modules/staff/i18n/de.json +5 -0
  94. package/src/modules/staff/i18n/en.json +5 -0
  95. package/src/modules/staff/i18n/es.json +5 -0
  96. package/src/modules/staff/i18n/pl.json +5 -0
  97. package/src/modules/translations/components/TranslationDrawerAction.tsx +31 -66
  98. package/src/modules/translations/components/TranslationManager.tsx +2 -2
  99. package/src/modules/translations/widgets/injection/translation-manager/widget.client.tsx +53 -84
@@ -1,8 +1,16 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from 'react'
4
- import { Languages, X } from 'lucide-react'
4
+ import { Languages } from 'lucide-react'
5
5
  import { Button } from '@open-mercato/ui/primitives/button'
6
+ import {
7
+ Drawer,
8
+ DrawerBody,
9
+ DrawerContent,
10
+ DrawerDescription,
11
+ DrawerHeader,
12
+ DrawerTitle,
13
+ } from '@open-mercato/ui/primitives/drawer'
6
14
  import { useT } from '@open-mercato/shared/lib/i18n/context'
7
15
  import { TranslationManager } from './TranslationManager'
8
16
 
@@ -24,30 +32,10 @@ export function TranslationDrawerAction({ config }: TranslationDrawerActionProps
24
32
  config?.entityType && config?.recordId && String(config.recordId).trim().length > 0,
25
33
  )
26
34
 
27
- React.useEffect(() => {
28
- if (!open || !canRender) return
29
- const prev = document.body.style.overflow
30
- document.body.style.overflow = 'hidden'
31
- return () => {
32
- document.body.style.overflow = prev
33
- }
34
- }, [canRender, open])
35
-
36
- React.useEffect(() => {
37
- if (!open || !canRender) return
38
- const handleKeyDown = (event: KeyboardEvent) => {
39
- if (event.key === 'Escape') {
40
- setOpen(false)
41
- }
42
- }
43
- document.addEventListener('keydown', handleKeyDown)
44
- return () => document.removeEventListener('keydown', handleKeyDown)
45
- }, [canRender, open])
46
-
47
35
  if (!canRender) return null
48
36
 
49
37
  return (
50
- <>
38
+ <Drawer open={open} onOpenChange={setOpen}>
51
39
  <Button
52
40
  type="button"
53
41
  variant="ghost"
@@ -58,50 +46,27 @@ export function TranslationDrawerAction({ config }: TranslationDrawerActionProps
58
46
  >
59
47
  <Languages className="size-4" />
60
48
  </Button>
61
- {open ? (
62
- <>
63
- <div
64
- className="fixed inset-0 z-overlay bg-black/20"
65
- onClick={() => setOpen(false)}
66
- aria-hidden="true"
49
+ <DrawerContent className="max-w-4xl">
50
+ <DrawerHeader>
51
+ <DrawerTitle>
52
+ {t('translations.widgets.translationManager.groupLabel', 'Translations')}
53
+ </DrawerTitle>
54
+ <DrawerDescription>
55
+ {t(
56
+ 'translations.widgets.translationManager.groupDescription',
57
+ 'Manage translations for this record across supported locales.',
58
+ )}
59
+ </DrawerDescription>
60
+ </DrawerHeader>
61
+ <DrawerBody>
62
+ <TranslationManager
63
+ mode="embedded"
64
+ entityType={config!.entityType}
65
+ recordId={config!.recordId}
66
+ baseValues={config!.baseValues}
67
67
  />
68
- <div
69
- className="fixed right-0 top-0 z-modal h-full w-full max-w-4xl border-l bg-background shadow-lg"
70
- role="dialog"
71
- aria-modal="true"
72
- aria-label={t('translations.widgets.translationManager.groupLabel', 'Translations')}
73
- >
74
- <div className="flex h-full flex-col">
75
- <div className="flex items-start justify-between gap-3 border-b px-4 py-3">
76
- <div className="space-y-1">
77
- <h2 className="font-semibold">
78
- {t('translations.widgets.translationManager.groupLabel', 'Translations')}
79
- </h2>
80
- <p className="text-sm text-muted-foreground">
81
- {t('translations.widgets.translationManager.groupDescription', 'Manage translations for this record across supported locales.')}
82
- </p>
83
- </div>
84
- <Button
85
- variant="ghost"
86
- size="icon"
87
- onClick={() => setOpen(false)}
88
- aria-label={t('ui.dialog.close.ariaLabel', 'Close')}
89
- >
90
- <X className="size-4" />
91
- </Button>
92
- </div>
93
- <div className="flex-1 overflow-y-auto px-4 py-4">
94
- <TranslationManager
95
- mode="embedded"
96
- entityType={config!.entityType}
97
- recordId={config!.recordId}
98
- baseValues={config!.baseValues}
99
- />
100
- </div>
101
- </div>
102
- </div>
103
- </>
104
- ) : null}
105
- </>
68
+ </DrawerBody>
69
+ </DrawerContent>
70
+ </Drawer>
106
71
  )
107
72
  }
@@ -316,7 +316,7 @@ export function TranslationManager({
316
316
  data-locale={locale}
317
317
  className={`px-3 py-1.5 text-sm font-medium transition-colors ${
318
318
  isActive
319
- ? 'border-b-2 border-primary text-primary'
319
+ ? 'border-b-2 border-accent-indigo text-foreground'
320
320
  : 'text-muted-foreground hover:text-foreground'
321
321
  }`}
322
322
  onClick={() => setActiveLocale(locale)}
@@ -496,7 +496,7 @@ export function TranslationManager({
496
496
  />
497
497
  </div>
498
498
  {entitiesError && (
499
- <p className="mt-1 text-xs text-red-600">
499
+ <p className="mt-1 text-xs text-destructive">
500
500
  {t('translations.manager.errors.loadEntities', 'Failed to load entities')}
501
501
  </p>
502
502
  )}
@@ -3,10 +3,18 @@
3
3
  import * as React from 'react'
4
4
  import { useParams } from 'next/navigation'
5
5
  import Link from 'next/link'
6
- import { ExternalLink, Languages, X } from 'lucide-react'
6
+ import { ExternalLink, Languages } from 'lucide-react'
7
7
  import type { InjectionWidgetComponentProps } from '@open-mercato/shared/modules/widgets/injection'
8
8
  import { useT } from '@open-mercato/shared/lib/i18n/context'
9
9
  import { Button } from '@open-mercato/ui/primitives/button'
10
+ import {
11
+ Drawer,
12
+ DrawerBody,
13
+ DrawerContent,
14
+ DrawerDescription,
15
+ DrawerHeader,
16
+ DrawerTitle,
17
+ } from '@open-mercato/ui/primitives/drawer'
10
18
  import { TranslationManager } from '../../../components/TranslationManager'
11
19
  import { extractRecordId } from '../../../lib/extract-record-id'
12
20
 
@@ -44,30 +52,10 @@ export default function TranslationWidget({ context, data }: InjectionWidgetComp
44
52
  const recordId = contextRecordId ?? dataRecordId ?? routeRecordId
45
53
  const canRender = Boolean(entityType && recordId && hasAccess)
46
54
 
47
- React.useEffect(() => {
48
- if (!open || !canRender) return
49
- const prev = document.body.style.overflow
50
- document.body.style.overflow = 'hidden'
51
- return () => {
52
- document.body.style.overflow = prev
53
- }
54
- }, [canRender, open])
55
-
56
- React.useEffect(() => {
57
- if (!open || !canRender) return
58
- const handleKeyDown = (event: KeyboardEvent) => {
59
- if (event.key === 'Escape') {
60
- setOpen(false)
61
- }
62
- }
63
- document.addEventListener('keydown', handleKeyDown)
64
- return () => document.removeEventListener('keydown', handleKeyDown)
65
- }, [canRender, open])
66
-
67
55
  if (!canRender) return null
68
56
 
69
57
  return (
70
- <>
58
+ <Drawer open={open} onOpenChange={setOpen}>
71
59
  <Button
72
60
  type="button"
73
61
  variant="ghost"
@@ -78,69 +66,50 @@ export default function TranslationWidget({ context, data }: InjectionWidgetComp
78
66
  >
79
67
  <Languages className="size-4" />
80
68
  </Button>
81
- {open ? (
82
- <>
83
- <div
84
- className="fixed inset-0 z-overlay bg-black/20"
85
- onClick={() => setOpen(false)}
86
- aria-hidden="true"
69
+ <DrawerContent className="max-w-4xl">
70
+ <DrawerHeader>
71
+ <DrawerTitle>
72
+ {t('translations.widgets.translationManager.groupLabel', 'Translations')}
73
+ </DrawerTitle>
74
+ <DrawerDescription>
75
+ {t(
76
+ 'translations.widgets.translationManager.groupDescription',
77
+ 'Manage translations for this record across supported locales.',
78
+ )}
79
+ </DrawerDescription>
80
+ </DrawerHeader>
81
+ <DrawerBody>
82
+ <TranslationManager
83
+ mode="embedded"
84
+ compact
85
+ entityType={entityType}
86
+ recordId={recordId}
87
+ baseValues={data}
87
88
  />
88
- <div
89
- className="fixed right-0 top-0 z-modal h-full w-full max-w-4xl border-l bg-background shadow-lg"
90
- role="dialog"
91
- aria-modal="true"
92
- aria-label={t('translations.widgets.translationManager.groupLabel', 'Translations')}
89
+ </DrawerBody>
90
+ {/* Custom footer: 2 inline link affordances (not action buttons),
91
+ wrap-friendly + left-aligned. DS DrawerFooter layouts assume
92
+ buttons in the trailing slot, so we hand-roll the row with
93
+ the DrawerFooter padding convention (`px-6 pt-4 pb-5`). */}
94
+ <div className="flex flex-wrap gap-x-4 gap-y-1 px-6 pt-4 pb-5">
95
+ <Link
96
+ href={`/backend/entities/system/${encodeURIComponent(entityType!)}`}
97
+ className="inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors"
98
+ >
99
+ <Languages className="size-3" />
100
+ {t('translations.widgets.translationManager.customFieldLabels', 'Custom fields translations')}
101
+ <ExternalLink className="size-2.5" />
102
+ </Link>
103
+ <Link
104
+ href="/backend/config/translations"
105
+ className="inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors"
93
106
  >
94
- <div className="flex h-full flex-col">
95
- <div className="flex items-start justify-between gap-3 border-b px-4 py-3">
96
- <div className="space-y-1">
97
- <h2 className="font-semibold">
98
- {t('translations.widgets.translationManager.groupLabel', 'Translations')}
99
- </h2>
100
- <p className="text-sm text-muted-foreground">
101
- {t('translations.widgets.translationManager.groupDescription', 'Manage translations for this record across supported locales.')}
102
- </p>
103
- </div>
104
- <Button
105
- variant="ghost"
106
- size="icon"
107
- onClick={() => setOpen(false)}
108
- aria-label={t('ui.dialog.close.ariaLabel', 'Close')}
109
- >
110
- <X className="size-4" />
111
- </Button>
112
- </div>
113
- <div className="flex-1 overflow-y-auto px-4 py-4">
114
- <TranslationManager
115
- mode="embedded"
116
- compact
117
- entityType={entityType}
118
- recordId={recordId}
119
- baseValues={data}
120
- />
121
- </div>
122
- <div className="flex flex-wrap gap-x-4 gap-y-1 border-t px-4 py-3">
123
- <Link
124
- href={`/backend/entities/system/${encodeURIComponent(entityType!)}`}
125
- className="inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors"
126
- >
127
- <Languages className="size-3" />
128
- {t('translations.widgets.translationManager.customFieldLabels', 'Custom fields translations')}
129
- <ExternalLink className="size-2.5" />
130
- </Link>
131
- <Link
132
- href="/backend/config/translations"
133
- className="inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors"
134
- >
135
- <Languages className="size-3" />
136
- {t('translations.widgets.translationManager.fullManager', 'Translation manager')}
137
- <ExternalLink className="size-2.5" />
138
- </Link>
139
- </div>
140
- </div>
141
- </div>
142
- </>
143
- ) : null}
144
- </>
107
+ <Languages className="size-3" />
108
+ {t('translations.widgets.translationManager.fullManager', 'Translation manager')}
109
+ <ExternalLink className="size-2.5" />
110
+ </Link>
111
+ </div>
112
+ </DrawerContent>
113
+ </Drawer>
145
114
  )
146
115
  }