@shoplix-ai/block-kit 4.6.0 → 5.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/README.md +116 -10
- package/dist/account-links.d.ts +96 -0
- package/dist/account-links.d.ts.map +1 -0
- package/dist/account-links.js +121 -0
- package/dist/account-links.js.map +1 -0
- package/dist/address-list.d.ts +58 -0
- package/dist/address-list.d.ts.map +1 -0
- package/dist/address-list.js +57 -0
- package/dist/address-list.js.map +1 -0
- package/dist/buy-box.d.ts +8 -0
- package/dist/buy-box.d.ts.map +1 -1
- package/dist/buy-box.js +8 -0
- package/dist/buy-box.js.map +1 -1
- package/dist/capabilities.d.ts +12 -2
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/category-grid.d.ts +92 -0
- package/dist/category-grid.d.ts.map +1 -0
- package/dist/category-grid.js +123 -0
- package/dist/category-grid.js.map +1 -0
- package/dist/color-choice.d.ts +4 -0
- package/dist/color-choice.d.ts.map +1 -0
- package/dist/color-choice.js +11 -0
- package/dist/color-choice.js.map +1 -0
- package/dist/content-direction.d.ts +10 -0
- package/dist/content-direction.d.ts.map +1 -0
- package/dist/content-direction.js +20 -0
- package/dist/content-direction.js.map +1 -0
- package/dist/contract.d.ts +20 -14
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +3 -2
- package/dist/contract.js.map +1 -1
- package/dist/description.d.ts +60 -0
- package/dist/description.d.ts.map +1 -0
- package/dist/description.js +332 -0
- package/dist/description.js.map +1 -0
- package/dist/hero-banner.d.ts +10 -1
- package/dist/hero-banner.d.ts.map +1 -1
- package/dist/hero-banner.js +17 -0
- package/dist/hero-banner.js.map +1 -1
- package/dist/index.d.ts +32 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -8
- package/dist/index.js.map +1 -1
- package/dist/listing-filters.d.ts +114 -0
- package/dist/listing-filters.d.ts.map +1 -0
- package/dist/listing-filters.js +195 -0
- package/dist/listing-filters.js.map +1 -0
- package/dist/listing-toolbar.d.ts +117 -0
- package/dist/listing-toolbar.d.ts.map +1 -0
- package/dist/listing-toolbar.js +130 -0
- package/dist/listing-toolbar.js.map +1 -0
- package/dist/money.d.ts +7 -0
- package/dist/money.d.ts.map +1 -1
- package/dist/money.js +15 -0
- package/dist/money.js.map +1 -1
- package/dist/navigation.d.ts +10 -2
- package/dist/navigation.d.ts.map +1 -1
- package/dist/orders.d.ts +162 -0
- package/dist/orders.d.ts.map +1 -0
- package/dist/orders.js +302 -0
- package/dist/orders.js.map +1 -0
- package/dist/product-card.d.ts +4 -0
- package/dist/product-card.d.ts.map +1 -1
- package/dist/product-card.js +4 -0
- package/dist/product-card.js.map +1 -1
- package/dist/product-gallery.d.ts +3 -0
- package/dist/product-gallery.d.ts.map +1 -1
- package/dist/product-gallery.js +3 -0
- package/dist/product-gallery.js.map +1 -1
- package/dist/product-specs.d.ts +33 -2
- package/dist/product-specs.d.ts.map +1 -1
- package/dist/product-specs.js +51 -2
- package/dist/product-specs.js.map +1 -1
- package/dist/product-summary.d.ts +12 -1
- package/dist/product-summary.d.ts.map +1 -1
- package/dist/product-summary.js +29 -0
- package/dist/product-summary.js.map +1 -1
- package/dist/profile-header.d.ts +30 -0
- package/dist/profile-header.d.ts.map +1 -0
- package/dist/profile-header.js +36 -0
- package/dist/profile-header.js.map +1 -0
- package/dist/promo-banner.d.ts +11 -1
- package/dist/promo-banner.d.ts.map +1 -1
- package/dist/promo-banner.js +24 -0
- package/dist/promo-banner.js.map +1 -1
- package/dist/section-header.d.ts +5 -1
- package/dist/section-header.d.ts.map +1 -1
- package/dist/section-header.js +5 -1
- package/dist/section-header.js.map +1 -1
- package/dist/sign-in.d.ts +28 -0
- package/dist/sign-in.d.ts.map +1 -0
- package/dist/sign-in.js +27 -0
- package/dist/sign-in.js.map +1 -0
- package/dist/store-header.d.ts +49 -6
- package/dist/store-header.d.ts.map +1 -1
- package/dist/store-header.js +59 -5
- package/dist/store-header.js.map +1 -1
- package/dist/variant-choice.d.ts +14 -0
- package/dist/variant-choice.d.ts.map +1 -1
- package/dist/variant-choice.js +36 -0
- package/dist/variant-choice.js.map +1 -1
- package/dist/variant-rows.d.ts +33 -0
- package/dist/variant-rows.d.ts.map +1 -0
- package/dist/variant-rows.js +52 -0
- package/dist/variant-rows.js.map +1 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +2 -2
- package/dist/version.js.map +1 -1
- package/dist/words.d.ts +185 -0
- package/dist/words.d.ts.map +1 -1
- package/dist/words.js +530 -4
- package/dist/words.js.map +1 -1
- package/package.json +2 -2
package/dist/money.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money.js","sourceRoot":"","sources":["../src/money.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAIpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,aAAa,GAAG,YAAY,CAAC;AAEnC,mEAAmE;AACnE,MAAM,OAAO,GAAG,eAAe,CAAC;AAEhC,uEAAuE;AACvE,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,MAAuB,EACvB,YAAoB,EACpB,QAAgB;IAEhB,MAAM,KAAK,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAC1F,OAAO,IAAI,CAAC;IACd,CAAC;IACD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,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACpG,CAAC"}
|
package/dist/navigation.d.ts
CHANGED
|
@@ -3,8 +3,12 @@ import type { Action } from '@shoplix-ai/sdui-schema';
|
|
|
3
3
|
* The only way a renderer moves the buyer, and it is as closed as the
|
|
4
4
|
* capability set: the action the document itself carries, and the implicit
|
|
5
5
|
* taps a block owns by its own kind — a card opening its entity, a search bar
|
|
6
|
-
* opening search
|
|
7
|
-
*
|
|
6
|
+
* opening search, a row of the orders opening its order or its tracking, the
|
|
7
|
+
* order opening the page Shopify hosts for it, a saved address opening the
|
|
8
|
+
* Address Sheet on itself. A renderer never sees a route, never a screen the
|
|
9
|
+
* document did not name, and never the router that owns them. The last four
|
|
10
|
+
* are absent on a host written before them, so a renderer calls each only
|
|
11
|
+
* where it is there.
|
|
8
12
|
*/
|
|
9
13
|
export interface BlockNavigation {
|
|
10
14
|
readonly run: (action: Action) => void;
|
|
@@ -12,5 +16,9 @@ export interface BlockNavigation {
|
|
|
12
16
|
readonly openCollection: (collectionId: string) => void;
|
|
13
17
|
readonly openSearch: () => void;
|
|
14
18
|
readonly openAccount: () => void;
|
|
19
|
+
readonly openOrder?: (orderId: string) => void;
|
|
20
|
+
readonly openOrderTracking?: (orderId: string) => void;
|
|
21
|
+
readonly openOrderPage?: (url: string) => void;
|
|
22
|
+
readonly openAddress?: (addressId: string) => void;
|
|
15
23
|
}
|
|
16
24
|
//# sourceMappingURL=navigation.d.ts.map
|
package/dist/navigation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD"}
|
package/dist/orders.d.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { type DisplayMoney, type FulfillmentDisplay, type FulfillmentEventStatus, type FulfillmentStatus, type LocaleCode, type OrderDisplay, type OrderLineDisplay, type OrderLinesBlock, type OrderListBlock, type OrderSummaryBlock, type StatusTokenName, type ThemeStyle } from '@shoplix-ai/sdui-schema';
|
|
2
|
+
import type { WordKey } from './words.js';
|
|
3
|
+
/**
|
|
4
|
+
* How a pill reads at a glance: a state still moving, one that ended well,
|
|
5
|
+
* one that ended otherwise, and one that says nothing either way.
|
|
6
|
+
*/
|
|
7
|
+
export type OrderPillTone = 'progress' | 'done' | 'stopped' | 'quiet';
|
|
8
|
+
/** One pill as both renderers draw it: the platform's word for the state, and its tone. */
|
|
9
|
+
export interface OrderPill {
|
|
10
|
+
readonly word: WordKey;
|
|
11
|
+
readonly tone: OrderPillTone;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Where the shipping of an order stands. A cancelled order says so whatever
|
|
15
|
+
* its shipping state was. Delivered is read off the newest event of every
|
|
16
|
+
* live shipment, which the opened order and a row of the list both carry; a
|
|
17
|
+
* row that carries no shipment says what the fulfillment state says.
|
|
18
|
+
*/
|
|
19
|
+
export declare function fulfillmentPillOf(order: OrderDisplay): OrderPill;
|
|
20
|
+
/** Where the payment of an order stands. */
|
|
21
|
+
export declare function paymentPillOf(order: OrderDisplay): OrderPill;
|
|
22
|
+
export interface OrderPillColors {
|
|
23
|
+
readonly ink: string;
|
|
24
|
+
readonly surface: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The ink and the surface of a pill: the label and the surface the theme
|
|
28
|
+
* names for the pill's state at `status.<state>`. A theme written before those
|
|
29
|
+
* draws what it drew then: `order.pill_<tone>` and `order.pill_<tone>_surface`
|
|
30
|
+
* where it names them, and the tone's role on the sunken well behind those.
|
|
31
|
+
* No theme role is a red and none is a tint, so a stopped pill of a theme
|
|
32
|
+
* that names nothing draws the warning role.
|
|
33
|
+
*/
|
|
34
|
+
export declare function orderPillColors(theme: ThemeStyle, tone: OrderPillTone): OrderPillColors;
|
|
35
|
+
/** The pair each of the three states is drawn in, as a pill of that state would draw it. */
|
|
36
|
+
export declare function orderStatusColors(theme: ThemeStyle): Readonly<Record<StatusTokenName, OrderPillColors>>;
|
|
37
|
+
/** The four steps of the progress rail, in the order a parcel passes them. */
|
|
38
|
+
export declare const SHIPMENT_STEPS: readonly ["confirmed", "in_transit", "out_for_delivery", "delivered"];
|
|
39
|
+
export type ShipmentStep = (typeof SHIPMENT_STEPS)[number];
|
|
40
|
+
/**
|
|
41
|
+
* The furthest step of the rail a shipment has reached, by the events the
|
|
42
|
+
* carrier told Shopify. A shipment Shopify holds with no event yet stands on
|
|
43
|
+
* the first step; one that was cancelled or failed stands on none.
|
|
44
|
+
*/
|
|
45
|
+
export declare function shipmentStepReached(shipment: FulfillmentDisplay): number;
|
|
46
|
+
/** The platform's word for one step of a shipment's way, which is also the word under a step of the rail. */
|
|
47
|
+
export declare function fulfillmentEventWord(status: FulfillmentEventStatus): WordKey;
|
|
48
|
+
/**
|
|
49
|
+
* The platform's word for the state of one shipment: Delivered where its
|
|
50
|
+
* newest event says it arrived, the word of the state Shopify holds it in
|
|
51
|
+
* otherwise. Handed a state alone, the word of that state.
|
|
52
|
+
*/
|
|
53
|
+
export declare function shipmentWord(shipmentOrState: FulfillmentDisplay | FulfillmentStatus): WordKey;
|
|
54
|
+
/** One money row of the order summary: the platform's word and Shopify's amount. */
|
|
55
|
+
export interface OrderMoneyRow {
|
|
56
|
+
readonly key: 'subtotal' | 'discount' | 'shipping' | 'tax';
|
|
57
|
+
readonly word: WordKey;
|
|
58
|
+
readonly money: DisplayMoney;
|
|
59
|
+
}
|
|
60
|
+
/** The money rows over the total, in reading order, each only where Shopify wrote it. */
|
|
61
|
+
export declare function orderMoneyRows(order: OrderDisplay): readonly OrderMoneyRow[];
|
|
62
|
+
/** A timestamp as the day a shopper reads, in their language and the phone's own time zone. */
|
|
63
|
+
export declare function orderDay(iso: string, language: LocaleCode, timeZone?: string): string;
|
|
64
|
+
/** A timestamp as a time of day, beside the day a timeline row already names. */
|
|
65
|
+
export declare function orderTime(iso: string, language: LocaleCode, timeZone?: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* The parts the order blocks share, each with the theme role it draws unless a
|
|
68
|
+
* component token names another. The eight blocks read one table, so a design
|
|
69
|
+
* names the stroke of an order card once. The summary's inks are parts of
|
|
70
|
+
* their own, so a design can give the summary its near-blacks without moving
|
|
71
|
+
* the other blocks.
|
|
72
|
+
*/
|
|
73
|
+
declare const ORDER_ROLES: {
|
|
74
|
+
readonly card: "surface";
|
|
75
|
+
readonly border: "border";
|
|
76
|
+
readonly title: "text";
|
|
77
|
+
readonly body: "muted";
|
|
78
|
+
readonly picture: "sunken";
|
|
79
|
+
readonly summary: "elevated";
|
|
80
|
+
readonly rule: "border";
|
|
81
|
+
readonly total: "text";
|
|
82
|
+
readonly rail_done: "text";
|
|
83
|
+
readonly rail_todo: "border";
|
|
84
|
+
readonly rail_dash: "subtle";
|
|
85
|
+
readonly link: "action";
|
|
86
|
+
readonly button: "action";
|
|
87
|
+
readonly chevron: "muted";
|
|
88
|
+
readonly chip: "sunken";
|
|
89
|
+
readonly chip_ink: "muted";
|
|
90
|
+
readonly chip_stroke: "border";
|
|
91
|
+
readonly summary_title: "text";
|
|
92
|
+
readonly summary_row: "text";
|
|
93
|
+
readonly summary_total: "text";
|
|
94
|
+
readonly summary_amount: "text";
|
|
95
|
+
};
|
|
96
|
+
export type OrderPart = keyof typeof ORDER_ROLES;
|
|
97
|
+
export type OrderColors = Readonly<Record<OrderPart, string>>;
|
|
98
|
+
/** Every colour the order blocks draw beside the pills, one per part, with `order.<part>` over each theme role. */
|
|
99
|
+
export declare function orderColors(theme: ThemeStyle): OrderColors;
|
|
100
|
+
/** The corner an order card is cut with: the merchant's own, with `order.radius` over it. */
|
|
101
|
+
export declare function orderRadius(theme: ThemeStyle): number;
|
|
102
|
+
/** The card one line of an order stands on: its surface, its corner and the corner of its picture. */
|
|
103
|
+
export interface OrderLineCard {
|
|
104
|
+
readonly surface: string;
|
|
105
|
+
readonly radius: number;
|
|
106
|
+
readonly pictureRadius: number;
|
|
107
|
+
}
|
|
108
|
+
/** The card one row of the orders list stands on: the line around it, its corner and its inner space. */
|
|
109
|
+
export interface OrderRowCard {
|
|
110
|
+
readonly stroke: string;
|
|
111
|
+
readonly radius: number;
|
|
112
|
+
readonly padding: number;
|
|
113
|
+
}
|
|
114
|
+
export interface OrderListCards {
|
|
115
|
+
readonly row: OrderRowCard;
|
|
116
|
+
readonly line: OrderLineCard;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The card one line of an order stands on, in the list and on the order
|
|
120
|
+
* screen alike: what the merchant set, and the order blocks' own surface and
|
|
121
|
+
* corner where they set nothing. The corner of the picture is
|
|
122
|
+
* `order.picture_radius`, the theme's corner behind it.
|
|
123
|
+
*/
|
|
124
|
+
export declare function orderLineCard(theme: ThemeStyle, lineCard: OrderLinesBlock['props']['lineCard']): OrderLineCard;
|
|
125
|
+
/**
|
|
126
|
+
* The two cards of a row of the orders list: what the merchant set, and for
|
|
127
|
+
* every part they left out the look the list had before the cards were
|
|
128
|
+
* settings: the order blocks' stroke and corner, twelve points inside, and
|
|
129
|
+
* under the first line the card a line of the order screen stands on.
|
|
130
|
+
*/
|
|
131
|
+
export declare function orderListCards(theme: ThemeStyle, settings: OrderListBlock['props']): OrderListCards;
|
|
132
|
+
/** The box the money rows stand in: its surface, the line under each row and its corner. */
|
|
133
|
+
export interface OrderSummaryBox {
|
|
134
|
+
readonly surface: string;
|
|
135
|
+
readonly divider: string;
|
|
136
|
+
readonly radius: number;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The summary box as the merchant set it, and the look it had before these
|
|
140
|
+
* were settings where they set nothing: the order blocks' summary surface and
|
|
141
|
+
* rule, and the theme's corner.
|
|
142
|
+
*/
|
|
143
|
+
export declare function orderSummaryBox(theme: ThemeStyle, settings: OrderSummaryBlock['props']): OrderSummaryBox;
|
|
144
|
+
/** What a row of the list draws of an order's lines. A count Shopify did not hand in full is null. */
|
|
145
|
+
export interface OrderItems {
|
|
146
|
+
readonly firstLine: OrderLineDisplay | null;
|
|
147
|
+
readonly otherLines: number | null;
|
|
148
|
+
readonly itemCount: number | null;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The first line of an order, how many lines follow it and how many items it
|
|
152
|
+
* holds: what a row of a page carries, or what the lines of a whole order add
|
|
153
|
+
* up to. A row whose lines Shopify did not hand in full knows neither count.
|
|
154
|
+
*/
|
|
155
|
+
export declare function orderItemsOf(order: OrderDisplay): OrderItems;
|
|
156
|
+
/**
|
|
157
|
+
* Whether Shopify holds a shipment of the order, the one thing its tracking
|
|
158
|
+
* can show: the shipments a whole order carries, or what a row of a page says.
|
|
159
|
+
*/
|
|
160
|
+
export declare function orderHasShipments(order: OrderDisplay): boolean;
|
|
161
|
+
export {};
|
|
162
|
+
//# sourceMappingURL=orders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../src/orders.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtE,2FAA2F;AAC3F,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;CAC9B;AAuCD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAOhE;AAED,4CAA4C;AAC5C,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAE5D;AASD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAUD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,eAAe,CASvF;AAED,4FA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E,iBAAiB,CAAC,OAAO,CAAC,GACnC,eAAe,CAOjB;AAED,sGAAsG;AACtG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,CAU5D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAG9D"}
|
package/dist/orders.js
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { componentTokenValue, statusTokenPath, } from '@shoplix-ai/sdui-schema';
|
|
2
|
+
import { colorChoiceOf } from './color-choice.js';
|
|
3
|
+
import { partColors } from './part-colors.js';
|
|
4
|
+
const CANCELLED = { word: 'order.cancelled', tone: 'stopped' };
|
|
5
|
+
const DELIVERED = { word: 'order.delivered', tone: 'done' };
|
|
6
|
+
const FULFILLMENT_PILLS = {
|
|
7
|
+
fulfilled: { word: 'order.fulfillment.fulfilled', tone: 'done' },
|
|
8
|
+
in_progress: { word: 'order.fulfillment.in_progress', tone: 'progress' },
|
|
9
|
+
on_hold: { word: 'order.fulfillment.on_hold', tone: 'progress' },
|
|
10
|
+
open: { word: 'order.fulfillment.open', tone: 'progress' },
|
|
11
|
+
partially_fulfilled: { word: 'order.fulfillment.partially_fulfilled', tone: 'progress' },
|
|
12
|
+
pending_fulfillment: { word: 'order.fulfillment.pending_fulfillment', tone: 'progress' },
|
|
13
|
+
restocked: { word: 'order.fulfillment.restocked', tone: 'stopped' },
|
|
14
|
+
scheduled: { word: 'order.fulfillment.scheduled', tone: 'progress' },
|
|
15
|
+
unfulfilled: { word: 'order.fulfillment.unfulfilled', tone: 'progress' },
|
|
16
|
+
};
|
|
17
|
+
const PAYMENT_PILLS = {
|
|
18
|
+
authorized: { word: 'order.payment.authorized', tone: 'progress' },
|
|
19
|
+
expired: { word: 'order.payment.expired', tone: 'stopped' },
|
|
20
|
+
paid: { word: 'order.payment.paid', tone: 'done' },
|
|
21
|
+
partially_paid: { word: 'order.payment.partially_paid', tone: 'progress' },
|
|
22
|
+
partially_refunded: { word: 'order.payment.partially_refunded', tone: 'quiet' },
|
|
23
|
+
pending: { word: 'order.payment.pending', tone: 'progress' },
|
|
24
|
+
refunded: { word: 'order.payment.refunded', tone: 'stopped' },
|
|
25
|
+
voided: { word: 'order.payment.voided', tone: 'stopped' },
|
|
26
|
+
};
|
|
27
|
+
const ARRIVED = new Set(['delivered', 'picked_up']);
|
|
28
|
+
/**
|
|
29
|
+
* Whether a live shipment reached the shopper: its newest event, the first of
|
|
30
|
+
* the events Shopify hands newest first, says it was delivered or picked up.
|
|
31
|
+
*/
|
|
32
|
+
function arrived(shipment) {
|
|
33
|
+
const newest = shipment.events?.[0];
|
|
34
|
+
return shipment.status === 'success' && newest !== undefined && ARRIVED.has(newest.status);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Where the shipping of an order stands. A cancelled order says so whatever
|
|
38
|
+
* its shipping state was. Delivered is read off the newest event of every
|
|
39
|
+
* live shipment, which the opened order and a row of the list both carry; a
|
|
40
|
+
* row that carries no shipment says what the fulfillment state says.
|
|
41
|
+
*/
|
|
42
|
+
export function fulfillmentPillOf(order) {
|
|
43
|
+
if (order.cancelledAt !== undefined)
|
|
44
|
+
return CANCELLED;
|
|
45
|
+
const live = (order.fulfillments ?? []).filter((shipment) => shipment.status === 'success');
|
|
46
|
+
if (order.fulfillmentStatus === 'fulfilled' && live.length > 0 && live.every(arrived)) {
|
|
47
|
+
return DELIVERED;
|
|
48
|
+
}
|
|
49
|
+
return FULFILLMENT_PILLS[order.fulfillmentStatus];
|
|
50
|
+
}
|
|
51
|
+
/** Where the payment of an order stands. */
|
|
52
|
+
export function paymentPillOf(order) {
|
|
53
|
+
return PAYMENT_PILLS[order.financialStatus];
|
|
54
|
+
}
|
|
55
|
+
const PILL_ROLES = {
|
|
56
|
+
progress: 'warning',
|
|
57
|
+
done: 'success',
|
|
58
|
+
stopped: 'warning',
|
|
59
|
+
quiet: 'muted',
|
|
60
|
+
};
|
|
61
|
+
/** The state a tone is drawn in: the three states a theme names colours for, and the quiet tone none. */
|
|
62
|
+
const STATE_OF_TONE = {
|
|
63
|
+
progress: 'pending',
|
|
64
|
+
done: 'delivered',
|
|
65
|
+
stopped: 'cancelled',
|
|
66
|
+
quiet: null,
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* The ink and the surface of a pill: the label and the surface the theme
|
|
70
|
+
* names for the pill's state at `status.<state>`. A theme written before those
|
|
71
|
+
* draws what it drew then: `order.pill_<tone>` and `order.pill_<tone>_surface`
|
|
72
|
+
* where it names them, and the tone's role on the sunken well behind those.
|
|
73
|
+
* No theme role is a red and none is a tint, so a stopped pill of a theme
|
|
74
|
+
* that names nothing draws the warning role.
|
|
75
|
+
*/
|
|
76
|
+
export function orderPillColors(theme, tone) {
|
|
77
|
+
const ink = componentTokenValue(theme, `order.pill_${tone}`, theme.colors[PILL_ROLES[tone]]);
|
|
78
|
+
const surface = componentTokenValue(theme, `order.pill_${tone}_surface`, theme.colors.sunken);
|
|
79
|
+
const state = STATE_OF_TONE[tone];
|
|
80
|
+
if (state === null)
|
|
81
|
+
return { ink, surface };
|
|
82
|
+
return {
|
|
83
|
+
ink: componentTokenValue(theme, statusTokenPath(state, 'label'), ink),
|
|
84
|
+
surface: componentTokenValue(theme, statusTokenPath(state, 'surface'), surface),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** The pair each of the three states is drawn in, as a pill of that state would draw it. */
|
|
88
|
+
export function orderStatusColors(theme) {
|
|
89
|
+
return {
|
|
90
|
+
pending: orderPillColors(theme, 'progress'),
|
|
91
|
+
delivered: orderPillColors(theme, 'done'),
|
|
92
|
+
cancelled: orderPillColors(theme, 'stopped'),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** The four steps of the progress rail, in the order a parcel passes them. */
|
|
96
|
+
export const SHIPMENT_STEPS = ['confirmed', 'in_transit', 'out_for_delivery', 'delivered'];
|
|
97
|
+
const STEP_OF_EVENT = {
|
|
98
|
+
label_purchased: 0,
|
|
99
|
+
label_printed: 0,
|
|
100
|
+
confirmed: 0,
|
|
101
|
+
ready_for_pickup: 0,
|
|
102
|
+
carrier_picked_up: 1,
|
|
103
|
+
in_transit: 1,
|
|
104
|
+
delayed: 1,
|
|
105
|
+
failure: 1,
|
|
106
|
+
out_for_delivery: 2,
|
|
107
|
+
attempted_delivery: 2,
|
|
108
|
+
delivered: 3,
|
|
109
|
+
picked_up: 3,
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* The furthest step of the rail a shipment has reached, by the events the
|
|
113
|
+
* carrier told Shopify. A shipment Shopify holds with no event yet stands on
|
|
114
|
+
* the first step; one that was cancelled or failed stands on none.
|
|
115
|
+
*/
|
|
116
|
+
export function shipmentStepReached(shipment) {
|
|
117
|
+
if (shipment.status !== 'success' &&
|
|
118
|
+
shipment.status !== 'open' &&
|
|
119
|
+
shipment.status !== 'pending') {
|
|
120
|
+
return -1;
|
|
121
|
+
}
|
|
122
|
+
return (shipment.events ?? []).reduce((reached, event) => Math.max(reached, STEP_OF_EVENT[event.status]), 0);
|
|
123
|
+
}
|
|
124
|
+
const EVENT_WORDS = {
|
|
125
|
+
attempted_delivery: 'order.event.attempted_delivery',
|
|
126
|
+
carrier_picked_up: 'order.event.carrier_picked_up',
|
|
127
|
+
confirmed: 'order.event.confirmed',
|
|
128
|
+
delayed: 'order.event.delayed',
|
|
129
|
+
delivered: 'order.delivered',
|
|
130
|
+
failure: 'order.event.failure',
|
|
131
|
+
in_transit: 'order.event.in_transit',
|
|
132
|
+
label_printed: 'order.event.label_printed',
|
|
133
|
+
label_purchased: 'order.event.label_purchased',
|
|
134
|
+
out_for_delivery: 'order.event.out_for_delivery',
|
|
135
|
+
picked_up: 'order.event.picked_up',
|
|
136
|
+
ready_for_pickup: 'order.event.ready_for_pickup',
|
|
137
|
+
};
|
|
138
|
+
/** The platform's word for one step of a shipment's way, which is also the word under a step of the rail. */
|
|
139
|
+
export function fulfillmentEventWord(status) {
|
|
140
|
+
return EVENT_WORDS[status];
|
|
141
|
+
}
|
|
142
|
+
const SHIPMENT_WORDS = {
|
|
143
|
+
cancelled: 'order.cancelled',
|
|
144
|
+
error: 'order.shipment_failed',
|
|
145
|
+
failure: 'order.shipment_failed',
|
|
146
|
+
open: 'order.fulfillment.open',
|
|
147
|
+
pending: 'order.fulfillment.pending_fulfillment',
|
|
148
|
+
success: 'order.fulfillment.fulfilled',
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* The platform's word for the state of one shipment: Delivered where its
|
|
152
|
+
* newest event says it arrived, the word of the state Shopify holds it in
|
|
153
|
+
* otherwise. Handed a state alone, the word of that state.
|
|
154
|
+
*/
|
|
155
|
+
export function shipmentWord(shipmentOrState) {
|
|
156
|
+
if (typeof shipmentOrState === 'string')
|
|
157
|
+
return SHIPMENT_WORDS[shipmentOrState];
|
|
158
|
+
return arrived(shipmentOrState) ? DELIVERED.word : SHIPMENT_WORDS[shipmentOrState.status];
|
|
159
|
+
}
|
|
160
|
+
const MONEY_ROWS = [
|
|
161
|
+
['subtotal', 'cart.subtotal'],
|
|
162
|
+
['discount', 'cart.discount'],
|
|
163
|
+
['shipping', 'cart.shipping'],
|
|
164
|
+
['tax', 'order.tax'],
|
|
165
|
+
];
|
|
166
|
+
/** The money rows over the total, in reading order, each only where Shopify wrote it. */
|
|
167
|
+
export function orderMoneyRows(order) {
|
|
168
|
+
const rows = [];
|
|
169
|
+
for (const [key, word] of MONEY_ROWS) {
|
|
170
|
+
const money = order[key];
|
|
171
|
+
if (money !== undefined)
|
|
172
|
+
rows.push({ key, word, money });
|
|
173
|
+
}
|
|
174
|
+
return rows;
|
|
175
|
+
}
|
|
176
|
+
function written(iso, language, options, timeZone) {
|
|
177
|
+
const moment = new Date(iso);
|
|
178
|
+
if (Number.isNaN(moment.getTime()))
|
|
179
|
+
return iso;
|
|
180
|
+
try {
|
|
181
|
+
return new Intl.DateTimeFormat(language, { ...options, timeZone }).format(moment);
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
return iso;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** A timestamp as the day a shopper reads, in their language and the phone's own time zone. */
|
|
188
|
+
export function orderDay(iso, language, timeZone) {
|
|
189
|
+
return written(iso, language, { year: 'numeric', month: 'short', day: 'numeric' }, timeZone);
|
|
190
|
+
}
|
|
191
|
+
/** A timestamp as a time of day, beside the day a timeline row already names. */
|
|
192
|
+
export function orderTime(iso, language, timeZone) {
|
|
193
|
+
return written(iso, language, { hour: 'numeric', minute: '2-digit' }, timeZone);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* The parts the order blocks share, each with the theme role it draws unless a
|
|
197
|
+
* component token names another. The eight blocks read one table, so a design
|
|
198
|
+
* names the stroke of an order card once. The summary's inks are parts of
|
|
199
|
+
* their own, so a design can give the summary its near-blacks without moving
|
|
200
|
+
* the other blocks.
|
|
201
|
+
*/
|
|
202
|
+
const ORDER_ROLES = {
|
|
203
|
+
card: 'surface',
|
|
204
|
+
border: 'border',
|
|
205
|
+
title: 'text',
|
|
206
|
+
body: 'muted',
|
|
207
|
+
picture: 'sunken',
|
|
208
|
+
summary: 'elevated',
|
|
209
|
+
rule: 'border',
|
|
210
|
+
total: 'text',
|
|
211
|
+
rail_done: 'text',
|
|
212
|
+
rail_todo: 'border',
|
|
213
|
+
rail_dash: 'subtle',
|
|
214
|
+
link: 'action',
|
|
215
|
+
button: 'action',
|
|
216
|
+
chevron: 'muted',
|
|
217
|
+
chip: 'sunken',
|
|
218
|
+
chip_ink: 'muted',
|
|
219
|
+
chip_stroke: 'border',
|
|
220
|
+
summary_title: 'text',
|
|
221
|
+
summary_row: 'text',
|
|
222
|
+
summary_total: 'text',
|
|
223
|
+
summary_amount: 'text',
|
|
224
|
+
};
|
|
225
|
+
/** Every colour the order blocks draw beside the pills, one per part, with `order.<part>` over each theme role. */
|
|
226
|
+
export function orderColors(theme) {
|
|
227
|
+
return partColors(theme, 'order', ORDER_ROLES);
|
|
228
|
+
}
|
|
229
|
+
/** The corner an order card is cut with: the merchant's own, with `order.radius` over it. */
|
|
230
|
+
export function orderRadius(theme) {
|
|
231
|
+
return componentTokenValue(theme, 'order.radius', theme.radius);
|
|
232
|
+
}
|
|
233
|
+
/** The inner space of an order card where the merchant set none. */
|
|
234
|
+
const CARD_PADDING = 12;
|
|
235
|
+
/**
|
|
236
|
+
* The card one line of an order stands on, in the list and on the order
|
|
237
|
+
* screen alike: what the merchant set, and the order blocks' own surface and
|
|
238
|
+
* corner where they set nothing. The corner of the picture is
|
|
239
|
+
* `order.picture_radius`, the theme's corner behind it.
|
|
240
|
+
*/
|
|
241
|
+
export function orderLineCard(theme, lineCard) {
|
|
242
|
+
return {
|
|
243
|
+
surface: colorChoiceOf(theme, lineCard?.surface) ?? orderColors(theme).card,
|
|
244
|
+
radius: lineCard?.radius ?? orderRadius(theme),
|
|
245
|
+
pictureRadius: componentTokenValue(theme, 'order.picture_radius', theme.radius),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* The two cards of a row of the orders list: what the merchant set, and for
|
|
250
|
+
* every part they left out the look the list had before the cards were
|
|
251
|
+
* settings: the order blocks' stroke and corner, twelve points inside, and
|
|
252
|
+
* under the first line the card a line of the order screen stands on.
|
|
253
|
+
*/
|
|
254
|
+
export function orderListCards(theme, settings) {
|
|
255
|
+
const card = settings.card ?? {};
|
|
256
|
+
return {
|
|
257
|
+
row: {
|
|
258
|
+
stroke: colorChoiceOf(theme, card.stroke) ?? orderColors(theme).border,
|
|
259
|
+
radius: card.radius ?? orderRadius(theme),
|
|
260
|
+
padding: card.padding ?? CARD_PADDING,
|
|
261
|
+
},
|
|
262
|
+
line: orderLineCard(theme, settings.lineCard),
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* The summary box as the merchant set it, and the look it had before these
|
|
267
|
+
* were settings where they set nothing: the order blocks' summary surface and
|
|
268
|
+
* rule, and the theme's corner.
|
|
269
|
+
*/
|
|
270
|
+
export function orderSummaryBox(theme, settings) {
|
|
271
|
+
const colors = orderColors(theme);
|
|
272
|
+
return {
|
|
273
|
+
surface: colorChoiceOf(theme, settings.surface) ?? colors.summary,
|
|
274
|
+
divider: colorChoiceOf(theme, settings.divider) ?? colors.rule,
|
|
275
|
+
radius: settings.radius ?? theme.radius,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The first line of an order, how many lines follow it and how many items it
|
|
280
|
+
* holds: what a row of a page carries, or what the lines of a whole order add
|
|
281
|
+
* up to. A row whose lines Shopify did not hand in full knows neither count.
|
|
282
|
+
*/
|
|
283
|
+
export function orderItemsOf(order) {
|
|
284
|
+
const lines = order.lines;
|
|
285
|
+
const lineCount = order.lineCount ?? lines?.length ?? null;
|
|
286
|
+
const itemCount = order.itemCount ?? lines?.reduce((items, line) => items + line.quantity, 0) ?? null;
|
|
287
|
+
return {
|
|
288
|
+
firstLine: order.firstLine ?? lines?.[0] ?? null,
|
|
289
|
+
otherLines: lineCount === null ? null : Math.max(0, lineCount - 1),
|
|
290
|
+
itemCount,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Whether Shopify holds a shipment of the order, the one thing its tracking
|
|
295
|
+
* can show: the shipments a whole order carries, or what a row of a page says.
|
|
296
|
+
*/
|
|
297
|
+
export function orderHasShipments(order) {
|
|
298
|
+
if (order.fulfillments !== undefined)
|
|
299
|
+
return order.fulfillments.length > 0;
|
|
300
|
+
return order.hasShipments === true;
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=orders.js.map
|
|
@@ -0,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AS,EAAE,KAAK,CAAC,SAAS,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI;QAChD,UAAU,EAAE,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC;QAClE,SAAS;KACV,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAmB;IACnD,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3E,OAAO,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;AACrC,CAAC"}
|
package/dist/product-card.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ declare const PRODUCT_CARD_ROLES: {
|
|
|
13
13
|
readonly notify: "text";
|
|
14
14
|
readonly notify_done: "success";
|
|
15
15
|
readonly notify_done_surface: "elevated";
|
|
16
|
+
readonly amount: "text";
|
|
17
|
+
readonly plus: "elevated";
|
|
18
|
+
readonly plus_ink: "text";
|
|
19
|
+
readonly plus_ring: "border";
|
|
16
20
|
};
|
|
17
21
|
export type ProductCardPart = keyof typeof PRODUCT_CARD_ROLES;
|
|
18
22
|
export type ProductCardColors = Readonly<Record<ProductCardPart, string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-card.d.ts","sourceRoot":"","sources":["../src/product-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,+GAA+G;AAC/G,QAAA,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"product-card.d.ts","sourceRoot":"","sources":["../src/product-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,+GAA+G;AAC/G,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;CAiBuC,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,iBAAiB,CAEtE"}
|
package/dist/product-card.js
CHANGED
|
@@ -13,6 +13,10 @@ const PRODUCT_CARD_ROLES = {
|
|
|
13
13
|
notify: 'text',
|
|
14
14
|
notify_done: 'success',
|
|
15
15
|
notify_done_surface: 'elevated',
|
|
16
|
+
amount: 'text',
|
|
17
|
+
plus: 'elevated',
|
|
18
|
+
plus_ink: 'text',
|
|
19
|
+
plus_ring: 'border',
|
|
16
20
|
};
|
|
17
21
|
/**
|
|
18
22
|
* Every colour the product card draws, one per part: the theme role behind
|
package/dist/product-card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-card.js","sourceRoot":"","sources":["../src/product-card.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,+GAA+G;AAC/G,MAAM,kBAAkB,GAAG;IACzB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,GAAG,EAAE,QAAQ;IACb,cAAc,EAAE,SAAS;IACzB,aAAa,EAAE,QAAQ;IACvB,YAAY,EAAE,MAAM;IACpB,GAAG,EAAE,QAAQ;IACb,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,SAAS;IACtB,mBAAmB,EAAE,UAAU;
|
|
1
|
+
{"version":3,"file":"product-card.js","sourceRoot":"","sources":["../src/product-card.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,+GAA+G;AAC/G,MAAM,kBAAkB,GAAG;IACzB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,GAAG,EAAE,QAAQ;IACb,cAAc,EAAE,SAAS;IACzB,aAAa,EAAE,QAAQ;IACvB,YAAY,EAAE,MAAM;IACpB,GAAG,EAAE,QAAQ;IACb,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,SAAS;IACtB,mBAAmB,EAAE,UAAU;IAC/B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,QAAQ;CAC0C,CAAC;AAMhE;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAiB;IACjD,OAAO,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,kBAAkB,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -8,6 +8,9 @@ declare const PRODUCT_GALLERY_ROLES: {
|
|
|
8
8
|
readonly thumb_border: "border";
|
|
9
9
|
readonly thumb_active: "action";
|
|
10
10
|
readonly sold_out_chip: "text";
|
|
11
|
+
readonly strip: "elevated";
|
|
12
|
+
readonly segment: "border";
|
|
13
|
+
readonly segment_active: "text";
|
|
11
14
|
};
|
|
12
15
|
export type ProductGalleryPart = keyof typeof PRODUCT_GALLERY_ROLES;
|
|
13
16
|
export type ProductGalleryColors = Readonly<Record<ProductGalleryPart, string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-gallery.d.ts","sourceRoot":"","sources":["../src/product-gallery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,kHAAkH;AAClH,QAAA,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"product-gallery.d.ts","sourceRoot":"","sources":["../src/product-gallery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,kHAAkH;AAClH,QAAA,MAAM,qBAAqB;;;;;;;;;;;CAWoC,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAEpE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,oBAAoB,CAE5E"}
|
package/dist/product-gallery.js
CHANGED
|
@@ -8,6 +8,9 @@ const PRODUCT_GALLERY_ROLES = {
|
|
|
8
8
|
thumb_border: 'border',
|
|
9
9
|
thumb_active: 'action',
|
|
10
10
|
sold_out_chip: 'text',
|
|
11
|
+
strip: 'elevated',
|
|
12
|
+
segment: 'border',
|
|
13
|
+
segment_active: 'text',
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
13
16
|
* Every colour the gallery draws, one per part, with `product_gallery.<part>`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-gallery.js","sourceRoot":"","sources":["../src/product-gallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,kHAAkH;AAClH,MAAM,qBAAqB,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,UAAU;IACjB,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,QAAQ;IACtB,aAAa,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"product-gallery.js","sourceRoot":"","sources":["../src/product-gallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,kHAAkH;AAClH,MAAM,qBAAqB,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,UAAU;IACjB,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,QAAQ;IACtB,aAAa,EAAE,MAAM;IACrB,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,QAAQ;IACjB,cAAc,EAAE,MAAM;CACuC,CAAC;AAMhE;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAiB;IACpD,OAAO,UAAU,CAAC,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;AACrE,CAAC"}
|