@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,130 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// React Context provider for the Admin UI i18n runtime — feature 019.
|
|
3
|
+
//
|
|
4
|
+
// Holds the current language and the merged bundle for that language.
|
|
5
|
+
// Re-renders the entire tree without sign-out when the language flips
|
|
6
|
+
// (FR-005, SC-002). Boot-time fetch is on-demand: the provider issues
|
|
7
|
+
// a single `getBundles(language)` call when its `language` prop changes
|
|
8
|
+
// and caches the response in state.
|
|
9
|
+
//
|
|
10
|
+
// Missing translations log a `console.warn` in development only
|
|
11
|
+
// (research §R8); production stays silent. Each distinct subject is reported
|
|
12
|
+
// once per module registry — see `reportedSubjects` below for why a per-render
|
|
13
|
+
// repeat is a CI defect and not a nuisance.
|
|
14
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
15
|
+
import { getBundles } from './language-storage.js';
|
|
16
|
+
import { resolve } from './resolver.js';
|
|
17
|
+
const TranslationContext = createContext(null);
|
|
18
|
+
/**
|
|
19
|
+
* Subjects the two development diagnostics below have already reported.
|
|
20
|
+
*
|
|
21
|
+
* Both of them state a fact about a *subject* — this language's bundle cannot be
|
|
22
|
+
* fetched; this key is not in it — and both sit on a path that runs again for
|
|
23
|
+
* reasons that have nothing to do with whether the fact changed. `t()` is called
|
|
24
|
+
* during render, so a missing key is re-discovered on every render of every
|
|
25
|
+
* component that reads it; the boot effect runs once per provider mount, so a
|
|
26
|
+
* failing endpoint is re-discovered once per mount. Neither repetition is wrong
|
|
27
|
+
* and neither is news.
|
|
28
|
+
*
|
|
29
|
+
* It was measured as a CI defect rather than a nuisance. Master pipeline 14265's
|
|
30
|
+
* `test:frontend` (job 55801) failed and the reason was unobtainable: the trace
|
|
31
|
+
* ends in `Job's log exceeded limit of 4194304 bytes`, vitest prints its failure
|
|
32
|
+
* summary last, and the summary was past the cut. One green run of that job's
|
|
33
|
+
* command is **5 509 606 bytes**, of which 3 537 037 (64.2%) are 38 201
|
|
34
|
+
* missing-key lines carrying 920 distinct keys, and a further 1 406 522 (25.5%)
|
|
35
|
+
* are 673 copies of one fetch failure, each with a ten-frame stack.
|
|
36
|
+
* `admin/test/kit/kit-i18n-diagnostic-volume.test.tsx` holds the census and the
|
|
37
|
+
* two mechanisms.
|
|
38
|
+
*
|
|
39
|
+
* The first occurrence keeps its full form, stack included — that is the
|
|
40
|
+
* diagnostic, and one copy of it costs nothing. What is dropped is an exact
|
|
41
|
+
* repeat, and deliberately without a running count: "`core.appShell.nav.home` is
|
|
42
|
+
* missing" is the entire signal, and "it is missing 1 065 times" is a fact about
|
|
43
|
+
* how often the tree re-rendered.
|
|
44
|
+
*
|
|
45
|
+
* Module scope, so the memory is one module registry: one page load in a browser,
|
|
46
|
+
* one test file under vitest. That is the right granularity in both — the log
|
|
47
|
+
* still attributes the key to the file that surfaced it — and it needs no reset
|
|
48
|
+
* hook, which a React provider has nowhere to put. The set is bounded by the
|
|
49
|
+
* number of distinct keys the application names.
|
|
50
|
+
*/
|
|
51
|
+
const reportedSubjects = new Set();
|
|
52
|
+
/** Report `args` unless this `subject` has already been reported in this registry. */
|
|
53
|
+
function warnOncePerSubject(subject, ...args) {
|
|
54
|
+
if (reportedSubjects.has(subject))
|
|
55
|
+
return;
|
|
56
|
+
reportedSubjects.add(subject);
|
|
57
|
+
console.warn(...args);
|
|
58
|
+
}
|
|
59
|
+
export function TranslationProvider(props) {
|
|
60
|
+
const { language, initialBundle, initialFallbackBundle, children } = props;
|
|
61
|
+
const [bundle, setBundle] = useState(initialBundle ?? {});
|
|
62
|
+
const [fallbackBundle, setFallbackBundle] = useState(initialFallbackBundle);
|
|
63
|
+
const lastFetchedRef = useRef(initialBundle ? language : null);
|
|
64
|
+
// Fetch the requested-language bundle whenever the language prop flips
|
|
65
|
+
// (or on first mount when no initialBundle was supplied).
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (lastFetchedRef.current === language)
|
|
68
|
+
return;
|
|
69
|
+
let cancelled = false;
|
|
70
|
+
void (async () => {
|
|
71
|
+
try {
|
|
72
|
+
const res = await getBundles(language);
|
|
73
|
+
if (cancelled)
|
|
74
|
+
return;
|
|
75
|
+
setBundle(res.bundles);
|
|
76
|
+
lastFetchedRef.current = language;
|
|
77
|
+
// Pre-fetch EN once for cross-language fallback (FR-013) — only
|
|
78
|
+
// when the user has chosen a non-English language and we don't
|
|
79
|
+
// already have it.
|
|
80
|
+
if (language !== 'en' && !fallbackBundle) {
|
|
81
|
+
const fb = await getBundles('en');
|
|
82
|
+
if (!cancelled)
|
|
83
|
+
setFallbackBundle(fb.bundles);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
// Logging only; the provider keeps the prior bundle so the UI
|
|
88
|
+
// stays usable. The toast is the consumer's responsibility.
|
|
89
|
+
if (import.meta.env.DEV) {
|
|
90
|
+
// The subject is the language whose bundle could not be fetched, so a
|
|
91
|
+
// second language failing is still reported; the same one failing on
|
|
92
|
+
// the next mount is not.
|
|
93
|
+
warnOncePerSubject(`bundle-fetch:${language}`, '[i18n] bundle fetch failed', err);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
})();
|
|
97
|
+
return () => {
|
|
98
|
+
cancelled = true;
|
|
99
|
+
};
|
|
100
|
+
}, [language, fallbackBundle]);
|
|
101
|
+
const t = useCallback((scope, key, params) => {
|
|
102
|
+
const result = resolve({
|
|
103
|
+
scope,
|
|
104
|
+
key,
|
|
105
|
+
language,
|
|
106
|
+
bundle,
|
|
107
|
+
...(fallbackBundle !== undefined ? { fallbackBundle } : {}),
|
|
108
|
+
...(params ? { params } : {}),
|
|
109
|
+
});
|
|
110
|
+
if (import.meta.env.DEV && result.outcome !== 'requested') {
|
|
111
|
+
const target = result.outcome === 'en' ? 'en' : 'placeholder';
|
|
112
|
+
// The subject is the key in this language, and the outcome is part of it:
|
|
113
|
+
// a key that stops resolving from `en` and starts resolving to a
|
|
114
|
+
// placeholder is a different fact, and says so.
|
|
115
|
+
warnOncePerSubject(`missing:${language}:${scope}.${key}:${target}`, `[i18n] missing ${language}: ${scope}.${key} → fell back to ${target}`);
|
|
116
|
+
}
|
|
117
|
+
return result.value;
|
|
118
|
+
}, [language, bundle, fallbackBundle]);
|
|
119
|
+
const value = useMemo(() => ({ language, bundle, fallbackBundle, t }), [language, bundle, fallbackBundle, t]);
|
|
120
|
+
return (_jsx(TranslationContext.Provider, { value: value, children: children }));
|
|
121
|
+
}
|
|
122
|
+
/** Internal accessor — `useTranslation` is the public-facing wrapper. */
|
|
123
|
+
export function useTranslationContext() {
|
|
124
|
+
const ctx = useContext(TranslationContext);
|
|
125
|
+
if (!ctx) {
|
|
126
|
+
throw new Error('[i18n] useTranslation called outside <TranslationProvider>; wrap your app tree first.');
|
|
127
|
+
}
|
|
128
|
+
return ctx;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=TranslationProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TranslationProvider.js","sourceRoot":"","sources":["../../src/i18n/TranslationProvider.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SupportedAdminLanguage } from './types.js';
|
|
2
|
+
export interface AppLanguageContextValue {
|
|
3
|
+
language: SupportedAdminLanguage;
|
|
4
|
+
setLanguage(next: SupportedAdminLanguage): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const AppLanguageContext: import("react").Context<AppLanguageContextValue | null>;
|
|
7
|
+
export declare function useAppLanguage(): AppLanguageContextValue;
|
|
8
|
+
//# sourceMappingURL=app-language-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-language-context.d.ts","sourceRoot":"","sources":["../../src/i18n/app-language-context.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,WAAW,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,kBAAkB,yDAE9B,CAAC;AAEF,wBAAgB,cAAc,IAAI,uBAAuB,CAQxD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Tiny context shared between App and ProfilePage so the user's
|
|
2
|
+
// language selector in Profile flips the whole admin tree without
|
|
3
|
+
// going through React-Query / global state. Feature 019.
|
|
4
|
+
import { createContext, useContext } from 'react';
|
|
5
|
+
export const AppLanguageContext = createContext(null);
|
|
6
|
+
export function useAppLanguage() {
|
|
7
|
+
const ctx = useContext(AppLanguageContext);
|
|
8
|
+
if (!ctx) {
|
|
9
|
+
throw new Error('useAppLanguage must be used inside <AppLanguageContext.Provider>; check App.tsx wiring.');
|
|
10
|
+
}
|
|
11
|
+
return ctx;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=app-language-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-language-context.js","sourceRoot":"","sources":["../../src/i18n/app-language-context.tsx"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,kEAAkE;AAClE,yDAAyD;AAEzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAQlD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAC7C,IAAI,CACL,CAAC;AAEF,MAAM,UAAU,cAAc;IAC5B,MAAM,GAAG,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC3C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@endora-commerce/admin-kit/i18n` — Translation: the provider, the language context and `useTranslation`.
|
|
3
|
+
*
|
|
4
|
+
* The membership is **derived, never designed**
|
|
5
|
+
* (`specs/091-module-owned-admin-surfaces/contracts/admin-kit-surface.md` §1): every
|
|
6
|
+
* `from '…'` specifier in the admin's module directories that resolves inside the admin
|
|
7
|
+
* source root and outside the importing file's own module directory, plus the transitive
|
|
8
|
+
* closure of those files, which is what has to live in one place for there to be one copy.
|
|
9
|
+
*
|
|
10
|
+
* The barrel is **explicit and holds no `export *`** (R2): a short published set reports
|
|
11
|
+
* more findings than a complete one, and its obvious repair is to widen the barrel
|
|
12
|
+
* silently. `check:admin-surface` refuses one and exits 2.
|
|
13
|
+
*
|
|
14
|
+
* Every binding here is the **only** copy in the process. `admin/src` keeps a re-export
|
|
15
|
+
* shim at each old path, so a `@/…` specifier and this subpath name one module record —
|
|
16
|
+
* proved by reference equality in `admin/test/kit/admin-kit-shims.test.ts`, not by a
|
|
17
|
+
* structural comparison, which a second React context would pass.
|
|
18
|
+
*/
|
|
19
|
+
export { TranslationProvider, useTranslationContext } from './TranslationProvider.js';
|
|
20
|
+
export type { TranslationProviderProps } from './TranslationProvider.js';
|
|
21
|
+
export { AppLanguageContext, useAppLanguage } from './app-language-context.js';
|
|
22
|
+
export type { AppLanguageContextValue } from './app-language-context.js';
|
|
23
|
+
export { interpolate } from './interpolate.js';
|
|
24
|
+
export { getBundles, reloadBundles, setPreferredLanguage } from './language-storage.js';
|
|
25
|
+
export { resolve } from './resolver.js';
|
|
26
|
+
export type { ResolveArgs, ResolveResult } from './resolver.js';
|
|
27
|
+
export type { Bundle, GetBundlesResponse, ResolveOutcome, ScopedBundle, SupportedAdminLanguage, TranslationBundleEntries } from './types.js';
|
|
28
|
+
export { useTranslation } from './useTranslation.js';
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtF,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC/E,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC7I,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@endora-commerce/admin-kit/i18n` — Translation: the provider, the language context and `useTranslation`.
|
|
3
|
+
*
|
|
4
|
+
* The membership is **derived, never designed**
|
|
5
|
+
* (`specs/091-module-owned-admin-surfaces/contracts/admin-kit-surface.md` §1): every
|
|
6
|
+
* `from '…'` specifier in the admin's module directories that resolves inside the admin
|
|
7
|
+
* source root and outside the importing file's own module directory, plus the transitive
|
|
8
|
+
* closure of those files, which is what has to live in one place for there to be one copy.
|
|
9
|
+
*
|
|
10
|
+
* The barrel is **explicit and holds no `export *`** (R2): a short published set reports
|
|
11
|
+
* more findings than a complete one, and its obvious repair is to widen the barrel
|
|
12
|
+
* silently. `check:admin-surface` refuses one and exits 2.
|
|
13
|
+
*
|
|
14
|
+
* Every binding here is the **only** copy in the process. `admin/src` keeps a re-export
|
|
15
|
+
* shim at each old path, so a `@/…` specifier and this subpath name one module record —
|
|
16
|
+
* proved by reference equality in `admin/test/kit/admin-kit-shims.test.ts`, not by a
|
|
17
|
+
* structural comparison, which a second React context would pass.
|
|
18
|
+
*/
|
|
19
|
+
export { TranslationProvider, useTranslationContext } from './TranslationProvider.js';
|
|
20
|
+
export { AppLanguageContext, useAppLanguage } from './app-language-context.js';
|
|
21
|
+
export { interpolate } from './interpolate.js';
|
|
22
|
+
export { getBundles, reloadBundles, setPreferredLanguage } from './language-storage.js';
|
|
23
|
+
export { resolve } from './resolver.js';
|
|
24
|
+
export { useTranslation } from './useTranslation.js';
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolate.d.ts","sourceRoot":"","sources":["../../src/i18n/interpolate.ts"],"names":[],"mappings":"AAKA,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GACvC,MAAM,CAKR"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// `{name}`-style placeholder substitution — feature 019 / research §R2.
|
|
2
|
+
//
|
|
3
|
+
// Single-regex interpolation. Missing parameter names are left in place so
|
|
4
|
+
// the gap is visible in the rendered UI rather than silently elided.
|
|
5
|
+
export function interpolate(template, params) {
|
|
6
|
+
if (!params)
|
|
7
|
+
return template;
|
|
8
|
+
return template.replace(/\{(\w+)\}/g, (_match, name) => params[name] != null ? String(params[name]) : `{${name}}`);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=interpolate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolate.js","sourceRoot":"","sources":["../../src/i18n/interpolate.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AAErE,MAAM,UAAU,WAAW,CACzB,QAAgB,EAChB,MAAwC;IAExC,IAAI,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC;IAC7B,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,IAAY,EAAE,EAAE,CAC7D,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GetBundlesResponse, SupportedAdminLanguage } from '@endora-commerce/contracts';
|
|
2
|
+
export declare function getBundles(language: SupportedAdminLanguage): Promise<GetBundlesResponse>;
|
|
3
|
+
/**
|
|
4
|
+
* Hot-reload translations: re-reads every module's on-disk i18n bundles into
|
|
5
|
+
* the DB (feature: i18n reload). The caller should refresh the page afterwards
|
|
6
|
+
* so the new strings are fetched.
|
|
7
|
+
*/
|
|
8
|
+
export declare function reloadBundles(): Promise<{
|
|
9
|
+
installed: number;
|
|
10
|
+
skipped: number;
|
|
11
|
+
failed: number;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function setPreferredLanguage(preferredLanguage: SupportedAdminLanguage | null): Promise<{
|
|
14
|
+
preferredLanguage: SupportedAdminLanguage | null;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=language-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-storage.d.ts","sourceRoot":"","sources":["../../src/i18n/language-storage.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,kBAAkB,EAElB,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAEpC,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,sBAAsB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAK7B;AAED;;;;GAIG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAKD;AAED,wBAAsB,oBAAoB,CACxC,iBAAiB,EAAE,sBAAsB,GAAG,IAAI,GAC/C,OAAO,CAAC;IAAE,iBAAiB,EAAE,sBAAsB,GAAG,IAAI,CAAA;CAAE,CAAC,CAM/D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Typed I/O against the Admin UI i18n endpoints — feature 019 /
|
|
2
|
+
// contracts/admin-http.md. No UI here; just the contract calls.
|
|
3
|
+
//
|
|
4
|
+
// Both endpoints return the project-standard `{ data: ... }` envelope
|
|
5
|
+
// (packages/contracts/src/envelopes.ts) — these helpers unwrap it so
|
|
6
|
+
// the SPA's TranslationProvider receives the bare payload.
|
|
7
|
+
import { apiClient } from '../lib/api-client.js';
|
|
8
|
+
export async function getBundles(language) {
|
|
9
|
+
const res = await apiClient.get(`/api/v1/admin/i18n/bundles?language=${encodeURIComponent(language)}`);
|
|
10
|
+
return res.data;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Hot-reload translations: re-reads every module's on-disk i18n bundles into
|
|
14
|
+
* the DB (feature: i18n reload). The caller should refresh the page afterwards
|
|
15
|
+
* so the new strings are fetched.
|
|
16
|
+
*/
|
|
17
|
+
export async function reloadBundles() {
|
|
18
|
+
const res = await apiClient.post('/api/v1/admin/i18n/reload', {});
|
|
19
|
+
return res.data;
|
|
20
|
+
}
|
|
21
|
+
export async function setPreferredLanguage(preferredLanguage) {
|
|
22
|
+
const body = { preferredLanguage };
|
|
23
|
+
const res = await apiClient.patch('/api/v1/admin/me/preferred-language', body);
|
|
24
|
+
return res.data;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=language-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-storage.js","sourceRoot":"","sources":["../../src/i18n/language-storage.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,gEAAgE;AAChE,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,2DAA2D;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAOjD,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,QAAgC;IAEhC,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,CAC7B,uCAAuC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CACtE,CAAC;IACF,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa;IAKjC,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,IAAI,CAE7B,2BAA2B,EAAE,EAAE,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,iBAAgD;IAEhD,MAAM,IAAI,GAA+B,EAAE,iBAAiB,EAAE,CAAC;IAC/D,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,KAAK,CAE9B,qCAAqC,EAAE,IAAI,CAAC,CAAC;IAChD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Bundle, ResolveOutcome, SupportedAdminLanguage } from './types.js';
|
|
2
|
+
export interface ResolveArgs {
|
|
3
|
+
scope: string;
|
|
4
|
+
key: string;
|
|
5
|
+
language: SupportedAdminLanguage;
|
|
6
|
+
bundle: Bundle;
|
|
7
|
+
/** Optional EN bundle pre-fetched separately. When undefined, no
|
|
8
|
+
* cross-language fallback is attempted (useful when the SPA already
|
|
9
|
+
* fetched only the user's preferred bundle and is in a degraded
|
|
10
|
+
* rendering state — see research §R7). */
|
|
11
|
+
fallbackBundle?: Bundle;
|
|
12
|
+
params?: Record<string, string | number>;
|
|
13
|
+
}
|
|
14
|
+
export interface ResolveResult {
|
|
15
|
+
value: string;
|
|
16
|
+
outcome: ResolveOutcome;
|
|
17
|
+
}
|
|
18
|
+
export declare function resolve(args: ResolveArgs): ResolveResult;
|
|
19
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/i18n/resolver.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIjF,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,sBAAsB,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf;;;+CAG2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa,CAaxD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Pure i18n resolver — feature 019 / research §R7.
|
|
2
|
+
//
|
|
3
|
+
// Three-step fallback chain: requested-language entry → English entry →
|
|
4
|
+
// `${scope}.${key}` placeholder. The `outcome` field lets callers
|
|
5
|
+
// observe whether a fallback fired so the diagnostic surface
|
|
6
|
+
// (TranslationProvider's dev-mode console.warn) can log it.
|
|
7
|
+
import { interpolate } from './interpolate.js';
|
|
8
|
+
const FALLBACK_LANGUAGE = 'en';
|
|
9
|
+
export function resolve(args) {
|
|
10
|
+
const { scope, key, language, bundle, fallbackBundle, params } = args;
|
|
11
|
+
const requested = bundle[scope]?.[key];
|
|
12
|
+
if (requested != null) {
|
|
13
|
+
return { value: interpolate(requested, params), outcome: 'requested' };
|
|
14
|
+
}
|
|
15
|
+
if (language !== FALLBACK_LANGUAGE) {
|
|
16
|
+
const englishValue = fallbackBundle?.[scope]?.[key];
|
|
17
|
+
if (englishValue != null) {
|
|
18
|
+
return { value: interpolate(englishValue, params), outcome: 'en' };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return { value: `${scope}.${key}`, outcome: 'placeholder' };
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../src/i18n/resolver.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,wEAAwE;AACxE,kEAAkE;AAClE,6DAA6D;AAC7D,4DAA4D;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,MAAM,iBAAiB,GAA2B,IAAI,CAAC;AAoBvD,MAAM,UAAU,OAAO,CAAC,IAAiB;IACvC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACtE,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IACzE,CAAC;IACD,IAAI,QAAQ,KAAK,iBAAiB,EAAE,CAAC;QACnC,MAAM,YAAY,GAAG,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QACpD,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;YACzB,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACrE,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GetBundlesResponse, SupportedAdminLanguage, TranslationBundleEntries } from '@endora-commerce/contracts';
|
|
2
|
+
export type { GetBundlesResponse, SupportedAdminLanguage, TranslationBundleEntries, };
|
|
3
|
+
/** Per-module scoped bundle (one language). */
|
|
4
|
+
export type ScopedBundle = TranslationBundleEntries;
|
|
5
|
+
/**
|
|
6
|
+
* Merged bundle delivered to the SPA — `moduleId → entries` for the
|
|
7
|
+
* single language the user is currently viewing.
|
|
8
|
+
*/
|
|
9
|
+
export type Bundle = GetBundlesResponse['bundles'];
|
|
10
|
+
/** Outcome of a single resolver lookup; lets callers observe the fallback chain. */
|
|
11
|
+
export type ResolveOutcome = 'requested' | 'en' | 'placeholder';
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,GACzB,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAEnD,oFAAoF;AACpF,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,IAAI,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Admin UI i18n runtime types — feature 019.
|
|
2
|
+
//
|
|
3
|
+
// Re-exports of the contract shapes plus admin-side type aliases. The
|
|
4
|
+
// Bundle and ScopedBundle aliases are used by TranslationProvider and
|
|
5
|
+
// the resolver respectively — see admin/src/i18n/resolver.ts.
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,8DAA8D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../src/i18n/useTranslation.ts"],"names":[],"mappings":"AAaA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,SAGlC,MAAM,WAAW,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAG,MAAM,CAIlE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Public hook — feature 019.
|
|
2
|
+
//
|
|
3
|
+
// Returns a scope-bound `t(key, params?)` function. Pass the calling
|
|
4
|
+
// module's id as the scope so keys are looked up against the right
|
|
5
|
+
// bundle (research §R3, FR-009).
|
|
6
|
+
//
|
|
7
|
+
// const t = useTranslation('settings');
|
|
8
|
+
// t('actions.save'); // → "Save" / "Zapisz"
|
|
9
|
+
// t('notifications.saved', { name: 'foo' }); // → "Saved \"foo\"."
|
|
10
|
+
import { useCallback } from 'react';
|
|
11
|
+
import { useTranslationContext } from './TranslationProvider.js';
|
|
12
|
+
export function useTranslation(scope) {
|
|
13
|
+
const { t } = useTranslationContext();
|
|
14
|
+
return useCallback((key, params) => t(scope, key, params), [t, scope]);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=useTranslation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../src/i18n/useTranslation.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,EAAE;AACF,qEAAqE;AACrE,mEAAmE;AACnE,iCAAiC;AACjC,EAAE;AACF,0CAA0C;AAC1C,uEAAuE;AACvE,sEAAsE;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,MAAM,EAAE,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACtC,OAAO,WAAW,CAChB,CAAC,GAAW,EAAE,MAAwC,EAAU,EAAE,CAChE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EACvB,CAAC,CAAC,EAAE,KAAK,CAAC,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-map.d.ts","sourceRoot":"","sources":["../../../src/lib/admin-actions/icon-map.ts"],"names":[],"mappings":"AAAA,OAAO,EA0DL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AA4GtB,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAOpD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Activity, Archive, Bell, BookOpen, Box, Boxes, Building2, CircleDollarSign, ClipboardCheck, ClipboardList, CloudUpload, CreditCard, Download, Edit, Eraser, FilePlus, FileDown, FileText, FileUp, FolderPlus, Image as ImageIcon, Inbox, KeyRound, Languages, Layers, LayoutDashboard, LineChart, ListChecks, Menu, Newspaper, Package, PackageOpen, PanelLeft, PercentDiamond, PlugZap, Plus, PlusCircle, PlusSquare, Receipt, Rss, Scale, Search, Settings, ShieldCheck, ShoppingCart, Smartphone, Sparkles, Store, Tag, TrendingDown, Truck, Upload, UserPlus, Users, Video, Warehouse, Webhook, } from 'lucide-react';
|
|
2
|
+
/**
|
|
3
|
+
* Map from the closed allowlist of icon names declared in
|
|
4
|
+
* `packages/contracts/src/admin-actions.ts` to their lucide-react
|
|
5
|
+
* components. Adding a new entry here requires the matching name to be
|
|
6
|
+
* added to `KnownIconNameSchema` in the same PR.
|
|
7
|
+
*
|
|
8
|
+
* If a string somehow reaches the admin that isn't in the allowlist
|
|
9
|
+
* (e.g., backend and admin bundles drifted across deploys), we render
|
|
10
|
+
* the `Sparkles` fallback rather than dropping the action — the action
|
|
11
|
+
* remains usable, only the icon is generic.
|
|
12
|
+
*/
|
|
13
|
+
const ICON_MAP = {
|
|
14
|
+
Plus,
|
|
15
|
+
PlugZap,
|
|
16
|
+
Sparkles,
|
|
17
|
+
Settings,
|
|
18
|
+
Search,
|
|
19
|
+
Boxes,
|
|
20
|
+
Layers,
|
|
21
|
+
Menu,
|
|
22
|
+
PlusCircle,
|
|
23
|
+
PlusSquare,
|
|
24
|
+
FilePlus,
|
|
25
|
+
FolderPlus,
|
|
26
|
+
Upload,
|
|
27
|
+
FileUp,
|
|
28
|
+
CloudUpload,
|
|
29
|
+
Download,
|
|
30
|
+
FileDown,
|
|
31
|
+
FileText,
|
|
32
|
+
BookOpen,
|
|
33
|
+
Rss,
|
|
34
|
+
Package,
|
|
35
|
+
Tag,
|
|
36
|
+
ShoppingCart,
|
|
37
|
+
Receipt,
|
|
38
|
+
CreditCard,
|
|
39
|
+
Users,
|
|
40
|
+
UserPlus,
|
|
41
|
+
Inbox,
|
|
42
|
+
ListChecks,
|
|
43
|
+
ClipboardList,
|
|
44
|
+
Image: ImageIcon,
|
|
45
|
+
Video,
|
|
46
|
+
LayoutDashboard,
|
|
47
|
+
PanelLeft,
|
|
48
|
+
KeyRound,
|
|
49
|
+
// Feature 080 (D-163.1) — the dashboard recent-activity renderings. They
|
|
50
|
+
// were lucide imports inside `modules/home/activity-render.ts`, the fourth
|
|
51
|
+
// hand-maintained action table that ruling retired; a module declares its
|
|
52
|
+
// icon by name now, so the name has to be in the platform's allowlist and
|
|
53
|
+
// resolve through this one map.
|
|
54
|
+
Edit,
|
|
55
|
+
Archive,
|
|
56
|
+
Box,
|
|
57
|
+
Truck,
|
|
58
|
+
CircleDollarSign,
|
|
59
|
+
Activity,
|
|
60
|
+
// Feature 091 (Phase 4, batch two) — `analytics` declares its sidebar icon by
|
|
61
|
+
// name now, and this is the map that turns the name back into the same glyph
|
|
62
|
+
// `AppShell.tsx` used to import directly.
|
|
63
|
+
LineChart,
|
|
64
|
+
// Feature 091 (Phase 4, batch four) — the same, for `admin_roles`' sidebar
|
|
65
|
+
// entry and palette action.
|
|
66
|
+
ShieldCheck,
|
|
67
|
+
// Feature 091 (Phase 4, batch six) — the same, for `pwa`' sidebar entry.
|
|
68
|
+
Smartphone,
|
|
69
|
+
// Feature 091 (Phase 4, the plan's batch 6) — the same, for `webhooks`' and
|
|
70
|
+
// `comparisons`' sidebar entries and palette actions. `api_keys` needed no
|
|
71
|
+
// entry: `KeyRound` is already above.
|
|
72
|
+
Webhook,
|
|
73
|
+
Scale,
|
|
74
|
+
// Feature 091 (Phase 4, the plan's batch 7) — the same, for `promotions`' two
|
|
75
|
+
// sidebar entries and two palette rows. The other three members of that batch
|
|
76
|
+
// needed no entry: `CreditCard`, `Users` and `Rss` are already above.
|
|
77
|
+
PercentDiamond,
|
|
78
|
+
// Feature 091 (Phase 4, batch 8) — the same, for `megamenu`'s sidebar entry.
|
|
79
|
+
// The batch's other five needed no entry: `Search`, `Receipt`, `Truck`,
|
|
80
|
+
// `CreditCard` and `Package` are already above.
|
|
81
|
+
Newspaper,
|
|
82
|
+
// Feature 091 (Phase 4, batch 10) — the same, for `dictionaries`' two sidebar
|
|
83
|
+
// entries and two palette actions and for `settings`' cache row. The batch's
|
|
84
|
+
// other rows needed no entry: `ListChecks`, `Settings` and `KeyRound` are
|
|
85
|
+
// already above.
|
|
86
|
+
Languages,
|
|
87
|
+
Eraser,
|
|
88
|
+
// Feature 091 (Phase 4, batch 13) — the same, for four of `inventory`'s five
|
|
89
|
+
// sidebar entries. The batch's other rows needed no entry: `Box`,
|
|
90
|
+
// `CircleDollarSign` and `PlugZap` are already above.
|
|
91
|
+
Warehouse,
|
|
92
|
+
TrendingDown,
|
|
93
|
+
Bell,
|
|
94
|
+
PackageOpen,
|
|
95
|
+
// Feature 091 (Phase 4, batch 14) — the same, for `organizations`' and
|
|
96
|
+
// `sales_channels`' sidebar entries and the two palette actions that replace
|
|
97
|
+
// their hand-written *Navigate* rows. `customers`' two rows needed no entry:
|
|
98
|
+
// `Users` is already above.
|
|
99
|
+
Building2,
|
|
100
|
+
Store,
|
|
101
|
+
// Feature 091 (Phase 4, batch 15) — the same, for `orders`' three sidebar
|
|
102
|
+
// entries. The batch's other seven rows needed no entry: `Package`, `Boxes`,
|
|
103
|
+
// `Tag`, `FileText` and `ListChecks` are already above.
|
|
104
|
+
ClipboardCheck,
|
|
105
|
+
};
|
|
106
|
+
export function resolveIcon(name) {
|
|
107
|
+
const known = ICON_MAP[name];
|
|
108
|
+
if (known)
|
|
109
|
+
return known;
|
|
110
|
+
if (import.meta.env.DEV) {
|
|
111
|
+
console.warn(`[admin-actions] unknown icon "${name}" — rendering fallback Sparkles.`);
|
|
112
|
+
}
|
|
113
|
+
return Sparkles;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=icon-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-map.js","sourceRoot":"","sources":["../../../src/lib/admin-actions/icon-map.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,GAAG,EACH,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,WAAW,EACX,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,UAAU,EACV,KAAK,IAAI,SAAS,EAClB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,MAAM,EACN,eAAe,EACf,SAAS,EACT,UAAU,EACV,IAAI,EACJ,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAS,EACT,cAAc,EACd,OAAO,EACP,IAAI,EACJ,UAAU,EACV,UAAU,EACV,OAAO,EACP,GAAG,EACH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,KAAK,EACL,GAAG,EACH,YAAY,EACZ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,EACL,SAAS,EACT,OAAO,GAER,MAAM,cAAc,CAAC;AAGtB;;;;;;;;;;GAUG;AACH,MAAM,QAAQ,GAAsC;IAClD,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,KAAK;IACL,MAAM;IACN,IAAI;IACJ,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;IACV,MAAM;IACN,MAAM;IACN,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,GAAG;IACH,OAAO;IACP,GAAG;IACH,YAAY;IACZ,OAAO;IACP,UAAU;IACV,KAAK;IACL,QAAQ;IACR,KAAK;IACL,UAAU;IACV,aAAa;IACb,KAAK,EAAE,SAAS;IAChB,KAAK;IACL,eAAe;IACf,SAAS;IACT,QAAQ;IACR,yEAAyE;IACzE,2EAA2E;IAC3E,0EAA0E;IAC1E,0EAA0E;IAC1E,gCAAgC;IAChC,IAAI;IACJ,OAAO;IACP,GAAG;IACH,KAAK;IACL,gBAAgB;IAChB,QAAQ;IACR,8EAA8E;IAC9E,6EAA6E;IAC7E,0CAA0C;IAC1C,SAAS;IACT,2EAA2E;IAC3E,4BAA4B;IAC5B,WAAW;IACX,yEAAyE;IACzE,UAAU;IACV,4EAA4E;IAC5E,2EAA2E;IAC3E,sCAAsC;IACtC,OAAO;IACP,KAAK;IACL,8EAA8E;IAC9E,8EAA8E;IAC9E,sEAAsE;IACtE,cAAc;IACd,6EAA6E;IAC7E,wEAAwE;IACxE,gDAAgD;IAChD,SAAS;IACT,8EAA8E;IAC9E,6EAA6E;IAC7E,0EAA0E;IAC1E,iBAAiB;IACjB,SAAS;IACT,MAAM;IACN,6EAA6E;IAC7E,kEAAkE;IAClE,sDAAsD;IACtD,SAAS;IACT,YAAY;IACZ,IAAI;IACJ,WAAW;IACX,uEAAuE;IACvE,6EAA6E;IAC7E,6EAA6E;IAC7E,4BAA4B;IAC5B,SAAS;IACT,KAAK;IACL,0EAA0E;IAC1E,6EAA6E;IAC7E,wDAAwD;IACxD,cAAc;CACf,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAqB,CAAC,CAAC;IAC9C,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACxB,OAAO,CAAC,IAAI,CAAC,iCAAiC,IAAI,kCAAkC,CAAC,CAAC;IACxF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The admin's HTTP client — the fetch wrapper, the origin it talks to and the
|
|
3
|
+
* unauthorized-listener seam around both.
|
|
4
|
+
*
|
|
5
|
+
* The wrapper below was `@endora-commerce/api-client` until D-202. That
|
|
6
|
+
* package's own header called it *"the typed HTTP client shared by storefront
|
|
7
|
+
* and admin"*, and half of that sentence had never been true: no storefront
|
|
8
|
+
* file ever imported it, and this file was its only production consumer —
|
|
9
|
+
* 81 lines behind a package boundary, wrapped by the 30 lines that follow them.
|
|
10
|
+
* The ruling folded it in here rather than answer what the boundary was for.
|
|
11
|
+
*
|
|
12
|
+
* It stays deliberately thin: it carries cookies for session auth and an
|
|
13
|
+
* optional API key for integration-scope calls, applies the project's envelope
|
|
14
|
+
* conventions, and surfaces typed errors from `@endora-commerce/contracts`.
|
|
15
|
+
*/
|
|
16
|
+
import type { ErrorEnvelope } from '@endora-commerce/contracts';
|
|
17
|
+
export interface ApiClientOptions {
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
/** Optional API-key for server-to-server integrations. Overrides cookie auth when set. */
|
|
20
|
+
apiKey?: string;
|
|
21
|
+
/** Optional custom fetch implementation (useful in tests and server-side rendering). */
|
|
22
|
+
fetchFn?: typeof fetch;
|
|
23
|
+
}
|
|
24
|
+
export declare class ApiError extends Error {
|
|
25
|
+
readonly status: number;
|
|
26
|
+
readonly envelope: ErrorEnvelope;
|
|
27
|
+
constructor(status: number, envelope: ErrorEnvelope);
|
|
28
|
+
}
|
|
29
|
+
export interface ApiClient {
|
|
30
|
+
get<T>(path: string, init?: RequestInit): Promise<T>;
|
|
31
|
+
post<T>(path: string, body?: unknown, init?: RequestInit): Promise<T>;
|
|
32
|
+
put<T>(path: string, body?: unknown, init?: RequestInit): Promise<T>;
|
|
33
|
+
patch<T>(path: string, body?: unknown, init?: RequestInit): Promise<T>;
|
|
34
|
+
delete<T>(path: string, init?: RequestInit): Promise<T>;
|
|
35
|
+
}
|
|
36
|
+
export declare function createApiClient(options: ApiClientOptions): ApiClient;
|
|
37
|
+
/**
|
|
38
|
+
* The API origin this admin talks to, and the **one** place the environment
|
|
39
|
+
* variable behind it is read.
|
|
40
|
+
*
|
|
41
|
+
* Published (feature 091) because a screen that builds a URL the fetch client
|
|
42
|
+
* cannot make for it — a `<a download>` href, a form action — needs the same
|
|
43
|
+
* origin, and a module package cannot read `import.meta.env` for itself
|
|
44
|
+
* without acquiring `vite/client` types and a second copy of this fallback.
|
|
45
|
+
* Vite replaces the expression `import.meta.env.VITE_API_BASE_URL` at build
|
|
46
|
+
* time, so it is written **verbatim** here: a cast or an indirection is a
|
|
47
|
+
* chance for that replacement to stop happening in a way no type-check can
|
|
48
|
+
* see.
|
|
49
|
+
*/
|
|
50
|
+
export declare const apiBaseUrl: string;
|
|
51
|
+
type Listener = () => void;
|
|
52
|
+
export declare function onUnauthorized(listener: Listener): () => void;
|
|
53
|
+
export declare const apiClient: ApiClient;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;CACxB;AAED,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;gBACrB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa;CAMpD;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtE,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACrE,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvE,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACzD;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CA4CpE;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,EAAE,MAC6D,CAAC;AAIvF,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAG3B,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAK7D;AAWD,eAAO,MAAM,SAAS,EAAE,SAMvB,CAAC"}
|