@zappie/foundations 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +68 -0
- package/dist/account/index.js +1 -48
- package/dist/account/index.js.map +1 -1
- package/dist/account/zappie-account.js +1 -38
- package/dist/account/zappie-account.js.map +1 -1
- package/dist/attribution/powered-by-zappie.js +2 -0
- package/dist/attribution/powered-by-zappie.js.map +6 -0
- package/dist/branch-map/colors.js +1 -26
- package/dist/branch-map/colors.js.map +1 -1
- package/dist/branch-map/delivery-map.js +1 -59
- package/dist/branch-map/delivery-map.js.map +1 -1
- package/dist/branch-map/delivery-runtime.js +1 -117
- package/dist/branch-map/delivery-runtime.js.map +1 -1
- package/dist/branch-map/fit.js +1 -107
- package/dist/branch-map/fit.js.map +1 -1
- package/dist/branch-map/geometry.js +1 -11
- package/dist/branch-map/geometry.js.map +1 -1
- package/dist/branch-map/index.js +1 -94
- package/dist/branch-map/index.js.map +1 -1
- package/dist/branch-map/loader.js +1 -38
- package/dist/branch-map/loader.js.map +1 -1
- package/dist/branch-map/markers.js +1 -182
- package/dist/branch-map/markers.js.map +1 -1
- package/dist/branch-map/runtime.js +1 -294
- package/dist/branch-map/runtime.js.map +1 -1
- package/dist/branch-map/use-map-runtime.js +1 -52
- package/dist/branch-map/use-map-runtime.js.map +1 -1
- package/dist/branch-switch/index.js +1 -125
- package/dist/branch-switch/index.js.map +1 -1
- package/dist/cart/index.js +1 -170
- package/dist/cart/index.js.map +1 -1
- package/dist/checkout/attempt.js +1 -48
- package/dist/checkout/attempt.js.map +1 -1
- package/dist/checkout/contact.js +1 -35
- package/dist/checkout/contact.js.map +1 -1
- package/dist/checkout/index.js +1 -33
- package/dist/checkout/index.js.map +1 -1
- package/dist/checkout/markers.js +1 -25
- package/dist/checkout/markers.js.map +1 -1
- package/dist/checkout/offers.js +1 -12
- package/dist/checkout/offers.js.map +1 -1
- package/dist/checkout/pay-after-sign-in.js +1 -77
- package/dist/checkout/pay-after-sign-in.js.map +1 -1
- package/dist/checkout/sign-in.js +1 -25
- package/dist/checkout/sign-in.js.map +1 -1
- package/dist/checkout/status.js +1 -72
- package/dist/checkout/status.js.map +1 -1
- package/dist/checkout/timing.js +1 -38
- package/dist/checkout/timing.js.map +1 -1
- package/dist/checkout/use-checkout-flow.js +1 -598
- package/dist/checkout/use-checkout-flow.js.map +1 -1
- package/dist/deferred/index.js +1 -141
- package/dist/deferred/index.js.map +1 -1
- package/dist/fulfilment/address-picker.js +1 -165
- package/dist/fulfilment/address-picker.js.map +1 -1
- package/dist/fulfilment/branch-picker.js +1 -53
- package/dist/fulfilment/branch-picker.js.map +1 -1
- package/dist/fulfilment/schedule.js +1 -126
- package/dist/fulfilment/schedule.js.map +1 -1
- package/dist/fulfilment/switch.js +1 -53
- package/dist/fulfilment/switch.js.map +1 -1
- package/dist/fulfilment/window.js +1 -154
- package/dist/fulfilment/window.js.map +1 -1
- package/dist/index.d.ts +31 -110
- package/dist/index.js +1 -76
- package/dist/index.js.map +1 -1
- package/dist/internal/combobox.js +1 -130
- package/dist/internal/combobox.js.map +1 -1
- package/dist/internal/data-attrs.js +1 -7
- package/dist/internal/data-attrs.js.map +1 -1
- package/dist/internal/ids.js +1 -9
- package/dist/internal/ids.js.map +1 -1
- package/dist/internal/slot.js +1 -87
- package/dist/internal/slot.js.map +1 -1
- package/dist/internal/use-controllable-state.js +1 -28
- package/dist/internal/use-controllable-state.js.map +1 -1
- package/dist/item-form/index.js +1 -14
- package/dist/item-form/index.js.map +1 -1
- package/dist/item-form/option-group.js +1 -331
- package/dist/item-form/option-group.js.map +1 -1
- package/dist/item-form/options.js +1 -64
- package/dist/item-form/options.js.map +1 -1
- package/dist/item-form/quantity.js +1 -130
- package/dist/item-form/quantity.js.map +1 -1
- package/dist/item-form/root.js +1 -182
- package/dist/item-form/root.js.map +1 -1
- package/dist/item-sheet/index.d.ts +137 -0
- package/dist/item-sheet/index.js +2 -0
- package/dist/item-sheet/index.js.map +6 -0
- package/dist/loyalty/index.js +1 -278
- package/dist/loyalty/index.js.map +1 -1
- package/dist/media/image.js +1 -58
- package/dist/media/image.js.map +1 -1
- package/dist/money.js +1 -19
- package/dist/money.js.map +1 -1
- package/dist/next.js +1 -57
- package/dist/next.js.map +1 -1
- package/dist/order/index.js +1 -575
- package/dist/order/index.js.map +1 -1
- package/dist/order/model.js +1 -83
- package/dist/order/model.js.map +1 -1
- package/dist/order/use-customer-order.js +1 -55
- package/dist/order/use-customer-order.js.map +1 -1
- package/dist/otp/input.js +1 -109
- package/dist/otp/input.js.map +1 -1
- package/dist/overlay/drag-to-close.js +1 -50
- package/dist/overlay/drag-to-close.js.map +1 -1
- package/dist/overlay/drag.js +1 -209
- package/dist/overlay/drag.js.map +1 -1
- package/dist/overlay/engine.js +1 -184
- package/dist/overlay/engine.js.map +1 -1
- package/dist/overlay/history.js +1 -101
- package/dist/overlay/history.js.map +1 -1
- package/dist/overlay/load.js +1 -28
- package/dist/overlay/load.js.map +1 -1
- package/dist/overlay/react.js +1 -481
- package/dist/overlay/react.js.map +1 -1
- package/dist/payment/methods.js +1 -102
- package/dist/payment/methods.js.map +1 -1
- package/dist/phone/combobox.js +1 -295
- package/dist/phone/combobox.js.map +1 -1
- package/dist/phone/core.js +1 -162
- package/dist/phone/core.js.map +1 -1
- package/dist/phone/countries.js +1 -56
- package/dist/phone/countries.js.map +1 -1
- package/dist/phone/country-data.js +1 -272
- package/dist/phone/country-data.js.map +1 -1
- package/dist/phone/index.js +1 -42
- package/dist/phone/index.js.map +1 -1
- package/dist/phone/load.js +1 -12
- package/dist/phone/load.js.map +1 -1
- package/dist/phone/picker.js +1 -142
- package/dist/phone/picker.js.map +1 -1
- package/dist/phone/use-phone-field.js +1 -183
- package/dist/phone/use-phone-field.js.map +1 -1
- package/dist/react-CFPTPzAO.d.ts +120 -0
- package/dist/rich-text/banners.js +1 -8
- package/dist/rich-text/banners.js.map +1 -1
- package/dist/rich-text/browser.js +1 -23
- package/dist/rich-text/browser.js.map +1 -1
- package/dist/rich-text/core.js +1 -74
- package/dist/rich-text/core.js.map +1 -1
- package/dist/rich-text/index.js +1 -3
- package/dist/rich-text/index.js.map +1 -1
- package/dist/schedule/index.js +1 -36
- package/dist/schedule/index.js.map +1 -1
- package/dist/search/engine.js +1 -92
- package/dist/search/engine.js.map +1 -1
- package/dist/search/index.js +1 -174
- package/dist/search/index.js.map +1 -1
- package/dist/status/contact.js +1 -41
- package/dist/status/contact.js.map +1 -1
- package/dist/status/hours.js +1 -185
- package/dist/status/hours.js.map +1 -1
- package/dist/status/open-status.js +1 -47
- package/dist/status/open-status.js.map +1 -1
- package/dist/version.js +1 -5
- package/dist/version.js.map +1 -1
- package/package.json +14 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/item-form/quantity.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "aACA,OACE,cACA,WACA,YACA,WACA,YAGK,QACP,OAAS,SAAY,4BACrB,OAAS,SAA4B,sBACrC,OAAS,yBAA4B,wCA6EjC,mCAjEJ,IAAM,QAAU,eAAgB,cAAoC,IAAI,EACxE,SAAS,aAAc,CACrB,MAAM,QAAU,WAAW,OAAO,EAClC,GAAI,CAAC,QAAS,CACZ,MAAM,IAAI,MAAM,sCAAsC,CACxD,CACA,OAAO,OACT,CAaA,SAAS,KAAK,CACZ,MACA,aACA,cACA,IAAM,EACN,IAAM,GACN,KAAO,EACP,SAAW,MACX,GAAG,KACL,EAAkB,CAChB,GACE,CAAC,OAAO,SAAS,GAAG,GACpB,CAAC,OAAO,SAAS,GAAG,GACpB,CAAC,OAAO,SAAS,IAAI,GACrB,MAAQ,GACR,IAAM,IACN,CACA,MAAM,IAAI,WACR,6DACF,CACF,CACA,KAAM,CAAC,QAAS,GAAG,EAAI,qBAAqB,CAC1C,MACA,aAAc,cAAgB,IAC9B,SAAU,aACZ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M,KAAK,EAAG,CAC7B,IAAI,SAAS,OAAO,MAAM,OAAO,KAAK,CAAC,CACzC,CACF,EACA,UAAY,OAAyB,CACnC,MAAM,KAAO,CACX,QAAS,IAAI,MAAQ,IAAI,KACzB,UAAW,IAAI,MAAQ,IAAI,KAC3B,KAAM,IAAI,IACV,IAAK,IAAI,GACX,EAAE,MAAM,GAAG,EACX,GAAI,OAAS,OAAW,CACtB,MAAM,eAAe,EACrB,IAAI,SAAS,IAAI,CACnB,CACF,CACF,EACA,GACF,CACF,CACF,EAcO,IAAM,SAAW,CACtB,KACA,MACA,UAAW,OAAO,CAAC,EACnB,UAAW,OAAO,EAAE,CACtB",
|
|
5
5
|
"names": ["Value"]
|
|
6
6
|
}
|
package/dist/item-form/root.js
CHANGED
|
@@ -1,183 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/item-form/root.tsx
|
|
4
|
-
import {
|
|
5
|
-
previewItem,
|
|
6
|
-
ZappieCartError
|
|
7
|
-
} from "@zappie/sdk";
|
|
8
|
-
import { useCart, useCartCatalogue, useZappie } from "@zappie/sdk/react";
|
|
9
|
-
import {
|
|
10
|
-
createContext,
|
|
11
|
-
useCallback,
|
|
12
|
-
useContext,
|
|
13
|
-
useMemo,
|
|
14
|
-
useRef,
|
|
15
|
-
useState
|
|
16
|
-
} from "react";
|
|
17
|
-
import { part } from "../internal/slot.js";
|
|
18
|
-
import { useControllableState } from "../internal/use-controllable-state.js";
|
|
19
|
-
import { jsx } from "react/jsx-runtime";
|
|
20
|
-
var ItemFormStateContext = /* @__PURE__ */ createContext(null);
|
|
21
|
-
function useItemForm() {
|
|
22
|
-
const value = useContext(ItemFormStateContext);
|
|
23
|
-
if (!value) {
|
|
24
|
-
throw new Error("ItemForm parts require ItemForm.Root");
|
|
25
|
-
}
|
|
26
|
-
return value;
|
|
27
|
-
}
|
|
28
|
-
var GroupRegistry = /* @__PURE__ */ createContext(null);
|
|
29
|
-
function Root({
|
|
30
|
-
item,
|
|
31
|
-
value,
|
|
32
|
-
defaultValue,
|
|
33
|
-
onValueChange,
|
|
34
|
-
defaultQuantity,
|
|
35
|
-
onAdded,
|
|
36
|
-
onCommit,
|
|
37
|
-
onInvalid,
|
|
38
|
-
branchRequired = false,
|
|
39
|
-
onBranchRequired,
|
|
40
|
-
...props
|
|
41
|
-
}) {
|
|
42
|
-
const client = useZappie();
|
|
43
|
-
const { actions } = useCart();
|
|
44
|
-
const menu = useCartCatalogue();
|
|
45
|
-
const [input, setInput] = useControllableState({
|
|
46
|
-
value,
|
|
47
|
-
defaultValue: {
|
|
48
|
-
...defaultValue,
|
|
49
|
-
itemId: item.id,
|
|
50
|
-
quantity: defaultQuantity ?? defaultValue?.quantity ?? item.quantity.min
|
|
51
|
-
},
|
|
52
|
-
onChange: onValueChange
|
|
53
|
-
});
|
|
54
|
-
const registry = useRef(/* @__PURE__ */ new Map());
|
|
55
|
-
const [added, setAdded] = useState(false);
|
|
56
|
-
const [attempted, setAttempted] = useState(false);
|
|
57
|
-
const [failure, setFailure] = useState(null);
|
|
58
|
-
const normalized = useMemo(
|
|
59
|
-
() => ({ ...input, itemId: item.id }),
|
|
60
|
-
[input, item.id]
|
|
61
|
-
);
|
|
62
|
-
const preview = useMemo(
|
|
63
|
-
() => previewItem(item, normalized),
|
|
64
|
-
[item, normalized]
|
|
65
|
-
);
|
|
66
|
-
const validation = useMemo(
|
|
67
|
-
() => client.cart.validate(normalized),
|
|
68
|
-
[client, normalized, menu]
|
|
69
|
-
);
|
|
70
|
-
const issues = failure ?? (attempted && !validation.ok ? validation.issues : []);
|
|
71
|
-
const setValue = useCallback(
|
|
72
|
-
(next) => {
|
|
73
|
-
setAdded(false);
|
|
74
|
-
setFailure(null);
|
|
75
|
-
setInput({ ...next, itemId: item.id });
|
|
76
|
-
},
|
|
77
|
-
[setInput, item.id]
|
|
78
|
-
);
|
|
79
|
-
const setQuantity = useCallback(
|
|
80
|
-
(quantity) => setValue({ ...normalized, quantity }),
|
|
81
|
-
[setValue, normalized]
|
|
82
|
-
);
|
|
83
|
-
const focusIssue = useCallback(
|
|
84
|
-
(errors) => {
|
|
85
|
-
const ids = /* @__PURE__ */ new Set([
|
|
86
|
-
...registry.current.keys(),
|
|
87
|
-
...preview.groups.map((group) => group.id)
|
|
88
|
-
]);
|
|
89
|
-
const invalid = [...ids].flatMap((groupId) => {
|
|
90
|
-
const issues2 = errors.filter((issue) => issue.groupId === groupId);
|
|
91
|
-
return issues2.length ? [
|
|
92
|
-
{
|
|
93
|
-
groupId,
|
|
94
|
-
group: preview.groups.find((group) => group.id === groupId),
|
|
95
|
-
element: registry.current.get(groupId),
|
|
96
|
-
issues: issues2
|
|
97
|
-
}
|
|
98
|
-
] : [];
|
|
99
|
-
});
|
|
100
|
-
invalid[0]?.element?.focus({ preventScroll: true });
|
|
101
|
-
onInvalid?.(invalid);
|
|
102
|
-
},
|
|
103
|
-
[preview.groups, onInvalid]
|
|
104
|
-
);
|
|
105
|
-
const add = useCallback(() => {
|
|
106
|
-
if (branchRequired) {
|
|
107
|
-
onBranchRequired?.(normalized);
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
const result = client.cart.validate(normalized);
|
|
111
|
-
if (!result.ok) {
|
|
112
|
-
setAttempted(true);
|
|
113
|
-
setFailure(result.issues);
|
|
114
|
-
focusIssue(result.issues);
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
try {
|
|
118
|
-
const line = onCommit ? onCommit(normalized) : actions.add(item, normalized);
|
|
119
|
-
setAttempted(false);
|
|
120
|
-
setAdded(true);
|
|
121
|
-
onAdded?.(line);
|
|
122
|
-
return line;
|
|
123
|
-
} catch (error) {
|
|
124
|
-
if (error instanceof ZappieCartError) {
|
|
125
|
-
setAttempted(true);
|
|
126
|
-
setFailure([...error.issues]);
|
|
127
|
-
focusIssue([...error.issues]);
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
throw error;
|
|
131
|
-
}
|
|
132
|
-
}, [
|
|
133
|
-
client,
|
|
134
|
-
actions,
|
|
135
|
-
normalized,
|
|
136
|
-
item,
|
|
137
|
-
onAdded,
|
|
138
|
-
onCommit,
|
|
139
|
-
focusIssue,
|
|
140
|
-
branchRequired,
|
|
141
|
-
onBranchRequired
|
|
142
|
-
]);
|
|
143
|
-
const context = useMemo(
|
|
144
|
-
() => ({
|
|
145
|
-
item,
|
|
146
|
-
...preview,
|
|
147
|
-
quantity: normalized.quantity ?? item.quantity.min,
|
|
148
|
-
setQuantity,
|
|
149
|
-
issues,
|
|
150
|
-
canAdd: validation.ok && !failure,
|
|
151
|
-
add,
|
|
152
|
-
status: added ? "added" : validation.ok ? "valid" : "incomplete",
|
|
153
|
-
value: normalized,
|
|
154
|
-
setValue,
|
|
155
|
-
branchRequired
|
|
156
|
-
}),
|
|
157
|
-
[
|
|
158
|
-
item,
|
|
159
|
-
preview,
|
|
160
|
-
normalized,
|
|
161
|
-
setQuantity,
|
|
162
|
-
issues,
|
|
163
|
-
validation.ok,
|
|
164
|
-
failure,
|
|
165
|
-
add,
|
|
166
|
-
added,
|
|
167
|
-
setValue,
|
|
168
|
-
branchRequired
|
|
169
|
-
]
|
|
170
|
-
);
|
|
171
|
-
return /* @__PURE__ */ jsx(ItemFormStateContext.Provider, { value: context, children: /* @__PURE__ */ jsx(GroupRegistry.Provider, { value: registry.current, children: part("div", props, context, {
|
|
172
|
-
"data-zappie-item": item.id,
|
|
173
|
-
"data-state": issues.length ? "invalid" : "valid",
|
|
174
|
-
"data-sold-out": item.isAvailable ? void 0 : ""
|
|
175
|
-
}) }) });
|
|
176
|
-
}
|
|
177
|
-
export {
|
|
178
|
-
GroupRegistry,
|
|
179
|
-
ItemFormStateContext,
|
|
180
|
-
Root,
|
|
181
|
-
useItemForm
|
|
182
|
-
};
|
|
1
|
+
"use client";import{previewItem,ZappieCartError}from"@zappie/sdk";import{useCart,useCartCatalogue,useZappie}from"@zappie/sdk/react";import{createContext,useCallback,useContext,useMemo,useRef,useState}from"react";import{part}from"../internal/slot.js";import{useControllableState}from"../internal/use-controllable-state.js";import{jsx}from"react/jsx-runtime";var ItemFormStateContext=/*@__PURE__ */createContext(null);function useItemForm(){const value=useContext(ItemFormStateContext);if(!value){throw new Error("ItemForm parts require ItemForm.Root")}return value}var GroupRegistry=/*@__PURE__ */createContext(null);function Root({item,value,defaultValue,onValueChange,defaultQuantity,onAdded,onCommit,onInvalid,branchRequired=false,onBranchRequired,...props}){const client=useZappie();const{actions}=useCart();const menu=useCartCatalogue();const[input,setInput]=useControllableState({value,defaultValue:{...defaultValue,itemId:item.id,quantity:defaultQuantity??defaultValue?.quantity??item.quantity.min},onChange:onValueChange});const registry=useRef(new Map);const[added,setAdded]=useState(false);const[attempted,setAttempted]=useState(false);const[failure,setFailure]=useState(null);const normalized=useMemo(()=>({...input,itemId:item.id}),[input,item.id]);const preview=useMemo(()=>previewItem(item,normalized),[item,normalized]);const validation=useMemo(()=>client.cart.validate(normalized),[client,normalized,menu]);const issues=failure??(attempted&&!validation.ok?validation.issues:[]);const setValue=useCallback(next=>{setAdded(false);setFailure(null);setInput({...next,itemId:item.id})},[setInput,item.id]);const setQuantity=useCallback(quantity=>setValue({...normalized,quantity}),[setValue,normalized]);const focusIssue=useCallback(errors=>{const ids=new Set([...registry.current.keys(),...preview.groups.map(group=>group.id)]);const invalid=[...ids].flatMap(groupId=>{const issues2=errors.filter(issue=>issue.groupId===groupId);return issues2.length?[{groupId,group:preview.groups.find(group=>group.id===groupId),element:registry.current.get(groupId),issues:issues2}]:[]});invalid[0]?.element?.focus({preventScroll:true});onInvalid?.(invalid)},[preview.groups,onInvalid]);const add=useCallback(()=>{if(branchRequired){onBranchRequired?.(normalized);return null}const result=client.cart.validate(normalized);if(!result.ok){setAttempted(true);setFailure(result.issues);focusIssue(result.issues);return null}try{const line=onCommit?onCommit(normalized):actions.add(item,normalized);setAttempted(false);setAdded(true);onAdded?.(line);return line}catch(error){if(error instanceof ZappieCartError){setAttempted(true);setFailure([...error.issues]);focusIssue([...error.issues]);return null}throw error}},[client,actions,normalized,item,onAdded,onCommit,focusIssue,branchRequired,onBranchRequired]);const context=useMemo(()=>({item,...preview,quantity:normalized.quantity??item.quantity.min,setQuantity,issues,canAdd:validation.ok&&!failure,add,status:added?"added":validation.ok?"valid":"incomplete",value:normalized,setValue,branchRequired}),[item,preview,normalized,setQuantity,issues,validation.ok,failure,add,added,setValue,branchRequired]);return jsx(ItemFormStateContext.Provider,{value:context,children:jsx(GroupRegistry.Provider,{value:registry.current,children:part("div",props,context,{"data-zappie-item":item.id,"data-state":issues.length?"invalid":"valid","data-sold-out":item.isAvailable?void 0:""})})})}export{GroupRegistry,ItemFormStateContext,Root,useItemForm};
|
|
183
2
|
//# sourceMappingURL=root.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/item-form/root.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "aACA,OACE,YACA,oBAOK,cACP,OAAS,QAAS,iBAAkB,cAAiB,oBACrD,OACE,cACA,YACA,WACA,QACA,OACA,aACK,QACP,OAAS,SAA4B,sBACrC,OAAS,yBAA4B,wCAyO/B,mCAjNC,IAAM,qBACX,eAAgB,cAAsC,IAAI,EACrD,SAAS,aAAc,CAC5B,MAAM,MAAQ,WAAW,oBAAoB,EAC7C,GAAI,CAAC,MAAO,CACV,MAAM,IAAI,MAAM,sCAAsC,CACxD,CACA,OAAO,KACT,CAYO,IAAM,cAAgB,eAAgB,cAGnC,IAAI,EAkCP,SAAS,KAAK,CACnB,KACA,MACA,aACA,cACA,gBACA,QACA,SACA,UACA,eAAiB,MACjB,iBACA,GAAG,KACL,EAAkB,CAChB,MAAM,OAAS,UAAU,EACzB,KAAM,CAAE,OAAQ,EAAI,QAAQ,EAC5B,MAAM,KAAO,iBAAiB,EAC9B,KAAM,CAAC,MAAO,QAAQ,EAAI,qBAAqB,CAC7C,MACA,aAAc,CACZ,GAAG,aAC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K,GACzB,aAAc,OAAO,OAAS,UAAY,QAC1C,gBAAiB,KAAK,YAAc,OAAY,EAClD,CAAC,EACH,EACF,CAEJ",
|
|
5
5
|
"names": ["issues"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { O as OverlayQuery } from '../history-BlytQinP.js';
|
|
2
|
+
import { P as PartOwnedAttributes } from '../slot-CHfqzPTd.js';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { CartLineInput, Item } from '@zappie/sdk';
|
|
6
|
+
import { Deferred } from '../index.js';
|
|
7
|
+
import { a as OverlayContentProps, R as ResponsivePresentation } from '../react-CFPTPzAO.js';
|
|
8
|
+
import '../overlay/engine.js';
|
|
9
|
+
import '@base-ui/react/dialog';
|
|
10
|
+
|
|
11
|
+
/** What the site's sheet body receives. */
|
|
12
|
+
type ItemSheetBodyProps = {
|
|
13
|
+
/** The item the sheet shows. */
|
|
14
|
+
itemId: string;
|
|
15
|
+
/** Closes the sheet the way its close button does: Back to the page under it, or to `closeTo`. */
|
|
16
|
+
close: () => void;
|
|
17
|
+
};
|
|
18
|
+
/** The open sheet, from `useItemSheet()`. */
|
|
19
|
+
type ItemSheetState = {
|
|
20
|
+
/** The item open now, or `undefined` while no sheet is open. */
|
|
21
|
+
itemId: string | undefined;
|
|
22
|
+
/** Close the open sheet. */
|
|
23
|
+
close: () => void;
|
|
24
|
+
/** Open an item's sheet over the current page. */
|
|
25
|
+
open: (itemId: string) => void;
|
|
26
|
+
/** The item's address. */
|
|
27
|
+
href: (itemId: string) => string;
|
|
28
|
+
/** Start loading the sheet's code and the overlay engine. */
|
|
29
|
+
preload: () => void;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The open item sheet: its item, and actions to open, close and preload it.
|
|
33
|
+
* Use it inside `ItemSheet.Root`.
|
|
34
|
+
*/
|
|
35
|
+
declare function useItemSheet(): ItemSheetState;
|
|
36
|
+
/**
|
|
37
|
+
* Move focus to the card that opens `itemId` (an `ItemSheet.Trigger`, or any element with
|
|
38
|
+
* `data-zappie-item-link` set to the item's ID) without scrolling the page. `ItemSheet` does this
|
|
39
|
+
* itself when a sheet closes. Call it for an item you show another way, such as at a table.
|
|
40
|
+
*/
|
|
41
|
+
declare function returnFocusToCard(itemId: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Holds the item sheet for the routes under it. Put it in the layout or root whose `<Outlet />`
|
|
44
|
+
* renders both the pages a shopper opens items from and the item route, and render
|
|
45
|
+
* `ItemSheet.Page` in place of that `<Outlet />`.
|
|
46
|
+
*
|
|
47
|
+
* A tap paints the sheet at once and the address moves to the item a frame later. Closing goes
|
|
48
|
+
* Back when there is history to go back to, and otherwise replaces the address with `closeTo`.
|
|
49
|
+
*/
|
|
50
|
+
declare function Root({ sheet, href, closeTo, path, children, }: {
|
|
51
|
+
/** The site's sheet body: `deferred(() => import("./item-sheet-body"))`. */
|
|
52
|
+
sheet: Deferred<ItemSheetBodyProps>;
|
|
53
|
+
/** The item's address, such as `` (id) => `/item/${id}` ``. */
|
|
54
|
+
href: (itemId: string) => string;
|
|
55
|
+
/** Where closing a sheet opened from a link goes: the page shown under it. Defaults to `/`. */
|
|
56
|
+
closeTo?: string | ((itemId: string) => string);
|
|
57
|
+
/** The item route's path. Its `:id` names the item. Defaults to `/item/:id`. */
|
|
58
|
+
path?: string;
|
|
59
|
+
children?: ReactNode;
|
|
60
|
+
}): react.JSX.Element;
|
|
61
|
+
/**
|
|
62
|
+
* The page under the sheet: renders in place of the layout's `<Outlet />`. While the address
|
|
63
|
+
* names an item it keeps the page the shopper opened it from, mounted and unchanged, with the
|
|
64
|
+
* location and loader data it had. A sheet opened from a link has the item route's own element
|
|
65
|
+
* under it, so that route renders the page a link should open over, such as the menu.
|
|
66
|
+
*/
|
|
67
|
+
declare function Page(): react.JSX.Element;
|
|
68
|
+
/** Props for `ItemSheet.Content`: the dialog's own props, its presentation and its loading states. */
|
|
69
|
+
type ItemSheetContentProps = Omit<OverlayContentProps, "children" | "forceMount"> & {
|
|
70
|
+
/** A `sheet` or `drawer` drags to close on phones. Use `{ base, md, … }` for responsive layouts. Defaults to `drawer`. */
|
|
71
|
+
presentation?: ResponsivePresentation;
|
|
72
|
+
/**
|
|
73
|
+
* Shown in the sheet while its code loads, such as the item's name and photo. With a fallback the
|
|
74
|
+
* sheet opens at once, so its styles must already be on the page. Without one, a sheet whose code
|
|
75
|
+
* isn't in yet opens once the code and its styles are, and never paints unstyled.
|
|
76
|
+
*/
|
|
77
|
+
fallback?: (itemId: string) => ReactNode;
|
|
78
|
+
/** Shown when the sheet's code, or the overlay engine, didn't load. `retry` loads it again. */
|
|
79
|
+
failed: (retry: () => void, close: () => void) => ReactNode;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* The sheet itself: a foundations `Overlay` (focus trap, Escape, scroll lock, drag to close and the
|
|
83
|
+
* exit) holding the site's body. It stays mounted after closing so its exit can play, and focus
|
|
84
|
+
* goes back to the card that opened it.
|
|
85
|
+
*/
|
|
86
|
+
declare function Content({ presentation, fallback, failed, ...props }: ItemSheetContentProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react.JSX.Element | null | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* The product sheet over the current page, for React Router route modules. `Root` and `Page`
|
|
89
|
+
* go in the layout that holds the item route, `Content` anywhere under `Root`, and `Trigger` on
|
|
90
|
+
* each card. The body is the site's own, loaded with `deferred()`.
|
|
91
|
+
*/
|
|
92
|
+
declare const ItemSheet: {
|
|
93
|
+
Root: typeof Root;
|
|
94
|
+
Page: typeof Page;
|
|
95
|
+
Content: typeof Content;
|
|
96
|
+
Trigger: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
97
|
+
asChild?: boolean;
|
|
98
|
+
children?: ReactNode | ((state: ItemSheetState) => ReactNode);
|
|
99
|
+
} & {
|
|
100
|
+
itemId: string;
|
|
101
|
+
prefetch?: "none" | "intent" | "render" | "viewport";
|
|
102
|
+
} & react.RefAttributes<HTMLElement>>;
|
|
103
|
+
Title: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
104
|
+
asChild?: boolean;
|
|
105
|
+
children?: ReactNode | ((state: {
|
|
106
|
+
isOpen: boolean;
|
|
107
|
+
open: (query?: OverlayQuery) => void;
|
|
108
|
+
close: () => void;
|
|
109
|
+
}) => ReactNode);
|
|
110
|
+
} & react.RefAttributes<HTMLElement>>;
|
|
111
|
+
Close: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
112
|
+
asChild?: boolean;
|
|
113
|
+
children?: ReactNode | ((state: {
|
|
114
|
+
isOpen: boolean;
|
|
115
|
+
open: (query?: OverlayQuery) => void;
|
|
116
|
+
close: () => void;
|
|
117
|
+
}) => ReactNode);
|
|
118
|
+
} & react.RefAttributes<HTMLElement>>;
|
|
119
|
+
};
|
|
120
|
+
/** What the item page keeps in the history state while the shopper chooses a branch from Add. */
|
|
121
|
+
type KeptLine = {
|
|
122
|
+
line: CartLineInput;
|
|
123
|
+
};
|
|
124
|
+
/** The line kept in a history state, when the state holds one for this item. */
|
|
125
|
+
declare function keptLine(state: unknown, itemId: string): CartLineInput | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* The kept line as the chosen branch sells the item. Choices that branch doesn't have or has
|
|
128
|
+
* sold out are dropped, and so are answers to groups it doesn't ask. `dropped` says whether
|
|
129
|
+
* anything went. The quantity is held inside the item's limits.
|
|
130
|
+
*/
|
|
131
|
+
declare function restoreLine(item: Item, line: CartLineInput): {
|
|
132
|
+
value: Partial<CartLineInput>;
|
|
133
|
+
dropped: boolean;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export { ItemSheet, keptLine, restoreLine, returnFocusToCard, useItemSheet };
|
|
137
|
+
export type { ItemSheetBodyProps, ItemSheetContentProps, ItemSheetState, KeptLine };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{createContext,forwardRef,useContext,useEffect,useMemo,useRef,useState}from"react";import{flushSync}from"react-dom";import{UNSAFE_DataRouterDataContext as DataContext,Link,UNSAFE_LocationContext as LocationContext,matchPath,useLocation,useNavigate,useOutlet}from"react-router";import{part}from"../internal/slot.js";import{loadOverlayEngine}from"../overlay/load.js";import{Overlay}from"../overlay/react.js";import{jsx}from"react/jsx-runtime";var SheetContext=/*@__PURE__ */createContext(null);function useItemSheet(){const value=useContext(SheetContext);if(!value){throw new Error("ItemSheet parts require ItemSheet.Root")}return value}var loaded=new WeakSet;var ignore=()=>{};var load=sheet=>Promise.all([sheet.preload(),loadOverlayEngine()]).then(()=>{loaded.add(sheet)});function cardFor(itemId,card){return card?.isConnected&&card.dataset.zappieItemLink===itemId?card:itemId?document.querySelector(`[data-zappie-item-link="${CSS.escape(itemId)}"]`):null}function returnFocusToCard(itemId){cardFor(itemId)?.focus({preventScroll:true})}function Root({sheet,href,closeTo="/",path="/item/:id",children}){const{pathname}=useLocation();const navigate=useNavigate();const routed=matchPath(path,pathname)?.params.id;const[tapped,setTapped]=useState();const[leaving,setLeaving]=useState();const pending=useRef(void 0);const latest=useRef({navigate,href,closeTo,routed});latest.current={navigate,href,closeTo,routed};const card=useRef(void 0);useEffect(()=>{if(routed){setTapped(void 0);pending.current=void 0;if(routed===leaving){setLeaving(void 0);void latest.current.navigate(-1)}}},[routed]);useEffect(()=>{const start=()=>load(sheet).catch(ignore);if(typeof window.requestIdleCallback==="function"){const handle2=window.requestIdleCallback(start);return()=>window.cancelIdleCallback(handle2)}const handle=window.setTimeout(start,1);return()=>window.clearTimeout(handle)},[sheet]);const itemId=(routed!==leaving?routed:void 0)??tapped;const actions=useMemo(()=>({href:id=>latest.current.href(id),preload:()=>{load(sheet).catch(ignore)},open:id=>{setLeaving(void 0);flushSync(()=>setTapped(id));const step={frame:requestAnimationFrame(()=>{step.timer=window.setTimeout(()=>{step.sent=id;void latest.current.navigate(latest.current.href(id),{preventScrollReset:true})})})};pending.current=step},close:()=>{const{navigate:navigate2,closeTo:closeTo2,routed:routed2}=latest.current;const step=pending.current;if(!routed2){pending.current=void 0;if(step?.sent){setLeaving(step.sent)}else if(step){cancelAnimationFrame(step.frame);window.clearTimeout(step.timer)}setTapped(void 0)}else if((window.history.state?.idx??0)>0){void navigate2(-1)}else{void navigate2(typeof closeTo2==="string"?closeTo2:closeTo2(routed2),{replace:true,preventScrollReset:true})}}}),[sheet]);const value=useMemo(()=>({...actions,itemId,routed:!!routed,sheet,card}),[actions,itemId,routed,sheet]);return jsx(SheetContext.Provider,{value,children})}function Page(){const{routed}=useItemSheet();const live={outlet:useOutlet(),location:useContext(LocationContext),data:useContext(DataContext)};const[kept,setKept]=useState(live);if(!routed&&(kept.outlet!==live.outlet||kept.location!==live.location||kept.data!==live.data)){setKept(live)}const{outlet,location,data}=routed?kept:live;return jsx(LocationContext.Provider,{value:location,children:jsx(DataContext.Provider,{value:data,children:outlet})})}function Content({presentation="drawer",fallback,failed,...props}){const{itemId,close,sheet,card}=useItemSheet();const[last,setLast]=useState(itemId);if(itemId&&itemId!==last){setLast(itemId)}const[arrived,setArrived]=useState();const[tries,setTries]=useState(0);const open=!!itemId;useEffect(()=>{let live=open;if(live){setArrived(value=>value||void 0);load(sheet).then(()=>live&&setArrived(true),()=>live&&setArrived(false))}return()=>{live=false}},[open,sheet,tries]);const navigation=useMemo(()=>({isOpen:open,open:ignore,close,trigger:{get current(){return cardFor(last,card.current)}}}),[open,close,last,card]);if(!last){return null}if(arrived===false){return open?failed(()=>{setArrived(void 0);setTries(count=>count+1)},close):null}if(!(fallback||arrived||loaded.has(sheet))){return null}return jsx(Overlay.Root,{param:"item",id:last,navigation,presentation,children:jsx(Overlay.Content,{"data-zappie-overlay":"item",...props,children:jsx(sheet.Component,{open:true,itemId:last,close,fallback:fallback?.(last),failed:retry=>failed(retry,close)},last)})})}var Trigger=/*@__PURE__ */forwardRef(function Trigger2({itemId,prefetch="viewport",...props},ref){const state=useItemSheet();const href=state.href(itemId);return part(props.asChild?"a":Link,props,state,{...props.asChild?{href}:{to:href,prefetch},"data-zappie-item-link":itemId,"data-zappie-overlay-trigger":"item",onPointerEnter:state.preload,onPointerDown:state.preload,onFocus:state.preload,onClick:event=>{if(event.button===0&&!(event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)){event.preventDefault();state.card.current=event.currentTarget;state.open(itemId)}}},ref)});var ItemSheet={Root,Page,Content,Trigger,Title:Overlay.Title,Close:Overlay.Close};function keptLine(state,itemId){const line=state?.line;return line&&typeof line==="object"&&line.itemId===itemId?line:void 0}function restoreLine(item,line){const groups=new Map(item.optionGroups.map(group=>[group.id,group]));const chosen=line.choices??[];const asked=Object.entries(line.inputs??{});const choices=chosen.filter(entry=>groups.get(entry.groupId)?.choices.some(choice=>choice.id===entry.choiceId&&choice.isAvailable));const inputs=asked.filter(([groupId])=>groups.has(groupId));return{value:{itemId:item.id,quantity:Math.min(Math.max(line.quantity??item.quantity.min,item.quantity.min),item.quantity.max??Infinity),...choices.length>0?{choices}:{},...inputs.length>0?{inputs:Object.fromEntries(inputs)}:{},...line.note?{note:line.note}:{}},dropped:choices.length!==chosen.length||inputs.length!==asked.length}}export{ItemSheet,keptLine,restoreLine,returnFocusToCard,useItemSheet};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/item-sheet/index.tsx"],
|
|
4
|
+
"mappings": "aAEA,OACE,cACA,WACA,WACA,UACA,QACA,OACA,aAEK,QACP,OAAS,cAAiB,YAC1B,OACE,gCAAgC,YAChC,KACA,0BAA0B,gBAC1B,UACA,YACA,YACA,cACK,eAEP,OAAS,SAA4B,sBACrC,OAAS,sBAA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