@open-mercato/core 0.4.2-canary-ed15f2e753 → 0.4.2-canary-f075c3eb92

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 (241) hide show
  1. package/dist/generated/entities.ids.generated.js +0 -1
  2. package/dist/generated/entities.ids.generated.js.map +2 -2
  3. package/dist/generated/entity-fields-registry.js +0 -2
  4. package/dist/generated/entity-fields-registry.js.map +2 -2
  5. package/dist/modules/api_keys/setup.js +11 -0
  6. package/dist/modules/api_keys/setup.js.map +7 -0
  7. package/dist/modules/attachments/components/AttachmentLibrary.js +1 -1
  8. package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
  9. package/dist/modules/attachments/lib/assignmentDetails.js +31 -17
  10. package/dist/modules/attachments/lib/assignmentDetails.js.map +2 -2
  11. package/dist/modules/attachments/lib/partitions.js +3 -3
  12. package/dist/modules/attachments/lib/partitions.js.map +2 -2
  13. package/dist/modules/attachments/setup.js +11 -0
  14. package/dist/modules/attachments/setup.js.map +7 -0
  15. package/dist/modules/audit_logs/setup.js +12 -0
  16. package/dist/modules/audit_logs/setup.js.map +7 -0
  17. package/dist/modules/auth/lib/setup-app.js +29 -159
  18. package/dist/modules/auth/lib/setup-app.js.map +2 -2
  19. package/dist/modules/auth/setup.js +11 -0
  20. package/dist/modules/auth/setup.js.map +7 -0
  21. package/dist/modules/business_rules/data/validators.js +0 -34
  22. package/dist/modules/business_rules/data/validators.js.map +2 -2
  23. package/dist/modules/business_rules/index.js +1 -21
  24. package/dist/modules/business_rules/index.js.map +2 -2
  25. package/dist/modules/business_rules/lib/rule-engine.js +1 -182
  26. package/dist/modules/business_rules/lib/rule-engine.js.map +2 -2
  27. package/dist/modules/business_rules/setup.js +11 -0
  28. package/dist/modules/business_rules/setup.js.map +7 -0
  29. package/dist/modules/catalog/setup.js +22 -0
  30. package/dist/modules/catalog/setup.js.map +7 -0
  31. package/dist/modules/configs/lib/upgrade-actions.js +65 -15
  32. package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
  33. package/dist/modules/configs/setup.js +16 -0
  34. package/dist/modules/configs/setup.js.map +7 -0
  35. package/dist/modules/currencies/setup.js +16 -0
  36. package/dist/modules/currencies/setup.js.map +7 -0
  37. package/dist/modules/customers/setup.js +36 -0
  38. package/dist/modules/customers/setup.js.map +7 -0
  39. package/dist/modules/dashboards/setup.js +12 -0
  40. package/dist/modules/dashboards/setup.js.map +7 -0
  41. package/dist/modules/dictionaries/setup.js +12 -0
  42. package/dist/modules/dictionaries/setup.js.map +7 -0
  43. package/dist/modules/directory/setup.js +12 -0
  44. package/dist/modules/directory/setup.js.map +7 -0
  45. package/dist/modules/entities/setup.js +11 -0
  46. package/dist/modules/entities/setup.js.map +7 -0
  47. package/dist/modules/feature_toggles/setup.js +11 -0
  48. package/dist/modules/feature_toggles/setup.js.map +7 -0
  49. package/dist/modules/perspectives/setup.js +12 -0
  50. package/dist/modules/perspectives/setup.js.map +7 -0
  51. package/dist/modules/planner/setup.js +21 -0
  52. package/dist/modules/planner/setup.js.map +7 -0
  53. package/dist/modules/query_index/setup.js +11 -0
  54. package/dist/modules/query_index/setup.js.map +7 -0
  55. package/dist/modules/resources/setup.js +21 -0
  56. package/dist/modules/resources/setup.js.map +7 -0
  57. package/dist/modules/sales/acl.js +0 -1
  58. package/dist/modules/sales/acl.js.map +2 -2
  59. package/dist/modules/sales/backend/sales/documents/[id]/page.js +0 -12
  60. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
  61. package/dist/modules/sales/commands/documents.js +0 -62
  62. package/dist/modules/sales/commands/documents.js.map +2 -2
  63. package/dist/modules/sales/lib/dictionaries.js +0 -3
  64. package/dist/modules/sales/lib/dictionaries.js.map +2 -2
  65. package/dist/modules/sales/setup.js +99 -0
  66. package/dist/modules/sales/setup.js.map +7 -0
  67. package/dist/modules/staff/setup.js +27 -0
  68. package/dist/modules/staff/setup.js.map +7 -0
  69. package/dist/modules/workflows/acl.js +0 -2
  70. package/dist/modules/workflows/acl.js.map +2 -2
  71. package/dist/modules/workflows/api/instances/route.js +6 -18
  72. package/dist/modules/workflows/api/instances/route.js.map +2 -2
  73. package/dist/modules/workflows/api/tasks/route.js +1 -6
  74. package/dist/modules/workflows/api/tasks/route.js.map +2 -2
  75. package/dist/modules/workflows/backend/definitions/[id]/page.js +1 -9
  76. package/dist/modules/workflows/backend/definitions/[id]/page.js.map +2 -2
  77. package/dist/modules/workflows/backend/definitions/[id]/page.meta.js +1 -1
  78. package/dist/modules/workflows/backend/definitions/[id]/page.meta.js.map +2 -2
  79. package/dist/modules/workflows/backend/definitions/create/page.js +15 -24
  80. package/dist/modules/workflows/backend/definitions/create/page.js.map +2 -2
  81. package/dist/modules/workflows/backend/definitions/create/page.meta.js +1 -1
  82. package/dist/modules/workflows/backend/definitions/create/page.meta.js.map +2 -2
  83. package/dist/modules/workflows/backend/definitions/visual-editor/page.js +132 -150
  84. package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
  85. package/dist/modules/workflows/backend/definitions/visual-editor/page.meta.js +1 -1
  86. package/dist/modules/workflows/backend/definitions/visual-editor/page.meta.js.map +2 -2
  87. package/dist/modules/workflows/backend/events/[id]/page.js +1 -1
  88. package/dist/modules/workflows/backend/events/[id]/page.js.map +2 -2
  89. package/dist/modules/workflows/backend/events/[id]/page.meta.js +2 -2
  90. package/dist/modules/workflows/backend/events/[id]/page.meta.js.map +2 -2
  91. package/dist/modules/workflows/backend/instances/[id]/page.meta.js +2 -2
  92. package/dist/modules/workflows/backend/instances/[id]/page.meta.js.map +2 -2
  93. package/dist/modules/workflows/backend/tasks/[id]/page.js +1 -1
  94. package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
  95. package/dist/modules/workflows/backend/tasks/[id]/page.meta.js +2 -2
  96. package/dist/modules/workflows/backend/tasks/[id]/page.meta.js.map +2 -2
  97. package/dist/modules/workflows/backend/tasks/page.js +6 -5
  98. package/dist/modules/workflows/backend/tasks/page.js.map +2 -2
  99. package/dist/modules/workflows/cli.js +3 -81
  100. package/dist/modules/workflows/cli.js.map +3 -3
  101. package/dist/modules/workflows/data/entities.js +1 -64
  102. package/dist/modules/workflows/data/entities.js.map +2 -2
  103. package/dist/modules/workflows/data/validators.js +0 -115
  104. package/dist/modules/workflows/data/validators.js.map +2 -2
  105. package/dist/modules/workflows/examples/checkout-demo-definition.json +5 -1
  106. package/dist/modules/workflows/lib/activity-executor.js +13 -75
  107. package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
  108. package/dist/modules/workflows/lib/graph-utils.js +2 -71
  109. package/dist/modules/workflows/lib/graph-utils.js.map +2 -2
  110. package/dist/modules/workflows/lib/seeds.js +7 -36
  111. package/dist/modules/workflows/lib/seeds.js.map +2 -2
  112. package/dist/modules/workflows/lib/start-validator.js +23 -33
  113. package/dist/modules/workflows/lib/start-validator.js.map +2 -2
  114. package/dist/modules/workflows/lib/transition-handler.js +45 -157
  115. package/dist/modules/workflows/lib/transition-handler.js.map +3 -3
  116. package/dist/modules/workflows/migrations/Migration20251207131955.js +76 -72
  117. package/dist/modules/workflows/migrations/Migration20251207131955.js.map +2 -2
  118. package/dist/modules/workflows/setup.js +16 -0
  119. package/dist/modules/workflows/setup.js.map +7 -0
  120. package/generated/entities.ids.generated.ts +0 -1
  121. package/generated/entity-fields-registry.ts +0 -2
  122. package/package.json +2 -2
  123. package/src/__tests__/module-decoupling.test.ts +356 -0
  124. package/src/modules/api_keys/setup.ts +9 -0
  125. package/src/modules/attachments/components/AttachmentLibrary.tsx +2 -2
  126. package/src/modules/attachments/lib/assignmentDetails.ts +32 -16
  127. package/src/modules/attachments/lib/partitions.ts +3 -3
  128. package/src/modules/attachments/setup.ts +9 -0
  129. package/src/modules/audit_logs/setup.ts +10 -0
  130. package/src/modules/auth/__tests__/cli-setup-acl.test.ts +30 -0
  131. package/src/modules/auth/lib/setup-app.ts +40 -177
  132. package/src/modules/auth/setup.ts +9 -0
  133. package/src/modules/business_rules/data/validators.ts +0 -40
  134. package/src/modules/business_rules/index.ts +0 -25
  135. package/src/modules/business_rules/lib/rule-engine.ts +1 -281
  136. package/src/modules/business_rules/setup.ts +9 -0
  137. package/src/modules/catalog/setup.ts +22 -0
  138. package/src/modules/configs/lib/upgrade-actions.ts +78 -17
  139. package/src/modules/configs/setup.ts +14 -0
  140. package/src/modules/currencies/setup.ts +15 -0
  141. package/src/modules/customers/setup.ts +36 -0
  142. package/src/modules/dashboards/setup.ts +10 -0
  143. package/src/modules/dictionaries/setup.ts +10 -0
  144. package/src/modules/directory/setup.ts +10 -0
  145. package/src/modules/entities/setup.ts +9 -0
  146. package/src/modules/feature_toggles/setup.ts +9 -0
  147. package/src/modules/perspectives/setup.ts +10 -0
  148. package/src/modules/planner/setup.ts +21 -0
  149. package/src/modules/query_index/setup.ts +9 -0
  150. package/src/modules/resources/setup.ts +21 -0
  151. package/src/modules/sales/acl.ts +0 -1
  152. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +0 -16
  153. package/src/modules/sales/commands/documents.ts +1 -74
  154. package/src/modules/sales/lib/dictionaries.ts +0 -3
  155. package/src/modules/sales/setup.ts +108 -0
  156. package/src/modules/staff/setup.ts +27 -0
  157. package/src/modules/workflows/acl.ts +0 -2
  158. package/src/modules/workflows/api/__tests__/instances.route.test.ts +2 -5
  159. package/src/modules/workflows/api/instances/route.ts +7 -21
  160. package/src/modules/workflows/api/tasks/route.ts +1 -7
  161. package/src/modules/workflows/backend/definitions/[id]/page.meta.ts +1 -1
  162. package/src/modules/workflows/backend/definitions/[id]/page.tsx +0 -9
  163. package/src/modules/workflows/backend/definitions/create/page.meta.ts +1 -1
  164. package/src/modules/workflows/backend/definitions/create/page.tsx +0 -9
  165. package/src/modules/workflows/backend/definitions/visual-editor/page.meta.ts +1 -1
  166. package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +3 -21
  167. package/src/modules/workflows/backend/events/[id]/page.meta.ts +2 -2
  168. package/src/modules/workflows/backend/events/[id]/page.tsx +1 -1
  169. package/src/modules/workflows/backend/instances/[id]/page.meta.ts +2 -2
  170. package/src/modules/workflows/backend/tasks/[id]/page.meta.ts +2 -2
  171. package/src/modules/workflows/backend/tasks/[id]/page.tsx +1 -1
  172. package/src/modules/workflows/backend/tasks/page.tsx +6 -5
  173. package/src/modules/workflows/cli.ts +0 -111
  174. package/src/modules/workflows/data/entities.ts +0 -124
  175. package/src/modules/workflows/data/validators.ts +0 -138
  176. package/src/modules/workflows/examples/checkout-demo-definition.json +5 -1
  177. package/src/modules/workflows/i18n/en.json +0 -71
  178. package/src/modules/workflows/lib/__tests__/activity-executor.test.ts +36 -43
  179. package/src/modules/workflows/lib/__tests__/transition-handler.test.ts +90 -170
  180. package/src/modules/workflows/lib/activity-executor.ts +16 -129
  181. package/src/modules/workflows/lib/graph-utils.ts +2 -117
  182. package/src/modules/workflows/lib/seeds.ts +12 -50
  183. package/src/modules/workflows/lib/start-validator.ts +28 -38
  184. package/src/modules/workflows/lib/transition-handler.ts +55 -208
  185. package/src/modules/workflows/migrations/Migration20251207131955.ts +77 -143
  186. package/src/modules/workflows/setup.ts +15 -0
  187. package/dist/generated/entities/workflow_event_trigger/index.js +0 -33
  188. package/dist/generated/entities/workflow_event_trigger/index.js.map +0 -7
  189. package/dist/modules/auth/events.js +0 -30
  190. package/dist/modules/auth/events.js.map +0 -7
  191. package/dist/modules/business_rules/api/execute/[ruleId]/route.js +0 -145
  192. package/dist/modules/business_rules/api/execute/[ruleId]/route.js.map +0 -7
  193. package/dist/modules/catalog/events.js +0 -34
  194. package/dist/modules/catalog/events.js.map +0 -7
  195. package/dist/modules/customers/events.js +0 -49
  196. package/dist/modules/customers/events.js.map +0 -7
  197. package/dist/modules/directory/events.js +0 -23
  198. package/dist/modules/directory/events.js.map +0 -7
  199. package/dist/modules/sales/events.js +0 -63
  200. package/dist/modules/sales/events.js.map +0 -7
  201. package/dist/modules/sales/lib/frontend/documentDataEvents.js +0 -25
  202. package/dist/modules/sales/lib/frontend/documentDataEvents.js.map +0 -7
  203. package/dist/modules/workflows/components/DefinitionTriggersEditor.js +0 -481
  204. package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +0 -7
  205. package/dist/modules/workflows/components/EventTriggersEditor.js +0 -553
  206. package/dist/modules/workflows/components/EventTriggersEditor.js.map +0 -7
  207. package/dist/modules/workflows/events.js +0 -38
  208. package/dist/modules/workflows/events.js.map +0 -7
  209. package/dist/modules/workflows/examples/order-approval-definition.json +0 -257
  210. package/dist/modules/workflows/examples/order-approval-guard-rules.json +0 -32
  211. package/dist/modules/workflows/lib/event-trigger-service.js +0 -308
  212. package/dist/modules/workflows/lib/event-trigger-service.js.map +0 -7
  213. package/dist/modules/workflows/migrations/Migration20260123143500.js +0 -36
  214. package/dist/modules/workflows/migrations/Migration20260123143500.js.map +0 -7
  215. package/dist/modules/workflows/subscribers/event-trigger.js +0 -78
  216. package/dist/modules/workflows/subscribers/event-trigger.js.map +0 -7
  217. package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js +0 -323
  218. package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js.map +0 -7
  219. package/dist/modules/workflows/widgets/injection/order-approval/widget.js +0 -17
  220. package/dist/modules/workflows/widgets/injection/order-approval/widget.js.map +0 -7
  221. package/dist/modules/workflows/widgets/injection-table.js +0 -19
  222. package/dist/modules/workflows/widgets/injection-table.js.map +0 -7
  223. package/generated/entities/workflow_event_trigger/index.ts +0 -15
  224. package/src/modules/auth/events.ts +0 -39
  225. package/src/modules/business_rules/api/execute/[ruleId]/route.ts +0 -163
  226. package/src/modules/catalog/events.ts +0 -45
  227. package/src/modules/customers/events.ts +0 -63
  228. package/src/modules/directory/events.ts +0 -31
  229. package/src/modules/sales/events.ts +0 -82
  230. package/src/modules/sales/lib/frontend/documentDataEvents.ts +0 -28
  231. package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +0 -581
  232. package/src/modules/workflows/components/EventTriggersEditor.tsx +0 -664
  233. package/src/modules/workflows/events.ts +0 -49
  234. package/src/modules/workflows/examples/order-approval-definition.json +0 -257
  235. package/src/modules/workflows/examples/order-approval-guard-rules.json +0 -32
  236. package/src/modules/workflows/lib/event-trigger-service.ts +0 -557
  237. package/src/modules/workflows/migrations/Migration20260123143500.ts +0 -38
  238. package/src/modules/workflows/subscribers/event-trigger.ts +0 -109
  239. package/src/modules/workflows/widgets/injection/order-approval/widget.client.tsx +0 -446
  240. package/src/modules/workflows/widgets/injection/order-approval/widget.ts +0 -16
  241. package/src/modules/workflows/widgets/injection-table.ts +0 -21
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { useRouter } from "next/navigation";
5
5
  import { Page, PageBody } from "@open-mercato/ui/backend/Page";
@@ -15,8 +15,6 @@ import {
15
15
  } from "../../../components/formConfig.js";
16
16
  import { StepsEditor } from "../../../components/StepsEditor.js";
17
17
  import { TransitionsEditor } from "../../../components/TransitionsEditor.js";
18
- import { Alert, AlertDescription, AlertTitle } from "@open-mercato/ui/primitives/alert";
19
- import { Zap } from "lucide-react";
20
18
  function CreateWorkflowDefinitionPage() {
21
19
  const router = useRouter();
22
20
  const t = useT();
@@ -40,27 +38,20 @@ function CreateWorkflowDefinitionPage() {
40
38
  () => createFormGroups(t, StepsEditor, TransitionsEditor),
41
39
  [t]
42
40
  );
43
- return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsxs(PageBody, { children: [
44
- /* @__PURE__ */ jsxs(Alert, { variant: "info", className: "mb-6", children: [
45
- /* @__PURE__ */ jsx(Zap, { className: "w-4 h-4" }),
46
- /* @__PURE__ */ jsx(AlertTitle, { children: "Event Triggers" }),
47
- /* @__PURE__ */ jsx(AlertDescription, { children: "After creating this workflow definition, you can configure event triggers to automatically start the workflow when specific events occur in the system." })
48
- ] }),
49
- /* @__PURE__ */ jsx(
50
- CrudForm,
51
- {
52
- title: t("workflows.create.title"),
53
- backHref: "/backend/definitions",
54
- schema: workflowDefinitionFormSchema,
55
- fields,
56
- initialValues: defaultFormValues,
57
- onSubmit: handleSubmit,
58
- cancelHref: "/backend/definitions",
59
- groups: formGroups,
60
- submitLabel: t("workflows.form.create")
61
- }
62
- )
63
- ] }) });
41
+ return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsx(PageBody, { children: /* @__PURE__ */ jsx(
42
+ CrudForm,
43
+ {
44
+ title: t("workflows.create.title"),
45
+ backHref: "/backend/definitions",
46
+ schema: workflowDefinitionFormSchema,
47
+ fields,
48
+ initialValues: defaultFormValues,
49
+ onSubmit: handleSubmit,
50
+ cancelHref: "/backend/definitions",
51
+ groups: formGroups,
52
+ submitLabel: t("workflows.form.create")
53
+ }
54
+ ) }) });
64
55
  }
65
56
  export {
66
57
  CreateWorkflowDefinitionPage as default
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/modules/workflows/backend/definitions/create/page.tsx"],
4
- "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useRouter } from 'next/navigation'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { CrudForm } from '@open-mercato/ui/backend/CrudForm'\nimport { apiFetch } from '@open-mercato/ui/backend/utils/api'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport {\n workflowDefinitionFormSchema,\n createFormGroups,\n createFieldDefinitions,\n defaultFormValues,\n buildWorkflowPayload,\n type WorkflowDefinitionFormValues,\n} from '../../../components/formConfig'\nimport { StepsEditor } from '../../../components/StepsEditor'\nimport { TransitionsEditor } from '../../../components/TransitionsEditor'\nimport { Alert, AlertDescription, AlertTitle } from '@open-mercato/ui/primitives/alert'\nimport { Zap } from 'lucide-react'\n\nexport default function CreateWorkflowDefinitionPage() {\n const router = useRouter()\n const t = useT()\n\n const handleSubmit = async (values: WorkflowDefinitionFormValues) => {\n const payload = buildWorkflowPayload(values)\n\n const response = await apiFetch('/api/workflows/definitions', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(payload),\n })\n\n if (!response.ok) {\n const error = await response.json()\n throw new Error(error.error || t('workflows.errors.createFailed'))\n }\n\n const result = await response.json()\n router.push(`/backend/definitions/${result.id}`)\n router.refresh()\n }\n\n const fields = React.useMemo(() => createFieldDefinitions(t), [t])\n\n const formGroups = React.useMemo(\n () => createFormGroups(t, StepsEditor, TransitionsEditor),\n [t]\n )\n\n return (\n <Page>\n <PageBody>\n <Alert variant=\"info\" className=\"mb-6\">\n <Zap className=\"w-4 h-4\" />\n <AlertTitle>Event Triggers</AlertTitle>\n <AlertDescription>\n After creating this workflow definition, you can configure event triggers to automatically start the workflow when specific events occur in the system.\n </AlertDescription>\n </Alert>\n <CrudForm\n title={t('workflows.create.title')}\n backHref=\"/backend/definitions\"\n schema={workflowDefinitionFormSchema}\n fields={fields}\n initialValues={defaultFormValues}\n onSubmit={handleSubmit}\n cancelHref=\"/backend/definitions\"\n groups={formGroups}\n submitLabel={t('workflows.form.create')}\n />\n </PageBody>\n </Page>\n )\n}\n"],
5
- "mappings": ";AAsDQ,SACE,KADF;AApDR,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAC1B,SAAS,MAAM,gBAAgB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,OAAO,kBAAkB,kBAAkB;AACpD,SAAS,WAAW;AAEL,SAAR,+BAAgD;AACrD,QAAM,SAAS,UAAU;AACzB,QAAM,IAAI,KAAK;AAEf,QAAM,eAAe,OAAO,WAAyC;AACnE,UAAM,UAAU,qBAAqB,MAAM;AAE3C,UAAM,WAAW,MAAM,SAAS,8BAA8B;AAAA,MAC5D,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,MAAM,KAAK,UAAU,OAAO;AAAA,IAC9B,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,QAAQ,MAAM,SAAS,KAAK;AAClC,YAAM,IAAI,MAAM,MAAM,SAAS,EAAE,+BAA+B,CAAC;AAAA,IACnE;AAEA,UAAM,SAAS,MAAM,SAAS,KAAK;AACnC,WAAO,KAAK,wBAAwB,OAAO,EAAE,EAAE;AAC/C,WAAO,QAAQ;AAAA,EACjB;AAEA,QAAM,SAAS,MAAM,QAAQ,MAAM,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjE,QAAM,aAAa,MAAM;AAAA,IACvB,MAAM,iBAAiB,GAAG,aAAa,iBAAiB;AAAA,IACxD,CAAC,CAAC;AAAA,EACJ;AAEA,SACE,oBAAC,QACC,+BAAC,YACC;AAAA,yBAAC,SAAM,SAAQ,QAAO,WAAU,QAC9B;AAAA,0BAAC,OAAI,WAAU,WAAU;AAAA,MACzB,oBAAC,cAAW,4BAAc;AAAA,MAC1B,oBAAC,oBAAiB,qKAElB;AAAA,OACF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,EAAE,wBAAwB;AAAA,QACjC,UAAS;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,QACA,eAAe;AAAA,QACf,UAAU;AAAA,QACV,YAAW;AAAA,QACX,QAAQ;AAAA,QACR,aAAa,EAAE,uBAAuB;AAAA;AAAA,IACxC;AAAA,KACF,GACF;AAEJ;",
4
+ "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useRouter } from 'next/navigation'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { CrudForm } from '@open-mercato/ui/backend/CrudForm'\nimport { apiFetch } from '@open-mercato/ui/backend/utils/api'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport {\n workflowDefinitionFormSchema,\n createFormGroups,\n createFieldDefinitions,\n defaultFormValues,\n buildWorkflowPayload,\n type WorkflowDefinitionFormValues,\n} from '../../../components/formConfig'\nimport { StepsEditor } from '../../../components/StepsEditor'\nimport { TransitionsEditor } from '../../../components/TransitionsEditor'\n\nexport default function CreateWorkflowDefinitionPage() {\n const router = useRouter()\n const t = useT()\n\n const handleSubmit = async (values: WorkflowDefinitionFormValues) => {\n const payload = buildWorkflowPayload(values)\n\n const response = await apiFetch('/api/workflows/definitions', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(payload),\n })\n\n if (!response.ok) {\n const error = await response.json()\n throw new Error(error.error || t('workflows.errors.createFailed'))\n }\n\n const result = await response.json()\n router.push(`/backend/definitions/${result.id}`)\n router.refresh()\n }\n\n const fields = React.useMemo(() => createFieldDefinitions(t), [t])\n\n const formGroups = React.useMemo(\n () => createFormGroups(t, StepsEditor, TransitionsEditor),\n [t]\n )\n\n return (\n <Page>\n <PageBody>\n <CrudForm\n title={t('workflows.create.title')}\n backHref=\"/backend/definitions\"\n schema={workflowDefinitionFormSchema}\n fields={fields}\n initialValues={defaultFormValues}\n onSubmit={handleSubmit}\n cancelHref=\"/backend/definitions\"\n groups={formGroups}\n submitLabel={t('workflows.form.create')}\n />\n </PageBody>\n </Page>\n )\n}\n"],
5
+ "mappings": ";AAoDQ;AAlDR,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAC1B,SAAS,MAAM,gBAAgB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAEnB,SAAR,+BAAgD;AACrD,QAAM,SAAS,UAAU;AACzB,QAAM,IAAI,KAAK;AAEf,QAAM,eAAe,OAAO,WAAyC;AACnE,UAAM,UAAU,qBAAqB,MAAM;AAE3C,UAAM,WAAW,MAAM,SAAS,8BAA8B;AAAA,MAC5D,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,MAAM,KAAK,UAAU,OAAO;AAAA,IAC9B,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,QAAQ,MAAM,SAAS,KAAK;AAClC,YAAM,IAAI,MAAM,MAAM,SAAS,EAAE,+BAA+B,CAAC;AAAA,IACnE;AAEA,UAAM,SAAS,MAAM,SAAS,KAAK;AACnC,WAAO,KAAK,wBAAwB,OAAO,EAAE,EAAE;AAC/C,WAAO,QAAQ;AAAA,EACjB;AAEA,QAAM,SAAS,MAAM,QAAQ,MAAM,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjE,QAAM,aAAa,MAAM;AAAA,IACvB,MAAM,iBAAiB,GAAG,aAAa,iBAAiB;AAAA,IACxD,CAAC,CAAC;AAAA,EACJ;AAEA,SACE,oBAAC,QACC,8BAAC,YACC;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,wBAAwB;AAAA,MACjC,UAAS;AAAA,MACT,QAAQ;AAAA,MACR;AAAA,MACA,eAAe;AAAA,MACf,UAAU;AAAA,MACV,YAAW;AAAA,MACX,QAAQ;AAAA,MACR,aAAa,EAAE,uBAAuB;AAAA;AAAA,EACxC,GACF,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -18,7 +18,7 @@ const metadata = {
18
18
  pageOrder: 100,
19
19
  icon: createIcon,
20
20
  breadcrumb: [
21
- { label: "Workflows", labelKey: "workflows.module.name", href: "/backend/definitions" },
21
+ { label: "Workflows", labelKey: "workflows.module.name", href: "/backend/workflows/definitions" },
22
22
  { label: "Create", labelKey: "workflows.common.create" }
23
23
  ]
24
24
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/modules/workflows/backend/definitions/create/page.meta.ts"],
4
- "sourcesContent": ["import React from 'react'\n\nconst createIcon = React.createElement(\n 'svg',\n { width: 16, height: 16, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 2 },\n React.createElement('path', { d: 'M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z' }),\n React.createElement('polyline', { points: '14 2 14 8 20 8' }),\n React.createElement('line', { x1: 12, y1: 13, x2: 12, y2: 19 }),\n React.createElement('line', { x1: 9, y1: 16, x2: 15, y2: 16 })\n)\n\nexport const metadata = {\n requireAuth: true,\n requireFeatures: ['workflows.create'],\n pageTitle: 'Create Workflow Definition',\n pageTitleKey: 'workflows.create.title',\n pageGroup: 'Workflows',\n pageGroupKey: 'workflows.module.name',\n pagePriority: 10,\n pageOrder: 100,\n icon: createIcon,\n breadcrumb: [\n { label: 'Workflows', labelKey: 'workflows.module.name', href: '/backend/definitions' },\n { label: 'Create', labelKey: 'workflows.common.create' },\n ],\n}\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAElB,MAAM,aAAa,MAAM;AAAA,EACvB;AAAA,EACA,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,QAAQ,gBAAgB,aAAa,EAAE;AAAA,EACpG,MAAM,cAAc,QAAQ,EAAE,GAAG,6DAA6D,CAAC;AAAA,EAC/F,MAAM,cAAc,YAAY,EAAE,QAAQ,iBAAiB,CAAC;AAAA,EAC5D,MAAM,cAAc,QAAQ,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG,CAAC;AAAA,EAC9D,MAAM,cAAc,QAAQ,EAAE,IAAI,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG,CAAC;AAC/D;AAEO,MAAM,WAAW;AAAA,EACtB,aAAa;AAAA,EACb,iBAAiB,CAAC,kBAAkB;AAAA,EACpC,WAAW;AAAA,EACX,cAAc;AAAA,EACd,WAAW;AAAA,EACX,cAAc;AAAA,EACd,cAAc;AAAA,EACd,WAAW;AAAA,EACX,MAAM;AAAA,EACN,YAAY;AAAA,IACV,EAAE,OAAO,aAAa,UAAU,yBAAyB,MAAM,uBAAuB;AAAA,IACtF,EAAE,OAAO,UAAU,UAAU,0BAA0B;AAAA,EACzD;AACF;",
4
+ "sourcesContent": ["import React from 'react'\n\nconst createIcon = React.createElement(\n 'svg',\n { width: 16, height: 16, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 2 },\n React.createElement('path', { d: 'M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z' }),\n React.createElement('polyline', { points: '14 2 14 8 20 8' }),\n React.createElement('line', { x1: 12, y1: 13, x2: 12, y2: 19 }),\n React.createElement('line', { x1: 9, y1: 16, x2: 15, y2: 16 })\n)\n\nexport const metadata = {\n requireAuth: true,\n requireFeatures: ['workflows.create'],\n pageTitle: 'Create Workflow Definition',\n pageTitleKey: 'workflows.create.title',\n pageGroup: 'Workflows',\n pageGroupKey: 'workflows.module.name',\n pagePriority: 10,\n pageOrder: 100,\n icon: createIcon,\n breadcrumb: [\n { label: 'Workflows', labelKey: 'workflows.module.name', href: '/backend/workflows/definitions' },\n { label: 'Create', labelKey: 'workflows.common.create' },\n ],\n}\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAElB,MAAM,aAAa,MAAM;AAAA,EACvB;AAAA,EACA,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,QAAQ,gBAAgB,aAAa,EAAE;AAAA,EACpG,MAAM,cAAc,QAAQ,EAAE,GAAG,6DAA6D,CAAC;AAAA,EAC/F,MAAM,cAAc,YAAY,EAAE,QAAQ,iBAAiB,CAAC;AAAA,EAC5D,MAAM,cAAc,QAAQ,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG,CAAC;AAAA,EAC9D,MAAM,cAAc,QAAQ,EAAE,IAAI,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG,CAAC;AAC/D;AAEO,MAAM,WAAW;AAAA,EACtB,aAAa;AAAA,EACb,iBAAiB,CAAC,kBAAkB;AAAA,EACpC,WAAW;AAAA,EACX,cAAc;AAAA,EACd,WAAW;AAAA,EACX,cAAc;AAAA,EACd,cAAc;AAAA,EACd,WAAW;AAAA,EACX,MAAM;AAAA,EACN,YAAY;AAAA,IACV,EAAE,OAAO,aAAa,UAAU,yBAAyB,MAAM,iCAAiC;AAAA,IAChG,EAAE,OAAO,UAAU,UAAU,0BAA0B;AAAA,EACzD;AACF;",
6
6
  "names": []
7
7
  }
@@ -33,7 +33,6 @@ import { apiCall } from "@open-mercato/ui/backend/utils/apiCall";
33
33
  import { flash } from "@open-mercato/ui/backend/FlashMessages";
34
34
  import { CircleQuestionMark, Info, PanelTopClose, PanelTopOpen, Play, Save, Trash2 } from "lucide-react";
35
35
  import { NODE_TYPE_ICONS, NODE_TYPE_COLORS, NODE_TYPE_LABELS } from "../../../lib/node-type-icons.js";
36
- import { DefinitionTriggersEditor } from "../../../components/DefinitionTriggersEditor.js";
37
36
  function VisualEditorPage() {
38
37
  const t = useT();
39
38
  const router = useRouter();
@@ -59,7 +58,6 @@ function VisualEditorPage() {
59
58
  const [icon, setIcon] = useState("");
60
59
  const [effectiveFrom, setEffectiveFrom] = useState("");
61
60
  const [effectiveTo, setEffectiveTo] = useState("");
62
- const [triggers, setTriggers] = useState([]);
63
61
  useEffect(() => {
64
62
  const loadDefinition = async () => {
65
63
  if (!definitionId) {
@@ -87,7 +85,6 @@ function VisualEditorPage() {
87
85
  const graph = definitionToGraph(definition.definition);
88
86
  setNodes(graph.nodes);
89
87
  setEdges(graph.edges);
90
- setTriggers(definition.definition?.triggers || []);
91
88
  flash("Workflow loaded successfully", "success");
92
89
  } catch (error) {
93
90
  console.error("Error loading workflow definition:", error);
@@ -212,11 +209,7 @@ function VisualEditorPage() {
212
209
  flash(`Cannot save: ${criticalErrors.length} validation error(s) found. Please fix them first.`, "error");
213
210
  return;
214
211
  }
215
- const graphDefinition = graphToDefinition(nodes, edges, { includePositions: true });
216
- const definitionData = {
217
- ...graphDefinition,
218
- triggers: triggers.length > 0 ? triggers : void 0
219
- };
212
+ const definitionData = graphToDefinition(nodes, edges, { includePositions: true });
220
213
  const schemaResult = workflowDefinitionDataSchema.safeParse(definitionData);
221
214
  if (!schemaResult.success) {
222
215
  const firstIssue = schemaResult.error.issues[0];
@@ -272,7 +265,7 @@ function VisualEditorPage() {
272
265
  } finally {
273
266
  setIsSaving(false);
274
267
  }
275
- }, [nodes, edges, workflowId, workflowName, description, version, enabled, category, tags, triggers, definitionId, router]);
268
+ }, [nodes, edges, workflowId, workflowName, description, version, enabled, category, tags, definitionId, router]);
276
269
  const handleTest = useCallback(() => {
277
270
  const errors = validateWorkflowGraph(nodes, edges);
278
271
  const criticalErrors = errors.filter((e) => e.type === "error");
@@ -375,7 +368,6 @@ function VisualEditorPage() {
375
368
  setIcon("");
376
369
  setEffectiveFrom("");
377
370
  setEffectiveTo("");
378
- setTriggers([]);
379
371
  setShowClearConfirm(false);
380
372
  flash("Canvas cleared", "success");
381
373
  }, []);
@@ -474,152 +466,142 @@ function VisualEditorPage() {
474
466
  )
475
467
  ] })
476
468
  ] }) }),
477
- showMetadata && /* @__PURE__ */ jsxs("div", { className: "bg-white border-b border-gray-200 px-6 py-4", children: [
478
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
479
- /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold uppercase text-muted-foreground mb-4", children: "Workflow Metadata" }),
480
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-4", children: [
481
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
482
- /* @__PURE__ */ jsx(Label, { htmlFor: "workflowId", className: "text-xs", children: "Workflow ID *" }),
483
- /* @__PURE__ */ jsx(
484
- Input,
485
- {
486
- id: "workflowId",
487
- value: workflowId,
488
- onChange: (e) => setWorkflowId(e.target.value),
489
- placeholder: "checkout_workflow",
490
- disabled: !!definitionId
491
- }
492
- ),
493
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: definitionId ? "Cannot be changed when editing" : "Lowercase, numbers, hyphens, underscores" })
494
- ] }),
495
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
496
- /* @__PURE__ */ jsx(Label, { htmlFor: "workflowName", className: "text-xs", children: "Workflow Name *" }),
497
- /* @__PURE__ */ jsx(
498
- Input,
499
- {
500
- id: "workflowName",
501
- value: workflowName,
502
- onChange: (e) => setWorkflowName(e.target.value),
503
- placeholder: "Checkout Process"
504
- }
505
- )
506
- ] }),
507
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
508
- /* @__PURE__ */ jsx(Label, { htmlFor: "category", className: "text-xs", children: "Category" }),
509
- /* @__PURE__ */ jsx(
510
- Input,
511
- {
512
- id: "category",
513
- value: category,
514
- onChange: (e) => setCategory(e.target.value),
515
- placeholder: "E-Commerce"
516
- }
517
- )
518
- ] }),
519
- /* @__PURE__ */ jsxs("div", { className: "col-span-3 space-y-1", children: [
520
- /* @__PURE__ */ jsx(Label, { htmlFor: "description", className: "text-xs", children: "Description" }),
521
- /* @__PURE__ */ jsx(
522
- Textarea,
523
- {
524
- id: "description",
525
- value: description,
526
- onChange: (e) => setDescription(e.target.value),
527
- placeholder: "Describe the purpose of this workflow...",
528
- rows: 2
529
- }
530
- )
531
- ] }),
532
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
533
- /* @__PURE__ */ jsx(Label, { htmlFor: "version", className: "text-xs", children: "Version *" }),
534
- /* @__PURE__ */ jsx(
535
- Input,
536
- {
537
- id: "version",
538
- type: "number",
539
- value: version,
540
- onChange: (e) => setVersion(parseInt(e.target.value) || 1),
541
- min: 1,
542
- disabled: !!definitionId
543
- }
544
- ),
545
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Version number (increment for major changes)" })
546
- ] }),
547
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
548
- /* @__PURE__ */ jsx(Label, { className: "text-xs", children: "Enabled" }),
549
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
550
- /* @__PURE__ */ jsx(
551
- Switch,
552
- {
553
- id: "enabled",
554
- checked: enabled,
555
- onCheckedChange: setEnabled
556
- }
557
- ),
558
- /* @__PURE__ */ jsx(Label, { htmlFor: "enabled", className: "text-sm font-normal cursor-pointer", children: "Only enabled workflows can be started" })
559
- ] })
560
- ] }),
561
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
562
- /* @__PURE__ */ jsx(Label, { className: "text-xs", children: "Tags" }),
563
- /* @__PURE__ */ jsx(
564
- TagsInput,
565
- {
566
- value: tags,
567
- onChange: setTags,
568
- placeholder: t("workflows.form.placeholders.tags")
569
- }
570
- ),
571
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("workflows.form.descriptions.tags") })
572
- ] }),
573
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
574
- /* @__PURE__ */ jsx(Label, { htmlFor: "icon", className: "text-xs", children: "Icon" }),
575
- /* @__PURE__ */ jsx(
576
- Input,
577
- {
578
- id: "icon",
579
- value: icon,
580
- onChange: (e) => setIcon(e.target.value),
581
- placeholder: "ShoppingCart"
582
- }
583
- ),
584
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Icon name for visual identification" })
585
- ] }),
586
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
587
- /* @__PURE__ */ jsx(Label, { htmlFor: "effectiveFrom", className: "text-xs", children: "Effective From" }),
588
- /* @__PURE__ */ jsx(
589
- Input,
590
- {
591
- id: "effectiveFrom",
592
- type: "date",
593
- value: effectiveFrom,
594
- onChange: (e) => setEffectiveFrom(e.target.value)
595
- }
596
- ),
597
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Workflow becomes active from this date" })
598
- ] }),
599
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
600
- /* @__PURE__ */ jsx(Label, { htmlFor: "effectiveTo", className: "text-xs", children: "Effective To" }),
469
+ showMetadata && /* @__PURE__ */ jsx("div", { className: "bg-white border-b border-gray-200 px-6 py-4", children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
470
+ /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold uppercase text-muted-foreground mb-4", children: "Workflow Metadata" }),
471
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-4", children: [
472
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
473
+ /* @__PURE__ */ jsx(Label, { htmlFor: "workflowId", className: "text-xs", children: "Workflow ID *" }),
474
+ /* @__PURE__ */ jsx(
475
+ Input,
476
+ {
477
+ id: "workflowId",
478
+ value: workflowId,
479
+ onChange: (e) => setWorkflowId(e.target.value),
480
+ placeholder: "checkout_workflow",
481
+ disabled: !!definitionId
482
+ }
483
+ ),
484
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: definitionId ? "Cannot be changed when editing" : "Lowercase, numbers, hyphens, underscores" })
485
+ ] }),
486
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
487
+ /* @__PURE__ */ jsx(Label, { htmlFor: "workflowName", className: "text-xs", children: "Workflow Name *" }),
488
+ /* @__PURE__ */ jsx(
489
+ Input,
490
+ {
491
+ id: "workflowName",
492
+ value: workflowName,
493
+ onChange: (e) => setWorkflowName(e.target.value),
494
+ placeholder: "Checkout Process"
495
+ }
496
+ )
497
+ ] }),
498
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
499
+ /* @__PURE__ */ jsx(Label, { htmlFor: "category", className: "text-xs", children: "Category" }),
500
+ /* @__PURE__ */ jsx(
501
+ Input,
502
+ {
503
+ id: "category",
504
+ value: category,
505
+ onChange: (e) => setCategory(e.target.value),
506
+ placeholder: "E-Commerce"
507
+ }
508
+ )
509
+ ] }),
510
+ /* @__PURE__ */ jsxs("div", { className: "col-span-3 space-y-1", children: [
511
+ /* @__PURE__ */ jsx(Label, { htmlFor: "description", className: "text-xs", children: "Description" }),
512
+ /* @__PURE__ */ jsx(
513
+ Textarea,
514
+ {
515
+ id: "description",
516
+ value: description,
517
+ onChange: (e) => setDescription(e.target.value),
518
+ placeholder: "Describe the purpose of this workflow...",
519
+ rows: 2
520
+ }
521
+ )
522
+ ] }),
523
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
524
+ /* @__PURE__ */ jsx(Label, { htmlFor: "version", className: "text-xs", children: "Version *" }),
525
+ /* @__PURE__ */ jsx(
526
+ Input,
527
+ {
528
+ id: "version",
529
+ type: "number",
530
+ value: version,
531
+ onChange: (e) => setVersion(parseInt(e.target.value) || 1),
532
+ min: 1,
533
+ disabled: !!definitionId
534
+ }
535
+ ),
536
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Version number (increment for major changes)" })
537
+ ] }),
538
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
539
+ /* @__PURE__ */ jsx(Label, { className: "text-xs", children: "Enabled" }),
540
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
601
541
  /* @__PURE__ */ jsx(
602
- Input,
542
+ Switch,
603
543
  {
604
- id: "effectiveTo",
605
- type: "date",
606
- value: effectiveTo,
607
- onChange: (e) => setEffectiveTo(e.target.value)
544
+ id: "enabled",
545
+ checked: enabled,
546
+ onCheckedChange: setEnabled
608
547
  }
609
548
  ),
610
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Workflow deactivates after this date" })
549
+ /* @__PURE__ */ jsx(Label, { htmlFor: "enabled", className: "text-sm font-normal cursor-pointer", children: "Only enabled workflows can be started" })
611
550
  ] })
551
+ ] }),
552
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
553
+ /* @__PURE__ */ jsx(Label, { className: "text-xs", children: "Tags" }),
554
+ /* @__PURE__ */ jsx(
555
+ TagsInput,
556
+ {
557
+ value: tags,
558
+ onChange: setTags,
559
+ placeholder: t("workflows.form.placeholders.tags")
560
+ }
561
+ ),
562
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("workflows.form.descriptions.tags") })
563
+ ] }),
564
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
565
+ /* @__PURE__ */ jsx(Label, { htmlFor: "icon", className: "text-xs", children: "Icon" }),
566
+ /* @__PURE__ */ jsx(
567
+ Input,
568
+ {
569
+ id: "icon",
570
+ value: icon,
571
+ onChange: (e) => setIcon(e.target.value),
572
+ placeholder: "ShoppingCart"
573
+ }
574
+ ),
575
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Icon name for visual identification" })
576
+ ] }),
577
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
578
+ /* @__PURE__ */ jsx(Label, { htmlFor: "effectiveFrom", className: "text-xs", children: "Effective From" }),
579
+ /* @__PURE__ */ jsx(
580
+ Input,
581
+ {
582
+ id: "effectiveFrom",
583
+ type: "date",
584
+ value: effectiveFrom,
585
+ onChange: (e) => setEffectiveFrom(e.target.value)
586
+ }
587
+ ),
588
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Workflow becomes active from this date" })
589
+ ] }),
590
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
591
+ /* @__PURE__ */ jsx(Label, { htmlFor: "effectiveTo", className: "text-xs", children: "Effective To" }),
592
+ /* @__PURE__ */ jsx(
593
+ Input,
594
+ {
595
+ id: "effectiveTo",
596
+ type: "date",
597
+ value: effectiveTo,
598
+ onChange: (e) => setEffectiveTo(e.target.value)
599
+ }
600
+ ),
601
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Workflow deactivates after this date" })
612
602
  ] })
613
- ] }),
614
- /* @__PURE__ */ jsx(
615
- DefinitionTriggersEditor,
616
- {
617
- value: triggers,
618
- onChange: setTriggers,
619
- className: "mt-4"
620
- }
621
- )
622
- ] }),
603
+ ] })
604
+ ] }) }),
623
605
  /* @__PURE__ */ jsxs(PageBody, { className: "flex-1 flex overflow-hidden", children: [
624
606
  /* @__PURE__ */ jsx("div", { className: "w-88 bg-white border-r border-gray-200 p-6 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
625
607
  /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold uppercase text-muted-foreground mb-2", children: "Step Palette" }),