@open-mercato/core 0.6.7-develop.6785.1.1dd7cfac55 → 0.6.7-develop.6795.1.8a3f27921c
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/.turbo/turbo-build.log +1 -1
- package/dist/generated/entities.ids.generated.js +1 -0
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/modules/auth/backend/settings/page.js +14 -9
- package/dist/modules/auth/backend/settings/page.js.map +2 -2
- package/dist/modules/customers/cli.js +17 -7
- package/dist/modules/customers/cli.js.map +2 -2
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js +229 -216
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js.map +2 -2
- package/dist/modules/customers/search.js +50 -29
- package/dist/modules/customers/search.js.map +2 -2
- package/dist/modules/data_sync/api/mappings/[id]/route.js +22 -9
- package/dist/modules/data_sync/api/mappings/[id]/route.js.map +2 -2
- package/dist/modules/data_sync/api/mappings/route.js +13 -4
- package/dist/modules/data_sync/api/mappings/route.js.map +2 -2
- package/dist/modules/data_sync/api/options.js +7 -2
- package/dist/modules/data_sync/api/options.js.map +2 -2
- package/dist/modules/data_sync/api/run.js +7 -2
- package/dist/modules/data_sync/api/run.js.map +2 -2
- package/dist/modules/data_sync/api/runs/[id]/cancel.js +8 -3
- package/dist/modules/data_sync/api/runs/[id]/cancel.js.map +2 -2
- package/dist/modules/data_sync/api/runs/[id]/retry.js +7 -2
- package/dist/modules/data_sync/api/runs/[id]/retry.js.map +2 -2
- package/dist/modules/data_sync/api/runs/[id]/route.js +8 -3
- package/dist/modules/data_sync/api/runs/[id]/route.js.map +2 -2
- package/dist/modules/data_sync/api/runs.js +7 -2
- package/dist/modules/data_sync/api/runs.js.map +2 -2
- package/dist/modules/data_sync/api/schedules/[id]/route.js +19 -6
- package/dist/modules/data_sync/api/schedules/[id]/route.js.map +2 -2
- package/dist/modules/data_sync/api/schedules/route.js +13 -4
- package/dist/modules/data_sync/api/schedules/route.js.map +2 -2
- package/dist/modules/data_sync/api/validate.js +9 -4
- package/dist/modules/data_sync/api/validate.js.map +2 -2
- package/dist/modules/design_system/acl.js +9 -0
- package/dist/modules/design_system/acl.js.map +7 -0
- package/dist/modules/design_system/backend/design-system/page.js +11 -0
- package/dist/modules/design_system/backend/design-system/page.js.map +7 -0
- package/dist/modules/design_system/backend/design-system/page.meta.js +15 -0
- package/dist/modules/design_system/backend/design-system/page.meta.js.map +7 -0
- package/dist/modules/design_system/gallery/components/CodeSnippet.js +52 -0
- package/dist/modules/design_system/gallery/components/CodeSnippet.js.map +7 -0
- package/dist/modules/design_system/gallery/components/EntryCard.js +63 -0
- package/dist/modules/design_system/gallery/components/EntryCard.js.map +7 -0
- package/dist/modules/design_system/gallery/components/GalleryShell.js +163 -0
- package/dist/modules/design_system/gallery/components/GalleryShell.js.map +7 -0
- package/dist/modules/design_system/gallery/components/VariantPreview.js +9 -0
- package/dist/modules/design_system/gallery/components/VariantPreview.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/banners.js +186 -0
- package/dist/modules/design_system/gallery/entries/banners.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/buttons.js +361 -0
- package/dist/modules/design_system/gallery/entries/buttons.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/charts.js +457 -0
- package/dist/modules/design_system/gallery/entries/charts.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/dates.js +306 -0
- package/dist/modules/design_system/gallery/entries/dates.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/detail.js +358 -0
- package/dist/modules/design_system/gallery/entries/detail.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/display.js +785 -0
- package/dist/modules/design_system/gallery/entries/display.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/feedback.js +658 -0
- package/dist/modules/design_system/gallery/entries/feedback.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/filters.js +505 -0
- package/dist/modules/design_system/gallery/entries/filters.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/foundations.js +453 -0
- package/dist/modules/design_system/gallery/entries/foundations.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/icons.js +140 -0
- package/dist/modules/design_system/gallery/entries/icons.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/inputs.js +1217 -0
- package/dist/modules/design_system/gallery/entries/inputs.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/messages.js +334 -0
- package/dist/modules/design_system/gallery/entries/messages.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/navigation.js +475 -0
- package/dist/modules/design_system/gallery/entries/navigation.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/notifications.js +257 -0
- package/dist/modules/design_system/gallery/entries/notifications.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/overlays.js +576 -0
- package/dist/modules/design_system/gallery/entries/overlays.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/scaffolding.js +378 -0
- package/dist/modules/design_system/gallery/entries/scaffolding.js.map +7 -0
- package/dist/modules/design_system/gallery/entries/schedule.js +297 -0
- package/dist/modules/design_system/gallery/entries/schedule.js.map +7 -0
- package/dist/modules/design_system/gallery/registry.js +139 -0
- package/dist/modules/design_system/gallery/registry.js.map +7 -0
- package/dist/modules/design_system/gallery/types.js +1 -0
- package/dist/modules/design_system/gallery/types.js.map +7 -0
- package/dist/modules/design_system/index.js +9 -0
- package/dist/modules/design_system/index.js.map +7 -0
- package/dist/modules/design_system/setup.js +14 -0
- package/dist/modules/design_system/setup.js.map +7 -0
- package/dist/modules/inbox_ops/search.js +15 -4
- package/dist/modules/inbox_ops/search.js.map +2 -2
- package/dist/modules/integrations/api/[id]/credentials/route.js +11 -5
- package/dist/modules/integrations/api/[id]/credentials/route.js.map +2 -2
- package/dist/modules/integrations/api/[id]/health/route.js +6 -3
- package/dist/modules/integrations/api/[id]/health/route.js.map +2 -2
- package/dist/modules/integrations/api/[id]/route.js +6 -3
- package/dist/modules/integrations/api/[id]/route.js.map +2 -2
- package/dist/modules/integrations/api/[id]/state/route.js +6 -3
- package/dist/modules/integrations/api/[id]/state/route.js.map +2 -2
- package/dist/modules/integrations/api/[id]/version/route.js +6 -3
- package/dist/modules/integrations/api/[id]/version/route.js.map +2 -2
- package/dist/modules/integrations/api/logs/route.js +6 -3
- package/dist/modules/integrations/api/logs/route.js.map +2 -2
- package/dist/modules/integrations/api/route.js +6 -3
- package/dist/modules/integrations/api/route.js.map +2 -2
- package/dist/modules/integrations/api/umes-read.js +2 -2
- package/dist/modules/integrations/api/umes-read.js.map +2 -2
- package/dist/modules/integrations/lib/organization-scope.js +2 -9
- package/dist/modules/integrations/lib/organization-scope.js.map +2 -2
- package/dist/modules/messages/search.js +10 -5
- package/dist/modules/messages/search.js.map +2 -2
- package/dist/modules/query_index/data/entities.js +2 -1
- package/dist/modules/query_index/data/entities.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +32 -50
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/query_index/migrations/Migration20260731105052_query_index.js +17 -0
- package/dist/modules/query_index/migrations/Migration20260731105052_query_index.js.map +7 -0
- package/generated/entities.ids.generated.ts +1 -0
- package/package.json +16 -16
- package/src/modules/auth/backend/settings/page.tsx +17 -8
- package/src/modules/customers/cli.ts +17 -7
- package/src/modules/customers/components/detail/ScheduleActivityDialog.tsx +24 -13
- package/src/modules/customers/i18n/de.json +17 -0
- package/src/modules/customers/i18n/en.json +17 -0
- package/src/modules/customers/i18n/es.json +17 -0
- package/src/modules/customers/i18n/pl.json +17 -0
- package/src/modules/customers/search.ts +59 -27
- package/src/modules/data_sync/AGENTS.md +1 -0
- package/src/modules/data_sync/api/mappings/[id]/route.ts +22 -9
- package/src/modules/data_sync/api/mappings/route.ts +13 -4
- package/src/modules/data_sync/api/options.ts +7 -2
- package/src/modules/data_sync/api/run.ts +7 -2
- package/src/modules/data_sync/api/runs/[id]/cancel.ts +8 -3
- package/src/modules/data_sync/api/runs/[id]/retry.ts +7 -2
- package/src/modules/data_sync/api/runs/[id]/route.ts +8 -3
- package/src/modules/data_sync/api/runs.ts +7 -2
- package/src/modules/data_sync/api/schedules/[id]/route.ts +19 -6
- package/src/modules/data_sync/api/schedules/route.ts +13 -4
- package/src/modules/data_sync/api/validate.ts +9 -4
- package/src/modules/design_system/AGENTS.md +34 -0
- package/src/modules/design_system/acl.ts +5 -0
- package/src/modules/design_system/backend/design-system/page.meta.ts +11 -0
- package/src/modules/design_system/backend/design-system/page.tsx +14 -0
- package/src/modules/design_system/gallery/components/CodeSnippet.tsx +55 -0
- package/src/modules/design_system/gallery/components/EntryCard.tsx +95 -0
- package/src/modules/design_system/gallery/components/GalleryShell.tsx +206 -0
- package/src/modules/design_system/gallery/components/VariantPreview.tsx +15 -0
- package/src/modules/design_system/gallery/entries/banners.tsx +226 -0
- package/src/modules/design_system/gallery/entries/buttons.tsx +422 -0
- package/src/modules/design_system/gallery/entries/charts.tsx +518 -0
- package/src/modules/design_system/gallery/entries/dates.tsx +325 -0
- package/src/modules/design_system/gallery/entries/detail.tsx +403 -0
- package/src/modules/design_system/gallery/entries/display.tsx +893 -0
- package/src/modules/design_system/gallery/entries/feedback.tsx +746 -0
- package/src/modules/design_system/gallery/entries/filters.tsx +570 -0
- package/src/modules/design_system/gallery/entries/foundations.tsx +529 -0
- package/src/modules/design_system/gallery/entries/icons.tsx +168 -0
- package/src/modules/design_system/gallery/entries/inputs.tsx +1516 -0
- package/src/modules/design_system/gallery/entries/messages.tsx +339 -0
- package/src/modules/design_system/gallery/entries/navigation.tsx +573 -0
- package/src/modules/design_system/gallery/entries/notifications.tsx +285 -0
- package/src/modules/design_system/gallery/entries/overlays.tsx +677 -0
- package/src/modules/design_system/gallery/entries/scaffolding.tsx +430 -0
- package/src/modules/design_system/gallery/entries/schedule.tsx +307 -0
- package/src/modules/design_system/gallery/registry.ts +152 -0
- package/src/modules/design_system/gallery/types.ts +32 -0
- package/src/modules/design_system/i18n/.hardcoded-allowlist.json +71 -0
- package/src/modules/design_system/i18n/de.json +46 -0
- package/src/modules/design_system/i18n/en.json +46 -0
- package/src/modules/design_system/i18n/es.json +46 -0
- package/src/modules/design_system/i18n/pl.json +46 -0
- package/src/modules/design_system/index.ts +7 -0
- package/src/modules/design_system/setup.ts +12 -0
- package/src/modules/inbox_ops/i18n/de.json +3 -0
- package/src/modules/inbox_ops/i18n/en.json +3 -0
- package/src/modules/inbox_ops/i18n/es.json +3 -0
- package/src/modules/inbox_ops/i18n/pl.json +3 -0
- package/src/modules/inbox_ops/search.ts +20 -4
- package/src/modules/integrations/api/[id]/credentials/route.ts +11 -5
- package/src/modules/integrations/api/[id]/health/route.ts +6 -3
- package/src/modules/integrations/api/[id]/route.ts +6 -3
- package/src/modules/integrations/api/[id]/state/route.ts +6 -3
- package/src/modules/integrations/api/[id]/version/route.ts +6 -3
- package/src/modules/integrations/api/logs/route.ts +6 -3
- package/src/modules/integrations/api/route.ts +6 -3
- package/src/modules/integrations/api/umes-read.ts +2 -2
- package/src/modules/integrations/lib/organization-scope.ts +5 -25
- package/src/modules/messages/i18n/de.json +2 -0
- package/src/modules/messages/i18n/en.json +2 -0
- package/src/modules/messages/i18n/es.json +2 -0
- package/src/modules/messages/i18n/pl.json +2 -0
- package/src/modules/messages/search.ts +11 -5
- package/src/modules/query_index/data/entities.ts +7 -0
- package/src/modules/query_index/lib/engine.ts +40 -63
- package/src/modules/query_index/migrations/.snapshot-open-mercato.json +12 -0
- package/src/modules/query_index/migrations/Migration20260731105052_query_index.ts +35 -0
|
@@ -202,6 +202,7 @@ function ScheduleActivityDialog({
|
|
|
202
202
|
const initialSnapshotRef = React.useRef(null);
|
|
203
203
|
const snapshotOpenKeyRef = React.useRef(null);
|
|
204
204
|
const snapshotSettleCountRef = React.useRef(0);
|
|
205
|
+
const closeConfirmPendingRef = React.useRef(false);
|
|
205
206
|
const openKey = open ? `${editData?.id ?? "new"}` : null;
|
|
206
207
|
React.useEffect(() => {
|
|
207
208
|
if (!open) {
|
|
@@ -225,21 +226,27 @@ function ScheduleActivityDialog({
|
|
|
225
226
|
return initialSnapshotRef.current !== formSnapshot;
|
|
226
227
|
}, [formSnapshot]);
|
|
227
228
|
const guardedClose = React.useCallback(async () => {
|
|
229
|
+
if (closeConfirmPendingRef.current) return;
|
|
228
230
|
if (!isDirty()) {
|
|
229
231
|
onClose();
|
|
230
232
|
return;
|
|
231
233
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
"customers.schedule.discardConfirm.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
234
|
+
closeConfirmPendingRef.current = true;
|
|
235
|
+
try {
|
|
236
|
+
const ok = await confirm({
|
|
237
|
+
title: t("customers.schedule.discardConfirm.title", "Discard unsaved changes?"),
|
|
238
|
+
description: t(
|
|
239
|
+
"customers.schedule.discardConfirm.description",
|
|
240
|
+
"You have unsaved edits in this activity. Save them first or continue to discard them."
|
|
241
|
+
),
|
|
242
|
+
confirmText: t("customers.schedule.discardConfirm.confirm", "Discard"),
|
|
243
|
+
cancelText: t("customers.schedule.discardConfirm.cancel", "Keep editing"),
|
|
244
|
+
variant: "destructive"
|
|
245
|
+
});
|
|
246
|
+
if (ok) onClose();
|
|
247
|
+
} finally {
|
|
248
|
+
closeConfirmPendingRef.current = false;
|
|
249
|
+
}
|
|
243
250
|
}, [confirm, isDirty, onClose, t]);
|
|
244
251
|
const mutationContextId = React.useMemo(
|
|
245
252
|
() => `customer-activity:${entityType}:${entityId}`,
|
|
@@ -411,123 +418,152 @@ function ScheduleActivityDialog({
|
|
|
411
418
|
}
|
|
412
419
|
}, [callDirection, callOutcome, callPhoneInvalidMessage, callPhoneNumber, isDateMissing, isTimeMissing, state.activityType, state.allDay, state.date, state.description, dealId, state.duration, editData, entityId, state.guestPermissions, state.linkedEntities, state.location, onActivityCreated, onClose, state.participants, state.recurrenceCount, state.recurrenceDays, state.recurrenceEnabled, state.recurrenceEndDate, state.recurrenceEndType, state.reminderMinutes, runGuardedMutation, state.startTime, t, taskPriority, state.title, translateErrorMessage, trimmedCallPhone, trimmedDate, trimmedStartTime, state.visibility, visibleFields]);
|
|
413
420
|
const handleKeyDown = useDialogKeyHandler({ onConfirm: handleSave });
|
|
414
|
-
return /* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: (o) => {
|
|
415
422
|
if (!o) void guardedClose();
|
|
416
|
-
}, children:
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
/* @__PURE__ */ jsx(
|
|
423
|
+
}, children: /* @__PURE__ */ jsxs(
|
|
424
|
+
DialogContent,
|
|
425
|
+
{
|
|
426
|
+
className: "flex max-h-[90vh] flex-col overflow-hidden border-border p-0 shadow-xl sm:max-w-[760px] sm:rounded-xl [&>[data-dialog-close]]:hidden",
|
|
427
|
+
onKeyDown: handleKeyDown,
|
|
428
|
+
"aria-describedby": void 0,
|
|
429
|
+
children: [
|
|
430
|
+
ConfirmDialogElement,
|
|
431
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(DialogTitle, { children: isEditing ? t("customers.schedule.editTitle", "Edit activity") : t(chrome.titleKey, chrome.titleFallback) }) }),
|
|
432
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border bg-background px-6 py-5", children: [
|
|
433
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
434
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold leading-tight tracking-tight text-foreground", children: isEditing ? t("customers.schedule.editTitle", "Edit activity") : t(chrome.titleKey, chrome.titleFallback) }),
|
|
435
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t(chrome.subtitleKey, chrome.subtitleFallback) }),
|
|
436
|
+
entityName ? /* @__PURE__ */ jsxs("p", { className: "mt-0.5 text-xs text-muted-foreground/80", children: [
|
|
437
|
+
t("customers.schedule.context", "On timeline: {{name}}", { name: entityName }),
|
|
438
|
+
companyName ? ` \xB7 ${companyName}` : ""
|
|
439
|
+
] }) : null
|
|
440
|
+
] }),
|
|
441
|
+
/* @__PURE__ */ jsx(IconButton, { type: "button", variant: "ghost", size: "sm", onClick: () => {
|
|
442
|
+
void guardedClose();
|
|
443
|
+
}, className: "flex size-9 shrink-0 items-center justify-center rounded-md border border-border bg-background", "aria-label": t("customers.schedule.cancel", "Cancel"), children: /* @__PURE__ */ jsx(X, { className: "size-4 text-muted-foreground" }) })
|
|
437
444
|
] }),
|
|
438
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
445
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 bg-background p-6", children: [
|
|
446
|
+
state.conflict && /* @__PURE__ */ jsxs(Alert, { variant: "warning", className: "rounded-lg", children: [
|
|
447
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t("customers.schedule.conflict.title", "Calendar conflict") }),
|
|
448
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: state.conflict })
|
|
449
|
+
] }),
|
|
450
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 gap-2", children: TYPE_TABS.map(({ type, icon: Icon, labelKey, fallback }) => {
|
|
451
|
+
const isActive = state.activityType === type;
|
|
452
|
+
return /* @__PURE__ */ jsxs(
|
|
453
|
+
"button",
|
|
454
|
+
{
|
|
455
|
+
type: "button",
|
|
456
|
+
onClick: () => state.setActivityType(type),
|
|
457
|
+
"aria-pressed": isActive,
|
|
458
|
+
className: cn(
|
|
459
|
+
"flex h-[80px] flex-col items-center justify-center gap-2 rounded-md border text-[14px] font-semibold transition-colors",
|
|
460
|
+
isActive ? "border-transparent bg-foreground text-background" : "border-border bg-card text-muted-foreground hover:border-foreground/40 hover:text-foreground"
|
|
461
|
+
),
|
|
462
|
+
children: [
|
|
463
|
+
/* @__PURE__ */ jsx(Icon, { className: "size-[18px]" }),
|
|
464
|
+
t(labelKey, fallback)
|
|
465
|
+
]
|
|
466
|
+
},
|
|
467
|
+
type
|
|
468
|
+
);
|
|
469
|
+
}) }),
|
|
470
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
471
|
+
/* @__PURE__ */ jsx("label", { className: "text-overline font-semibold text-muted-foreground tracking-wider", children: getFieldLabel(state.activityType, "title", t, "customers.schedule.titleLabel", "Title") }),
|
|
472
|
+
/* @__PURE__ */ jsx(
|
|
473
|
+
"input",
|
|
474
|
+
{
|
|
475
|
+
type: "text",
|
|
476
|
+
value: state.title,
|
|
477
|
+
onChange: (e) => state.setTitle(e.target.value),
|
|
478
|
+
placeholder: state.activityType === "email" ? t("customers.schedule.subjectPlaceholder", "Subject...") : t("customers.schedule.titlePlaceholder", "Activity title..."),
|
|
479
|
+
className: "w-full rounded-md border border-border bg-background px-3 py-2.5 text-sm text-foreground outline-none focus:border-foreground",
|
|
480
|
+
autoFocus: true
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
] }),
|
|
460
484
|
/* @__PURE__ */ jsx(
|
|
461
|
-
|
|
485
|
+
DateTimeFields,
|
|
462
486
|
{
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
487
|
+
visible: visibleFields,
|
|
488
|
+
activityType: state.activityType,
|
|
489
|
+
date: state.date,
|
|
490
|
+
setDate: state.setDate,
|
|
491
|
+
startTime: state.startTime,
|
|
492
|
+
setStartTime: state.setStartTime,
|
|
493
|
+
duration: state.duration,
|
|
494
|
+
setDuration: state.setDuration,
|
|
495
|
+
allDay: state.allDay,
|
|
496
|
+
setAllDay: state.setAllDay,
|
|
497
|
+
recurrenceEnabled: state.recurrenceEnabled,
|
|
498
|
+
setRecurrenceEnabled: state.setRecurrenceEnabled,
|
|
499
|
+
recurrenceDays: state.recurrenceDays,
|
|
500
|
+
toggleRecurrenceDay: state.toggleRecurrenceDay,
|
|
501
|
+
recurrenceEndType: state.recurrenceEndType,
|
|
502
|
+
setRecurrenceEndType: state.setRecurrenceEndType,
|
|
503
|
+
recurrenceCount: state.recurrenceCount,
|
|
504
|
+
setRecurrenceCount: state.setRecurrenceCount,
|
|
505
|
+
recurrenceEndDate: state.recurrenceEndDate,
|
|
506
|
+
setRecurrenceEndDate: state.setRecurrenceEndDate
|
|
469
507
|
}
|
|
470
|
-
)
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
);
|
|
519
|
-
}) })
|
|
508
|
+
),
|
|
509
|
+
state.activityType === "call" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
510
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
511
|
+
/* @__PURE__ */ jsx("label", { className: "text-overline font-semibold uppercase text-muted-foreground tracking-wider", children: t("customers.schedule.call.directionLabel", "Direction") }),
|
|
512
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: CALL_DIRECTIONS.map((opt) => {
|
|
513
|
+
const isActive = callDirection === opt.key;
|
|
514
|
+
return /* @__PURE__ */ jsxs(
|
|
515
|
+
"button",
|
|
516
|
+
{
|
|
517
|
+
type: "button",
|
|
518
|
+
"aria-pressed": isActive,
|
|
519
|
+
onClick: () => setCallDirection(opt.key),
|
|
520
|
+
className: cn(
|
|
521
|
+
"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm font-medium transition-colors",
|
|
522
|
+
isActive ? "border-transparent bg-foreground text-background" : "border-border bg-card text-muted-foreground hover:border-foreground/40"
|
|
523
|
+
),
|
|
524
|
+
children: [
|
|
525
|
+
/* @__PURE__ */ jsx("span", { className: cn("inline-block size-1.5 rounded-full", opt.dot), "aria-hidden": true }),
|
|
526
|
+
t(opt.labelKey, opt.labelFallback)
|
|
527
|
+
]
|
|
528
|
+
},
|
|
529
|
+
opt.key
|
|
530
|
+
);
|
|
531
|
+
}) })
|
|
532
|
+
] }),
|
|
533
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
534
|
+
/* @__PURE__ */ jsx("label", { className: "text-overline font-semibold uppercase text-muted-foreground tracking-wider", children: t("customers.schedule.call.outcomeLabel", "Outcome") }),
|
|
535
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: CALL_OUTCOMES.map((opt) => {
|
|
536
|
+
const isActive = callOutcome === opt.key;
|
|
537
|
+
return /* @__PURE__ */ jsxs(
|
|
538
|
+
"button",
|
|
539
|
+
{
|
|
540
|
+
type: "button",
|
|
541
|
+
"aria-pressed": isActive,
|
|
542
|
+
onClick: () => setCallOutcome(isActive ? null : opt.key),
|
|
543
|
+
className: cn(
|
|
544
|
+
"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm font-medium transition-colors",
|
|
545
|
+
isActive ? "border-transparent bg-foreground text-background" : "border-border bg-card text-muted-foreground hover:border-foreground/40"
|
|
546
|
+
),
|
|
547
|
+
children: [
|
|
548
|
+
/* @__PURE__ */ jsx("span", { className: cn("inline-block size-1.5 rounded-full", opt.dot), "aria-hidden": true }),
|
|
549
|
+
t(opt.labelKey, opt.labelFallback)
|
|
550
|
+
]
|
|
551
|
+
},
|
|
552
|
+
opt.key
|
|
553
|
+
);
|
|
554
|
+
}) })
|
|
555
|
+
] })
|
|
520
556
|
] }),
|
|
521
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
522
|
-
/* @__PURE__ */ jsx("label", { className: "text-overline font-semibold uppercase text-muted-foreground tracking-wider", children: t("customers.schedule.
|
|
523
|
-
/* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children:
|
|
524
|
-
const isActive =
|
|
557
|
+
state.activityType === "task" && /* @__PURE__ */ jsxs("div", { children: [
|
|
558
|
+
/* @__PURE__ */ jsx("label", { className: "text-overline font-semibold uppercase text-muted-foreground tracking-wider", children: t("customers.schedule.task.priorityLabel", "Priority") }),
|
|
559
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: TASK_PRIORITIES.map((opt) => {
|
|
560
|
+
const isActive = taskPriority === opt.key;
|
|
525
561
|
return /* @__PURE__ */ jsxs(
|
|
526
562
|
"button",
|
|
527
563
|
{
|
|
528
564
|
type: "button",
|
|
529
565
|
"aria-pressed": isActive,
|
|
530
|
-
onClick: () =>
|
|
566
|
+
onClick: () => setTaskPriority(opt.key),
|
|
531
567
|
className: cn(
|
|
532
568
|
"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm font-medium transition-colors",
|
|
533
569
|
isActive ? "border-transparent bg-foreground text-background" : "border-border bg-card text-muted-foreground hover:border-foreground/40"
|
|
@@ -540,112 +576,89 @@ function ScheduleActivityDialog({
|
|
|
540
576
|
opt.key
|
|
541
577
|
);
|
|
542
578
|
}) })
|
|
543
|
-
] })
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
579
|
+
] }),
|
|
580
|
+
/* @__PURE__ */ jsx(
|
|
581
|
+
ParticipantsField,
|
|
582
|
+
{
|
|
583
|
+
visible: visibleFields,
|
|
584
|
+
activityType: state.activityType,
|
|
585
|
+
participants: state.participants,
|
|
586
|
+
setParticipants: state.setParticipants,
|
|
587
|
+
removeParticipant: state.removeParticipant,
|
|
588
|
+
guestPermissions: state.guestPermissions,
|
|
589
|
+
setGuestPermissions: state.setGuestPermissions
|
|
590
|
+
}
|
|
591
|
+
),
|
|
592
|
+
state.activityType === "call" ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
593
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "schedule-call-phone", className: "text-overline font-semibold uppercase text-muted-foreground tracking-wider", children: t("customers.schedule.call.phoneLabel", "Phone number") }),
|
|
594
|
+
/* @__PURE__ */ jsx(
|
|
595
|
+
PhoneNumberField,
|
|
551
596
|
{
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
visible: visibleFields,
|
|
572
|
-
activityType: state.activityType,
|
|
573
|
-
participants: state.participants,
|
|
574
|
-
setParticipants: state.setParticipants,
|
|
575
|
-
removeParticipant: state.removeParticipant,
|
|
576
|
-
guestPermissions: state.guestPermissions,
|
|
577
|
-
setGuestPermissions: state.setGuestPermissions
|
|
578
|
-
}
|
|
579
|
-
),
|
|
580
|
-
state.activityType === "call" ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
581
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "schedule-call-phone", className: "text-overline font-semibold uppercase text-muted-foreground tracking-wider", children: t("customers.schedule.call.phoneLabel", "Phone number") }),
|
|
597
|
+
id: "schedule-call-phone",
|
|
598
|
+
value: callPhoneNumber,
|
|
599
|
+
onValueChange: handleCallPhoneChange,
|
|
600
|
+
placeholder: t("customers.schedule.call.phonePlaceholder", "+1 555 000 0000"),
|
|
601
|
+
externalError: callPhoneError,
|
|
602
|
+
invalidLabel: callPhoneInvalidMessage,
|
|
603
|
+
minDigits: 7,
|
|
604
|
+
defaultCountryIso2
|
|
605
|
+
}
|
|
606
|
+
)
|
|
607
|
+
] }) : /* @__PURE__ */ jsx(
|
|
608
|
+
LocationField,
|
|
609
|
+
{
|
|
610
|
+
visible: visibleFields,
|
|
611
|
+
activityType: state.activityType,
|
|
612
|
+
location: state.location,
|
|
613
|
+
setLocation: state.setLocation
|
|
614
|
+
}
|
|
615
|
+
),
|
|
582
616
|
/* @__PURE__ */ jsx(
|
|
583
|
-
|
|
617
|
+
LinkedEntitiesField,
|
|
584
618
|
{
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
externalError: callPhoneError,
|
|
590
|
-
invalidLabel: callPhoneInvalidMessage,
|
|
591
|
-
minDigits: 7,
|
|
592
|
-
defaultCountryIso2
|
|
619
|
+
visible: visibleFields,
|
|
620
|
+
activityType: state.activityType,
|
|
621
|
+
linkedEntities: state.linkedEntities,
|
|
622
|
+
setLinkedEntities: state.setLinkedEntities
|
|
593
623
|
}
|
|
594
|
-
)
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
setLinkedEntities: state.setLinkedEntities
|
|
611
|
-
}
|
|
612
|
-
),
|
|
613
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
614
|
-
/* @__PURE__ */ jsx("label", { className: "text-overline font-semibold uppercase text-muted-foreground tracking-wider", children: getFieldLabel(state.activityType, "description", t, "customers.schedule.description", "Description") }),
|
|
615
|
-
/* @__PURE__ */ jsx("div", { className: "mt-[8px]", children: /* @__PURE__ */ jsx(
|
|
616
|
-
SwitchableMarkdownInput,
|
|
624
|
+
),
|
|
625
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
626
|
+
/* @__PURE__ */ jsx("label", { className: "text-overline font-semibold uppercase text-muted-foreground tracking-wider", children: getFieldLabel(state.activityType, "description", t, "customers.schedule.description", "Description") }),
|
|
627
|
+
/* @__PURE__ */ jsx("div", { className: "mt-[8px]", children: /* @__PURE__ */ jsx(
|
|
628
|
+
SwitchableMarkdownInput,
|
|
629
|
+
{
|
|
630
|
+
value: state.description,
|
|
631
|
+
onChange: state.setDescription,
|
|
632
|
+
isMarkdownEnabled: state.markdownEnabled,
|
|
633
|
+
height: 120,
|
|
634
|
+
placeholder: t("customers.schedule.descriptionPlaceholder", "Add details...")
|
|
635
|
+
}
|
|
636
|
+
) })
|
|
637
|
+
] }),
|
|
638
|
+
/* @__PURE__ */ jsx(
|
|
639
|
+
FooterFields,
|
|
617
640
|
{
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
641
|
+
visible: visibleFields,
|
|
642
|
+
activityType: state.activityType,
|
|
643
|
+
reminderMinutes: state.reminderMinutes,
|
|
644
|
+
setReminderMinutes: state.setReminderMinutes,
|
|
645
|
+
visibility: state.visibility,
|
|
646
|
+
setVisibility: state.setVisibility
|
|
623
647
|
}
|
|
624
|
-
)
|
|
625
|
-
] }),
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
setVisibility: state.setVisibility
|
|
635
|
-
}
|
|
636
|
-
)
|
|
637
|
-
] }) }),
|
|
638
|
-
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center justify-end gap-2.5 border-t border-border bg-muted/50 px-6 py-4", children: [
|
|
639
|
-
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
640
|
-
void guardedClose();
|
|
641
|
-
}, className: "rounded-md border border-input bg-background px-5 py-3 text-sm font-semibold text-foreground", children: t("customers.schedule.cancel", "Cancel") }),
|
|
642
|
-
/* @__PURE__ */ jsxs(Button, { type: "button", onClick: handleSave, disabled: isSubmitDisabled, className: "flex items-center gap-2 rounded-md bg-foreground px-5 py-3 text-sm font-semibold text-background hover:bg-foreground/90 disabled:opacity-50", children: [
|
|
643
|
-
/* @__PURE__ */ jsx(SaveIcon, { className: "size-3.5" }),
|
|
644
|
-
state.saving ? t("customers.schedule.saving", "Saving...") : isEditing ? t("customers.schedule.update", "Update activity") : t(chrome.saveKey, chrome.saveFallback)
|
|
648
|
+
)
|
|
649
|
+
] }) }),
|
|
650
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center justify-end gap-2.5 border-t border-border bg-muted/50 px-6 py-4", children: [
|
|
651
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
652
|
+
void guardedClose();
|
|
653
|
+
}, className: "rounded-md border border-input bg-background px-5 py-3 text-sm font-semibold text-foreground", children: t("customers.schedule.cancel", "Cancel") }),
|
|
654
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", onClick: handleSave, disabled: isSubmitDisabled, className: "flex items-center gap-2 rounded-md bg-foreground px-5 py-3 text-sm font-semibold text-background hover:bg-foreground/90 disabled:opacity-50", children: [
|
|
655
|
+
/* @__PURE__ */ jsx(SaveIcon, { className: "size-3.5" }),
|
|
656
|
+
state.saving ? t("customers.schedule.saving", "Saving...") : isEditing ? t("customers.schedule.update", "Update activity") : t(chrome.saveKey, chrome.saveFallback)
|
|
657
|
+
] })
|
|
645
658
|
] })
|
|
646
|
-
]
|
|
647
|
-
|
|
648
|
-
|
|
659
|
+
]
|
|
660
|
+
}
|
|
661
|
+
) });
|
|
649
662
|
}
|
|
650
663
|
function buildRecurrenceRule(days, endType, count, endDate) {
|
|
651
664
|
const dayNames = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"];
|