@open-mercato/core 0.5.1-develop.2860.07af3a6a9d → 0.5.1-develop.2874.77704bccbd

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 (349) hide show
  1. package/dist/modules/api_docs/frontend/docs/api/Explorer.js +18 -18
  2. package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
  3. package/dist/modules/api_keys/backend/api-keys/create/page.js +1 -1
  4. package/dist/modules/api_keys/backend/api-keys/create/page.js.map +1 -1
  5. package/dist/modules/attachments/components/AttachmentLibrary.js +2 -2
  6. package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
  7. package/dist/modules/attachments/components/AttachmentPartitionSettings.js +1 -1
  8. package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +1 -1
  9. package/dist/modules/attachments/fields/attachment.js +1 -1
  10. package/dist/modules/attachments/fields/attachment.js.map +1 -1
  11. package/dist/modules/audit_logs/components/ActionLogDetailsDialog.js +1 -1
  12. package/dist/modules/audit_logs/components/ActionLogDetailsDialog.js.map +2 -2
  13. package/dist/modules/audit_logs/lib/display-helpers.js +1 -1
  14. package/dist/modules/audit_logs/lib/display-helpers.js.map +1 -1
  15. package/dist/modules/auth/backend/users/create/page.js +1 -1
  16. package/dist/modules/auth/backend/users/create/page.js.map +1 -1
  17. package/dist/modules/business_rules/backend/rules/page.js +6 -6
  18. package/dist/modules/business_rules/backend/rules/page.js.map +2 -2
  19. package/dist/modules/business_rules/backend/sets/page.js +2 -2
  20. package/dist/modules/business_rules/backend/sets/page.js.map +2 -2
  21. package/dist/modules/business_rules/components/ActionBuilder.js +5 -5
  22. package/dist/modules/business_rules/components/ActionBuilder.js.map +2 -2
  23. package/dist/modules/business_rules/components/ActionRow.js +8 -8
  24. package/dist/modules/business_rules/components/ActionRow.js.map +1 -1
  25. package/dist/modules/business_rules/components/ConditionBuilder.js +5 -5
  26. package/dist/modules/business_rules/components/ConditionBuilder.js.map +2 -2
  27. package/dist/modules/business_rules/components/ConditionGroup.js +2 -2
  28. package/dist/modules/business_rules/components/ConditionGroup.js.map +1 -1
  29. package/dist/modules/business_rules/components/ConditionRow.js +3 -3
  30. package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
  31. package/dist/modules/business_rules/components/RuleSetMembers.js +8 -8
  32. package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
  33. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +2 -2
  34. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +1 -1
  35. package/dist/modules/catalog/backend/catalog/products/create/page.js +5 -5
  36. package/dist/modules/catalog/backend/catalog/products/create/page.js.map +1 -1
  37. package/dist/modules/catalog/components/products/MetadataEditor.js +1 -1
  38. package/dist/modules/catalog/components/products/MetadataEditor.js.map +1 -1
  39. package/dist/modules/catalog/components/products/ProductImageCell.js +1 -1
  40. package/dist/modules/catalog/components/products/ProductImageCell.js.map +1 -1
  41. package/dist/modules/catalog/components/products/VariantBuilder.js +1 -1
  42. package/dist/modules/catalog/components/products/VariantBuilder.js.map +1 -1
  43. package/dist/modules/catalog/widgets/injection/product-seo/widget.client.js +1 -1
  44. package/dist/modules/catalog/widgets/injection/product-seo/widget.client.js.map +2 -2
  45. package/dist/modules/currencies/components/CurrencyFetchingConfig.js +1 -1
  46. package/dist/modules/currencies/components/CurrencyFetchingConfig.js.map +1 -1
  47. package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js +2 -2
  48. package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js.map +2 -2
  49. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +9 -9
  50. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
  51. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +7 -7
  52. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
  53. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +2 -2
  54. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +1 -1
  55. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +3 -3
  56. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +1 -1
  57. package/dist/modules/customers/backend/customers/deals/pipeline/page.js +2 -2
  58. package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +1 -1
  59. package/dist/modules/customers/components/AddressTiles.js +1 -1
  60. package/dist/modules/customers/components/AddressTiles.js.map +1 -1
  61. package/dist/modules/customers/components/detail/ActivityForm.js +3 -3
  62. package/dist/modules/customers/components/detail/ActivityForm.js.map +1 -1
  63. package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
  64. package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +1 -1
  65. package/dist/modules/customers/components/detail/CustomFieldValuesList.js +1 -1
  66. package/dist/modules/customers/components/detail/CustomFieldValuesList.js.map +1 -1
  67. package/dist/modules/customers/components/detail/DealForm.js +1 -1
  68. package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
  69. package/dist/modules/customers/components/detail/DealsSection.js +1 -1
  70. package/dist/modules/customers/components/detail/DealsSection.js.map +1 -1
  71. package/dist/modules/customers/components/detail/DetailFieldsSection.js +1 -1
  72. package/dist/modules/customers/components/detail/DetailFieldsSection.js.map +1 -1
  73. package/dist/modules/customers/components/detail/InlineEditors.js +5 -5
  74. package/dist/modules/customers/components/detail/InlineEditors.js.map +2 -2
  75. package/dist/modules/customers/components/detail/TasksSection.js +1 -1
  76. package/dist/modules/customers/components/detail/TasksSection.js.map +1 -1
  77. package/dist/modules/customers/components/detail/TimelineItemHeader.js +1 -1
  78. package/dist/modules/customers/components/detail/TimelineItemHeader.js.map +1 -1
  79. package/dist/modules/customers/components/formConfig.js +2 -2
  80. package/dist/modules/customers/components/formConfig.js.map +1 -1
  81. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +1 -1
  82. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +1 -1
  83. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +2 -2
  84. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +1 -1
  85. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +1 -1
  86. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +1 -1
  87. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +1 -1
  88. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +1 -1
  89. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +1 -1
  90. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +1 -1
  91. package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js +1 -1
  92. package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js.map +1 -1
  93. package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js +1 -1
  94. package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js.map +1 -1
  95. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +1 -1
  96. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +1 -1
  97. package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js +1 -1
  98. package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js.map +1 -1
  99. package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js +1 -1
  100. package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js.map +1 -1
  101. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +2 -2
  102. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +1 -1
  103. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +1 -1
  104. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +1 -1
  105. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +1 -1
  106. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +1 -1
  107. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +2 -2
  108. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +1 -1
  109. package/dist/modules/data_sync/backend/data-sync/page.js +4 -4
  110. package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
  111. package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js +2 -2
  112. package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js.map +1 -1
  113. package/dist/modules/dictionaries/components/AppearanceSelector.js +3 -3
  114. package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
  115. package/dist/modules/dictionaries/components/DictionariesManager.js +4 -4
  116. package/dist/modules/dictionaries/components/DictionariesManager.js.map +2 -2
  117. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +2 -2
  118. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
  119. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +3 -3
  120. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +1 -1
  121. package/dist/modules/dictionaries/fields/dictionary.js +4 -4
  122. package/dist/modules/dictionaries/fields/dictionary.js.map +1 -1
  123. package/dist/modules/entities/components/EncryptionManager.js +3 -3
  124. package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
  125. package/dist/modules/entities/components/UserEntitiesTable.js +1 -1
  126. package/dist/modules/entities/components/UserEntitiesTable.js.map +2 -2
  127. package/dist/modules/feature_toggles/components/formConfig.js +1 -1
  128. package/dist/modules/feature_toggles/components/formConfig.js.map +1 -1
  129. package/dist/modules/feature_toggles/components/overrideFormConfig.js +2 -2
  130. package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +1 -1
  131. package/dist/modules/inbox_ops/backend/inbox-ops/proposals/[id]/page.js +12 -12
  132. package/dist/modules/inbox_ops/backend/inbox-ops/proposals/[id]/page.js.map +2 -2
  133. package/dist/modules/inbox_ops/components/messages/InboxEmailPreview.js +1 -1
  134. package/dist/modules/inbox_ops/components/messages/InboxEmailPreview.js.map +1 -1
  135. package/dist/modules/inbox_ops/components/proposals/ActionCard.js +12 -12
  136. package/dist/modules/inbox_ops/components/proposals/ActionCard.js.map +2 -2
  137. package/dist/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.js +3 -3
  138. package/dist/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.js.map +2 -2
  139. package/dist/modules/integrations/backend/integrations/[id]/page.js +6 -6
  140. package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
  141. package/dist/modules/messages/components/MessagesInboxPageClient.js +1 -1
  142. package/dist/modules/messages/components/MessagesInboxPageClient.js.map +1 -1
  143. package/dist/modules/messages/components/defaults/DefaultMessageListItem.js +1 -1
  144. package/dist/modules/messages/components/defaults/DefaultMessageListItem.js.map +1 -1
  145. package/dist/modules/messages/components/defaults/MessageRecordObjectDetail.js +1 -1
  146. package/dist/modules/messages/components/defaults/MessageRecordObjectDetail.js.map +1 -1
  147. package/dist/modules/messages/components/defaults/MessageRecordObjectPreview.js +1 -1
  148. package/dist/modules/messages/components/defaults/MessageRecordObjectPreview.js.map +1 -1
  149. package/dist/modules/messages/components/message-detail/panels/MessageListComponent.js +1 -1
  150. package/dist/modules/messages/components/message-detail/panels/MessageListComponent.js.map +1 -1
  151. package/dist/modules/messages/components/message-detail/panels/attachments-panel.js +1 -1
  152. package/dist/modules/messages/components/message-detail/panels/attachments-panel.js.map +1 -1
  153. package/dist/modules/payment_gateways/backend/payment-gateways/page.js +11 -11
  154. package/dist/modules/payment_gateways/backend/payment-gateways/page.js.map +2 -2
  155. package/dist/modules/planner/components/AvailabilityRulesEditor.js +2 -2
  156. package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
  157. package/dist/modules/portal/frontend/[orgSlug]/portal/dashboard/page.js +2 -2
  158. package/dist/modules/portal/frontend/[orgSlug]/portal/dashboard/page.js.map +2 -2
  159. package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js +3 -3
  160. package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js.map +2 -2
  161. package/dist/modules/portal/frontend/[orgSlug]/portal/page.js +3 -3
  162. package/dist/modules/portal/frontend/[orgSlug]/portal/page.js.map +2 -2
  163. package/dist/modules/portal/frontend/[orgSlug]/portal/profile/page.js +4 -4
  164. package/dist/modules/portal/frontend/[orgSlug]/portal/profile/page.js.map +2 -2
  165. package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js +4 -4
  166. package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js.map +2 -2
  167. package/dist/modules/resources/backend/resources/resources/[id]/page.js +1 -1
  168. package/dist/modules/resources/backend/resources/resources/[id]/page.js.map +1 -1
  169. package/dist/modules/sales/backend/sales/documents/[id]/page.js +4 -4
  170. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +1 -1
  171. package/dist/modules/sales/components/DocumentNumberSettings.js +1 -1
  172. package/dist/modules/sales/components/DocumentNumberSettings.js.map +1 -1
  173. package/dist/modules/sales/components/channels/ChannelOfferForm.js +1 -1
  174. package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +1 -1
  175. package/dist/modules/sales/components/documents/AdjustmentDialog.js +1 -1
  176. package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +1 -1
  177. package/dist/modules/sales/components/documents/DocumentTotals.js +3 -3
  178. package/dist/modules/sales/components/documents/DocumentTotals.js.map +1 -1
  179. package/dist/modules/sales/components/documents/PaymentDialog.js +1 -1
  180. package/dist/modules/sales/components/documents/PaymentDialog.js.map +1 -1
  181. package/dist/modules/sales/components/documents/SalesDocumentForm.js +2 -2
  182. package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
  183. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +4 -4
  184. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +1 -1
  185. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +4 -4
  186. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +1 -1
  187. package/dist/modules/sales/widgets/injection/document-history/widget.client.js +2 -2
  188. package/dist/modules/sales/widgets/injection/document-history/widget.client.js.map +1 -1
  189. package/dist/modules/sales/widgets/messages/SalesDocumentMessageDetail.js +1 -1
  190. package/dist/modules/sales/widgets/messages/SalesDocumentMessageDetail.js.map +1 -1
  191. package/dist/modules/sales/widgets/messages/SalesDocumentMessagePreview.js +1 -1
  192. package/dist/modules/sales/widgets/messages/SalesDocumentMessagePreview.js.map +1 -1
  193. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/PackageEditor.js +1 -1
  194. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/PackageEditor.js.map +1 -1
  195. package/dist/modules/staff/backend/staff/team-members/[id]/page.js +1 -1
  196. package/dist/modules/staff/backend/staff/team-members/[id]/page.js.map +1 -1
  197. package/dist/modules/translations/components/TranslationDrawerAction.js +2 -2
  198. package/dist/modules/translations/components/TranslationDrawerAction.js.map +1 -1
  199. package/dist/modules/translations/components/TranslationManager.js +3 -3
  200. package/dist/modules/translations/components/TranslationManager.js.map +1 -1
  201. package/dist/modules/translations/widgets/injection/translation-manager/widget.client.js +2 -2
  202. package/dist/modules/translations/widgets/injection/translation-manager/widget.client.js.map +1 -1
  203. package/dist/modules/workflows/backend/definitions/[id]/page.js +5 -5
  204. package/dist/modules/workflows/backend/definitions/[id]/page.js.map +2 -2
  205. package/dist/modules/workflows/backend/definitions/visual-editor/page.js +2 -2
  206. package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
  207. package/dist/modules/workflows/backend/events/[id]/page.js +4 -4
  208. package/dist/modules/workflows/backend/events/[id]/page.js.map +1 -1
  209. package/dist/modules/workflows/backend/instances/[id]/page.js +2 -2
  210. package/dist/modules/workflows/backend/instances/[id]/page.js.map +1 -1
  211. package/dist/modules/workflows/backend/tasks/[id]/page.js +20 -20
  212. package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
  213. package/dist/modules/workflows/components/DefinitionTriggersEditor.js +1 -1
  214. package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +1 -1
  215. package/dist/modules/workflows/components/EdgeEditDialog.js +12 -12
  216. package/dist/modules/workflows/components/EdgeEditDialog.js.map +1 -1
  217. package/dist/modules/workflows/components/NodeEditDialog.js +26 -26
  218. package/dist/modules/workflows/components/NodeEditDialog.js.map +1 -1
  219. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +1 -1
  220. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +1 -1
  221. package/dist/modules/workflows/components/mobile/MobileDefinitionDetail.js +2 -2
  222. package/dist/modules/workflows/components/mobile/MobileDefinitionDetail.js.map +2 -2
  223. package/dist/modules/workflows/components/mobile/MobileInstanceOverview.js +7 -7
  224. package/dist/modules/workflows/components/mobile/MobileInstanceOverview.js.map +2 -2
  225. package/dist/modules/workflows/components/mobile/MobileTaskForm.js +11 -11
  226. package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
  227. package/dist/modules/workflows/components/mobile/MobileVisualEditor.js +1 -1
  228. package/dist/modules/workflows/components/mobile/MobileVisualEditor.js.map +1 -1
  229. package/dist/modules/workflows/components/mobile/MobileWorkflowTimeline.js +23 -23
  230. package/dist/modules/workflows/components/mobile/MobileWorkflowTimeline.js.map +2 -2
  231. package/dist/modules/workflows/frontend/checkout-demo/page.js +6 -6
  232. package/dist/modules/workflows/frontend/checkout-demo/page.js.map +1 -1
  233. package/package.json +3 -3
  234. package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +18 -18
  235. package/src/modules/api_keys/backend/api-keys/create/page.tsx +1 -1
  236. package/src/modules/attachments/components/AttachmentLibrary.tsx +3 -3
  237. package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +1 -1
  238. package/src/modules/attachments/fields/attachment.tsx +1 -1
  239. package/src/modules/audit_logs/components/ActionLogDetailsDialog.tsx +1 -1
  240. package/src/modules/audit_logs/lib/display-helpers.tsx +1 -1
  241. package/src/modules/auth/backend/users/create/page.tsx +1 -1
  242. package/src/modules/business_rules/backend/rules/page.tsx +7 -7
  243. package/src/modules/business_rules/backend/sets/page.tsx +3 -3
  244. package/src/modules/business_rules/components/ActionBuilder.tsx +6 -6
  245. package/src/modules/business_rules/components/ActionRow.tsx +8 -8
  246. package/src/modules/business_rules/components/ConditionBuilder.tsx +6 -6
  247. package/src/modules/business_rules/components/ConditionGroup.tsx +2 -2
  248. package/src/modules/business_rules/components/ConditionRow.tsx +3 -3
  249. package/src/modules/business_rules/components/RuleSetMembers.tsx +9 -9
  250. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +2 -2
  251. package/src/modules/catalog/backend/catalog/products/create/page.tsx +5 -5
  252. package/src/modules/catalog/components/products/MetadataEditor.tsx +1 -1
  253. package/src/modules/catalog/components/products/ProductImageCell.tsx +1 -1
  254. package/src/modules/catalog/components/products/VariantBuilder.tsx +1 -1
  255. package/src/modules/catalog/widgets/injection/product-seo/widget.client.tsx +1 -1
  256. package/src/modules/currencies/components/CurrencyFetchingConfig.tsx +1 -1
  257. package/src/modules/customer_accounts/backend/customer_accounts/roles/page.tsx +2 -2
  258. package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +10 -10
  259. package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +9 -9
  260. package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +2 -2
  261. package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +3 -3
  262. package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +2 -2
  263. package/src/modules/customers/components/AddressTiles.tsx +1 -1
  264. package/src/modules/customers/components/detail/ActivityForm.tsx +3 -3
  265. package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
  266. package/src/modules/customers/components/detail/CustomFieldValuesList.tsx +1 -1
  267. package/src/modules/customers/components/detail/DealForm.tsx +1 -1
  268. package/src/modules/customers/components/detail/DealsSection.tsx +1 -1
  269. package/src/modules/customers/components/detail/DetailFieldsSection.tsx +1 -1
  270. package/src/modules/customers/components/detail/InlineEditors.tsx +5 -5
  271. package/src/modules/customers/components/detail/TasksSection.tsx +1 -1
  272. package/src/modules/customers/components/detail/TimelineItemHeader.tsx +1 -1
  273. package/src/modules/customers/components/formConfig.tsx +2 -2
  274. package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +1 -1
  275. package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +2 -2
  276. package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +1 -1
  277. package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +1 -1
  278. package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +1 -1
  279. package/src/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.tsx +1 -1
  280. package/src/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.tsx +1 -1
  281. package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +1 -1
  282. package/src/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.tsx +1 -1
  283. package/src/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.tsx +1 -1
  284. package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +2 -2
  285. package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +1 -1
  286. package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +1 -1
  287. package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +2 -2
  288. package/src/modules/data_sync/backend/data-sync/page.tsx +4 -4
  289. package/src/modules/data_sync/backend/data-sync/runs/[id]/page.tsx +2 -2
  290. package/src/modules/dictionaries/components/AppearanceSelector.tsx +3 -3
  291. package/src/modules/dictionaries/components/DictionariesManager.tsx +4 -4
  292. package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +2 -2
  293. package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +3 -3
  294. package/src/modules/dictionaries/fields/dictionary.tsx +4 -4
  295. package/src/modules/entities/components/EncryptionManager.tsx +3 -3
  296. package/src/modules/entities/components/UserEntitiesTable.tsx +1 -1
  297. package/src/modules/feature_toggles/components/formConfig.tsx +1 -1
  298. package/src/modules/feature_toggles/components/overrideFormConfig.tsx +2 -2
  299. package/src/modules/inbox_ops/backend/inbox-ops/proposals/[id]/page.tsx +12 -12
  300. package/src/modules/inbox_ops/components/messages/InboxEmailPreview.tsx +1 -1
  301. package/src/modules/inbox_ops/components/proposals/ActionCard.tsx +12 -12
  302. package/src/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.tsx +4 -4
  303. package/src/modules/integrations/backend/integrations/[id]/page.tsx +6 -6
  304. package/src/modules/messages/components/MessagesInboxPageClient.tsx +1 -1
  305. package/src/modules/messages/components/defaults/DefaultMessageListItem.tsx +1 -1
  306. package/src/modules/messages/components/defaults/MessageRecordObjectDetail.tsx +1 -1
  307. package/src/modules/messages/components/defaults/MessageRecordObjectPreview.tsx +1 -1
  308. package/src/modules/messages/components/message-detail/panels/MessageListComponent.tsx +1 -1
  309. package/src/modules/messages/components/message-detail/panels/attachments-panel.tsx +1 -1
  310. package/src/modules/payment_gateways/backend/payment-gateways/page.tsx +11 -11
  311. package/src/modules/planner/components/AvailabilityRulesEditor.tsx +2 -2
  312. package/src/modules/portal/frontend/[orgSlug]/portal/dashboard/page.tsx +2 -2
  313. package/src/modules/portal/frontend/[orgSlug]/portal/login/page.tsx +3 -3
  314. package/src/modules/portal/frontend/[orgSlug]/portal/page.tsx +3 -3
  315. package/src/modules/portal/frontend/[orgSlug]/portal/profile/page.tsx +4 -4
  316. package/src/modules/portal/frontend/[orgSlug]/portal/signup/page.tsx +4 -4
  317. package/src/modules/resources/backend/resources/resources/[id]/page.tsx +1 -1
  318. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +4 -4
  319. package/src/modules/sales/components/DocumentNumberSettings.tsx +1 -1
  320. package/src/modules/sales/components/channels/ChannelOfferForm.tsx +1 -1
  321. package/src/modules/sales/components/documents/AdjustmentDialog.tsx +1 -1
  322. package/src/modules/sales/components/documents/DocumentTotals.tsx +3 -3
  323. package/src/modules/sales/components/documents/PaymentDialog.tsx +1 -1
  324. package/src/modules/sales/components/documents/SalesDocumentForm.tsx +2 -2
  325. package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +4 -4
  326. package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +4 -4
  327. package/src/modules/sales/widgets/injection/document-history/widget.client.tsx +2 -2
  328. package/src/modules/sales/widgets/messages/SalesDocumentMessageDetail.tsx +1 -1
  329. package/src/modules/sales/widgets/messages/SalesDocumentMessagePreview.tsx +1 -1
  330. package/src/modules/shipping_carriers/lib/shipment-wizard/components/PackageEditor.tsx +1 -1
  331. package/src/modules/staff/backend/staff/team-members/[id]/page.tsx +1 -1
  332. package/src/modules/translations/components/TranslationDrawerAction.tsx +2 -2
  333. package/src/modules/translations/components/TranslationManager.tsx +3 -3
  334. package/src/modules/translations/widgets/injection/translation-manager/widget.client.tsx +2 -2
  335. package/src/modules/workflows/backend/definitions/[id]/page.tsx +5 -5
  336. package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +2 -2
  337. package/src/modules/workflows/backend/events/[id]/page.tsx +4 -4
  338. package/src/modules/workflows/backend/instances/[id]/page.tsx +2 -2
  339. package/src/modules/workflows/backend/tasks/[id]/page.tsx +23 -23
  340. package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +1 -1
  341. package/src/modules/workflows/components/EdgeEditDialog.tsx +12 -12
  342. package/src/modules/workflows/components/NodeEditDialog.tsx +26 -26
  343. package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +1 -1
  344. package/src/modules/workflows/components/mobile/MobileDefinitionDetail.tsx +2 -2
  345. package/src/modules/workflows/components/mobile/MobileInstanceOverview.tsx +7 -7
  346. package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +14 -14
  347. package/src/modules/workflows/components/mobile/MobileVisualEditor.tsx +1 -1
  348. package/src/modules/workflows/components/mobile/MobileWorkflowTimeline.tsx +23 -23
  349. package/src/modules/workflows/frontend/checkout-demo/page.tsx +6 -6
@@ -51,7 +51,7 @@ function ActionRow({
51
51
  value,
52
52
  onChange: (e) => handleConfigChange(field, e.target.value.split(",").map((s) => s.trim())),
53
53
  placeholder: t("business_rules.components.actionRow.config.recipients.placeholder"),
54
- className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500"
54
+ className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
55
55
  }
56
56
  ),
57
57
  /* @__PURE__ */ jsx("div", { className: "col-span-4 col-start-2", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("business_rules.components.actionRow.config.recipients.help") }) })
@@ -65,7 +65,7 @@ function ActionRow({
65
65
  {
66
66
  value: value || "info",
67
67
  onChange: (e) => handleConfigChange(field, e.target.value),
68
- className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500",
68
+ className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
69
69
  children: [
70
70
  /* @__PURE__ */ jsx("option", { value: "info", children: t("business_rules.components.actionRow.config.level.info") }),
71
71
  /* @__PURE__ */ jsx("option", { value: "warn", children: t("business_rules.components.actionRow.config.level.warn") }),
@@ -84,7 +84,7 @@ function ActionRow({
84
84
  {
85
85
  value: value || "POST",
86
86
  onChange: (e) => handleConfigChange(field, e.target.value),
87
- className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500",
87
+ className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
88
88
  children: [
89
89
  /* @__PURE__ */ jsx("option", { value: "GET", children: "GET" }),
90
90
  /* @__PURE__ */ jsx("option", { value: "POST", children: "POST" }),
@@ -110,7 +110,7 @@ function ActionRow({
110
110
  onChange: (e) => handleConfigChange(field, e.target.value),
111
111
  placeholder: t("business_rules.components.actionRow.config.message.placeholder"),
112
112
  rows: 2,
113
- className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500"
113
+ className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
114
114
  }
115
115
  ),
116
116
  /* @__PURE__ */ jsx("div", { className: "col-span-4 col-start-2", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("business_rules.components.actionRow.config.message.help") }) })
@@ -129,7 +129,7 @@ function ActionRow({
129
129
  value,
130
130
  onChange: (e) => handleConfigChange(field, e.target.value),
131
131
  placeholder: t("business_rules.components.actionRow.config.field.placeholder", { field }),
132
- className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500"
132
+ className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
133
133
  }
134
134
  )
135
135
  ] }, field);
@@ -147,7 +147,7 @@ function ActionRow({
147
147
  {
148
148
  value: action.type || "",
149
149
  onChange: handleTypeChange,
150
- className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500 font-medium",
150
+ className: "col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring font-medium",
151
151
  children: [
152
152
  /* @__PURE__ */ jsx("option", { value: "", children: t("business_rules.components.actionRow.actionType.placeholder") }),
153
153
  actionTypes.map((type) => /* @__PURE__ */ jsx("option", { value: type.value, children: type.label }, type.value))
@@ -168,7 +168,7 @@ function ActionRow({
168
168
  type: "button",
169
169
  onClick: () => onMoveUp(index),
170
170
  disabled: !canMoveUp,
171
- className: "p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
171
+ className: "p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
172
172
  title: t("business_rules.components.actionRow.moveUp"),
173
173
  children: /* @__PURE__ */ jsx(ChevronUp, { className: "w-4 h-4" })
174
174
  }
@@ -179,7 +179,7 @@ function ActionRow({
179
179
  type: "button",
180
180
  onClick: () => onMoveDown(index),
181
181
  disabled: !canMoveDown,
182
- className: "p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
182
+ className: "p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
183
183
  title: t("business_rules.components.actionRow.moveDown"),
184
184
  children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-4 h-4" })
185
185
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/modules/business_rules/components/ActionRow.tsx"],
4
- "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { X, ChevronUp, ChevronDown } from 'lucide-react'\nimport type { Action } from './utils/actionValidation'\nimport { getActionTypeOptions, getRequiredConfigFields, getOptionalConfigFields } from './utils/actionValidation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\nexport type ActionRowProps = {\n action: Action\n index: number\n onChange: (index: number, action: Action) => void\n onDelete: (index: number) => void\n onMoveUp?: (index: number) => void\n onMoveDown?: (index: number) => void\n canMoveUp?: boolean\n canMoveDown?: boolean\n error?: string\n}\n\nexport function ActionRow({\n action,\n index,\n onChange,\n onDelete,\n onMoveUp,\n onMoveDown,\n canMoveUp,\n canMoveDown,\n error,\n}: ActionRowProps) {\n const t = useT()\n const actionTypes = getActionTypeOptions(t)\n const requiredFields = getRequiredConfigFields(action.type)\n const optionalFields = getOptionalConfigFields(action.type)\n\n const handleTypeChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n onChange(index, {\n ...action,\n type: e.target.value,\n config: {}, // Reset config when type changes\n })\n }\n\n const handleConfigChange = (field: string, value: any) => {\n onChange(index, {\n ...action,\n config: {\n ...(action.config || {}),\n [field]: value,\n },\n })\n }\n\n const renderConfigField = (field: string, required: boolean) => {\n const value = action.config?.[field] || ''\n\n // Special handling for different field types\n if (field === 'recipients' && action.type === 'NOTIFY') {\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-start\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">\n {t('business_rules.components.actionRow.config.recipients')} {required && <span className=\"text-red-500\">{t('business_rules.components.actionRow.actionType.required')}</span>}\n </label>\n <input\n type=\"text\"\n value={value}\n onChange={(e) => handleConfigChange(field, e.target.value.split(',').map((s) => s.trim()))}\n placeholder={t('business_rules.components.actionRow.config.recipients.placeholder')}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500\"\n />\n <div className=\"col-span-4 col-start-2\">\n <p className=\"text-xs text-muted-foreground\">{t('business_rules.components.actionRow.config.recipients.help')}</p>\n </div>\n </div>\n )\n }\n\n if (field === 'level' && action.type === 'LOG') {\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-center\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">{t('business_rules.components.actionRow.config.level')}</label>\n <select\n value={value || 'info'}\n onChange={(e) => handleConfigChange(field, e.target.value)}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500\"\n >\n <option value=\"info\">{t('business_rules.components.actionRow.config.level.info')}</option>\n <option value=\"warn\">{t('business_rules.components.actionRow.config.level.warn')}</option>\n <option value=\"error\">{t('business_rules.components.actionRow.config.level.error')}</option>\n <option value=\"debug\">{t('business_rules.components.actionRow.config.level.debug')}</option>\n </select>\n </div>\n )\n }\n\n if (field === 'method' && action.type === 'CALL_WEBHOOK') {\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-center\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">{t('business_rules.components.actionRow.config.method')}</label>\n <select\n value={value || 'POST'}\n onChange={(e) => handleConfigChange(field, e.target.value)}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500\"\n >\n <option value=\"GET\">GET</option>\n <option value=\"POST\">POST</option>\n <option value=\"PUT\">PUT</option>\n <option value=\"PATCH\">PATCH</option>\n <option value=\"DELETE\">DELETE</option>\n </select>\n </div>\n )\n }\n\n if (field === 'message') {\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-start\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">\n {t('business_rules.components.actionRow.config.message')} {required && <span className=\"text-red-500\">{t('business_rules.components.actionRow.actionType.required')}</span>}\n </label>\n <textarea\n value={value}\n onChange={(e) => handleConfigChange(field, e.target.value)}\n placeholder={t('business_rules.components.actionRow.config.message.placeholder')}\n rows={2}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500\"\n />\n <div className=\"col-span-4 col-start-2\">\n <p className=\"text-xs text-muted-foreground\">{t('business_rules.components.actionRow.config.message.help')}</p>\n </div>\n </div>\n )\n }\n\n // Default text input\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-center\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">\n {field} {required && <span className=\"text-red-500\">{t('business_rules.components.actionRow.actionType.required')}</span>}\n </label>\n <input\n type=\"text\"\n value={value}\n onChange={(e) => handleConfigChange(field, e.target.value)}\n placeholder={t('business_rules.components.actionRow.config.field.placeholder', { field })}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500\"\n />\n </div>\n )\n }\n\n return (\n <div className=\"flex items-start gap-2 p-3 bg-muted rounded border border-border\">\n <div className=\"flex-1 space-y-2\">\n {/* Action Type */}\n <div className=\"grid grid-cols-4 gap-2 items-center\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">\n {t('business_rules.components.actionRow.actionType')} <span className=\"text-red-500\">{t('business_rules.components.actionRow.actionType.required')}</span>\n </label>\n <select\n value={action.type || ''}\n onChange={handleTypeChange}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500 font-medium\"\n >\n <option value=\"\">{t('business_rules.components.actionRow.actionType.placeholder')}</option>\n {actionTypes.map((type) => (\n <option key={type.value} value={type.value}>\n {type.label}\n </option>\n ))}\n </select>\n </div>\n\n {/* Config Fields */}\n {action.type && (\n <>\n {requiredFields.map((field) => renderConfigField(field, true))}\n {optionalFields.map((field) => renderConfigField(field, false))}\n </>\n )}\n\n {/* Error Display */}\n {error && (\n <div className=\"mt-2\">\n <p className=\"text-xs text-red-600\">{error}</p>\n </div>\n )}\n </div>\n\n {/* Control Buttons */}\n <div className=\"flex flex-col gap-1\">\n {onMoveUp && (\n <button\n type=\"button\"\n onClick={() => onMoveUp(index)}\n disabled={!canMoveUp}\n className=\"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed\"\n title={t('business_rules.components.actionRow.moveUp')}\n >\n <ChevronUp className=\"w-4 h-4\" />\n </button>\n )}\n {onMoveDown && (\n <button\n type=\"button\"\n onClick={() => onMoveDown(index)}\n disabled={!canMoveDown}\n className=\"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed\"\n title={t('business_rules.components.actionRow.moveDown')}\n >\n <ChevronDown className=\"w-4 h-4\" />\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => onDelete(index)}\n className=\"p-1 text-muted-foreground hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors\"\n title={t('business_rules.components.actionRow.delete')}\n >\n <X className=\"w-4 h-4\" />\n </button>\n </div>\n </div>\n )\n}\n"],
4
+ "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { X, ChevronUp, ChevronDown } from 'lucide-react'\nimport type { Action } from './utils/actionValidation'\nimport { getActionTypeOptions, getRequiredConfigFields, getOptionalConfigFields } from './utils/actionValidation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\nexport type ActionRowProps = {\n action: Action\n index: number\n onChange: (index: number, action: Action) => void\n onDelete: (index: number) => void\n onMoveUp?: (index: number) => void\n onMoveDown?: (index: number) => void\n canMoveUp?: boolean\n canMoveDown?: boolean\n error?: string\n}\n\nexport function ActionRow({\n action,\n index,\n onChange,\n onDelete,\n onMoveUp,\n onMoveDown,\n canMoveUp,\n canMoveDown,\n error,\n}: ActionRowProps) {\n const t = useT()\n const actionTypes = getActionTypeOptions(t)\n const requiredFields = getRequiredConfigFields(action.type)\n const optionalFields = getOptionalConfigFields(action.type)\n\n const handleTypeChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n onChange(index, {\n ...action,\n type: e.target.value,\n config: {}, // Reset config when type changes\n })\n }\n\n const handleConfigChange = (field: string, value: any) => {\n onChange(index, {\n ...action,\n config: {\n ...(action.config || {}),\n [field]: value,\n },\n })\n }\n\n const renderConfigField = (field: string, required: boolean) => {\n const value = action.config?.[field] || ''\n\n // Special handling for different field types\n if (field === 'recipients' && action.type === 'NOTIFY') {\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-start\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">\n {t('business_rules.components.actionRow.config.recipients')} {required && <span className=\"text-red-500\">{t('business_rules.components.actionRow.actionType.required')}</span>}\n </label>\n <input\n type=\"text\"\n value={value}\n onChange={(e) => handleConfigChange(field, e.target.value.split(',').map((s) => s.trim()))}\n placeholder={t('business_rules.components.actionRow.config.recipients.placeholder')}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n <div className=\"col-span-4 col-start-2\">\n <p className=\"text-xs text-muted-foreground\">{t('business_rules.components.actionRow.config.recipients.help')}</p>\n </div>\n </div>\n )\n }\n\n if (field === 'level' && action.type === 'LOG') {\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-center\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">{t('business_rules.components.actionRow.config.level')}</label>\n <select\n value={value || 'info'}\n onChange={(e) => handleConfigChange(field, e.target.value)}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <option value=\"info\">{t('business_rules.components.actionRow.config.level.info')}</option>\n <option value=\"warn\">{t('business_rules.components.actionRow.config.level.warn')}</option>\n <option value=\"error\">{t('business_rules.components.actionRow.config.level.error')}</option>\n <option value=\"debug\">{t('business_rules.components.actionRow.config.level.debug')}</option>\n </select>\n </div>\n )\n }\n\n if (field === 'method' && action.type === 'CALL_WEBHOOK') {\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-center\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">{t('business_rules.components.actionRow.config.method')}</label>\n <select\n value={value || 'POST'}\n onChange={(e) => handleConfigChange(field, e.target.value)}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <option value=\"GET\">GET</option>\n <option value=\"POST\">POST</option>\n <option value=\"PUT\">PUT</option>\n <option value=\"PATCH\">PATCH</option>\n <option value=\"DELETE\">DELETE</option>\n </select>\n </div>\n )\n }\n\n if (field === 'message') {\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-start\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">\n {t('business_rules.components.actionRow.config.message')} {required && <span className=\"text-red-500\">{t('business_rules.components.actionRow.actionType.required')}</span>}\n </label>\n <textarea\n value={value}\n onChange={(e) => handleConfigChange(field, e.target.value)}\n placeholder={t('business_rules.components.actionRow.config.message.placeholder')}\n rows={2}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n <div className=\"col-span-4 col-start-2\">\n <p className=\"text-xs text-muted-foreground\">{t('business_rules.components.actionRow.config.message.help')}</p>\n </div>\n </div>\n )\n }\n\n // Default text input\n return (\n <div key={field} className=\"grid grid-cols-4 gap-2 items-center\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">\n {field} {required && <span className=\"text-red-500\">{t('business_rules.components.actionRow.actionType.required')}</span>}\n </label>\n <input\n type=\"text\"\n value={value}\n onChange={(e) => handleConfigChange(field, e.target.value)}\n placeholder={t('business_rules.components.actionRow.config.field.placeholder', { field })}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n </div>\n )\n }\n\n return (\n <div className=\"flex items-start gap-2 p-3 bg-muted rounded border border-border\">\n <div className=\"flex-1 space-y-2\">\n {/* Action Type */}\n <div className=\"grid grid-cols-4 gap-2 items-center\">\n <label className=\"text-xs font-medium text-foreground col-span-1\">\n {t('business_rules.components.actionRow.actionType')} <span className=\"text-red-500\">{t('business_rules.components.actionRow.actionType.required')}</span>\n </label>\n <select\n value={action.type || ''}\n onChange={handleTypeChange}\n className=\"col-span-3 px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring font-medium\"\n >\n <option value=\"\">{t('business_rules.components.actionRow.actionType.placeholder')}</option>\n {actionTypes.map((type) => (\n <option key={type.value} value={type.value}>\n {type.label}\n </option>\n ))}\n </select>\n </div>\n\n {/* Config Fields */}\n {action.type && (\n <>\n {requiredFields.map((field) => renderConfigField(field, true))}\n {optionalFields.map((field) => renderConfigField(field, false))}\n </>\n )}\n\n {/* Error Display */}\n {error && (\n <div className=\"mt-2\">\n <p className=\"text-xs text-red-600\">{error}</p>\n </div>\n )}\n </div>\n\n {/* Control Buttons */}\n <div className=\"flex flex-col gap-1\">\n {onMoveUp && (\n <button\n type=\"button\"\n onClick={() => onMoveUp(index)}\n disabled={!canMoveUp}\n className=\"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n title={t('business_rules.components.actionRow.moveUp')}\n >\n <ChevronUp className=\"w-4 h-4\" />\n </button>\n )}\n {onMoveDown && (\n <button\n type=\"button\"\n onClick={() => onMoveDown(index)}\n disabled={!canMoveDown}\n className=\"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n title={t('business_rules.components.actionRow.moveDown')}\n >\n <ChevronDown className=\"w-4 h-4\" />\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => onDelete(index)}\n className=\"p-1 text-muted-foreground hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors\"\n title={t('business_rules.components.actionRow.delete')}\n >\n <X className=\"w-4 h-4\" />\n </button>\n </div>\n </div>\n )\n}\n"],
5
5
  "mappings": ";AA6DU,SAmHA,UAlH4E,KAD5E;AA1DV,SAAS,GAAG,WAAW,mBAAmB;AAE1C,SAAS,sBAAsB,yBAAyB,+BAA+B;AACvF,SAAS,YAAY;AAcd,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,QAAM,IAAI,KAAK;AACf,QAAM,cAAc,qBAAqB,CAAC;AAC1C,QAAM,iBAAiB,wBAAwB,OAAO,IAAI;AAC1D,QAAM,iBAAiB,wBAAwB,OAAO,IAAI;AAE1D,QAAM,mBAAmB,CAAC,MAA4C;AACpE,aAAS,OAAO;AAAA,MACd,GAAG;AAAA,MACH,MAAM,EAAE,OAAO;AAAA,MACf,QAAQ,CAAC;AAAA;AAAA,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iBAAM,GAC7C;AAAA,OAEJ;AAAA,IAGA,qBAAC,SAAI,WAAU,uBACZ;AAAA,kBACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,SAAS,KAAK;AAAA,UAC7B,UAAU,CAAC;AAAA,UACX,WAAU;AAAA,UACV,OAAO,EAAE,4CAA4C;AAAA,UAErD,8BAAC,aAAU,WAAU,WAAU;AAAA;AAAA,MACjC;AAAA,MAED,cACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,WAAW,KAAK;AAAA,UAC/B,UAAU,CAAC;AAAA,UACX,WAAU;AAAA,UACV,OAAO,EAAE,8CAA8C;AAAA,UAEvD,8BAAC,eAAY,WAAU,WAAU;AAAA;AAAA,MACnC;AAAA,MAEF;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,SAAS,KAAK;AAAA,UAC7B,WAAU;AAAA,UACV,OAAO,EAAE,4CAA4C;AAAA,UAErD,8BAAC,KAAE,WAAU,WAAU;AAAA;AAAA,MACzB;AAAA,OACF;AAAA,KACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -90,13 +90,13 @@ function ConditionBuilder({
90
90
  entityType
91
91
  }
92
92
  ),
93
- /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Button, { type: "button", onClick: handleClear, variant: "outline", size: "sm", className: "text-red-600", children: t("business_rules.components.conditionBuilder.clearAll") }) })
93
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Button, { type: "button", onClick: handleClear, variant: "outline", size: "sm", className: "text-status-error-text", children: t("business_rules.components.conditionBuilder.clearAll") }) })
94
94
  ] }),
95
- !validation.valid && /* @__PURE__ */ jsxs("div", { className: "p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded", children: [
96
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-red-800 dark:text-red-300 mb-1", children: t("business_rules.components.conditionBuilder.validationErrors") }),
97
- /* @__PURE__ */ jsx("ul", { className: "list-disc list-inside space-y-0.5", children: validation.errors.map((err, index) => /* @__PURE__ */ jsx("li", { className: "text-xs text-red-700 dark:text-red-400", children: err }, index)) })
95
+ !validation.valid && /* @__PURE__ */ jsxs("div", { className: "p-3 bg-status-error-bg border border-status-error-border rounded", children: [
96
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-status-error-text mb-1", children: t("business_rules.components.conditionBuilder.validationErrors") }),
97
+ /* @__PURE__ */ jsx("ul", { className: "list-disc list-inside space-y-0.5", children: validation.errors.map((err, index) => /* @__PURE__ */ jsx("li", { className: "text-xs text-status-error-text", children: err }, index)) })
98
98
  ] }),
99
- error && /* @__PURE__ */ jsx("div", { className: "p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-red-700 dark:text-red-400", children: error }) }),
99
+ error && /* @__PURE__ */ jsx("div", { className: "p-3 bg-status-error-bg border border-status-error-border rounded", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-status-error-text", children: error }) }),
100
100
  showDebug && value && /* @__PURE__ */ jsx("div", { className: "p-3 bg-zinc-900 dark:bg-zinc-950 rounded text-xs font-mono overflow-x-auto border border-border", children: /* @__PURE__ */ jsx("pre", { className: "text-zinc-100", children: JSON.stringify(value, null, 2) }) }),
101
101
  /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground space-y-1", children: [
102
102
  /* @__PURE__ */ jsxs("p", { children: [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/modules/business_rules/components/ConditionBuilder.tsx"],
4
- "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Plus, Code } from 'lucide-react'\nimport { ConditionGroup } from './ConditionGroup'\nimport type { GroupCondition, ConditionExpression } from './utils/conditionValidation'\nimport { validateConditionExpression } from './utils/conditionValidation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\n\nexport type ConditionBuilderProps = {\n value: GroupCondition | null | undefined\n onChangeAction: (value: GroupCondition) => void\n entityType?: string\n maxDepth?: number\n error?: string\n showJsonPreview?: boolean\n}\n\nexport function ConditionBuilder({\n value,\n onChangeAction,\n entityType,\n maxDepth = 5,\n error,\n showJsonPreview = false,\n}: ConditionBuilderProps) {\n const t = useT()\n const { confirm: confirmDialog, ConfirmDialogElement } = useConfirmDialog()\n const [showDebug, setShowDebug] = React.useState(false)\n\n const handleInitialize = () => {\n const initialGroup: GroupCondition = {\n operator: 'AND',\n rules: [\n {\n field: '',\n operator: '=',\n value: null,\n },\n ],\n }\n onChangeAction(initialGroup)\n }\n\n const handleChange = (updatedGroup: GroupCondition) => {\n onChangeAction(updatedGroup)\n }\n\n const handleClear = async () => {\n const confirmed = await confirmDialog({\n title: t('business_rules.components.conditionBuilder.confirm.clearAll'),\n variant: 'destructive',\n })\n if (confirmed) {\n onChangeAction({\n operator: 'AND',\n rules: [],\n })\n }\n }\n\n // Validate current value (memoized to avoid expensive re-computation)\n const validation = React.useMemo(() => {\n return value ? validateConditionExpression(value, 0, 5, t) : { valid: true, errors: [] }\n }, [value, t])\n\n return (\n <div className=\"space-y-3\">\n {/* Header */}\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"text-sm font-medium text-foreground\">\n {t('business_rules.components.conditionBuilder.title')}\n </h3>\n {value && value.rules && value.rules.length > 0 && (\n <span className=\"text-xs text-muted-foreground\">\n ({t('business_rules.components.conditionBuilder.ruleCount', { count: value.rules.length })})\n </span>\n )}\n </div>\n\n {/* Debug Toggle */}\n {showJsonPreview && value && (\n <button\n type=\"button\"\n onClick={() => setShowDebug(!showDebug)}\n className=\"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground\"\n title={t('business_rules.components.conditionBuilder.jsonPreview.toggle')}\n >\n <Code className=\"w-3 h-3\" />\n {showDebug\n ? t('business_rules.components.conditionBuilder.jsonPreview.hide')\n : t('business_rules.components.conditionBuilder.jsonPreview.show')\n }\n </button>\n )}\n </div>\n\n {/* Empty State */}\n {!value || !value.rules || value.rules.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center p-8 border-2 border-dashed border-border rounded-lg bg-muted\">\n <p className=\"text-sm text-muted-foreground mb-4\">\n {t('business_rules.components.conditionBuilder.emptyMessage')}\n </p>\n <Button type=\"button\" onClick={handleInitialize} variant=\"outline\" size=\"sm\">\n <Plus className=\"w-4 h-4 mr-2\" />\n {t('business_rules.components.conditionBuilder.addFirstCondition')}\n </Button>\n </div>\n ) : (\n <>\n {/* Condition Tree */}\n <ConditionGroup\n group={value}\n onChange={handleChange}\n depth={0}\n maxDepth={maxDepth}\n entityType={entityType}\n />\n\n {/* Clear Button */}\n <div className=\"flex justify-end\">\n <Button type=\"button\" onClick={handleClear} variant=\"outline\" size=\"sm\" className=\"text-red-600\">\n {t('business_rules.components.conditionBuilder.clearAll')}\n </Button>\n </div>\n </>\n )}\n\n {/* Validation Errors */}\n {!validation.valid && (\n <div className=\"p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded\">\n <p className=\"text-sm font-medium text-red-800 dark:text-red-300 mb-1\">\n {t('business_rules.components.conditionBuilder.validationErrors')}\n </p>\n <ul className=\"list-disc list-inside space-y-0.5\">\n {validation.errors.map((err, index) => (\n <li key={index} className=\"text-xs text-red-700 dark:text-red-400\">\n {err}\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {/* External Error */}\n {error && (\n <div className=\"p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded\">\n <p className=\"text-sm text-red-700 dark:text-red-400\">{error}</p>\n </div>\n )}\n\n {/* JSON Preview */}\n {showDebug && value && (\n <div className=\"p-3 bg-zinc-900 dark:bg-zinc-950 rounded text-xs font-mono overflow-x-auto border border-border\">\n <pre className=\"text-zinc-100\">{JSON.stringify(value, null, 2)}</pre>\n </div>\n )}\n\n {/* Help Text */}\n <div className=\"text-xs text-muted-foreground space-y-1\">\n <p>\n <strong>{t('business_rules.components.conditionBuilder.help.fieldPaths')}</strong>{' '}\n {t('business_rules.components.conditionBuilder.help.fieldPathsDescription')}\n </p>\n <p>\n <strong>{t('business_rules.components.conditionBuilder.help.values')}</strong>{' '}\n {t('business_rules.components.conditionBuilder.help.valuesDescription')}\n </p>\n <p>\n <strong>{t('business_rules.components.conditionBuilder.help.fieldComparison')}</strong>{' '}\n {t('business_rules.components.conditionBuilder.help.fieldComparisonDescription')}\n </p>\n </div>\n {ConfirmDialogElement}\n </div>\n )\n}\n"],
5
- "mappings": ";AAyEU,SAuCF,UAvCE,KAIE,YAJF;AAvEV,YAAY,WAAW;AACvB,SAAS,cAAc;AACvB,SAAS,MAAM,YAAY;AAC3B,SAAS,sBAAsB;AAE/B,SAAS,mCAAmC;AAC5C,SAAS,YAAY;AACrB,SAAS,wBAAwB;AAW1B,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA,kBAAkB;AACpB,GAA0B;AACxB,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,SAAS,eAAe,qBAAqB,IAAI,iBAAiB;AAC1E,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,KAAK;AAEtD,QAAM,mBAAmB,MAAM;AAC7B,UAAM,eAA+B;AAAA,MACnC,UAAU;AAAA,MACV,OAAO;AAAA,QACL;AAAA,UACE,OAAO;AAAA,UACP,UAAU;AAAA,UACV,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AACA,mBAAe,YAAY;AAAA,EAC7B;AAEA,QAAM,eAAe,CAAC,iBAAiC;AACrD,mBAAe,YAAY;AAAA,EAC7B;AAEA,QAAM,cAAc,YAAY;AAC9B,UAAM,YAAY,MAAM,cAAc;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from '@open-mercato/ui/primitives/button'\nimport { Plus, Code } from 'lucide-react'\nimport { ConditionGroup } from './ConditionGroup'\nimport type { GroupCondition, ConditionExpression } from './utils/conditionValidation'\nimport { validateConditionExpression } from './utils/conditionValidation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\n\nexport type ConditionBuilderProps = {\n value: GroupCondition | null | undefined\n onChangeAction: (value: GroupCondition) => void\n entityType?: string\n maxDepth?: number\n error?: string\n showJsonPreview?: boolean\n}\n\nexport function ConditionBuilder({\n value,\n onChangeAction,\n entityType,\n maxDepth = 5,\n error,\n showJsonPreview = false,\n}: ConditionBuilderProps) {\n const t = useT()\n const { confirm: confirmDialog, ConfirmDialogElement } = useConfirmDialog()\n const [showDebug, setShowDebug] = React.useState(false)\n\n const handleInitialize = () => {\n const initialGroup: GroupCondition = {\n operator: 'AND',\n rules: [\n {\n field: '',\n operator: '=',\n value: null,\n },\n ],\n }\n onChangeAction(initialGroup)\n }\n\n const handleChange = (updatedGroup: GroupCondition) => {\n onChangeAction(updatedGroup)\n }\n\n const handleClear = async () => {\n const confirmed = await confirmDialog({\n title: t('business_rules.components.conditionBuilder.confirm.clearAll'),\n variant: 'destructive',\n })\n if (confirmed) {\n onChangeAction({\n operator: 'AND',\n rules: [],\n })\n }\n }\n\n // Validate current value (memoized to avoid expensive re-computation)\n const validation = React.useMemo(() => {\n return value ? validateConditionExpression(value, 0, 5, t) : { valid: true, errors: [] }\n }, [value, t])\n\n return (\n <div className=\"space-y-3\">\n {/* Header */}\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"text-sm font-medium text-foreground\">\n {t('business_rules.components.conditionBuilder.title')}\n </h3>\n {value && value.rules && value.rules.length > 0 && (\n <span className=\"text-xs text-muted-foreground\">\n ({t('business_rules.components.conditionBuilder.ruleCount', { count: value.rules.length })})\n </span>\n )}\n </div>\n\n {/* Debug Toggle */}\n {showJsonPreview && value && (\n <button\n type=\"button\"\n onClick={() => setShowDebug(!showDebug)}\n className=\"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground\"\n title={t('business_rules.components.conditionBuilder.jsonPreview.toggle')}\n >\n <Code className=\"w-3 h-3\" />\n {showDebug\n ? t('business_rules.components.conditionBuilder.jsonPreview.hide')\n : t('business_rules.components.conditionBuilder.jsonPreview.show')\n }\n </button>\n )}\n </div>\n\n {/* Empty State */}\n {!value || !value.rules || value.rules.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center p-8 border-2 border-dashed border-border rounded-lg bg-muted\">\n <p className=\"text-sm text-muted-foreground mb-4\">\n {t('business_rules.components.conditionBuilder.emptyMessage')}\n </p>\n <Button type=\"button\" onClick={handleInitialize} variant=\"outline\" size=\"sm\">\n <Plus className=\"w-4 h-4 mr-2\" />\n {t('business_rules.components.conditionBuilder.addFirstCondition')}\n </Button>\n </div>\n ) : (\n <>\n {/* Condition Tree */}\n <ConditionGroup\n group={value}\n onChange={handleChange}\n depth={0}\n maxDepth={maxDepth}\n entityType={entityType}\n />\n\n {/* Clear Button */}\n <div className=\"flex justify-end\">\n <Button type=\"button\" onClick={handleClear} variant=\"outline\" size=\"sm\" className=\"text-status-error-text\">\n {t('business_rules.components.conditionBuilder.clearAll')}\n </Button>\n </div>\n </>\n )}\n\n {/* Validation Errors */}\n {!validation.valid && (\n <div className=\"p-3 bg-status-error-bg border border-status-error-border rounded\">\n <p className=\"text-sm font-medium text-status-error-text mb-1\">\n {t('business_rules.components.conditionBuilder.validationErrors')}\n </p>\n <ul className=\"list-disc list-inside space-y-0.5\">\n {validation.errors.map((err, index) => (\n <li key={index} className=\"text-xs text-status-error-text\">\n {err}\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {/* External Error */}\n {error && (\n <div className=\"p-3 bg-status-error-bg border border-status-error-border rounded\">\n <p className=\"text-sm text-status-error-text\">{error}</p>\n </div>\n )}\n\n {/* JSON Preview */}\n {showDebug && value && (\n <div className=\"p-3 bg-zinc-900 dark:bg-zinc-950 rounded text-xs font-mono overflow-x-auto border border-border\">\n <pre className=\"text-zinc-100\">{JSON.stringify(value, null, 2)}</pre>\n </div>\n )}\n\n {/* Help Text */}\n <div className=\"text-xs text-muted-foreground space-y-1\">\n <p>\n <strong>{t('business_rules.components.conditionBuilder.help.fieldPaths')}</strong>{' '}\n {t('business_rules.components.conditionBuilder.help.fieldPathsDescription')}\n </p>\n <p>\n <strong>{t('business_rules.components.conditionBuilder.help.values')}</strong>{' '}\n {t('business_rules.components.conditionBuilder.help.valuesDescription')}\n </p>\n <p>\n <strong>{t('business_rules.components.conditionBuilder.help.fieldComparison')}</strong>{' '}\n {t('business_rules.components.conditionBuilder.help.fieldComparisonDescription')}\n </p>\n </div>\n {ConfirmDialogElement}\n </div>\n )\n}\n"],
5
+ "mappings": ";AAyEU,SAuCF,UAvCE,KAIE,YAJF;AAvEV,YAAY,WAAW;AACvB,SAAS,cAAc;AACvB,SAAS,MAAM,YAAY;AAC3B,SAAS,sBAAsB;AAE/B,SAAS,mCAAmC;AAC5C,SAAS,YAAY;AACrB,SAAS,wBAAwB;AAW1B,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA,kBAAkB;AACpB,GAA0B;AACxB,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,SAAS,eAAe,qBAAqB,IAAI,iBAAiB;AAC1E,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,KAAK;AAEtD,QAAM,mBAAmB,MAAM;AAC7B,UAAM,eAA+B;AAAA,MACnC,UAAU;AAAA,MACV,OAAO;AAAA,QACL;AAAA,UACE,OAAO;AAAA,UACP,UAAU;AAAA,UACV,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AACA,mBAAe,YAAY;AAAA,EAC7B;AAEA,QAAM,eAAe,CAAC,iBAAiC;AACrD,mBAAe,YAAY;AAAA,EAC7B;AAEA,QAAM,cA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
7
7
  }
@@ -85,7 +85,7 @@ function ConditionGroup({ group, onChange, onDelete, depth, maxDepth = 5, entity
85
85
  {
86
86
  value: group.operator,
87
87
  onChange: handleOperatorChange,
88
- className: "px-3 py-1.5 text-sm font-semibold border border-border rounded bg-card focus:outline-none focus:ring-2 focus:ring-blue-500",
88
+ className: "px-3 py-1.5 text-sm font-semibold border border-border rounded bg-card focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
89
89
  children: logicalOperators.map((op) => /* @__PURE__ */ jsx("option", { value: op.value, children: op.label }, op.value))
90
90
  }
91
91
  ),
@@ -99,7 +99,7 @@ function ConditionGroup({ group, onChange, onDelete, depth, maxDepth = 5, entity
99
99
  {
100
100
  type: "button",
101
101
  onClick: onDelete,
102
- className: "ml-auto p-1 text-muted-foreground hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors",
102
+ className: "ml-auto p-1 text-muted-foreground hover:text-status-error-text hover:bg-status-error-bg rounded transition-colors",
103
103
  title: t("business_rules.components.conditionGroup.deleteGroup"),
104
104
  children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
105
105
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/modules/business_rules/components/ConditionGroup.tsx"],
4
- "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { Plus, X } from 'lucide-react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { ConditionRow } from './ConditionRow'\nimport type { GroupCondition, ConditionExpression, SimpleCondition } from './utils/conditionValidation'\nimport type { LogicalOperator } from './../data/validators'\nimport { isGroupCondition, getLogicalOperators } from './utils/conditionValidation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\nexport type ConditionGroupProps = {\n group: GroupCondition\n onChange: (group: GroupCondition) => void\n onDelete?: () => void\n depth: number\n maxDepth?: number\n entityType?: string\n}\n\nconst DEPTH_COLORS = [\n 'border-blue-300 bg-blue-50 dark:border-blue-700 dark:bg-blue-950/50',\n 'border-green-300 bg-green-50 dark:border-green-700 dark:bg-green-950/50',\n 'border-purple-300 bg-purple-50 dark:border-purple-700 dark:bg-purple-950/50',\n 'border-orange-300 bg-orange-50 dark:border-orange-700 dark:bg-orange-950/50',\n 'border-pink-300 bg-pink-50 dark:border-pink-700 dark:bg-pink-950/50',\n]\n\nexport function ConditionGroup({ group, onChange, onDelete, depth, maxDepth = 5, entityType }: ConditionGroupProps) {\n const t = useT()\n const logicalOperators = getLogicalOperators(t)\n const colorClass = DEPTH_COLORS[depth % DEPTH_COLORS.length]\n\n const handleOperatorChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n onChange({\n ...group,\n operator: e.target.value as LogicalOperator,\n })\n }\n\n const handleRuleChange = (index: number, updatedRule: ConditionExpression) => {\n const newRules = [...group.rules]\n newRules[index] = updatedRule\n onChange({\n ...group,\n rules: newRules,\n })\n }\n\n const handleDeleteRule = (index: number) => {\n const newRules = group.rules.filter((_, i) => i !== index)\n if (newRules.length === 0) {\n // If no rules left, delete the group itself\n onDelete?.()\n } else {\n onChange({\n ...group,\n rules: newRules,\n })\n }\n }\n\n const addSimpleCondition = () => {\n const newCondition: SimpleCondition = {\n field: '',\n operator: '=',\n value: null,\n }\n onChange({\n ...group,\n rules: [...group.rules, newCondition],\n })\n }\n\n const addConditionGroup = () => {\n if (depth >= maxDepth) {\n alert(t('business_rules.components.conditionGroup.maxDepthReached', { maxDepth }))\n return\n }\n\n const newGroup: GroupCondition = {\n operator: 'AND',\n rules: [\n {\n field: '',\n operator: '=',\n value: null,\n },\n ],\n }\n onChange({\n ...group,\n rules: [...group.rules, newGroup],\n })\n }\n\n return (\n <div\n className={`p-3 rounded border-2 ${colorClass}`}\n style={{ marginLeft: depth > 0 ? `${depth * 16}px` : '0' }}\n >\n {/* Group Header */}\n <div className=\"flex items-center gap-2 mb-3\">\n <span className=\"text-xs font-medium text-muted-foreground\">\n {t('business_rules.components.conditionGroup.group', { depth: depth + 1 })}\n </span>\n <select\n value={group.operator}\n onChange={handleOperatorChange}\n className=\"px-3 py-1.5 text-sm font-semibold border border-border rounded bg-card focus:outline-none focus:ring-2 focus:ring-blue-500\"\n >\n {logicalOperators.map((op) => (\n <option key={op.value} value={op.value}>\n {op.label}\n </option>\n ))}\n </select>\n\n <span className=\"text-xs text-muted-foreground\">\n ({t('business_rules.components.conditionGroup.ruleCount', { count: group.rules.length })})\n </span>\n\n {onDelete && (\n <button\n type=\"button\"\n onClick={onDelete}\n className=\"ml-auto p-1 text-muted-foreground hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors\"\n title={t('business_rules.components.conditionGroup.deleteGroup')}\n >\n <X className=\"w-4 h-4\" />\n </button>\n )}\n </div>\n\n {/* Rules */}\n <div className=\"space-y-2\">\n {group.rules.map((rule, index) => (\n <div key={index}>\n {isGroupCondition(rule) ? (\n // Recursive: Nested Group\n <ConditionGroup\n group={rule}\n onChange={(updatedGroup) => handleRuleChange(index, updatedGroup)}\n onDelete={() => handleDeleteRule(index)}\n depth={depth + 1}\n maxDepth={maxDepth}\n entityType={entityType}\n />\n ) : (\n // Base Case: Simple Condition\n <ConditionRow\n condition={rule}\n onChange={(updatedCondition) => handleRuleChange(index, updatedCondition)}\n onDelete={() => handleDeleteRule(index)}\n entityType={entityType}\n />\n )}\n </div>\n ))}\n </div>\n\n {/* Add Buttons */}\n <div className=\"flex gap-2 mt-3\">\n <Button\n type=\"button\"\n onClick={addSimpleCondition}\n variant=\"outline\"\n size=\"sm\"\n className=\"text-xs\"\n >\n <Plus className=\"w-3 h-3 mr-1\" />\n {t('business_rules.components.conditionGroup.addCondition')}\n </Button>\n\n {depth < maxDepth && (\n <Button\n type=\"button\"\n onClick={addConditionGroup}\n variant=\"outline\"\n size=\"sm\"\n className=\"text-xs\"\n >\n <Plus className=\"w-3 h-3 mr-1\" />\n {t('business_rules.components.conditionGroup.addGroup', { depth: depth + 2 })}\n </Button>\n )}\n </div>\n </div>\n )\n}\n"],
4
+ "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { Plus, X } from 'lucide-react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { ConditionRow } from './ConditionRow'\nimport type { GroupCondition, ConditionExpression, SimpleCondition } from './utils/conditionValidation'\nimport type { LogicalOperator } from './../data/validators'\nimport { isGroupCondition, getLogicalOperators } from './utils/conditionValidation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\nexport type ConditionGroupProps = {\n group: GroupCondition\n onChange: (group: GroupCondition) => void\n onDelete?: () => void\n depth: number\n maxDepth?: number\n entityType?: string\n}\n\nconst DEPTH_COLORS = [\n 'border-blue-300 bg-blue-50 dark:border-blue-700 dark:bg-blue-950/50',\n 'border-green-300 bg-green-50 dark:border-green-700 dark:bg-green-950/50',\n 'border-purple-300 bg-purple-50 dark:border-purple-700 dark:bg-purple-950/50',\n 'border-orange-300 bg-orange-50 dark:border-orange-700 dark:bg-orange-950/50',\n 'border-pink-300 bg-pink-50 dark:border-pink-700 dark:bg-pink-950/50',\n]\n\nexport function ConditionGroup({ group, onChange, onDelete, depth, maxDepth = 5, entityType }: ConditionGroupProps) {\n const t = useT()\n const logicalOperators = getLogicalOperators(t)\n const colorClass = DEPTH_COLORS[depth % DEPTH_COLORS.length]\n\n const handleOperatorChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n onChange({\n ...group,\n operator: e.target.value as LogicalOperator,\n })\n }\n\n const handleRuleChange = (index: number, updatedRule: ConditionExpression) => {\n const newRules = [...group.rules]\n newRules[index] = updatedRule\n onChange({\n ...group,\n rules: newRules,\n })\n }\n\n const handleDeleteRule = (index: number) => {\n const newRules = group.rules.filter((_, i) => i !== index)\n if (newRules.length === 0) {\n // If no rules left, delete the group itself\n onDelete?.()\n } else {\n onChange({\n ...group,\n rules: newRules,\n })\n }\n }\n\n const addSimpleCondition = () => {\n const newCondition: SimpleCondition = {\n field: '',\n operator: '=',\n value: null,\n }\n onChange({\n ...group,\n rules: [...group.rules, newCondition],\n })\n }\n\n const addConditionGroup = () => {\n if (depth >= maxDepth) {\n alert(t('business_rules.components.conditionGroup.maxDepthReached', { maxDepth }))\n return\n }\n\n const newGroup: GroupCondition = {\n operator: 'AND',\n rules: [\n {\n field: '',\n operator: '=',\n value: null,\n },\n ],\n }\n onChange({\n ...group,\n rules: [...group.rules, newGroup],\n })\n }\n\n return (\n <div\n className={`p-3 rounded border-2 ${colorClass}`}\n style={{ marginLeft: depth > 0 ? `${depth * 16}px` : '0' }}\n >\n {/* Group Header */}\n <div className=\"flex items-center gap-2 mb-3\">\n <span className=\"text-xs font-medium text-muted-foreground\">\n {t('business_rules.components.conditionGroup.group', { depth: depth + 1 })}\n </span>\n <select\n value={group.operator}\n onChange={handleOperatorChange}\n className=\"px-3 py-1.5 text-sm font-semibold border border-border rounded bg-card focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {logicalOperators.map((op) => (\n <option key={op.value} value={op.value}>\n {op.label}\n </option>\n ))}\n </select>\n\n <span className=\"text-xs text-muted-foreground\">\n ({t('business_rules.components.conditionGroup.ruleCount', { count: group.rules.length })})\n </span>\n\n {onDelete && (\n <button\n type=\"button\"\n onClick={onDelete}\n className=\"ml-auto p-1 text-muted-foreground hover:text-status-error-text hover:bg-status-error-bg rounded transition-colors\"\n title={t('business_rules.components.conditionGroup.deleteGroup')}\n >\n <X className=\"w-4 h-4\" />\n </button>\n )}\n </div>\n\n {/* Rules */}\n <div className=\"space-y-2\">\n {group.rules.map((rule, index) => (\n <div key={index}>\n {isGroupCondition(rule) ? (\n // Recursive: Nested Group\n <ConditionGroup\n group={rule}\n onChange={(updatedGroup) => handleRuleChange(index, updatedGroup)}\n onDelete={() => handleDeleteRule(index)}\n depth={depth + 1}\n maxDepth={maxDepth}\n entityType={entityType}\n />\n ) : (\n // Base Case: Simple Condition\n <ConditionRow\n condition={rule}\n onChange={(updatedCondition) => handleRuleChange(index, updatedCondition)}\n onDelete={() => handleDeleteRule(index)}\n entityType={entityType}\n />\n )}\n </div>\n ))}\n </div>\n\n {/* Add Buttons */}\n <div className=\"flex gap-2 mt-3\">\n <Button\n type=\"button\"\n onClick={addSimpleCondition}\n variant=\"outline\"\n size=\"sm\"\n className=\"text-xs\"\n >\n <Plus className=\"w-3 h-3 mr-1\" />\n {t('business_rules.components.conditionGroup.addCondition')}\n </Button>\n\n {depth < maxDepth && (\n <Button\n type=\"button\"\n onClick={addConditionGroup}\n variant=\"outline\"\n size=\"sm\"\n className=\"text-xs\"\n >\n <Plus className=\"w-3 h-3 mr-1\" />\n {t('business_rules.components.conditionGroup.addGroup', { depth: depth + 2 })}\n </Button>\n )}\n </div>\n </div>\n )\n}\n"],
5
5
  "mappings": ";AAuGQ,cAeA,YAfA;AApGR,SAAS,MAAM,SAAS;AACxB,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAG7B,SAAS,kBAAkB,2BAA2B;AACtD,SAAS,YAAY;AAWrB,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAAS,eAAe,EAAE,OAAO,UAAU,UAAU,OAAO,WAAW,GAAG,WAAW,GAAwB;AAClH,QAAM,IAAI,KAAK;AACf,QAAM,mBAAmB,oBAAoB,CAAC;AAC9C,QAAM,aAAa,aAAa,QAAQ,aAAa,MAAM;AAE3D,QAAM,uBAAuB,CAAC,MAA4C;AACxE,aAAS;AAAA,MACP,GAAG;AAAA,MACH,UAAU,EAAE,OAAO;AAAA,IACrB,CAAC;AAAA,EACH;AAEA,QAAM,mBAAmB,CAAC,OAAe,gBAAqC;AAC5E,UAAM,WAAW,CAAC,GAAG,MAAM,KAAK;AAChC,aAAS,KAAK,IAAI;AAClB,aAAS;AAAA,MACP,GAAG;AAAA,MACH,OAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,QAAM,mBAAmB,CAAC,UAAkB;AAC1C,UAAM,WAAW,MAAM,MAAM,OAAO,CAAC,GAAG,MAAM,MAAM,KAAK;AACzD,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EAAE,qDAAqD,EAAE,OAAO,QAAQ,EAAE,CAAC;AAAA;AAAA;AAAA,UAC9E;AAAA,WAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -51,7 +51,7 @@ function ConditionRow({ condition, onChange, onDelete, error }) {
51
51
  value: condition.field || "",
52
52
  onChange: handleFieldChange,
53
53
  placeholder: t("business_rules.components.conditionRow.field.placeholder"),
54
- className: `w-full px-2 py-1.5 text-sm border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500 ${fieldError ? "border-red-500" : "border-border"}`
54
+ className: `w-full px-2 py-1.5 text-sm border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${fieldError ? "border-red-500" : "border-border"}`
55
55
  }
56
56
  ),
57
57
  fieldError && /* @__PURE__ */ jsx("p", { className: "text-xs text-red-600 mt-0.5", children: t("business_rules.components.conditionRow.field.invalidPath") })
@@ -63,7 +63,7 @@ function ConditionRow({ condition, onChange, onDelete, error }) {
63
63
  {
64
64
  value: condition.operator || "=",
65
65
  onChange: handleOperatorChange,
66
- className: "w-full px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500",
66
+ className: "w-full px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
67
67
  children: operators.map((op) => /* @__PURE__ */ jsx("option", { value: op.value, children: op.label }, op.value))
68
68
  }
69
69
  )
@@ -89,7 +89,7 @@ function ConditionRow({ condition, onChange, onDelete, error }) {
89
89
  value: useFieldComparison ? condition.valueField || "" : condition.value === null || condition.value === void 0 ? "" : typeof condition.value === "string" ? condition.value : JSON.stringify(condition.value),
90
90
  onChange: useFieldComparison ? handleValueFieldChange : handleValueChange,
91
91
  placeholder: useFieldComparison ? t("business_rules.components.conditionRow.field.comparisonPlaceholder") : t("business_rules.components.conditionRow.value.placeholder"),
92
- className: "w-full px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500"
92
+ className: "w-full px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
93
93
  }
94
94
  ),
95
95
  /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: useFieldComparison ? t("business_rules.components.conditionRow.field.comparisonHelp") : t("business_rules.components.conditionRow.value.help") })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/modules/business_rules/components/ConditionRow.tsx"],
4
- "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { X } from 'lucide-react'\nimport type { SimpleCondition } from './utils/conditionValidation'\nimport { getComparisonOperators, isValidFieldPath } from './utils/conditionValidation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\nexport type ConditionRowProps = {\n condition: SimpleCondition\n onChange: (condition: SimpleCondition) => void\n onDelete: () => void\n entityType?: string\n error?: string\n}\n\nexport function ConditionRow({ condition, onChange, onDelete, error }: ConditionRowProps) {\n const t = useT()\n const operators = getComparisonOperators(t)\n const [useFieldComparison, setUseFieldComparison] = React.useState(!!condition.valueField)\n\n const handleFieldChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange({ ...condition, field: e.target.value })\n }\n\n const handleOperatorChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n onChange({ ...condition, operator: e.target.value as any })\n }\n\n const handleValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const rawValue = e.target.value\n\n // Try to parse as JSON for arrays/objects\n let parsedValue: any = rawValue\n if (rawValue.trim().startsWith('[') || rawValue.trim().startsWith('{')) {\n try {\n parsedValue = JSON.parse(rawValue)\n } catch {\n // Keep as string if not valid JSON\n parsedValue = rawValue\n }\n }\n\n onChange({ ...condition, value: parsedValue, valueField: undefined })\n }\n\n const handleValueFieldChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange({ ...condition, valueField: e.target.value, value: null })\n }\n\n const toggleFieldComparison = () => {\n if (useFieldComparison) {\n onChange({ ...condition, valueField: undefined, value: null })\n setUseFieldComparison(false)\n } else {\n onChange({ ...condition, value: null, valueField: '' })\n setUseFieldComparison(true)\n }\n }\n\n // Operators that don't need a value\n const operatorNeedsValue = !['IS_EMPTY', 'IS_NOT_EMPTY'].includes(condition.operator)\n\n const fieldError = condition.field && !isValidFieldPath(condition.field)\n\n return (\n <div className=\"flex items-start gap-2 p-3 bg-muted rounded border border-border\">\n <div className=\"flex-1 grid grid-cols-1 md:grid-cols-3 gap-2\">\n {/* Field Input */}\n <div>\n <label className=\"block text-xs font-medium text-foreground mb-1\">\n {t('business_rules.components.conditionRow.field')}\n </label>\n <input\n type=\"text\"\n value={condition.field || ''}\n onChange={handleFieldChange}\n placeholder={t('business_rules.components.conditionRow.field.placeholder')}\n className={`w-full px-2 py-1.5 text-sm border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500 ${\n fieldError ? 'border-red-500' : 'border-border'\n }`}\n />\n {fieldError && (\n <p className=\"text-xs text-red-600 mt-0.5\">\n {t('business_rules.components.conditionRow.field.invalidPath')}\n </p>\n )}\n </div>\n\n {/* Operator Select */}\n <div>\n <label className=\"block text-xs font-medium text-foreground mb-1\">\n {t('business_rules.components.conditionRow.operator')}\n </label>\n <select\n value={condition.operator || '='}\n onChange={handleOperatorChange}\n className=\"w-full px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500\"\n >\n {operators.map((op) => (\n <option key={op.value} value={op.value}>\n {op.label}\n </option>\n ))}\n </select>\n </div>\n\n {/* Value Input */}\n {operatorNeedsValue && (\n <div>\n <div className=\"flex items-center justify-between mb-1\">\n <label className=\"block text-xs font-medium text-foreground\">\n {useFieldComparison\n ? t('business_rules.components.conditionRow.compareToField')\n : t('business_rules.components.conditionRow.value')\n }\n </label>\n <button\n type=\"button\"\n onClick={toggleFieldComparison}\n className=\"text-xs text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300\"\n title={t('business_rules.components.conditionRow.toggleFieldComparison')}\n >\n {useFieldComparison\n ? t('business_rules.components.conditionRow.useValue')\n : t('business_rules.components.conditionRow.useField')\n }\n </button>\n </div>\n <input\n type=\"text\"\n value={\n useFieldComparison\n ? (condition.valueField || '')\n : (condition.value === null || condition.value === undefined)\n ? ''\n : typeof condition.value === 'string'\n ? condition.value\n : JSON.stringify(condition.value)\n }\n onChange={useFieldComparison ? handleValueFieldChange : handleValueChange}\n placeholder={useFieldComparison\n ? t('business_rules.components.conditionRow.field.comparisonPlaceholder')\n : t('business_rules.components.conditionRow.value.placeholder')\n }\n className=\"w-full px-2 py-1.5 text-sm border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500\"\n />\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {useFieldComparison\n ? t('business_rules.components.conditionRow.field.comparisonHelp')\n : t('business_rules.components.conditionRow.value.help')\n }\n </p>\n </div>\n )}\n </div>\n\n {/* Delete Button */}\n <button\n type=\"button\"\n onClick={onDelete}\n className=\"p-1.5 text-muted-foreground hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors\"\n title={t('business_rules.components.conditionRow.deleteCondition')}\n >\n <X className=\"w-4 h-4\" />\n </button>\n\n {/* Error Display */}\n {error && (\n <div className=\"col-span-full mt-2\">\n <p className=\"text-xs text-red-600\">{error}</p>\n </div>\n )}\n </div>\n )\n}\n"],
5
- "mappings": ";AAsEQ,SACE,KADF;AApER,YAAY,WAAW;AAEvB,SAAS,SAAS;AAElB,SAAS,wBAAwB,wBAAwB;AACzD,SAAS,YAAY;AAUd,SAAS,aAAa,EAAE,WAAW,UAAU,UAAU,MAAM,GAAsB;AACxF,QAAM,IAAI,KAAK;AACf,QAAM,YAAY,uBAAuB,CAAC;AAC1C,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,MAAM,SAAS,CAAC,CAAC,UAAU,UAAU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D,EAAE,mDAAmD,GAE3D;AAAA,SACF;AAAA,OAEJ;AAAA,IAGA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,WAAU;AAAA,QACV,OAAO,EAAE,wDAAwD;AAAA,QAEjE,8BAAC,KAAE,WAAU,WAAU;AAAA;AAAA,IACzB;AAAA,IAGC,SACC,oBAAC,SAAI,WAAU,sBACb,8BAAC,OAAE,WAAU,wBAAwB,iBAAM,GAC7C;AAAA,KAEJ;AAEJ;",
4
+ "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { X } from 'lucide-react'\nimport type { SimpleCondition } from './utils/conditionValidation'\nimport { getComparisonOperators, isValidFieldPath } from './utils/conditionValidation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\nexport type ConditionRowProps = {\n condition: SimpleCondition\n onChange: (condition: SimpleCondition) => void\n onDelete: () => void\n entityType?: string\n error?: string\n}\n\nexport function ConditionRow({ condition, onChange, onDelete, error }: ConditionRowProps) {\n const t = useT()\n const operators = getComparisonOperators(t)\n const [useFieldComparison, setUseFieldComparison] = React.useState(!!condition.valueField)\n\n const handleFieldChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange({ ...condition, field: e.target.value })\n }\n\n const handleOperatorChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n onChange({ ...condition, operator: e.target.value as any })\n }\n\n const handleValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const rawValue = e.target.value\n\n // Try to parse as JSON for arrays/objects\n let parsedValue: any = rawValue\n if (rawValue.trim().startsWith('[') || rawValue.trim().startsWith('{')) {\n try {\n parsedValue = JSON.parse(rawValue)\n } catch {\n // Keep as string if not valid JSON\n parsedValue = rawValue\n }\n }\n\n onChange({ ...condition, value: parsedValue, valueField: undefined })\n }\n\n const handleValueFieldChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange({ ...condition, valueField: e.target.value, value: null })\n }\n\n const toggleFieldComparison = () => {\n if (useFieldComparison) {\n onChange({ ...condition, valueField: undefined, value: null })\n setUseFieldComparison(false)\n } else {\n onChange({ ...condition, value: null, valueField: '' })\n setUseFieldComparison(true)\n }\n }\n\n // Operators that don't need a value\n const operatorNeedsValue = !['IS_EMPTY', 'IS_NOT_EMPTY'].includes(condition.operator)\n\n const fieldError = condition.field && !isValidFieldPath(condition.field)\n\n return (\n <div className=\"flex items-start gap-2 p-3 bg-muted rounded border border-border\">\n <div className=\"flex-1 grid grid-cols-1 md:grid-cols-3 gap-2\">\n {/* Field Input */}\n <div>\n <label className=\"block text-xs font-medium text-foreground mb-1\">\n {t('business_rules.components.conditionRow.field')}\n </label>\n <input\n type=\"text\"\n value={condition.field || ''}\n onChange={handleFieldChange}\n placeholder={t('business_rules.components.conditionRow.field.placeholder')}\n className={`w-full px-2 py-1.5 text-sm border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${\n fieldError ? 'border-red-500' : 'border-border'\n }`}\n />\n {fieldError && (\n <p className=\"text-xs text-red-600 mt-0.5\">\n {t('business_rules.components.conditionRow.field.invalidPath')}\n </p>\n )}\n </div>\n\n {/* Operator Select */}\n <div>\n <label className=\"block text-xs font-medium text-foreground mb-1\">\n {t('business_rules.components.conditionRow.operator')}\n </label>\n <select\n value={condition.operator || '='}\n onChange={handleOperatorChange}\n className=\"w-full px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {operators.map((op) => (\n <option key={op.value} value={op.value}>\n {op.label}\n </option>\n ))}\n </select>\n </div>\n\n {/* Value Input */}\n {operatorNeedsValue && (\n <div>\n <div className=\"flex items-center justify-between mb-1\">\n <label className=\"block text-xs font-medium text-foreground\">\n {useFieldComparison\n ? t('business_rules.components.conditionRow.compareToField')\n : t('business_rules.components.conditionRow.value')\n }\n </label>\n <button\n type=\"button\"\n onClick={toggleFieldComparison}\n className=\"text-xs text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300\"\n title={t('business_rules.components.conditionRow.toggleFieldComparison')}\n >\n {useFieldComparison\n ? t('business_rules.components.conditionRow.useValue')\n : t('business_rules.components.conditionRow.useField')\n }\n </button>\n </div>\n <input\n type=\"text\"\n value={\n useFieldComparison\n ? (condition.valueField || '')\n : (condition.value === null || condition.value === undefined)\n ? ''\n : typeof condition.value === 'string'\n ? condition.value\n : JSON.stringify(condition.value)\n }\n onChange={useFieldComparison ? handleValueFieldChange : handleValueChange}\n placeholder={useFieldComparison\n ? t('business_rules.components.conditionRow.field.comparisonPlaceholder')\n : t('business_rules.components.conditionRow.value.placeholder')\n }\n className=\"w-full px-2 py-1.5 text-sm border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {useFieldComparison\n ? t('business_rules.components.conditionRow.field.comparisonHelp')\n : t('business_rules.components.conditionRow.value.help')\n }\n </p>\n </div>\n )}\n </div>\n\n {/* Delete Button */}\n <button\n type=\"button\"\n onClick={onDelete}\n className=\"p-1.5 text-muted-foreground hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors\"\n title={t('business_rules.components.conditionRow.deleteCondition')}\n >\n <X className=\"w-4 h-4\" />\n </button>\n\n {/* Error Display */}\n {error && (\n <div className=\"col-span-full mt-2\">\n <p className=\"text-xs text-red-600\">{error}</p>\n </div>\n )}\n </div>\n )\n}\n"],
5
+ "mappings": ";AAsEQ,SACE,KADF;AApER,YAAY,WAAW;AAEvB,SAAS,SAAS;AAElB,SAAS,wBAAwB,wBAAwB;AACzD,SAAS,YAAY;AAUd,SAAS,aAAa,EAAE,WAAW,UAAU,UAAU,MAAM,GAAsB;AACxF,QAAM,IAAI,KAAK;AACf,QAAM,YAAY,uBAAuB,CAAC;AAC1C,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,MAAM,SAAS,CAAC,CAAC,UAAU,UAA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/D,EAAE,mDAAmD,GAE3D;AAAA,SACF;AAAA,OAEJ;AAAA,IAGA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,WAAU;AAAA,QACV,OAAO,EAAE,wDAAwD;AAAA,QAEjE,8BAAC,KAAE,WAAU,WAAU;AAAA;AAAA,IACzB;AAAA,IAGC,SACC,oBAAC,SAAI,WAAU,sBACb,8BAAC,OAAE,WAAU,wBAAwB,iBAAM,GAC7C;AAAA,KAEJ;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -61,7 +61,7 @@ function RuleSetMembers({ members, onAdd, onUpdate, onRemove }) {
61
61
  {
62
62
  onClick: () => handleMoveUp(member, index),
63
63
  disabled: index === 0,
64
- className: "p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
64
+ className: "p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
65
65
  title: t("common.moveUp"),
66
66
  children: /* @__PURE__ */ jsx(ChevronUp, { className: "w-4 h-4" })
67
67
  }
@@ -71,13 +71,13 @@ function RuleSetMembers({ members, onAdd, onUpdate, onRemove }) {
71
71
  {
72
72
  onClick: () => handleMoveDown(member, index),
73
73
  disabled: index === members.length - 1,
74
- className: "p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
74
+ className: "p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
75
75
  title: t("common.moveDown"),
76
76
  children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-4 h-4" })
77
77
  }
78
78
  )
79
79
  ] }),
80
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-8 h-8 bg-blue-100 text-blue-700 rounded font-mono text-sm font-medium dark:bg-blue-900 dark:text-blue-300", children: member.sequence }),
80
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-8 h-8 bg-status-info-bg text-status-info-text rounded font-mono text-sm font-medium", children: member.sequence }),
81
81
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
82
82
  /* @__PURE__ */ jsx("div", { className: "font-medium", children: member.ruleName }),
83
83
  /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground font-mono", children: member.ruleId })
@@ -87,7 +87,7 @@ function RuleSetMembers({ members, onAdd, onUpdate, onRemove }) {
87
87
  "button",
88
88
  {
89
89
  onClick: () => handleToggleEnabled(member),
90
- className: `px-2 py-1 rounded text-xs font-medium cursor-pointer ${member.enabled ? "bg-green-100 text-green-800 hover:bg-green-200 dark:bg-green-900 dark:text-green-300 dark:hover:bg-green-800" : "bg-muted text-muted-foreground hover:bg-muted/80"}`,
90
+ className: `px-2 py-1 rounded text-xs font-medium cursor-pointer ${member.enabled ? "bg-status-success-bg text-status-success-text hover:bg-status-success-bg/80" : "bg-muted text-muted-foreground hover:bg-muted/50"}`,
91
91
  title: t("business_rules.sets.members.actions.toggleEnabled"),
92
92
  children: member.enabled ? t("common.enabled") : t("common.disabled")
93
93
  }
@@ -96,7 +96,7 @@ function RuleSetMembers({ members, onAdd, onUpdate, onRemove }) {
96
96
  "button",
97
97
  {
98
98
  onClick: () => onRemove(member.id, member.ruleName),
99
- className: "p-1.5 text-muted-foreground hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors",
99
+ className: "p-1.5 text-muted-foreground hover:text-status-error-text hover:bg-status-error-bg rounded transition-colors",
100
100
  title: t("common.remove"),
101
101
  children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
102
102
  }
@@ -105,7 +105,7 @@ function RuleSetMembers({ members, onAdd, onUpdate, onRemove }) {
105
105
  },
106
106
  member.id
107
107
  )) }),
108
- showAddForm ? /* @__PURE__ */ jsxs("div", { className: "p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded space-y-3", children: [
108
+ showAddForm ? /* @__PURE__ */ jsxs("div", { className: "p-4 bg-status-info-bg border border-status-info-border rounded space-y-3", children: [
109
109
  /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-3", children: [
110
110
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
111
111
  /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: t("business_rules.sets.members.form.selectRule") }),
@@ -114,7 +114,7 @@ function RuleSetMembers({ members, onAdd, onUpdate, onRemove }) {
114
114
  {
115
115
  value: selectedRuleId,
116
116
  onChange: (e) => setSelectedRuleId(e.target.value),
117
- className: "w-full px-3 py-2 border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500",
117
+ className: "w-full px-3 py-2 border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
118
118
  children: [
119
119
  /* @__PURE__ */ jsx("option", { value: "", children: t("business_rules.sets.members.form.selectRulePlaceholder") }),
120
120
  rulesNotInSet.map((rule) => /* @__PURE__ */ jsxs("option", { value: rule.id, children: [
@@ -136,7 +136,7 @@ function RuleSetMembers({ members, onAdd, onUpdate, onRemove }) {
136
136
  value: sequence,
137
137
  onChange: (e) => setSequence(parseInt(e.target.value) || 0),
138
138
  min: 0,
139
- className: "w-full px-3 py-2 border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500"
139
+ className: "w-full px-3 py-2 border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
140
140
  }
141
141
  )
142
142
  ] })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/modules/business_rules/components/RuleSetMembers.tsx"],
4
- "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Plus, ChevronUp, ChevronDown, X } from 'lucide-react'\nimport { useQuery } from '@tanstack/react-query'\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\ntype Member = {\n id: string\n ruleId: string\n ruleName: string\n ruleType: string\n sequence: number\n enabled: boolean\n}\n\ntype RuleOption = {\n id: string\n ruleId: string\n ruleName: string\n ruleType: string\n}\n\ntype RuleSetMembersProps = {\n members: Member[]\n onAdd: (ruleId: string, sequence: number) => Promise<void>\n onUpdate: (memberId: string, updates: { sequence?: number; enabled?: boolean }) => Promise<void>\n onRemove: (memberId: string, ruleName: string) => Promise<void>\n}\n\nexport function RuleSetMembers({ members, onAdd, onUpdate, onRemove }: RuleSetMembersProps) {\n const t = useT()\n const [showAddForm, setShowAddForm] = React.useState(false)\n const [selectedRuleId, setSelectedRuleId] = React.useState('')\n const [sequence, setSequence] = React.useState(0)\n\n // Fetch available rules\n const { data: availableRules } = useQuery({\n queryKey: ['business-rules', 'rules-list'],\n queryFn: async () => {\n const result = await apiCall<{ items: RuleOption[] }>(\n '/api/business_rules/rules?page=1&pageSize=100&sortField=ruleName&sortDir=asc'\n )\n if (!result.ok) {\n throw new Error('Failed to fetch rules')\n }\n return result.result?.items || []\n },\n })\n\n // Filter out already added rules (memoized to avoid re-computation on every render)\n const rulesNotInSet = React.useMemo(() => {\n const memberRuleIds = new Set(members.map(m => m.ruleId))\n return availableRules?.filter(r => !memberRuleIds.has(r.id)) || []\n }, [members, availableRules])\n\n const handleAdd = async () => {\n if (!selectedRuleId) return\n await onAdd(selectedRuleId, sequence)\n setSelectedRuleId('')\n setSequence(0)\n setShowAddForm(false)\n }\n\n const handleMoveUp = async (member: Member, index: number) => {\n if (index === 0) return\n const prevMember = members[index - 1]\n // Swap sequences\n await onUpdate(member.id, { sequence: prevMember.sequence })\n await onUpdate(prevMember.id, { sequence: member.sequence })\n }\n\n const handleMoveDown = async (member: Member, index: number) => {\n if (index === members.length - 1) return\n const nextMember = members[index + 1]\n // Swap sequences\n await onUpdate(member.id, { sequence: nextMember.sequence })\n await onUpdate(nextMember.id, { sequence: member.sequence })\n }\n\n const handleToggleEnabled = async (member: Member) => {\n await onUpdate(member.id, { enabled: !member.enabled })\n }\n\n return (\n <div className=\"space-y-4\">\n {/* Members List */}\n {members.length === 0 ? (\n <div className=\"text-center py-8 text-muted-foreground\">\n <p>{t('business_rules.sets.members.empty')}</p>\n </div>\n ) : (\n <div className=\"space-y-2\">\n {members.map((member, index) => (\n <div\n key={member.id}\n className=\"flex items-center gap-3 p-3 bg-muted rounded border border-border\"\n >\n {/* Order Controls */}\n <div className=\"flex flex-col gap-1\">\n <button\n onClick={() => handleMoveUp(member, index)}\n disabled={index === 0}\n className=\"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed\"\n title={t('common.moveUp')}\n >\n <ChevronUp className=\"w-4 h-4\" />\n </button>\n <button\n onClick={() => handleMoveDown(member, index)}\n disabled={index === members.length - 1}\n className=\"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed\"\n title={t('common.moveDown')}\n >\n <ChevronDown className=\"w-4 h-4\" />\n </button>\n </div>\n\n {/* Sequence Number */}\n <div className=\"flex items-center justify-center w-8 h-8 bg-blue-100 text-blue-700 rounded font-mono text-sm font-medium dark:bg-blue-900 dark:text-blue-300\">\n {member.sequence}\n </div>\n\n {/* Rule Info */}\n <div className=\"flex-1\">\n <div className=\"font-medium\">{member.ruleName}</div>\n <div className=\"text-xs text-muted-foreground font-mono\">{member.ruleId}</div>\n </div>\n\n {/* Rule Type Badge */}\n <div className=\"px-2 py-1 bg-muted text-muted-foreground text-xs rounded font-medium\">\n {member.ruleType}\n </div>\n\n {/* Enabled Toggle */}\n <button\n onClick={() => handleToggleEnabled(member)}\n className={`px-2 py-1 rounded text-xs font-medium cursor-pointer ${\n member.enabled\n ? 'bg-green-100 text-green-800 hover:bg-green-200 dark:bg-green-900 dark:text-green-300 dark:hover:bg-green-800'\n : 'bg-muted text-muted-foreground hover:bg-muted/80'\n }`}\n title={t('business_rules.sets.members.actions.toggleEnabled')}\n >\n {member.enabled ? t('common.enabled') : t('common.disabled')}\n </button>\n\n {/* Remove Button */}\n <button\n onClick={() => onRemove(member.id, member.ruleName)}\n className=\"p-1.5 text-muted-foreground hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors\"\n title={t('common.remove')}\n >\n <X className=\"w-4 h-4\" />\n </button>\n </div>\n ))}\n </div>\n )}\n\n {/* Add Rule Form */}\n {showAddForm ? (\n <div className=\"p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded space-y-3\">\n <div className=\"flex items-end gap-3\">\n <div className=\"flex-1\">\n <label className=\"block text-sm font-medium text-foreground mb-1\">\n {t('business_rules.sets.members.form.selectRule')}\n </label>\n <select\n value={selectedRuleId}\n onChange={(e) => setSelectedRuleId(e.target.value)}\n className=\"w-full px-3 py-2 border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500\"\n >\n <option value=\"\">{t('business_rules.sets.members.form.selectRulePlaceholder')}</option>\n {rulesNotInSet.map((rule) => (\n <option key={rule.id} value={rule.id}>\n {rule.ruleName} ({rule.ruleId})\n </option>\n ))}\n </select>\n </div>\n\n <div className=\"w-32\">\n <label className=\"block text-sm font-medium text-foreground mb-1\">\n {t('business_rules.sets.members.form.sequence')}\n </label>\n <input\n type=\"number\"\n value={sequence}\n onChange={(e) => setSequence(parseInt(e.target.value) || 0)}\n min={0}\n className=\"w-full px-3 py-2 border border-border rounded bg-background focus:outline-none focus:ring-2 focus:ring-blue-500\"\n />\n </div>\n </div>\n\n <div className=\"flex gap-2\">\n <Button onClick={handleAdd} disabled={!selectedRuleId} size=\"sm\">\n {t('business_rules.sets.members.actions.add')}\n </Button>\n <Button\n onClick={() => {\n setShowAddForm(false)\n setSelectedRuleId('')\n setSequence(0)\n }}\n variant=\"outline\"\n size=\"sm\"\n >\n {t('common.cancel')}\n </Button>\n </div>\n </div>\n ) : (\n <Button onClick={() => setShowAddForm(true)} variant=\"outline\" size=\"sm\">\n <Plus className=\"w-4 h-4 mr-2\" />\n {t('business_rules.sets.members.actions.addRule')}\n </Button>\n )}\n\n {/* Help Text */}\n <div className=\"text-xs text-muted-foreground space-y-1\">\n <p>\n <strong>{t('business_rules.sets.members.help.ordering')}:</strong>{' '}\n {t('business_rules.sets.members.help.orderingDescription')}\n </p>\n <p>\n <strong>{t('business_rules.sets.members.help.enabled')}:</strong>{' '}\n {t('business_rules.sets.members.help.enabledDescription')}\n </p>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": ";AA2FU,cAUI,YAVJ;AAzFV,YAAY,WAAW;AACvB,SAAS,cAAc;AACvB,SAAS,MAAM,WAAW,aAAa,SAAS;AAChD,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,YAAY;AAyBd,SAAS,eAAe,EAAE,SAAS,OAAO,UAAU,SAAS,GAAwB;AAC1F,QAAM,IAAI,KAAK;AACf,QAAM,CAAC,aAAa,cAAc,IAAI,MAAM,SAAS,KAAK;AAC1D,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,MAAM,SAAS,EAAE;AAC7D,QAAM,CAAC,UAAU,WAAW,IAAI,MAAM,SAAS,CAAC;AAGhD,QAAM,EAAE,MAAM,eAAe,IAAI,SAAS;AAAA,IACxC,UAAU,CAAC,kBAAkB,YAAY;AAAA,IACzC,SAAS,YAAY;AACnB,YAAM,SAAS,MAAM;AAAA,QACnB;AAAA,MACF;AACA,UAAI,CAAC,OAAO,IAAI;AACd,cAAM,IAAI,MAAM,uBAAuB;AAAA,MACzC;AACA,aAAO,OAAO,QAAQ,SAAS,CAAC;AAAA,IAClC;AAAA,EACF,CAAC;AAGD,QAAM,gBAAgB,MAAM,QAAQ,MAAM;AACxC,UAAM,gBAAgB,IAAI,IAAI,QAAQ,IAAI,OAAK,EAAE,MAAM,CAAC;AACxD,WAAO,gBAAgB,OAAO,OAAK,CAAC,cAAc,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC;AAAA,EACnE,GAA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;AAAA,MACA,qBAAC,OACC;AAAA,6BAAC,YAAQ;AAAA,YAAE,0CAA0C;AAAA,UAAE;AAAA,WAAC;AAAA,QAAU;AAAA,QACjE,EAAE,qDAAqD;AAAA,SAC1D;AAAA,OACF;AAAA,KACF;AAEJ;",
4
+ "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Plus, ChevronUp, ChevronDown, X } from 'lucide-react'\nimport { useQuery } from '@tanstack/react-query'\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\ntype Member = {\n id: string\n ruleId: string\n ruleName: string\n ruleType: string\n sequence: number\n enabled: boolean\n}\n\ntype RuleOption = {\n id: string\n ruleId: string\n ruleName: string\n ruleType: string\n}\n\ntype RuleSetMembersProps = {\n members: Member[]\n onAdd: (ruleId: string, sequence: number) => Promise<void>\n onUpdate: (memberId: string, updates: { sequence?: number; enabled?: boolean }) => Promise<void>\n onRemove: (memberId: string, ruleName: string) => Promise<void>\n}\n\nexport function RuleSetMembers({ members, onAdd, onUpdate, onRemove }: RuleSetMembersProps) {\n const t = useT()\n const [showAddForm, setShowAddForm] = React.useState(false)\n const [selectedRuleId, setSelectedRuleId] = React.useState('')\n const [sequence, setSequence] = React.useState(0)\n\n // Fetch available rules\n const { data: availableRules } = useQuery({\n queryKey: ['business-rules', 'rules-list'],\n queryFn: async () => {\n const result = await apiCall<{ items: RuleOption[] }>(\n '/api/business_rules/rules?page=1&pageSize=100&sortField=ruleName&sortDir=asc'\n )\n if (!result.ok) {\n throw new Error('Failed to fetch rules')\n }\n return result.result?.items || []\n },\n })\n\n // Filter out already added rules (memoized to avoid re-computation on every render)\n const rulesNotInSet = React.useMemo(() => {\n const memberRuleIds = new Set(members.map(m => m.ruleId))\n return availableRules?.filter(r => !memberRuleIds.has(r.id)) || []\n }, [members, availableRules])\n\n const handleAdd = async () => {\n if (!selectedRuleId) return\n await onAdd(selectedRuleId, sequence)\n setSelectedRuleId('')\n setSequence(0)\n setShowAddForm(false)\n }\n\n const handleMoveUp = async (member: Member, index: number) => {\n if (index === 0) return\n const prevMember = members[index - 1]\n // Swap sequences\n await onUpdate(member.id, { sequence: prevMember.sequence })\n await onUpdate(prevMember.id, { sequence: member.sequence })\n }\n\n const handleMoveDown = async (member: Member, index: number) => {\n if (index === members.length - 1) return\n const nextMember = members[index + 1]\n // Swap sequences\n await onUpdate(member.id, { sequence: nextMember.sequence })\n await onUpdate(nextMember.id, { sequence: member.sequence })\n }\n\n const handleToggleEnabled = async (member: Member) => {\n await onUpdate(member.id, { enabled: !member.enabled })\n }\n\n return (\n <div className=\"space-y-4\">\n {/* Members List */}\n {members.length === 0 ? (\n <div className=\"text-center py-8 text-muted-foreground\">\n <p>{t('business_rules.sets.members.empty')}</p>\n </div>\n ) : (\n <div className=\"space-y-2\">\n {members.map((member, index) => (\n <div\n key={member.id}\n className=\"flex items-center gap-3 p-3 bg-muted rounded border border-border\"\n >\n {/* Order Controls */}\n <div className=\"flex flex-col gap-1\">\n <button\n onClick={() => handleMoveUp(member, index)}\n disabled={index === 0}\n className=\"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n title={t('common.moveUp')}\n >\n <ChevronUp className=\"w-4 h-4\" />\n </button>\n <button\n onClick={() => handleMoveDown(member, index)}\n disabled={index === members.length - 1}\n className=\"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n title={t('common.moveDown')}\n >\n <ChevronDown className=\"w-4 h-4\" />\n </button>\n </div>\n\n {/* Sequence Number */}\n <div className=\"flex items-center justify-center w-8 h-8 bg-status-info-bg text-status-info-text rounded font-mono text-sm font-medium\">\n {member.sequence}\n </div>\n\n {/* Rule Info */}\n <div className=\"flex-1\">\n <div className=\"font-medium\">{member.ruleName}</div>\n <div className=\"text-xs text-muted-foreground font-mono\">{member.ruleId}</div>\n </div>\n\n {/* Rule Type Badge */}\n <div className=\"px-2 py-1 bg-muted text-muted-foreground text-xs rounded font-medium\">\n {member.ruleType}\n </div>\n\n {/* Enabled Toggle */}\n <button\n onClick={() => handleToggleEnabled(member)}\n className={`px-2 py-1 rounded text-xs font-medium cursor-pointer ${\n member.enabled\n ? 'bg-status-success-bg text-status-success-text hover:bg-status-success-bg/80'\n : 'bg-muted text-muted-foreground hover:bg-muted/50'\n }`}\n title={t('business_rules.sets.members.actions.toggleEnabled')}\n >\n {member.enabled ? t('common.enabled') : t('common.disabled')}\n </button>\n\n {/* Remove Button */}\n <button\n onClick={() => onRemove(member.id, member.ruleName)}\n className=\"p-1.5 text-muted-foreground hover:text-status-error-text hover:bg-status-error-bg rounded transition-colors\"\n title={t('common.remove')}\n >\n <X className=\"w-4 h-4\" />\n </button>\n </div>\n ))}\n </div>\n )}\n\n {/* Add Rule Form */}\n {showAddForm ? (\n <div className=\"p-4 bg-status-info-bg border border-status-info-border rounded space-y-3\">\n <div className=\"flex items-end gap-3\">\n <div className=\"flex-1\">\n <label className=\"block text-sm font-medium text-foreground mb-1\">\n {t('business_rules.sets.members.form.selectRule')}\n </label>\n <select\n value={selectedRuleId}\n onChange={(e) => setSelectedRuleId(e.target.value)}\n className=\"w-full px-3 py-2 border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <option value=\"\">{t('business_rules.sets.members.form.selectRulePlaceholder')}</option>\n {rulesNotInSet.map((rule) => (\n <option key={rule.id} value={rule.id}>\n {rule.ruleName} ({rule.ruleId})\n </option>\n ))}\n </select>\n </div>\n\n <div className=\"w-32\">\n <label className=\"block text-sm font-medium text-foreground mb-1\">\n {t('business_rules.sets.members.form.sequence')}\n </label>\n <input\n type=\"number\"\n value={sequence}\n onChange={(e) => setSequence(parseInt(e.target.value) || 0)}\n min={0}\n className=\"w-full px-3 py-2 border border-border rounded bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n </div>\n </div>\n\n <div className=\"flex gap-2\">\n <Button onClick={handleAdd} disabled={!selectedRuleId} size=\"sm\">\n {t('business_rules.sets.members.actions.add')}\n </Button>\n <Button\n onClick={() => {\n setShowAddForm(false)\n setSelectedRuleId('')\n setSequence(0)\n }}\n variant=\"outline\"\n size=\"sm\"\n >\n {t('common.cancel')}\n </Button>\n </div>\n </div>\n ) : (\n <Button onClick={() => setShowAddForm(true)} variant=\"outline\" size=\"sm\">\n <Plus className=\"w-4 h-4 mr-2\" />\n {t('business_rules.sets.members.actions.addRule')}\n </Button>\n )}\n\n {/* Help Text */}\n <div className=\"text-xs text-muted-foreground space-y-1\">\n <p>\n <strong>{t('business_rules.sets.members.help.ordering')}:</strong>{' '}\n {t('business_rules.sets.members.help.orderingDescription')}\n </p>\n <p>\n <strong>{t('business_rules.sets.members.help.enabled')}:</strong>{' '}\n {t('business_rules.sets.members.help.enabledDescription')}\n </p>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": ";AA2FU,cAUI,YAVJ;AAzFV,YAAY,WAAW;AACvB,SAAS,cAAc;AACvB,SAAS,MAAM,WAAW,aAAa,SAAS;AAChD,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,YAAY;AAyBd,SAAS,eAAe,EAAE,SAAS,OAAO,UAAU,SAAS,GAAwB;AAC1F,QAAM,IAAI,KAAK;AACf,QAAM,CAAC,aAAa,cAAc,IAAI,MAAM,SAAS,KAAK;AAC1D,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,MAAM,SAAS,EAAE;AAC7D,QAAM,CAAC,UAAU,WAAW,IAAI,MAAM,SAAS,CAAC;AAGhD,QAAM,EAAE,MAAM,eAAe,IAAI,SAAS;AAAA,IACxC,UAAU,CAAC,kBAAkB,YAAY;AAAA,IACzC,SAAS,YAAY;AACnB,YAAM,SAAS,MAAM;AAAA,QACnB;AAAA,MACF;AACA,UAAI,CAAC,OAAO,IAAI;AACd,cAAM,IAAI,MAAM,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AAM,eAAe,IAAI,GAAG,SAAQ,WAAU,MAAK,MAClE;AAAA,0BAAC,QAAK,WAAU,gBAAe;AAAA,MAC9B,EAAE,6CAA6C;AAAA,OAClD;AAAA,IAIF,qBAAC,SAAI,WAAU,2CACb;AAAA,2BAAC,OACC;AAAA,6BAAC,YAAQ;AAAA,YAAE,2CAA2C;AAAA,UAAE;AAAA,WAAC;AAAA,QAAU;AAAA,QAClE,EAAE,sDAAsD;AAAA,SAC3D;AAAA,MACA,qBAAC,OACC;AAAA,6BAAC,YAAQ;AAAA,YAAE,0CAA0C;AAAA,UAAE;AAAA,WAAC;AAAA,QAAU;AAAA,QACjE,EAAE,qDAAqD;AAAA,SAC1D;AAAA,OACF;AAAA,KACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1518,7 +1518,7 @@ function ProductOptionsSection({ values, setValue }) {
1518
1518
  )
1519
1519
  ] })
1520
1520
  ] }),
1521
- (Array.isArray(values.options) ? values.options : []).map((option) => /* @__PURE__ */ jsxs("div", { className: "rounded-md bg-muted/40 p-4", children: [
1521
+ (Array.isArray(values.options) ? values.options : []).map((option) => /* @__PURE__ */ jsxs("div", { className: "rounded-md bg-muted/50 p-4", children: [
1522
1522
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1523
1523
  /* @__PURE__ */ jsx(
1524
1524
  Input,
@@ -1827,7 +1827,7 @@ function ProductVariantsSection({
1827
1827
  /* @__PURE__ */ jsx("th", { className: "w-24 px-3 py-2 font-normal", children: t("catalog.products.edit.variants.default", "Default") }),
1828
1828
  /* @__PURE__ */ jsx("th", { className: "w-40 px-3 py-2 font-normal text-right", children: t("catalog.products.edit.variantList.actions", "Actions") })
1829
1829
  ] }) }),
1830
- /* @__PURE__ */ jsx("tbody", { children: variants.map((variant) => /* @__PURE__ */ jsxs("tr", { className: "border-t hover:bg-muted/40", children: [
1830
+ /* @__PURE__ */ jsx("tbody", { children: variants.map((variant) => /* @__PURE__ */ jsxs("tr", { className: "border-t hover:bg-muted/50", children: [
1831
1831
  /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(
1832
1832
  Link,
1833
1833
  {