@mframework/layer-shared 0.0.1
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 +2 -0
- package/dist/api/global-search.d.ts +8 -0
- package/dist/api/global-search.js +1 -0
- package/dist/app/components/Gallery/__tests__/Gallery.spec.d.ts +1 -0
- package/dist/app/components/Gallery/__tests__/Gallery.spec.js +12 -0
- package/dist/app/components/Heading/__tests__/Heading.spec.d.ts +1 -0
- package/dist/app/components/Heading/__tests__/Heading.spec.js +12 -0
- package/dist/app/components/Heading/types.d.ts +5 -0
- package/dist/app/components/Heading/types.js +1 -0
- package/dist/app/components/ui/AccordionItem/__tests__/AccordionItem.spec.d.ts +1 -0
- package/dist/app/components/ui/AccordionItem/__tests__/AccordionItem.spec.js +12 -0
- package/dist/app/components/ui/AccordionItem/types.d.ts +5 -0
- package/dist/app/components/ui/AccordionItem/types.js +1 -0
- package/dist/app/components/ui/Alert/types.d.ts +5 -0
- package/dist/app/components/ui/Alert/types.js +1 -0
- package/dist/app/components/ui/Breadcrumbs/__tests__/Breadcrumbs.spec.d.ts +1 -0
- package/dist/app/components/ui/Breadcrumbs/__tests__/Breadcrumbs.spec.js +12 -0
- package/dist/app/components/ui/Breadcrumbs/types.d.ts +7 -0
- package/dist/app/components/ui/Breadcrumbs/types.js +1 -0
- package/dist/app/components/ui/CartProductCard/types.d.ts +17 -0
- package/dist/app/components/ui/CartProductCard/types.js +1 -0
- package/dist/app/components/ui/CategoryCard/types.d.ts +8 -0
- package/dist/app/components/ui/CategoryCard/types.js +1 -0
- package/dist/app/components/ui/Display/types.d.ts +12 -0
- package/dist/app/components/ui/Display/types.js +1 -0
- package/dist/app/components/ui/Divider/__tests__/Divider.spec.d.ts +1 -0
- package/dist/app/components/ui/Divider/__tests__/Divider.spec.js +8 -0
- package/dist/app/components/ui/Form/__tests__/FormHelperText.spec.d.ts +1 -0
- package/dist/app/components/ui/Form/__tests__/FormHelperText.spec.js +8 -0
- package/dist/app/components/ui/Form/__tests__/FormLabel.spec.d.ts +1 -0
- package/dist/app/components/ui/Form/__tests__/FormLabel.spec.js +8 -0
- package/dist/app/components/ui/Hero/types.d.ts +10 -0
- package/dist/app/components/ui/Hero/types.js +1 -0
- package/dist/app/components/ui/Modal/types.d.ts +7 -0
- package/dist/app/components/ui/Modal/types.js +1 -0
- package/dist/app/components/ui/Overlay/__tests__/Overlay.spec.d.ts +1 -0
- package/dist/app/components/ui/Overlay/__tests__/Overlay.spec.js +12 -0
- package/dist/app/components/ui/Overlay/types.d.ts +3 -0
- package/dist/app/components/ui/Overlay/types.js +1 -0
- package/dist/app/components/ui/Pagination/__tests__/Pagination.spec.d.ts +1 -0
- package/dist/app/components/ui/Pagination/__tests__/Pagination.spec.js +15 -0
- package/dist/app/components/ui/Pagination/types.d.ts +6 -0
- package/dist/app/components/ui/Pagination/types.js +1 -0
- package/dist/app/components/ui/ProductCard/__tests__/ProductCard.spec.d.ts +1 -0
- package/dist/app/components/ui/ProductCard/__tests__/ProductCard.spec.js +14 -0
- package/dist/app/components/ui/ProductCard/types.d.ts +12 -0
- package/dist/app/components/ui/ProductCard/types.js +1 -0
- package/dist/app/components/ui/ProductCardHorizontal/__tests__/ProductCardHorizontal.spec.d.ts +1 -0
- package/dist/app/components/ui/ProductCardHorizontal/__tests__/ProductCardHorizontal.spec.js +34 -0
- package/dist/app/components/ui/ProductCardHorizontal/types.d.ts +4 -0
- package/dist/app/components/ui/ProductCardHorizontal/types.js +1 -0
- package/dist/app/components/ui/PurchaseCard/__tests__/PurchaseCard.spec.d.ts +1 -0
- package/dist/app/components/ui/PurchaseCard/__tests__/PurchaseCard.spec.js +12 -0
- package/dist/app/components/ui/PurchaseCard/types.d.ts +4 -0
- package/dist/app/components/ui/PurchaseCard/types.js +1 -0
- package/dist/app/components/ui/QuantitySelector/__tests__/QuantitySelector.spec.d.ts +1 -0
- package/dist/app/components/ui/QuantitySelector/__tests__/QuantitySelector.spec.js +13 -0
- package/dist/app/components/ui/QuantitySelector/types.d.ts +5 -0
- package/dist/app/components/ui/QuantitySelector/types.js +1 -0
- package/dist/app/components/ui/Review/__tests__/Review.spec.d.ts +1 -0
- package/dist/app/components/ui/Review/__tests__/Review.spec.js +13 -0
- package/dist/app/components/ui/Review/types.d.ts +4 -0
- package/dist/app/components/ui/Review/types.js +1 -0
- package/dist/app/components/ui/Tag/__tests__/Tag.spec.d.ts +1 -0
- package/dist/app/components/ui/Tag/__tests__/Tag.spec.js +8 -0
- package/dist/app/components/ui/Tag/types.d.ts +14 -0
- package/dist/app/components/ui/Tag/types.js +11 -0
- package/dist/app/composables/globals/useAdminTable.d.ts +3 -0
- package/dist/app/composables/globals/useAdminTable.js +9 -0
- package/dist/app/composables/globals/useCustomFetch.d.ts +2 -0
- package/dist/app/composables/globals/useCustomFetch.js +8 -0
- package/dist/app/composables/globals/useDirectusField.d.ts +10 -0
- package/dist/app/composables/globals/useDirectusField.js +119 -0
- package/dist/app/composables/globals/useDirectusForm.d.ts +10 -0
- package/dist/app/composables/globals/useDirectusForm.js +66 -0
- package/dist/app/composables/globals/useFileManager.d.ts +14 -0
- package/dist/app/composables/globals/useFileManager.js +62 -0
- package/dist/app/composables/globals/useLivePreview.d.ts +1 -0
- package/dist/app/composables/globals/useLivePreview.js +16 -0
- package/dist/app/composables/globals/useLoading.d.ts +6 -0
- package/dist/app/composables/globals/useLoading.js +19 -0
- package/dist/app/composables/globals/useNotifications.d.ts +35 -0
- package/dist/app/composables/globals/useNotifications.js +133 -0
- package/dist/app/composables/globals/useRichText.d.ts +1 -0
- package/dist/app/composables/globals/useRichText.js +32 -0
- package/dist/app/composables/globals/useServerRootMixin.d.ts +3 -0
- package/dist/app/composables/globals/useServerRootMixin.js +15 -0
- package/dist/app/composables/globals/useVisualEditing.d.ts +17 -0
- package/dist/app/composables/globals/useVisualEditing.js +27 -0
- package/dist/app/composables/mappers/createMapper.d.ts +2 -0
- package/dist/app/composables/mappers/createMapper.js +6 -0
- package/dist/app/composables/mappers/errors.d.ts +6 -0
- package/dist/app/composables/mappers/errors.js +12 -0
- package/dist/app/composables/mappers/index.d.ts +6 -0
- package/dist/app/composables/mappers/index.js +7 -0
- package/dist/app/composables/mappers/registry.d.ts +5 -0
- package/dist/app/composables/mappers/registry.js +18 -0
- package/dist/app/composables/mappers/testHarness.d.ts +13 -0
- package/dist/app/composables/mappers/testHarness.js +98 -0
- package/dist/app/composables/mappers/types.d.ts +5 -0
- package/dist/app/composables/mappers/types.js +1 -0
- package/dist/app/composables/mappers/zodMapper.d.ts +9 -0
- package/dist/app/composables/mappers/zodMapper.js +17 -0
- package/dist/app/composables/media/useFile.d.ts +2 -0
- package/dist/app/composables/media/useFile.js +4 -0
- package/dist/app/composables/media/useMediaCenter.d.ts +29 -0
- package/dist/app/composables/media/useMediaCenter.js +321 -0
- package/dist/app/composables/media/useVideojs.d.ts +11 -0
- package/dist/app/composables/media/useVideojs.js +42 -0
- package/dist/app/composables/registry.d.ts +3 -0
- package/dist/app/composables/registry.js +10 -0
- package/dist/app/composables/schema/commerce/attributes.d.ts +7 -0
- package/dist/app/composables/schema/commerce/attributes.js +1 -0
- package/dist/app/composables/schema/commerce/blocks.d.ts +6 -0
- package/dist/app/composables/schema/commerce/blocks.js +1 -0
- package/dist/app/composables/schema/commerce/bundleProduts.d.ts +10 -0
- package/dist/app/composables/schema/commerce/bundleProduts.js +1 -0
- package/dist/app/composables/schema/commerce/cart.d.ts +29 -0
- package/dist/app/composables/schema/commerce/cart.js +1 -0
- package/dist/app/composables/schema/commerce/category.d.ts +12 -0
- package/dist/app/composables/schema/commerce/category.js +1 -0
- package/dist/app/composables/schema/commerce/checkout.d.ts +9 -0
- package/dist/app/composables/schema/commerce/checkout.js +1 -0
- package/dist/app/composables/schema/commerce/company.d.ts +7 -0
- package/dist/app/composables/schema/commerce/company.js +1 -0
- package/dist/app/composables/schema/commerce/configurableProducts.d.ts +12 -0
- package/dist/app/composables/schema/commerce/configurableProducts.js +1 -0
- package/dist/app/composables/schema/commerce/coupons.d.ts +9 -0
- package/dist/app/composables/schema/commerce/coupons.js +1 -0
- package/dist/app/composables/schema/commerce/credit-memos.d.ts +48 -0
- package/dist/app/composables/schema/commerce/credit-memos.js +1 -0
- package/dist/app/composables/schema/commerce/digitalProducts.d.ts +11 -0
- package/dist/app/composables/schema/commerce/digitalProducts.js +1 -0
- package/dist/app/composables/schema/commerce/directory.d.ts +7 -0
- package/dist/app/composables/schema/commerce/directory.js +1 -0
- package/dist/app/composables/schema/commerce/events.d.ts +27 -0
- package/dist/app/composables/schema/commerce/events.js +1 -0
- package/dist/app/composables/schema/commerce/gift-registry.d.ts +7 -0
- package/dist/app/composables/schema/commerce/gift-registry.js +1 -0
- package/dist/app/composables/schema/commerce/guest-cart.d.ts +4 -0
- package/dist/app/composables/schema/commerce/guest-cart.js +1 -0
- package/dist/app/composables/schema/commerce/inventory.d.ts +8 -0
- package/dist/app/composables/schema/commerce/inventory.js +1 -0
- package/dist/app/composables/schema/commerce/invoices.d.ts +47 -0
- package/dist/app/composables/schema/commerce/invoices.js +1 -0
- package/dist/app/composables/schema/commerce/orders.d.ts +32 -0
- package/dist/app/composables/schema/commerce/orders.js +1 -0
- package/dist/app/composables/schema/commerce/payments.d.ts +8 -0
- package/dist/app/composables/schema/commerce/payments.js +1 -0
- package/dist/app/composables/schema/commerce/price.d.ts +9 -0
- package/dist/app/composables/schema/commerce/price.js +1 -0
- package/dist/app/composables/schema/commerce/product-types.d.ts +6 -0
- package/dist/app/composables/schema/commerce/product-types.js +1 -0
- package/dist/app/composables/schema/commerce/product.d.ts +20 -0
- package/dist/app/composables/schema/commerce/product.js +1 -0
- package/dist/app/composables/schema/commerce/quotes.d.ts +13 -0
- package/dist/app/composables/schema/commerce/quotes.js +1 -0
- package/dist/app/composables/schema/commerce/requisition-lists.d.ts +9 -0
- package/dist/app/composables/schema/commerce/requisition-lists.js +1 -0
- package/dist/app/composables/schema/commerce/returns.d.ts +8 -0
- package/dist/app/composables/schema/commerce/returns.js +1 -0
- package/dist/app/composables/schema/commerce/reward.d.ts +7 -0
- package/dist/app/composables/schema/commerce/reward.js +1 -0
- package/dist/app/composables/schema/commerce/rules.d.ts +7 -0
- package/dist/app/composables/schema/commerce/rules.js +1 -0
- package/dist/app/composables/schema/commerce/shipment.d.ts +18 -0
- package/dist/app/composables/schema/commerce/shipment.js +1 -0
- package/dist/app/composables/schema/commerce/shops.d.ts +8 -0
- package/dist/app/composables/schema/commerce/shops.js +1 -0
- package/dist/app/composables/schema/commerce/stockItems.d.ts +7 -0
- package/dist/app/composables/schema/commerce/stockItems.js +1 -0
- package/dist/app/composables/schema/commerce/store.d.ts +7 -0
- package/dist/app/composables/schema/commerce/store.js +1 -0
- package/dist/app/composables/schema/commerce/subscriptons.d.ts +9 -0
- package/dist/app/composables/schema/commerce/subscriptons.js +1 -0
- package/dist/app/composables/schema/commerce/taxRates.d.ts +7 -0
- package/dist/app/composables/schema/commerce/taxRates.js +1 -0
- package/dist/app/composables/schema/commerce/taxRules.d.ts +7 -0
- package/dist/app/composables/schema/commerce/taxRules.js +1 -0
- package/dist/app/composables/schema/commerce/teams.d.ts +6 -0
- package/dist/app/composables/schema/commerce/teams.js +1 -0
- package/dist/app/composables/schema/commerce/transactions.d.ts +11 -0
- package/dist/app/composables/schema/commerce/transactions.js +1 -0
- package/dist/app/composables/schema/identity/customerGroup.d.ts +7 -0
- package/dist/app/composables/schema/identity/customerGroup.js +1 -0
- package/dist/app/composables/schema/identity/user.d.ts +45 -0
- package/dist/app/composables/schema/identity/user.js +1 -0
- package/dist/app/composables/schema/media/asset.d.ts +28 -0
- package/dist/app/composables/schema/media/asset.js +1 -0
- package/dist/app/composables/schema/social/post.d.ts +25 -0
- package/dist/app/composables/schema/social/post.js +1 -0
- package/dist/app/composables/schema/social/profile.d.ts +22 -0
- package/dist/app/composables/schema/social/profile.js +1 -0
- package/dist/app/composables/schema/social/space.d.ts +17 -0
- package/dist/app/composables/schema/social/space.js +1 -0
- package/dist/app/composables/types.d.ts +11 -0
- package/dist/app/composables/types.js +1 -0
- package/dist/app/composables/useContent.d.ts +4 -0
- package/dist/app/composables/useContent.js +10 -0
- package/dist/app/composables/useDirectusRequest.d.ts +12 -0
- package/dist/app/composables/useDirectusRequest.js +83 -0
- package/dist/app/composables/utils/assert.d.ts +1 -0
- package/dist/app/composables/utils/assert.js +5 -0
- package/dist/app/composables/utils/deepMerge.d.ts +1 -0
- package/dist/app/composables/utils/deepMerge.js +15 -0
- package/dist/app/composables/utils/index.d.ts +4 -0
- package/dist/app/composables/utils/index.js +4 -0
- package/dist/app/composables/utils/isObject.d.ts +1 -0
- package/dist/app/composables/utils/isObject.js +5 -0
- package/dist/app/composables/utils/module.d.ts +4 -0
- package/dist/app/composables/utils/module.js +14 -0
- package/dist/app/composables/utils/safeGet.d.ts +1 -0
- package/dist/app/composables/utils/safeGet.js +5 -0
- package/dist/app/stores/index.d.ts +0 -0
- package/dist/app/stores/index.js +1 -0
- package/dist/app/utils/billing-address.d.ts +2 -0
- package/dist/app/utils/billing-address.js +18 -0
- package/dist/app/utils/color.d.ts +2 -0
- package/dist/app/utils/color.js +11 -0
- package/dist/app/utils/currency.d.ts +6 -0
- package/dist/app/utils/currency.js +20 -0
- package/dist/app/utils/embed.d.ts +2 -0
- package/dist/app/utils/embed.js +52 -0
- package/dist/app/utils/errors.d.ts +5 -0
- package/dist/app/utils/errors.js +6 -0
- package/dist/app/utils/fonts.d.ts +5 -0
- package/dist/app/utils/fonts.js +18 -0
- package/dist/app/utils/formkit.d.ts +12 -0
- package/dist/app/utils/formkit.js +59 -0
- package/dist/app/utils/icons.d.ts +4 -0
- package/dist/app/utils/icons.js +36 -0
- package/dist/app/utils/links.d.ts +7 -0
- package/dist/app/utils/links.js +21 -0
- package/dist/app/utils/lodash.d.ts +2 -0
- package/dist/app/utils/lodash.js +23 -0
- package/dist/app/utils/markdown.d.ts +1 -0
- package/dist/app/utils/markdown.js +8 -0
- package/dist/app/utils/math.d.ts +6 -0
- package/dist/app/utils/math.js +21 -0
- package/dist/app/utils/navigation.d.ts +2 -0
- package/dist/app/utils/navigation.js +9 -0
- package/dist/app/utils/objects.d.ts +3 -0
- package/dist/app/utils/objects.js +11 -0
- package/dist/app/utils/paths.d.ts +21 -0
- package/dist/app/utils/paths.js +21 -0
- package/dist/app/utils/relations.d.ts +9 -0
- package/dist/app/utils/relations.js +24 -0
- package/dist/app/utils/strings.d.ts +14 -0
- package/dist/app/utils/strings.js +92 -0
- package/dist/app/utils/time.d.ts +13 -0
- package/dist/app/utils/time.js +124 -0
- package/dist/app/utils/url.d.ts +12 -0
- package/dist/app/utils/url.js +20 -0
- package/dist/app/utils/user-name.d.ts +2 -0
- package/dist/app/utils/user-name.js +15 -0
- package/dist/blocks/block-button-group.d.ts +6 -0
- package/dist/blocks/block-button-group.js +1 -0
- package/dist/blocks/block-button.d.ts +13 -0
- package/dist/blocks/block-button.js +1 -0
- package/dist/blocks/block-column.d.ts +18 -0
- package/dist/blocks/block-column.js +1 -0
- package/dist/blocks/block-cta.d.ts +11 -0
- package/dist/blocks/block-cta.js +1 -0
- package/dist/blocks/block-divider.d.ts +4 -0
- package/dist/blocks/block-divider.js +1 -0
- package/dist/blocks/block-faq.d.ts +11 -0
- package/dist/blocks/block-faq.js +1 -0
- package/dist/blocks/block-form.d.ts +7 -0
- package/dist/blocks/block-form.js +1 -0
- package/dist/blocks/block-gallery.d.ts +13 -0
- package/dist/blocks/block-gallery.js +1 -0
- package/dist/blocks/block-hero.d.ts +11 -0
- package/dist/blocks/block-hero.js +1 -0
- package/dist/blocks/block-html.d.ts +4 -0
- package/dist/blocks/block-html.js +1 -0
- package/dist/blocks/block-logocloud.d.ts +13 -0
- package/dist/blocks/block-logocloud.js +1 -0
- package/dist/blocks/block-quote.d.ts +10 -0
- package/dist/blocks/block-quote.js +1 -0
- package/dist/blocks/block-richtext.d.ts +7 -0
- package/dist/blocks/block-richtext.js +1 -0
- package/dist/blocks/block-steps.d.ts +21 -0
- package/dist/blocks/block-steps.js +1 -0
- package/dist/blocks/block-team.d.ts +6 -0
- package/dist/blocks/block-team.js +1 -0
- package/dist/blocks/block-testimonial.d.ts +13 -0
- package/dist/blocks/block-testimonial.js +1 -0
- package/dist/blocks/block-video.d.ts +9 -0
- package/dist/blocks/block-video.js +1 -0
- package/dist/blocks/block.d.ts +17 -0
- package/dist/blocks/block.js +1 -0
- package/dist/blocks/index.d.ts +18 -0
- package/dist/blocks/index.js +1 -0
- package/dist/componentMap.d.ts +6 -0
- package/dist/componentMap.js +8 -0
- package/dist/content/category.d.ts +10 -0
- package/dist/content/category.js +1 -0
- package/dist/content/form.d.ts +21 -0
- package/dist/content/form.js +1 -0
- package/dist/content/index.d.ts +6 -0
- package/dist/content/index.js +1 -0
- package/dist/content/page.d.ts +38 -0
- package/dist/content/page.js +1 -0
- package/dist/content/post.d.ts +38 -0
- package/dist/content/post.js +1 -0
- package/dist/content/team.d.ts +17 -0
- package/dist/content/team.js +1 -0
- package/dist/content/testimonial.d.ts +18 -0
- package/dist/content/testimonial.js +1 -0
- package/dist/help/index.d.ts +51 -0
- package/dist/help/index.js +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -0
- package/dist/meta/analytics.d.ts +21 -0
- package/dist/meta/analytics.js +1 -0
- package/dist/meta/config.d.ts +22 -0
- package/dist/meta/config.js +1 -0
- package/dist/meta/globals.d.ts +33 -0
- package/dist/meta/globals.js +1 -0
- package/dist/meta/index.d.ts +6 -0
- package/dist/meta/index.js +1 -0
- package/dist/meta/navigation.d.ts +31 -0
- package/dist/meta/navigation.js +1 -0
- package/dist/meta/redirect.d.ts +12 -0
- package/dist/meta/redirect.js +1 -0
- package/dist/meta/seo.d.ts +19 -0
- package/dist/meta/seo.js +1 -0
- package/dist/os/contact.d.ts +22 -0
- package/dist/os/contact.js +1 -0
- package/dist/os/conversation.d.ts +23 -0
- package/dist/os/conversation.js +1 -0
- package/dist/os/index.d.ts +16 -0
- package/dist/os/index.js +1 -0
- package/dist/os/organization.d.ts +51 -0
- package/dist/os/organization.js +1 -0
- package/dist/os/os-activity.d.ts +26 -0
- package/dist/os/os-activity.js +1 -0
- package/dist/os/os-deal.d.ts +42 -0
- package/dist/os/os-deal.js +1 -0
- package/dist/os/os-expense.d.ts +21 -0
- package/dist/os/os-expense.js +1 -0
- package/dist/os/os-invoice.d.ts +46 -0
- package/dist/os/os-invoice.js +1 -0
- package/dist/os/os-item.d.ts +17 -0
- package/dist/os/os-item.js +1 -0
- package/dist/os/os-payment.d.ts +27 -0
- package/dist/os/os-payment.js +1 -0
- package/dist/os/os-project.d.ts +45 -0
- package/dist/os/os-project.js +1 -0
- package/dist/os/os-proposal.d.ts +61 -0
- package/dist/os/os-proposal.js +1 -0
- package/dist/os/os-settings.d.ts +17 -0
- package/dist/os/os-settings.js +1 -0
- package/dist/os/os-subscription.d.ts +12 -0
- package/dist/os/os-subscription.js +1 -0
- package/dist/os/os-task.d.ts +32 -0
- package/dist/os/os-task.js +1 -0
- package/dist/os/os-tax-rate.d.ts +12 -0
- package/dist/os/os-tax-rate.js +1 -0
- package/dist/package.json +72 -0
- package/dist/pageComponentMap.d.ts +2 -0
- package/dist/pageComponentMap.js +7 -0
- package/dist/schema.d.ts +78 -0
- package/dist/schema.js +1 -0
- package/dist/system/file.d.ts +47 -0
- package/dist/system/file.js +1 -0
- package/dist/system/folder.d.ts +8 -0
- package/dist/system/folder.js +1 -0
- package/dist/system/index.d.ts +4 -0
- package/dist/system/index.js +1 -0
- package/dist/system/role.d.ts +20 -0
- package/dist/system/role.js +1 -0
- package/dist/system/user.d.ts +57 -0
- package/dist/system/user.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/i18n/.gitkeep +0 -0
- package/i18n/config.ts +9 -0
- package/i18n/da_DK.json +613 -0
- package/i18n/de-DE/account.json +100 -0
- package/i18n/de-DE/cart.json +19 -0
- package/i18n/de-DE/changePassword.json +15 -0
- package/i18n/de-DE/checkout.json +68 -0
- package/i18n/de-DE/de-DE.ts +27 -0
- package/i18n/de-DE/errors.json +46 -0
- package/i18n/de-DE/form.json +42 -0
- package/i18n/de-DE/general.json +62 -0
- package/i18n/de-DE/listing.json +15 -0
- package/i18n/de-DE/newsletter.json +11 -0
- package/i18n/de-DE/product.json +48 -0
- package/i18n/de-DE/recoveryPassword.json +21 -0
- package/i18n/de-DE/validations.json +24 -0
- package/i18n/de_DE.json +613 -0
- package/i18n/en-GB/account.json +102 -0
- package/i18n/en-GB/cart.json +19 -0
- package/i18n/en-GB/changePassword.json +15 -0
- package/i18n/en-GB/checkout.json +68 -0
- package/i18n/en-GB/en-GB.ts +27 -0
- package/i18n/en-GB/errors.json +47 -0
- package/i18n/en-GB/form.json +42 -0
- package/i18n/en-GB/general.json +64 -0
- package/i18n/en-GB/listing.json +15 -0
- package/i18n/en-GB/newsletter.json +11 -0
- package/i18n/en-GB/product.json +48 -0
- package/i18n/en-GB/recoveryPassword.json +21 -0
- package/i18n/en-GB/validations.json +24 -0
- package/i18n/en_US.json +264 -0
- package/i18n/es_ES.json +613 -0
- package/i18n/fa_IR.json +613 -0
- package/i18n/fi_FI.json +613 -0
- package/i18n/fr_FR.json +613 -0
- package/i18n/it_IT.json +613 -0
- package/i18n/lv_LV.json +613 -0
- package/i18n/nb_NO.json +613 -0
- package/i18n/nl_NL.json +613 -0
- package/i18n/pl-PL/account.json +100 -0
- package/i18n/pl-PL/cart.json +19 -0
- package/i18n/pl-PL/changePassword.json +15 -0
- package/i18n/pl-PL/checkout.json +69 -0
- package/i18n/pl-PL/errors.json +46 -0
- package/i18n/pl-PL/form.json +42 -0
- package/i18n/pl-PL/general.json +64 -0
- package/i18n/pl-PL/listing.json +15 -0
- package/i18n/pl-PL/newsletter.json +11 -0
- package/i18n/pl-PL/pl-PL.ts +25 -0
- package/i18n/pl-PL/product.json +48 -0
- package/i18n/pl-PL/recoveryPassword.json +21 -0
- package/i18n/pl-PL/validations.json +24 -0
- package/i18n/pl_PL.json +613 -0
- package/i18n/pt_BR.json +613 -0
- package/i18n/ru_RU.json +613 -0
- package/i18n/sl_SI.json +613 -0
- package/i18n/src/helpers/prefix.ts +17 -0
- package/i18n/src/langs/de-DE.ts +2 -0
- package/i18n/src/langs/en-GB.ts +2 -0
- package/i18n/src/langs/pl-PL.ts +2 -0
- package/i18n/sv_SE.json +613 -0
- package/i18n/tr_TR.json +613 -0
- package/i18n/utils/i18n-validators.ts +31 -0
- package/i18n/zh_TW.json +613 -0
- package/nuxt.config.ts +91 -0
- package/package.json +72 -0
- package/prisma/generated/browser.ts +44 -0
- package/prisma/generated/client.ts +66 -0
- package/prisma/generated/commonInputTypes.ts +432 -0
- package/prisma/generated/enums.ts +15 -0
- package/prisma/generated/internal/class.ts +232 -0
- package/prisma/generated/internal/prismaNamespace.ts +1154 -0
- package/prisma/generated/internal/prismaNamespaceBrowser.ts +179 -0
- package/prisma/generated/models/Account.ts +1620 -0
- package/prisma/generated/models/Session.ts +1484 -0
- package/prisma/generated/models/Upload.ts +1291 -0
- package/prisma/generated/models/User.ts +1780 -0
- package/prisma/generated/models/Verification.ts +1172 -0
- package/prisma/generated/models.ts +16 -0
- package/prisma/schema.prisma +102 -0
- package/runtime/plugins/vuetify.ts +12 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { ref, computed, watch } from "vue";
|
|
2
|
+
import Input from "~/components/ui/forms/TextInput.vue";
|
|
3
|
+
import Select from "~/components/ui/forms/SelectInput.vue";
|
|
4
|
+
import DateTime from "~/components/ui/forms/DateTime.vue";
|
|
5
|
+
import FileInput from "~/components/ui/forms/FileInput.vue";
|
|
6
|
+
import BooleanInput from "~/components/ui/forms/BooleanInput.vue";
|
|
7
|
+
import RelationSelect from "~/components/ui/forms/RelationSelect.vue";
|
|
8
|
+
import TiptapEditor from "~/components/ui/forms/TiptapEditor.vue";
|
|
9
|
+
export function useDirectusField(field, modelValue, emit, formContext) {
|
|
10
|
+
const internalValue = computed({
|
|
11
|
+
get: () => modelValue,
|
|
12
|
+
set: (v) => emit("update:modelValue", v),
|
|
13
|
+
});
|
|
14
|
+
const previousAuto = ref(null);
|
|
15
|
+
const internalAuto = computed(() => {
|
|
16
|
+
return previousAuto.value != null && internalValue.value === previousAuto.value;
|
|
17
|
+
});
|
|
18
|
+
const slugify = (val) => String(val || "")
|
|
19
|
+
.toLowerCase()
|
|
20
|
+
.normalize("NFKD")
|
|
21
|
+
.replace(/\s+/g, "-")
|
|
22
|
+
.replace(/[^a-z0-9\-]/g, "")
|
|
23
|
+
.replace(/-+/g, "-")
|
|
24
|
+
.replace(/^-|-$/g, "");
|
|
25
|
+
const isAliasField = computed(() => {
|
|
26
|
+
const meta = field?.meta ?? {};
|
|
27
|
+
return (meta.interface === "alias" ||
|
|
28
|
+
(meta.options && (meta.options.source || meta.options.from)));
|
|
29
|
+
});
|
|
30
|
+
if (isAliasField.value && formContext && formContext.form) {
|
|
31
|
+
const meta = field?.meta ?? {};
|
|
32
|
+
let sourceField = meta?.options?.source ?? meta?.options?.from ?? null;
|
|
33
|
+
if (!sourceField && formContext.fields) {
|
|
34
|
+
const candidates = ["name", "title"];
|
|
35
|
+
sourceField =
|
|
36
|
+
candidates.find((c) => formContext.fields.value.some((f) => f.field === c)) ?? null;
|
|
37
|
+
}
|
|
38
|
+
if (sourceField) {
|
|
39
|
+
watch(() => formContext.form.value?.[sourceField], (newVal) => {
|
|
40
|
+
const target = field.field;
|
|
41
|
+
const current = formContext.form.value?.[target] ?? "";
|
|
42
|
+
const generated = slugify(String(newVal ?? ""));
|
|
43
|
+
if (!generated)
|
|
44
|
+
return;
|
|
45
|
+
// Case 1: Empty or previously autoโgenerated โ regenerate
|
|
46
|
+
if (!current || current === previousAuto.value) {
|
|
47
|
+
formContext.form.value[target] = generated;
|
|
48
|
+
internalValue.value = generated;
|
|
49
|
+
previousAuto.value = generated;
|
|
50
|
+
}
|
|
51
|
+
}, { immediate: true });
|
|
52
|
+
// Watch the target itself: if cleared, regenerate
|
|
53
|
+
watch(() => formContext.form.value?.[field.field], (newVal) => {
|
|
54
|
+
if (!newVal) {
|
|
55
|
+
const sourceVal = formContext.form.value?.[sourceField] ?? "";
|
|
56
|
+
const regenerated = slugify(String(sourceVal));
|
|
57
|
+
if (regenerated) {
|
|
58
|
+
formContext.form.value[field.field] = regenerated;
|
|
59
|
+
internalValue.value = regenerated;
|
|
60
|
+
previousAuto.value = regenerated;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// --- Label prettifier ---
|
|
67
|
+
const prettify = (s) => s.replace(/_/g, " ")
|
|
68
|
+
.split(" ")
|
|
69
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
70
|
+
.join(" ");
|
|
71
|
+
const label = computed(() => {
|
|
72
|
+
const raw = field?.meta?.field ?? field?.field ?? "";
|
|
73
|
+
return prettify(raw);
|
|
74
|
+
});
|
|
75
|
+
// --- Field lookup ---
|
|
76
|
+
const fieldLookup = computed(() => {
|
|
77
|
+
const iface = field?.meta?.interface;
|
|
78
|
+
const name = String(iface ?? "").toLowerCase();
|
|
79
|
+
if (["input", "string"].includes(name))
|
|
80
|
+
return Input;
|
|
81
|
+
if (["textarea", "wysiwyg", "rich-text", "input-multiline", "input-rich-text", "input-rich-text-md"].includes(name))
|
|
82
|
+
return TiptapEditor;
|
|
83
|
+
if (["select", "select-dropdown", "select-multiple"].includes(name))
|
|
84
|
+
return Select;
|
|
85
|
+
if (name === "datetime")
|
|
86
|
+
return DateTime;
|
|
87
|
+
if (["file", "files", "file-image"].includes(name))
|
|
88
|
+
return FileInput;
|
|
89
|
+
if (name === "boolean")
|
|
90
|
+
return BooleanInput;
|
|
91
|
+
if (name.includes("many") || name.includes("one") || name.includes("to"))
|
|
92
|
+
return RelationSelect;
|
|
93
|
+
return Input;
|
|
94
|
+
});
|
|
95
|
+
const required = computed(() => {
|
|
96
|
+
const meta = field?.meta ?? {};
|
|
97
|
+
return Boolean(meta?.validation?.required ?? meta?.required ?? false);
|
|
98
|
+
});
|
|
99
|
+
const safeOptions = computed(() => field?.meta?.options ?? null);
|
|
100
|
+
const defaultValue = computed(() => field?.schema?.default_value ?? null);
|
|
101
|
+
const isMultiple = computed(() => {
|
|
102
|
+
const name = String(field?.meta?.interface ?? "").toLowerCase();
|
|
103
|
+
if (name === "select-multiple")
|
|
104
|
+
return true;
|
|
105
|
+
if (name.includes("many"))
|
|
106
|
+
return true;
|
|
107
|
+
return Boolean(field?.meta?.options?.multiple || false);
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
internalValue,
|
|
111
|
+
internalAuto,
|
|
112
|
+
label,
|
|
113
|
+
fieldLookup,
|
|
114
|
+
required,
|
|
115
|
+
safeOptions,
|
|
116
|
+
defaultValue,
|
|
117
|
+
isMultiple,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
export declare function useDirectusForm(collectionName: string, fieldsRef: Ref<any[]>, opts?: {
|
|
3
|
+
clearOnSuccess?: boolean;
|
|
4
|
+
closeDialogRef?: Ref<boolean>;
|
|
5
|
+
}): {
|
|
6
|
+
form: Ref<Record<string, any>, Record<string, any>>;
|
|
7
|
+
formError: Ref<string | null, string | null>;
|
|
8
|
+
formSuccess: Ref<string | null, string | null>;
|
|
9
|
+
submitForm: () => Promise<void>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ref, provide } from 'vue';
|
|
2
|
+
export function useDirectusForm(collectionName, fieldsRef, opts) {
|
|
3
|
+
const form = ref({});
|
|
4
|
+
const formError = ref(null);
|
|
5
|
+
const formSuccess = ref(null);
|
|
6
|
+
// provide form context for DirectusFormElement children
|
|
7
|
+
provide('directusForm', {
|
|
8
|
+
form,
|
|
9
|
+
fields: fieldsRef,
|
|
10
|
+
});
|
|
11
|
+
const submitForm = async () => {
|
|
12
|
+
formError.value = null;
|
|
13
|
+
formSuccess.value = null;
|
|
14
|
+
// Validate form data against field validation rules
|
|
15
|
+
for (const field of fieldsRef.value) {
|
|
16
|
+
if (field.meta?.validation) {
|
|
17
|
+
try {
|
|
18
|
+
const validation = field.meta.validation;
|
|
19
|
+
if (validation._and) {
|
|
20
|
+
for (const rule of validation._and) {
|
|
21
|
+
const fieldName = Object.keys(rule)[0];
|
|
22
|
+
if (!fieldName)
|
|
23
|
+
continue;
|
|
24
|
+
const ruleDef = rule[fieldName];
|
|
25
|
+
if (ruleDef && ruleDef._regex) {
|
|
26
|
+
const regex = new RegExp(ruleDef._regex);
|
|
27
|
+
const valueToTest = String(form.value[field.field] ?? '');
|
|
28
|
+
if (!regex.test(valueToTest)) {
|
|
29
|
+
formError.value = field.meta.validation_message || field.meta.field + ' failed validation';
|
|
30
|
+
console.error(`Validation failed for ${field.field}: ${field.meta.validation_message || 'Invalid format'}`);
|
|
31
|
+
return; // Stop submission if validation fails
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
console.error(`Error parsing validation for ${field.field}:`, err);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const { $directus, $createItem } = useNuxtApp();
|
|
43
|
+
const result = await $directus.request($createItem(collectionName, form.value));
|
|
44
|
+
if (result.error) {
|
|
45
|
+
formError.value = result.error.message;
|
|
46
|
+
console.error(`Error creating ${collectionName}:`, result.error);
|
|
47
|
+
return; // Stop submission if error occurs
|
|
48
|
+
}
|
|
49
|
+
formSuccess.value = `${collectionName} created successfully`;
|
|
50
|
+
if (opts?.clearOnSuccess) {
|
|
51
|
+
form.value = {};
|
|
52
|
+
}
|
|
53
|
+
if (opts?.closeDialogRef) {
|
|
54
|
+
try {
|
|
55
|
+
opts.closeDialogRef.value = false;
|
|
56
|
+
}
|
|
57
|
+
catch (e) { }
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
form,
|
|
62
|
+
formError,
|
|
63
|
+
formSuccess,
|
|
64
|
+
submitForm,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FileManagerConfig {
|
|
2
|
+
maxSize?: number;
|
|
3
|
+
allowedTypes?: string[];
|
|
4
|
+
onProgress?: (progress: number) => void;
|
|
5
|
+
onSuccess?: (file: any) => void;
|
|
6
|
+
onError?: (error: Error) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useFileManager(config?: FileManagerConfig): {
|
|
9
|
+
uploading: any;
|
|
10
|
+
progress: any;
|
|
11
|
+
error: any;
|
|
12
|
+
uploadToServer: (file: File) => Promise<any>;
|
|
13
|
+
uploadMultipleFiles: (files: FileList | File[]) => Promise<any[]>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export function useFileManager(config = {}) {
|
|
2
|
+
const uploading = ref(false);
|
|
3
|
+
const progress = ref(0);
|
|
4
|
+
const error = ref(null);
|
|
5
|
+
const uploadToServer = async (file) => {
|
|
6
|
+
if (config.maxSize && file.size > config.maxSize) {
|
|
7
|
+
const errorMsg = `File size exceeds ${formatFileSize(config.maxSize)}`;
|
|
8
|
+
error.value = errorMsg;
|
|
9
|
+
config.onError?.(new Error(errorMsg));
|
|
10
|
+
throw new Error(errorMsg);
|
|
11
|
+
}
|
|
12
|
+
if (config.allowedTypes && !config.allowedTypes.includes(file.type)) {
|
|
13
|
+
const errorMsg = 'File type not allowed';
|
|
14
|
+
error.value = errorMsg;
|
|
15
|
+
config.onError?.(new Error(errorMsg));
|
|
16
|
+
throw new Error(errorMsg);
|
|
17
|
+
}
|
|
18
|
+
const formData = new FormData();
|
|
19
|
+
formData.append('file', file);
|
|
20
|
+
uploading.value = true;
|
|
21
|
+
progress.value = 0;
|
|
22
|
+
error.value = null;
|
|
23
|
+
try {
|
|
24
|
+
const response = await $fetch('/api/file/upload', {
|
|
25
|
+
method: 'POST',
|
|
26
|
+
body: formData
|
|
27
|
+
});
|
|
28
|
+
config.onSuccess?.(response.file);
|
|
29
|
+
return response.file;
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
const errorMsg = err.data?.message || 'Upload failed';
|
|
33
|
+
error.value = errorMsg;
|
|
34
|
+
config.onError?.(new Error(errorMsg));
|
|
35
|
+
throw err;
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
uploading.value = false;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const uploadMultipleFiles = async (files) => {
|
|
42
|
+
const fileArray = Array.from(files);
|
|
43
|
+
const results = [];
|
|
44
|
+
for (const file of fileArray) {
|
|
45
|
+
try {
|
|
46
|
+
const result = await uploadToServer(file);
|
|
47
|
+
results.push(result);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
results.push({ error: err.message });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return results;
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
uploading: readonly(uploading),
|
|
57
|
+
progress: readonly(progress),
|
|
58
|
+
error: readonly(error),
|
|
59
|
+
uploadToServer,
|
|
60
|
+
uploadMultipleFiles
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLivePreview(): any;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function useLivePreview() {
|
|
2
|
+
return usePreviewMode({
|
|
3
|
+
// Enable preview mode when both preview and token params exist in URL
|
|
4
|
+
shouldEnable: () => {
|
|
5
|
+
const route = useRoute();
|
|
6
|
+
return !!route.query.preview && !!route.query.token;
|
|
7
|
+
},
|
|
8
|
+
// Store the token from the URL for use in API calls
|
|
9
|
+
getState: (currentState) => {
|
|
10
|
+
const route = useRoute();
|
|
11
|
+
return {
|
|
12
|
+
token: route.query.token || currentState.token,
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// composables/useLoading.ts
|
|
2
|
+
export const useLoading = () => {
|
|
3
|
+
const loading = ref(false);
|
|
4
|
+
const loadingText = ref('');
|
|
5
|
+
const startLoading = (text = 'Loading...') => {
|
|
6
|
+
loading.value = true;
|
|
7
|
+
loadingText.value = text;
|
|
8
|
+
};
|
|
9
|
+
const stopLoading = () => {
|
|
10
|
+
loading.value = false;
|
|
11
|
+
loadingText.value = '';
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
loading,
|
|
15
|
+
loadingText,
|
|
16
|
+
startLoading,
|
|
17
|
+
stopLoading
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface Notification {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
date: string;
|
|
6
|
+
type: 'order' | 'account' | 'social' | 'system';
|
|
7
|
+
isRead: boolean;
|
|
8
|
+
source: 'magento' | 'directus';
|
|
9
|
+
payload?: any;
|
|
10
|
+
}
|
|
11
|
+
export declare function useNotifications(): {
|
|
12
|
+
notifications: import("vue").Ref<{
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
content: string;
|
|
16
|
+
date: string;
|
|
17
|
+
type: "order" | "account" | "social" | "system";
|
|
18
|
+
isRead: boolean;
|
|
19
|
+
source: "magento" | "directus";
|
|
20
|
+
payload?: any;
|
|
21
|
+
}[], Notification[] | {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
content: string;
|
|
25
|
+
date: string;
|
|
26
|
+
type: "order" | "account" | "social" | "system";
|
|
27
|
+
isRead: boolean;
|
|
28
|
+
source: "magento" | "directus";
|
|
29
|
+
payload?: any;
|
|
30
|
+
}[]>;
|
|
31
|
+
unreadCount: import("vue").Ref<number, number>;
|
|
32
|
+
markAsRead: (notificationId: string, source: "magento" | "directus") => Promise<void>;
|
|
33
|
+
markAllAsRead: () => Promise<void>;
|
|
34
|
+
updateUnreadCount: () => void;
|
|
35
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { ref, onMounted } from 'vue';
|
|
2
|
+
import { useAsyncData, useNuxtApp } from '#imports';
|
|
3
|
+
export function useNotifications() {
|
|
4
|
+
const notifications = ref([]);
|
|
5
|
+
const unreadCount = ref(0);
|
|
6
|
+
const { $directus, $readItems, $updateItem } = useNuxtApp();
|
|
7
|
+
// Fetch notifications from Directus
|
|
8
|
+
const fetchDirectusNotifications = async () => {
|
|
9
|
+
try {
|
|
10
|
+
const { data } = await useAsyncData('directusNotifications', () => {
|
|
11
|
+
return $directus.request($readItems('notifications', {
|
|
12
|
+
filter: {
|
|
13
|
+
recipient: { _eq: 'current_user' }
|
|
14
|
+
},
|
|
15
|
+
sort: ['-date_created']
|
|
16
|
+
}));
|
|
17
|
+
});
|
|
18
|
+
if (data.value) {
|
|
19
|
+
const formattedNotifications = data.value.map((notification) => ({
|
|
20
|
+
id: String(notification.id),
|
|
21
|
+
title: String(notification.subject),
|
|
22
|
+
content: String(notification.message),
|
|
23
|
+
date: String(notification.timestamp),
|
|
24
|
+
type: (['order', 'account', 'social', 'system'].includes(notification.collection) ? notification.collection : 'system'),
|
|
25
|
+
isRead: notification.status === 'read',
|
|
26
|
+
source: 'directus',
|
|
27
|
+
payload: notification.item
|
|
28
|
+
}));
|
|
29
|
+
notifications.value = [...notifications.value, ...formattedNotifications];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error('Error fetching Directus notifications:', error);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
// Fetch notifications from Magento
|
|
37
|
+
const fetchMagentoNotifications = async () => {
|
|
38
|
+
try {
|
|
39
|
+
// Replace with your Magento API endpoint
|
|
40
|
+
const response = await fetch('/api/magento/notifications');
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
const text = await response.text().catch(() => '');
|
|
43
|
+
console.error('Magento notifications fetch failed', { status: response.status, body: text });
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const data = await response.json();
|
|
47
|
+
const formattedNotifications = data.map((notification) => ({
|
|
48
|
+
id: String(notification.id),
|
|
49
|
+
title: String(notification.title),
|
|
50
|
+
content: String(notification.message),
|
|
51
|
+
date: String(notification.created_at),
|
|
52
|
+
type: (['order', 'account', 'social', 'system'].includes(notification.type) ? notification.type : 'system'),
|
|
53
|
+
isRead: Boolean(notification.is_read),
|
|
54
|
+
source: 'magento',
|
|
55
|
+
payload: notification.payload
|
|
56
|
+
}));
|
|
57
|
+
notifications.value = [...notifications.value, ...formattedNotifications];
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error('Error fetching Magento notifications:', error?.message ?? String(error));
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
// Mark notification as read
|
|
64
|
+
const markAsRead = async (notificationId, source) => {
|
|
65
|
+
try {
|
|
66
|
+
if (source === 'directus') {
|
|
67
|
+
await $directus.request($updateItem('notifications', notificationId, {
|
|
68
|
+
status: 'read'
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
// Update Magento notification
|
|
73
|
+
await fetch(`/api/magento/notifications/${notificationId}/read`, {
|
|
74
|
+
method: 'POST'
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Update local state
|
|
78
|
+
const notification = notifications.value.find(n => n.id === notificationId);
|
|
79
|
+
if (notification) {
|
|
80
|
+
notification.isRead = true;
|
|
81
|
+
unreadCount.value = Math.max(0, unreadCount.value - 1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error('Error marking notification as read:', error);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
// Mark all notifications as read
|
|
89
|
+
const markAllAsRead = async () => {
|
|
90
|
+
try {
|
|
91
|
+
// Update Directus notifications
|
|
92
|
+
await $directus.request($updateItem('notifications', {
|
|
93
|
+
filter: {
|
|
94
|
+
recipient: { _eq: 'current_user' },
|
|
95
|
+
status: { _eq: 'inbox' }
|
|
96
|
+
},
|
|
97
|
+
data: {
|
|
98
|
+
status: 'read'
|
|
99
|
+
}
|
|
100
|
+
}));
|
|
101
|
+
// Update Magento notifications
|
|
102
|
+
await fetch('/api/magento/notifications/read-all', {
|
|
103
|
+
method: 'POST'
|
|
104
|
+
});
|
|
105
|
+
// Update local state
|
|
106
|
+
notifications.value.forEach(notification => {
|
|
107
|
+
notification.isRead = true;
|
|
108
|
+
});
|
|
109
|
+
unreadCount.value = 0;
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
console.error('Error marking all notifications as read:', error);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
// Calculate unread count
|
|
116
|
+
const updateUnreadCount = () => {
|
|
117
|
+
unreadCount.value = notifications.value.filter(n => !n.isRead).length;
|
|
118
|
+
};
|
|
119
|
+
onMounted(async () => {
|
|
120
|
+
await Promise.all([
|
|
121
|
+
fetchDirectusNotifications(),
|
|
122
|
+
fetchMagentoNotifications()
|
|
123
|
+
]);
|
|
124
|
+
updateUnreadCount();
|
|
125
|
+
});
|
|
126
|
+
return {
|
|
127
|
+
notifications,
|
|
128
|
+
unreadCount,
|
|
129
|
+
markAsRead,
|
|
130
|
+
markAllAsRead,
|
|
131
|
+
updateUnreadCount
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { RichText } from '@atproto/api';
|
|
2
|
+
// creating richtext
|
|
3
|
+
const rt = new RichText({
|
|
4
|
+
text: 'Hello @alice.com, check out this link: https://example.com',
|
|
5
|
+
});
|
|
6
|
+
await rt.detectFacets(agent); // automatically detects mentions and links
|
|
7
|
+
const postRecord = {
|
|
8
|
+
$type: 'app.bsky.feed.post',
|
|
9
|
+
text: rt.text,
|
|
10
|
+
facets: rt.facets,
|
|
11
|
+
createdAt: new Date().toISOString(),
|
|
12
|
+
};
|
|
13
|
+
// rendering as markdown
|
|
14
|
+
let markdown = '';
|
|
15
|
+
for (const segment of rt.segments()) {
|
|
16
|
+
if (segment.isLink()) {
|
|
17
|
+
markdown += `[${segment.text}](${segment.link?.uri})`;
|
|
18
|
+
}
|
|
19
|
+
else if (segment.isMention()) {
|
|
20
|
+
markdown += `[${segment.text}](https://my-bsky-app.com/user/${segment.mention?.did})`;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
markdown += segment.text;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// calculating string lengths
|
|
27
|
+
const rt2 = new RichText({ text: 'Hello' });
|
|
28
|
+
console.log(rt2.length); // => 5
|
|
29
|
+
console.log(rt2.graphemeLength); // => 5
|
|
30
|
+
const rt3 = new RichText({ text: '๐จโ๐ฉโ๐งโ๐ง' });
|
|
31
|
+
console.log(rt3.length); // => 25
|
|
32
|
+
console.log(rt3.graphemeLength); // => 1
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createServerRootMixin } from 'vue-instantsearch/vue3/es';
|
|
2
|
+
export default function useServerRootMixin(indexName) {
|
|
3
|
+
const nuxtApp = useNuxtApp();
|
|
4
|
+
const searchClient = useMeilisearch();
|
|
5
|
+
const serverRootMixin = ref(createServerRootMixin({
|
|
6
|
+
searchClient,
|
|
7
|
+
indexName
|
|
8
|
+
}));
|
|
9
|
+
// Install SSR mixin
|
|
10
|
+
nuxtApp.vueApp.mixin(serverRootMixin.value);
|
|
11
|
+
// TODO: ensure mixin is only installed once
|
|
12
|
+
return {
|
|
13
|
+
instantsearch: serverRootMixin.value.data().instantsearch
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PrimaryKey } from '@directus/types';
|
|
2
|
+
interface ApplyOptions {
|
|
3
|
+
directusUrl: string;
|
|
4
|
+
elements?: HTMLElement[] | HTMLElement;
|
|
5
|
+
onSaved?: (data: {
|
|
6
|
+
collection?: string;
|
|
7
|
+
item?: PrimaryKey | null;
|
|
8
|
+
payload?: Record<string, any>;
|
|
9
|
+
}) => void;
|
|
10
|
+
customClass?: string;
|
|
11
|
+
}
|
|
12
|
+
export default function useVisualEditing(): {
|
|
13
|
+
isVisualEditingEnabled: any;
|
|
14
|
+
apply: (options: Pick<ApplyOptions, "elements" | "onSaved" | "customClass">) => void;
|
|
15
|
+
setAttr: any;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { apply as applyVisualEditing, setAttr } from '@directus/visual-editing';
|
|
2
|
+
export default function useVisualEditing() {
|
|
3
|
+
// Use useState for state that persists across navigation
|
|
4
|
+
const isVisualEditingEnabled = useState('visual-editing-enabled', () => false);
|
|
5
|
+
const route = useRoute();
|
|
6
|
+
const { public: { enableVisualEditing, directusUrl }, } = useRuntimeConfig();
|
|
7
|
+
// Check query param on composable initialization.
|
|
8
|
+
if (route.query['visual-editing'] === 'true' && enableVisualEditing) {
|
|
9
|
+
isVisualEditingEnabled.value = true;
|
|
10
|
+
}
|
|
11
|
+
else if (route.query['visual-editing'] === 'false') {
|
|
12
|
+
isVisualEditingEnabled.value = false;
|
|
13
|
+
}
|
|
14
|
+
const apply = (options) => {
|
|
15
|
+
if (!isVisualEditingEnabled.value)
|
|
16
|
+
return;
|
|
17
|
+
applyVisualEditing({
|
|
18
|
+
...options,
|
|
19
|
+
directusUrl,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
isVisualEditingEnabled,
|
|
24
|
+
apply,
|
|
25
|
+
setAttr,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class MapperError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = 'MapperError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class MapperNotFoundError extends MapperError {
|
|
8
|
+
constructor(name) {
|
|
9
|
+
super(`Mapper "${name}" was not found`);
|
|
10
|
+
this.name = 'MapperNotFoundError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MapperDefinition } from './types';
|
|
2
|
+
export declare function registerMapper<TInput, TOutput>(mapper: MapperDefinition<TInput, TOutput>): void;
|
|
3
|
+
export declare function getMapper<TInput, TOutput>(name: string): MapperDefinition<TInput, TOutput>;
|
|
4
|
+
export declare function hasMapper(name: string): boolean;
|
|
5
|
+
export declare function listMappers(): string[];
|