@endora-commerce/admin-kit 0.0.0-stage → 0.100.0
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/LICENSE +21 -0
- package/README.md +212 -2
- package/dist/components/FileDropzone.d.ts +13 -0
- package/dist/components/FileDropzone.d.ts.map +1 -0
- package/dist/components/FileDropzone.js +39 -0
- package/dist/components/FileDropzone.js.map +1 -0
- package/dist/components/PaginationFooter.d.ts +25 -0
- package/dist/components/PaginationFooter.d.ts.map +1 -0
- package/dist/components/PaginationFooter.js +33 -0
- package/dist/components/PaginationFooter.js.map +1 -0
- package/dist/components/ResponsiveTable.d.ts +26 -0
- package/dist/components/ResponsiveTable.d.ts.map +1 -0
- package/dist/components/ResponsiveTable.js +34 -0
- package/dist/components/ResponsiveTable.js.map +1 -0
- package/dist/components/RowActionMenu.d.ts +40 -0
- package/dist/components/RowActionMenu.d.ts.map +1 -0
- package/dist/components/RowActionMenu.js +15 -0
- package/dist/components/RowActionMenu.js.map +1 -0
- package/dist/components/StickyFormActions.d.ts +10 -0
- package/dist/components/StickyFormActions.d.ts.map +1 -0
- package/dist/components/StickyFormActions.js +10 -0
- package/dist/components/StickyFormActions.js.map +1 -0
- package/dist/components/TouchReorderButtons.d.ts +13 -0
- package/dist/components/TouchReorderButtons.d.ts.map +1 -0
- package/dist/components/TouchReorderButtons.js +12 -0
- package/dist/components/TouchReorderButtons.js.map +1 -0
- package/dist/components/admin-user-picker/AdminUserPicker.d.ts +14 -0
- package/dist/components/admin-user-picker/AdminUserPicker.d.ts.map +1 -0
- package/dist/components/admin-user-picker/AdminUserPicker.js +68 -0
- package/dist/components/admin-user-picker/AdminUserPicker.js.map +1 -0
- package/dist/components/asset-picker/AssetFieldPicker.d.ts +32 -0
- package/dist/components/asset-picker/AssetFieldPicker.d.ts.map +1 -0
- package/dist/components/asset-picker/AssetFieldPicker.js +42 -0
- package/dist/components/asset-picker/AssetFieldPicker.js.map +1 -0
- package/dist/components/asset-picker/AssetPicker.d.ts +31 -0
- package/dist/components/asset-picker/AssetPicker.d.ts.map +1 -0
- package/dist/components/asset-picker/AssetPicker.js +68 -0
- package/dist/components/asset-picker/AssetPicker.js.map +1 -0
- package/dist/components/asset-picker/AssetUploader.d.ts +15 -0
- package/dist/components/asset-picker/AssetUploader.d.ts.map +1 -0
- package/dist/components/asset-picker/AssetUploader.js +61 -0
- package/dist/components/asset-picker/AssetUploader.js.map +1 -0
- package/dist/components/asset-picker/assets-api.d.ts +49 -0
- package/dist/components/asset-picker/assets-api.d.ts.map +1 -0
- package/dist/components/asset-picker/assets-api.js +67 -0
- package/dist/components/asset-picker/assets-api.js.map +1 -0
- package/dist/components/category-picker/CategorySelect.d.ts +14 -0
- package/dist/components/category-picker/CategorySelect.d.ts.map +1 -0
- package/dist/components/category-picker/CategorySelect.js +41 -0
- package/dist/components/category-picker/CategorySelect.js.map +1 -0
- package/dist/components/category-tree-picker/CategoryTreeNodeRow.d.ts +18 -0
- package/dist/components/category-tree-picker/CategoryTreeNodeRow.d.ts.map +1 -0
- package/dist/components/category-tree-picker/CategoryTreeNodeRow.js +19 -0
- package/dist/components/category-tree-picker/CategoryTreeNodeRow.js.map +1 -0
- package/dist/components/category-tree-picker/CategoryTreePicker.d.ts +23 -0
- package/dist/components/category-tree-picker/CategoryTreePicker.d.ts.map +1 -0
- package/dist/components/category-tree-picker/CategoryTreePicker.js +82 -0
- package/dist/components/category-tree-picker/CategoryTreePicker.js.map +1 -0
- package/dist/components/category-tree-picker/category-tree-utils.d.ts +35 -0
- package/dist/components/category-tree-picker/category-tree-utils.d.ts.map +1 -0
- package/dist/components/category-tree-picker/category-tree-utils.js +140 -0
- package/dist/components/category-tree-picker/category-tree-utils.js.map +1 -0
- package/dist/components/category-tree-picker/index.d.ts +4 -0
- package/dist/components/category-tree-picker/index.d.ts.map +1 -0
- package/dist/components/category-tree-picker/index.js +2 -0
- package/dist/components/category-tree-picker/index.js.map +1 -0
- package/dist/components/charts/echart.d.ts +17 -0
- package/dist/components/charts/echart.d.ts.map +1 -0
- package/dist/components/charts/echart.js +61 -0
- package/dist/components/charts/echart.js.map +1 -0
- package/dist/components/cms-picker/CmsBlockPicker.d.ts +14 -0
- package/dist/components/cms-picker/CmsBlockPicker.d.ts.map +1 -0
- package/dist/components/cms-picker/CmsBlockPicker.js +40 -0
- package/dist/components/cms-picker/CmsBlockPicker.js.map +1 -0
- package/dist/components/cms-picker/CmsPagePicker.d.ts +15 -0
- package/dist/components/cms-picker/CmsPagePicker.d.ts.map +1 -0
- package/dist/components/cms-picker/CmsPagePicker.js +80 -0
- package/dist/components/cms-picker/CmsPagePicker.js.map +1 -0
- package/dist/components/content-language-tabs/ContentLanguageTabs.d.ts +30 -0
- package/dist/components/content-language-tabs/ContentLanguageTabs.d.ts.map +1 -0
- package/dist/components/content-language-tabs/ContentLanguageTabs.js +14 -0
- package/dist/components/content-language-tabs/ContentLanguageTabs.js.map +1 -0
- package/dist/components/country-select/CountrySelect.d.ts +29 -0
- package/dist/components/country-select/CountrySelect.d.ts.map +1 -0
- package/dist/components/country-select/CountrySelect.js +40 -0
- package/dist/components/country-select/CountrySelect.js.map +1 -0
- package/dist/components/country-select/index.d.ts +3 -0
- package/dist/components/country-select/index.d.ts.map +1 -0
- package/dist/components/country-select/index.js +3 -0
- package/dist/components/country-select/index.js.map +1 -0
- package/dist/components/country-select/useCountriesQuery.d.ts +12 -0
- package/dist/components/country-select/useCountriesQuery.d.ts.map +1 -0
- package/dist/components/country-select/useCountriesQuery.js +69 -0
- package/dist/components/country-select/useCountriesQuery.js.map +1 -0
- package/dist/components/custom-field-values/CustomFieldValuesPanel.d.ts +48 -0
- package/dist/components/custom-field-values/CustomFieldValuesPanel.d.ts.map +1 -0
- package/dist/components/custom-field-values/CustomFieldValuesPanel.js +122 -0
- package/dist/components/custom-field-values/CustomFieldValuesPanel.js.map +1 -0
- package/dist/components/customer-group-picker/CustomerGroupPicker.d.ts +14 -0
- package/dist/components/customer-group-picker/CustomerGroupPicker.d.ts.map +1 -0
- package/dist/components/customer-group-picker/CustomerGroupPicker.js +36 -0
- package/dist/components/customer-group-picker/CustomerGroupPicker.js.map +1 -0
- package/dist/components/customer-picker/CustomerPicker.d.ts +18 -0
- package/dist/components/customer-picker/CustomerPicker.d.ts.map +1 -0
- package/dist/components/customer-picker/CustomerPicker.js +85 -0
- package/dist/components/customer-picker/CustomerPicker.js.map +1 -0
- package/dist/components/dictionary-picker/CountryPicker.d.ts +26 -0
- package/dist/components/dictionary-picker/CountryPicker.d.ts.map +1 -0
- package/dist/components/dictionary-picker/CountryPicker.js +29 -0
- package/dist/components/dictionary-picker/CountryPicker.js.map +1 -0
- package/dist/components/dictionary-picker/CurrencyPicker.d.ts +17 -0
- package/dist/components/dictionary-picker/CurrencyPicker.d.ts.map +1 -0
- package/dist/components/dictionary-picker/CurrencyPicker.js +29 -0
- package/dist/components/dictionary-picker/CurrencyPicker.js.map +1 -0
- package/dist/components/dictionary-picker/dictionary-api.d.ts +21 -0
- package/dist/components/dictionary-picker/dictionary-api.d.ts.map +1 -0
- package/dist/components/dictionary-picker/dictionary-api.js +26 -0
- package/dist/components/dictionary-picker/dictionary-api.js.map +1 -0
- package/dist/components/dictionary-picker/index.d.ts +4 -0
- package/dist/components/dictionary-picker/index.d.ts.map +1 -0
- package/dist/components/dictionary-picker/index.js +4 -0
- package/dist/components/dictionary-picker/index.js.map +1 -0
- package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.d.ts +49 -0
- package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.d.ts.map +1 -0
- package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.js +43 -0
- package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.js.map +1 -0
- package/dist/components/hooks/useFocusTrap.d.ts +6 -0
- package/dist/components/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/components/hooks/useFocusTrap.js +41 -0
- package/dist/components/hooks/useFocusTrap.js.map +1 -0
- package/dist/components/hooks/useViewportTier.d.ts +7 -0
- package/dist/components/hooks/useViewportTier.d.ts.map +1 -0
- package/dist/components/hooks/useViewportTier.js +23 -0
- package/dist/components/hooks/useViewportTier.js.map +1 -0
- package/dist/components/index.d.ts +101 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +63 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/organization-picker/OrganizationPicker.d.ts +28 -0
- package/dist/components/organization-picker/OrganizationPicker.d.ts.map +1 -0
- package/dist/components/organization-picker/OrganizationPicker.js +35 -0
- package/dist/components/organization-picker/OrganizationPicker.js.map +1 -0
- package/dist/components/organization-picker/OrganizationPickerMulti.d.ts +32 -0
- package/dist/components/organization-picker/OrganizationPickerMulti.d.ts.map +1 -0
- package/dist/components/organization-picker/OrganizationPickerMulti.js +55 -0
- package/dist/components/organization-picker/OrganizationPickerMulti.js.map +1 -0
- package/dist/components/organization-picker/OrganizationStatusBadge.d.ts +7 -0
- package/dist/components/organization-picker/OrganizationStatusBadge.d.ts.map +1 -0
- package/dist/components/organization-picker/OrganizationStatusBadge.js +33 -0
- package/dist/components/organization-picker/OrganizationStatusBadge.js.map +1 -0
- package/dist/components/organization-picker/useOrganizationsQuery.d.ts +33 -0
- package/dist/components/organization-picker/useOrganizationsQuery.d.ts.map +1 -0
- package/dist/components/organization-picker/useOrganizationsQuery.js +92 -0
- package/dist/components/organization-picker/useOrganizationsQuery.js.map +1 -0
- package/dist/components/payment-method-availability/MethodAvailabilityCell.d.ts +38 -0
- package/dist/components/payment-method-availability/MethodAvailabilityCell.d.ts.map +1 -0
- package/dist/components/payment-method-availability/MethodAvailabilityCell.js +50 -0
- package/dist/components/payment-method-availability/MethodAvailabilityCell.js.map +1 -0
- package/dist/components/product-picker/ProductPicker.d.ts +22 -0
- package/dist/components/product-picker/ProductPicker.d.ts.map +1 -0
- package/dist/components/product-picker/ProductPicker.js +143 -0
- package/dist/components/product-picker/ProductPicker.js.map +1 -0
- package/dist/components/reorder/ReorderAnnouncer.d.ts +29 -0
- package/dist/components/reorder/ReorderAnnouncer.d.ts.map +1 -0
- package/dist/components/reorder/ReorderAnnouncer.js +6 -0
- package/dist/components/reorder/ReorderAnnouncer.js.map +1 -0
- package/dist/components/reorder/useReorderList.d.ts +121 -0
- package/dist/components/reorder/useReorderList.d.ts.map +1 -0
- package/dist/components/reorder/useReorderList.js +241 -0
- package/dist/components/reorder/useReorderList.js.map +1 -0
- package/dist/components/rule-builder/RuleBuilder.d.ts +105 -0
- package/dist/components/rule-builder/RuleBuilder.d.ts.map +1 -0
- package/dist/components/rule-builder/RuleBuilder.js +138 -0
- package/dist/components/rule-builder/RuleBuilder.js.map +1 -0
- package/dist/components/sales-channel-picker/SalesChannelPicker.d.ts +15 -0
- package/dist/components/sales-channel-picker/SalesChannelPicker.d.ts.map +1 -0
- package/dist/components/sales-channel-picker/SalesChannelPicker.js +79 -0
- package/dist/components/sales-channel-picker/SalesChannelPicker.js.map +1 -0
- package/dist/components/scope-notice/ScopeNotice.d.ts +33 -0
- package/dist/components/scope-notice/ScopeNotice.d.ts.map +1 -0
- package/dist/components/scope-notice/ScopeNotice.js +11 -0
- package/dist/components/scope-notice/ScopeNotice.js.map +1 -0
- package/dist/components/scope-picker/ScopePicker.d.ts +28 -0
- package/dist/components/scope-picker/ScopePicker.d.ts.map +1 -0
- package/dist/components/scope-picker/ScopePicker.js +114 -0
- package/dist/components/scope-picker/ScopePicker.js.map +1 -0
- package/dist/components/scope-picker/sales-channels-api.d.ts +19 -0
- package/dist/components/scope-picker/sales-channels-api.d.ts.map +1 -0
- package/dist/components/scope-picker/sales-channels-api.js +30 -0
- package/dist/components/scope-picker/sales-channels-api.js.map +1 -0
- package/dist/components/status-transition-graph/StatusTransitionGraph.d.ts +26 -0
- package/dist/components/status-transition-graph/StatusTransitionGraph.d.ts.map +1 -0
- package/dist/components/status-transition-graph/StatusTransitionGraph.js +241 -0
- package/dist/components/status-transition-graph/StatusTransitionGraph.js.map +1 -0
- package/dist/components/status-transition-graph/index.d.ts +3 -0
- package/dist/components/status-transition-graph/index.d.ts.map +1 -0
- package/dist/components/status-transition-graph/index.js +2 -0
- package/dist/components/status-transition-graph/index.js.map +1 -0
- package/dist/contributions/index.d.ts +44 -0
- package/dist/contributions/index.d.ts.map +1 -0
- package/dist/contributions/index.js +42 -0
- package/dist/contributions/index.js.map +1 -0
- package/dist/contributions/zone-component.d.ts +70 -0
- package/dist/contributions/zone-component.d.ts.map +1 -0
- package/dist/contributions/zone-component.js +26 -0
- package/dist/contributions/zone-component.js.map +1 -0
- package/dist/field-protection/FieldProtectionPricePanel.d.ts +26 -0
- package/dist/field-protection/FieldProtectionPricePanel.d.ts.map +1 -0
- package/dist/field-protection/FieldProtectionPricePanel.js +14 -0
- package/dist/field-protection/FieldProtectionPricePanel.js.map +1 -0
- package/dist/field-protection/FieldProtectionSummary.d.ts +18 -0
- package/dist/field-protection/FieldProtectionSummary.d.ts.map +1 -0
- package/dist/field-protection/FieldProtectionSummary.js +18 -0
- package/dist/field-protection/FieldProtectionSummary.js.map +1 -0
- package/dist/field-protection/FieldProtectionToggle.d.ts +36 -0
- package/dist/field-protection/FieldProtectionToggle.d.ts.map +1 -0
- package/dist/field-protection/FieldProtectionToggle.js +30 -0
- package/dist/field-protection/FieldProtectionToggle.js.map +1 -0
- package/dist/field-protection/describe-path.d.ts +27 -0
- package/dist/field-protection/describe-path.d.ts.map +1 -0
- package/dist/field-protection/describe-path.js +28 -0
- package/dist/field-protection/describe-path.js.map +1 -0
- package/dist/field-protection/index.d.ts +46 -0
- package/dist/field-protection/index.d.ts.map +1 -0
- package/dist/field-protection/index.js +41 -0
- package/dist/field-protection/index.js.map +1 -0
- package/dist/field-protection/types.d.ts +93 -0
- package/dist/field-protection/types.d.ts.map +1 -0
- package/dist/field-protection/types.js +2 -0
- package/dist/field-protection/types.js.map +1 -0
- package/dist/field-protection/use-field-protection.d.ts +27 -0
- package/dist/field-protection/use-field-protection.d.ts.map +1 -0
- package/dist/field-protection/use-field-protection.js +149 -0
- package/dist/field-protection/use-field-protection.js.map +1 -0
- package/dist/i18n/TranslationProvider.d.ts +27 -0
- package/dist/i18n/TranslationProvider.d.ts.map +1 -0
- package/dist/i18n/TranslationProvider.js +130 -0
- package/dist/i18n/TranslationProvider.js.map +1 -0
- package/dist/i18n/app-language-context.d.ts +8 -0
- package/dist/i18n/app-language-context.d.ts.map +1 -0
- package/dist/i18n/app-language-context.js +13 -0
- package/dist/i18n/app-language-context.js.map +1 -0
- package/dist/i18n/index.d.ts +29 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +25 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/interpolate.d.ts +2 -0
- package/dist/i18n/interpolate.d.ts.map +1 -0
- package/dist/i18n/interpolate.js +10 -0
- package/dist/i18n/interpolate.js.map +1 -0
- package/dist/i18n/language-storage.d.ts +16 -0
- package/dist/i18n/language-storage.d.ts.map +1 -0
- package/dist/i18n/language-storage.js +26 -0
- package/dist/i18n/language-storage.js.map +1 -0
- package/dist/i18n/resolver.d.ts +19 -0
- package/dist/i18n/resolver.d.ts.map +1 -0
- package/dist/i18n/resolver.js +23 -0
- package/dist/i18n/resolver.js.map +1 -0
- package/dist/i18n/types.d.ts +12 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +7 -0
- package/dist/i18n/types.js.map +1 -0
- package/dist/i18n/useTranslation.d.ts +2 -0
- package/dist/i18n/useTranslation.d.ts.map +1 -0
- package/dist/i18n/useTranslation.js +16 -0
- package/dist/i18n/useTranslation.js.map +1 -0
- package/dist/lib/admin-actions/icon-map.d.ts +3 -0
- package/dist/lib/admin-actions/icon-map.d.ts.map +1 -0
- package/dist/lib/admin-actions/icon-map.js +115 -0
- package/dist/lib/admin-actions/icon-map.js.map +1 -0
- package/dist/lib/api-client.d.ts +55 -0
- package/dist/lib/api-client.d.ts.map +1 -0
- package/dist/lib/api-client.js +89 -0
- package/dist/lib/api-client.js.map +1 -0
- package/dist/lib/asset-url.d.ts +32 -0
- package/dist/lib/asset-url.d.ts.map +1 -0
- package/dist/lib/asset-url.js +42 -0
- package/dist/lib/asset-url.js.map +1 -0
- package/dist/lib/auth.d.ts +92 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +133 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/format.d.ts +2 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +9 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/index.d.ts +46 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +41 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/invoice-email-outcome.d.ts +53 -0
- package/dist/lib/invoice-email-outcome.d.ts.map +1 -0
- package/dist/lib/invoice-email-outcome.js +43 -0
- package/dist/lib/invoice-email-outcome.js.map +1 -0
- package/dist/lib/module-presence/ModulePresenceProvider.d.ts +49 -0
- package/dist/lib/module-presence/ModulePresenceProvider.d.ts.map +1 -0
- package/dist/lib/module-presence/ModulePresenceProvider.js +73 -0
- package/dist/lib/module-presence/ModulePresenceProvider.js.map +1 -0
- package/dist/lib/module-presence/api.d.ts +15 -0
- package/dist/lib/module-presence/api.d.ts.map +1 -0
- package/dist/lib/module-presence/api.js +25 -0
- package/dist/lib/module-presence/api.js.map +1 -0
- package/dist/lib/module-presence/index.d.ts +3 -0
- package/dist/lib/module-presence/index.d.ts.map +1 -0
- package/dist/lib/module-presence/index.js +3 -0
- package/dist/lib/module-presence/index.js.map +1 -0
- package/dist/lib/money.d.ts +22 -0
- package/dist/lib/money.d.ts.map +1 -0
- package/dist/lib/money.js +51 -0
- package/dist/lib/money.js.map +1 -0
- package/dist/lib/page-size-options.d.ts +15 -0
- package/dist/lib/page-size-options.d.ts.map +1 -0
- package/dist/lib/page-size-options.js +14 -0
- package/dist/lib/page-size-options.js.map +1 -0
- package/dist/lib/status-color.d.ts +32 -0
- package/dist/lib/status-color.d.ts.map +1 -0
- package/dist/lib/status-color.js +24 -0
- package/dist/lib/status-color.js.map +1 -0
- package/dist/lib/surface-visibility.d.ts +70 -0
- package/dist/lib/surface-visibility.d.ts.map +1 -0
- package/dist/lib/surface-visibility.js +37 -0
- package/dist/lib/surface-visibility.js.map +1 -0
- package/dist/lib/text-normalization.d.ts +56 -0
- package/dist/lib/text-normalization.d.ts.map +1 -0
- package/dist/lib/text-normalization.js +59 -0
- package/dist/lib/text-normalization.js.map +1 -0
- package/dist/lib/use-page-size-preference.d.ts +29 -0
- package/dist/lib/use-page-size-preference.d.ts.map +1 -0
- package/dist/lib/use-page-size-preference.js +61 -0
- package/dist/lib/use-page-size-preference.js.map +1 -0
- package/dist/lib/use-unsaved-changes-prompt.d.ts +23 -0
- package/dist/lib/use-unsaved-changes-prompt.d.ts.map +1 -0
- package/dist/lib/use-unsaved-changes-prompt.js +75 -0
- package/dist/lib/use-unsaved-changes-prompt.js.map +1 -0
- package/dist/lib/utils.d.ts +9 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +12 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/uuid.d.ts +8 -0
- package/dist/lib/uuid.d.ts.map +1 -0
- package/dist/lib/uuid.js +18 -0
- package/dist/lib/uuid.js.map +1 -0
- package/dist/ui/alert.d.ts +12 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +22 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/badge.d.ts +10 -0
- package/dist/ui/badge.d.ts.map +1 -0
- package/dist/ui/badge.js +21 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/button.d.ts +12 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +31 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/card.d.ts +8 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +16 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/checkbox.d.ts +8 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +11 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/color-picker.d.ts +23 -0
- package/dist/ui/color-picker.d.ts.map +1 -0
- package/dist/ui/color-picker.js +76 -0
- package/dist/ui/color-picker.js.map +1 -0
- package/dist/ui/combobox.d.ts +68 -0
- package/dist/ui/combobox.d.ts.map +1 -0
- package/dist/ui/combobox.js +182 -0
- package/dist/ui/combobox.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +26 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +38 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/index.d.ts +47 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +38 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +8 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/label.d.ts +4 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +9 -0
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/multi-select.d.ts +32 -0
- package/dist/ui/multi-select.d.ts.map +1 -0
- package/dist/ui/multi-select.js +63 -0
- package/dist/ui/multi-select.js.map +1 -0
- package/dist/ui/page-header.d.ts +21 -0
- package/dist/ui/page-header.d.ts.map +1 -0
- package/dist/ui/page-header.js +9 -0
- package/dist/ui/page-header.js.map +1 -0
- package/dist/ui/route-tabs.d.ts +58 -0
- package/dist/ui/route-tabs.d.ts.map +1 -0
- package/dist/ui/route-tabs.js +34 -0
- package/dist/ui/route-tabs.js.map +1 -0
- package/dist/ui/save-button-group.d.ts +27 -0
- package/dist/ui/save-button-group.d.ts.map +1 -0
- package/dist/ui/save-button-group.js +44 -0
- package/dist/ui/save-button-group.js.map +1 -0
- package/dist/ui/section.d.ts +20 -0
- package/dist/ui/section.d.ts.map +1 -0
- package/dist/ui/section.js +7 -0
- package/dist/ui/section.js.map +1 -0
- package/dist/ui/select.d.ts +10 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +15 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.d.ts +3 -0
- package/dist/ui/separator.d.ts.map +1 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +20 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/textarea.js +8 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/zones/AdminContributionsProvider.d.ts +72 -0
- package/dist/zones/AdminContributionsProvider.d.ts.map +1 -0
- package/dist/zones/AdminContributionsProvider.js +63 -0
- package/dist/zones/AdminContributionsProvider.js.map +1 -0
- package/dist/zones/AdminZone.d.ts +30 -0
- package/dist/zones/AdminZone.d.ts.map +1 -0
- package/dist/zones/AdminZone.js +59 -0
- package/dist/zones/AdminZone.js.map +1 -0
- package/dist/zones/RouteTabsZone.d.ts +62 -0
- package/dist/zones/RouteTabsZone.d.ts.map +1 -0
- package/dist/zones/RouteTabsZone.js +25 -0
- package/dist/zones/RouteTabsZone.js.map +1 -0
- package/dist/zones/ZoneErrorBoundary.d.ts +36 -0
- package/dist/zones/ZoneErrorBoundary.d.ts.map +1 -0
- package/dist/zones/ZoneErrorBoundary.js +44 -0
- package/dist/zones/ZoneErrorBoundary.js.map +1 -0
- package/dist/zones/index.d.ts +31 -0
- package/dist/zones/index.d.ts.map +1 -0
- package/dist/zones/index.js +27 -0
- package/dist/zones/index.js.map +1 -0
- package/dist/zones/use-admin-zone.d.ts +32 -0
- package/dist/zones/use-admin-zone.d.ts.map +1 -0
- package/dist/zones/use-admin-zone.js +96 -0
- package/dist/zones/use-admin-zone.js.map +1 -0
- package/package.json +94 -3
- package/tailwind.css +14 -0
- package/theme.css +2056 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// `apiClient` comes through the kit's published `lib` **barrel** rather than
|
|
2
|
+
// through `../../lib/api-client.js`: `vi.mock` keys on a resolved module id, so
|
|
3
|
+
// the barrel is the only spelling an admin test can name, and it resolves to
|
|
4
|
+
// the same file as `@endora-commerce/admin-kit/lib`.
|
|
5
|
+
import { apiClient } from '../../lib/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* The two sales-channel reads `ScopePicker` needs, built here (feature 091, P8).
|
|
8
|
+
*
|
|
9
|
+
* Until this component moved into the kit it called `sales_channels`' own admin
|
|
10
|
+
* API client, which is a reach out of the platform's frontend into a module's
|
|
11
|
+
* admin code — the one entry
|
|
12
|
+
* `backend/scripts/ledgers/cross-module-imports/cms.ts` held. The exit is the
|
|
13
|
+
* one P2 established for the three data-fetching pickers: name the endpoint and
|
|
14
|
+
* the published response type, which both sides already compile, and depend on
|
|
15
|
+
* no module's code. Both shapes are `@endora-commerce/contracts`', so nothing
|
|
16
|
+
* about them is duplicated — only the two `GET`s the picker needs out of that
|
|
17
|
+
* client's fifteen methods.
|
|
18
|
+
*/
|
|
19
|
+
/** Active channels, one large page — channels are few and unpaged in practice. */
|
|
20
|
+
export function listScopeSalesChannels(pageSize = 100) {
|
|
21
|
+
const qs = new URLSearchParams();
|
|
22
|
+
qs.set('activeOnly', 'true');
|
|
23
|
+
qs.set('pageSize', String(pageSize));
|
|
24
|
+
return apiClient.get(`/api/v1/admin/sales-channels?${qs.toString()}`);
|
|
25
|
+
}
|
|
26
|
+
/** One channel by its code, for the language list a summary does not carry. */
|
|
27
|
+
export function fetchScopeSalesChannel(code) {
|
|
28
|
+
return apiClient.get(`/api/v1/admin/sales-channels/${encodeURIComponent(code)}`);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=sales-channels-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sales-channels-api.js","sourceRoot":"","sources":["../../../src/components/scope-picker/sales-channels-api.ts"],"names":[],"mappings":"AACA,6EAA6E;AAC7E,gFAAgF;AAChF,6EAA6E;AAC7E,qDAAqD;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;;;;;;;;;;;GAYG;AAEH,kFAAkF;AAClF,MAAM,UAAU,sBAAsB,CAAC,QAAQ,GAAG,GAAG;IACnD,MAAM,EAAE,GAAG,IAAI,eAAe,EAAE,CAAC;IACjC,EAAE,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC7B,EAAE,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrC,OAAO,SAAS,CAAC,GAAG,CAA2B,gCAAgC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,OAAO,SAAS,CAAC,GAAG,CAClB,gCAAgC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface StatusTransitionGraphStatus {
|
|
3
|
+
code: string;
|
|
4
|
+
name: Record<string, string>;
|
|
5
|
+
defaultName: string;
|
|
6
|
+
isInitial: boolean;
|
|
7
|
+
isTerminal: boolean;
|
|
8
|
+
isSystem: boolean;
|
|
9
|
+
weight: number;
|
|
10
|
+
color: string;
|
|
11
|
+
inUseCount: number;
|
|
12
|
+
}
|
|
13
|
+
export interface StatusTransitionGraphTransition {
|
|
14
|
+
fromStatusCode: string;
|
|
15
|
+
toStatusCode: string;
|
|
16
|
+
isSystem: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface StatusTransitionGraphProps {
|
|
19
|
+
statuses: StatusTransitionGraphStatus[];
|
|
20
|
+
transitions: StatusTransitionGraphTransition[];
|
|
21
|
+
statusLabel: (s: StatusTransitionGraphStatus) => string;
|
|
22
|
+
onAdd: (from: string, to: string) => void;
|
|
23
|
+
onRemove: (from: string, to: string) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function StatusTransitionGraph({ statuses, transitions, statusLabel, onAdd, onRemove, }: StatusTransitionGraphProps): ReactNode;
|
|
26
|
+
//# sourceMappingURL=StatusTransitionGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusTransitionGraph.d.ts","sourceRoot":"","sources":["../../../src/components/status-transition-graph/StatusTransitionGraph.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAA0C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS/E,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,+BAA+B;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,2BAA2B,EAAE,CAAC;IACxC,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAC/C,WAAW,EAAE,CAAC,CAAC,EAAE,2BAA2B,KAAK,MAAM,CAAC;IACxD,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAkBD,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,WAAW,EACX,WAAW,EACX,KAAK,EACL,QAAQ,GACT,EAAE,0BAA0B,GAAG,SAAS,CAoVxC"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Visual editor for a status transition graph (feature 038 / 039 UX).
|
|
3
|
+
//
|
|
4
|
+
// Replaces the flat "from → to" table with an ECharts directed graph: nodes are
|
|
5
|
+
// statuses, arrows are allowed transitions. Editing happens on the canvas —
|
|
6
|
+
// "connect mode" turns two node clicks into a new transition, and clicking an
|
|
7
|
+
// arrow selects it for removal. The classic From/To form is kept below as an
|
|
8
|
+
// accessible, test-friendly fallback.
|
|
9
|
+
//
|
|
10
|
+
// **Published into the kit by feature 091, batch 8.** It lived under `orders`'
|
|
11
|
+
// admin directory and `returns` imported it for the return workflow, which
|
|
12
|
+
// `backend/scripts/ledgers/cross-module-imports/returns.ts` recorded as a
|
|
13
|
+
// boundary reach whose retiring condition is exactly this. The component holds
|
|
14
|
+
// no `orders` knowledge: it takes `statuses`, `transitions`, `statusLabel`,
|
|
15
|
+
// `onAdd` and `onRemove` — data in, callbacks out — and the caller supplies the
|
|
16
|
+
// vocabulary through `statusLabel`. `admin-component-contribution.md` Z1
|
|
17
|
+
// question 1, so a published component and not a zone contribution.
|
|
18
|
+
//
|
|
19
|
+
// **The `t` prop is gone, and that is the R-1 half of the move.** Both callers
|
|
20
|
+
// passed `useTranslation('core')` and the component read `orderStatusConfig.*`
|
|
21
|
+
// keys out of it, so the prop carried the *component's own* copy through the
|
|
22
|
+
// caller rather than the caller's vocabulary — which the `statusLabel` prop
|
|
23
|
+
// already carries. A kit component may not read a module's namespace, and the
|
|
24
|
+
// keys it reads are `_i18n`'s `core` already, so it resolves them itself and
|
|
25
|
+
// the rendered output is unchanged in both shipped languages.
|
|
26
|
+
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
27
|
+
import { Plus, Trash2, Workflow, X } from 'lucide-react';
|
|
28
|
+
import { Button } from '../../ui/button.js';
|
|
29
|
+
import { Label } from '../../ui/label.js';
|
|
30
|
+
import { Select } from '../../ui/select.js';
|
|
31
|
+
import { useTranslation } from '../../i18n/useTranslation.js';
|
|
32
|
+
import { EChart } from '../charts/echart.js';
|
|
33
|
+
// Node fill by lifecycle role; system membership is shown with a gold border.
|
|
34
|
+
const COLOR_INITIAL = '#10b981';
|
|
35
|
+
const COLOR_TERMINAL = '#f43f5e';
|
|
36
|
+
const COLOR_NORMAL = '#3b82f6';
|
|
37
|
+
const COLOR_SYSTEM_BORDER = '#f59e0b';
|
|
38
|
+
const COLOR_EDGE = '#94a3b8';
|
|
39
|
+
const COLOR_EDGE_SYSTEM = '#cbd5e1';
|
|
40
|
+
export function StatusTransitionGraph({ statuses, transitions, statusLabel, onAdd, onRemove, }) {
|
|
41
|
+
const t = useTranslation('core');
|
|
42
|
+
const [layout, setLayout] = useState('none');
|
|
43
|
+
const [connectMode, setConnectMode] = useState(false);
|
|
44
|
+
const [pendingFrom, setPendingFrom] = useState(null);
|
|
45
|
+
const [selected, setSelected] = useState(null);
|
|
46
|
+
const [transFrom, setTransFrom] = useState('');
|
|
47
|
+
const [transTo, setTransTo] = useState('');
|
|
48
|
+
const chartRef = useRef(null);
|
|
49
|
+
const labelByCode = useMemo(() => {
|
|
50
|
+
const map = new Map();
|
|
51
|
+
for (const s of statuses)
|
|
52
|
+
map.set(s.code, statusLabel(s));
|
|
53
|
+
return map;
|
|
54
|
+
}, [statuses, statusLabel]);
|
|
55
|
+
const labelOf = useCallback((code) => labelByCode.get(code) ?? code, [labelByCode]);
|
|
56
|
+
const option = useMemo(() => {
|
|
57
|
+
// With no automatic layout, ECharts needs explicit coordinates. Lay the
|
|
58
|
+
// graph out left→right by lifecycle flow: initial status on the left,
|
|
59
|
+
// terminal statuses on the right, the rest ranked by their shortest
|
|
60
|
+
// transition distance from an initial status. Nodes stay where dragged.
|
|
61
|
+
const coordByCode = new Map();
|
|
62
|
+
if (layout === 'none') {
|
|
63
|
+
const adjacency = new Map();
|
|
64
|
+
for (const tr of transitions) {
|
|
65
|
+
const out = adjacency.get(tr.fromStatusCode) ?? [];
|
|
66
|
+
out.push(tr.toStatusCode);
|
|
67
|
+
adjacency.set(tr.fromStatusCode, out);
|
|
68
|
+
}
|
|
69
|
+
// BFS shortest distance from the initial status set (cycle-safe).
|
|
70
|
+
const col = new Map();
|
|
71
|
+
const queue = [];
|
|
72
|
+
for (const s of statuses)
|
|
73
|
+
if (s.isInitial) {
|
|
74
|
+
col.set(s.code, 0);
|
|
75
|
+
queue.push(s.code);
|
|
76
|
+
}
|
|
77
|
+
while (queue.length > 0) {
|
|
78
|
+
const cur = queue.shift();
|
|
79
|
+
const depth = col.get(cur);
|
|
80
|
+
for (const next of adjacency.get(cur) ?? [])
|
|
81
|
+
if (!col.has(next)) {
|
|
82
|
+
col.set(next, depth + 1);
|
|
83
|
+
queue.push(next);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Unreachable statuses (no path from an initial) sit one column in.
|
|
87
|
+
let maxNonTerminal = 0;
|
|
88
|
+
for (const s of statuses) {
|
|
89
|
+
if (!col.has(s.code))
|
|
90
|
+
col.set(s.code, 1);
|
|
91
|
+
if (!s.isTerminal)
|
|
92
|
+
maxNonTerminal = Math.max(maxNonTerminal, col.get(s.code));
|
|
93
|
+
}
|
|
94
|
+
// Terminal statuses are pinned to the rightmost column.
|
|
95
|
+
const hasTerminal = statuses.some((s) => s.isTerminal);
|
|
96
|
+
const terminalCol = hasTerminal ? maxNonTerminal + 1 : maxNonTerminal;
|
|
97
|
+
for (const s of statuses)
|
|
98
|
+
if (s.isTerminal)
|
|
99
|
+
col.set(s.code, terminalCol);
|
|
100
|
+
// Spread nodes vertically within each column, centred.
|
|
101
|
+
const byCol = new Map();
|
|
102
|
+
for (const s of statuses) {
|
|
103
|
+
const c = col.get(s.code);
|
|
104
|
+
const bucket = byCol.get(c) ?? [];
|
|
105
|
+
bucket.push(s.code);
|
|
106
|
+
byCol.set(c, bucket);
|
|
107
|
+
}
|
|
108
|
+
for (const [c, codes] of byCol)
|
|
109
|
+
codes.forEach((code, j) => {
|
|
110
|
+
coordByCode.set(code, { x: c * 220, y: (j - (codes.length - 1) / 2) * 120 });
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const nodes = statuses.map((s) => {
|
|
114
|
+
const flags = [
|
|
115
|
+
s.isInitial ? t('orderStatusConfig.flag.initial') : null,
|
|
116
|
+
s.isTerminal ? t('orderStatusConfig.flag.terminal') : null,
|
|
117
|
+
s.isSystem ? t('orderStatusConfig.flag.system') : null,
|
|
118
|
+
]
|
|
119
|
+
.filter(Boolean)
|
|
120
|
+
.join(', ');
|
|
121
|
+
const fill = s.isInitial ? COLOR_INITIAL : s.isTerminal ? COLOR_TERMINAL : COLOR_NORMAL;
|
|
122
|
+
const coords = coordByCode.get(s.code) ?? {};
|
|
123
|
+
return {
|
|
124
|
+
name: s.code,
|
|
125
|
+
label: statusLabel(s),
|
|
126
|
+
flags,
|
|
127
|
+
symbolSize: 22,
|
|
128
|
+
...coords,
|
|
129
|
+
itemStyle: {
|
|
130
|
+
color: fill,
|
|
131
|
+
borderColor: s.isSystem ? COLOR_SYSTEM_BORDER : 'transparent',
|
|
132
|
+
borderWidth: s.isSystem ? 3 : 0,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
const links = transitions.map((tr) => ({
|
|
137
|
+
source: tr.fromStatusCode,
|
|
138
|
+
target: tr.toStatusCode,
|
|
139
|
+
lineStyle: { color: tr.isSystem ? COLOR_EDGE_SYSTEM : COLOR_EDGE },
|
|
140
|
+
}));
|
|
141
|
+
return {
|
|
142
|
+
tooltip: {
|
|
143
|
+
confine: true,
|
|
144
|
+
formatter: (raw) => {
|
|
145
|
+
const p = raw;
|
|
146
|
+
if (p.dataType === 'edge') {
|
|
147
|
+
return `${labelOf(String(p.data.source))} → ${labelOf(String(p.data.target))}`;
|
|
148
|
+
}
|
|
149
|
+
const flags = p.data.flags ? `<br/><span style="color:#64748b">${p.data.flags}</span>` : '';
|
|
150
|
+
return `<strong>${labelOf(String(p.data.name))}</strong><br/><code>${p.data.name}</code>${flags}`;
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
series: [
|
|
154
|
+
{
|
|
155
|
+
type: 'graph',
|
|
156
|
+
layout,
|
|
157
|
+
roam: true,
|
|
158
|
+
draggable: true,
|
|
159
|
+
cursor: 'pointer',
|
|
160
|
+
edgeSymbol: ['none', 'arrow'],
|
|
161
|
+
edgeSymbolSize: 9,
|
|
162
|
+
force: { repulsion: 340, edgeLength: 160, gravity: 0.08 },
|
|
163
|
+
circular: { rotateLabel: false },
|
|
164
|
+
label: {
|
|
165
|
+
show: true,
|
|
166
|
+
position: 'bottom',
|
|
167
|
+
fontSize: 11,
|
|
168
|
+
color: '#334155',
|
|
169
|
+
formatter: (raw) => labelOf(String(raw.data.name)),
|
|
170
|
+
},
|
|
171
|
+
lineStyle: { color: COLOR_EDGE, width: 1.5, curveness: 0.12, opacity: 0.9 },
|
|
172
|
+
emphasis: { focus: 'adjacency', lineStyle: { width: 3 } },
|
|
173
|
+
data: nodes,
|
|
174
|
+
links,
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
};
|
|
178
|
+
}, [statuses, transitions, layout, labelOf, statusLabel, t]);
|
|
179
|
+
const exists = useCallback((from, to) => transitions.some((tr) => tr.fromStatusCode === from && tr.toStatusCode === to), [transitions]);
|
|
180
|
+
const highlightNode = useCallback((code) => {
|
|
181
|
+
const chart = chartRef.current;
|
|
182
|
+
if (!chart)
|
|
183
|
+
return;
|
|
184
|
+
chart.dispatchAction({ type: 'downplay', seriesIndex: 0 });
|
|
185
|
+
if (code)
|
|
186
|
+
chart.dispatchAction({ type: 'highlight', seriesIndex: 0, name: code });
|
|
187
|
+
}, []);
|
|
188
|
+
const tryAdd = useCallback((from, to) => {
|
|
189
|
+
if (!from || !to || from === to || exists(from, to))
|
|
190
|
+
return;
|
|
191
|
+
onAdd(from, to);
|
|
192
|
+
}, [exists, onAdd]);
|
|
193
|
+
const handleClick = useMemo(() => {
|
|
194
|
+
const click = (e) => {
|
|
195
|
+
const p = e;
|
|
196
|
+
if (p.dataType === 'edge') {
|
|
197
|
+
const tr = transitions.find((x) => x.fromStatusCode === p.data.source && x.toStatusCode === p.data.target);
|
|
198
|
+
if (tr)
|
|
199
|
+
setSelected(tr);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (p.dataType === 'node') {
|
|
203
|
+
const code = String(p.data.name);
|
|
204
|
+
if (!connectMode)
|
|
205
|
+
return;
|
|
206
|
+
if (!pendingFrom) {
|
|
207
|
+
setPendingFrom(code);
|
|
208
|
+
highlightNode(code);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (pendingFrom !== code)
|
|
212
|
+
tryAdd(pendingFrom, code);
|
|
213
|
+
setPendingFrom(null);
|
|
214
|
+
highlightNode(null);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
return { click };
|
|
218
|
+
}, [transitions, connectMode, pendingFrom, tryAdd, highlightNode]);
|
|
219
|
+
const exitConnectMode = useCallback(() => {
|
|
220
|
+
setConnectMode(false);
|
|
221
|
+
setPendingFrom(null);
|
|
222
|
+
highlightNode(null);
|
|
223
|
+
}, [highlightNode]);
|
|
224
|
+
const connectHint = pendingFrom
|
|
225
|
+
? t('orderStatusConfig.graph.pickTarget', { from: labelOf(pendingFrom) })
|
|
226
|
+
: t('orderStatusConfig.graph.pickSource');
|
|
227
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs(Button, { variant: connectMode ? 'default' : 'outline', size: "sm", onClick: () => (connectMode ? exitConnectMode() : setConnectMode(true)), children: [_jsx(Workflow, {}), t('orderStatusConfig.graph.connectMode')] }), connectMode ? (_jsx("span", { className: "text-sm text-muted-foreground", children: connectHint })) : null, _jsxs("div", { className: "ml-auto flex items-center gap-1", children: [_jsx(Button, { variant: layout === 'none' ? 'default' : 'outline', size: "sm", onClick: () => setLayout('none'), children: t('orderStatusConfig.graph.layoutNone') }), _jsx(Button, { variant: layout === 'force' ? 'default' : 'outline', size: "sm", onClick: () => setLayout('force'), children: t('orderStatusConfig.graph.layoutForce') }), _jsx(Button, { variant: layout === 'circular' ? 'default' : 'outline', size: "sm", onClick: () => setLayout('circular'), children: t('orderStatusConfig.graph.layoutCircular') })] })] }), _jsx("div", { className: "rounded-md border bg-card", children: statuses.length === 0 ? (_jsx("p", { className: "p-8 text-center text-sm text-muted-foreground", children: t('orderStatusConfig.graph.empty') })) : (_jsx(EChart, { option: option, onEvents: handleClick, onReady: (chart) => {
|
|
228
|
+
chartRef.current = chart;
|
|
229
|
+
}, className: "h-[440px] w-full" })) }), _jsxs("div", { className: "flex flex-wrap items-center gap-4 text-xs text-muted-foreground", children: [_jsx(LegendDot, { color: COLOR_INITIAL, label: t('orderStatusConfig.flag.initial') }), _jsx(LegendDot, { color: COLOR_TERMINAL, label: t('orderStatusConfig.flag.terminal') }), _jsx(LegendDot, { color: COLOR_NORMAL, label: t('orderStatusConfig.graph.legendNormal') }), _jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "inline-block h-3 w-3 rounded-full border-[3px]", style: { borderColor: COLOR_SYSTEM_BORDER, background: 'transparent' } }), t('orderStatusConfig.flag.system')] })] }), selected ? (_jsxs("div", { className: "flex flex-wrap items-center gap-3 rounded-md border bg-muted/40 px-3 py-2", children: [_jsxs("span", { className: "text-sm", children: [t('orderStatusConfig.graph.selected'), ":", ' ', _jsxs("span", { className: "font-mono text-xs", children: [selected.fromStatusCode, " \u2192 ", selected.toStatusCode] })] }), _jsxs("div", { className: "ml-auto flex items-center gap-1", children: [_jsxs(Button, { variant: "ghost", size: "sm", disabled: selected.isSystem, onClick: () => {
|
|
230
|
+
onRemove(selected.fromStatusCode, selected.toStatusCode);
|
|
231
|
+
setSelected(null);
|
|
232
|
+
}, children: [_jsx(Trash2, {}), t('orderStatusConfig.graph.removeTransition')] }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setSelected(null), children: _jsx(X, {}) })] })] })) : null, _jsxs("div", { className: "flex flex-wrap items-end gap-3 border-t pt-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "transFrom", children: t('orderStatusConfig.col.from') }), _jsxs(Select, { id: "transFrom", value: transFrom, onChange: (e) => setTransFrom(e.target.value), children: [_jsx("option", { value: "", children: "\u2014" }), statuses.map((s) => (_jsx("option", { value: s.code, children: s.code }, s.code)))] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "transTo", children: t('orderStatusConfig.col.to') }), _jsxs(Select, { id: "transTo", value: transTo, onChange: (e) => setTransTo(e.target.value), children: [_jsx("option", { value: "", children: "\u2014" }), statuses.map((s) => (_jsx("option", { value: s.code, children: s.code }, s.code)))] })] }), _jsxs(Button, { onClick: () => {
|
|
233
|
+
tryAdd(transFrom, transTo);
|
|
234
|
+
setTransFrom('');
|
|
235
|
+
setTransTo('');
|
|
236
|
+
}, disabled: !transFrom || !transTo || transFrom === transTo, children: [_jsx(Plus, {}), t('orderStatusConfig.addTransition')] })] })] }));
|
|
237
|
+
}
|
|
238
|
+
function LegendDot({ color, label }) {
|
|
239
|
+
return (_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "inline-block h-3 w-3 rounded-full", style: { background: color } }), label] }));
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=StatusTransitionGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusTransitionGraph.js","sourceRoot":"","sources":["../../../src/components/status-transition-graph/StatusTransitionGraph.tsx"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,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CAAC;AAED,SAAS,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAoC;IACnE,OAAO,CACL,gBAAM,SAAS,EAAC,2BAA2B,aACzC,eAAM,SAAS,EAAC,mCAAmC,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,GAAI,EACnF,KAAK,IACD,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/status-transition-graph/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/status-transition-graph/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The declaration types a module package's `./admin` layer is written against
|
|
3
|
+
* (feature 091, Phase 1).
|
|
4
|
+
*
|
|
5
|
+
* Re-exported from `@endora-commerce/contracts` **so a module needs one import
|
|
6
|
+
* for the shapes and not two** — the reason
|
|
7
|
+
* `specs/091-module-owned-admin-surfaces/contracts/admin-kit-surface.md` §2
|
|
8
|
+
* gives this subpath. The declarations themselves live in `contracts` because
|
|
9
|
+
* Principle II puts a shape crossing a package boundary there, beside
|
|
10
|
+
* `ModuleManifest` and `ModuleActionSchema`.
|
|
11
|
+
*
|
|
12
|
+
* **Every export here is the identical binding, never a copy.** The re-export
|
|
13
|
+
* carries the symbol through; `contracts` is a peer dependency, so an
|
|
14
|
+
* application resolves exactly one copy of it and
|
|
15
|
+
* `AdminZoneNameSchema` compared across the seam is the same object. That is
|
|
16
|
+
* not a nicety: a second `z.enum` would validate the same strings and fail an
|
|
17
|
+
* `instanceof`, and the failure would be silent — which is the property
|
|
18
|
+
* `check:singleton-identity` exists to protect on the backend and which has no
|
|
19
|
+
* frontend instrument yet.
|
|
20
|
+
*
|
|
21
|
+
* The barrel is **explicit and holds no `export *`**, per
|
|
22
|
+
* `admin-kit-surface.md` R2: a short published set reports more findings than a
|
|
23
|
+
* complete one, and its obvious repair is to widen the barrel silently.
|
|
24
|
+
*/
|
|
25
|
+
export { AdminNavDeclarationSchema, AdminNavSectionNameSchema, AdminRouteDeclarationSchema, AdminZoneContributionSchema, AdminZoneNameSchema, PermissionRequirementSchema, } from '@endora-commerce/contracts';
|
|
26
|
+
export type { AdminComponentFactory, AdminContributions, AdminNavDeclaration, AdminNavSectionName, AdminRouteDeclaration, AdminZoneContribution, AdminZoneName, AdminZoneProps, AdminZonePropsMap, DeliveryMethodIntegrationsZoneProps, PermissionRequirement, ProductEditorFieldZoneProps, ProductEditorZoneProps, } from '@endora-commerce/contracts';
|
|
27
|
+
/**
|
|
28
|
+
* The contributor's end of a zone's props contract — the kit's own, not a
|
|
29
|
+
* re-export.
|
|
30
|
+
*
|
|
31
|
+
* It lives here rather than in `contracts` because it names `ComponentType`,
|
|
32
|
+
* and that package is compiled by the backend and may acquire no React
|
|
33
|
+
* dependency. That split is what leaves `AdminComponentFactory` resolving to
|
|
34
|
+
* `{ default: unknown }`, and this helper is what makes the `unknown` a courier
|
|
35
|
+
* between two checked ends rather than a hole.
|
|
36
|
+
*
|
|
37
|
+
* It stays on `./contributions` and not on `./zones` because it is the
|
|
38
|
+
* **contributor's** side and carries no runtime behaviour: a module's
|
|
39
|
+
* `src/admin/index.ts` must be enumerable without evaluating a React tree, and
|
|
40
|
+
* R2 of `admin-contribution.md` is what that rule protects.
|
|
41
|
+
*/
|
|
42
|
+
export { zoneComponent } from './zone-component.js';
|
|
43
|
+
export type { AdminZoneComponent, ZoneComponentOptions } from './zone-component.js';
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contributions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mCAAmC,EACnC,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The declaration types a module package's `./admin` layer is written against
|
|
3
|
+
* (feature 091, Phase 1).
|
|
4
|
+
*
|
|
5
|
+
* Re-exported from `@endora-commerce/contracts` **so a module needs one import
|
|
6
|
+
* for the shapes and not two** — the reason
|
|
7
|
+
* `specs/091-module-owned-admin-surfaces/contracts/admin-kit-surface.md` §2
|
|
8
|
+
* gives this subpath. The declarations themselves live in `contracts` because
|
|
9
|
+
* Principle II puts a shape crossing a package boundary there, beside
|
|
10
|
+
* `ModuleManifest` and `ModuleActionSchema`.
|
|
11
|
+
*
|
|
12
|
+
* **Every export here is the identical binding, never a copy.** The re-export
|
|
13
|
+
* carries the symbol through; `contracts` is a peer dependency, so an
|
|
14
|
+
* application resolves exactly one copy of it and
|
|
15
|
+
* `AdminZoneNameSchema` compared across the seam is the same object. That is
|
|
16
|
+
* not a nicety: a second `z.enum` would validate the same strings and fail an
|
|
17
|
+
* `instanceof`, and the failure would be silent — which is the property
|
|
18
|
+
* `check:singleton-identity` exists to protect on the backend and which has no
|
|
19
|
+
* frontend instrument yet.
|
|
20
|
+
*
|
|
21
|
+
* The barrel is **explicit and holds no `export *`**, per
|
|
22
|
+
* `admin-kit-surface.md` R2: a short published set reports more findings than a
|
|
23
|
+
* complete one, and its obvious repair is to widen the barrel silently.
|
|
24
|
+
*/
|
|
25
|
+
export { AdminNavDeclarationSchema, AdminNavSectionNameSchema, AdminRouteDeclarationSchema, AdminZoneContributionSchema, AdminZoneNameSchema, PermissionRequirementSchema, } from '@endora-commerce/contracts';
|
|
26
|
+
/**
|
|
27
|
+
* The contributor's end of a zone's props contract — the kit's own, not a
|
|
28
|
+
* re-export.
|
|
29
|
+
*
|
|
30
|
+
* It lives here rather than in `contracts` because it names `ComponentType`,
|
|
31
|
+
* and that package is compiled by the backend and may acquire no React
|
|
32
|
+
* dependency. That split is what leaves `AdminComponentFactory` resolving to
|
|
33
|
+
* `{ default: unknown }`, and this helper is what makes the `unknown` a courier
|
|
34
|
+
* between two checked ends rather than a hole.
|
|
35
|
+
*
|
|
36
|
+
* It stays on `./contributions` and not on `./zones` because it is the
|
|
37
|
+
* **contributor's** side and carries no runtime behaviour: a module's
|
|
38
|
+
* `src/admin/index.ts` must be enumerable without evaluating a React tree, and
|
|
39
|
+
* R2 of `admin-contribution.md` is what that rule protects.
|
|
40
|
+
*/
|
|
41
|
+
export { zoneComponent } from './zone-component.js';
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contributions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAkBpC;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contributor's end of a zone's props contract (feature 091, P4a; Z3).
|
|
3
|
+
*
|
|
4
|
+
* A zone's props are declared once, in `AdminZonePropsMap`, and checked by
|
|
5
|
+
* `tsc` at **both** ends and by nothing at runtime. This file is the
|
|
6
|
+
* contributor's end: it turns the module's own `() => import('./Whatever.js')`
|
|
7
|
+
* into a factory whose module's default export is constrained to
|
|
8
|
+
* `ComponentType<AdminZoneProps<Z>>` for the zone the contribution names.
|
|
9
|
+
*
|
|
10
|
+
* Without it a contributor has no compile-time relationship to the props at
|
|
11
|
+
* all: `AdminComponentFactory` resolves to `{ default: unknown }` deliberately,
|
|
12
|
+
* because `@endora-commerce/contracts` compiles in the backend and may acquire
|
|
13
|
+
* no React dependency. The `unknown` in the middle is not a hole — it is the
|
|
14
|
+
* courier between two ends checked against the same map — but it is only not a
|
|
15
|
+
* hole while the contributor's end is checked, and this is what checks it.
|
|
16
|
+
*
|
|
17
|
+
* It carries **no runtime behaviour**: the returned object is the declaration
|
|
18
|
+
* the module would have written by hand, with the factory passed through
|
|
19
|
+
* unchanged. `React.lazy` is the renderer's, and it is reached only after the
|
|
20
|
+
* renderer has decided presence, permission and `match` (FR-013).
|
|
21
|
+
*/
|
|
22
|
+
import type { AdminZoneContribution, AdminZoneName, AdminZoneProps, PermissionRequirement } from '@endora-commerce/contracts';
|
|
23
|
+
import type { ComponentType } from 'react';
|
|
24
|
+
/**
|
|
25
|
+
* What a module's zone component must be, for the zone it contributes to.
|
|
26
|
+
*
|
|
27
|
+
* Exported in its own right because a contributor that keeps its component in
|
|
28
|
+
* a separate file wants to annotate that file's export, which is where a
|
|
29
|
+
* mismatch is cheapest to read.
|
|
30
|
+
*/
|
|
31
|
+
export type AdminZoneComponent<Z extends AdminZoneName> = ComponentType<AdminZoneProps<Z>>;
|
|
32
|
+
/** Everything a contribution declares beyond its zone and its component. */
|
|
33
|
+
export interface ZoneComponentOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Order within the zone. Ties are broken by module id, so the order is a
|
|
36
|
+
* function of the declarations and never of the registry's walk order.
|
|
37
|
+
*
|
|
38
|
+
* Defaults to `0`: a contributor with no opinion should not have to invent
|
|
39
|
+
* one, and every contributor with no opinion then sorts by module id.
|
|
40
|
+
*/
|
|
41
|
+
readonly weight?: number;
|
|
42
|
+
/** The permission the contributed surface needs, if it needs one. */
|
|
43
|
+
readonly requiredPermission?: PermissionRequirement;
|
|
44
|
+
/**
|
|
45
|
+
* Narrow this contribution to the mounts whose props agree — see
|
|
46
|
+
* `AdminZoneContributionSchema`'s `match`.
|
|
47
|
+
*
|
|
48
|
+
* Typed as the zone's own props, partially and by value, so a key the zone
|
|
49
|
+
* does not carry is a compile error here rather than a contribution that
|
|
50
|
+
* silently matches nothing.
|
|
51
|
+
*/
|
|
52
|
+
readonly match?: {
|
|
53
|
+
readonly [K in keyof AdminZoneProps<AdminZoneName> & string]?: string | readonly string[];
|
|
54
|
+
} & Readonly<Record<string, string | readonly string[]>>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Declare a contribution to `zone`, with its component type-checked against
|
|
58
|
+
* that zone's props.
|
|
59
|
+
*
|
|
60
|
+
* ```ts
|
|
61
|
+
* zoneComponent('product.editor.field.after', () => import('./FieldProtection.js'), {
|
|
62
|
+
* weight: 10,
|
|
63
|
+
* requiredPermission: 'catalog:write',
|
|
64
|
+
* })
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function zoneComponent<Z extends AdminZoneName>(zone: Z, load: () => Promise<{
|
|
68
|
+
readonly default: AdminZoneComponent<Z>;
|
|
69
|
+
}>, options?: ZoneComponentOptions): AdminZoneContribution;
|
|
70
|
+
//# sourceMappingURL=zone-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zone-component.d.ts","sourceRoot":"","sources":["../../src/contributions/zone-component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,aAAa,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3F,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;IACpD;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE;QACf,QAAQ,EAAE,CAAC,IAAI,MAAM,cAAc,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE;KAC1F,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CAC1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EACnD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,OAAO,CAAC;IAAE,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,EAChE,OAAO,GAAE,oBAAyB,GACjC,qBAAqB,CAavB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declare a contribution to `zone`, with its component type-checked against
|
|
3
|
+
* that zone's props.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* zoneComponent('product.editor.field.after', () => import('./FieldProtection.js'), {
|
|
7
|
+
* weight: 10,
|
|
8
|
+
* requiredPermission: 'catalog:write',
|
|
9
|
+
* })
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export function zoneComponent(zone, load, options = {}) {
|
|
13
|
+
// `exactOptionalPropertyTypes` is on, so an absent option is an absent
|
|
14
|
+
// property rather than an explicit `undefined` — the distinction the flag
|
|
15
|
+
// exists for, and the reason these are spreads and not fields.
|
|
16
|
+
return {
|
|
17
|
+
zone,
|
|
18
|
+
weight: options.weight ?? 0,
|
|
19
|
+
...(options.requiredPermission === undefined
|
|
20
|
+
? {}
|
|
21
|
+
: { requiredPermission: options.requiredPermission }),
|
|
22
|
+
...(options.match === undefined ? {} : { match: options.match }),
|
|
23
|
+
component: load,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=zone-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zone-component.js","sourceRoot":"","sources":["../../src/contributions/zone-component.ts"],"names":[],"mappings":"AA+DA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAO,EACP,IAAgE,EAChE,UAAgC,EAAE;IAElC,uEAAuE;IACvE,0EAA0E;IAC1E,+DAA+D;IAC/D,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC;QAC3B,GAAG,CAAC,OAAO,CAAC,kBAAkB,KAAK,SAAS;YAC1C,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACvD,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;QAChE,SAAS,EAAE,IAAI;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Pin this price locally" — one control per price the integration could write
|
|
3
|
+
* on this record (feature 091, P4b).
|
|
4
|
+
*
|
|
5
|
+
* ## Why it is a panel and not a toggle beside a number
|
|
6
|
+
*
|
|
7
|
+
* There is no price *input* on the product editor to sit next to: prices are
|
|
8
|
+
* bracket rows on a price list, and the editor's Pricing tab is an index of the
|
|
9
|
+
* lists a product belongs to. So the control goes where the operator already
|
|
10
|
+
* goes to ask "what is this priced at", and names the list and currency it is
|
|
11
|
+
* about — which a toggle floating beside a number could not do.
|
|
12
|
+
*
|
|
13
|
+
* ## Why it renders nothing without a live path
|
|
14
|
+
*
|
|
15
|
+
* `livePricePaths` is the owner's answer to "which prices would an import write
|
|
16
|
+
* here", and it is empty for every record no binding covers. A control for a
|
|
17
|
+
* price the import will never write would promise a protection against nothing.
|
|
18
|
+
*/
|
|
19
|
+
import type { ReactNode } from 'react';
|
|
20
|
+
import type { FieldProtectionSource } from './types.js';
|
|
21
|
+
export interface FieldProtectionPricePanelProps {
|
|
22
|
+
readonly source: FieldProtectionSource;
|
|
23
|
+
readonly className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function FieldProtectionPricePanel({ source, className, }: FieldProtectionPricePanelProps): ReactNode;
|
|
26
|
+
//# sourceMappingURL=FieldProtectionPricePanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldProtectionPricePanel.d.ts","sourceRoot":"","sources":["../../src/field-protection/FieldProtectionPricePanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,yBAAyB,CAAC,EACxC,MAAM,EACN,SAAS,GACV,EAAE,8BAA8B,GAAG,SAAS,CAwB5C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Lock } from 'lucide-react';
|
|
3
|
+
import { FieldProtectionToggle } from './FieldProtectionToggle.js';
|
|
4
|
+
import { useFieldProtection } from './use-field-protection.js';
|
|
5
|
+
export function FieldProtectionPricePanel({ source, className, }) {
|
|
6
|
+
const protection = useFieldProtection(source);
|
|
7
|
+
if (!protection.available)
|
|
8
|
+
return null;
|
|
9
|
+
if (protection.livePricePaths.length === 0)
|
|
10
|
+
return null;
|
|
11
|
+
const t = source.t;
|
|
12
|
+
return (_jsxs("div", { className: `rounded-md border border-border bg-muted/30 px-3 py-2 text-xs ${className ?? ''}`, children: [_jsxs("span", { className: "inline-flex items-center gap-1.5 font-medium", children: [_jsx(Lock, { size: 13, "aria-hidden": "true" }), t('fieldProtection.price.title'), _jsx("span", { className: "opacity-70", children: source.sourceLabel })] }), _jsx("p", { className: "mt-1 text-muted-foreground", children: t('fieldProtection.price.description') }), _jsx("div", { className: "mt-1.5 flex flex-wrap gap-x-4 gap-y-1", children: protection.livePricePaths.map((entry) => (_jsx(FieldProtectionToggle, { source: source, fieldPath: entry.fieldPath }, entry.fieldPath))) })] }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=FieldProtectionPricePanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldProtectionPricePanel.js","sourceRoot":"","sources":["../../src/field-protection/FieldProtectionPricePanel.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAQ/D,MAAM,UAAU,yBAAyB,CAAC,EACxC,MAAM,EACN,SAAS,GACsB;IAC/B,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,UAAU,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAExD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;IAEnB,OAAO,CACL,eACE,SAAS,EAAE,iEAAiE,SAAS,IAAI,EAAE,EAAE,aAE7F,gBAAM,SAAS,EAAC,8CAA8C,aAC5D,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,iBAAc,MAAM,GAAG,EACpC,CAAC,CAAC,6BAA6B,CAAC,EACjC,eAAM,SAAS,EAAC,YAAY,YAAE,MAAM,CAAC,WAAW,GAAQ,IACnD,EACP,YAAG,SAAS,EAAC,4BAA4B,YAAE,CAAC,CAAC,mCAAmC,CAAC,GAAK,EACtF,cAAK,SAAS,EAAC,uCAAuC,YACnD,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACxC,KAAC,qBAAqB,IAAuB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,IAA3D,KAAK,CAAC,SAAS,CAAgD,CAC5F,CAAC,GACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Which fields on this record are protected", answered without opening each
|
|
3
|
+
* one (feature 091, P4b), together with what the integration says about the
|
|
4
|
+
* record: that it is integration-managed, how the source models it, and when it
|
|
5
|
+
* last synchronised.
|
|
6
|
+
*
|
|
7
|
+
* Renders nothing at all when the owner reports no enabled connection — the
|
|
8
|
+
* same rule as the control itself, and the reason a host needs no condition of
|
|
9
|
+
* its own around the mount.
|
|
10
|
+
*/
|
|
11
|
+
import type { ReactNode } from 'react';
|
|
12
|
+
import type { FieldProtectionSource } from './types.js';
|
|
13
|
+
export interface FieldProtectionSummaryProps {
|
|
14
|
+
readonly source: FieldProtectionSource;
|
|
15
|
+
readonly className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function FieldProtectionSummary({ source, className, }: FieldProtectionSummaryProps): ReactNode;
|
|
18
|
+
//# sourceMappingURL=FieldProtectionSummary.d.ts.map
|