@wilshop/dashboard 3.5.2
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/README.md +116 -0
- package/dist/plugin/api/api-extensions.d.ts +1 -0
- package/dist/plugin/api/api-extensions.js +35 -0
- package/dist/plugin/api/metrics.resolver.d.ts +8 -0
- package/dist/plugin/api/metrics.resolver.js +40 -0
- package/dist/plugin/config/metrics-strategies.d.ts +39 -0
- package/dist/plugin/config/metrics-strategies.js +74 -0
- package/dist/plugin/constants.d.ts +8 -0
- package/dist/plugin/constants.js +31 -0
- package/dist/plugin/dashboard.plugin.d.ts +115 -0
- package/dist/plugin/dashboard.plugin.js +339 -0
- package/dist/plugin/default-page.html +193 -0
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/index.js +18 -0
- package/dist/plugin/package.json +3 -0
- package/dist/plugin/service/metrics.service.d.ts +15 -0
- package/dist/plugin/service/metrics.service.js +129 -0
- package/dist/plugin/types.d.ts +20 -0
- package/dist/plugin/types.js +9 -0
- package/dist/vite/constants.d.ts +5 -0
- package/dist/vite/constants.js +278 -0
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/index.js +1 -0
- package/dist/vite/types.d.ts +79 -0
- package/dist/vite/types.js +1 -0
- package/dist/vite/utils/ast-utils.d.ts +5 -0
- package/dist/vite/utils/ast-utils.js +29 -0
- package/dist/vite/utils/ast-utils.spec.d.ts +1 -0
- package/dist/vite/utils/ast-utils.spec.js +45 -0
- package/dist/vite/utils/compiler.d.ts +23 -0
- package/dist/vite/utils/compiler.js +165 -0
- package/dist/vite/utils/get-dashboard-paths.d.ts +5 -0
- package/dist/vite/utils/get-dashboard-paths.js +20 -0
- package/dist/vite/utils/logger.d.ts +3 -0
- package/dist/vite/utils/logger.js +39 -0
- package/dist/vite/utils/plugin-discovery.d.ts +27 -0
- package/dist/vite/utils/plugin-discovery.js +398 -0
- package/dist/vite/utils/schema-generator.d.ts +10 -0
- package/dist/vite/utils/schema-generator.js +35 -0
- package/dist/vite/utils/tsconfig-utils.d.ts +9 -0
- package/dist/vite/utils/tsconfig-utils.js +51 -0
- package/dist/vite/utils/ui-config.d.ts +3 -0
- package/dist/vite/utils/ui-config.js +30 -0
- package/dist/vite/vite-plugin-admin-api-schema.d.ts +24 -0
- package/dist/vite/vite-plugin-admin-api-schema.js +82 -0
- package/dist/vite/vite-plugin-config-loader.d.ts +16 -0
- package/dist/vite/vite-plugin-config-loader.js +70 -0
- package/dist/vite/vite-plugin-config.d.ts +4 -0
- package/dist/vite/vite-plugin-config.js +60 -0
- package/dist/vite/vite-plugin-dashboard-metadata.d.ts +7 -0
- package/dist/vite/vite-plugin-dashboard-metadata.js +61 -0
- package/dist/vite/vite-plugin-gql-tada.d.ts +6 -0
- package/dist/vite/vite-plugin-gql-tada.js +51 -0
- package/dist/vite/vite-plugin-hmr.d.ts +8 -0
- package/dist/vite/vite-plugin-hmr.js +34 -0
- package/dist/vite/vite-plugin-lingui-babel.d.ts +27 -0
- package/dist/vite/vite-plugin-lingui-babel.js +86 -0
- package/dist/vite/vite-plugin-tailwind-source.d.ts +7 -0
- package/dist/vite/vite-plugin-tailwind-source.js +48 -0
- package/dist/vite/vite-plugin-theme.d.ts +55 -0
- package/dist/vite/vite-plugin-theme.js +130 -0
- package/dist/vite/vite-plugin-transform-index.d.ts +11 -0
- package/dist/vite/vite-plugin-transform-index.js +40 -0
- package/dist/vite/vite-plugin-translations.d.ts +31 -0
- package/dist/vite/vite-plugin-translations.js +177 -0
- package/dist/vite/vite-plugin-ui-config.d.ts +150 -0
- package/dist/vite/vite-plugin-ui-config.js +36 -0
- package/dist/vite/vite-plugin-vendure-dashboard.d.ts +142 -0
- package/dist/vite/vite-plugin-vendure-dashboard.js +170 -0
- package/index.html +14 -0
- package/lingui.config.js +37 -0
- package/package.json +178 -0
- package/src/app/app-providers.tsx +31 -0
- package/src/app/common/delete-bulk-action.tsx +149 -0
- package/src/app/common/duplicate-bulk-action.tsx +147 -0
- package/src/app/common/duplicate-entity-dialog.tsx +117 -0
- package/src/app/common/map-faceted-filter-fields.ts +21 -0
- package/src/app/common/set-document-direction.ts +7 -0
- package/src/app/common/use-page-title.test.ts +263 -0
- package/src/app/common/use-page-title.ts +86 -0
- package/src/app/main.tsx +134 -0
- package/src/app/routeTree.gen.ts +1284 -0
- package/src/app/routes/__root.tsx +23 -0
- package/src/app/routes/_authenticated/_administrators/administrators.graphql.ts +88 -0
- package/src/app/routes/_authenticated/_administrators/administrators.tsx +104 -0
- package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +160 -0
- package/src/app/routes/_authenticated/_administrators/components/administrator-bulk-actions.tsx +15 -0
- package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +133 -0
- package/src/app/routes/_authenticated/_assets/assets.graphql.ts +76 -0
- package/src/app/routes/_authenticated/_assets/assets.tsx +48 -0
- package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +181 -0
- package/src/app/routes/_authenticated/_assets/components/asset-bulk-actions.tsx +47 -0
- package/src/app/routes/_authenticated/_assets/components/asset-tag-filter.tsx +206 -0
- package/src/app/routes/_authenticated/_assets/components/asset-tags-editor.tsx +226 -0
- package/src/app/routes/_authenticated/_assets/components/manage-tags-dialog.tsx +212 -0
- package/src/app/routes/_authenticated/_channels/channels.graphql.ts +102 -0
- package/src/app/routes/_authenticated/_channels/channels.tsx +81 -0
- package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +251 -0
- package/src/app/routes/_authenticated/_channels/components/channel-bulk-actions.tsx +15 -0
- package/src/app/routes/_authenticated/_collections/collections.graphql.ts +193 -0
- package/src/app/routes/_authenticated/_collections/collections.tsx +337 -0
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +236 -0
- package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +130 -0
- package/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx +153 -0
- package/src/app/routes/_authenticated/_collections/components/collection-contents-sheet.tsx +50 -0
- package/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx +83 -0
- package/src/app/routes/_authenticated/_collections/components/collection-filters-selector.tsx +24 -0
- package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +433 -0
- package/src/app/routes/_authenticated/_countries/components/country-bulk-actions.tsx +15 -0
- package/src/app/routes/_authenticated/_countries/countries.graphql.ts +82 -0
- package/src/app/routes/_authenticated/_countries/countries.tsx +72 -0
- package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +123 -0
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-bulk-actions.tsx +15 -0
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-sheet.tsx +51 -0
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx +134 -0
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.graphql.ts +80 -0
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +72 -0
- package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +121 -0
- package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +155 -0
- package/src/app/routes/_authenticated/_customers/components/customer-address-form.tsx +347 -0
- package/src/app/routes/_authenticated/_customers/components/customer-bulk-actions.tsx +15 -0
- package/src/app/routes/_authenticated/_customers/components/customer-group-controls.tsx +4 -0
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-container.tsx +78 -0
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-types.ts +5 -0
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-utils.tsx +124 -0
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history.tsx +113 -0
- package/src/app/routes/_authenticated/_customers/components/customer-history/default-customer-history-components.tsx +176 -0
- package/src/app/routes/_authenticated/_customers/components/customer-history/index.ts +4 -0
- package/src/app/routes/_authenticated/_customers/components/customer-history/use-customer-history.ts +169 -0
- package/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx +90 -0
- package/src/app/routes/_authenticated/_customers/components/customer-status-badge.tsx +33 -0
- package/src/app/routes/_authenticated/_customers/customers.graphql.ts +218 -0
- package/src/app/routes/_authenticated/_customers/customers.tsx +104 -0
- package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +280 -0
- package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +99 -0
- package/src/app/routes/_authenticated/_facets/components/facet-value-bulk-actions.tsx +16 -0
- package/src/app/routes/_authenticated/_facets/components/facet-values-sheet.tsx +49 -0
- package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +139 -0
- package/src/app/routes/_authenticated/_facets/facets.graphql.ts +182 -0
- package/src/app/routes/_authenticated/_facets/facets.tsx +121 -0
- package/src/app/routes/_authenticated/_facets/facets_.$facetId.values_.$id.tsx +158 -0
- package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +152 -0
- package/src/app/routes/_authenticated/_global-settings/global-settings.graphql.ts +28 -0
- package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +161 -0
- package/src/app/routes/_authenticated/_orders/components/add-manual-payment-dialog.tsx +189 -0
- package/src/app/routes/_authenticated/_orders/components/add-surcharge-form.tsx +139 -0
- package/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx +100 -0
- package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +287 -0
- package/src/app/routes/_authenticated/_orders/components/fulfill-order-dialog.tsx +320 -0
- package/src/app/routes/_authenticated/_orders/components/fulfillment-details.tsx +159 -0
- package/src/app/routes/_authenticated/_orders/components/money-gross-net.tsx +20 -0
- package/src/app/routes/_authenticated/_orders/components/order-address.tsx +65 -0
- package/src/app/routes/_authenticated/_orders/components/order-detail-shared.tsx +307 -0
- package/src/app/routes/_authenticated/_orders/components/order-history/default-order-history-components.tsx +98 -0
- package/src/app/routes/_authenticated/_orders/components/order-history/index.ts +3 -0
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-container.tsx +80 -0
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-types.ts +5 -0
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-utils.tsx +173 -0
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history.tsx +104 -0
- package/src/app/routes/_authenticated/_orders/components/order-history/use-order-history.ts +175 -0
- package/src/app/routes/_authenticated/_orders/components/order-line-custom-fields-form.tsx +53 -0
- package/src/app/routes/_authenticated/_orders/components/order-modification-preview-dialog.tsx +365 -0
- package/src/app/routes/_authenticated/_orders/components/order-modification-summary.tsx +261 -0
- package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +100 -0
- package/src/app/routes/_authenticated/_orders/components/order-table.tsx +194 -0
- package/src/app/routes/_authenticated/_orders/components/order-tax-summary.tsx +40 -0
- package/src/app/routes/_authenticated/_orders/components/payment-details.tsx +293 -0
- package/src/app/routes/_authenticated/_orders/components/seller-orders-card.tsx +63 -0
- package/src/app/routes/_authenticated/_orders/components/settle-refund-dialog.tsx +80 -0
- package/src/app/routes/_authenticated/_orders/components/shipping-method-selector.tsx +64 -0
- package/src/app/routes/_authenticated/_orders/components/state-transition-control.tsx +99 -0
- package/src/app/routes/_authenticated/_orders/components/use-transition-order-to-state.tsx +151 -0
- package/src/app/routes/_authenticated/_orders/orders.graphql.ts +775 -0
- package/src/app/routes/_authenticated/_orders/orders.tsx +120 -0
- package/src/app/routes/_authenticated/_orders/orders_.$aggregateOrderId_.seller-orders.$sellerOrderId.tsx +50 -0
- package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +30 -0
- package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +298 -0
- package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +495 -0
- package/src/app/routes/_authenticated/_orders/utils/order-detail-loaders.tsx +134 -0
- package/src/app/routes/_authenticated/_orders/utils/order-types.ts +10 -0
- package/src/app/routes/_authenticated/_orders/utils/order-utils.ts +159 -0
- package/src/app/routes/_authenticated/_orders/utils/use-modify-order.ts +335 -0
- package/src/app/routes/_authenticated/_payment-methods/components/payment-eligibility-checker-selector.tsx +37 -0
- package/src/app/routes/_authenticated/_payment-methods/components/payment-handler-selector.tsx +33 -0
- package/src/app/routes/_authenticated/_payment-methods/components/payment-method-bulk-actions.tsx +58 -0
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.graphql.ts +110 -0
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +88 -0
- package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +197 -0
- package/src/app/routes/_authenticated/_product-variants/components/add-currency-dropdown.tsx +49 -0
- package/src/app/routes/_authenticated/_product-variants/components/add-stock-location-dropdown.tsx +56 -0
- package/src/app/routes/_authenticated/_product-variants/components/product-variant-bulk-actions.tsx +110 -0
- package/src/app/routes/_authenticated/_product-variants/components/variant-price-detail.tsx +88 -0
- package/src/app/routes/_authenticated/_product-variants/product-variants.graphql.ts +207 -0
- package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +98 -0
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +471 -0
- package/src/app/routes/_authenticated/_products/components/add-option-group-dialog.tsx +127 -0
- package/src/app/routes/_authenticated/_products/components/add-product-variant-dialog.tsx +372 -0
- package/src/app/routes/_authenticated/_products/components/assign-facet-values-dialog.tsx +282 -0
- package/src/app/routes/_authenticated/_products/components/create-product-options-dialog.tsx +416 -0
- package/src/app/routes/_authenticated/_products/components/create-product-variants-dialog.tsx +190 -0
- package/src/app/routes/_authenticated/_products/components/create-product-variants.tsx +370 -0
- package/src/app/routes/_authenticated/_products/components/option-groups-editor.tsx +180 -0
- package/src/app/routes/_authenticated/_products/components/option-value-input.tsx +72 -0
- package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +117 -0
- package/src/app/routes/_authenticated/_products/components/product-option-group-badge.tsx +19 -0
- package/src/app/routes/_authenticated/_products/components/product-option-select.tsx +111 -0
- package/src/app/routes/_authenticated/_products/components/product-options-table.tsx +114 -0
- package/src/app/routes/_authenticated/_products/components/product-variants-table.tsx +120 -0
- package/src/app/routes/_authenticated/_products/product-option-groups.graphql.ts +103 -0
- package/src/app/routes/_authenticated/_products/products.graphql.ts +352 -0
- package/src/app/routes/_authenticated/_products/products.tsx +121 -0
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +258 -0
- package/src/app/routes/_authenticated/_products/products_.$id_.variants.tsx +405 -0
- package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$id.tsx +177 -0
- package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$productOptionGroupId.options_.$id.tsx +204 -0
- package/src/app/routes/_authenticated/_profile/profile.graphql.ts +23 -0
- package/src/app/routes/_authenticated/_profile/profile.tsx +119 -0
- package/src/app/routes/_authenticated/_promotions/components/promotion-actions-selector.tsx +35 -0
- package/src/app/routes/_authenticated/_promotions/components/promotion-bulk-actions.tsx +72 -0
- package/src/app/routes/_authenticated/_promotions/components/promotion-conditions-selector.tsx +35 -0
- package/src/app/routes/_authenticated/_promotions/promotions.graphql.ts +121 -0
- package/src/app/routes/_authenticated/_promotions/promotions.tsx +94 -0
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +245 -0
- package/src/app/routes/_authenticated/_roles/components/expandable-permissions.tsx +54 -0
- package/src/app/routes/_authenticated/_roles/components/permissions-table-grid.tsx +251 -0
- package/src/app/routes/_authenticated/_roles/components/role-bulk-actions.tsx +15 -0
- package/src/app/routes/_authenticated/_roles/roles.graphql.ts +76 -0
- package/src/app/routes/_authenticated/_roles/roles.tsx +99 -0
- package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +146 -0
- package/src/app/routes/_authenticated/_sellers/components/seller-bulk-actions.tsx +15 -0
- package/src/app/routes/_authenticated/_sellers/sellers.graphql.ts +70 -0
- package/src/app/routes/_authenticated/_sellers/sellers.tsx +56 -0
- package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +112 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/fulfillment-handler-selector.tsx +56 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/metadata-badges.tsx +15 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/price-display.tsx +21 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-calculator-selector.tsx +33 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-eligibility-checker-selector.tsx +36 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-bulk-actions.tsx +61 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-test-result-wrapper.tsx +87 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/test-address-form.tsx +256 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/test-order-builder.tsx +244 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-result.tsx +97 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-sheet.tsx +41 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods.tsx +74 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/test-single-method-result.tsx +90 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/test-single-shipping-method-sheet.tsx +56 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/test-single-shipping-method.tsx +82 -0
- package/src/app/routes/_authenticated/_shipping-methods/components/use-shipping-method-test-state.ts +67 -0
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.graphql.ts +137 -0
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +76 -0
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +197 -0
- package/src/app/routes/_authenticated/_stock-locations/components/stock-location-bulk-actions.tsx +58 -0
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.graphql.ts +87 -0
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +65 -0
- package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +126 -0
- package/src/app/routes/_authenticated/_system/components/payload-dialog.tsx +41 -0
- package/src/app/routes/_authenticated/_system/healthchecks.tsx +99 -0
- package/src/app/routes/_authenticated/_system/job-queue.graphql.ts +54 -0
- package/src/app/routes/_authenticated/_system/job-queue.tsx +265 -0
- package/src/app/routes/_authenticated/_system/scheduled-tasks.tsx +249 -0
- package/src/app/routes/_authenticated/_tax-categories/components/tax-category-bulk-actions.tsx +15 -0
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.graphql.ts +72 -0
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +69 -0
- package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +127 -0
- package/src/app/routes/_authenticated/_tax-rates/components/tax-rate-bulk-actions.tsx +15 -0
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.graphql.ts +84 -0
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +119 -0
- package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +149 -0
- package/src/app/routes/_authenticated/_zones/components/zone-bulk-actions.tsx +63 -0
- package/src/app/routes/_authenticated/_zones/components/zone-countries-add.tsx +0 -0
- package/src/app/routes/_authenticated/_zones/components/zone-countries-sheet.tsx +34 -0
- package/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx +94 -0
- package/src/app/routes/_authenticated/_zones/zones.graphql.ts +105 -0
- package/src/app/routes/_authenticated/_zones/zones.tsx +64 -0
- package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +110 -0
- package/src/app/routes/_authenticated/index.tsx +233 -0
- package/src/app/routes/_authenticated.tsx +35 -0
- package/src/app/routes/login.tsx +49 -0
- package/src/app/styles.css +100 -0
- package/src/app/tailwindcss-animate.css +275 -0
- package/src/i18n/common-strings.ts +111 -0
- package/src/i18n/locales/ar.po +4972 -0
- package/src/i18n/locales/bg.po +3436 -0
- package/src/i18n/locales/cs.po +4972 -0
- package/src/i18n/locales/de.po +4972 -0
- package/src/i18n/locales/en.po +4972 -0
- package/src/i18n/locales/es.po +4972 -0
- package/src/i18n/locales/fa.po +4972 -0
- package/src/i18n/locales/fr.po +4972 -0
- package/src/i18n/locales/he.po +4972 -0
- package/src/i18n/locales/hr.po +4972 -0
- package/src/i18n/locales/it.po +4972 -0
- package/src/i18n/locales/ja.po +4972 -0
- package/src/i18n/locales/ko.po +4628 -0
- package/src/i18n/locales/nb.po +4972 -0
- package/src/i18n/locales/ne.po +4972 -0
- package/src/i18n/locales/nl.po +4628 -0
- package/src/i18n/locales/pl.po +4972 -0
- package/src/i18n/locales/pt_BR.po +4972 -0
- package/src/i18n/locales/pt_PT.po +4972 -0
- package/src/i18n/locales/ru.po +4972 -0
- package/src/i18n/locales/sv.po +4972 -0
- package/src/i18n/locales/tr.po +4972 -0
- package/src/i18n/locales/uk.po +4972 -0
- package/src/i18n/locales/zh_Hans.po +4972 -0
- package/src/i18n/locales/zh_Hant.po +4972 -0
- package/src/lib/components/data-display/boolean.tsx +23 -0
- package/src/lib/components/data-display/date-time.tsx +19 -0
- package/src/lib/components/data-display/json.tsx +20 -0
- package/src/lib/components/data-display/money.tsx +14 -0
- package/src/lib/components/data-input/affixed-input.stories.tsx +93 -0
- package/src/lib/components/data-input/affixed-input.tsx +79 -0
- package/src/lib/components/data-input/boolean-input.stories.tsx +102 -0
- package/src/lib/components/data-input/boolean-input.tsx +16 -0
- package/src/lib/components/data-input/checkbox-input.stories.tsx +61 -0
- package/src/lib/components/data-input/checkbox-input.tsx +15 -0
- package/src/lib/components/data-input/combination-mode-input.tsx +61 -0
- package/src/lib/components/data-input/configurable-operation-list-input.tsx +58 -0
- package/src/lib/components/data-input/custom-field-list-input.tsx +294 -0
- package/src/lib/components/data-input/customer-group-input.tsx +61 -0
- package/src/lib/components/data-input/datetime-input.stories.tsx +62 -0
- package/src/lib/components/data-input/datetime-input.tsx +192 -0
- package/src/lib/components/data-input/default-relation-input.tsx +626 -0
- package/src/lib/components/data-input/facet-value-input.tsx +78 -0
- package/src/lib/components/data-input/index.ts +23 -0
- package/src/lib/components/data-input/money-input.stories.tsx +88 -0
- package/src/lib/components/data-input/money-input.tsx +122 -0
- package/src/lib/components/data-input/number-input.stories.tsx +103 -0
- package/src/lib/components/data-input/number-input.tsx +85 -0
- package/src/lib/components/data-input/password-form-input.stories.tsx +65 -0
- package/src/lib/components/data-input/password-form-input.tsx +23 -0
- package/src/lib/components/data-input/product-multi-selector-input.tsx +416 -0
- package/src/lib/components/data-input/relation-input.tsx +165 -0
- package/src/lib/components/data-input/relation-selector.tsx +476 -0
- package/src/lib/components/data-input/rich-text-input.stories.tsx +92 -0
- package/src/lib/components/data-input/rich-text-input.tsx +16 -0
- package/src/lib/components/data-input/select-with-options.tsx +96 -0
- package/src/lib/components/data-input/slug-input.stories.tsx +232 -0
- package/src/lib/components/data-input/slug-input.tsx +289 -0
- package/src/lib/components/data-input/string-list-input.tsx +268 -0
- package/src/lib/components/data-input/struct-form-input.tsx +320 -0
- package/src/lib/components/data-input/text-input.stories.tsx +52 -0
- package/src/lib/components/data-input/text-input.tsx +16 -0
- package/src/lib/components/data-input/textarea-input.stories.tsx +55 -0
- package/src/lib/components/data-input/textarea-input.tsx +23 -0
- package/src/lib/components/data-table/add-filter-menu.tsx +64 -0
- package/src/lib/components/data-table/column-header-wrapper.tsx +106 -0
- package/src/lib/components/data-table/data-table-bulk-action-item.tsx +141 -0
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +99 -0
- package/src/lib/components/data-table/data-table-column-header.tsx +50 -0
- package/src/lib/components/data-table/data-table-context.tsx +106 -0
- package/src/lib/components/data-table/data-table-faceted-filter.tsx +195 -0
- package/src/lib/components/data-table/data-table-filter-badge-editable.tsx +35 -0
- package/src/lib/components/data-table/data-table-filter-badge.tsx +101 -0
- package/src/lib/components/data-table/data-table-filter-dialog.tsx +92 -0
- package/src/lib/components/data-table/data-table-pagination.tsx +103 -0
- package/src/lib/components/data-table/data-table-utils.ts +291 -0
- package/src/lib/components/data-table/data-table-view-options.tsx +130 -0
- package/src/lib/components/data-table/data-table.stories.tsx +249 -0
- package/src/lib/components/data-table/data-table.tsx +508 -0
- package/src/lib/components/data-table/filters/data-table-boolean-filter.tsx +60 -0
- package/src/lib/components/data-table/filters/data-table-datetime-filter.tsx +159 -0
- package/src/lib/components/data-table/filters/data-table-id-filter.tsx +63 -0
- package/src/lib/components/data-table/filters/data-table-number-filter.tsx +123 -0
- package/src/lib/components/data-table/filters/data-table-string-filter.tsx +79 -0
- package/src/lib/components/data-table/global-views-bar.tsx +97 -0
- package/src/lib/components/data-table/global-views-sheet.tsx +11 -0
- package/src/lib/components/data-table/human-readable-operator.tsx +65 -0
- package/src/lib/components/data-table/manage-global-views-button.tsx +26 -0
- package/src/lib/components/data-table/my-views-button.tsx +47 -0
- package/src/lib/components/data-table/refresh-button.tsx +49 -0
- package/src/lib/components/data-table/save-view-button.tsx +45 -0
- package/src/lib/components/data-table/save-view-dialog.tsx +134 -0
- package/src/lib/components/data-table/types.ts +40 -0
- package/src/lib/components/data-table/use-all-bulk-actions.ts +19 -0
- package/src/lib/components/data-table/use-generated-columns.tsx +411 -0
- package/src/lib/components/data-table/user-views-sheet.tsx +11 -0
- package/src/lib/components/data-table/views-sheet.tsx +305 -0
- package/src/lib/components/date-range-picker.tsx +186 -0
- package/src/lib/components/labeled-data.tsx +21 -0
- package/src/lib/components/layout/app-layout.tsx +35 -0
- package/src/lib/components/layout/app-sidebar.tsx +37 -0
- package/src/lib/components/layout/channel-switcher.tsx +229 -0
- package/src/lib/components/layout/content-language-selector.tsx +46 -0
- package/src/lib/components/layout/dev-mode-indicator.tsx +18 -0
- package/src/lib/components/layout/generated-breadcrumbs.tsx +136 -0
- package/src/lib/components/layout/language-dialog.tsx +133 -0
- package/src/lib/components/layout/manage-languages-dialog.tsx +386 -0
- package/src/lib/components/layout/nav-item-wrapper.tsx +107 -0
- package/src/lib/components/layout/nav-main.tsx +331 -0
- package/src/lib/components/layout/nav-projects.tsx +81 -0
- package/src/lib/components/layout/nav-user.tsx +180 -0
- package/src/lib/components/login/login-form.tsx +124 -0
- package/src/lib/components/shared/alerts.tsx +52 -0
- package/src/lib/components/shared/animated-number.tsx +49 -0
- package/src/lib/components/shared/asset/asset-bulk-actions.tsx +109 -0
- package/src/lib/components/shared/asset/asset-focal-point-editor.tsx +103 -0
- package/src/lib/components/shared/asset/asset-gallery.stories.tsx +76 -0
- package/src/lib/components/shared/asset/asset-gallery.tsx +623 -0
- package/src/lib/components/shared/asset/asset-picker-dialog.stories.tsx +58 -0
- package/src/lib/components/shared/asset/asset-picker-dialog.tsx +109 -0
- package/src/lib/components/shared/asset/asset-preview-dialog.tsx +38 -0
- package/src/lib/components/shared/asset/asset-preview-selector.tsx +32 -0
- package/src/lib/components/shared/asset/asset-preview.tsx +114 -0
- package/src/lib/components/shared/asset/asset-properties.tsx +44 -0
- package/src/lib/components/shared/assign-to-channel-bulk-action.tsx +71 -0
- package/src/lib/components/shared/assign-to-channel-dialog.tsx +156 -0
- package/src/lib/components/shared/assigned-channels.tsx +108 -0
- package/src/lib/components/shared/assigned-facet-values.tsx +61 -0
- package/src/lib/components/shared/channel-chip.tsx +43 -0
- package/src/lib/components/shared/channel-code-label.tsx +6 -0
- package/src/lib/components/shared/channel-selector.tsx +51 -0
- package/src/lib/components/shared/configurable-operation-arg-input.tsx +29 -0
- package/src/lib/components/shared/configurable-operation-input.tsx +167 -0
- package/src/lib/components/shared/configurable-operation-multi-selector.tsx +263 -0
- package/src/lib/components/shared/configurable-operation-selector.tsx +156 -0
- package/src/lib/components/shared/confirmation-dialog.tsx +58 -0
- package/src/lib/components/shared/copyable-text.tsx +30 -0
- package/src/lib/components/shared/country-selector.tsx +108 -0
- package/src/lib/components/shared/currency-selector.tsx +33 -0
- package/src/lib/components/shared/custom-fields-form.tsx +296 -0
- package/src/lib/components/shared/customer-address-form.tsx +338 -0
- package/src/lib/components/shared/customer-group-chip.tsx +30 -0
- package/src/lib/components/shared/customer-group-selector.tsx +65 -0
- package/src/lib/components/shared/customer-selector.tsx +112 -0
- package/src/lib/components/shared/detail-page-button.stories.tsx +52 -0
- package/src/lib/components/shared/detail-page-button.tsx +59 -0
- package/src/lib/components/shared/entity-assets.tsx +411 -0
- package/src/lib/components/shared/error-page.tsx +31 -0
- package/src/lib/components/shared/facet-value-chip.tsx +59 -0
- package/src/lib/components/shared/facet-value-selector.stories.tsx +48 -0
- package/src/lib/components/shared/facet-value-selector.tsx +458 -0
- package/src/lib/components/shared/form-field-wrapper.tsx +111 -0
- package/src/lib/components/shared/history-timeline/history-entry-date.tsx +37 -0
- package/src/lib/components/shared/history-timeline/history-note-checkbox.tsx +28 -0
- package/src/lib/components/shared/history-timeline/history-note-editor.tsx +60 -0
- package/src/lib/components/shared/history-timeline/history-note-entry.tsx +65 -0
- package/src/lib/components/shared/history-timeline/history-note-input.tsx +39 -0
- package/src/lib/components/shared/history-timeline/history-timeline-with-grouping.tsx +141 -0
- package/src/lib/components/shared/history-timeline/history-timeline.tsx +16 -0
- package/src/lib/components/shared/history-timeline/use-history-note-editor.ts +26 -0
- package/src/lib/components/shared/icon-mark.tsx +18 -0
- package/src/lib/components/shared/language-selector.tsx +56 -0
- package/src/lib/components/shared/logo-mark.tsx +24 -0
- package/src/lib/components/shared/multi-select.tsx +159 -0
- package/src/lib/components/shared/navigation-confirmation.tsx +64 -0
- package/src/lib/components/shared/option-value-input.tsx +97 -0
- package/src/lib/components/shared/paginated-list-data-table.stories.tsx +212 -0
- package/src/lib/components/shared/paginated-list-data-table.tsx +523 -0
- package/src/lib/components/shared/permission-guard.stories.tsx +46 -0
- package/src/lib/components/shared/permission-guard.tsx +51 -0
- package/src/lib/components/shared/product-variant-selector.tsx +136 -0
- package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +93 -0
- package/src/lib/components/shared/rich-text-editor/image-dialog.tsx +223 -0
- package/src/lib/components/shared/rich-text-editor/link-dialog.tsx +151 -0
- package/src/lib/components/shared/rich-text-editor/responsive-toolbar.tsx +443 -0
- package/src/lib/components/shared/rich-text-editor/rich-text-editor.tsx +339 -0
- package/src/lib/components/shared/rich-text-editor/table-delete-menu.tsx +104 -0
- package/src/lib/components/shared/rich-text-editor/table-edit-icons.tsx +225 -0
- package/src/lib/components/shared/role-code-label.tsx +12 -0
- package/src/lib/components/shared/role-selector.tsx +56 -0
- package/src/lib/components/shared/seller-selector.tsx +111 -0
- package/src/lib/components/shared/stock-level-label.tsx +22 -0
- package/src/lib/components/shared/table-cell/order-table-cell-components.tsx +80 -0
- package/src/lib/components/shared/tax-category-selector.tsx +65 -0
- package/src/lib/components/shared/translatable-form-field.tsx +149 -0
- package/src/lib/components/shared/vendure-image.stories.tsx +167 -0
- package/src/lib/components/shared/vendure-image.tsx +307 -0
- package/src/lib/components/shared/zone-selector.tsx +65 -0
- package/src/lib/components/ui/accordion.stories.tsx +33 -0
- package/src/lib/components/ui/accordion.tsx +59 -0
- package/src/lib/components/ui/alert-dialog.stories.tsx +48 -0
- package/src/lib/components/ui/alert-dialog.tsx +128 -0
- package/src/lib/components/ui/alert.stories.tsx +35 -0
- package/src/lib/components/ui/alert.tsx +60 -0
- package/src/lib/components/ui/aspect-ratio.stories.tsx +28 -0
- package/src/lib/components/ui/aspect-ratio.tsx +9 -0
- package/src/lib/components/ui/badge.stories.tsx +28 -0
- package/src/lib/components/ui/badge.tsx +38 -0
- package/src/lib/components/ui/breadcrumb.stories.tsx +41 -0
- package/src/lib/components/ui/breadcrumb.tsx +102 -0
- package/src/lib/components/ui/button.stories.tsx +38 -0
- package/src/lib/components/ui/button.tsx +58 -0
- package/src/lib/components/ui/calendar.stories.tsx +22 -0
- package/src/lib/components/ui/calendar.tsx +447 -0
- package/src/lib/components/ui/card.stories.tsx +28 -0
- package/src/lib/components/ui/card.tsx +47 -0
- package/src/lib/components/ui/carousel.stories.tsx +34 -0
- package/src/lib/components/ui/carousel.tsx +241 -0
- package/src/lib/components/ui/chart.tsx +351 -0
- package/src/lib/components/ui/checkbox.stories.tsx +31 -0
- package/src/lib/components/ui/checkbox.tsx +27 -0
- package/src/lib/components/ui/collapsible.stories.tsx +39 -0
- package/src/lib/components/ui/collapsible.tsx +33 -0
- package/src/lib/components/ui/command.stories.tsx +44 -0
- package/src/lib/components/ui/command.tsx +139 -0
- package/src/lib/components/ui/context-menu.stories.tsx +38 -0
- package/src/lib/components/ui/context-menu.tsx +252 -0
- package/src/lib/components/ui/dialog.stories.tsx +52 -0
- package/src/lib/components/ui/dialog.tsx +116 -0
- package/src/lib/components/ui/drawer.stories.tsx +50 -0
- package/src/lib/components/ui/drawer.tsx +133 -0
- package/src/lib/components/ui/dropdown-menu.stories.tsx +41 -0
- package/src/lib/components/ui/dropdown-menu.tsx +223 -0
- package/src/lib/components/ui/form.tsx +141 -0
- package/src/lib/components/ui/grid-layout.tsx +376 -0
- package/src/lib/components/ui/hover-card.stories.tsx +38 -0
- package/src/lib/components/ui/hover-card.tsx +36 -0
- package/src/lib/components/ui/input-group.tsx +149 -0
- package/src/lib/components/ui/input-otp.stories.tsx +30 -0
- package/src/lib/components/ui/input-otp.tsx +77 -0
- package/src/lib/components/ui/input.stories.tsx +38 -0
- package/src/lib/components/ui/input.tsx +19 -0
- package/src/lib/components/ui/label.stories.tsx +24 -0
- package/src/lib/components/ui/label.tsx +21 -0
- package/src/lib/components/ui/menubar.stories.tsx +53 -0
- package/src/lib/components/ui/menubar.tsx +274 -0
- package/src/lib/components/ui/navigation-menu.stories.tsx +54 -0
- package/src/lib/components/ui/navigation-menu.tsx +168 -0
- package/src/lib/components/ui/pagination.stories.tsx +51 -0
- package/src/lib/components/ui/pagination.tsx +106 -0
- package/src/lib/components/ui/password-input.stories.tsx +32 -0
- package/src/lib/components/ui/password-input.tsx +29 -0
- package/src/lib/components/ui/popover.stories.tsx +33 -0
- package/src/lib/components/ui/popover.tsx +40 -0
- package/src/lib/components/ui/progress.stories.tsx +27 -0
- package/src/lib/components/ui/progress.tsx +29 -0
- package/src/lib/components/ui/radio-group.stories.tsx +34 -0
- package/src/lib/components/ui/radio-group.tsx +45 -0
- package/src/lib/components/ui/resizable.stories.tsx +32 -0
- package/src/lib/components/ui/resizable.tsx +54 -0
- package/src/lib/components/ui/scroll-area.stories.tsx +31 -0
- package/src/lib/components/ui/scroll-area.tsx +50 -0
- package/src/lib/components/ui/select.stories.tsx +36 -0
- package/src/lib/components/ui/select.tsx +183 -0
- package/src/lib/components/ui/separator.stories.tsx +35 -0
- package/src/lib/components/ui/separator.tsx +26 -0
- package/src/lib/components/ui/sheet.stories.tsx +50 -0
- package/src/lib/components/ui/sheet.tsx +118 -0
- package/src/lib/components/ui/sidebar-context.ts +16 -0
- package/src/lib/components/ui/sidebar.tsx +686 -0
- package/src/lib/components/ui/skeleton.stories.tsx +26 -0
- package/src/lib/components/ui/skeleton.tsx +13 -0
- package/src/lib/components/ui/slider.stories.tsx +37 -0
- package/src/lib/components/ui/slider.tsx +63 -0
- package/src/lib/components/ui/sonner.tsx +27 -0
- package/src/lib/components/ui/switch.stories.tsx +31 -0
- package/src/lib/components/ui/switch.tsx +26 -0
- package/src/lib/components/ui/table.stories.tsx +52 -0
- package/src/lib/components/ui/table.tsx +82 -0
- package/src/lib/components/ui/tabs.stories.tsx +29 -0
- package/src/lib/components/ui/tabs.tsx +48 -0
- package/src/lib/components/ui/textarea.stories.tsx +32 -0
- package/src/lib/components/ui/textarea.tsx +18 -0
- package/src/lib/components/ui/toggle-group.stories.tsx +31 -0
- package/src/lib/components/ui/toggle-group.tsx +73 -0
- package/src/lib/components/ui/toggle.stories.tsx +39 -0
- package/src/lib/components/ui/toggle.tsx +45 -0
- package/src/lib/components/ui/tooltip.stories.tsx +30 -0
- package/src/lib/components/ui/tooltip.tsx +51 -0
- package/src/lib/constants.ts +336 -0
- package/src/lib/framework/alert/alert-extensions.tsx +19 -0
- package/src/lib/framework/alert/alert-item.tsx +44 -0
- package/src/lib/framework/alert/alerts-indicator.tsx +22 -0
- package/src/lib/framework/alert/search-index-buffer-alert/search-index-buffer-alert.ts +41 -0
- package/src/lib/framework/component-registry/component-registry.tsx +18 -0
- package/src/lib/framework/component-registry/display-component.tsx +28 -0
- package/src/lib/framework/dashboard-widget/base-widget.tsx +101 -0
- package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +152 -0
- package/src/lib/framework/dashboard-widget/latest-orders-widget/latest-orders-widget.graphql.ts +35 -0
- package/src/lib/framework/dashboard-widget/metrics-widget/chart.tsx +40 -0
- package/src/lib/framework/dashboard-widget/metrics-widget/index.tsx +96 -0
- package/src/lib/framework/dashboard-widget/metrics-widget/metrics-widget.graphql.ts +20 -0
- package/src/lib/framework/dashboard-widget/orders-summary/index.tsx +113 -0
- package/src/lib/framework/dashboard-widget/orders-summary/order-summary-widget.graphql.ts +14 -0
- package/src/lib/framework/dashboard-widget/widget-extensions.tsx +19 -0
- package/src/lib/framework/dashboard-widget/widget-filters-context.tsx +36 -0
- package/src/lib/framework/data-table/data-table-extensions.ts +35 -0
- package/src/lib/framework/defaults.ts +270 -0
- package/src/lib/framework/document-extension/extend-detail-form-query.ts +50 -0
- package/src/lib/framework/document-extension/extend-document.spec.ts +884 -0
- package/src/lib/framework/document-extension/extend-document.ts +159 -0
- package/src/lib/framework/document-introspection/add-custom-fields.spec.ts +1458 -0
- package/src/lib/framework/document-introspection/add-custom-fields.ts +452 -0
- package/src/lib/framework/document-introspection/get-document-structure.spec.ts +581 -0
- package/src/lib/framework/document-introspection/get-document-structure.ts +669 -0
- package/src/lib/framework/document-introspection/hooks.ts +13 -0
- package/src/lib/framework/document-introspection/include-only-selected-list-fields.spec.ts +1840 -0
- package/src/lib/framework/document-introspection/include-only-selected-list-fields.ts +940 -0
- package/src/lib/framework/document-introspection/testing-utils.ts +161 -0
- package/src/lib/framework/extension-api/define-dashboard-extension.ts +99 -0
- package/src/lib/framework/extension-api/display-component-extensions.tsx +58 -0
- package/src/lib/framework/extension-api/extension-api-types.ts +92 -0
- package/src/lib/framework/extension-api/input-component-extensions.tsx +96 -0
- package/src/lib/framework/extension-api/logic/alerts.ts +11 -0
- package/src/lib/framework/extension-api/logic/data-table.ts +37 -0
- package/src/lib/framework/extension-api/logic/detail-forms.ts +35 -0
- package/src/lib/framework/extension-api/logic/form-components.ts +14 -0
- package/src/lib/framework/extension-api/logic/history-entries.ts +24 -0
- package/src/lib/framework/extension-api/logic/index.ts +10 -0
- package/src/lib/framework/extension-api/logic/layout.ts +22 -0
- package/src/lib/framework/extension-api/logic/login.ts +17 -0
- package/src/lib/framework/extension-api/logic/navigation.ts +41 -0
- package/src/lib/framework/extension-api/logic/widgets.ts +10 -0
- package/src/lib/framework/extension-api/types/alerts.ts +59 -0
- package/src/lib/framework/extension-api/types/data-table.ts +159 -0
- package/src/lib/framework/extension-api/types/detail-forms.ts +58 -0
- package/src/lib/framework/extension-api/types/form-components.ts +41 -0
- package/src/lib/framework/extension-api/types/history-entries.ts +120 -0
- package/src/lib/framework/extension-api/types/index.ts +10 -0
- package/src/lib/framework/extension-api/types/layout.ts +141 -0
- package/src/lib/framework/extension-api/types/login.ts +76 -0
- package/src/lib/framework/extension-api/types/navigation.ts +105 -0
- package/src/lib/framework/extension-api/types/widgets.ts +101 -0
- package/src/lib/framework/extension-api/use-dashboard-extensions.ts +27 -0
- package/src/lib/framework/extension-api/use-login-extensions.ts +26 -0
- package/src/lib/framework/form-engine/custom-form-component-extensions.ts +15 -0
- package/src/lib/framework/form-engine/custom-form-component.tsx +16 -0
- package/src/lib/framework/form-engine/default-input-for-type.tsx +35 -0
- package/src/lib/framework/form-engine/form-control-adapter.tsx +193 -0
- package/src/lib/framework/form-engine/form-engine-types.ts +169 -0
- package/src/lib/framework/form-engine/form-schema-tools.spec.ts +610 -0
- package/src/lib/framework/form-engine/form-schema-tools.ts +417 -0
- package/src/lib/framework/form-engine/overridden-form-component.tsx +51 -0
- package/src/lib/framework/form-engine/use-generated-form.tsx +226 -0
- package/src/lib/framework/form-engine/utils.spec.ts +37 -0
- package/src/lib/framework/form-engine/utils.ts +356 -0
- package/src/lib/framework/form-engine/value-transformers.ts +150 -0
- package/src/lib/framework/history-entry/history-entry-extensions.ts +11 -0
- package/src/lib/framework/history-entry/history-entry.tsx +129 -0
- package/src/lib/framework/layout-engine/custom-form-page.stories.tsx +344 -0
- package/src/lib/framework/layout-engine/dev-mode-button.tsx +24 -0
- package/src/lib/framework/layout-engine/layout-extensions.ts +27 -0
- package/src/lib/framework/layout-engine/location-wrapper.tsx +122 -0
- package/src/lib/framework/layout-engine/page-block-provider.tsx +6 -0
- package/src/lib/framework/layout-engine/page-layout.spec.tsx +138 -0
- package/src/lib/framework/layout-engine/page-layout.tsx +700 -0
- package/src/lib/framework/layout-engine/page-provider.tsx +10 -0
- package/src/lib/framework/layout-engine/page.stories.tsx +275 -0
- package/src/lib/framework/nav-menu/nav-menu-extensions.ts +112 -0
- package/src/lib/framework/page/detail-page-route-loader.tsx +67 -0
- package/src/lib/framework/page/detail-page.stories.tsx +151 -0
- package/src/lib/framework/page/detail-page.tsx +255 -0
- package/src/lib/framework/page/list-page.stories.tsx +217 -0
- package/src/lib/framework/page/list-page.tsx +613 -0
- package/src/lib/framework/page/page-api.ts +9 -0
- package/src/lib/framework/page/page-types.ts +51 -0
- package/src/lib/framework/page/use-detail-page.ts +341 -0
- package/src/lib/framework/page/use-extended-router.tsx +139 -0
- package/src/lib/framework/registry/global-registry.ts +50 -0
- package/src/lib/framework/registry/registry-types.ts +32 -0
- package/src/lib/graphql/api.ts +123 -0
- package/src/lib/graphql/common-operations.ts +37 -0
- package/src/lib/graphql/fragments.ts +71 -0
- package/src/lib/graphql/graphql-env.d.ts +523 -0
- package/src/lib/graphql/graphql.ts +15 -0
- package/src/lib/graphql/settings-store-operations.ts +17 -0
- package/src/lib/hooks/use-alerts.ts +84 -0
- package/src/lib/hooks/use-auth.tsx +21 -0
- package/src/lib/hooks/use-channel.ts +27 -0
- package/src/lib/hooks/use-custom-field-config.ts +27 -0
- package/src/lib/hooks/use-display-locale.ts +40 -0
- package/src/lib/hooks/use-drag-and-drop.ts +86 -0
- package/src/lib/hooks/use-dynamic-translations.ts +46 -0
- package/src/lib/hooks/use-extended-detail-query.ts +37 -0
- package/src/lib/hooks/use-extended-list-query.ts +80 -0
- package/src/lib/hooks/use-floating-bulk-actions.ts +83 -0
- package/src/lib/hooks/use-grouped-permissions.ts +55 -0
- package/src/lib/hooks/use-local-format.ts +186 -0
- package/src/lib/hooks/use-mobile.ts +19 -0
- package/src/lib/hooks/use-page-block.tsx +27 -0
- package/src/lib/hooks/use-page.tsx +10 -0
- package/src/lib/hooks/use-permissions.ts +40 -0
- package/src/lib/hooks/use-saved-views.ts +238 -0
- package/src/lib/hooks/use-server-config.ts +4 -0
- package/src/lib/hooks/use-sorted-languages.ts +41 -0
- package/src/lib/hooks/use-theme.ts +10 -0
- package/src/lib/hooks/use-ui-language-loader.ts +30 -0
- package/src/lib/hooks/use-user-settings.tsx +12 -0
- package/src/lib/index.ts +293 -0
- package/src/lib/lib/load-i18n-messages.ts +20 -0
- package/src/lib/lib/trans.tsx +20 -0
- package/src/lib/lib/utils.ts +111 -0
- package/src/lib/providers/alerts-provider.tsx +60 -0
- package/src/lib/providers/auth.tsx +232 -0
- package/src/lib/providers/channel-provider.tsx +245 -0
- package/src/lib/providers/i18n-provider.tsx +21 -0
- package/src/lib/providers/server-config.tsx +289 -0
- package/src/lib/providers/theme-provider.tsx +56 -0
- package/src/lib/providers/user-settings.tsx +244 -0
- package/src/lib/types/saved-views.ts +42 -0
- package/src/lib/utils/config-utils.ts +19 -0
- package/src/lib/utils/global-languages.ts +268 -0
- package/src/lib/utils/saved-views-utils.ts +40 -0
- package/src/lib/virtual.d.ts +39 -0
- package/src/vite-env.d.ts +2 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Badge } from '@/vdb/components/ui/badge.js';
|
|
2
|
+
import { Button } from '@/vdb/components/ui/button.js';
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenu,
|
|
5
|
+
DropdownMenuContent,
|
|
6
|
+
DropdownMenuItem,
|
|
7
|
+
DropdownMenuTrigger,
|
|
8
|
+
} from '@/vdb/components/ui/dropdown-menu.js';
|
|
9
|
+
import { Separator } from '@/vdb/components/ui/separator.js';
|
|
10
|
+
import { HistoryEntry, HistoryEntryProps } from '@/vdb/framework/history-entry/history-entry.js';
|
|
11
|
+
import { Trans } from '@lingui/react/macro';
|
|
12
|
+
import { MoreVerticalIcon, PencilIcon, TrashIcon } from 'lucide-react';
|
|
13
|
+
|
|
14
|
+
interface HistoryNoteEntryProps extends Readonly<HistoryEntryProps> {
|
|
15
|
+
onEditNote?: (noteId: string, note: string, isPrivate: boolean) => void;
|
|
16
|
+
onDeleteNote?: (noteId: string) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function HistoryNoteEntry(props: HistoryNoteEntryProps) {
|
|
20
|
+
const { entry, isPrimary, onEditNote, onDeleteNote } = props;
|
|
21
|
+
return (
|
|
22
|
+
<HistoryEntry {...props}>
|
|
23
|
+
<div className={isPrimary ? 'space-y-2' : 'space-y-1'}>
|
|
24
|
+
<div className="space-y-1">
|
|
25
|
+
<p className={`${isPrimary ? 'text-sm' : 'text-xs'} text-foreground`}>
|
|
26
|
+
{entry.data.note}
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
{onEditNote && onDeleteNote && (
|
|
30
|
+
<div className="flex items-center gap-2">
|
|
31
|
+
<Badge variant={entry.isPublic ? 'outline' : 'secondary'} className="text-xs">
|
|
32
|
+
{entry.isPublic ? 'Public' : 'Private'}
|
|
33
|
+
</Badge>
|
|
34
|
+
<DropdownMenu>
|
|
35
|
+
<DropdownMenuTrigger asChild>
|
|
36
|
+
<Button variant="ghost" size="sm" className="h-6 w-6 p-0">
|
|
37
|
+
<MoreVerticalIcon className="h-3 w-3" />
|
|
38
|
+
</Button>
|
|
39
|
+
</DropdownMenuTrigger>
|
|
40
|
+
<DropdownMenuContent align="end">
|
|
41
|
+
<DropdownMenuItem
|
|
42
|
+
onClick={() => {
|
|
43
|
+
onEditNote(entry.id, entry.data.note, !entry.isPublic);
|
|
44
|
+
}}
|
|
45
|
+
className="cursor-pointer"
|
|
46
|
+
>
|
|
47
|
+
<PencilIcon className="mr-2 h-4 w-4" />
|
|
48
|
+
<Trans>Edit</Trans>
|
|
49
|
+
</DropdownMenuItem>
|
|
50
|
+
<Separator className="my-1" />
|
|
51
|
+
<DropdownMenuItem
|
|
52
|
+
onClick={() => onDeleteNote(entry.id)}
|
|
53
|
+
className="cursor-pointer text-red-600 focus:text-red-600"
|
|
54
|
+
>
|
|
55
|
+
<TrashIcon className="mr-2 h-4 w-4" />
|
|
56
|
+
<span>Delete</span>
|
|
57
|
+
</DropdownMenuItem>
|
|
58
|
+
</DropdownMenuContent>
|
|
59
|
+
</DropdownMenu>
|
|
60
|
+
</div>
|
|
61
|
+
)}
|
|
62
|
+
</div>
|
|
63
|
+
</HistoryEntry>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Button } from '@/vdb/components/ui/button.js';
|
|
2
|
+
import { Textarea } from '@/vdb/components/ui/textarea.js';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { HistoryNoteCheckbox } from './history-note-checkbox.js';
|
|
5
|
+
|
|
6
|
+
interface HistoryNoteInputProps {
|
|
7
|
+
onAddNote: (note: string, isPrivate: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function HistoryNoteInput({ onAddNote }: Readonly<HistoryNoteInputProps>) {
|
|
11
|
+
const [note, setNote] = useState('');
|
|
12
|
+
const [noteIsPrivate, setNoteIsPrivate] = useState(true);
|
|
13
|
+
|
|
14
|
+
const handleAddNote = () => {
|
|
15
|
+
if (note.trim()) {
|
|
16
|
+
onAddNote(note, noteIsPrivate);
|
|
17
|
+
setNote('');
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className="bg-muted/20 rounded-lg p-3 mb-4">
|
|
23
|
+
<div className="flex flex-col space-y-2">
|
|
24
|
+
<Textarea
|
|
25
|
+
placeholder="Add a note..."
|
|
26
|
+
value={note}
|
|
27
|
+
onChange={e => setNote(e.target.value)}
|
|
28
|
+
className="min-h-[50px] resize-none bg-background/50 focus:bg-background transition-colors text-sm"
|
|
29
|
+
/>
|
|
30
|
+
<div className="flex items-center justify-between">
|
|
31
|
+
<HistoryNoteCheckbox value={noteIsPrivate} onChange={setNoteIsPrivate} />
|
|
32
|
+
<Button onClick={handleAddNote} disabled={!note.trim()} size="sm" className="h-7 px-3 text-xs">
|
|
33
|
+
Add note
|
|
34
|
+
</Button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Button } from '@/vdb/components/ui/button.js';
|
|
2
|
+
import { HistoryEntryItem } from '@/vdb/framework/extension-api/types/history-entries.js';
|
|
3
|
+
import { getCustomHistoryEntryForType } from '@/vdb/framework/history-entry/history-entry-extensions.js';
|
|
4
|
+
import { ChevronDown, ChevronUp } from 'lucide-react';
|
|
5
|
+
import { ReactNode, useState } from 'react';
|
|
6
|
+
import { CustomerHistoryCustomerDetail } from '../../../../app/routes/_authenticated/_customers/components/customer-history/customer-history-types.js';
|
|
7
|
+
import { OrderHistoryOrderDetail } from '../../../../app/routes/_authenticated/_orders/components/order-history/order-history-types.js';
|
|
8
|
+
import { HistoryTimeline } from './history-timeline.js';
|
|
9
|
+
|
|
10
|
+
interface HistoryTimelineWithGroupingProps {
|
|
11
|
+
historyEntries: HistoryEntryItem[];
|
|
12
|
+
entity: OrderHistoryOrderDetail | CustomerHistoryCustomerDetail;
|
|
13
|
+
isPrimaryEvent: (entry: HistoryEntryItem) => boolean;
|
|
14
|
+
renderEntryContent: (entry: HistoryEntryItem) => ReactNode;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type EntryWithIndex = {
|
|
19
|
+
entry: HistoryEntryItem;
|
|
20
|
+
index: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export function HistoryTimelineWithGrouping({
|
|
24
|
+
historyEntries,
|
|
25
|
+
entity,
|
|
26
|
+
isPrimaryEvent,
|
|
27
|
+
renderEntryContent,
|
|
28
|
+
children,
|
|
29
|
+
}: Readonly<HistoryTimelineWithGroupingProps>) {
|
|
30
|
+
const [expandedGroups, setExpandedGroups] = useState<Set<number>>(new Set());
|
|
31
|
+
|
|
32
|
+
// Group consecutive secondary events
|
|
33
|
+
const groupedEntries: Array<
|
|
34
|
+
| ({ type: 'primary' } & EntryWithIndex)
|
|
35
|
+
| {
|
|
36
|
+
type: 'secondary-group';
|
|
37
|
+
entries: Array<EntryWithIndex>;
|
|
38
|
+
startIndex: number;
|
|
39
|
+
}
|
|
40
|
+
> = [];
|
|
41
|
+
let currentGroup: Array<EntryWithIndex> = [];
|
|
42
|
+
|
|
43
|
+
for (let i = 0; i < historyEntries.length; i++) {
|
|
44
|
+
const entry = historyEntries[i];
|
|
45
|
+
const isSecondary = !isPrimaryEvent(entry);
|
|
46
|
+
|
|
47
|
+
if (isSecondary) {
|
|
48
|
+
currentGroup.push({ entry, index: i });
|
|
49
|
+
} else {
|
|
50
|
+
// If we have accumulated secondary events, add them as a group
|
|
51
|
+
if (currentGroup.length > 0) {
|
|
52
|
+
groupedEntries.push({
|
|
53
|
+
type: 'secondary-group',
|
|
54
|
+
entries: currentGroup,
|
|
55
|
+
startIndex: currentGroup[0].index,
|
|
56
|
+
});
|
|
57
|
+
currentGroup = [];
|
|
58
|
+
}
|
|
59
|
+
// Add the primary event
|
|
60
|
+
groupedEntries.push({ type: 'primary', entry, index: i });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Don't forget the last group if it exists
|
|
65
|
+
if (currentGroup.length > 0) {
|
|
66
|
+
groupedEntries.push({
|
|
67
|
+
type: 'secondary-group',
|
|
68
|
+
entries: currentGroup,
|
|
69
|
+
startIndex: currentGroup[0].index,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const renderEntry = (entry: HistoryEntryItem) => {
|
|
74
|
+
const CustomType = getCustomHistoryEntryForType(entry.type);
|
|
75
|
+
if (CustomType) {
|
|
76
|
+
return <CustomType entry={entry} entity={entity} />;
|
|
77
|
+
} else {
|
|
78
|
+
return renderEntryContent(entry);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const toggleGroup = (groupIndex: number) => {
|
|
83
|
+
const newExpanded = new Set(expandedGroups);
|
|
84
|
+
if (newExpanded.has(groupIndex)) {
|
|
85
|
+
newExpanded.delete(groupIndex);
|
|
86
|
+
} else {
|
|
87
|
+
newExpanded.add(groupIndex);
|
|
88
|
+
}
|
|
89
|
+
setExpandedGroups(newExpanded);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<div className="">
|
|
94
|
+
{children && <div className="mb-4">{children}</div>}
|
|
95
|
+
<HistoryTimeline>
|
|
96
|
+
{groupedEntries.map((group, groupIndex) => {
|
|
97
|
+
if (group.type === 'primary') {
|
|
98
|
+
const entry = group.entry;
|
|
99
|
+
return <div key={entry.id}>{renderEntry(entry)}</div>;
|
|
100
|
+
} else {
|
|
101
|
+
// Secondary group
|
|
102
|
+
const shouldCollapse = group.entries.length > 2;
|
|
103
|
+
const isExpanded = expandedGroups.has(groupIndex);
|
|
104
|
+
const visibleEntries =
|
|
105
|
+
shouldCollapse && !isExpanded ? group.entries.slice(0, 2) : group.entries;
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<div key={`group-${groupIndex}`}>
|
|
109
|
+
{visibleEntries.map(({ entry }) => (
|
|
110
|
+
<div key={entry.id}>{renderEntry(entry)}</div>
|
|
111
|
+
))}
|
|
112
|
+
{shouldCollapse && (
|
|
113
|
+
<div className="flex justify-center py-2">
|
|
114
|
+
<Button
|
|
115
|
+
variant="ghost"
|
|
116
|
+
size="sm"
|
|
117
|
+
onClick={() => toggleGroup(groupIndex)}
|
|
118
|
+
className="text-muted-foreground hover:text-foreground h-6 text-xs"
|
|
119
|
+
>
|
|
120
|
+
{isExpanded ? (
|
|
121
|
+
<>
|
|
122
|
+
<ChevronUp className="w-3 h-3 mr-1" />
|
|
123
|
+
Show less
|
|
124
|
+
</>
|
|
125
|
+
) : (
|
|
126
|
+
<>
|
|
127
|
+
<ChevronDown className="w-3 h-3 mr-1" />
|
|
128
|
+
Show all ({group.entries.length - 2})
|
|
129
|
+
</>
|
|
130
|
+
)}
|
|
131
|
+
</Button>
|
|
132
|
+
</div>
|
|
133
|
+
)}
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
})}
|
|
138
|
+
</HistoryTimeline>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ScrollArea } from '@/vdb/components/ui/scroll-area.js';
|
|
2
|
+
|
|
3
|
+
interface HistoryTimelineProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function HistoryTimeline({ children }: Readonly<HistoryTimelineProps>) {
|
|
8
|
+
return (
|
|
9
|
+
<ScrollArea className="pr-2">
|
|
10
|
+
<div className="relative">
|
|
11
|
+
<div className="absolute left-6 top-6 bottom-0 w-px bg-gradient-to-b from-border via-border/50 to-transparent" />
|
|
12
|
+
<div className="space-y-0.5">{children}</div>
|
|
13
|
+
</div>
|
|
14
|
+
</ScrollArea>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export function useHistoryNoteEditor() {
|
|
4
|
+
const [noteEditorOpen, setNoteEditorOpen] = useState(false);
|
|
5
|
+
const [noteState, setNoteState] = useState<{
|
|
6
|
+
noteId: string;
|
|
7
|
+
note: string;
|
|
8
|
+
isPrivate: boolean;
|
|
9
|
+
}>({
|
|
10
|
+
noteId: '',
|
|
11
|
+
note: '',
|
|
12
|
+
isPrivate: true,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const handleEditNote = (noteId: string, note: string, isPrivate: boolean) => {
|
|
16
|
+
setNoteState({ noteId, note, isPrivate });
|
|
17
|
+
setNoteEditorOpen(true);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
noteEditorOpen,
|
|
22
|
+
setNoteEditorOpen,
|
|
23
|
+
noteState,
|
|
24
|
+
handleEditNote,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function IconMark(props: React.ComponentProps<'svg'>) {
|
|
2
|
+
return (
|
|
3
|
+
<svg viewBox="0 0 40 28" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
4
|
+
<path
|
|
5
|
+
d="M10.7466 12.6853V21.9481C10.7466 22.1142 10.8389 22.2712 10.9836 22.3527L19.3904 27.1155C19.6921 27.2846 20.0615 27.2846 20.3632 27.1155L28.77 22.3527C28.9178 22.2682 29.007 22.1142 29.007 21.9481V12.6853C29.007 12.3259 28.6099 12.0994 28.2929 12.2806L20.3632 16.7716C20.0615 16.9407 19.6921 16.9407 19.3904 16.7716L11.4607 12.2806C11.1437 12.0994 10.7466 12.3259 10.7466 12.6853Z"
|
|
6
|
+
fill="currentColor"
|
|
7
|
+
/>
|
|
8
|
+
<path
|
|
9
|
+
d="M8.8932 0.749702L0.486371 5.50943C0.184698 5.67856 0 5.99568 0 6.33393V15.8564C0 16.0225 0.0923489 16.1796 0.237029 16.2611L8.41299 20.894C8.73005 21.0752 9.12715 20.8487 9.12715 20.4893V11.5074C9.12715 11.1661 9.31185 10.852 9.61352 10.6829L17.5432 6.19199C17.8603 6.01078 17.8603 5.56077 17.5432 5.38258L9.36726 0.749702C9.2195 0.665138 9.03788 0.665138 8.89012 0.749702H8.8932Z"
|
|
10
|
+
fill="currentColor"
|
|
11
|
+
/>
|
|
12
|
+
<path
|
|
13
|
+
d="M30.86 0.740669L39.2668 5.5004C39.5685 5.66953 39.7532 5.98664 39.7532 6.3249V15.8474C39.7532 16.0135 39.6608 16.1705 39.5162 16.2521L31.3402 20.885C31.0231 21.0662 30.626 20.8397 30.626 20.4803V11.4984C30.626 11.1571 30.4413 10.843 30.1397 10.6739L22.21 6.18295C21.8929 6.00174 21.8929 5.55174 22.21 5.37355L30.3859 0.740669C30.5337 0.656105 30.7153 0.656105 30.8631 0.740669H30.86Z"
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { api } from '@/vdb/graphql/api.js';
|
|
2
|
+
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
3
|
+
import { useSortedLanguages } from '@/vdb/hooks/use-sorted-languages.js';
|
|
4
|
+
import { useLingui } from '@lingui/react/macro';
|
|
5
|
+
import { useQuery } from '@tanstack/react-query';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
import { MultiSelect } from './multi-select.js';
|
|
8
|
+
|
|
9
|
+
const availableGlobalLanguages = graphql(`
|
|
10
|
+
query AvailableGlobalLanguages {
|
|
11
|
+
globalSettings {
|
|
12
|
+
availableLanguages
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`);
|
|
16
|
+
|
|
17
|
+
export interface LanguageSelectorProps<T extends boolean> {
|
|
18
|
+
value: T extends true ? string[] : string;
|
|
19
|
+
onChange: (value: T extends true ? string[] : string) => void;
|
|
20
|
+
multiple?: T;
|
|
21
|
+
availableLanguageCodes?: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function LanguageSelector<T extends boolean>(props: LanguageSelectorProps<T>) {
|
|
25
|
+
const { data } = useQuery({
|
|
26
|
+
queryKey: ['availableGlobalLanguages'],
|
|
27
|
+
queryFn: () => api.query(availableGlobalLanguages),
|
|
28
|
+
staleTime: 1000 * 60 * 5, // 5 minutes
|
|
29
|
+
});
|
|
30
|
+
const { value, onChange, multiple, availableLanguageCodes } = props;
|
|
31
|
+
const { t } = useLingui();
|
|
32
|
+
|
|
33
|
+
const sortedLanguages = useSortedLanguages(
|
|
34
|
+
availableLanguageCodes ?? data?.globalSettings.availableLanguages ?? undefined,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const items = useMemo(
|
|
38
|
+
() =>
|
|
39
|
+
sortedLanguages.map(language => ({
|
|
40
|
+
value: language.code,
|
|
41
|
+
label: language.label,
|
|
42
|
+
})),
|
|
43
|
+
[sortedLanguages],
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<MultiSelect
|
|
48
|
+
value={value}
|
|
49
|
+
onChange={onChange}
|
|
50
|
+
multiple={multiple}
|
|
51
|
+
items={items}
|
|
52
|
+
placeholder={t`Select a language`}
|
|
53
|
+
searchPlaceholder={t`Search languages...`}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function LogoMark(props: React.ComponentProps<'svg'>) {
|
|
2
|
+
return (
|
|
3
|
+
<svg viewBox="0 0 177 33" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
4
|
+
<path
|
|
5
|
+
d="M65.192 9.73a.729.729 0 0 0-.593-.307h-2.503a.733.733 0 0 0-.685.487l-4.263 12.438-4.33-12.445a.721.721 0 0 0-.684-.486h-2.577a.73.73 0 0 0-.592.307.753.753 0 0 0-.092.662l6.139 17.077c.098.288.37.48.675.48h2.726a.708.708 0 0 0 .675-.48l6.174-17.076a.699.699 0 0 0-.092-.663l.016.01.006-.004ZM83.004 19.262c.026-.272.041-.646.041-1.133 0-1.719-.386-3.3-1.144-4.705a8.804 8.804 0 0 0-3.16-3.357c-1.34-.82-2.865-1.242-4.51-1.242-1.746 0-3.334.428-4.716 1.274-1.382.845-2.469 2.035-3.242 3.53-.767 1.479-1.154 3.175-1.154 5.035 0 1.86.396 3.556 1.17 5.044.782 1.498 1.885 2.689 3.277 3.53 1.391.846 2.995 1.275 4.767 1.275 1.901 0 3.581-.388 4.995-1.166a9.396 9.396 0 0 0 3.423-3.216.739.739 0 0 0-.206-.992l-1.959-1.316c-.165-.109-.361-.15-.561-.109a.728.728 0 0 0-.46.33 5.63 5.63 0 0 1-2.04 2.026c-.84.48-1.934.726-3.259.726-1.581 0-2.789-.521-3.695-1.603a6.478 6.478 0 0 1-1.465-3.3h13.185c.37 0 .685-.282.716-.653v.016l-.003.006Zm-13.647-2.836a6.03 6.03 0 0 1 1.505-2.58c.872-.876 1.968-1.305 3.36-1.305 1.391 0 2.545.371 3.36 1.133.665.627 1.144 1.555 1.407 2.746H69.35l.01.01-.003-.004ZM100.347 12.054a6.516 6.516 0 0 0-2.69-2.423 8.235 8.235 0 0 0-3.598-.803c-1.391 0-2.633.339-3.705 1.002-.437.272-.84.595-1.201.96v-.653a.726.726 0 0 0-.726-.727h-2.469a.728.728 0 0 0-.726.727v17.076c0 .397.32.727.726.727h2.47a.728.728 0 0 0 .725-.727V18.67c0-1.927.396-3.473 1.176-4.58.732-1.044 1.829-1.556 3.334-1.556 2.586 0 3.788 1.38 3.788 4.35v10.329c0 .397.32.727.725.727h2.469a.728.728 0 0 0 .726-.727v-11.42c0-1.421-.336-2.68-.995-3.739h-.029ZM121.243.003h-2.459a.729.729 0 0 0-.726.73v10.082a7.873 7.873 0 0 0-1.54-1.069c-1.125-.601-2.387-.9-3.727-.9-1.744 0-3.331.43-4.717 1.272-1.381.845-2.469 2.026-3.239 3.514-.767 1.473-1.153 3.16-1.153 5.028 0 1.87.393 3.595 1.169 5.077.783 1.495 1.886 2.689 3.277 3.534 1.389.841 2.98 1.27 4.735 1.27 1.325 0 2.568-.304 3.68-.912a7.922 7.922 0 0 0 1.515-1.056v.653c0 .397.323.726.726.726h2.469a.728.728 0 0 0 .726-.726V.73c0-.397-.32-.73-.726-.73l-.01.003Zm-3.185 18.674c0 1.2-.231 2.285-.691 3.226-.453.934-1.062 1.639-1.87 2.15-.798.513-1.686.763-2.713.763-1.027 0-1.876-.247-2.659-.762-.792-.512-1.401-1.226-1.854-2.157-.463-.945-.691-2.036-.691-3.262s.231-2.273.691-3.198c.453-.925 1.062-1.622 1.854-2.141.78-.512 1.655-.762 2.659-.762 1.005 0 1.918.247 2.713.762.789.503 1.417 1.23 1.87 2.15.463.942.691 2.027.691 3.227v.007-.003ZM140.761 9.414h-2.469a.728.728 0 0 0-.726.726v8.533c0 1.927-.396 3.473-1.176 4.58-.732 1.044-1.829 1.556-3.334 1.556-2.583 0-3.788-1.38-3.788-4.35V10.13a.726.726 0 0 0-.726-.726h-2.469a.727.727 0 0 0-.725.726v11.42c0 1.422.336 2.68.995 3.74a6.494 6.494 0 0 0 2.691 2.422 8.263 8.263 0 0 0 3.597.804c1.391 0 2.634-.34 3.705-1.002.437-.272.84-.586 1.211-.96v.653c0 .396.32.726.726.726h2.469a.727.727 0 0 0 .725-.726V10.14a.726.726 0 0 0-.725-.726h.019ZM155.578 9.125a6.292 6.292 0 0 0-1.886-.288c-1.407 0-2.685.397-3.81 1.191-.485.34-.938.746-1.359 1.216v-1.091a.726.726 0 0 0-.726-.727h-2.469a.728.728 0 0 0-.726.727v17.076c0 .397.32.727.726.727h2.469a.728.728 0 0 0 .726-.727v-8.171c0-1.39.247-2.596.741-3.605.485-.982 1.129-1.738 1.911-2.25a4.46 4.46 0 0 1 2.511-.761c.5 0 .947.099 1.359.297.222.109.485.09.691-.042a.731.731 0 0 0 .336-.61V9.82a.718.718 0 0 0-.501-.685l.01-.01h-.003ZM173.399 19.262c.026-.272.042-.637.042-1.133 0-1.719-.387-3.306-1.135-4.705a8.802 8.802 0 0 0-3.16-3.358c-1.341-.819-2.865-1.232-4.51-1.232-1.746 0-3.334.429-4.716 1.274-1.382.845-2.469 2.036-3.242 3.53-.764 1.48-1.154 3.176-1.154 5.035 0 1.86.396 3.556 1.169 5.045.783 1.498 1.886 2.688 3.284 3.53 1.391.845 2.995 1.274 4.767 1.274 1.901 0 3.581-.387 4.995-1.165a9.396 9.396 0 0 0 3.423-3.217.739.739 0 0 0-.206-.992l-1.959-1.316c-.165-.108-.361-.15-.561-.108a.743.743 0 0 0-.459.33 5.592 5.592 0 0 1-2.051 2.025c-.84.48-1.933.727-3.258.727-1.582 0-2.789-.522-3.696-1.604a6.48 6.48 0 0 1-1.464-3.3h13.188a.717.717 0 0 0 .716-.653l-.009.01-.004.003Zm-13.647-2.836a6.039 6.039 0 0 1 1.505-2.58c.872-.877 1.969-1.305 3.36-1.305 1.391 0 2.542.37 3.36 1.133.665.627 1.144 1.555 1.407 2.746h-9.638l.009.01-.003-.004Z"
|
|
6
|
+
fill="currentColor"
|
|
7
|
+
/>
|
|
8
|
+
<path
|
|
9
|
+
fillRule="evenodd"
|
|
10
|
+
clipRule="evenodd"
|
|
11
|
+
d="M174.388 4.798a2.148 2.148 0 0 0-2.136 2.157c0 1.191.957 2.158 2.136 2.158a2.149 2.149 0 0 0 2.137-2.158c0-1.19-.958-2.157-2.137-2.157Zm-2.611 2.157c0-1.456 1.169-2.637 2.611-2.637 1.443 0 2.612 1.181 2.612 2.637 0 1.457-1.169 2.638-2.612 2.638-1.442 0-2.611-1.181-2.611-2.638Z"
|
|
12
|
+
fill="currentColor"
|
|
13
|
+
/>
|
|
14
|
+
<path
|
|
15
|
+
d="M174.242 6.738c.146 0 .254-.03.321-.087.063-.054.098-.147.098-.275 0-.128-.035-.218-.098-.272-.064-.055-.172-.08-.321-.08h-.301v.717h.301v-.003Zm-.297.496V8.29h-.714V5.499h1.088c.364 0 .63.06.798.186.171.121.254.316.254.585a.76.76 0 0 1-.13.455.766.766 0 0 1-.399.26.59.59 0 0 1 .263.153c.079.08.155.198.234.361l.39.791h-.758l-.339-.695c-.066-.137-.136-.236-.206-.284a.463.463 0 0 0-.279-.08h-.199l-.003.003ZM11.065 17.572v9.817a.5.5 0 0 0 .244.429l8.655 5.047a1 1 0 0 0 1.002 0l8.655-5.047a.497.497 0 0 0 .245-.429v-9.817a.49.49 0 0 0-.736-.429l-8.164 4.76a1 1 0 0 1-1.002 0l-8.164-4.76a.49.49 0 0 0-.736.43Z"
|
|
16
|
+
fill="currentColor"
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
d="M9.156 4.923.501 9.967c-.31.18-.501.516-.501.874v10.092a.5.5 0 0 0 .244.429l8.418 4.91a.49.49 0 0 0 .735-.429v-9.519c0-.362.19-.695.501-.874l8.165-4.76a.498.498 0 0 0 0-.857l-8.418-4.91a.482.482 0 0 0-.492 0h.003ZM31.773 4.913l8.656 5.045c.31.179.501.515.501.873v10.092a.5.5 0 0 1-.244.43l-8.418 4.91a.49.49 0 0 1-.735-.43v-9.519c0-.361-.19-.694-.501-.873l-8.165-4.76a.498.498 0 0 1 0-.858l8.418-4.91c.152-.09.34-.09.492 0h-.004Z"
|
|
20
|
+
fill="currentColor"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Badge } from '@/vdb/components/ui/badge.js';
|
|
2
|
+
import { Button } from '@/vdb/components/ui/button.js';
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from '@/vdb/components/ui/popover.js';
|
|
4
|
+
import { cn } from '@/vdb/lib/utils.js';
|
|
5
|
+
import { ChevronDown, X } from 'lucide-react';
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import { Input } from '../ui/input.js';
|
|
8
|
+
|
|
9
|
+
export interface MultiSelectProps<T extends boolean> {
|
|
10
|
+
value: T extends true ? string[] : string;
|
|
11
|
+
onChange: (value: T extends true ? string[] : string) => void;
|
|
12
|
+
multiple?: T;
|
|
13
|
+
items: Array<{
|
|
14
|
+
value: string;
|
|
15
|
+
label: string;
|
|
16
|
+
/**
|
|
17
|
+
* The display value to use for the item.
|
|
18
|
+
* If not provided, the label will be used.
|
|
19
|
+
* This is useful for displaying a more complex value in
|
|
20
|
+
* a React component.
|
|
21
|
+
*/
|
|
22
|
+
display?: string | React.ReactNode;
|
|
23
|
+
}>;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
searchPlaceholder?: string;
|
|
26
|
+
showSearch?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function MultiSelect<T extends boolean>(props: MultiSelectProps<T>) {
|
|
31
|
+
const {
|
|
32
|
+
value,
|
|
33
|
+
onChange,
|
|
34
|
+
multiple,
|
|
35
|
+
items,
|
|
36
|
+
placeholder = 'Select items',
|
|
37
|
+
searchPlaceholder = 'Search...',
|
|
38
|
+
showSearch,
|
|
39
|
+
className,
|
|
40
|
+
} = props;
|
|
41
|
+
const [search, setSearch] = useState('');
|
|
42
|
+
|
|
43
|
+
const filteredItems = items.filter(item => item.label.toLowerCase().includes(search.toLowerCase()));
|
|
44
|
+
|
|
45
|
+
const handleSelect = (selectedValue: string) => {
|
|
46
|
+
if (multiple) {
|
|
47
|
+
const currentValue = value as string[];
|
|
48
|
+
const newValue = currentValue.includes(selectedValue)
|
|
49
|
+
? currentValue.filter(v => v !== selectedValue)
|
|
50
|
+
: [...currentValue, selectedValue];
|
|
51
|
+
onChange(newValue as T extends true ? string[] : string);
|
|
52
|
+
} else {
|
|
53
|
+
onChange(selectedValue as T extends true ? string[] : string);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleRemove = (valueToRemove: string) => {
|
|
58
|
+
if (multiple) {
|
|
59
|
+
const currentValue = value as string[];
|
|
60
|
+
onChange(currentValue.filter(v => v !== valueToRemove) as T extends true ? string[] : string);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const renderTrigger = () => {
|
|
65
|
+
if (multiple) {
|
|
66
|
+
const selectedValues: string[] = typeof value === 'string' ? [value] : value;
|
|
67
|
+
return (
|
|
68
|
+
<Button
|
|
69
|
+
variant="outline"
|
|
70
|
+
role="combobox"
|
|
71
|
+
className={cn(
|
|
72
|
+
'w-full justify-between',
|
|
73
|
+
'min-h-[2.5rem] h-auto',
|
|
74
|
+
'flex flex-wrap gap-1 p-1 shadow-xs',
|
|
75
|
+
className,
|
|
76
|
+
)}
|
|
77
|
+
>
|
|
78
|
+
<div className="flex flex-wrap gap-1">
|
|
79
|
+
{selectedValues.length > 0 ? (
|
|
80
|
+
selectedValues.map(selectedValue => {
|
|
81
|
+
const item = items.find(i => i.value === selectedValue);
|
|
82
|
+
return (
|
|
83
|
+
<Badge
|
|
84
|
+
key={selectedValue}
|
|
85
|
+
variant="secondary"
|
|
86
|
+
className="flex items-center gap-1"
|
|
87
|
+
>
|
|
88
|
+
{item?.display ?? item?.label ?? selectedValue}
|
|
89
|
+
<div
|
|
90
|
+
onClick={e => {
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
handleRemove(selectedValue);
|
|
93
|
+
}}
|
|
94
|
+
onKeyDown={e => {
|
|
95
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
handleRemove(selectedValue);
|
|
98
|
+
}
|
|
99
|
+
}}
|
|
100
|
+
role="button"
|
|
101
|
+
tabIndex={0}
|
|
102
|
+
className="ml-1 hover:text-destructive cursor-pointer"
|
|
103
|
+
aria-label={`Remove ${item?.label ?? selectedValue}`}
|
|
104
|
+
>
|
|
105
|
+
<X className="h-3 w-3" />
|
|
106
|
+
</div>
|
|
107
|
+
</Badge>
|
|
108
|
+
);
|
|
109
|
+
})
|
|
110
|
+
) : (
|
|
111
|
+
<span className="text-muted-foreground">{placeholder}</span>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
<ChevronDown className="h-4 w-4 shrink-0 opacity-50" />
|
|
115
|
+
</Button>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
const selectedItem = items.find(i => i.value === value);
|
|
119
|
+
return (
|
|
120
|
+
<Button variant="outline" role="combobox" className={cn('w-full justify-between', className)}>
|
|
121
|
+
{selectedItem ? (selectedItem.display ?? selectedItem.label) : placeholder}
|
|
122
|
+
<ChevronDown className="h-4 w-4 shrink-0 opacity-50" />
|
|
123
|
+
</Button>
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<Popover>
|
|
129
|
+
<PopoverTrigger asChild>{renderTrigger()}</PopoverTrigger>
|
|
130
|
+
<PopoverContent className="w-[200px] p-0" side="bottom" align="start" onWheel={(e) => e.stopPropagation()}>
|
|
131
|
+
{(showSearch === true || items.length > 10) && (
|
|
132
|
+
<div className="p-2">
|
|
133
|
+
<Input
|
|
134
|
+
type="text"
|
|
135
|
+
placeholder={searchPlaceholder}
|
|
136
|
+
value={search}
|
|
137
|
+
onChange={e => setSearch(e.target.value)}
|
|
138
|
+
className="w-full px-2 py-1 text-sm border rounded"
|
|
139
|
+
/>
|
|
140
|
+
</div>
|
|
141
|
+
)}
|
|
142
|
+
<div className="max-h-[300px] overflow-auto">
|
|
143
|
+
{filteredItems.map(item => (
|
|
144
|
+
<button
|
|
145
|
+
key={item.value}
|
|
146
|
+
onClick={() => handleSelect(item.value)}
|
|
147
|
+
className={cn(
|
|
148
|
+
'w-full px-2 py-1.5 text-sm text-left hover:bg-accent',
|
|
149
|
+
multiple && (value as string[]).includes(item.value) && 'bg-accent',
|
|
150
|
+
)}
|
|
151
|
+
>
|
|
152
|
+
{item.display ?? item.label}
|
|
153
|
+
</button>
|
|
154
|
+
))}
|
|
155
|
+
</div>
|
|
156
|
+
</PopoverContent>
|
|
157
|
+
</Popover>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Trans } from '@lingui/react/macro';
|
|
2
|
+
import { useBlocker } from '@tanstack/react-router';
|
|
3
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
4
|
+
|
|
5
|
+
import { Button } from '../ui/button.js';
|
|
6
|
+
import {
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogContent,
|
|
9
|
+
DialogDescription,
|
|
10
|
+
DialogFooter,
|
|
11
|
+
DialogHeader,
|
|
12
|
+
DialogTitle,
|
|
13
|
+
} from '../ui/dialog.js';
|
|
14
|
+
|
|
15
|
+
export interface NavigationConfirmationProps {
|
|
16
|
+
form: UseFormReturn<any>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Navigation confirmation dialog that blocks navigation when the form is dirty.
|
|
21
|
+
*/
|
|
22
|
+
export function NavigationConfirmation(props: Readonly<NavigationConfirmationProps>) {
|
|
23
|
+
const { proceed, reset, status } = useBlocker({
|
|
24
|
+
shouldBlockFn: args => {
|
|
25
|
+
// When a new entity is being created, we don't want to block navigation
|
|
26
|
+
// to the newly-created entity page.
|
|
27
|
+
const isNavigatingToNewlyCreatedEntity =
|
|
28
|
+
args.current.fullPath === args.next.fullPath &&
|
|
29
|
+
args.current.params.id === 'new' &&
|
|
30
|
+
args.next.params.id !== 'new';
|
|
31
|
+
if (isNavigatingToNewlyCreatedEntity) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return props.form.formState.isDirty;
|
|
35
|
+
},
|
|
36
|
+
withResolver: true,
|
|
37
|
+
enableBeforeUnload: () => props.form.formState.isDirty,
|
|
38
|
+
});
|
|
39
|
+
return (
|
|
40
|
+
<Dialog open={status === 'blocked'} onOpenChange={reset}>
|
|
41
|
+
<DialogContent className="sm:max-w-[425px]">
|
|
42
|
+
<DialogHeader>
|
|
43
|
+
<DialogTitle>
|
|
44
|
+
<Trans>Confirm navigation</Trans>
|
|
45
|
+
</DialogTitle>
|
|
46
|
+
<DialogDescription>
|
|
47
|
+
<Trans>
|
|
48
|
+
Are you sure you want to navigate away from this page? Any unsaved changes will be
|
|
49
|
+
lost.
|
|
50
|
+
</Trans>
|
|
51
|
+
</DialogDescription>
|
|
52
|
+
</DialogHeader>
|
|
53
|
+
<DialogFooter>
|
|
54
|
+
<Button variant="outline" onClick={reset}>
|
|
55
|
+
<Trans>Cancel</Trans>
|
|
56
|
+
</Button>
|
|
57
|
+
<Button type="button" onClick={proceed}>
|
|
58
|
+
<Trans>Confirm</Trans>
|
|
59
|
+
</Button>
|
|
60
|
+
</DialogFooter>
|
|
61
|
+
</DialogContent>
|
|
62
|
+
</Dialog>
|
|
63
|
+
);
|
|
64
|
+
}
|