@open-mercato/core 0.6.6-develop.6089.1.a7ed560528 → 0.6.6-develop.6121.1.5797a901b3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/dist/generated/entities/catalog_product/index.js +52 -0
- package/dist/generated/entities/catalog_product/index.js.map +2 -2
- package/dist/generated/entities/catalog_product_variant/index.js +4 -0
- package/dist/generated/entities/catalog_product_variant/index.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +28 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/catalog/api/products/route.js +103 -33
- package/dist/modules/catalog/api/products/route.js.map +2 -2
- package/dist/modules/catalog/api/variants/route.js +4 -0
- package/dist/modules/catalog/api/variants/route.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +46 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +4 -0
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js +2 -0
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +42 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/commands/products.js +251 -14
- package/dist/modules/catalog/commands/products.js.map +2 -2
- package/dist/modules/catalog/commands/variants.js +72 -1
- package/dist/modules/catalog/commands/variants.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductComplianceSection.js +500 -0
- package/dist/modules/catalog/components/products/ProductComplianceSection.js.map +7 -0
- package/dist/modules/catalog/components/products/VariantBuilder.js +39 -1
- package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
- package/dist/modules/catalog/components/products/productForm.js +164 -2
- package/dist/modules/catalog/components/products/productForm.js.map +2 -2
- package/dist/modules/catalog/components/products/variantForm.js +2 -0
- package/dist/modules/catalog/components/products/variantForm.js.map +2 -2
- package/dist/modules/catalog/data/entities.js +93 -0
- package/dist/modules/catalog/data/entities.js.map +2 -2
- package/dist/modules/catalog/data/types.js +28 -0
- package/dist/modules/catalog/data/types.js.map +2 -2
- package/dist/modules/catalog/data/validators.js +100 -5
- package/dist/modules/catalog/data/validators.js.map +2 -2
- package/dist/modules/catalog/lib/gtin.js +61 -0
- package/dist/modules/catalog/lib/gtin.js.map +7 -0
- package/dist/modules/catalog/migrations/Migration20260611090000.js +17 -0
- package/dist/modules/catalog/migrations/Migration20260611090000.js.map +7 -0
- package/dist/modules/catalog/translations.js +1 -1
- package/dist/modules/catalog/translations.js.map +2 -2
- package/dist/modules/configs/api/cache/route.js +60 -10
- package/dist/modules/configs/api/cache/route.js.map +3 -3
- package/dist/modules/configs/components/CachePanel.js +52 -29
- package/dist/modules/configs/components/CachePanel.js.map +2 -2
- package/dist/modules/currencies/api/currencies/options/route.js +18 -4
- package/dist/modules/currencies/api/currencies/options/route.js.map +2 -2
- package/dist/modules/currencies/services/rateFetchingService.js +35 -18
- package/dist/modules/currencies/services/rateFetchingService.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +16 -16
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +1 -1
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customers/backend/calendar/page.js +10 -0
- package/dist/modules/customers/backend/calendar/page.js.map +7 -0
- package/dist/modules/customers/backend/calendar/page.meta.js +25 -0
- package/dist/modules/customers/backend/calendar/page.meta.js.map +7 -0
- package/dist/modules/customers/cli.js +1 -0
- package/dist/modules/customers/cli.js.map +2 -2
- package/dist/modules/customers/components/calendar/AgendaList.js +182 -0
- package/dist/modules/customers/components/calendar/AgendaList.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarEventEditor.js +331 -0
- package/dist/modules/customers/components/calendar/CalendarEventEditor.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarFooter.js +48 -0
- package/dist/modules/customers/components/calendar/CalendarFooter.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarHeader.js +36 -0
- package/dist/modules/customers/components/calendar/CalendarHeader.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarScreen.js +516 -0
- package/dist/modules/customers/components/calendar/CalendarScreen.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarSettingsModal.js +163 -0
- package/dist/modules/customers/components/calendar/CalendarSettingsModal.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarTabs.js +60 -0
- package/dist/modules/customers/components/calendar/CalendarTabs.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarToolbar.js +262 -0
- package/dist/modules/customers/components/calendar/CalendarToolbar.js.map +7 -0
- package/dist/modules/customers/components/calendar/EventBlock.js +149 -0
- package/dist/modules/customers/components/calendar/EventBlock.js.map +7 -0
- package/dist/modules/customers/components/calendar/EventPeekPopover.js +72 -0
- package/dist/modules/customers/components/calendar/EventPeekPopover.js.map +7 -0
- package/dist/modules/customers/components/calendar/MonthGrid.js +214 -0
- package/dist/modules/customers/components/calendar/MonthGrid.js.map +7 -0
- package/dist/modules/customers/components/calendar/ShortcutsDialog.js +44 -0
- package/dist/modules/customers/components/calendar/ShortcutsDialog.js.map +7 -0
- package/dist/modules/customers/components/calendar/TimeGrid.js +410 -0
- package/dist/modules/customers/components/calendar/TimeGrid.js.map +7 -0
- package/dist/modules/customers/components/calendar/UpcomingCards.js +175 -0
- package/dist/modules/customers/components/calendar/UpcomingCards.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/CategoryField.js +75 -0
- package/dist/modules/customers/components/calendar/editor/CategoryField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/LocationField.js +30 -0
- package/dist/modules/customers/components/calendar/editor/LocationField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/PeopleField.js +135 -0
- package/dist/modules/customers/components/calendar/editor/PeopleField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/RelatedToField.js +218 -0
- package/dist/modules/customers/components/calendar/editor/RelatedToField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/RepeatField.js +119 -0
- package/dist/modules/customers/components/calendar/editor/RepeatField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/ScheduleSection.js +83 -0
- package/dist/modules/customers/components/calendar/editor/ScheduleSection.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/SegmentGroup.js +44 -0
- package/dist/modules/customers/components/calendar/editor/SegmentGroup.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/hooks.js +132 -0
- package/dist/modules/customers/components/calendar/editor/hooks.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/inputs.js +160 -0
- package/dist/modules/customers/components/calendar/editor/inputs.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/lookups.js +107 -0
- package/dist/modules/customers/components/calendar/editor/lookups.js.map +7 -0
- package/dist/modules/customers/components/calendar/types.js +30 -0
- package/dist/modules/customers/components/calendar/types.js.map +7 -0
- package/dist/modules/customers/components/calendar/useCalendarItems.js +131 -0
- package/dist/modules/customers/components/calendar/useCalendarItems.js.map +7 -0
- package/dist/modules/customers/components/calendar/useCalendarPreferences.js +41 -0
- package/dist/modules/customers/components/calendar/useCalendarPreferences.js.map +7 -0
- package/dist/modules/customers/lib/calendar/categories.js +28 -0
- package/dist/modules/customers/lib/calendar/categories.js.map +7 -0
- package/dist/modules/customers/lib/calendar/conflicts.js +72 -0
- package/dist/modules/customers/lib/calendar/conflicts.js.map +7 -0
- package/dist/modules/customers/lib/calendar/editorPayload.js +271 -0
- package/dist/modules/customers/lib/calendar/editorPayload.js.map +7 -0
- package/dist/modules/customers/lib/calendar/grid.js +48 -0
- package/dist/modules/customers/lib/calendar/grid.js.map +7 -0
- package/dist/modules/customers/lib/calendar/layout.js +39 -0
- package/dist/modules/customers/lib/calendar/layout.js.map +7 -0
- package/dist/modules/customers/lib/calendar/mapItem.js +79 -0
- package/dist/modules/customers/lib/calendar/mapItem.js.map +7 -0
- package/dist/modules/customers/lib/calendar/preferences.js +71 -0
- package/dist/modules/customers/lib/calendar/preferences.js.map +7 -0
- package/dist/modules/customers/lib/calendar/range.js +46 -0
- package/dist/modules/customers/lib/calendar/range.js.map +7 -0
- package/dist/modules/customers/lib/calendar/recurrence.js +113 -0
- package/dist/modules/customers/lib/calendar/recurrence.js.map +7 -0
- package/dist/modules/dashboards/services/widgetDataService.js +5 -5
- package/dist/modules/dashboards/services/widgetDataService.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js +61 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js +33 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js +61 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/route.js +33 -1
- package/dist/modules/dictionaries/api/route.js.map +2 -2
- package/dist/modules/feature_toggles/lib/queries.js +36 -52
- package/dist/modules/feature_toggles/lib/queries.js.map +2 -2
- package/dist/modules/messages/commands/actions.js +81 -9
- package/dist/modules/messages/commands/actions.js.map +2 -2
- package/dist/modules/perspectives/api/[tableId]/[perspectiveId]/route.js +32 -1
- package/dist/modules/perspectives/api/[tableId]/[perspectiveId]/route.js.map +2 -2
- package/dist/modules/perspectives/api/[tableId]/roles/[roleId]/route.js +32 -1
- package/dist/modules/perspectives/api/[tableId]/roles/[roleId]/route.js.map +2 -2
- package/dist/modules/perspectives/api/[tableId]/route.js +73 -2
- package/dist/modules/perspectives/api/[tableId]/route.js.map +2 -2
- package/dist/modules/perspectives/services/perspectiveService.js +5 -3
- package/dist/modules/perspectives/services/perspectiveService.js.map +2 -2
- package/dist/modules/planner/api/access.js +9 -0
- package/dist/modules/planner/api/access.js.map +2 -2
- package/dist/modules/planner/api/availability-date-specific.js +22 -1
- package/dist/modules/planner/api/availability-date-specific.js.map +2 -2
- package/dist/modules/planner/api/availability-weekly.js +22 -1
- package/dist/modules/planner/api/availability-weekly.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/assign/route.js +39 -0
- package/dist/modules/resources/api/resources/tags/assign/route.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/unassign/route.js +39 -0
- package/dist/modules/resources/api/resources/tags/unassign/route.js.map +2 -2
- package/dist/modules/sales/api/settings/document-numbers/route.js +33 -1
- package/dist/modules/sales/api/settings/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/settings/order-editing/route.js +35 -3
- package/dist/modules/sales/api/settings/order-editing/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +41 -0
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +41 -0
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/self/route.js +40 -0
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +41 -0
- package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/unassign/route.js +41 -0
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/translations/api/[entityType]/[entityId]/route.js +61 -1
- package/dist/modules/translations/api/[entityType]/[entityId]/route.js.map +2 -2
- package/dist/modules/translations/api/context.js +7 -0
- package/dist/modules/translations/api/context.js.map +2 -2
- package/dist/modules/translations/api/put/locales.js +33 -1
- package/dist/modules/translations/api/put/locales.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js +6 -7
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/[id]/page.js.map +1 -1
- package/dist/modules/workflows/components/EdgeEditDialog.js.map +1 -1
- package/dist/modules/workflows/components/EdgeEditDialogCrudForm.js.map +1 -1
- package/dist/modules/workflows/components/NodeEditDialog.js.map +1 -1
- package/dist/modules/workflows/components/NodeEditDialogCrudForm.js.map +1 -1
- package/dist/modules/workflows/components/WorkflowGraph.js.map +1 -1
- package/dist/modules/workflows/components/WorkflowGraphImpl.js +17 -9
- package/dist/modules/workflows/components/WorkflowGraphImpl.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileVisualEditor.js.map +1 -1
- package/dist/modules/workflows/frontend/checkout-demo/deriveCurrentStep.js +8 -0
- package/dist/modules/workflows/frontend/checkout-demo/deriveCurrentStep.js.map +7 -0
- package/dist/modules/workflows/frontend/checkout-demo/page.js +2 -20
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/dist/modules/workflows/lib/graph-utils.js +8 -0
- package/dist/modules/workflows/lib/graph-utils.js.map +2 -2
- package/generated/entities/catalog_product/index.ts +26 -0
- package/generated/entities/catalog_product_variant/index.ts +2 -0
- package/generated/entity-fields-registry.ts +28 -0
- package/package.json +7 -7
- package/src/modules/catalog/api/products/route.ts +123 -39
- package/src/modules/catalog/api/variants/route.ts +4 -0
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +43 -0
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +14 -0
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/create/page.tsx +2 -0
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +41 -0
- package/src/modules/catalog/commands/products.ts +307 -2
- package/src/modules/catalog/commands/variants.ts +90 -1
- package/src/modules/catalog/components/products/ProductComplianceSection.tsx +497 -0
- package/src/modules/catalog/components/products/VariantBuilder.tsx +43 -0
- package/src/modules/catalog/components/products/productForm.ts +262 -0
- package/src/modules/catalog/components/products/variantForm.ts +4 -0
- package/src/modules/catalog/data/entities.ts +97 -0
- package/src/modules/catalog/data/types.ts +36 -0
- package/src/modules/catalog/data/validators.ts +159 -3
- package/src/modules/catalog/i18n/de.json +64 -0
- package/src/modules/catalog/i18n/en.json +64 -0
- package/src/modules/catalog/i18n/es.json +64 -0
- package/src/modules/catalog/i18n/pl.json +64 -0
- package/src/modules/catalog/lib/gtin.ts +66 -0
- package/src/modules/catalog/migrations/.snapshot-open-mercato.json +457 -0
- package/src/modules/catalog/migrations/Migration20260611090000.ts +17 -0
- package/src/modules/catalog/translations.ts +1 -1
- package/src/modules/configs/api/cache/route.ts +72 -10
- package/src/modules/configs/components/CachePanel.tsx +59 -29
- package/src/modules/currencies/api/currencies/options/route.ts +22 -4
- package/src/modules/currencies/services/rateFetchingService.ts +63 -26
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +18 -18
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +1 -1
- package/src/modules/customer_accounts/i18n/de.json +1 -1
- package/src/modules/customer_accounts/i18n/en.json +1 -1
- package/src/modules/customer_accounts/i18n/es.json +1 -1
- package/src/modules/customer_accounts/i18n/pl.json +1 -1
- package/src/modules/customers/backend/calendar/page.meta.ts +23 -0
- package/src/modules/customers/backend/calendar/page.tsx +12 -0
- package/src/modules/customers/cli.ts +1 -0
- package/src/modules/customers/components/calendar/AgendaList.tsx +219 -0
- package/src/modules/customers/components/calendar/CalendarEventEditor.tsx +386 -0
- package/src/modules/customers/components/calendar/CalendarFooter.tsx +61 -0
- package/src/modules/customers/components/calendar/CalendarHeader.tsx +40 -0
- package/src/modules/customers/components/calendar/CalendarScreen.tsx +590 -0
- package/src/modules/customers/components/calendar/CalendarSettingsModal.tsx +207 -0
- package/src/modules/customers/components/calendar/CalendarTabs.tsx +63 -0
- package/src/modules/customers/components/calendar/CalendarToolbar.tsx +295 -0
- package/src/modules/customers/components/calendar/EventBlock.tsx +205 -0
- package/src/modules/customers/components/calendar/EventPeekPopover.tsx +100 -0
- package/src/modules/customers/components/calendar/MonthGrid.tsx +236 -0
- package/src/modules/customers/components/calendar/ShortcutsDialog.tsx +57 -0
- package/src/modules/customers/components/calendar/TimeGrid.tsx +510 -0
- package/src/modules/customers/components/calendar/UpcomingCards.tsx +220 -0
- package/src/modules/customers/components/calendar/editor/CategoryField.tsx +79 -0
- package/src/modules/customers/components/calendar/editor/LocationField.tsx +37 -0
- package/src/modules/customers/components/calendar/editor/PeopleField.tsx +148 -0
- package/src/modules/customers/components/calendar/editor/RelatedToField.tsx +242 -0
- package/src/modules/customers/components/calendar/editor/RepeatField.tsx +132 -0
- package/src/modules/customers/components/calendar/editor/ScheduleSection.tsx +110 -0
- package/src/modules/customers/components/calendar/editor/SegmentGroup.tsx +50 -0
- package/src/modules/customers/components/calendar/editor/hooks.ts +162 -0
- package/src/modules/customers/components/calendar/editor/inputs.tsx +158 -0
- package/src/modules/customers/components/calendar/editor/lookups.ts +160 -0
- package/src/modules/customers/components/calendar/types.ts +163 -0
- package/src/modules/customers/components/calendar/useCalendarItems.ts +162 -0
- package/src/modules/customers/components/calendar/useCalendarPreferences.ts +52 -0
- package/src/modules/customers/i18n/de.json +195 -0
- package/src/modules/customers/i18n/en.json +195 -0
- package/src/modules/customers/i18n/es.json +195 -0
- package/src/modules/customers/i18n/pl.json +195 -0
- package/src/modules/customers/lib/calendar/categories.ts +26 -0
- package/src/modules/customers/lib/calendar/conflicts.ts +117 -0
- package/src/modules/customers/lib/calendar/editorPayload.ts +388 -0
- package/src/modules/customers/lib/calendar/grid.ts +50 -0
- package/src/modules/customers/lib/calendar/layout.ts +47 -0
- package/src/modules/customers/lib/calendar/mapItem.ts +94 -0
- package/src/modules/customers/lib/calendar/preferences.ts +95 -0
- package/src/modules/customers/lib/calendar/range.ts +45 -0
- package/src/modules/customers/lib/calendar/recurrence.ts +137 -0
- package/src/modules/dashboards/services/widgetDataService.ts +8 -6
- package/src/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.ts +61 -1
- package/src/modules/dictionaries/api/[dictionaryId]/entries/route.ts +33 -1
- package/src/modules/dictionaries/api/[dictionaryId]/route.ts +65 -1
- package/src/modules/dictionaries/api/route.ts +36 -1
- package/src/modules/feature_toggles/lib/queries.ts +41 -60
- package/src/modules/messages/commands/actions.ts +100 -7
- package/src/modules/perspectives/api/[tableId]/[perspectiveId]/route.ts +34 -1
- package/src/modules/perspectives/api/[tableId]/roles/[roleId]/route.ts +34 -1
- package/src/modules/perspectives/api/[tableId]/route.ts +107 -32
- package/src/modules/perspectives/services/perspectiveService.ts +9 -5
- package/src/modules/planner/api/access.ts +9 -0
- package/src/modules/planner/api/availability-date-specific.ts +22 -1
- package/src/modules/planner/api/availability-weekly.ts +22 -1
- package/src/modules/resources/api/resources/tags/assign/route.ts +42 -0
- package/src/modules/resources/api/resources/tags/unassign/route.ts +42 -0
- package/src/modules/sales/api/settings/document-numbers/route.ts +35 -1
- package/src/modules/sales/api/settings/order-editing/route.ts +37 -3
- package/src/modules/staff/api/leave-requests/accept/route.ts +45 -0
- package/src/modules/staff/api/leave-requests/reject/route.ts +45 -0
- package/src/modules/staff/api/team-members/self/route.ts +43 -0
- package/src/modules/staff/api/team-members/tags/assign/route.ts +45 -0
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +45 -0
- package/src/modules/translations/api/[entityType]/[entityId]/route.ts +65 -1
- package/src/modules/translations/api/context.ts +7 -0
- package/src/modules/translations/api/put/locales.ts +35 -1
- package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +11 -9
- package/src/modules/workflows/backend/instances/[id]/page.tsx +1 -1
- package/src/modules/workflows/components/EdgeEditDialog.tsx +1 -1
- package/src/modules/workflows/components/EdgeEditDialogCrudForm.tsx +1 -1
- package/src/modules/workflows/components/NodeEditDialog.tsx +1 -1
- package/src/modules/workflows/components/NodeEditDialogCrudForm.tsx +1 -1
- package/src/modules/workflows/components/WorkflowGraph.tsx +2 -2
- package/src/modules/workflows/components/WorkflowGraphImpl.tsx +27 -13
- package/src/modules/workflows/components/mobile/MobileVisualEditor.tsx +3 -3
- package/src/modules/workflows/frontend/checkout-demo/deriveCurrentStep.ts +12 -0
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +3 -23
- package/src/modules/workflows/lib/graph-utils.ts +21 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server'
|
|
2
2
|
import { z } from 'zod'
|
|
3
|
-
import { resolveTranslationsRouteContext } from '@open-mercato/core/modules/translations/api/context'
|
|
3
|
+
import { resolveTranslationsRouteContext, resolveTranslationsActorId } from '@open-mercato/core/modules/translations/api/context'
|
|
4
4
|
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
5
|
+
import {
|
|
6
|
+
runCrudMutationGuardAfterSuccess,
|
|
7
|
+
validateCrudMutationGuard,
|
|
8
|
+
} from '@open-mercato/shared/lib/crud/mutation-guard'
|
|
5
9
|
import { isValidIso639 } from '@open-mercato/shared/lib/i18n/iso639'
|
|
6
10
|
import type { ModuleConfigService } from '@open-mercato/core/modules/configs/lib/module-config-service'
|
|
7
11
|
import type { OpenApiMethodDoc, OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'
|
|
@@ -23,9 +27,39 @@ async function PUT(req: Request) {
|
|
|
23
27
|
const body = bodySchema.parse(await req.json())
|
|
24
28
|
const uniqueLocales = [...new Set(body.locales.map((l) => l.toLowerCase().trim()))]
|
|
25
29
|
|
|
30
|
+
const guardUserId = resolveTranslationsActorId(context.auth)
|
|
31
|
+
const guardResult = await validateCrudMutationGuard(context.container, {
|
|
32
|
+
tenantId: context.tenantId,
|
|
33
|
+
organizationId: context.organizationId,
|
|
34
|
+
userId: guardUserId,
|
|
35
|
+
resourceKind: 'translations.locales',
|
|
36
|
+
resourceId: 'supported_locales',
|
|
37
|
+
operation: 'custom',
|
|
38
|
+
requestMethod: req.method,
|
|
39
|
+
requestHeaders: req.headers,
|
|
40
|
+
mutationPayload: { locales: uniqueLocales },
|
|
41
|
+
})
|
|
42
|
+
if (guardResult && !guardResult.ok) {
|
|
43
|
+
return NextResponse.json(guardResult.body, { status: guardResult.status })
|
|
44
|
+
}
|
|
45
|
+
|
|
26
46
|
const configService = context.container.resolve('moduleConfigService') as ModuleConfigService
|
|
27
47
|
await configService.setValue('translations', 'supported_locales', uniqueLocales)
|
|
28
48
|
|
|
49
|
+
if (guardResult?.ok && guardResult.shouldRunAfterSuccess) {
|
|
50
|
+
await runCrudMutationGuardAfterSuccess(context.container, {
|
|
51
|
+
tenantId: context.tenantId,
|
|
52
|
+
organizationId: context.organizationId,
|
|
53
|
+
userId: guardUserId,
|
|
54
|
+
resourceKind: 'translations.locales',
|
|
55
|
+
resourceId: 'supported_locales',
|
|
56
|
+
operation: 'custom',
|
|
57
|
+
requestMethod: req.method,
|
|
58
|
+
requestHeaders: req.headers,
|
|
59
|
+
metadata: guardResult.metadata ?? null,
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
29
63
|
return NextResponse.json({ locales: uniqueLocales })
|
|
30
64
|
} catch (err) {
|
|
31
65
|
if (isCrudHttpError(err)) {
|
|
@@ -6,10 +6,10 @@ import { NodeEditDialog } from '../../../components/NodeEditDialog'
|
|
|
6
6
|
import { EdgeEditDialog } from '../../../components/EdgeEditDialog'
|
|
7
7
|
import { NodeEditDialogCrudForm } from '../../../components/NodeEditDialogCrudForm'
|
|
8
8
|
import { EdgeEditDialogCrudForm } from '../../../components/EdgeEditDialogCrudForm'
|
|
9
|
-
import { Node, Edge,
|
|
9
|
+
import type { Node, Edge, Connection } from '@xyflow/react'
|
|
10
10
|
import { useState, useCallback, useEffect } from 'react'
|
|
11
11
|
import { useRouter, useSearchParams } from 'next/navigation'
|
|
12
|
-
import { graphToDefinition, definitionToGraph, validateWorkflowGraph, generateStepId, generateTransitionId, ValidationError } from '../../../lib/graph-utils'
|
|
12
|
+
import { graphToDefinition, definitionToGraph, validateWorkflowGraph, generateStepId, generateTransitionId, appendWorkflowEdge, ValidationError } from '../../../lib/graph-utils'
|
|
13
13
|
import { performDeleteEdgeFlow, performDeleteNodeFlow } from '../../../lib/visual-editor-delete-flow'
|
|
14
14
|
import { workflowDefinitionDataSchema } from '../../../data/validators'
|
|
15
15
|
import { Page } from '@open-mercato/ui/backend/Page'
|
|
@@ -169,16 +169,18 @@ export default function VisualEditorPage() {
|
|
|
169
169
|
loadDefinition()
|
|
170
170
|
}, [definitionId])
|
|
171
171
|
|
|
172
|
-
// Handle node changes from ReactFlow
|
|
173
|
-
|
|
172
|
+
// Handle node changes from ReactFlow. The lazy graph applies React Flow's
|
|
173
|
+
// change reducers internally (#3169) and hands back the resolved nodes, so
|
|
174
|
+
// this page never imports the @xyflow/react runtime.
|
|
175
|
+
const handleNodesChange = useCallback((nextNodes: Node[]) => {
|
|
174
176
|
if (isCodeOnly) return
|
|
175
|
-
setNodes(
|
|
177
|
+
setNodes(nextNodes)
|
|
176
178
|
}, [isCodeOnly])
|
|
177
179
|
|
|
178
|
-
// Handle edge changes from ReactFlow
|
|
179
|
-
const handleEdgesChange = useCallback((
|
|
180
|
+
// Handle edge changes from ReactFlow (resolved edges from the lazy graph).
|
|
181
|
+
const handleEdgesChange = useCallback((nextEdges: Edge[]) => {
|
|
180
182
|
if (isCodeOnly) return
|
|
181
|
-
setEdges(
|
|
183
|
+
setEdges(nextEdges)
|
|
182
184
|
}, [isCodeOnly])
|
|
183
185
|
|
|
184
186
|
// Handle adding new node from palette
|
|
@@ -285,7 +287,7 @@ export default function VisualEditorPage() {
|
|
|
285
287
|
},
|
|
286
288
|
}
|
|
287
289
|
|
|
288
|
-
setEdges((eds) =>
|
|
290
|
+
setEdges((eds) => appendWorkflowEdge(eds, newEdge))
|
|
289
291
|
}, [])
|
|
290
292
|
|
|
291
293
|
// Validate workflow
|
|
@@ -18,7 +18,7 @@ import { WorkflowLegend } from '../../../components/WorkflowLegend'
|
|
|
18
18
|
import { MobileInstanceOverview } from '../../../components/mobile/MobileInstanceOverview'
|
|
19
19
|
import { useIsMobile } from '@open-mercato/ui/hooks/useIsMobile'
|
|
20
20
|
import { definitionToGraph } from '../../../lib/graph-utils'
|
|
21
|
-
import { Node } from '@xyflow/react'
|
|
21
|
+
import type { Node } from '@xyflow/react'
|
|
22
22
|
import { RecordNotFoundState, ErrorMessage } from '@open-mercato/ui/backend/detail'
|
|
23
23
|
|
|
24
24
|
export default function WorkflowInstanceDetailPage({ params }: { params?: { id?: string } }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { Edge } from '@xyflow/react'
|
|
3
|
+
import type { Edge } from '@xyflow/react'
|
|
4
4
|
import { useState, useEffect, useCallback, useMemo } from 'react'
|
|
5
5
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@open-mercato/ui/primitives/dialog'
|
|
6
6
|
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import {Node} from '@xyflow/react'
|
|
3
|
+
import type {Node} from '@xyflow/react'
|
|
4
4
|
import {useEffect, useState} from 'react'
|
|
5
5
|
import {Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle} from '@open-mercato/ui/primitives/dialog'
|
|
6
6
|
import {Button} from '@open-mercato/ui/primitives/button'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { Node } from '@xyflow/react'
|
|
3
|
+
import type { Node } from '@xyflow/react'
|
|
4
4
|
import { useState, useEffect, useCallback, useMemo } from 'react'
|
|
5
5
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@open-mercato/ui/primitives/dialog'
|
|
6
6
|
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
@@ -8,8 +8,8 @@ import { Spinner } from '@open-mercato/ui/primitives/spinner'
|
|
|
8
8
|
export interface WorkflowGraphProps {
|
|
9
9
|
initialNodes?: Node[]
|
|
10
10
|
initialEdges?: Edge[]
|
|
11
|
-
onNodesChange?: (
|
|
12
|
-
onEdgesChange?: (
|
|
11
|
+
onNodesChange?: (nodes: Node[]) => void
|
|
12
|
+
onEdgesChange?: (edges: Edge[]) => void
|
|
13
13
|
onNodeClick?: (event: React.MouseEvent, node: Node) => void
|
|
14
14
|
onEdgeClick?: (event: React.MouseEvent, edge: Edge) => void
|
|
15
15
|
onConnect?: (connection: Connection) => void
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import '@xyflow/react/dist/style.css'
|
|
4
4
|
|
|
5
|
-
import { useCallback, useMemo, useEffect, useState } from 'react'
|
|
5
|
+
import { useCallback, useMemo, useEffect, useRef, useState } from 'react'
|
|
6
6
|
import {
|
|
7
7
|
ReactFlow,
|
|
8
8
|
Node,
|
|
@@ -15,7 +15,11 @@ import {
|
|
|
15
15
|
useNodesState,
|
|
16
16
|
useEdgesState,
|
|
17
17
|
addEdge,
|
|
18
|
+
applyNodeChanges,
|
|
19
|
+
applyEdgeChanges,
|
|
18
20
|
Connection,
|
|
21
|
+
NodeChange,
|
|
22
|
+
EdgeChange,
|
|
19
23
|
ConnectionMode,
|
|
20
24
|
MarkerType,
|
|
21
25
|
} from '@xyflow/react'
|
|
@@ -30,8 +34,8 @@ import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
|
30
34
|
export interface WorkflowGraphImplProps {
|
|
31
35
|
initialNodes?: Node[]
|
|
32
36
|
initialEdges?: Edge[]
|
|
33
|
-
onNodesChange?: (
|
|
34
|
-
onEdgesChange?: (
|
|
37
|
+
onNodesChange?: (nodes: Node[]) => void
|
|
38
|
+
onEdgesChange?: (edges: Edge[]) => void
|
|
35
39
|
onNodeClick?: (event: React.MouseEvent, node: Node) => void
|
|
36
40
|
onEdgeClick?: (event: React.MouseEvent, edge: Edge) => void
|
|
37
41
|
onConnect?: (connection: Connection) => void
|
|
@@ -53,8 +57,16 @@ export default function WorkflowGraphImpl({
|
|
|
53
57
|
height = '600px',
|
|
54
58
|
}: WorkflowGraphImplProps) {
|
|
55
59
|
const t = useT()
|
|
56
|
-
const [nodes, setNodes
|
|
57
|
-
const [edges, setEdges
|
|
60
|
+
const [nodes, setNodes] = useNodesState(initialNodes)
|
|
61
|
+
const [edges, setEdges] = useEdgesState(initialEdges)
|
|
62
|
+
|
|
63
|
+
// Track the latest committed graph so the change reducers can run inside the
|
|
64
|
+
// lazy boundary (#3169) and forward the already-applied arrays to the parent,
|
|
65
|
+
// keeping React Flow's runtime out of the editor page chunk.
|
|
66
|
+
const latestNodesRef = useRef(nodes)
|
|
67
|
+
latestNodesRef.current = nodes
|
|
68
|
+
const latestEdgesRef = useRef(edges)
|
|
69
|
+
latestEdgesRef.current = edges
|
|
58
70
|
|
|
59
71
|
const { resolvedTheme } = useTheme()
|
|
60
72
|
const isDark = resolvedTheme === 'dark'
|
|
@@ -105,23 +117,25 @@ export default function WorkflowGraphImpl({
|
|
|
105
117
|
)
|
|
106
118
|
|
|
107
119
|
const handleNodesChange = useCallback(
|
|
108
|
-
(changes:
|
|
109
|
-
|
|
120
|
+
(changes: NodeChange[]) => {
|
|
121
|
+
const nextNodes = applyNodeChanges(changes, latestNodesRef.current)
|
|
122
|
+
setNodes(nextNodes)
|
|
110
123
|
if (onNodesChangeProp) {
|
|
111
|
-
onNodesChangeProp(
|
|
124
|
+
onNodesChangeProp(nextNodes)
|
|
112
125
|
}
|
|
113
126
|
},
|
|
114
|
-
[
|
|
127
|
+
[setNodes, onNodesChangeProp]
|
|
115
128
|
)
|
|
116
129
|
|
|
117
130
|
const handleEdgesChange = useCallback(
|
|
118
|
-
(changes:
|
|
119
|
-
|
|
131
|
+
(changes: EdgeChange[]) => {
|
|
132
|
+
const nextEdges = applyEdgeChanges(changes, latestEdgesRef.current)
|
|
133
|
+
setEdges(nextEdges)
|
|
120
134
|
if (onEdgesChangeProp) {
|
|
121
|
-
onEdgesChangeProp(
|
|
135
|
+
onEdgesChangeProp(nextEdges)
|
|
122
136
|
}
|
|
123
137
|
},
|
|
124
|
-
[
|
|
138
|
+
[setEdges, onEdgesChangeProp]
|
|
125
139
|
)
|
|
126
140
|
|
|
127
141
|
const nodeTypes = useMemo(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { useState } from 'react'
|
|
4
|
-
import type { Node, Edge,
|
|
4
|
+
import type { Node, Edge, Connection } from '@xyflow/react'
|
|
5
5
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
6
6
|
import {
|
|
7
7
|
Dialog,
|
|
@@ -21,8 +21,8 @@ export interface MobileVisualEditorProps {
|
|
|
21
21
|
isSaving: boolean
|
|
22
22
|
nodes: Node[]
|
|
23
23
|
edges: Edge[]
|
|
24
|
-
onNodesChange: (
|
|
25
|
-
onEdgesChange: (
|
|
24
|
+
onNodesChange: (nodes: Node[]) => void
|
|
25
|
+
onEdgesChange: (edges: Edge[]) => void
|
|
26
26
|
onNodeClick: (event: React.MouseEvent, node: Node) => void
|
|
27
27
|
onEdgeClick: (event: React.MouseEvent, edge: Edge) => void
|
|
28
28
|
onConnect: (connection: Connection) => void
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derives the current workflow step from the running instance's `currentStepId`
|
|
3
|
+
* and the available workflow steps. This is a pure function of its inputs so the
|
|
4
|
+
* checkout demo can compute it during render instead of mirroring it into state.
|
|
5
|
+
*/
|
|
6
|
+
export function deriveCurrentStep<TStep extends { stepId: string }>(
|
|
7
|
+
currentStepId: string | undefined,
|
|
8
|
+
steps: TStep[],
|
|
9
|
+
): TStep | null {
|
|
10
|
+
if (!currentStepId) return null
|
|
11
|
+
return steps.find((step) => step.stepId === currentStepId) ?? null
|
|
12
|
+
}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import Link from 'next/link'
|
|
15
15
|
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
|
16
16
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
17
|
+
import { deriveCurrentStep } from './deriveCurrentStep'
|
|
17
18
|
|
|
18
19
|
interface CartItem {
|
|
19
20
|
id: string // Product UUID
|
|
@@ -62,8 +63,6 @@ export default function CheckoutDemoPage() {
|
|
|
62
63
|
const [advancing, setAdvancing] = useState(false)
|
|
63
64
|
const [result, setResult] = useState<WorkflowResult | null>(null)
|
|
64
65
|
const [error, setError] = useState<string | null>(null)
|
|
65
|
-
const [currentStep, setCurrentStep] = useState<StepInfo | null>(null)
|
|
66
|
-
const [availableSteps, setAvailableSteps] = useState<StepInfo[]>([])
|
|
67
66
|
const [formData, setFormData] = useState<Record<string, any>>({})
|
|
68
67
|
const [submittingTask, setSubmittingTask] = useState(false)
|
|
69
68
|
const [taskError, setTaskError] = useState<string | null>(null)
|
|
@@ -270,21 +269,8 @@ export default function CheckoutDemoPage() {
|
|
|
270
269
|
{ stepId: 'end', stepName: 'Complete', stepType: 'END', description: 'Checkout completed' },
|
|
271
270
|
]
|
|
272
271
|
|
|
273
|
-
//
|
|
274
|
-
|
|
275
|
-
if (result?.currentStepId) {
|
|
276
|
-
const current = workflowSteps.find(s => s.stepId === result.currentStepId)
|
|
277
|
-
setCurrentStep(current || null)
|
|
278
|
-
|
|
279
|
-
// Find next available steps (simple - just show next step)
|
|
280
|
-
const currentIndex = workflowSteps.findIndex(s => s.stepId === result.currentStepId)
|
|
281
|
-
if (currentIndex >= 0 && currentIndex < workflowSteps.length - 1) {
|
|
282
|
-
setAvailableSteps([workflowSteps[currentIndex + 1]])
|
|
283
|
-
} else {
|
|
284
|
-
setAvailableSteps([])
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}, [result])
|
|
272
|
+
// Current step derived from the running instance and the workflow steps
|
|
273
|
+
const currentStep = deriveCurrentStep(result?.currentStepId, workflowSteps)
|
|
288
274
|
|
|
289
275
|
// Add initial delay before polling for user tasks when workflow becomes PAUSED
|
|
290
276
|
// This reduces race condition where API returns before background execution completes
|
|
@@ -1490,8 +1476,6 @@ export default function CheckoutDemoPage() {
|
|
|
1490
1476
|
onClick={() => {
|
|
1491
1477
|
setResult(null)
|
|
1492
1478
|
setError(null)
|
|
1493
|
-
setCurrentStep(null)
|
|
1494
|
-
setAvailableSteps([])
|
|
1495
1479
|
}}
|
|
1496
1480
|
variant="outline"
|
|
1497
1481
|
className="w-full"
|
|
@@ -1515,8 +1499,6 @@ export default function CheckoutDemoPage() {
|
|
|
1515
1499
|
onClick={() => {
|
|
1516
1500
|
setResult(null)
|
|
1517
1501
|
setError(null)
|
|
1518
|
-
setCurrentStep(null)
|
|
1519
|
-
setAvailableSteps([])
|
|
1520
1502
|
}}
|
|
1521
1503
|
className="w-full mt-6"
|
|
1522
1504
|
>
|
|
@@ -1773,8 +1755,6 @@ export default function CheckoutDemoPage() {
|
|
|
1773
1755
|
onClick={() => {
|
|
1774
1756
|
setResult(null)
|
|
1775
1757
|
setError(null)
|
|
1776
|
-
setCurrentStep(null)
|
|
1777
|
-
setAvailableSteps([])
|
|
1778
1758
|
}}
|
|
1779
1759
|
variant="outline"
|
|
1780
1760
|
className="w-full"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, Edge } from '@xyflow/react'
|
|
1
|
+
import type { Node, Edge } from '@xyflow/react'
|
|
2
2
|
import type { WorkflowDefinition } from '../data/entities'
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -659,3 +659,23 @@ export function generateTransitionId(fromStepId: string, toStepId: string): stri
|
|
|
659
659
|
const id = `e_${fromStepId}_${toStepId}`
|
|
660
660
|
return sanitizeId(id)
|
|
661
661
|
}
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* Append a new edge to the list, skipping duplicate connections.
|
|
665
|
+
*
|
|
666
|
+
* A plain-data replacement for React Flow's `addEdge` so the visual editor
|
|
667
|
+
* page does not pull the `@xyflow/react` runtime out of its lazy boundary
|
|
668
|
+
* (#3169). Mirrors `addEdge`'s dedup rule: an edge is dropped when one with
|
|
669
|
+
* the same source/target endpoints (and handles) already exists.
|
|
670
|
+
*/
|
|
671
|
+
export function appendWorkflowEdge(edges: Edge[], edge: Edge): Edge[] {
|
|
672
|
+
const isDuplicate = edges.some(
|
|
673
|
+
(existing) =>
|
|
674
|
+
existing.source === edge.source &&
|
|
675
|
+
existing.target === edge.target &&
|
|
676
|
+
// Match addEdge: empty-string and nullish handles are equivalent.
|
|
677
|
+
(existing.sourceHandle || null) === (edge.sourceHandle || null) &&
|
|
678
|
+
(existing.targetHandle || null) === (edge.targetHandle || null),
|
|
679
|
+
)
|
|
680
|
+
return isDuplicate ? edges : [...edges, edge]
|
|
681
|
+
}
|