@eldrajs/theme-cli 0.2.4 → 0.2.6
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/CHANGELOG.md +4 -0
- package/README.md +6 -0
- package/dist/cli.js +8 -2
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/{validate-FjQ-5_ne.js → validate-CC6Mp5i_.js} +2 -1
- package/package.json +3 -3
- package/template/.eldra/block-types.d.ts +1 -1
- package/template/.eldra/manifest.json +30 -2
- package/template/.eldra/previews.json +35 -35
- package/template/README.md +3 -1
- package/template/app/app.vue +16 -3
- package/template/app/assets/main.css +13 -15
- package/template/app/components/ui/UiImage.vue +29 -17
- package/template/app/components/ui/__tests__/UiImage.spec.ts +24 -15
- package/template/app/composables/useStorefront.ts +7 -2
- package/template/app/pages/[...slug].vue +1 -1
- package/template/app/plugins/eldra-storefront.ts +9 -0
- package/template/app/storefront/analytics.ts +15 -7
- package/template/app/storefront/cart.ts +228 -51
- package/template/app/storefront/commerce.ts +8 -2
- package/template/app/storefront/currency.ts +205 -0
- package/template/app/storefront/demo.ts +10 -2
- package/template/app/storefront/feedback.ts +2 -0
- package/template/app/storefront/gateway.ts +153 -35
- package/template/app/storefront/money.ts +6 -18
- package/template/app/storefront/structuredData.ts +16 -5
- package/template/app/storefront/toProductCard.ts +14 -14
- package/template/app/storefront/types.ts +13 -0
- package/template/app/storefront/volatile.ts +4 -0
- package/template/app/utils/seoInput.ts +4 -3
- package/template/blocks/announcement-bar/Block.vue +3 -2
- package/template/blocks/announcement-bar/__tests__/Block.spec.ts +1 -1
- package/template/blocks/announcement-bar/preview.png +0 -0
- package/template/blocks/article/Block.vue +3 -4
- package/template/blocks/article/preview.png +0 -0
- package/template/blocks/article-list/Block.vue +18 -9
- package/template/blocks/article-list/preview.png +0 -0
- package/template/blocks/breadcrumbs/Block.vue +1 -1
- package/template/blocks/breadcrumbs/__tests__/Block.spec.ts +9 -9
- package/template/blocks/breadcrumbs/preview.png +0 -0
- package/template/blocks/cart/Block.vue +42 -23
- package/template/blocks/cart/__tests__/Block.spec.ts +2 -3
- package/template/blocks/cart/__tests__/loadFailed.spec.ts +135 -0
- package/template/blocks/cart/__tests__/notSold.spec.ts +109 -0
- package/template/blocks/cart/parts/CartLines.vue +16 -3
- package/template/blocks/cart/parts/CheckoutButton.vue +45 -0
- package/template/blocks/cart/parts/LoadFailed.vue +37 -0
- package/template/blocks/cart/parts/NotSoldNotice.vue +69 -0
- package/template/blocks/cart/parts/ShippingBar.vue +1 -1
- package/template/blocks/cart/parts/Summary.vue +14 -30
- package/template/blocks/cart/parts/notSold.ts +19 -0
- package/template/blocks/cart/preview.png +0 -0
- package/template/blocks/collection-grid/Block.vue +26 -16
- package/template/blocks/collection-grid/__tests__/Block.spec.ts +26 -14
- package/template/blocks/collection-grid/preview.png +0 -0
- package/template/blocks/collection-header/Block.vue +5 -5
- package/template/blocks/collection-header/preview.png +0 -0
- package/template/blocks/contact/Block.vue +1 -1
- package/template/blocks/contact/__tests__/Block.spec.ts +2 -2
- package/template/blocks/contact/preview.png +0 -0
- package/template/blocks/cta/Block.vue +16 -18
- package/template/blocks/cta/__tests__/Block.spec.ts +8 -12
- package/template/blocks/cta/preview.png +0 -0
- package/template/blocks/faq/Block.vue +3 -13
- package/template/blocks/faq/__tests__/Block.spec.ts +2 -2
- package/template/blocks/faq/preview.png +0 -0
- package/template/blocks/feature-grid/Block.vue +1 -1
- package/template/blocks/feature-grid/__tests__/Block.spec.ts +1 -1
- package/template/blocks/feature-grid/preview.png +0 -0
- package/template/blocks/footer/Block.vue +33 -55
- package/template/blocks/footer/__tests__/Block.spec.ts +5 -5
- package/template/blocks/footer/preview.png +0 -0
- package/template/blocks/form/Block.vue +1 -1
- package/template/blocks/form/preview.png +0 -0
- package/template/blocks/gallery/__tests__/Block.spec.ts +1 -1
- package/template/blocks/gallery/preview.png +0 -0
- package/template/blocks/hero/Block.vue +8 -11
- package/template/blocks/hero/__tests__/Block.spec.ts +9 -7
- package/template/blocks/hero/preview.png +0 -0
- package/template/blocks/image/Block.vue +4 -4
- package/template/blocks/image/__tests__/Block.spec.ts +5 -6
- package/template/blocks/image/preview.png +0 -0
- package/template/blocks/logo-cloud/__tests__/Block.spec.ts +1 -1
- package/template/blocks/logo-cloud/preview.png +0 -0
- package/template/blocks/navigation/Block.vue +55 -29
- package/template/blocks/navigation/__tests__/Block.spec.ts +22 -20
- package/template/blocks/navigation/preview.png +0 -0
- package/template/blocks/newsletter/__tests__/Block.spec.ts +1 -1
- package/template/blocks/newsletter/preview.png +0 -0
- package/template/blocks/order-status/Block.vue +23 -15
- package/template/blocks/order-status/__tests__/Block.spec.ts +1 -2
- package/template/blocks/order-status/preview.png +0 -0
- package/template/blocks/pricing-table/__tests__/Block.spec.ts +1 -1
- package/template/blocks/pricing-table/preview.png +0 -0
- package/template/blocks/product-carousel/Block.vue +11 -8
- package/template/blocks/product-carousel/__tests__/Block.spec.ts +26 -8
- package/template/blocks/product-carousel/preview.png +0 -0
- package/template/blocks/product-detail/Block.vue +54 -18
- package/template/blocks/product-detail/__tests__/Block.spec.ts +79 -2
- package/template/blocks/product-detail/parts/Gallery.vue +1 -1
- package/template/blocks/product-detail/preview.png +0 -0
- package/template/blocks/quote/Block.vue +1 -1
- package/template/blocks/quote/__tests__/Block.spec.ts +7 -4
- package/template/blocks/quote/preview.png +0 -0
- package/template/blocks/rich-text/preview.png +0 -0
- package/template/blocks/search/Block.vue +10 -4
- package/template/blocks/search/PopularChips.vue +1 -1
- package/template/blocks/search/TypeSection.vue +8 -2
- package/template/blocks/search/preview.png +0 -0
- package/template/blocks/search/results.ts +5 -2
- package/template/blocks/split-content/Block.vue +2 -3
- package/template/blocks/split-content/__tests__/Block.spec.ts +2 -2
- package/template/blocks/split-content/preview.png +0 -0
- package/template/blocks/stats/__tests__/Block.spec.ts +1 -1
- package/template/blocks/stats/preview.png +0 -0
- package/template/blocks/tabs/Block.vue +4 -5
- package/template/blocks/tabs/__tests__/Block.spec.ts +2 -2
- package/template/blocks/tabs/preview.png +0 -0
- package/template/blocks/team/preview.png +0 -0
- package/template/blocks/testimonials/Block.vue +10 -9
- package/template/blocks/testimonials/__tests__/Block.spec.ts +1 -1
- package/template/blocks/testimonials/preview.png +0 -0
- package/template/blocks/timeline/__tests__/Block.spec.ts +2 -2
- package/template/blocks/timeline/preview.png +0 -0
- package/template/blocks/trust-strip/Block.vue +1 -1
- package/template/blocks/trust-strip/__tests__/Block.spec.ts +1 -1
- package/template/blocks/trust-strip/preview.png +0 -0
- package/template/blocks/video-embed/Block.vue +3 -3
- package/template/blocks/video-embed/__tests__/Block.spec.ts +1 -1
- package/template/blocks/video-embed/preview.png +0 -0
- package/template/blocks/wishlist/Block.vue +6 -2
- package/template/blocks/wishlist/preview.png +0 -0
- package/template/i18n/en-US.json +19 -3
- package/template/i18n/is-IS.json +19 -3
- package/template/nuxt.config.ts +5 -4
- package/template/package.json +1 -0
- package/template/stories/pages/article.stories.ts +2 -3
- package/template/stories/pages/cart.stories.ts +2 -3
- package/template/stories/pages/category.stories.ts +2 -3
- package/template/stories/pages/collection.stories.ts +2 -3
- package/template/stories/pages/home.stories.ts +2 -3
- package/template/stories/pages/product.stories.ts +3 -4
- package/template/stories/pages/products.stories.ts +2 -3
- package/template/stories/pages/search.stories.ts +2 -3
- package/template/stories/pages/wishlist.stories.ts +2 -3
- package/template/test/carouselKeyboard.spec.ts +2 -2
- package/template/test/carouselRing.browser.spec.ts +2 -2
- package/template/test/carouselSlideWidth.browser.spec.ts +9 -9
- package/template/test/currencyPicker.spec.ts +66 -0
- package/template/test/eldraIcon.spec.ts +1 -1
- package/template/test/mainCss.spec.ts +7 -0
- package/template/test/pages/article.spec.ts +5 -5
- package/template/test/pages/collection.spec.ts +5 -5
- package/template/test/pages/hydration.spec.ts +10 -10
- package/template/test/prerenderRefresh.browser.spec.ts +1 -1
- package/template/test/seoInput.spec.ts +22 -0
- package/template/test/storefront/analytics.spec.ts +15 -0
- package/template/test/storefront/cart.spec.ts +4 -4
- package/template/test/storefront/currency.spec.ts +549 -0
- package/template/test/storefront/currencyStore.spec.ts +845 -0
- package/template/test/storefront/gateway.spec.ts +22 -0
- package/template/test/storefront/money.spec.ts +2 -8
- package/template/test/storefront/structuredData.spec.ts +45 -0
- package/template/test/storefront/toProductCard.spec.ts +1 -1
- package/template/test/storefront/volatile.spec.ts +11 -0
- package/template/test/support/mountPage.ts +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
5
5
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
|
|
8
|
+
- `eldra-theme types` asks the gateway for the `declare module '@eldrajs/sdk'` augmentation and
|
|
9
|
+
writes it with the CMS types, so `product.extensions` is typed through the SDK's
|
|
10
|
+
`EldraProductExtensions` registry (WS-434, contract 6.1.0). It is on by default;
|
|
11
|
+
`--no-sdk-augmentation` leaves it out, for a project that does not depend on `@eldrajs/sdk`.
|
|
8
12
|
- `eldra-theme deploy` explains a 413 whose body is not JSON instead of printing `gateway responded 413`: a proxy or CDN in front of the API may have refused the upload as too large, with the platform's own artifact limits for comparison.
|
|
9
13
|
- `eldra-theme init` scaffolds a starter whose `studioOrigins` default to production Studio (`https://eldra.app`) instead of `https://localhost:4311`, so a deploy that forgets `ELDRA_STUDIO_ORIGIN` still lets production Studio connect to the preview rather than failing silently; `ELDRA_STUDIO_ORIGIN` accepts a comma-separated list.
|
|
10
14
|
- `eldra-theme validate` and the plugin build fail naming `package.json: eldra.themeId` when a theme
|
package/README.md
CHANGED
|
@@ -19,6 +19,12 @@ pnpm exec eldra-theme types --schemas page,hero --out generated/eldra.d.ts
|
|
|
19
19
|
pnpm exec eldra-theme deploy
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
`eldra-theme types` writes the org's CMS schema types, including a `declare module '@eldrajs/sdk'`
|
|
23
|
+
block that fills the SDK's `EldraProductExtensions` registry, so `product.extensions` is typed. Pass
|
|
24
|
+
`--no-sdk-augmentation` in a project that does not depend on `@eldrajs/sdk`; the file then has plain
|
|
25
|
+
interfaces only and never names a module the project cannot resolve. `eldra-theme types --blocks`
|
|
26
|
+
writes only `.eldra/block-types.d.ts`, from the theme's `block.json` files, with no gateway.
|
|
27
|
+
|
|
22
28
|
See [docs/themes.md](../../docs/themes.md) for the full theme integration guide.
|
|
23
29
|
|
|
24
30
|
## Development
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as initTheme, i as scaffoldBlock, n as generateBlockTypesFile, o as DeployError, r as generateTypes, s as deployTheme, t as validateTheme } from "./validate-
|
|
2
|
+
import { a as initTheme, i as scaffoldBlock, n as generateBlockTypesFile, o as DeployError, r as generateTypes, s as deployTheme, t as validateTheme } from "./validate-CC6Mp5i_.js";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { defineCommand, runMain } from "citty";
|
|
5
5
|
// src/cli.ts
|
|
@@ -116,6 +116,11 @@ const main = defineCommand({
|
|
|
116
116
|
default: false,
|
|
117
117
|
description: "Write only .eldra/block-types.d.ts from blocks/*/block.json (no gateway)"
|
|
118
118
|
},
|
|
119
|
+
"sdk-augmentation": {
|
|
120
|
+
type: "boolean",
|
|
121
|
+
default: true,
|
|
122
|
+
description: "Leave out the declare module '@eldrajs/sdk' block that types product extensions (for a project that does not depend on @eldrajs/sdk)"
|
|
123
|
+
},
|
|
119
124
|
...gatewayArgs
|
|
120
125
|
},
|
|
121
126
|
async run({ args }) {
|
|
@@ -139,7 +144,8 @@ const main = defineCommand({
|
|
|
139
144
|
gatewayUrl,
|
|
140
145
|
orgId,
|
|
141
146
|
out: String(args.out),
|
|
142
|
-
schemas: typeof args.schemas === "string" ? args.schemas.split(",").map((schema) => schema.trim()).filter(Boolean) : void 0
|
|
147
|
+
schemas: typeof args.schemas === "string" ? args.schemas.split(",").map((schema) => schema.trim()).filter(Boolean) : void 0,
|
|
148
|
+
sdkAugmentation: args["sdk-augmentation"] !== false
|
|
143
149
|
});
|
|
144
150
|
console.log(`wrote ${target}`);
|
|
145
151
|
} catch (error) {
|
package/dist/index.d.ts
CHANGED
|
@@ -133,6 +133,12 @@ export declare function generateTypes(opts: {
|
|
|
133
133
|
orgId: string;
|
|
134
134
|
out: string;
|
|
135
135
|
schemas?: string[];
|
|
136
|
+
/**
|
|
137
|
+
* Ask for the `declare module '@eldrajs/sdk'` block that fills `EldraProductExtensions`. On by
|
|
138
|
+
* default, since a theme normally depends on the SDK; turn it off for a project that does not,
|
|
139
|
+
* which could not resolve that module.
|
|
140
|
+
*/
|
|
141
|
+
sdkAugmentation?: boolean;
|
|
136
142
|
fetch?: typeof globalThis.fetch;
|
|
137
143
|
}): Promise<string>;
|
|
138
144
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as initTheme, c as detectCommitSha, i as scaffoldBlock, l as fieldMigrationLines, n as generateBlockTypesFile, o as DeployError, r as generateTypes, s as deployTheme, t as validateTheme } from "./validate-
|
|
1
|
+
import { a as initTheme, c as detectCommitSha, i as scaffoldBlock, l as fieldMigrationLines, n as generateBlockTypesFile, o as DeployError, r as generateTypes, s as deployTheme, t as validateTheme } from "./validate-CC6Mp5i_.js";
|
|
2
2
|
import { scanTheme } from "@eldrajs/vite-plugin-theme/scan";
|
|
3
3
|
export { DeployError, deployTheme, detectCommitSha, fieldMigrationLines, generateBlockTypesFile, generateTypes, initTheme, scaffoldBlock, scanTheme, validateTheme };
|
|
@@ -407,7 +407,8 @@ async function generateTypes(opts) {
|
|
|
407
407
|
fetch: opts.fetch
|
|
408
408
|
}).getTypeScriptDefinitions({
|
|
409
409
|
schemas: opts.schemas,
|
|
410
|
-
moduleName: "Eldra"
|
|
410
|
+
moduleName: "Eldra",
|
|
411
|
+
sdkAugmentation: opts.sdkAugmentation ?? true
|
|
411
412
|
});
|
|
412
413
|
const target = resolve(opts.themeDir, opts.out);
|
|
413
414
|
mkdirSync(dirname(target), { recursive: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrajs/theme-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "CLI for Eldra themes: init from the starter, scaffold blocks, validate, generate types, deploy a static build to Eldra.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"citty": "^0.1.6",
|
|
44
44
|
"tar": "^7.4.3",
|
|
45
|
-
"@eldrajs/theme
|
|
46
|
-
"@eldrajs/
|
|
45
|
+
"@eldrajs/vite-plugin-theme": "^0.3.5",
|
|
46
|
+
"@eldrajs/theme-core": "^0.3.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"execa": "^9.5.2"
|
|
@@ -432,7 +432,7 @@ declare global {
|
|
|
432
432
|
|
|
433
433
|
/** The theme's own message keys (`i18n/<tag>.json`'s default locale),
|
|
434
434
|
* flattened to dotted paths — vue-i18n's `t()` argument. */
|
|
435
|
-
type MessageKey = 'announcement.dismiss' | 'announcement.hintHelp' | 'announcement.hintLabel' | 'announcement.region' | 'article.authorHintHelp' | 'article.authorHintLabel' | 'article.bodyHintHelp' | 'article.bodyHintLabel' | 'article.byline' | 'article.coverHintHelp' | 'article.coverHintLabel' | 'article.dekHintLabel' | 'article.metaHintLabel' | 'article.richTextTableLabel' | 'article.titleHintLabel' | 'articleList.filterNav' | 'articleList.headingHintHelp' | 'articleList.headingHintLabel' | 'articleList.itemsHintHelp' | 'articleList.itemsHintLabel' | 'articleList.pages' | 'breadcrumbs.hintHelp' | 'breadcrumbs.hintLabel' | 'breadcrumbs.home' | 'cart.added' | 'cart.applied' | 'cart.apply' | 'cart.applyFailed' | 'cart.applyUnsupported' | 'cart.awayFromFree' | 'cart.checkout' | 'cart.columnProduct' | 'cart.columnQuantity' | 'cart.columnTotal' | 'cart.continueShopping' | 'cart.discount' | 'cart.discountCode' | 'cart.discountPlaceholder' | 'cart.drawerHintHelp' | 'cart.drawerHintHosted' | 'cart.drawerHintLabel' | 'cart.each' | 'cart.emptyFallbackTitle' | 'cart.freeUnlocked' | 'cart.invalidCode' | 'cart.itemCountMany' | 'cart.itemCountOne' | 'cart.items' | 'cart.lineTotal' | 'cart.paymentsAccepted' | 'cart.quantityFor' | 'cart.removeCode' | 'cart.removeItem' | 'cart.removeItemVariant' | 'cart.removed' | 'cart.shipping' | 'cart.shippingFree' | 'cart.shippingPending' | 'cart.subtotal' | 'cart.summary' | 'cart.title' | 'cart.total' | 'cart.undo' | 'cart.viewCart' | 'collection.countMany' | 'collection.countOne' | 'collection.readLess' | 'collection.readMore' | 'collection.subcategories' | 'collection.subcollections' | 'collection.titleHintHelp' | 'collection.titleHintLabel' | 'contact.addressLabel' | 'contact.detailsHintHelp' | 'contact.detailsHintLabel' | 'contact.emailFieldLabel' | 'contact.emailInvalidError' | 'contact.emailLabel' | 'contact.formTitleDefault' | 'contact.headingHintHelp' | 'contact.headingHintLabel' | 'contact.hoursLabel' | 'contact.introHintLabel' | 'contact.mapHintHelp' | 'contact.mapHintLabel' | 'contact.mapTitle' | 'contact.mapTitleWithAddress' | 'contact.messageLabel' | 'contact.messageRequiredError' | 'contact.nameLabel' | 'contact.nameRequiredError' | 'contact.orderNumberLabel' | 'contact.orderNumberPlaceholder' | 'contact.phoneLabel' | 'contact.replyTime' | 'contact.sendAnother' | 'contact.sendMessage' | 'contact.sending' | 'contact.serverError' | 'contact.serverErrorGeneric' | 'contact.successTextDefault' | 'contact.successTitle' | 'contact.summaryTitleMany' | 'contact.summaryTitleOne' | 'contact.topicLabel' | 'cta.buttonHintLabel' | 'cta.headingHintHelp' | 'cta.headingHintLabel' | 'cta.textHintLabel' | 'editor.addLink' | 'error' | 'faq.headingHintLabel' | 'faq.introHintLabel' | 'faq.itemHintHelp' | 'faq.itemHintLabel' | 'faq.richTextTableLabel' | 'featureGrid.fallbackLabel' | 'featureGrid.headingHintLabel' | 'featureGrid.imageHintLabel' | 'featureGrid.itemHintHelp' | 'featureGrid.itemHintLabel' | 'footer.currencyLabel' | 'footer.descriptionHintLabel' | 'footer.emailError' | 'footer.emailInvalid' | 'footer.emailLabel' | 'footer.groupsHintHelp' | 'footer.groupsHintLabel' | 'footer.localeLabel' | 'footer.nav' | 'footer.newsletterAriaLabel' | 'footer.newsletterHintLabel' | 'footer.social.facebook' | 'footer.social.instagram' | 'footer.social.pinterest' | 'footer.social.tiktok' | 'footer.social.youtube' | 'footer.socialLinkName' | 'footer.subscribe' | 'footer.subscribed' | 'footer.subscribing' | 'footer.title' | 'form.formHintHelp' | 'form.formHintLabel' | 'form.headingHintLabel' | 'form.invalidEmail' | 'form.invalidForm' | 'form.invalidFormat' | 'form.invalidNumber' | 'form.invalidUrl' | 'form.loadFailed' | 'form.loading' | 'form.rateLimited' | 'form.required' | 'form.requiredCheckbox' | 'form.richTextTableLabel' | 'form.selectPlaceholder' | 'form.sendAnother' | 'form.submit' | 'form.submitting' | 'form.successTitle' | 'form.successTitlePending' | 'form.tooLarge' | 'form.tooLong' | 'form.tooShort' | 'form.turnstileFailed' | 'form.turnstileRequired' | 'form.unavailable' | 'form.unsupported' | 'gallery.carouselFallback' | 'gallery.headingHintHelp' | 'gallery.headingHintLabel' | 'gallery.imageHintLabel' | 'gallery.itemsHintHelp' | 'gallery.itemsHintLabel' | 'gallery.viewLarger' | 'gallery.viewer' | 'gallery.viewerHeading' | 'grid.activeFilters' | 'grid.availabilityInStock' | 'grid.availabilityOutOfStock' | 'grid.clearAll' | 'grid.clearFilters' | 'grid.columns' | 'grid.filter' | 'grid.filters' | 'grid.legendAvailability' | 'grid.legendCategory' | 'grid.legendCollection' | 'grid.legendColour' | 'grid.legendSize' | 'grid.nActive' | 'grid.nProducts' | 'grid.noCategoryHelp' | 'grid.noCategoryLabel' | 'grid.noCollectionHelp' | 'grid.noCollectionLabel' | 'grid.noResultsTitle' | 'grid.nothingIn' | 'grid.oneProduct' | 'grid.pagination' | 'grid.price' | 'grid.products' | 'grid.productsNoun' | 'grid.sectionLabel' | 'grid.sortBestSelling' | 'grid.sortBy' | 'grid.sortFeatured' | 'grid.sortNewest' | 'grid.sortPriceAsc' | 'grid.sortPriceDesc' | 'grid.updating' | 'header.cartEmpty' | 'header.cartMany' | 'header.cartOne' | 'header.menu' | 'header.openMenu' | 'header.primary' | 'header.search' | 'header.searchField' | 'header.viewAll' | 'header.viewAllOf' | 'header.wishlistEmpty' | 'header.wishlistMany' | 'header.wishlistOne' | 'hero.buttonHintLabel' | 'hero.carouselFallback' | 'hero.headingHintHelp' | 'hero.headingHintLabel' | 'hero.imageHintLabel' | 'hero.subheadingHintLabel' | 'imageBlock.captionHintLabel' | 'imageBlock.hintHelp' | 'imageBlock.hintLabel' | 'loading' | 'logoCloud.headingHintHelp' | 'logoCloud.headingHintLabel' | 'logoCloud.itemHintHelp' | 'logoCloud.itemHintLabel' | 'logoCloud.linkContext' | 'nav.menu' | 'nav.skipToContent' | 'newsletter.consentCheckboxLabel' | 'newsletter.consentRequired' | 'newsletter.emailLabel' | 'newsletter.emailPlaceholder' | 'newsletter.failed' | 'newsletter.headingHintLabel' | 'newsletter.invalidEmail' | 'newsletter.richTextTableLabel' | 'newsletter.subscribe' | 'newsletter.subscribing' | 'newsletter.successTitle' | 'newsletter.textHintLabel' | 'notFound.back' | 'notFound.body' | 'notFound.eyebrow' | 'notFound.title' | 'order.cardEnding' | 'order.carrierEta' | 'order.completed' | 'order.deliveryAddress' | 'order.detailsLabel' | 'order.estimated' | 'order.inProgress' | 'order.items' | 'order.needHelp' | 'order.notYet' | 'order.number' | 'order.payment' | 'order.placedMany' | 'order.placedOne' | 'order.progress' | 'order.qty' | 'order.shipping' | 'order.shippingFree' | 'order.showAllItems' | 'order.statusPrefix' | 'order.subtotal' | 'order.tax' | 'order.total' | 'order.trackOpens' | 'order.trackPackage' | 'order.trackingNumber' | 'pricing.headingHintLabel' | 'pricing.included' | 'pricing.includedIn' | 'pricing.introHintLabel' | 'pricing.mostPopular' | 'pricing.notIncluded' | 'pricing.planHintHelp' | 'pricing.planHintLabel' | 'product.addToCart' | 'product.backorder' | 'product.backorderNote' | 'product.backorderPending' | 'product.backorderShips' | 'product.hintHelp' | 'product.hintLabel' | 'product.imageIndex' | 'product.images' | 'product.inStock' | 'product.information' | 'product.lowStockMany' | 'product.lowStockManyIn' | 'product.lowStockOne' | 'product.lowStockOneIn' | 'product.notifyEmail' | 'product.notifyInvalid' | 'product.notifyMe' | 'product.notifySubmit' | 'product.notifySuccess' | 'product.notifyTitle' | 'product.notifyUnsupported' | 'product.quantity' | 'product.quickAdd' | 'product.quickAddMeta' | 'product.removeFromWishlist' | 'product.restockNote' | 'product.saleBadge' | 'product.saveToWishlist' | 'product.saving' | 'product.showImage' | 'product.sizeGuide' | 'product.soldOut' | 'product.soldOutIn' | 'product.tabsLabel' | 'product.taxNote' | 'product.viewer' | 'product.zoom' | 'productCarousel.carouselLabel' | 'productCarousel.clearHistory' | 'productCarousel.headingHintHelp' | 'productCarousel.headingHintLabel' | 'productCarousel.viewAllContext' | 'quote.headingFor' | 'quote.nameHintLabel' | 'quote.quoteHintHelp' | 'quote.quoteHintLabel' | 'richTextBlock.bodyHintHelp' | 'richTextBlock.bodyHintLabel' | 'richTextBlock.headingHintHelp' | 'richTextBlock.headingHintLabel' | 'richTextBlock.richTextTableLabel' | 'search.all' | 'search.customersLove' | 'search.didYouMean' | 'search.headingHintHelp' | 'search.headingHintLabel' | 'search.idleTitle' | 'search.noResultsAdvice' | 'search.noResultsTitle' | 'search.pageMany' | 'search.pageOne' | 'search.popularHintHelp' | 'search.popularHintLabel' | 'search.popularSearches' | 'search.productMany' | 'search.productOne' | 'search.resultMany' | 'search.resultOne' | 'search.resultTabs' | 'search.resultsHeading' | 'search.searchLabel' | 'search.searching' | 'search.storyMany' | 'search.storyOne' | 'search.title' | 'search.typeJournal' | 'search.typePages' | 'search.typeProducts' | 'search.viewAllJournal' | 'search.viewAllPages' | 'search.viewAllProducts' | 'splitContent.headingHintHelp' | 'splitContent.headingHintLabel' | 'splitContent.imageHintLabel' | 'splitContent.label' | 'splitContent.richTextTableLabel' | 'stats.headingHintLabel' | 'stats.introHintLabel' | 'stats.itemHintHelp' | 'stats.itemHintLabel' | 'storefront.cartOutOfDate' | 'storefront.error' | 'storefront.loading' | 'storefront.mutationFailed' | 'storefront.notFound' | 'storefront.orderStatus.cancelled' | 'storefront.orderStatus.delayed' | 'storefront.orderStatus.delivered' | 'storefront.orderStatus.processing' | 'storefront.orderStatus.shipped' | 'storefront.orderSteps.delivered' | 'storefront.orderSteps.ordered' | 'storefront.orderSteps.packed' | 'storefront.orderSteps.shipped' | 'storefront.outOfStock' | 'storefront.unavailable' | 'storefront.unresolvedCollectionHelp' | 'storefront.unresolvedCollectionLabel' | 'storefront.updatingValues' | 'tabsBlock.headingHintLabel' | 'tabsBlock.introHintLabel' | 'tabsBlock.itemHintHelp' | 'tabsBlock.itemHintLabel' | 'tabsBlock.richTextTableLabel' | 'tabsBlock.tabPlaceholderLabel' | 'team.emailPerson' | 'team.headingHintHelp' | 'team.headingHintLabel' | 'team.itemHintHelp' | 'team.itemHintLabel' | 'team.onInstagram' | 'team.onPinterest' | 'team.onTiktok' | 'team.portraitOf' | 'team.website' | 'testimonials.carousel' | 'testimonials.headingHintHelp' | 'testimonials.headingHintLabel' | 'testimonials.itemHintHelp' | 'testimonials.itemHintLabel' | 'timeline.headingHintHelp' | 'timeline.headingHintLabel' | 'timeline.itemHintHelp' | 'timeline.itemHintLabel' | 'timeline.step' | 'trust.applePay' | 'trust.itemHintHelp' | 'trust.itemHintLabel' | 'trust.mastercard' | 'trust.payments' | 'trust.paypal' | 'trust.scrollRegion' | 'trust.title' | 'trust.visa' | 'ui.breadcrumbLabel' | 'ui.cancel' | 'ui.clear' | 'ui.clearRecent' | 'ui.clearSearch' | 'ui.close' | 'ui.closeLightbox' | 'ui.closeSearch' | 'ui.decrease' | 'ui.dismissNotification' | 'ui.done' | 'ui.error' | 'ui.filterPanelApplied' | 'ui.filterPanelClearAll' | 'ui.filterPanelLabel' | 'ui.filterPanelMax' | 'ui.filterPanelMin' | 'ui.filterPanelNoneAvailable' | 'ui.filterPanelOrMore' | 'ui.filterPanelShowFewer' | 'ui.filterPanelShowProducts' | 'ui.filterPanelSizeGuide' | 'ui.filterPanelTitle' | 'ui.from' | 'ui.increase' | 'ui.learnMore' | 'ui.lightboxImages' | 'ui.loadMore' | 'ui.loading' | 'ui.loadingProduct' | 'ui.maximum' | 'ui.minimum' | 'ui.multiSelectPlaceholder' | 'ui.newBadge' | 'ui.next' | 'ui.nextImage' | 'ui.nextPage' | 'ui.noImage' | 'ui.noImageAvailable' | 'ui.noResults' | 'ui.noReviews' | 'ui.noneSelected' | 'ui.notifications' | 'ui.opensInNewTab' | 'ui.optional' | 'ui.pagination' | 'ui.pause' | 'ui.play' | 'ui.popularSearches' | 'ui.previous' | 'ui.previousImage' | 'ui.previousPage' | 'ui.quantity' | 'ui.quickAddLabel' | 'ui.recentSearches' | 'ui.regularPrice' | 'ui.required' | 'ui.salePrice' | 'ui.search' | 'ui.searchAdvice' | 'ui.searchCollections' | 'ui.searchEscHint' | 'ui.searchJournal' | 'ui.searchLoading' | 'ui.searchMoveHint' | 'ui.searchOpenHint' | 'ui.searchProducts' | 'ui.searchSuggestions' | 'ui.searchTheShop' | 'ui.selectPlaceholder' | 'ui.selected' | 'ui.shortcutHint' | 'ui.slideInstructions' | 'ui.slides' | 'ui.soldOut' | 'ui.stockIn' | 'ui.stockistSite' | 'ui.to' | 'ui.tryAgain' | 'ui.updatingPrice' | 'ui.updatingStock' | 'video.errorLink' | 'video.errorText' | 'video.errorTitle' | 'video.headingHintLabel' | 'video.introHintLabel' | 'video.minuteMany' | 'video.minuteOne' | 'video.play' | 'video.playWithDuration' | 'video.privacyNoteDefault' | 'video.secondMany' | 'video.secondOne' | 'video.urlHintHelp' | 'video.urlHintLabel' | 'wishlist.continueShopping' | 'wishlist.editorHintHelp' | 'wishlist.editorHintLabel' | 'wishlist.emptyText' | 'wishlist.emptyTitle' | 'wishlist.itemCountMany' | 'wishlist.itemCountOne' | 'wishlist.items' | 'wishlist.removed' | 'wishlist.removedNamed' | 'wishlist.saved' | 'wishlist.title' | 'wishlist.view';
|
|
435
|
+
type MessageKey = 'announcement.dismiss' | 'announcement.hintHelp' | 'announcement.hintLabel' | 'announcement.region' | 'article.authorHintHelp' | 'article.authorHintLabel' | 'article.bodyHintHelp' | 'article.bodyHintLabel' | 'article.byline' | 'article.coverHintHelp' | 'article.coverHintLabel' | 'article.dekHintLabel' | 'article.metaHintLabel' | 'article.richTextTableLabel' | 'article.titleHintLabel' | 'articleList.filterNav' | 'articleList.headingHintHelp' | 'articleList.headingHintLabel' | 'articleList.itemsHintHelp' | 'articleList.itemsHintLabel' | 'articleList.pages' | 'breadcrumbs.hintHelp' | 'breadcrumbs.hintLabel' | 'breadcrumbs.home' | 'cart.added' | 'cart.applied' | 'cart.apply' | 'cart.applyFailed' | 'cart.applyUnsupported' | 'cart.awayFromFree' | 'cart.checkout' | 'cart.columnProduct' | 'cart.columnQuantity' | 'cart.columnTotal' | 'cart.continueShopping' | 'cart.discount' | 'cart.discountCode' | 'cart.discountPlaceholder' | 'cart.drawerHintHelp' | 'cart.drawerHintHosted' | 'cart.drawerHintLabel' | 'cart.each' | 'cart.emptyFallbackTitle' | 'cart.freeUnlocked' | 'cart.invalidCode' | 'cart.itemCountMany' | 'cart.itemCountOne' | 'cart.items' | 'cart.lineTotal' | 'cart.loadFailed' | 'cart.paymentsAccepted' | 'cart.quantityFor' | 'cart.removeCode' | 'cart.removeItem' | 'cart.removeItemVariant' | 'cart.removed' | 'cart.shipping' | 'cart.shippingFree' | 'cart.shippingPending' | 'cart.subtotal' | 'cart.summary' | 'cart.title' | 'cart.total' | 'cart.tryAgain' | 'cart.undo' | 'cart.viewCart' | 'collection.countMany' | 'collection.countOne' | 'collection.readLess' | 'collection.readMore' | 'collection.subcategories' | 'collection.subcollections' | 'collection.titleHintHelp' | 'collection.titleHintLabel' | 'contact.addressLabel' | 'contact.detailsHintHelp' | 'contact.detailsHintLabel' | 'contact.emailFieldLabel' | 'contact.emailInvalidError' | 'contact.emailLabel' | 'contact.formTitleDefault' | 'contact.headingHintHelp' | 'contact.headingHintLabel' | 'contact.hoursLabel' | 'contact.introHintLabel' | 'contact.mapHintHelp' | 'contact.mapHintLabel' | 'contact.mapTitle' | 'contact.mapTitleWithAddress' | 'contact.messageLabel' | 'contact.messageRequiredError' | 'contact.nameLabel' | 'contact.nameRequiredError' | 'contact.orderNumberLabel' | 'contact.orderNumberPlaceholder' | 'contact.phoneLabel' | 'contact.replyTime' | 'contact.sendAnother' | 'contact.sendMessage' | 'contact.sending' | 'contact.serverError' | 'contact.serverErrorGeneric' | 'contact.successTextDefault' | 'contact.successTitle' | 'contact.summaryTitleMany' | 'contact.summaryTitleOne' | 'contact.topicLabel' | 'cta.buttonHintLabel' | 'cta.headingHintHelp' | 'cta.headingHintLabel' | 'cta.textHintLabel' | 'currency.cartNotSold' | 'currency.cartWillSwitch' | 'currency.checkoutWithout' | 'currency.label' | 'currency.movedTo' | 'currency.notIncludedMany' | 'currency.notIncludedOne' | 'currency.notSoldIn' | 'currency.notSoldInLong' | 'currency.shopIn' | 'editor.addLink' | 'error' | 'faq.headingHintLabel' | 'faq.introHintLabel' | 'faq.itemHintHelp' | 'faq.itemHintLabel' | 'faq.richTextTableLabel' | 'featureGrid.fallbackLabel' | 'featureGrid.headingHintLabel' | 'featureGrid.imageHintLabel' | 'featureGrid.itemHintHelp' | 'featureGrid.itemHintLabel' | 'footer.currencyLabel' | 'footer.descriptionHintLabel' | 'footer.emailError' | 'footer.emailInvalid' | 'footer.emailLabel' | 'footer.groupsHintHelp' | 'footer.groupsHintLabel' | 'footer.localeLabel' | 'footer.nav' | 'footer.newsletterAriaLabel' | 'footer.newsletterHintLabel' | 'footer.social.facebook' | 'footer.social.instagram' | 'footer.social.pinterest' | 'footer.social.tiktok' | 'footer.social.youtube' | 'footer.socialLinkName' | 'footer.subscribe' | 'footer.subscribed' | 'footer.subscribing' | 'footer.title' | 'form.formHintHelp' | 'form.formHintLabel' | 'form.headingHintLabel' | 'form.invalidEmail' | 'form.invalidForm' | 'form.invalidFormat' | 'form.invalidNumber' | 'form.invalidUrl' | 'form.loadFailed' | 'form.loading' | 'form.rateLimited' | 'form.required' | 'form.requiredCheckbox' | 'form.richTextTableLabel' | 'form.selectPlaceholder' | 'form.sendAnother' | 'form.submit' | 'form.submitting' | 'form.successTitle' | 'form.successTitlePending' | 'form.tooLarge' | 'form.tooLong' | 'form.tooShort' | 'form.turnstileFailed' | 'form.turnstileRequired' | 'form.unavailable' | 'form.unsupported' | 'gallery.carouselFallback' | 'gallery.headingHintHelp' | 'gallery.headingHintLabel' | 'gallery.imageHintLabel' | 'gallery.itemsHintHelp' | 'gallery.itemsHintLabel' | 'gallery.viewLarger' | 'gallery.viewer' | 'gallery.viewerHeading' | 'grid.activeFilters' | 'grid.availabilityInStock' | 'grid.availabilityOutOfStock' | 'grid.clearAll' | 'grid.clearFilters' | 'grid.columns' | 'grid.filter' | 'grid.filters' | 'grid.legendAvailability' | 'grid.legendCategory' | 'grid.legendCollection' | 'grid.legendColour' | 'grid.legendSize' | 'grid.nActive' | 'grid.nProducts' | 'grid.noCategoryHelp' | 'grid.noCategoryLabel' | 'grid.noCollectionHelp' | 'grid.noCollectionLabel' | 'grid.noResultsTitle' | 'grid.nothingIn' | 'grid.oneProduct' | 'grid.pagination' | 'grid.price' | 'grid.products' | 'grid.productsNoun' | 'grid.sectionLabel' | 'grid.sortBestSelling' | 'grid.sortBy' | 'grid.sortFeatured' | 'grid.sortNewest' | 'grid.sortPriceAsc' | 'grid.sortPriceDesc' | 'grid.updating' | 'header.cart' | 'header.cartEmpty' | 'header.cartMany' | 'header.cartOne' | 'header.menu' | 'header.openMenu' | 'header.primary' | 'header.search' | 'header.searchField' | 'header.viewAll' | 'header.viewAllOf' | 'header.wishlistEmpty' | 'header.wishlistMany' | 'header.wishlistOne' | 'hero.buttonHintLabel' | 'hero.carouselFallback' | 'hero.headingHintHelp' | 'hero.headingHintLabel' | 'hero.imageHintLabel' | 'hero.subheadingHintLabel' | 'imageBlock.captionHintLabel' | 'imageBlock.hintHelp' | 'imageBlock.hintLabel' | 'loading' | 'logoCloud.headingHintHelp' | 'logoCloud.headingHintLabel' | 'logoCloud.itemHintHelp' | 'logoCloud.itemHintLabel' | 'logoCloud.linkContext' | 'nav.menu' | 'nav.skipToContent' | 'newsletter.consentCheckboxLabel' | 'newsletter.consentRequired' | 'newsletter.emailLabel' | 'newsletter.emailPlaceholder' | 'newsletter.failed' | 'newsletter.headingHintLabel' | 'newsletter.invalidEmail' | 'newsletter.richTextTableLabel' | 'newsletter.subscribe' | 'newsletter.subscribing' | 'newsletter.successTitle' | 'newsletter.textHintLabel' | 'notFound.back' | 'notFound.body' | 'notFound.eyebrow' | 'notFound.title' | 'order.cardEnding' | 'order.carrierEta' | 'order.completed' | 'order.deliveryAddress' | 'order.detailsLabel' | 'order.estimated' | 'order.inProgress' | 'order.items' | 'order.needHelp' | 'order.notYet' | 'order.number' | 'order.payment' | 'order.placedMany' | 'order.placedOne' | 'order.progress' | 'order.qty' | 'order.shipping' | 'order.shippingFree' | 'order.showAllItems' | 'order.statusPrefix' | 'order.subtotal' | 'order.tax' | 'order.total' | 'order.trackOpens' | 'order.trackPackage' | 'order.trackingNumber' | 'pricing.headingHintLabel' | 'pricing.included' | 'pricing.includedIn' | 'pricing.introHintLabel' | 'pricing.mostPopular' | 'pricing.notIncluded' | 'pricing.planHintHelp' | 'pricing.planHintLabel' | 'product.addToCart' | 'product.backorder' | 'product.backorderNote' | 'product.backorderPending' | 'product.backorderShips' | 'product.hintHelp' | 'product.hintLabel' | 'product.imageIndex' | 'product.images' | 'product.inStock' | 'product.information' | 'product.lowStockMany' | 'product.lowStockManyIn' | 'product.lowStockOne' | 'product.lowStockOneIn' | 'product.notifyEmail' | 'product.notifyInvalid' | 'product.notifyMe' | 'product.notifySubmit' | 'product.notifySuccess' | 'product.notifyTitle' | 'product.notifyUnsupported' | 'product.quantity' | 'product.quickAdd' | 'product.quickAddMeta' | 'product.removeFromWishlist' | 'product.restockNote' | 'product.saleBadge' | 'product.saveToWishlist' | 'product.saving' | 'product.showImage' | 'product.sizeGuide' | 'product.soldOut' | 'product.soldOutIn' | 'product.tabsLabel' | 'product.taxNote' | 'product.viewer' | 'product.zoom' | 'productCarousel.carouselLabel' | 'productCarousel.clearHistory' | 'productCarousel.headingHintHelp' | 'productCarousel.headingHintLabel' | 'productCarousel.viewAllContext' | 'quote.headingFor' | 'quote.nameHintLabel' | 'quote.quoteHintHelp' | 'quote.quoteHintLabel' | 'richTextBlock.bodyHintHelp' | 'richTextBlock.bodyHintLabel' | 'richTextBlock.headingHintHelp' | 'richTextBlock.headingHintLabel' | 'richTextBlock.richTextTableLabel' | 'search.all' | 'search.customersLove' | 'search.didYouMean' | 'search.headingHintHelp' | 'search.headingHintLabel' | 'search.idleTitle' | 'search.noResultsAdvice' | 'search.noResultsTitle' | 'search.pageMany' | 'search.pageOne' | 'search.popularHintHelp' | 'search.popularHintLabel' | 'search.popularSearches' | 'search.productMany' | 'search.productOne' | 'search.resultMany' | 'search.resultOne' | 'search.resultTabs' | 'search.resultsHeading' | 'search.searchLabel' | 'search.searching' | 'search.storyMany' | 'search.storyOne' | 'search.title' | 'search.typeJournal' | 'search.typePages' | 'search.typeProducts' | 'search.viewAllJournal' | 'search.viewAllPages' | 'search.viewAllProducts' | 'splitContent.headingHintHelp' | 'splitContent.headingHintLabel' | 'splitContent.imageHintLabel' | 'splitContent.label' | 'splitContent.richTextTableLabel' | 'stats.headingHintLabel' | 'stats.introHintLabel' | 'stats.itemHintHelp' | 'stats.itemHintLabel' | 'storefront.cartOutOfDate' | 'storefront.error' | 'storefront.loading' | 'storefront.mutationFailed' | 'storefront.notFound' | 'storefront.orderStatus.cancelled' | 'storefront.orderStatus.delayed' | 'storefront.orderStatus.delivered' | 'storefront.orderStatus.processing' | 'storefront.orderStatus.shipped' | 'storefront.orderSteps.delivered' | 'storefront.orderSteps.ordered' | 'storefront.orderSteps.packed' | 'storefront.orderSteps.shipped' | 'storefront.outOfStock' | 'storefront.unavailable' | 'storefront.unresolvedCollectionHelp' | 'storefront.unresolvedCollectionLabel' | 'storefront.updatingValues' | 'tabsBlock.headingHintLabel' | 'tabsBlock.introHintLabel' | 'tabsBlock.itemHintHelp' | 'tabsBlock.itemHintLabel' | 'tabsBlock.richTextTableLabel' | 'tabsBlock.tabPlaceholderLabel' | 'team.emailPerson' | 'team.headingHintHelp' | 'team.headingHintLabel' | 'team.itemHintHelp' | 'team.itemHintLabel' | 'team.onInstagram' | 'team.onPinterest' | 'team.onTiktok' | 'team.portraitOf' | 'team.website' | 'testimonials.carousel' | 'testimonials.headingHintHelp' | 'testimonials.headingHintLabel' | 'testimonials.itemHintHelp' | 'testimonials.itemHintLabel' | 'timeline.headingHintHelp' | 'timeline.headingHintLabel' | 'timeline.itemHintHelp' | 'timeline.itemHintLabel' | 'timeline.step' | 'trust.applePay' | 'trust.itemHintHelp' | 'trust.itemHintLabel' | 'trust.mastercard' | 'trust.payments' | 'trust.paypal' | 'trust.scrollRegion' | 'trust.title' | 'trust.visa' | 'ui.breadcrumbLabel' | 'ui.cancel' | 'ui.clear' | 'ui.clearRecent' | 'ui.clearSearch' | 'ui.close' | 'ui.closeLightbox' | 'ui.closeSearch' | 'ui.currencyPickerLabel' | 'ui.decrease' | 'ui.dismissNotification' | 'ui.done' | 'ui.error' | 'ui.filterPanelApplied' | 'ui.filterPanelClearAll' | 'ui.filterPanelLabel' | 'ui.filterPanelMax' | 'ui.filterPanelMin' | 'ui.filterPanelNoneAvailable' | 'ui.filterPanelOrMore' | 'ui.filterPanelShowFewer' | 'ui.filterPanelShowProducts' | 'ui.filterPanelSizeGuide' | 'ui.filterPanelTitle' | 'ui.from' | 'ui.increase' | 'ui.learnMore' | 'ui.lightboxImages' | 'ui.loadMore' | 'ui.loading' | 'ui.loadingProduct' | 'ui.maximum' | 'ui.minimum' | 'ui.multiSelectPlaceholder' | 'ui.newBadge' | 'ui.next' | 'ui.nextImage' | 'ui.nextPage' | 'ui.noImage' | 'ui.noImageAvailable' | 'ui.noResults' | 'ui.noReviews' | 'ui.noneSelected' | 'ui.notifications' | 'ui.opensInNewTab' | 'ui.optional' | 'ui.pagination' | 'ui.pause' | 'ui.play' | 'ui.popularSearches' | 'ui.previous' | 'ui.previousImage' | 'ui.previousPage' | 'ui.quantity' | 'ui.quickAddLabel' | 'ui.recentSearches' | 'ui.regularPrice' | 'ui.required' | 'ui.salePrice' | 'ui.search' | 'ui.searchAdvice' | 'ui.searchCollections' | 'ui.searchEscHint' | 'ui.searchJournal' | 'ui.searchLoading' | 'ui.searchMoveHint' | 'ui.searchOpenHint' | 'ui.searchProducts' | 'ui.searchSuggestions' | 'ui.searchTheShop' | 'ui.selectPlaceholder' | 'ui.selected' | 'ui.shortcutHint' | 'ui.slideInstructions' | 'ui.slides' | 'ui.soldOut' | 'ui.stockIn' | 'ui.stockistSite' | 'ui.to' | 'ui.tryAgain' | 'ui.updatingPrice' | 'ui.updatingStock' | 'video.errorLink' | 'video.errorText' | 'video.errorTitle' | 'video.headingHintLabel' | 'video.introHintLabel' | 'video.minuteMany' | 'video.minuteOne' | 'video.play' | 'video.playWithDuration' | 'video.privacyNoteDefault' | 'video.secondMany' | 'video.secondOne' | 'video.urlHintHelp' | 'video.urlHintLabel' | 'wishlist.continueShopping' | 'wishlist.editorHintHelp' | 'wishlist.editorHintLabel' | 'wishlist.emptyText' | 'wishlist.emptyTitle' | 'wishlist.itemCountMany' | 'wishlist.itemCountOne' | 'wishlist.items' | 'wishlist.removed' | 'wishlist.removedNamed' | 'wishlist.saved' | 'wishlist.title' | 'wishlist.view';
|
|
436
436
|
}
|
|
437
437
|
|
|
438
438
|
export {};
|
|
@@ -8667,6 +8667,7 @@
|
|
|
8667
8667
|
"header.wishlistMany": "Wishlist, {count} items",
|
|
8668
8668
|
"header.viewAll": "View all",
|
|
8669
8669
|
"header.viewAllOf": "View all {label}",
|
|
8670
|
+
"header.cart": "Cart",
|
|
8670
8671
|
"editor.addLink": "Add a link",
|
|
8671
8672
|
"splitContent.label": "Our story",
|
|
8672
8673
|
"splitContent.imageHintLabel": "Choose an image",
|
|
@@ -8995,6 +8996,8 @@
|
|
|
8995
8996
|
"cart.drawerHintLabel": "The cart drawer opens from the header",
|
|
8996
8997
|
"cart.drawerHintHelp": "Shoppers open it with the bag button; nothing shows here until they do.",
|
|
8997
8998
|
"cart.drawerHintHosted": "The theme already opens one on every page, so this block adds nothing and can be removed.",
|
|
8999
|
+
"cart.loadFailed": "We couldn't load your cart.",
|
|
9000
|
+
"cart.tryAgain": "Try again",
|
|
8998
9001
|
"wishlist.saved": "Saved to wishlist",
|
|
8999
9002
|
"wishlist.removed": "Removed from wishlist",
|
|
9000
9003
|
"wishlist.view": "View wishlist",
|
|
@@ -9034,6 +9037,16 @@
|
|
|
9034
9037
|
"order.needHelp": "Need help?",
|
|
9035
9038
|
"order.trackingNumber": "Tracking number",
|
|
9036
9039
|
"order.carrierEta": "Estimated delivery {eta} with {carrier}.",
|
|
9040
|
+
"currency.label": "Currency",
|
|
9041
|
+
"currency.notSoldIn": "Not available in {currency}",
|
|
9042
|
+
"currency.notSoldInLong": "Not available in {currency}.",
|
|
9043
|
+
"currency.shopIn": "Shop in {currency}",
|
|
9044
|
+
"currency.cartNotSold": "{items} can't be bought in {currency}.",
|
|
9045
|
+
"currency.checkoutWithout": "Remove and check out",
|
|
9046
|
+
"currency.cartWillSwitch": "Your cart will switch to {currency}.",
|
|
9047
|
+
"currency.notIncludedOne": "1 item not included",
|
|
9048
|
+
"currency.notIncludedMany": "{count} items not included",
|
|
9049
|
+
"currency.movedTo": "Prices are now in {currency}.",
|
|
9037
9050
|
"ui.clear": "Clear",
|
|
9038
9051
|
"ui.close": "Close",
|
|
9039
9052
|
"ui.closeSearch": "Close search",
|
|
@@ -9114,7 +9127,8 @@
|
|
|
9114
9127
|
"ui.filterPanelMin": "Min",
|
|
9115
9128
|
"ui.filterPanelMax": "Max",
|
|
9116
9129
|
"ui.filterPanelOrMore": " or more",
|
|
9117
|
-
"ui.filterPanelShowProducts": "Show products"
|
|
9130
|
+
"ui.filterPanelShowProducts": "Show products",
|
|
9131
|
+
"ui.currencyPickerLabel": "Currency"
|
|
9118
9132
|
},
|
|
9119
9133
|
"is-IS": {
|
|
9120
9134
|
"notFound.eyebrow": "404",
|
|
@@ -9214,6 +9228,7 @@
|
|
|
9214
9228
|
"header.wishlistMany": "Óskalisti, {count} vörur",
|
|
9215
9229
|
"header.viewAll": "Sjá allt",
|
|
9216
9230
|
"header.viewAllOf": "Sjá allt: {label}",
|
|
9231
|
+
"header.cart": "Karfa",
|
|
9217
9232
|
"editor.addLink": "Bæta við tengli",
|
|
9218
9233
|
"splitContent.label": "Sagan okkar",
|
|
9219
9234
|
"splitContent.imageHintLabel": "Veldu mynd",
|
|
@@ -9542,6 +9557,8 @@
|
|
|
9542
9557
|
"cart.drawerHintLabel": "Karfan opnast úr hausnum",
|
|
9543
9558
|
"cart.drawerHintHelp": "Kaupendur opna hana með töskuhnappnum; hér sést ekkert fyrr en þeir gera það.",
|
|
9544
9559
|
"cart.drawerHintHosted": "Þemað opnar hana þegar á öllum síðum, svo þessi hluti gerir ekkert og má fjarlægja.",
|
|
9560
|
+
"cart.loadFailed": "Ekki tókst að sækja körfuna.",
|
|
9561
|
+
"cart.tryAgain": "Reyna aftur",
|
|
9545
9562
|
"wishlist.saved": "Vistað á óskalista",
|
|
9546
9563
|
"wishlist.removed": "Fjarlægt af óskalista",
|
|
9547
9564
|
"wishlist.view": "Skoða óskalista",
|
|
@@ -9581,6 +9598,16 @@
|
|
|
9581
9598
|
"order.needHelp": "Þarftu aðstoð?",
|
|
9582
9599
|
"order.trackingNumber": "Sendingarnúmer",
|
|
9583
9600
|
"order.carrierEta": "Áætlaður afhendingartími {eta} með {carrier}.",
|
|
9601
|
+
"currency.label": "Gjaldmiðill",
|
|
9602
|
+
"currency.notSoldIn": "Ekki til sölu í {currency}",
|
|
9603
|
+
"currency.notSoldInLong": "Ekki til sölu í {currency}.",
|
|
9604
|
+
"currency.shopIn": "Skipta yfir í {currency}",
|
|
9605
|
+
"currency.cartNotSold": "Þetta fæst ekki keypt í {currency}: {items}.",
|
|
9606
|
+
"currency.checkoutWithout": "Fjarlægja og ganga frá kaupum",
|
|
9607
|
+
"currency.cartWillSwitch": "Karfan færist yfir í {currency}.",
|
|
9608
|
+
"currency.notIncludedOne": "1 vara ekki talin með",
|
|
9609
|
+
"currency.notIncludedMany": "{count} vörur ekki taldar með",
|
|
9610
|
+
"currency.movedTo": "Verð eru nú í {currency}.",
|
|
9584
9611
|
"ui.clear": "Hreinsa",
|
|
9585
9612
|
"ui.close": "Loka",
|
|
9586
9613
|
"ui.closeSearch": "Loka leit",
|
|
@@ -9661,7 +9688,8 @@
|
|
|
9661
9688
|
"ui.filterPanelMin": "Lágm.",
|
|
9662
9689
|
"ui.filterPanelMax": "Hám.",
|
|
9663
9690
|
"ui.filterPanelOrMore": " eða meira",
|
|
9664
|
-
"ui.filterPanelShowProducts": "Sýna vörur"
|
|
9691
|
+
"ui.filterPanelShowProducts": "Sýna vörur",
|
|
9692
|
+
"ui.currencyPickerLabel": "Gjaldmiðill"
|
|
9665
9693
|
}
|
|
9666
9694
|
}
|
|
9667
9695
|
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
"announcement-bar": "
|
|
3
|
-
"article": "
|
|
4
|
-
"article-list": "
|
|
5
|
-
"breadcrumbs": "
|
|
6
|
-
"cart": "
|
|
7
|
-
"collection-grid": "
|
|
8
|
-
"collection-header": "
|
|
9
|
-
"contact": "
|
|
10
|
-
"cta": "
|
|
11
|
-
"faq": "
|
|
12
|
-
"feature-grid": "
|
|
13
|
-
"footer": "
|
|
14
|
-
"form": "
|
|
15
|
-
"gallery": "
|
|
16
|
-
"hero": "
|
|
17
|
-
"image": "
|
|
18
|
-
"logo-cloud": "
|
|
19
|
-
"navigation": "
|
|
20
|
-
"newsletter": "
|
|
21
|
-
"order-status": "
|
|
22
|
-
"pricing-table": "
|
|
23
|
-
"product-carousel": "
|
|
24
|
-
"product-detail": "
|
|
25
|
-
"quote": "
|
|
26
|
-
"rich-text": "
|
|
27
|
-
"search": "
|
|
28
|
-
"split-content": "
|
|
29
|
-
"stats": "
|
|
30
|
-
"tabs": "
|
|
31
|
-
"team": "
|
|
32
|
-
"testimonials": "
|
|
33
|
-
"timeline": "
|
|
34
|
-
"trust-strip": "
|
|
35
|
-
"video-embed": "
|
|
36
|
-
"wishlist": "
|
|
2
|
+
"announcement-bar": "c9afe3ca53192bd788e724048eb4fa66bbff19d93f1fefbc63aa4e396b1a1f71",
|
|
3
|
+
"article": "46689140a4cc1e04b70bfa1c69fc8ac2ae8e5b0ce669e7a2c23157bb2ac79876",
|
|
4
|
+
"article-list": "c99dbf56425ed57161d348b28f67a23dcb609d9cf9b602da2995baea584070d6",
|
|
5
|
+
"breadcrumbs": "db7e456eec13ac6e6688fcd67b12cec63ffd876defdebd3085f28fdb5d8d6206",
|
|
6
|
+
"cart": "5e1e74eafc670eaa0ce39dc85bb9b9349d73a327e814fc38b45379903b2da8e3",
|
|
7
|
+
"collection-grid": "9c4603f5de2891b3f066c0532bbb480003f7eb2ee1834475e2bd2097f149d57d",
|
|
8
|
+
"collection-header": "e0f8c97068a4cfd20585d7c055244a1e078f52d9a6eef59373b09dfde7337bdc",
|
|
9
|
+
"contact": "c8e558e99456095a7b3a0eb6baa06aa4ba2d246839bae123d769c88b8958ada8",
|
|
10
|
+
"cta": "bb97e5de236bc8fb46bfd7fc8ac80a8b3167a21fa90dd2b728d843f72fc0e421",
|
|
11
|
+
"faq": "5f9b2fbd25c28048d2f5c36c2fd2855f76011597bf1aa75e81e1316753a7eeba",
|
|
12
|
+
"feature-grid": "5019b8af23b77e0cd1360dd021287923c462e26b42e065886c03fb111929dda0",
|
|
13
|
+
"footer": "6dcbe2f7349c0a4dd51b47746c5f69466fa17cfefa63ee92e13e06be03c2c0a4",
|
|
14
|
+
"form": "6ec0407c114b5de4490d9f691b13cab3657e3fcbf7e37ed20a7f86fce4c1c24e",
|
|
15
|
+
"gallery": "d3fa5b835a1707e607410f7ca8e245c13ba4c8bc69b4c84485cc80b6d336f921",
|
|
16
|
+
"hero": "62c6ad62978389ae977db134e7277b410e57f1143832013e97e1db820d114987",
|
|
17
|
+
"image": "4b0bc804f063d947099f950bd0c09b98a07ea63f45ddfde51c9cd356c8c09587",
|
|
18
|
+
"logo-cloud": "7e946206faffab98d73d692f326bc79f4100c6e4892eb63ed69ee61032545042",
|
|
19
|
+
"navigation": "12363a34c5fd3593d91a912ba43352edb9347b1fda7e6b903baa2c39b0470682",
|
|
20
|
+
"newsletter": "5718d21c8c234534ac97a911989fea31fbe7a7ffcdbf9069a290954476ecf386",
|
|
21
|
+
"order-status": "1a7b4d108117fe7c67789adf9b55796364c16ab9c8f5ab652ac40d6c49d6f80e",
|
|
22
|
+
"pricing-table": "43b16d3abea292d7878a2a2f86dc35a6a069d9fb934bdb601305ee9731afe020",
|
|
23
|
+
"product-carousel": "70cc990a853c3ac33394e26cf071966ce2ce2c58e7254b5650f83c25b1402fa2",
|
|
24
|
+
"product-detail": "7035f8f03e9e3e03e979b577e22410ec118d26a5e47d3e88d7372f46ca173589",
|
|
25
|
+
"quote": "d771f4097ca14d70320c90fd88c54d980a996c1fe43a4448ab10f89c2bfe6d3d",
|
|
26
|
+
"rich-text": "6062e831392f12e805968882a0edbfde00dfd1296d00395a3e9a27492a242118",
|
|
27
|
+
"search": "30c9627f44da0c88f289d63de62e639ed7553cea079dac5cbe5010acf058229a",
|
|
28
|
+
"split-content": "a10b26c39b12e350ac1a16521c13bdd9ec0baf7581fc7fa1e1c8263307efc2c2",
|
|
29
|
+
"stats": "22bbd1d98024ef1f2cf2e969fbe070bfda2b316d9319009721c6189384c7a43c",
|
|
30
|
+
"tabs": "3f054548e97dac4f6f69782824abb020e191e28c229ed560f366651cd55dd2cf",
|
|
31
|
+
"team": "532e5965c859aa33844e228f9be6329e635ecfa8cb5e1bd2af261b337377b593",
|
|
32
|
+
"testimonials": "ce60546dba65fefea8403ede13b9b590ebf7650976b09cb5b1d0f4ca4b365c20",
|
|
33
|
+
"timeline": "bfb25e247819c632e5f6e6ed79340f1ad54cd103883d0238e1ed6db94b4c5ca8",
|
|
34
|
+
"trust-strip": "337c79080c4af9f784e151b6221ab21e63b4324de75b266c5f6af6f15964eb5d",
|
|
35
|
+
"video-embed": "ff21253e4ad5abcc6d4b34ae930068f2493b1c404ab42608799dd70ce2c4481f",
|
|
36
|
+
"wishlist": "a5994d9744219233dfa0ab5932507bb4a57599e1113466e759661074f7c16341"
|
|
37
37
|
}
|
package/template/README.md
CHANGED
|
@@ -239,7 +239,9 @@ true`). Each id becomes a `--eldra-color-<id>` custom property, which is the _sa
|
|
|
239
239
|
- **`app/assets/main.css`** — `@import 'tailwindcss'` then `@import '@eldrajs/ui/tailwind.css'`,
|
|
240
240
|
which brings in the `--eldra-*` variables, the Tailwind `@theme` mapping over them
|
|
241
241
|
(`bg-primary`, `rounded-md`, `shadow-md`, `font-heading`, `text-body`, …) and the package's own
|
|
242
|
-
utilities
|
|
242
|
+
utilities, then `@import '@eldrajs/ui/components.css'`, the package's components prebuilt (every
|
|
243
|
+
class `eldra:`-prefixed, below this file's utilities, so a class a block puts on a component
|
|
244
|
+
wins). What is left in the file is the theme's own: the section spacing scale, the container
|
|
243
245
|
rules, the base layer and the rich-text typography. Edit it directly; there's no build step.
|
|
244
246
|
Fonts are `--eldra-font-heading` / `--eldra-font-body` — override them here (the package names
|
|
245
247
|
its two faces but never loads them).
|
package/template/app/app.vue
CHANGED
|
@@ -31,6 +31,7 @@ import { Link, Toaster, useToast } from '@eldrajs/ui';
|
|
|
31
31
|
import CartBlock from '../blocks/cart/Block.vue';
|
|
32
32
|
import EldraRouterLink from './components/EldraRouterLink.vue';
|
|
33
33
|
import { useStorefront } from './composables/useStorefront';
|
|
34
|
+
import { useStorefrontFeedback } from './composables/useStorefrontFeedback';
|
|
34
35
|
import { useI18n } from 'vue-i18n';
|
|
35
36
|
import { CART_ADD_TOAST_ID } from './storefront/feedback';
|
|
36
37
|
|
|
@@ -81,6 +82,20 @@ watch(
|
|
|
81
82
|
}
|
|
82
83
|
);
|
|
83
84
|
|
|
85
|
+
// A currency the visitor had was taken away (the shop stopped selling in it): said once, here, on any page.
|
|
86
|
+
const currency = useStorefront().currency;
|
|
87
|
+
watch(currency.movedTo, (code) => {
|
|
88
|
+
if (code === null) return;
|
|
89
|
+
toast.show({ id: 'currency-moved', title: t('currency.movedTo', { currency: code }) });
|
|
90
|
+
currency.movedTo.value = null;
|
|
91
|
+
});
|
|
92
|
+
const feedback = useStorefrontFeedback();
|
|
93
|
+
watch(currency.failure, (failure) => {
|
|
94
|
+
if (failure === null) return;
|
|
95
|
+
feedback.report(failure, { id: 'currency-move' });
|
|
96
|
+
currency.failure.value = null;
|
|
97
|
+
});
|
|
98
|
+
|
|
84
99
|
/**
|
|
85
100
|
* An `EldraBlockEntry` needs an id. This one is the theme's own, not a CMS entry id, and never
|
|
86
101
|
* reaches the gateway; it is the shell's own, distinct from any cart block on a page, so the two
|
|
@@ -114,9 +129,7 @@ const drawerEntry = computed(
|
|
|
114
129
|
href="#main"
|
|
115
130
|
:as="EldraRouterLink"
|
|
116
131
|
variant="standalone"
|
|
117
|
-
|
|
118
|
-
root: 'bg-primary text-primary-contrast rounded-md sr-only px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50',
|
|
119
|
-
}"
|
|
132
|
+
class="bg-primary text-primary-contrast sr-only rounded-md px-4 py-2 focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50"
|
|
120
133
|
>
|
|
121
134
|
{{ t('nav.skipToContent') }}
|
|
122
135
|
</Link>
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
@import 'tailwindcss';
|
|
2
|
-
/* `@eldrajs/ui`'s Tailwind entry: its `tokens.css` (`--eldra-*` — colours,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
only `@eldrajs/ui`'s own `dist/*.js` uses (a Button fill, an Input border)
|
|
9
|
-
would never be emitted here.
|
|
2
|
+
/* `@eldrajs/ui`'s Tailwind entry: its `tokens.css` (`--eldra-*` — colours, radii, spacing,
|
|
3
|
+
type, motion, z-index), the `@theme` block mapping those onto Tailwind's own namespaces
|
|
4
|
+
(`--color-primary`, `--radius-md`, `--font-heading`, …) and the package's custom utilities
|
|
5
|
+
(`eldra-focus`, `control-h`, `text-body`, …), for this theme's own markup. It builds none of the
|
|
6
|
+
package's components: those come prebuilt in `components.css` below, every class `eldra:`-
|
|
7
|
+
prefixed and in the `components` layer, so a class written here or on a component wins.
|
|
10
8
|
|
|
11
|
-
The colour variables it declares are the *defaults*; the theme's own token
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
names identical: that name match is the whole wiring. */
|
|
9
|
+
The colour variables it declares are the *defaults*; the theme's own token CSS
|
|
10
|
+
(`virtual:eldra/tokens.css`, generated from `tokens.json` by @eldrajs/theme-core's
|
|
11
|
+
`generateDesignTokenCss`) declares the same `--eldra-color-<role>` names on `:root` and is what
|
|
12
|
+
Studio edits, live (`useEldraPreview` appends its own `<style>` to `<head>`, which wins over
|
|
13
|
+
every stylesheet). Keep `tokens.json`'s colour ids and the package's role names identical:
|
|
14
|
+
that name match is the whole wiring. */
|
|
18
15
|
@import '@eldrajs/ui/tailwind.css';
|
|
16
|
+
@import '@eldrajs/ui/components.css';
|
|
19
17
|
|
|
20
18
|
/* Nuxt's Vite root is `app/`, and Tailwind's automatic source detection starts at that root, so
|
|
21
19
|
`blocks/` (a sibling of `app/`) is never scanned in the site build: every class only a block
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* default `'none'`) — the two presets the design spec's frame radius actually has.
|
|
35
35
|
* - **`fill`** is for a background image that has to cover its positioned ancestor (the hero
|
|
36
36
|
* `image-background` variant): it sets `ratio="auto"` and adds `absolute inset-0 h-full w-full`
|
|
37
|
-
* to
|
|
37
|
+
* to the root and `h-full w-full` to `classes.frame`, so the frame's own height tracks its
|
|
38
38
|
* *positioned ancestor* (via the `inset-0`/`h-full` chain) instead of trying to derive one from
|
|
39
39
|
* `media`, which this wrapper never has `width`/`height` for. `media`'s own `object-cover`
|
|
40
40
|
* (`Image`'s default) does the rest.
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
* the media, so the browser's replaced-element sizing algorithm scales the image down to fit
|
|
54
54
|
* inside both caps at once, the same thing the original bare `<img class="max-h-[85vh] w-auto
|
|
55
55
|
* object-contain">` did by being the frame itself).
|
|
56
|
-
* - **`classes`** is `Image`'s own `classes` prop, passed straight through
|
|
57
|
-
*
|
|
58
|
-
* wins
|
|
56
|
+
* - **`classes`** is `Image`'s own `classes` prop, passed straight through. `fill`/`fit`'s own
|
|
57
|
+
* classes and the caller's (`class` for the root, `classes` for a part) are all app utilities in
|
|
58
|
+
* one layer, so they are combined with `twMerge` and the caller's wins a conflict — the general escape hatch for a radius `rounded` has no preset for (`rounded-full`,
|
|
59
59
|
* `rounded-md`) or a frame-level size constraint neither `fill` nor `fit` covers on their own
|
|
60
60
|
* (the gallery lightbox's `max-h-[85vh]`).
|
|
61
61
|
*
|
|
@@ -65,10 +65,13 @@
|
|
|
65
65
|
* class landing on the `<img>` now use `rounded`/`fill`/`fit`/`classes` instead — see each block's
|
|
66
66
|
* own diff and `docs/starter-kit.md`'s `UiImage` row.
|
|
67
67
|
*/
|
|
68
|
-
import { computed } from 'vue';
|
|
69
|
-
import {
|
|
68
|
+
import { computed, normalizeClass, useAttrs } from 'vue';
|
|
69
|
+
import { twMerge } from 'tailwind-merge';
|
|
70
|
+
import { Image, type ImagePart, type ImageRatio } from '@eldrajs/ui';
|
|
70
71
|
import { imageFramingAttrs, type ImageFraming } from '@eldrajs/theme-vue';
|
|
71
72
|
|
|
73
|
+
defineOptions({ inheritAttrs: false });
|
|
74
|
+
|
|
72
75
|
const props = withDefaults(
|
|
73
76
|
defineProps<{
|
|
74
77
|
src: string;
|
|
@@ -98,8 +101,8 @@ const props = withDefaults(
|
|
|
98
101
|
/** `Image`'s media covers its frame by default (`cover`); `contain` letterboxes instead, for a
|
|
99
102
|
* full, uncropped view (a lightbox). */
|
|
100
103
|
fit?: 'cover' | 'contain';
|
|
101
|
-
/** Passed straight through to `Image`'s own `classes` prop, merged with whatever `
|
|
102
|
-
*
|
|
104
|
+
/** Passed straight through to `Image`'s own `classes` prop, merged with whatever `fill`/`fit`
|
|
105
|
+
* above already set — the caller's own value for a part always wins. */
|
|
103
106
|
classes?: Partial<Record<ImagePart, string>>;
|
|
104
107
|
}>(),
|
|
105
108
|
{
|
|
@@ -156,19 +159,27 @@ const CONTAIN_FRAME_CLASS = 'w-auto max-w-full';
|
|
|
156
159
|
* height exceeds that cap. */
|
|
157
160
|
const CONTAIN_MEDIA_CLASS = 'object-contain h-auto w-auto max-w-full max-h-[inherit]';
|
|
158
161
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
+
const attrs = useAttrs();
|
|
163
|
+
const forwardedAttrs = computed(() => {
|
|
164
|
+
const { class: _class, style: _style, ...rest } = attrs;
|
|
165
|
+
return rest;
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
/** `fill`'s root classes, then the caller's `class` on top (`twMerge`: the caller wins). */
|
|
169
|
+
const rootClass = computed(() =>
|
|
170
|
+
twMerge(props.fill ? FILL_ROOT_CLASS : '', normalizeClass(attrs.class))
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
/** `fill`/`fit` set `frame`/`media` first, the caller's `classes` on top; other parts pass through. */
|
|
162
174
|
const mergedClasses = computed<Partial<Record<ImagePart, string>>>(() => {
|
|
163
175
|
const base = props.classes ?? {};
|
|
164
176
|
const result: Partial<Record<ImagePart, string>> = { ...base };
|
|
165
177
|
if (props.fill) {
|
|
166
|
-
result.
|
|
167
|
-
result.frame = cx(FILL_FRAME_CLASS, base.frame);
|
|
178
|
+
result.frame = twMerge(FILL_FRAME_CLASS, base.frame);
|
|
168
179
|
}
|
|
169
180
|
if (props.fit === 'contain') {
|
|
170
|
-
result.frame =
|
|
171
|
-
result.media =
|
|
181
|
+
result.frame = twMerge(CONTAIN_FRAME_CLASS, result.frame ?? base.frame);
|
|
182
|
+
result.media = twMerge(CONTAIN_MEDIA_CLASS, base.media);
|
|
172
183
|
}
|
|
173
184
|
return result;
|
|
174
185
|
});
|
|
@@ -217,8 +228,9 @@ const framingDataAttrs = computed(() => {
|
|
|
217
228
|
:rounded="rounded"
|
|
218
229
|
:sizes="sizes"
|
|
219
230
|
:priority="priority"
|
|
231
|
+
v-bind="{ ...forwardedAttrs, ...framingDataAttrs }"
|
|
232
|
+
:class="rootClass || undefined"
|
|
220
233
|
:classes="mergedClasses"
|
|
221
|
-
:style="rootStyle"
|
|
222
|
-
v-bind="framingDataAttrs"
|
|
234
|
+
:style="[rootStyle, attrs.style]"
|
|
223
235
|
/>
|
|
224
236
|
</template>
|