@zappie/theme-base 0.1.2 → 0.1.4
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 +26 -0
- package/dist/address.d.ts +3 -3
- package/dist/address.js +0 -1
- package/dist/address.js.map +2 -2
- package/dist/cart/totals.js +0 -2
- package/dist/cart/totals.js.map +2 -2
- package/dist/cart.d.ts +2 -2
- package/dist/catalogue/info-banners.js +4 -2
- package/dist/catalogue/info-banners.js.map +2 -2
- package/dist/catalogue/presentation.js +0 -1
- package/dist/catalogue/presentation.js.map +2 -2
- package/dist/catalogue.d.ts +3 -3
- package/dist/checkout.d.ts +3 -3
- package/dist/host-bridge.d.ts +3 -3
- package/dist/item-frame.d.ts +1 -2
- package/dist/item.d.ts +3 -3
- package/dist/navigation.d.ts +3 -3
- package/dist/styles.css +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @zappie/theme-base
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9b25eb7: The packages now live in zappie/storefront-packages, and each package's repository, homepage and issues links point there. This release is the first one published from that repository.
|
|
8
|
+
- Updated dependencies [9b25eb7]
|
|
9
|
+
- @zappie/sdk@0.1.13
|
|
10
|
+
- @zappie/tokens@0.1.2
|
|
11
|
+
- @zappie/foundations@0.1.7
|
|
12
|
+
|
|
13
|
+
## 0.1.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- afb46d4: Add storefront security lint rules, pass outbound hosts from `zappie.config.ts` to ESLint, and provide `safeRedirect` from `@zappie/sdk/redirect` for untrusted navigation targets.
|
|
18
|
+
- Updated dependencies [2b672c9]
|
|
19
|
+
- Updated dependencies [9b5b412]
|
|
20
|
+
- Updated dependencies [a4872fd]
|
|
21
|
+
- Updated dependencies [32ecccf]
|
|
22
|
+
- Updated dependencies [afb46d4]
|
|
23
|
+
- Updated dependencies [6a8e227]
|
|
24
|
+
- Updated dependencies [c0171ae]
|
|
25
|
+
- Updated dependencies [0cbc4da]
|
|
26
|
+
- @zappie/sdk@0.1.12
|
|
27
|
+
- @zappie/foundations@0.1.6
|
|
28
|
+
|
|
3
29
|
## 0.1.2
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/dist/address.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
3
|
import { DeliveryAddress } from '@zappie/sdk';
|
|
3
4
|
import { PlacesClient } from '@zappie/sdk/places';
|
|
4
|
-
import { ComponentType, ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
type AddressSuggestion = {
|
|
7
7
|
placeId: string;
|
|
@@ -22,7 +22,7 @@ type AddressLookup = {
|
|
|
22
22
|
declare function AddressLookupProvider({ lookup, children, }: {
|
|
23
23
|
lookup: AddressLookup;
|
|
24
24
|
children: ReactNode;
|
|
25
|
-
}):
|
|
25
|
+
}): react.JSX.Element;
|
|
26
26
|
declare function useAddressLookup(): AddressLookup;
|
|
27
27
|
declare function createSdkAddressLookup({ places, branchId, }: {
|
|
28
28
|
places: PlacesClient;
|
package/dist/address.js
CHANGED
package/dist/address.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/address.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport type { DeliveryAddress } from \"@zappie/sdk\";\nimport type { Place, PlacesClient } from \"@zappie/sdk/places\";\nimport {\n createContext,\n useContext,\n type ComponentType,\n type ReactNode,\n} from \"react\";\n\nexport type AddressSuggestion = {\n placeId: string;\n address: string;\n sessionToken?: string;\n};\n\nexport type AddressLookup = {\n suggest(query: string): Promise<AddressSuggestion[]>;\n reverse?(coordinates: { lat: number; lng: number }): Promise<DeliveryAddress>;\n resolve?(\n address: DeliveryAddress,\n sessionToken?: string,\n ): Promise<DeliveryAddress>;\n Map?: ComponentType<{ address: DeliveryAddress }>;\n};\n\nfunction deliveryAddress(\n place: Place,\n source?: DeliveryAddress,\n): DeliveryAddress {\n const result: DeliveryAddress = {\n line1: place.line1,\n placeId: place.place_id,\n coordinates: { lat: place.lat, lng: place.lng },\n };\n if (place.city !== undefined) {\n result.city = place.city;\n }\n if (source?.line2 !== undefined) {\n result.line2 = source.line2;\n }\n if (source?.instructions !== undefined) {\n result.instructions = source.instructions;\n }\n return result;\n}\n\nconst Context = createContext<AddressLookup | null>(null);\n\nexport function AddressLookupProvider({\n lookup,\n children,\n}: {\n lookup: AddressLookup;\n children: ReactNode;\n}) {\n return <Context.Provider value={lookup}>{children}</Context.Provider>;\n}\n\nexport function useAddressLookup() {\n const lookup = useContext(Context);\n if (!lookup) {\n throw new Error(\"useAddressLookup requires AddressLookupProvider\");\n }\n return lookup;\n}\n\nexport function createSdkAddressLookup({\n places,\n branchId,\n}: {\n places: PlacesClient;\n branchId: string;\n}): AddressLookup {\n let sessionToken = crypto.randomUUID();\n const Map = ({ address }: { address: DeliveryAddress }) => {\n if (!address.coordinates) {\n return null;\n }\n return (\n // The theme can't use next/image; the map's size is fixed by the API.\n
|
|
5
|
-
"mappings": ";;;AAIA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAgDE;AA9BT,SAAS,gBACP,OACA,QACiB;AACjB,QAAM,SAA0B;AAAA,IAC9B,OAAO,MAAM;AAAA,IACb,SAAS,MAAM;AAAA,IACf,aAAa,EAAE,KAAK,MAAM,KAAK,KAAK,MAAM,IAAI;AAAA,EAChD;AACA,MAAI,MAAM,SAAS,QAAW;AAC5B,WAAO,OAAO,MAAM;AAAA,EACtB;AACA,MAAI,QAAQ,UAAU,QAAW;AAC/B,WAAO,QAAQ,OAAO;AAAA,EACxB;AACA,MAAI,QAAQ,iBAAiB,QAAW;AACtC,WAAO,eAAe,OAAO;AAAA,EAC/B;AACA,SAAO;AACT;AAEA,IAAM,UAAU,cAAoC,IAAI;AAEjD,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AACF,GAGG;AACD,SAAO,oBAAC,QAAQ,UAAR,EAAiB,OAAO,QAAS,UAAS;AACpD;AAEO,SAAS,mBAAmB;AACjC,QAAM,SAAS,WAAW,OAAO;AACjC,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,iDAAiD;AAAA,EACnE;AACA,SAAO;AACT;AAEO,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AACF,GAGkB;AAChB,MAAI,eAAe,OAAO,WAAW;AACrC,QAAM,MAAM,CAAC,EAAE,QAAQ,MAAoC;AACzD,QAAI,CAAC,QAAQ,aAAa;AACxB,aAAO;AAAA,IACT;AACA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport type { DeliveryAddress } from \"@zappie/sdk\";\nimport type { Place, PlacesClient } from \"@zappie/sdk/places\";\nimport {\n createContext,\n useContext,\n type ComponentType,\n type ReactNode,\n} from \"react\";\n\nexport type AddressSuggestion = {\n placeId: string;\n address: string;\n sessionToken?: string;\n};\n\nexport type AddressLookup = {\n suggest(query: string): Promise<AddressSuggestion[]>;\n reverse?(coordinates: { lat: number; lng: number }): Promise<DeliveryAddress>;\n resolve?(\n address: DeliveryAddress,\n sessionToken?: string,\n ): Promise<DeliveryAddress>;\n Map?: ComponentType<{ address: DeliveryAddress }>;\n};\n\nfunction deliveryAddress(\n place: Place,\n source?: DeliveryAddress,\n): DeliveryAddress {\n const result: DeliveryAddress = {\n line1: place.line1,\n placeId: place.place_id,\n coordinates: { lat: place.lat, lng: place.lng },\n };\n if (place.city !== undefined) {\n result.city = place.city;\n }\n if (source?.line2 !== undefined) {\n result.line2 = source.line2;\n }\n if (source?.instructions !== undefined) {\n result.instructions = source.instructions;\n }\n return result;\n}\n\nconst Context = createContext<AddressLookup | null>(null);\n\nexport function AddressLookupProvider({\n lookup,\n children,\n}: {\n lookup: AddressLookup;\n children: ReactNode;\n}) {\n return <Context.Provider value={lookup}>{children}</Context.Provider>;\n}\n\nexport function useAddressLookup() {\n const lookup = useContext(Context);\n if (!lookup) {\n throw new Error(\"useAddressLookup requires AddressLookupProvider\");\n }\n return lookup;\n}\n\nexport function createSdkAddressLookup({\n places,\n branchId,\n}: {\n places: PlacesClient;\n branchId: string;\n}): AddressLookup {\n let sessionToken = crypto.randomUUID();\n const Map = ({ address }: { address: DeliveryAddress }) => {\n if (!address.coordinates) {\n return null;\n }\n return (\n // The theme can't use next/image; the map's size is fixed by the API.\n <img\n className=\"z-base-address-map\"\n src={places.staticMapUrl(\n address.coordinates.lat,\n address.coordinates.lng,\n branchId,\n )}\n alt={`Map of ${address.line1}`}\n width={640}\n height={320}\n loading=\"lazy\"\n />\n );\n };\n return {\n async suggest(query) {\n const suggestions = await places.autocomplete(query, sessionToken);\n return suggestions.map((suggestion) => ({\n placeId: suggestion.place_id,\n address: suggestion.secondary\n ? `${suggestion.text}, ${suggestion.secondary}`\n : suggestion.text,\n sessionToken,\n }));\n },\n async resolve(address, token) {\n if (!address.placeId) {\n throw new Error(\"Choose a suggested delivery address\");\n }\n const place = await places.place(address.placeId, {\n branchId,\n sessionToken: token ?? sessionToken,\n });\n sessionToken = crypto.randomUUID();\n return deliveryAddress(place, address);\n },\n async reverse({ lat, lng }) {\n const place = await places.reverse(lat, lng);\n return deliveryAddress(place);\n },\n Map,\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;AAIA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAgDE;AA9BT,SAAS,gBACP,OACA,QACiB;AACjB,QAAM,SAA0B;AAAA,IAC9B,OAAO,MAAM;AAAA,IACb,SAAS,MAAM;AAAA,IACf,aAAa,EAAE,KAAK,MAAM,KAAK,KAAK,MAAM,IAAI;AAAA,EAChD;AACA,MAAI,MAAM,SAAS,QAAW;AAC5B,WAAO,OAAO,MAAM;AAAA,EAC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QAAQ,SAAS;AACpB,cAAM,IAAI,MAAM,qCAAqC;AAAA,MACvD;AACA,YAAM,QAAQ,MAAM,OAAO,MAAM,QAAQ,SAAS;AAAA,QAChD;AAAA,QACA,cAAc,SAAS;AAAA,MACzB,CAAC;AACD,qBAAe,OAAO,WAAW;AACjC,aAAO,gBAAgB,OAAO,OAAO;AAAA,IACvC;AAAA,IACA,MAAM,QAAQ,EAAE,KAAK,IAAI,GAAG;AAC1B,YAAM,QAAQ,MAAM,OAAO,QAAQ,KAAK,GAAG;AAC3C,aAAO,gBAAgB,KAAK;AAAA,IAC9B;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cart/totals.js
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
import { Totals as FoundationTotals, Money } from "@zappie/foundations";
|
|
3
3
|
import { useCart } from "@zappie/sdk/react";
|
|
4
4
|
import { Fragment, useState } from "react";
|
|
5
|
-
import { useBaseHostBridge } from "../host-bridge.js";
|
|
6
5
|
import { CheckoutCta } from "./checkout-cta.js";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
function Totals({
|
|
9
8
|
contactPhone
|
|
10
9
|
} = {}) {
|
|
11
10
|
const cart = useCart();
|
|
12
|
-
const bridge = useBaseHostBridge();
|
|
13
11
|
const [error, setError] = useState(null);
|
|
14
12
|
const blocked = cart.issues.some((issue) => issue.severity === "blocking");
|
|
15
13
|
const refresh = async () => {
|
package/dist/cart/totals.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/cart/totals.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Totals as FoundationTotals, Money } from \"@zappie/foundations\";\nimport { useCart } from \"@zappie/sdk/react\";\nimport { Fragment, useState } from \"react\";\nimport {
|
|
5
|
-
"mappings": ";AAAA,SAAS,UAAU,kBAAkB,aAAa;AAClD,SAAS,eAAe;AACxB,SAAS,UAAU,gBAAgB;AACnC,SAAS,
|
|
4
|
+
"sourcesContent": ["import { Totals as FoundationTotals, Money } from \"@zappie/foundations\";\nimport { useCart } from \"@zappie/sdk/react\";\nimport { Fragment, useState } from \"react\";\nimport { CheckoutCta } from \"./checkout-cta\";\nimport type { ContactPhoneState } from \"./customer-details\";\nexport function Totals({\n contactPhone,\n}: {\n contactPhone?: ContactPhoneState;\n} = {}) {\n const cart = useCart();\n const [error, setError] = useState<string | null>(null);\n const blocked = cart.issues.some((issue) => issue.severity === \"blocking\");\n const refresh = async () => {\n setError(null);\n try {\n await cart.actions.quote({ force: true });\n } catch (error) {\n setError(\n error instanceof Error ? error.message : \"Unable to update totals\",\n );\n }\n };\n return (\n <FoundationTotals className=\"z-base-summary\">\n {({ quote, status }) => {\n // Under a blocking issue the store may not have priced the cart at\n // all (a closed branch without a time, a refused preview): its zero\n // totals would read as \u20A60. A priced cart still shows its figures, for\n // example before the customer signs in or chooses an address.\n const unpriced =\n blocked && (!quote || quote.subtotal.amountMinor === 0);\n return (\n <Fragment>\n <h2>Order summary</h2>\n {status === \"loading\" && <p role=\"status\">Updating totals\u2026</p>}\n {status === \"offline\" && (\n <p role=\"alert\">\n Unable to connect. Try updating your totals again.\n </p>\n )}\n {status === \"stale\" && !blocked && (\n <p>Update totals before continuing.</p>\n )}\n {error && <p role=\"alert\">{error}</p>}\n {unpriced && (\n <p>Totals appear once the issues above are resolved.</p>\n )}\n {blocked && !unpriced && (\n <p>Your total may change once the issues above are resolved.</p>\n )}\n {quote && !unpriced && (\n <dl className=\"z-base-totals\">\n <div>\n <dt>Subtotal</dt>\n <dd>\n <Money value={quote.subtotal} />\n </dd>\n </div>\n {quote.fees.map((fee, index) => (\n <div key={`${fee.code}:${index}`}>\n <dt>{fee.label}</dt>\n <dd>\n <Money value={fee.amount} />\n </dd>\n </div>\n ))}\n {quote.delivery && (\n <div>\n <dt>Delivery</dt>\n <dd>\n <Money value={quote.delivery} />\n </dd>\n </div>\n )}\n {quote.discounts.map((discount, index) => (\n <div key={`${discount.code}:${index}`}>\n <dt>{discount.label}</dt>\n <dd>\n <Money value={discount.amount} />\n </dd>\n </div>\n ))}\n <div className=\"z-base-total\">\n <dt>Total</dt>\n <dd>\n <Money value={quote.total} />\n </dd>\n </div>\n </dl>\n )}\n {(status === \"stale\" || status === \"offline\") && !blocked && (\n <button\n type=\"button\"\n className=\"z-base-button-secondary\"\n onClick={() => {\n void refresh();\n }}\n >\n Update totals\n </button>\n )}\n <CheckoutCta\n totalsStatus={status}\n {...(contactPhone ? { contactPhone } : {})}\n />\n </Fragment>\n );\n }}\n </FoundationTotals>\n );\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU,kBAAkB,aAAa;AAClD,SAAS,eAAe;AACxB,SAAS,UAAU,gBAAgB;AACnC,SAAS,mBAAmB;AA+BhB,cAmBI,YAnBJ;AA7BL,SAAS,OAAO;AAAA,EACrB;AACF,IAEI,CAAC,GAAG;AACN,QAAM,OAAO,QAAQ;AACrB,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,IAAI;AACtD,QAAM,UAAU,KAAK,OAAO,KAAK,CAAC,UAAU,MAAM,aAAa,UAAU;AACzE,QAAM,UAAU,YAAY;AAC1B,aAAS,IAAI;AACb,QAAI;AACF,YAAM,KAAK,QAAQ,MAAM,EAAE,OAAO,KAAK,CAAC;AAAA,IAC1C,SAASA,QAAO;AACd;AAAA,QACEA,kBAAiB,QAAQA,OAAM,UAAU;AAAA,MAC3C;AAAA,IACF;AAAA,EACF;AACA,SACE,oBAAC,oBAAiB,WAAU,kBACzB,WAAC,EAAE,OAAO,OAAO,MAAM;AAKtB,UAAM,WACJ,YAAY,CAAC,SAAS,MAAM,SAAS,gBAAgB;AACvD,WACE,qBAAC,YACC;AAAA,0BAAC,QAAG,2BAAa;AAAA,MAChB,WAAW,aAAa,oBAAC,OAAE,MAAK,UAAS,mCAAgB;AAAA,MACzD,WAAW,aACV,oBA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AK,QAAQ;AAAA,UACf;AAAA,UACD;AAAA;AAAA,MAED;AAAA,MAEF;AAAA,QAAC;AAAA;AAAA,UACC,cAAc;AAAA,UACb,GAAI,eAAe,EAAE,aAAa,IAAI,CAAC;AAAA;AAAA,MAC1C;AAAA,OACF;AAAA,EAEJ,GACF;AAEJ;",
|
|
6
6
|
"names": ["error"]
|
|
7
7
|
}
|
package/dist/cart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* `themeClass` lets a template reuse this cart under its own design: the class
|
|
@@ -7,6 +7,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
7
7
|
*/
|
|
8
8
|
declare function CartReview({ themeClass }?: {
|
|
9
9
|
themeClass?: string;
|
|
10
|
-
}):
|
|
10
|
+
}): react.JSX.Element;
|
|
11
11
|
|
|
12
12
|
export { CartReview };
|
|
@@ -18,7 +18,9 @@ function InfoBanners({ value }) {
|
|
|
18
18
|
const interacted = useRef(false);
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
setBanners(
|
|
21
|
-
splitInfoBanner(value).
|
|
21
|
+
splitInfoBanner(value).filter(
|
|
22
|
+
(banner) => banner.replace(/<[^>]*>/g, "").trim()
|
|
23
|
+
)
|
|
22
24
|
);
|
|
23
25
|
setIndex(0);
|
|
24
26
|
setExpanded({});
|
|
@@ -84,7 +86,7 @@ function InfoBanners({ value }) {
|
|
|
84
86
|
{
|
|
85
87
|
className: "z-base-info-copy",
|
|
86
88
|
"data-expanded": Boolean(expanded[position]),
|
|
87
|
-
dangerouslySetInnerHTML: { __html: banner }
|
|
89
|
+
dangerouslySetInnerHTML: { __html: sanitize(banner) }
|
|
88
90
|
}
|
|
89
91
|
),
|
|
90
92
|
/* @__PURE__ */ jsxs(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/catalogue/info-banners.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\nimport {\n createSanitizeRichText,\n splitInfoBanner,\n} from \"@zappie/foundations/rich-text\";\nimport { parseRichText } from \"@zappie/foundations/rich-text/browser\";\nimport { useEffect, useRef, useState } from \"react\";\nconst sanitize = createSanitizeRichText(parseRichText);\n/** Safe rich text with touch scrolling, explicit controls and pausable rotation. */\nexport function InfoBanners({ value }: { value?: string }) {\n const [banners, setBanners] = useState<string[]>([]);\n const [index, setIndex] = useState(0);\n const [expanded, setExpanded] = useState<Record<number, boolean>>({});\n const [paused, setPaused] = useState(false);\n const viewport = useRef<HTMLDivElement>(null);\n const interacted = useRef(false);\n useEffect(() => {\n setBanners(\n splitInfoBanner(value)
|
|
5
|
-
"mappings": ";;;AACA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,WAAW,QAAQ,gBAAgB;AAgFhC,cAKA,YALA;AA/EZ,IAAM,WAAW,uBAAuB,aAAa;AAE9C,SAAS,YAAY,EAAE,MAAM,GAAuB;AACzD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAmB,CAAC,CAAC;AACnD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,CAAC;AACpC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkC,CAAC,CAAC;AACpE,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,WAAW,OAAuB,IAAI;AAC5C,QAAM,aAAa,OAAO,KAAK;AAC/B,YAAU,MAAM;AACd;AAAA,MACE,gBAAgB,KAAK,
|
|
4
|
+
"sourcesContent": ["\"use client\";\nimport {\n createSanitizeRichText,\n splitInfoBanner,\n} from \"@zappie/foundations/rich-text\";\nimport { parseRichText } from \"@zappie/foundations/rich-text/browser\";\nimport { useEffect, useRef, useState } from \"react\";\nconst sanitize = createSanitizeRichText(parseRichText);\n/** Safe rich text with touch scrolling, explicit controls and pausable rotation. */\nexport function InfoBanners({ value }: { value?: string }) {\n const [banners, setBanners] = useState<string[]>([]);\n const [index, setIndex] = useState(0);\n const [expanded, setExpanded] = useState<Record<number, boolean>>({});\n const [paused, setPaused] = useState(false);\n const viewport = useRef<HTMLDivElement>(null);\n const interacted = useRef(false);\n useEffect(() => {\n setBanners(\n splitInfoBanner(value).filter((banner) =>\n banner.replace(/<[^>]*>/g, \"\").trim(),\n ),\n );\n setIndex(0);\n setExpanded({});\n interacted.current = false;\n }, [value]);\n function select(next: number, interaction = true) {\n interacted.current ||= interaction;\n setExpanded({});\n viewport.current?.children[next]?.scrollIntoView({\n block: \"nearest\",\n inline: \"start\",\n behavior: \"instant\",\n });\n setIndex(next);\n }\n const isExpanded = Object.values(expanded).some(Boolean);\n useEffect(() => {\n if (paused || isExpanded || banners.length < 2) {\n return;\n }\n const interval = setInterval(() => {\n const node = viewport.current;\n if (\n !node ||\n interacted.current ||\n window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches ||\n node.scrollWidth <= node.clientWidth\n ) {\n return;\n }\n select((index + 1) % banners.length, false);\n }, 5000);\n return () => clearInterval(interval);\n }, [index, paused, isExpanded, banners.length]);\n if (!banners.length) {\n return null;\n }\n return (\n <section\n aria-label=\"Menu information\"\n onMouseEnter={() => setPaused(true)}\n onMouseLeave={() => setPaused(false)}\n onFocus={() => setPaused(true)}\n onBlur={() => setPaused(false)}\n >\n <div\n className=\"z-base-info-banners\"\n ref={viewport}\n onPointerDown={() => {\n interacted.current = true;\n }}\n onScroll={() => {\n const node = viewport.current;\n if (node?.children[0]) {\n setIndex(\n Math.round(\n node.scrollLeft /\n node.children[0].getBoundingClientRect().width,\n ),\n );\n }\n }}\n >\n {banners.map((banner, position) => (\n <article key={banner + position}>\n <div\n className=\"z-base-info-copy\"\n data-expanded={Boolean(expanded[position])}\n dangerouslySetInnerHTML={{ __html: sanitize(banner) }}\n />\n <button\n type=\"button\"\n aria-expanded={Boolean(expanded[position])}\n onClick={() =>\n setExpanded((current) => ({\n ...current,\n [position]: !current[position],\n }))\n }\n >\n Show {expanded[position] ? \"less\" : \"more\"}\n </button>\n </article>\n ))}\n </div>\n {banners.length > 1 && (\n <div>\n <button\n type=\"button\"\n aria-label=\"Previous information\"\n disabled={index === 0}\n onClick={() => select(index - 1)}\n >\n Previous\n </button>\n <button\n type=\"button\"\n aria-label=\"Next information\"\n disabled={index >= banners.length - 1}\n onClick={() => select(index + 1)}\n >\n Next\n </button>\n {banners.map((_, position) => (\n <button\n key={position}\n type=\"button\"\n aria-label={`Go to banner ${position + 1}`}\n aria-current={index === position ? \"true\" : undefined}\n onClick={() => select(position)}\n >\n {position + 1}\n </button>\n ))}\n </div>\n )}\n </section>\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;AACA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,WAAW,QAAQ,gBAAgB;AAgFhC,cAKA,YALA;AA/EZ,IAAM,WAAW,uBAAuB,aAAa;AAE9C,SAAS,YAAY,EAAE,MAAM,GAAuB;AACzD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAmB,CAAC,CAAC;AACnD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,CAAC;AACpC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkC,CAAC,CAAC;AACpE,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,WAAW,OAAuB,IAAI;AAC5C,QAAM,aAAa,OAAO,KAAK;AAC/B,YAAU,MAAM;AACd;AAAA,MACE,gBAAgB,KAAK,EAAE;AAAA,QAAO,CAAC,WAC7B,OAAO,QAAQ,YAAY,EAAE,EAAE,KAAK;AAAA,MACtC;AAAA,IACF;AACA,aAAS,CAAC;AACV,gBAAY,CAAC,CAAC;AACd,eAAW,UAAU;AAAA,EACvB,GAAG,CAAC,KAAK,CAAC;AACV,WAAS,OAAO,MAAc,cAAc,MAAM;AAChD,eAAW,YAAX,WAAW,UAAY;AACvB,gBAAY,C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@@ -30,7 +30,6 @@ function ItemImage({
|
|
|
30
30
|
return /* @__PURE__ */ jsx("div", { className: "z-base-item-image", children: image && !failed ? (
|
|
31
31
|
// Public themes remain framework independent; the host may optimise
|
|
32
32
|
// image URLs through the bridge.
|
|
33
|
-
// eslint-disable-next-line @next/next/no-img-element
|
|
34
33
|
/* @__PURE__ */ jsx(
|
|
35
34
|
"img",
|
|
36
35
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/catalogue/presentation.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\nimport { createSanitizeRichText } from \"@zappie/foundations/rich-text\";\nimport { parseRichText } from \"@zappie/foundations/rich-text/browser\";\nimport { useEffect, useState } from \"react\";\nimport { useBaseHostBridge } from \"../host-bridge\";\nconst sanitize = createSanitizeRichText(parseRichText);\nexport function Description({ value }: { value: string }) {\n const [html, setHtml] = useState(\"\");\n useEffect(() => setHtml(sanitize(value)), [value]);\n return (\n <div\n className=\"z-base-description\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n );\n}\nexport function ItemImage({\n src,\n sizes,\n priority = false,\n}: {\n src?: string | undefined;\n /** Rendered width hint for responsive host images. */\n sizes: string;\n /** Tiles likely to be the largest paint load first instead of lazily. */\n priority?: boolean;\n}) {\n const bridge = useBaseHostBridge();\n const [failed, setFailed] = useState(false);\n useEffect(() => setFailed(false), [src]);\n const image = src ? (bridge.imageProps?.(src, sizes) ?? { src }) : undefined;\n return (\n <div className=\"z-base-item-image\">\n {image && !failed ? (\n // Public themes remain framework independent; the host may optimise\n // image URLs through the bridge.\n
|
|
5
|
-
"mappings": ";;;AACA,SAAS,8BAA8B;AACvC,SAAS,qBAAqB;AAC9B,SAAS,WAAW,gBAAgB;AACpC,SAAS,yBAAyB;AAM9B;AALJ,IAAM,WAAW,uBAAuB,aAAa;AAC9C,SAAS,YAAY,EAAE,MAAM,GAAsB;AACxD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AACnC,YAAU,MAAM,QAAQ,SAAS,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;AACjD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,yBAAyB,EAAE,QAAQ,KAAK;AAAA;AAAA,EAC1C;AAEJ;AACO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,WAAW;AACb,GAMG;AACD,QAAM,SAAS,kBAAkB;AACjC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,YAAU,MAAM,UAAU,KAAK,GAAG,CAAC,GAAG,CAAC;AACvC,QAAM,QAAQ,MAAO,OAAO,aAAa,KAAK,KAAK,KAAK,EAAE,IAAI,IAAK;AACnE,SACE,oBAAC,SAAI,WAAU,qBACZ,mBAAS,CAAC;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["\"use client\";\nimport { createSanitizeRichText } from \"@zappie/foundations/rich-text\";\nimport { parseRichText } from \"@zappie/foundations/rich-text/browser\";\nimport { useEffect, useState } from \"react\";\nimport { useBaseHostBridge } from \"../host-bridge\";\nconst sanitize = createSanitizeRichText(parseRichText);\nexport function Description({ value }: { value: string }) {\n const [html, setHtml] = useState(\"\");\n useEffect(() => setHtml(sanitize(value)), [value]);\n return (\n <div\n className=\"z-base-description\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n );\n}\nexport function ItemImage({\n src,\n sizes,\n priority = false,\n}: {\n src?: string | undefined;\n /** Rendered width hint for responsive host images. */\n sizes: string;\n /** Tiles likely to be the largest paint load first instead of lazily. */\n priority?: boolean;\n}) {\n const bridge = useBaseHostBridge();\n const [failed, setFailed] = useState(false);\n useEffect(() => setFailed(false), [src]);\n const image = src ? (bridge.imageProps?.(src, sizes) ?? { src }) : undefined;\n return (\n <div className=\"z-base-item-image\">\n {image && !failed ? (\n // Public themes remain framework independent; the host may optimise\n // image URLs through the bridge.\n <img\n {...image}\n loading={priority ? \"eager\" : \"lazy\"}\n fetchPriority={priority ? \"high\" : \"auto\"}\n decoding=\"async\"\n alt=\"\"\n onError={() => setFailed(true)}\n />\n ) : (\n <span aria-hidden=\"true\">Image unavailable</span>\n )}\n </div>\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;AACA,SAAS,8BAA8B;AACvC,SAAS,qBAAqB;AAC9B,SAAS,WAAW,gBAAgB;AACpC,SAAS,yBAAyB;AAM9B;AALJ,IAAM,WAAW,uBAAuB,aAAa;AAC9C,SAAS,YAAY,EAAE,MAAM,GAAsB;AACxD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AACnC,YAAU,MAAM,QAAQ,SAAS,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;AACjD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,yBAAyB,EAAE,QAAQ,KAAK;AAAA;AAAA,EAC1C;AAEJ;AACO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,WAAW;AACb,GAMG;AACD,QAAM,SAAS,kBAAkB;AACjC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,YAAU,MAAM,UAAU,KAAK,GAAG,CAAC,GAAG,CAAC;AACvC,QAAM,QAAQ,MAAO,OAAO,aAAa,KAAK,KAAK,KAAK,EAAE,IAAI,IAAK;AACnE,SACE,oBAAC,SAAI,WAAU,qBACZ,mBAAS,CAAC;AAAA;AAAA;AAAA,IAGT;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,SAAS,WAAW,UAAU;AAAA,QAC9B,eAAe,WAAW,SAAS;AAAA,QACnC,UAAS;AAAA,QACT,KAAI;AAAA,QACJ,SAAS,MAAM,UAAU,IAAI;AAAA;AAAA,IAC/B;AAAA,MAEA,oBAAC,UAAK,eAAY,QAAO,+BAAiB,GAE9C;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/catalogue.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Menu, Item, Category } from '@zappie/sdk';
|
|
1
|
+
import * as react from 'react';
|
|
3
2
|
import { ComponentType } from 'react';
|
|
3
|
+
import { Menu, Item, Category } from '@zappie/sdk';
|
|
4
4
|
|
|
5
5
|
type CatalogueStrategy = (metadata: Menu, sample?: Menu) => "eager" | "progressive" | null;
|
|
6
6
|
|
|
@@ -55,6 +55,6 @@ type CatalogueSlots = {
|
|
|
55
55
|
layout?: CatalogueLayout;
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
declare function Catalogue({ initialMenu, resolveStrategy, themeClass, orderAction, menuNotice, revision, slots, }: CatalogueProps):
|
|
58
|
+
declare function Catalogue({ initialMenu, resolveStrategy, themeClass, orderAction, menuNotice, revision, slots, }: CatalogueProps): react.JSX.Element;
|
|
59
59
|
|
|
60
60
|
export { Catalogue, type CatalogueCategoryHeaderProps, type CatalogueCategoryTabProps, type CatalogueColumnCount, type CatalogueLayout, type CatalogueLayoutMode, type CatalogueMenuSlotProps, type CatalogueProps, type CatalogueSlots, type CatalogueTileProps, type CatalogueToolbarActionProps };
|
package/dist/checkout.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { CartModule } from '@zappie/sdk';
|
|
3
4
|
import { CheckoutClient } from '@zappie/sdk/checkout';
|
|
4
5
|
import { CustomerClient } from '@zappie/sdk/customer';
|
|
5
|
-
import { ReactNode } from 'react';
|
|
6
6
|
|
|
7
7
|
type CheckoutPayload = ReturnType<CartModule["toCheckoutPayload"]>;
|
|
8
8
|
type CheckoutHandoff = {
|
|
@@ -19,7 +19,7 @@ type CheckoutHandoff = {
|
|
|
19
19
|
declare function CheckoutHandoffProvider({ handoff, children, }: {
|
|
20
20
|
handoff: CheckoutHandoff;
|
|
21
21
|
children: ReactNode;
|
|
22
|
-
}):
|
|
22
|
+
}): react.JSX.Element;
|
|
23
23
|
declare function useCheckoutHandoff(): CheckoutHandoff;
|
|
24
24
|
declare function createSdkCheckoutHandoff({ customer, checkout, branchId, returnUrl, cancelUrl, attribution, }: {
|
|
25
25
|
customer: CustomerClient;
|
package/dist/host-bridge.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Money, OpeningTime, CartFulfilment } from '@zappie/sdk';
|
|
1
|
+
import * as react from 'react';
|
|
3
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { Money, OpeningTime, CartFulfilment } from '@zappie/sdk';
|
|
4
4
|
export { AddressSuggestion } from './address.js';
|
|
5
5
|
import '@zappie/sdk/places';
|
|
6
6
|
|
|
@@ -94,7 +94,7 @@ type CustomerDetailsValues = {
|
|
|
94
94
|
declare function BaseHostBridgeProvider({ bridge, children, }: {
|
|
95
95
|
bridge: BaseHostBridge;
|
|
96
96
|
children: ReactNode;
|
|
97
|
-
}):
|
|
97
|
+
}): react.JSX.Element;
|
|
98
98
|
declare function useBaseHostBridge(): BaseHostBridge;
|
|
99
99
|
|
|
100
100
|
export { type BaseHostBridge, BaseHostBridgeProvider, type CustomerDetailsValues, type HostAppliedReward, type HostPromo, type HostReward, useBaseHostBridge };
|
package/dist/item-frame.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as react from 'react';
|
|
3
2
|
import { RefObject, ReactNode } from 'react';
|
|
4
3
|
|
|
@@ -15,6 +14,6 @@ declare function ItemFrame({ id, name, hasImages, navigation, themeClass, childr
|
|
|
15
14
|
open(): void;
|
|
16
15
|
close(): void;
|
|
17
16
|
};
|
|
18
|
-
}):
|
|
17
|
+
}): react.JSX.Element;
|
|
19
18
|
|
|
20
19
|
export { ItemEscapeContext, ItemFrame };
|
package/dist/item.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { Item } from '@zappie/sdk';
|
|
3
3
|
|
|
4
4
|
type ItemDetailProps = {
|
|
@@ -14,7 +14,7 @@ type ItemDetailProps = {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
/** Framework-independent SDK item screen, reusable through themeClass. */
|
|
17
|
-
declare function ItemDetail(props: ItemDetailProps):
|
|
18
|
-
declare function ItemContent({ item, menuId, scope, href, navigation, }: ItemDetailProps):
|
|
17
|
+
declare function ItemDetail(props: ItemDetailProps): react.JSX.Element;
|
|
18
|
+
declare function ItemContent({ item, menuId, scope, href, navigation, }: ItemDetailProps): react.JSX.Element;
|
|
19
19
|
|
|
20
20
|
export { ItemContent, ItemDetail, type ItemDetailProps };
|
package/dist/navigation.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { Item } from '@zappie/sdk';
|
|
3
4
|
import { StorefrontUrlOptions } from '@zappie/sdk/url';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
declare function createUrlNavigation(options?: UrlNavigationOptions): CatalogueNavigation;
|
|
7
7
|
|
|
@@ -58,7 +58,7 @@ type UrlNavigationOptions = StorefrontUrlOptions & {
|
|
|
58
58
|
declare function CatalogueNavigationProvider({ navigation, children, }: {
|
|
59
59
|
navigation: CatalogueNavigation;
|
|
60
60
|
children: ReactNode;
|
|
61
|
-
}):
|
|
61
|
+
}): react.JSX.Element;
|
|
62
62
|
declare function useCatalogueNavigation(): CatalogueNavigation;
|
|
63
63
|
|
|
64
64
|
export { type CatalogueFocusTarget, type CatalogueLocation, type CatalogueNavigation, CatalogueNavigationProvider, type CatalogueNavigationTarget, type UrlNavigationOptions, createUrlNavigation, useCatalogueNavigation };
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zappie/theme-base",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "The base storefront theme Zappie's own storefront app renders, built only from Zappie's public packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -54,22 +54,22 @@
|
|
|
54
54
|
"CHANGELOG.md"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@zappie/foundations": "^0.1.
|
|
58
|
-
"@zappie/sdk": "^0.1.
|
|
59
|
-
"@zappie/tokens": "^0.1.
|
|
57
|
+
"@zappie/foundations": "^0.1.7",
|
|
58
|
+
"@zappie/sdk": "^0.1.13",
|
|
59
|
+
"@zappie/tokens": "^0.1.2"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"react": "^19.2.0"
|
|
63
63
|
},
|
|
64
64
|
"repository": {
|
|
65
65
|
"type": "git",
|
|
66
|
-
"url": "git+https://github.com/zappie/storefront.git",
|
|
66
|
+
"url": "git+https://github.com/zappie/storefront-packages.git",
|
|
67
67
|
"directory": "themes/base"
|
|
68
68
|
},
|
|
69
69
|
"license": "MIT",
|
|
70
|
-
"homepage": "https://github.com/zappie/storefront#readme",
|
|
70
|
+
"homepage": "https://github.com/zappie/storefront-packages#readme",
|
|
71
71
|
"bugs": {
|
|
72
|
-
"url": "https://github.com/zappie/storefront/issues"
|
|
72
|
+
"url": "https://github.com/zappie/storefront-packages/issues"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "tsup && node ../../scripts/release-packages/build-modules.mjs"
|