@open-mercato/core 0.10.1-develop.7894.1.2c464c73e3 → 0.10.1-develop.7900.1.69c0120c72

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.
@@ -1,3 +1,11 @@
1
+ function formatDealDuplicateTitle(title, formatTitle) {
2
+ const formatted = formatTitle(title);
3
+ const excess = formatted.length - 200;
4
+ if (excess <= 0) return formatted;
5
+ let shortened = title.slice(0, Math.max(0, title.length - excess)).trimEnd();
6
+ if (/[\uD800-\uDBFF]$/.test(shortened)) shortened = shortened.slice(0, -1);
7
+ return formatTitle(shortened);
8
+ }
1
9
  function buildDealDuplicatePayload(source, title) {
2
10
  const payload = { title, status: "open" };
3
11
  if (source.pipelineId) payload.pipelineId = source.pipelineId;
@@ -12,6 +20,7 @@ function buildDealDuplicatePayload(source, title) {
12
20
  return payload;
13
21
  }
14
22
  export {
15
- buildDealDuplicatePayload
23
+ buildDealDuplicatePayload,
24
+ formatDealDuplicateTitle
16
25
  };
17
26
  //# sourceMappingURL=duplicateDeal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/modules/customers/lib/duplicateDeal.ts"],
4
- "sourcesContent": ["export type DealDuplicateSource = {\n pipelineId?: string | null\n pipelineStageId?: string | null\n valueAmount?: number | null\n valueCurrency?: string | null\n probability?: number | null\n expectedCloseAt?: string | null\n ownerUserId?: string | null\n}\n\n/**\n * Builds the `POST /api/customers/deals` body that creates a copy of an existing deal.\n *\n * Shared by the deals list row actions and the kanban card menu so both \"Duplicate\"\n * entry points copy the same fields. The copy always starts `open`; the unassigned kanban\n * lane sentinel is never forwarded as a stage id. `title` is supplied by the caller because\n * the page owns translation of the \"(copy)\" suffix.\n */\nexport function buildDealDuplicatePayload(\n source: DealDuplicateSource,\n title: string,\n): Record<string, unknown> {\n const payload: Record<string, unknown> = { title, status: 'open' }\n if (source.pipelineId) payload.pipelineId = source.pipelineId\n if (source.pipelineStageId && source.pipelineStageId !== '__unassigned') {\n payload.pipelineStageId = source.pipelineStageId\n }\n if (typeof source.valueAmount === 'number') payload.valueAmount = source.valueAmount\n if (source.valueCurrency) payload.valueCurrency = source.valueCurrency\n if (typeof source.probability === 'number') payload.probability = source.probability\n if (source.expectedCloseAt) payload.expectedCloseAt = source.expectedCloseAt\n if (source.ownerUserId) payload.ownerUserId = source.ownerUserId\n return payload\n}\n"],
5
- "mappings": "AAkBO,SAAS,0BACd,QACA,OACyB;AACzB,QAAM,UAAmC,EAAE,OAAO,QAAQ,OAAO;AACjE,MAAI,OAAO,WAAY,SAAQ,aAAa,OAAO;AACnD,MAAI,OAAO,mBAAmB,OAAO,oBAAoB,gBAAgB;AACvE,YAAQ,kBAAkB,OAAO;AAAA,EACnC;AACA,MAAI,OAAO,OAAO,gBAAgB,SAAU,SAAQ,cAAc,OAAO;AACzE,MAAI,OAAO,cAAe,SAAQ,gBAAgB,OAAO;AACzD,MAAI,OAAO,OAAO,gBAAgB,SAAU,SAAQ,cAAc,OAAO;AACzE,MAAI,OAAO,gBAAiB,SAAQ,kBAAkB,OAAO;AAC7D,MAAI,OAAO,YAAa,SAAQ,cAAc,OAAO;AACrD,SAAO;AACT;",
4
+ "sourcesContent": ["export function formatDealDuplicateTitle(title: string, formatTitle: (title: string) => string): string {\n const formatted = formatTitle(title)\n const excess = formatted.length - 200\n if (excess <= 0) return formatted\n let shortened = title.slice(0, Math.max(0, title.length - excess)).trimEnd()\n if (/[\\uD800-\\uDBFF]$/.test(shortened)) shortened = shortened.slice(0, -1)\n return formatTitle(shortened)\n}\n\nexport type DealDuplicateSource = {\n pipelineId?: string | null\n pipelineStageId?: string | null\n valueAmount?: number | null\n valueCurrency?: string | null\n probability?: number | null\n expectedCloseAt?: string | null\n ownerUserId?: string | null\n}\n\n/**\n * Builds the `POST /api/customers/deals` body that creates a copy of an existing deal.\n *\n * Shared by the deals list row actions and the kanban card menu so both \"Duplicate\"\n * entry points copy the same fields. The copy always starts `open`; the unassigned kanban\n * lane sentinel is never forwarded as a stage id. `title` is supplied by the caller because\n * the page owns translation of the \"(copy)\" suffix.\n */\nexport function buildDealDuplicatePayload(\n source: DealDuplicateSource,\n title: string,\n): Record<string, unknown> {\n const payload: Record<string, unknown> = { title, status: 'open' }\n if (source.pipelineId) payload.pipelineId = source.pipelineId\n if (source.pipelineStageId && source.pipelineStageId !== '__unassigned') {\n payload.pipelineStageId = source.pipelineStageId\n }\n if (typeof source.valueAmount === 'number') payload.valueAmount = source.valueAmount\n if (source.valueCurrency) payload.valueCurrency = source.valueCurrency\n if (typeof source.probability === 'number') payload.probability = source.probability\n if (source.expectedCloseAt) payload.expectedCloseAt = source.expectedCloseAt\n if (source.ownerUserId) payload.ownerUserId = source.ownerUserId\n return payload\n}\n"],
5
+ "mappings": "AAAO,SAAS,yBAAyB,OAAe,aAAgD;AACtG,QAAM,YAAY,YAAY,KAAK;AACnC,QAAM,SAAS,UAAU,SAAS;AAClC,MAAI,UAAU,EAAG,QAAO;AACxB,MAAI,YAAY,MAAM,MAAM,GAAG,KAAK,IAAI,GAAG,MAAM,SAAS,MAAM,CAAC,EAAE,QAAQ;AAC3E,MAAI,mBAAmB,KAAK,SAAS,EAAG,aAAY,UAAU,MAAM,GAAG,EAAE;AACzE,SAAO,YAAY,SAAS;AAC9B;AAoBO,SAAS,0BACd,QACA,OACyB;AACzB,QAAM,UAAmC,EAAE,OAAO,QAAQ,OAAO;AACjE,MAAI,OAAO,WAAY,SAAQ,aAAa,OAAO;AACnD,MAAI,OAAO,mBAAmB,OAAO,oBAAoB,gBAAgB;AACvE,YAAQ,kBAAkB,OAAO;AAAA,EACnC;AACA,MAAI,OAAO,OAAO,gBAAgB,SAAU,SAAQ,cAAc,OAAO;AACzE,MAAI,OAAO,cAAe,SAAQ,gBAAgB,OAAO;AACzD,MAAI,OAAO,OAAO,gBAAgB,SAAU,SAAQ,cAAc,OAAO;AACzE,MAAI,OAAO,gBAAiB,SAAQ,kBAAkB,OAAO;AAC7D,MAAI,OAAO,YAAa,SAAQ,cAAc,OAAO;AACrD,SAAO;AACT;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/core",
3
- "version": "0.10.1-develop.7894.1.2c464c73e3",
3
+ "version": "0.10.1-develop.7900.1.69c0120c72",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -266,16 +266,16 @@
266
266
  "zod": "^4.6.6"
267
267
  },
268
268
  "peerDependencies": {
269
- "@open-mercato/ai-assistant": "0.10.1-develop.7894.1.2c464c73e3",
270
- "@open-mercato/shared": "0.10.1-develop.7894.1.2c464c73e3",
271
- "@open-mercato/ui": "0.10.1-develop.7894.1.2c464c73e3",
269
+ "@open-mercato/ai-assistant": "0.10.1-develop.7900.1.69c0120c72",
270
+ "@open-mercato/shared": "0.10.1-develop.7900.1.69c0120c72",
271
+ "@open-mercato/ui": "0.10.1-develop.7900.1.69c0120c72",
272
272
  "react": "^19.0.0",
273
273
  "react-dom": "^19.0.0"
274
274
  },
275
275
  "devDependencies": {
276
- "@open-mercato/ai-assistant": "0.10.1-develop.7894.1.2c464c73e3",
277
- "@open-mercato/shared": "0.10.1-develop.7894.1.2c464c73e3",
278
- "@open-mercato/ui": "0.10.1-develop.7894.1.2c464c73e3",
276
+ "@open-mercato/ai-assistant": "0.10.1-develop.7900.1.69c0120c72",
277
+ "@open-mercato/shared": "0.10.1-develop.7900.1.69c0120c72",
278
+ "@open-mercato/ui": "0.10.1-develop.7900.1.69c0120c72",
279
279
  "@testing-library/dom": "^10.4.1",
280
280
  "@testing-library/jest-dom": "^7.0.1",
281
281
  "@testing-library/react": "^16.3.3",
@@ -37,7 +37,7 @@
37
37
  "business_rules.components.actionRow.config.endpoint.placeholder": "Seleccione endpoint",
38
38
  "business_rules.components.actionRow.config.field.placeholder": "Ingrese {{field}}",
39
39
  "business_rules.components.actionRow.config.level": "nivel",
40
- "business_rules.components.actionRow.config.level.debug": "Debug",
40
+ "business_rules.components.actionRow.config.level.debug": "Depuración",
41
41
  "business_rules.components.actionRow.config.level.error": "Error",
42
42
  "business_rules.components.actionRow.config.level.info": "Info",
43
43
  "business_rules.components.actionRow.config.level.warn": "Advertencia",
@@ -76,7 +76,7 @@ import { UserCircle2 } from 'lucide-react'
76
76
  import { ReassignOwnerDialog } from './components/ReassignOwnerDialog'
77
77
  import type { BulkActionExecuteResult } from '@open-mercato/ui/backend/DataTable'
78
78
  import { requestBulkOwnerReassignment, buildReassignOwnerSuccess } from '../../../lib/reassignDealOwner'
79
- import { buildDealDuplicatePayload } from '../../../lib/duplicateDeal'
79
+ import { buildDealDuplicatePayload, formatDealDuplicateTitle } from '../../../lib/duplicateDeal'
80
80
 
81
81
  const logger = createLogger('customers')
82
82
 
@@ -563,7 +563,9 @@ export default function CustomersDealsPage() {
563
563
  if (pendingDuplicateId) return
564
564
  const payload = buildDealDuplicatePayload(
565
565
  row,
566
- t('customers.deals.list.duplicateTitle', '{title} (copy)', { title: row.title }),
566
+ formatDealDuplicateTitle(row.title, (title) =>
567
+ t('customers.deals.list.duplicateTitle', '{title} (copy)', { title }),
568
+ ),
567
569
  )
568
570
  setPendingDuplicateId(row.id)
569
571
  try {
@@ -58,7 +58,7 @@ import type { FilterOptionTone } from '@open-mercato/shared/lib/query/advanced-f
58
58
  import { ViewTabsRow, VIEW_TABS_ROW_COMPONENT_ID, type ViewTabsRowProps } from './components/ViewTabsRow'
59
59
  import { LANE_WIDTH_CLASS } from './components/constants'
60
60
  import { useCurrencyDictionary } from '../../../../components/detail/hooks/useCurrencyDictionary'
61
- import { buildDealDuplicatePayload } from '../../../../lib/duplicateDeal'
61
+ import { buildDealDuplicatePayload, formatDealDuplicateTitle } from '../../../../lib/duplicateDeal'
62
62
  import { FilterBarRow, type KanbanFilterChip } from './components/FilterBarRow'
63
63
  import { Lane, type LaneStage } from './components/Lane'
64
64
  import { LaneCurrencyBreakdown } from './components/LaneCurrencyBreakdown'
@@ -2270,11 +2270,13 @@ export default function DealsKanbanPage(): React.ReactElement {
2270
2270
  expectedCloseAt: deal.expectedCloseAt,
2271
2271
  ownerUserId: deal.owner?.userId,
2272
2272
  },
2273
- translateWithFallback(
2274
- t,
2275
- 'customers.deals.kanban.menu.duplicate.titleSuffix',
2276
- '{title} (copy)',
2277
- { title: deal.title },
2273
+ formatDealDuplicateTitle(deal.title, (title) =>
2274
+ translateWithFallback(
2275
+ t,
2276
+ 'customers.deals.kanban.menu.duplicate.titleSuffix',
2277
+ '{title} (copy)',
2278
+ { title },
2279
+ ),
2278
2280
  ),
2279
2281
  )
2280
2282
 
@@ -2833,6 +2833,12 @@
2833
2833
  "customers.schedule.dueDate": "Fälligkeitsdatum",
2834
2834
  "customers.schedule.dueTime": "Due time",
2835
2835
  "customers.schedule.duration": "Duration",
2836
+ "customers.schedule.duration.option.15min": "15 Min.",
2837
+ "customers.schedule.duration.option.1h30m": "1 Std. 30 Min.",
2838
+ "customers.schedule.duration.option.1hour": "1 Stunde",
2839
+ "customers.schedule.duration.option.2hours": "2 Stunden",
2840
+ "customers.schedule.duration.option.30min": "30 Min.",
2841
+ "customers.schedule.duration.option.45min": "45 Min.",
2836
2842
  "customers.schedule.editTitle": "Aktivität bearbeiten",
2837
2843
  "customers.schedule.email.save": "E-Mail senden",
2838
2844
  "customers.schedule.email.subtitle": "Verfassen und senden Sie eine getrackte E-Mail",
@@ -2833,6 +2833,12 @@
2833
2833
  "customers.schedule.dueDate": "Due date",
2834
2834
  "customers.schedule.dueTime": "Due time",
2835
2835
  "customers.schedule.duration": "Duration",
2836
+ "customers.schedule.duration.option.15min": "15 min",
2837
+ "customers.schedule.duration.option.1h30m": "1h 30m",
2838
+ "customers.schedule.duration.option.1hour": "1 hour",
2839
+ "customers.schedule.duration.option.2hours": "2 hours",
2840
+ "customers.schedule.duration.option.30min": "30 min",
2841
+ "customers.schedule.duration.option.45min": "45 min",
2836
2842
  "customers.schedule.editTitle": "Edit activity",
2837
2843
  "customers.schedule.email.save": "Send email",
2838
2844
  "customers.schedule.email.subtitle": "Compose and send a tracked email",
@@ -2833,6 +2833,12 @@
2833
2833
  "customers.schedule.dueDate": "Fecha límite",
2834
2834
  "customers.schedule.dueTime": "Due time",
2835
2835
  "customers.schedule.duration": "Duration",
2836
+ "customers.schedule.duration.option.15min": "15 min",
2837
+ "customers.schedule.duration.option.1h30m": "1 h 30 min",
2838
+ "customers.schedule.duration.option.1hour": "1 hora",
2839
+ "customers.schedule.duration.option.2hours": "2 horas",
2840
+ "customers.schedule.duration.option.30min": "30 min",
2841
+ "customers.schedule.duration.option.45min": "45 min",
2836
2842
  "customers.schedule.editTitle": "Editar actividad",
2837
2843
  "customers.schedule.email.save": "Enviar correo",
2838
2844
  "customers.schedule.email.subtitle": "Redacta y envía un correo con seguimiento",
@@ -2833,6 +2833,12 @@
2833
2833
  "customers.schedule.dueDate": "기한 날짜",
2834
2834
  "customers.schedule.dueTime": "기한 시간",
2835
2835
  "customers.schedule.duration": "소요 시간",
2836
+ "customers.schedule.duration.option.15min": "15분",
2837
+ "customers.schedule.duration.option.1h30m": "1시간 30분",
2838
+ "customers.schedule.duration.option.1hour": "1시간",
2839
+ "customers.schedule.duration.option.2hours": "2시간",
2840
+ "customers.schedule.duration.option.30min": "30분",
2841
+ "customers.schedule.duration.option.45min": "45분",
2836
2842
  "customers.schedule.editTitle": "활동 편집",
2837
2843
  "customers.schedule.email.save": "이메일 보내기",
2838
2844
  "customers.schedule.email.subtitle": "추적 가능한 이메일을 작성하여 보내세요",
@@ -2833,6 +2833,12 @@
2833
2833
  "customers.schedule.dueDate": "Termin",
2834
2834
  "customers.schedule.dueTime": "Godzina",
2835
2835
  "customers.schedule.duration": "Czas trwania",
2836
+ "customers.schedule.duration.option.15min": "15 min",
2837
+ "customers.schedule.duration.option.1h30m": "1 godz. 30 min",
2838
+ "customers.schedule.duration.option.1hour": "1 godzina",
2839
+ "customers.schedule.duration.option.2hours": "2 godziny",
2840
+ "customers.schedule.duration.option.30min": "30 min",
2841
+ "customers.schedule.duration.option.45min": "45 min",
2836
2842
  "customers.schedule.editTitle": "Edytuj aktywność",
2837
2843
  "customers.schedule.email.save": "Wyślij e-mail",
2838
2844
  "customers.schedule.email.subtitle": "Napisz i wyślij śledzony e-mail",
@@ -1,3 +1,12 @@
1
+ export function formatDealDuplicateTitle(title: string, formatTitle: (title: string) => string): string {
2
+ const formatted = formatTitle(title)
3
+ const excess = formatted.length - 200
4
+ if (excess <= 0) return formatted
5
+ let shortened = title.slice(0, Math.max(0, title.length - excess)).trimEnd()
6
+ if (/[\uD800-\uDBFF]$/.test(shortened)) shortened = shortened.slice(0, -1)
7
+ return formatTitle(shortened)
8
+ }
9
+
1
10
  export type DealDuplicateSource = {
2
11
  pipelineId?: string | null
3
12
  pipelineStageId?: string | null