@open-mercato/core 0.6.1-develop.3291.1.6fad645fd0 → 0.6.1-develop.3306.1.9ad9ff2526

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 (122) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/AGENTS.md +14 -0
  3. package/dist/modules/auth/backend/roles/[id]/edit/page.js +2 -1
  4. package/dist/modules/auth/backend/roles/[id]/edit/page.js.map +2 -2
  5. package/dist/modules/auth/backend/users/[id]/edit/page.js +2 -5
  6. package/dist/modules/auth/backend/users/[id]/edit/page.js.map +2 -2
  7. package/dist/modules/catalog/ai-agents.js +47 -5
  8. package/dist/modules/catalog/ai-agents.js.map +2 -2
  9. package/dist/modules/catalog/backend/catalog/categories/[id]/edit/page.js +2 -5
  10. package/dist/modules/catalog/backend/catalog/categories/[id]/edit/page.js.map +2 -2
  11. package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js +4 -3
  12. package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js.map +2 -2
  13. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +2 -9
  14. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
  15. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +2 -9
  16. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
  17. package/dist/modules/customers/ai-agents.js +174 -1
  18. package/dist/modules/customers/ai-agents.js.map +2 -2
  19. package/dist/modules/customers/ai-tools/deal-analyzer-pack.js +196 -0
  20. package/dist/modules/customers/ai-tools/deal-analyzer-pack.js.map +7 -0
  21. package/dist/modules/customers/ai-tools.js +3 -1
  22. package/dist/modules/customers/ai-tools.js.map +2 -2
  23. package/dist/modules/customers/backend/customers/companies/page.js +11 -1
  24. package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
  25. package/dist/modules/customers/backend/customers/deals/page.js +11 -1
  26. package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
  27. package/dist/modules/customers/backend/customers/people/page.js +11 -1
  28. package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
  29. package/dist/modules/customers/commands/companies.js +37 -15
  30. package/dist/modules/customers/commands/companies.js.map +2 -2
  31. package/dist/modules/customers/components/detail/AiActionChips.js +2 -2
  32. package/dist/modules/customers/components/detail/AiActionChips.js.map +2 -2
  33. package/dist/modules/customers/components/detail/ChangelogTab.js +3 -9
  34. package/dist/modules/customers/components/detail/ChangelogTab.js.map +2 -2
  35. package/dist/modules/customers/components/detail/changelogValues.js +35 -0
  36. package/dist/modules/customers/components/detail/changelogValues.js.map +7 -0
  37. package/dist/modules/customers/components/detail/customFieldUtils.js +1 -1
  38. package/dist/modules/customers/components/detail/customFieldUtils.js.map +1 -1
  39. package/dist/modules/customers/components/formConfig.js +3 -2
  40. package/dist/modules/customers/components/formConfig.js.map +2 -2
  41. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js +4 -9
  42. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js.map +2 -2
  43. package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.js +302 -0
  44. package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.js.map +7 -0
  45. package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.js +17 -0
  46. package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.js.map +7 -0
  47. package/dist/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.js +2 -2
  48. package/dist/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.js.map +2 -2
  49. package/dist/modules/customers/widgets/injection-table.js +2 -2
  50. package/dist/modules/customers/widgets/injection-table.js.map +2 -2
  51. package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js +2 -5
  52. package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js.map +2 -2
  53. package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.js +2 -5
  54. package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.js.map +2 -2
  55. package/dist/modules/resources/backend/resources/resources/[id]/page.js +2 -5
  56. package/dist/modules/resources/backend/resources/resources/[id]/page.js.map +2 -2
  57. package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js +2 -25
  58. package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js.map +2 -2
  59. package/dist/modules/sales/components/channels/ChannelOfferForm.js +2 -43
  60. package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
  61. package/dist/modules/sales/components/documents/LineItemDialog.js +162 -42
  62. package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
  63. package/dist/modules/sales/components/documents/customFieldHelpers.js +4 -31
  64. package/dist/modules/sales/components/documents/customFieldHelpers.js.map +2 -2
  65. package/package.json +15 -6
  66. package/src/modules/auth/backend/roles/[id]/edit/page.tsx +2 -1
  67. package/src/modules/auth/backend/users/[id]/edit/page.tsx +2 -5
  68. package/src/modules/business_rules/migrations/.snapshot-open-mercato.json +746 -394
  69. package/src/modules/catalog/ai-agents.ts +62 -4
  70. package/src/modules/catalog/backend/catalog/categories/[id]/edit/page.tsx +2 -5
  71. package/src/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.tsx +4 -3
  72. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +2 -12
  73. package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +2 -10
  74. package/src/modules/catalog/migrations/.snapshot-open-mercato.json +2519 -1307
  75. package/src/modules/customer_accounts/migrations/.snapshot-open-mercato.json +828 -834
  76. package/src/modules/customers/AGENTS.md +6 -1
  77. package/src/modules/customers/ai-agents.ts +213 -6
  78. package/src/modules/customers/ai-tools/deal-analyzer-pack.ts +286 -0
  79. package/src/modules/customers/ai-tools.ts +2 -0
  80. package/src/modules/customers/backend/customers/companies/page.tsx +10 -0
  81. package/src/modules/customers/backend/customers/deals/page.tsx +10 -0
  82. package/src/modules/customers/backend/customers/people/page.tsx +10 -0
  83. package/src/modules/customers/commands/companies.ts +38 -14
  84. package/src/modules/customers/components/detail/AiActionChips.tsx +2 -2
  85. package/src/modules/customers/components/detail/ChangelogTab.tsx +3 -10
  86. package/src/modules/customers/components/detail/changelogValues.ts +42 -0
  87. package/src/modules/customers/components/detail/customFieldUtils.ts +1 -1
  88. package/src/modules/customers/components/formConfig.tsx +3 -2
  89. package/src/modules/customers/i18n/de.json +7 -0
  90. package/src/modules/customers/i18n/en.json +7 -0
  91. package/src/modules/customers/i18n/es.json +7 -0
  92. package/src/modules/customers/i18n/pl.json +7 -0
  93. package/src/modules/customers/migrations/.snapshot-open-mercato.json +2313 -2336
  94. package/src/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.tsx +4 -6
  95. package/src/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.tsx +358 -0
  96. package/src/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.ts +34 -0
  97. package/src/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.tsx +2 -2
  98. package/src/modules/customers/widgets/injection-table.ts +12 -9
  99. package/src/modules/data_sync/migrations/.snapshot-open-mercato.json +554 -210
  100. package/src/modules/dictionaries/migrations/.snapshot-open-mercato.json +146 -146
  101. package/src/modules/directory/backend/directory/organizations/[id]/edit/page.tsx +2 -5
  102. package/src/modules/directory/backend/directory/tenants/[id]/edit/page.tsx +2 -5
  103. package/src/modules/directory/migrations/.snapshot-open-mercato.json +273 -140
  104. package/src/modules/feature_toggles/migrations/.snapshot-open-mercato.json +242 -137
  105. package/src/modules/integrations/migrations/.snapshot-open-mercato.json +498 -195
  106. package/src/modules/payment_gateways/migrations/.snapshot-open-mercato.json +158 -157
  107. package/src/modules/perspectives/migrations/.snapshot-open-mercato.json +274 -129
  108. package/src/modules/planner/migrations/.snapshot-open-mercato.json +327 -157
  109. package/src/modules/progress/AGENTS.md +72 -0
  110. package/src/modules/resources/backend/resources/resources/[id]/page.tsx +2 -5
  111. package/src/modules/resources/migrations/.snapshot-open-mercato.json +920 -470
  112. package/src/modules/sales/backend/sales/channels/[channelId]/edit/page.tsx +2 -27
  113. package/src/modules/sales/components/channels/ChannelOfferForm.tsx +2 -49
  114. package/src/modules/sales/components/documents/LineItemDialog.tsx +214 -78
  115. package/src/modules/sales/components/documents/customFieldHelpers.ts +4 -43
  116. package/src/modules/sales/i18n/de.json +3 -0
  117. package/src/modules/sales/i18n/en.json +3 -0
  118. package/src/modules/sales/i18n/es.json +3 -0
  119. package/src/modules/sales/i18n/pl.json +3 -0
  120. package/src/modules/sales/migrations/.snapshot-open-mercato.json +4740 -4778
  121. package/src/modules/shipping_carriers/migrations/.snapshot-open-mercato.json +340 -81
  122. package/src/modules/staff/migrations/.snapshot-open-mercato.json +1439 -729
@@ -1,4 +1,5 @@
1
1
  import { normalizeCustomFieldResponse } from "@open-mercato/shared/lib/custom-fields/normalize";
2
+ import { extractCustomFieldEntries } from "@open-mercato/shared/lib/crud/custom-fields-client";
2
3
  const normalizeCustomFieldSubmitValue = (value) => {
3
4
  if (Array.isArray(value)) return value.filter((entry) => entry !== void 0);
4
5
  if (value === void 0) return null;
@@ -17,37 +18,9 @@ const prefixCustomFieldValues = (input) => {
17
18
  };
18
19
  const extractCustomFieldValues = (source) => {
19
20
  if (!source || typeof source !== "object") return {};
20
- const merged = {};
21
- const assign = (key, value) => {
22
- if (typeof key !== "string") return;
23
- const trimmed = key.trim();
24
- if (!trimmed.length) return;
25
- const normalizedKey = trimmed.startsWith("cf_") ? trimmed : trimmed.startsWith("cf:") ? `cf_${trimmed.slice(3)}` : `cf_${trimmed}`;
26
- if (normalizedKey.endsWith("__is_multi")) return;
27
- merged[normalizedKey] = value;
28
- };
29
- Object.entries(source).forEach(([key, value]) => {
30
- if (key.startsWith("cf_") || key.startsWith("cf:")) {
31
- assign(key, value);
32
- }
33
- });
34
- const customValues = source.customValues ?? source.custom_values;
35
- if (customValues && typeof customValues === "object" && !Array.isArray(customValues)) {
36
- Object.entries(customValues).forEach(([key, value]) => assign(key, value));
37
- }
38
- const customFields = source.customFields ?? source.custom_fields;
39
- if (Array.isArray(customFields)) {
40
- ;
41
- customFields.forEach((entry) => {
42
- const key = typeof entry?.key === "string" ? entry.key : typeof entry?.id === "string" ? entry.id : null;
43
- if (!key) return;
44
- assign(key, entry?.value);
45
- });
46
- } else if (customFields && typeof customFields === "object") {
47
- Object.entries(customFields).forEach(([key, value]) => assign(key, value));
48
- }
49
- const normalized = normalizeCustomFieldResponse(merged);
50
- return normalized ? prefixCustomFieldValues(normalized) : prefixCustomFieldValues(merged);
21
+ const extracted = extractCustomFieldEntries(source);
22
+ const normalized = normalizeCustomFieldResponse(extracted);
23
+ return normalized ? prefixCustomFieldValues(normalized) : prefixCustomFieldValues(extracted);
51
24
  };
52
25
  export {
53
26
  extractCustomFieldValues,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/modules/sales/components/documents/customFieldHelpers.ts"],
4
- "sourcesContent": ["import { normalizeCustomFieldResponse } from '@open-mercato/shared/lib/custom-fields/normalize'\n\nexport const normalizeCustomFieldSubmitValue = (value: unknown): unknown => {\n if (Array.isArray(value)) return value.filter((entry) => entry !== undefined)\n if (value === undefined) return null\n return value\n}\n\nexport const prefixCustomFieldValues = (input?: Record<string, unknown> | null): Record<string, unknown> => {\n if (!input || typeof input !== 'object') return {}\n return Object.entries(input).reduce<Record<string, unknown>>((acc, [key, value]) => {\n const trimmedKey = key.trim()\n if (!trimmedKey.length) return acc\n const normalizedKey = trimmedKey.startsWith('cf_')\n ? trimmedKey\n : trimmedKey.startsWith('cf:')\n ? `cf_${trimmedKey.slice(3)}`\n : `cf_${trimmedKey}`\n if (normalizedKey.endsWith('__is_multi')) return acc\n acc[normalizedKey] = value\n return acc\n }, {})\n}\n\nexport const extractCustomFieldValues = (source?: Record<string, unknown> | null): Record<string, unknown> => {\n if (!source || typeof source !== 'object') return {}\n const merged: Record<string, unknown> = {}\n const assign = (key: unknown, value: unknown) => {\n if (typeof key !== 'string') return\n const trimmed = key.trim()\n if (!trimmed.length) return\n const normalizedKey = trimmed.startsWith('cf_')\n ? trimmed\n : trimmed.startsWith('cf:')\n ? `cf_${trimmed.slice(3)}`\n : `cf_${trimmed}`\n if (normalizedKey.endsWith('__is_multi')) return\n merged[normalizedKey] = value\n }\n\n Object.entries(source).forEach(([key, value]) => {\n if (key.startsWith('cf_') || key.startsWith('cf:')) {\n assign(key, value)\n }\n })\n\n const customValues = (source as any).customValues ?? (source as any).custom_values\n if (customValues && typeof customValues === 'object' && !Array.isArray(customValues)) {\n Object.entries(customValues as Record<string, unknown>).forEach(([key, value]) => assign(key, value))\n }\n\n const customFields = (source as any).customFields ?? (source as any).custom_fields\n if (Array.isArray(customFields)) {\n ;(customFields as Array<Record<string, unknown>>).forEach((entry) => {\n const key =\n typeof entry?.key === 'string'\n ? entry.key\n : typeof (entry as any)?.id === 'string'\n ? (entry as any).id\n : null\n if (!key) return\n assign(key, (entry as any)?.value)\n })\n } else if (customFields && typeof customFields === 'object') {\n Object.entries(customFields as Record<string, unknown>).forEach(([key, value]) => assign(key, value))\n }\n\n const normalized = normalizeCustomFieldResponse(merged)\n return normalized ? prefixCustomFieldValues(normalized) : prefixCustomFieldValues(merged)\n}\n"],
5
- "mappings": "AAAA,SAAS,oCAAoC;AAEtC,MAAM,kCAAkC,CAAC,UAA4B;AAC1E,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,OAAO,CAAC,UAAU,UAAU,MAAS;AAC5E,MAAI,UAAU,OAAW,QAAO;AAChC,SAAO;AACT;AAEO,MAAM,0BAA0B,CAAC,UAAoE;AAC1G,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO,CAAC;AACjD,SAAO,OAAO,QAAQ,KAAK,EAAE,OAAgC,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM;AAClF,UAAM,aAAa,IAAI,KAAK;AAC5B,QAAI,CAAC,WAAW,OAAQ,QAAO;AAC/B,UAAM,gBAAgB,WAAW,WAAW,KAAK,IAC7C,aACA,WAAW,WAAW,KAAK,IACzB,MAAM,WAAW,MAAM,CAAC,CAAC,KACzB,MAAM,UAAU;AACtB,QAAI,cAAc,SAAS,YAAY,EAAG,QAAO;AACjD,QAAI,aAAa,IAAI;AACrB,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACP;AAEO,MAAM,2BAA2B,CAAC,WAAqE;AAC5G,MAAI,CAAC,UAAU,OAAO,WAAW,SAAU,QAAO,CAAC;AACnD,QAAM,SAAkC,CAAC;AACzC,QAAM,SAAS,CAAC,KAAc,UAAmB;AAC/C,QAAI,OAAO,QAAQ,SAAU;AAC7B,UAAM,UAAU,IAAI,KAAK;AACzB,QAAI,CAAC,QAAQ,OAAQ;AACrB,UAAM,gBAAgB,QAAQ,WAAW,KAAK,IAC1C,UACA,QAAQ,WAAW,KAAK,IACtB,MAAM,QAAQ,MAAM,CAAC,CAAC,KACtB,MAAM,OAAO;AACnB,QAAI,cAAc,SAAS,YAAY,EAAG;AAC1C,WAAO,aAAa,IAAI;AAAA,EAC1B;AAEA,SAAO,QAAQ,MAAM,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC/C,QAAI,IAAI,WAAW,KAAK,KAAK,IAAI,WAAW,KAAK,GAAG;AAClD,aAAO,KAAK,KAAK;AAAA,IACnB;AAAA,EACF,CAAC;AAED,QAAM,eAAgB,OAAe,gBAAiB,OAAe;AACrE,MAAI,gBAAgB,OAAO,iBAAiB,YAAY,CAAC,MAAM,QAAQ,YAAY,GAAG;AACpF,WAAO,QAAQ,YAAuC,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM,OAAO,KAAK,KAAK,CAAC;AAAA,EACtG;AAEA,QAAM,eAAgB,OAAe,gBAAiB,OAAe;AACrE,MAAI,MAAM,QAAQ,YAAY,GAAG;AAC/B;AAAC,IAAC,aAAgD,QAAQ,CAAC,UAAU;AACnE,YAAM,MACJ,OAAO,OAAO,QAAQ,WAClB,MAAM,MACN,OAAQ,OAAe,OAAO,WAC3B,MAAc,KACf;AACR,UAAI,CAAC,IAAK;AACV,aAAO,KAAM,OAAe,KAAK;AAAA,IACnC,CAAC;AAAA,EACH,WAAW,gBAAgB,OAAO,iBAAiB,UAAU;AAC3D,WAAO,QAAQ,YAAuC,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM,OAAO,KAAK,KAAK,CAAC;AAAA,EACtG;AAEA,QAAM,aAAa,6BAA6B,MAAM;AACtD,SAAO,aAAa,wBAAwB,UAAU,IAAI,wBAAwB,MAAM;AAC1F;",
4
+ "sourcesContent": ["import { normalizeCustomFieldResponse } from '@open-mercato/shared/lib/custom-fields/normalize'\nimport { extractCustomFieldEntries } from '@open-mercato/shared/lib/crud/custom-fields-client'\n\nexport const normalizeCustomFieldSubmitValue = (value: unknown): unknown => {\n if (Array.isArray(value)) return value.filter((entry) => entry !== undefined)\n if (value === undefined) return null\n return value\n}\n\nexport const prefixCustomFieldValues = (input?: Record<string, unknown> | null): Record<string, unknown> => {\n if (!input || typeof input !== 'object') return {}\n return Object.entries(input).reduce<Record<string, unknown>>((acc, [key, value]) => {\n const trimmedKey = key.trim()\n if (!trimmedKey.length) return acc\n const normalizedKey = trimmedKey.startsWith('cf_')\n ? trimmedKey\n : trimmedKey.startsWith('cf:')\n ? `cf_${trimmedKey.slice(3)}`\n : `cf_${trimmedKey}`\n if (normalizedKey.endsWith('__is_multi')) return acc\n acc[normalizedKey] = value\n return acc\n }, {})\n}\n\nexport const extractCustomFieldValues = (source?: Record<string, unknown> | null): Record<string, unknown> => {\n if (!source || typeof source !== 'object') return {}\n const extracted = extractCustomFieldEntries(source)\n const normalized = normalizeCustomFieldResponse(extracted)\n return normalized ? prefixCustomFieldValues(normalized) : prefixCustomFieldValues(extracted)\n}\n"],
5
+ "mappings": "AAAA,SAAS,oCAAoC;AAC7C,SAAS,iCAAiC;AAEnC,MAAM,kCAAkC,CAAC,UAA4B;AAC1E,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,OAAO,CAAC,UAAU,UAAU,MAAS;AAC5E,MAAI,UAAU,OAAW,QAAO;AAChC,SAAO;AACT;AAEO,MAAM,0BAA0B,CAAC,UAAoE;AAC1G,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO,CAAC;AACjD,SAAO,OAAO,QAAQ,KAAK,EAAE,OAAgC,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM;AAClF,UAAM,aAAa,IAAI,KAAK;AAC5B,QAAI,CAAC,WAAW,OAAQ,QAAO;AAC/B,UAAM,gBAAgB,WAAW,WAAW,KAAK,IAC7C,aACA,WAAW,WAAW,KAAK,IACzB,MAAM,WAAW,MAAM,CAAC,CAAC,KACzB,MAAM,UAAU;AACtB,QAAI,cAAc,SAAS,YAAY,EAAG,QAAO;AACjD,QAAI,aAAa,IAAI;AACrB,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACP;AAEO,MAAM,2BAA2B,CAAC,WAAqE;AAC5G,MAAI,CAAC,UAAU,OAAO,WAAW,SAAU,QAAO,CAAC;AACnD,QAAM,YAAY,0BAA0B,MAAM;AAClD,QAAM,aAAa,6BAA6B,SAAS;AACzD,SAAO,aAAa,wBAAwB,UAAU,IAAI,wBAAwB,SAAS;AAC7F;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/core",
3
- "version": "0.6.1-develop.3291.1.6fad645fd0",
3
+ "version": "0.6.1-develop.3306.1.9ad9ff2526",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -234,25 +234,34 @@
234
234
  "mammoth": "^1.9.0",
235
235
  "pdfjs-dist": "^5.7.284",
236
236
  "semver": "^7.8.0",
237
- "ts-pattern": "^5.0.0"
237
+ "ts-pattern": "^5.0.0",
238
+ "zod": "^4.3.6"
238
239
  },
239
240
  "peerDependencies": {
240
- "@open-mercato/ai-assistant": "0.6.1-develop.3291.1.6fad645fd0",
241
- "@open-mercato/shared": "0.6.1-develop.3291.1.6fad645fd0"
241
+ "@open-mercato/ai-assistant": "0.6.1-develop.3306.1.9ad9ff2526",
242
+ "@open-mercato/shared": "0.6.1-develop.3306.1.9ad9ff2526",
243
+ "@open-mercato/ui": "0.6.1-develop.3306.1.9ad9ff2526",
244
+ "react": "^19.0.0",
245
+ "react-dom": "^19.0.0"
242
246
  },
243
247
  "devDependencies": {
244
- "@open-mercato/ai-assistant": "0.6.1-develop.3291.1.6fad645fd0",
245
- "@open-mercato/shared": "0.6.1-develop.3291.1.6fad645fd0",
248
+ "@open-mercato/ai-assistant": "0.6.1-develop.3306.1.9ad9ff2526",
249
+ "@open-mercato/shared": "0.6.1-develop.3306.1.9ad9ff2526",
250
+ "@open-mercato/ui": "0.6.1-develop.3306.1.9ad9ff2526",
246
251
  "@testing-library/dom": "^10.4.1",
247
252
  "@testing-library/jest-dom": "^6.9.1",
248
253
  "@testing-library/react": "^16.3.1",
249
254
  "@types/chance": "^1.1.8",
250
255
  "@types/html-to-text": "^9.0.4",
251
256
  "@types/jest": "^30.0.0",
257
+ "@types/react": "^19.2.14",
258
+ "@types/react-dom": "^19.2.3",
252
259
  "@types/semver": "^7.5.8",
253
260
  "chance": "^1.1.13",
254
261
  "jest": "^30.4.2",
255
262
  "jest-environment-jsdom": "^30.4.1",
263
+ "react": "19.2.6",
264
+ "react-dom": "19.2.6",
256
265
  "ts-jest": "^29.4.9"
257
266
  },
258
267
  "publishConfig": {
@@ -10,6 +10,7 @@ import { WidgetVisibilityEditor, type WidgetVisibilityEditorHandle } from '@open
10
10
  import { E } from '#generated/entities.ids.generated'
11
11
  import { TenantSelect } from '@open-mercato/core/modules/directory/components/TenantSelect'
12
12
  import { useT } from '@open-mercato/shared/lib/i18n/context'
13
+ import { extractCustomFieldEntries } from '@open-mercato/shared/lib/crud/custom-fields-client'
13
14
 
14
15
  type EditRoleFormValues = {
15
16
  name?: string
@@ -51,7 +52,7 @@ export default function EditRolePage({ params }: { params?: { id?: string } }) {
51
52
  const found = (foundList?.[0] ?? null) as RoleRecord | null
52
53
  if (!cancelled) {
53
54
  setActorIsSuperAdmin(Boolean(result?.isSuperAdmin))
54
- setInitial(found || null)
55
+ setInitial(found ? { ...found, ...extractCustomFieldEntries(found) } : null)
55
56
  const tenant = found && typeof found.tenantId === 'string' ? found.tenantId : null
56
57
  setSelectedTenantId(tenant)
57
58
  }
@@ -14,6 +14,7 @@ import { WidgetVisibilityEditor, type WidgetVisibilityEditorHandle } from '@open
14
14
  import { Button } from '@open-mercato/ui/primitives/button'
15
15
  import { flash } from '@open-mercato/ui/backend/FlashMessages'
16
16
  import { useT } from '@open-mercato/shared/lib/i18n/context'
17
+ import { extractCustomFieldEntries } from '@open-mercato/shared/lib/crud/custom-fields-client'
17
18
  import { formatPasswordRequirements, getPasswordPolicy } from '@open-mercato/shared/lib/auth/passwordPolicy'
18
19
  import { UserConsentsPanel } from '@open-mercato/core/modules/auth/components/UserConsentsPanel'
19
20
 
@@ -206,11 +207,7 @@ export default function EditUserPage({ params }: { params?: { id?: string } }) {
206
207
  hasPassword: item.hasPassword !== false,
207
208
  })
208
209
  setSelectedTenantId(item.tenantId ? String(item.tenantId) : null)
209
- const custom: Record<string, unknown> = {}
210
- for (const [key, value] of Object.entries(item)) {
211
- if (key.startsWith('cf_')) custom[key] = value as unknown
212
- else if (key.startsWith('cf:')) custom[`cf_${key.slice(3)}`] = value as unknown
213
- }
210
+ const custom = extractCustomFieldEntries(item as Record<string, unknown>)
214
211
  setCustomFieldValues(custom)
215
212
  }
216
213
  }