Skip to content

Commit 58bf805

Browse files
committed
Add missing example descriptions
Fixes
1 parent 88444cd commit 58bf805

File tree

9 files changed

+54
-34
lines changed

9 files changed

+54
-34
lines changed

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/cart-line-item-api.doc.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ const data: ReferenceEntityTemplateSchema = {
2121
type: 'CartLineItemApi',
2222
},
2323
],
24+
examples: {
25+
description:
26+
'Learn how to access line item information in cart line item action contexts.',
27+
examples: [
28+
{
29+
codeblock: generateJsxCodeBlockForCartLineItemApi(
30+
'Display the line item ID',
31+
'id',
32+
),
33+
description:
34+
'Access the unique identifier of the current cart line item in line item detail contexts. This example shows how to use `shopify.cartLineItem.id` to retrieve the line item ID. This can be used for modifying the item, applying discounts, or implementing item-specific functionality.',
35+
},
36+
],
37+
},
38+
category: 'Target APIs',
39+
subCategory: 'Contextual APIs',
40+
related: [],
2441
subSections: [
2542
{
2643
type: 'Generic',
@@ -44,23 +61,6 @@ const data: ReferenceEntityTemplateSchema = {
4461
`,
4562
},
4663
],
47-
examples: {
48-
description:
49-
'Learn how to access line item information in cart line item action contexts.',
50-
examples: [
51-
{
52-
codeblock: generateJsxCodeBlockForCartLineItemApi(
53-
'Display the line item ID',
54-
'id',
55-
),
56-
description:
57-
'Access the unique identifier of the current cart line item in line item detail contexts. This example shows how to use `shopify.cartLineItem.id` to retrieve the line item ID. This can be used for modifying the item, applying discounts, or implementing item-specific functionality.',
58-
},
59-
],
60-
},
61-
category: 'Target APIs',
62-
subCategory: 'Contextual APIs',
63-
related: [],
6464
};
6565

6666
export default data;

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/customer-api.doc.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ const data: ReferenceEntityTemplateSchema = {
1919
type: 'CustomerApiContent',
2020
},
2121
],
22+
examples: {
23+
description:
24+
'Learn how to access customer information in customer detail contexts.',
25+
examples: [
26+
{
27+
codeblock: generateJsxCodeBlockForCustomerApi(
28+
'Display the customer ID',
29+
'id',
30+
),
31+
description:
32+
'Access the unique identifier of the current customer in a customer detail context. This example shows how to use `shopify.customer.id` to retrieve the customer ID. This can be used for fetching additional customer data, implementing loyalty features, or building personalized customer experiences.',
33+
},
34+
],
35+
},
36+
category: 'Target APIs',
37+
subCategory: 'Contextual APIs',
38+
related: [],
2239
subSections: [
2340
{
2441
type: 'Generic',
@@ -39,23 +56,6 @@ Customer data reflects the current POS session and may not include real-time upd
3956
`,
4057
},
4158
],
42-
examples: {
43-
description:
44-
'Learn how to access customer information in customer detail contexts.',
45-
examples: [
46-
{
47-
codeblock: generateJsxCodeBlockForCustomerApi(
48-
'Display the customer ID',
49-
'id',
50-
),
51-
description:
52-
'Access the unique identifier of the current customer in a customer detail context. This example shows how to use `shopify.customer.id` to retrieve the customer ID. This can be used for fetching additional customer data, implementing loyalty features, or building personalized customer experiences.',
53-
},
54-
],
55-
},
56-
category: 'Target APIs',
57-
subCategory: 'Contextual APIs',
58-
related: [],
5959
};
6060

6161
export default data;

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/draft-order-api.doc.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ const data: ReferenceEntityTemplateSchema = {
3333
description:
3434
'Access the unique identifier of the current draft order in a draft order detail context. This example shows how to use `shopify.draftOrder.id` to retrieve the draft order ID. This can be used for fetching additional order data, implementing custom workflows, or building draft order-specific features.',
3535
},
36+
{
37+
codeblock: generateJsxCodeBlockForDraftOrderApi(
38+
"Retrieve a draft order's name, ID, and associated customer ID",
39+
'draft-order-details',
40+
),
41+
description:
42+
'Access multiple properties from the draft order object including name, ID, and customer information. This example demonstrates using `shopify.draftOrder` to retrieve comprehensive draft order details. This enables building contextual interfaces and implementing order-specific workflows.',
43+
},
3644
],
3745
},
3846
category: 'Target APIs',

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/order-api.doc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ Order data reflects the current POS session and may not include real-time update
5858
"Retrieve an order's name, ID, and associated customer ID",
5959
'order-details',
6060
),
61+
description:
62+
'Access multiple order properties including the order name and customer ID. This example demonstrates accessing `shopify.order.id`, `shopify.order.name`, and `shopify.order.customerId` to display comprehensive order information. Use this pattern for order management workflows and customer service features.',
6163
},
6264
],
6365
},

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/pinpad-api.doc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ const data: ReferenceEntityTemplateSchema = {
6060
'Configure PinPad options and handle dismissal',
6161
'validation-with-options',
6262
),
63+
description:
64+
'Configure PIN pad options including PIN length requirements, masking, and custom labels. This example shows how to use `showPinPad()` with options like `minPinLength`, `maxPinLength`, `masked`, `title`, and `onDismissed` callback. This creates a fully configured PIN entry experience with proper validation and dismissal handling.',
6365
},
6466
],
6567
},

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/product-api.doc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ const data: ReferenceEntityTemplateSchema = {
3636
'Retrieve product and product variant IDs',
3737
'product-variant',
3838
),
39+
description:
40+
'Access both product and variant identifiers to implement variant-specific functionality. This example shows how to retrieve `shopify.product.id` and `shopify.product.variantId` together. Use this pattern for variant-aware features like inventory checks, variant-specific pricing, or detailed product information displays.',
3941
},
4042
],
4143
},

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/scanner-api.doc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ const data: ReferenceEntityTemplateSchema = {
6060
'Subscribe to scanner data events and track scanning history',
6161
'scanner-data-subscribe',
6262
),
63+
description:
64+
'Subscribe to real-time scan events and maintain a history of scanned items. This example demonstrates using `shopify.scanner.scannerData.current.subscribe()` to capture scan data, source information, and timestamps. Use this pattern for scan logging, bulk scanning workflows, or scan history review.',
6365
},
6466
],
6567
},

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/session-api.doc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ const data: ReferenceEntityTemplateSchema = {
5959
'Access properties associated with the current session',
6060
'current-session',
6161
),
62+
description:
63+
'Access comprehensive session information including shop details, user data, and location information. This example shows how to use `shopify.session.currentSession` to retrieve shop ID, domain, currency, user ID, location ID, staff member ID, and POS version. Use this data to build location-aware features and personalized experiences.',
6264
},
6365
],
6466
},

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/toast-api.doc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ const data: ReferenceEntityTemplateSchema = {
5959
'Display a toast notification for a custom duration',
6060
'show-with-duration',
6161
),
62+
description:
63+
'Configure custom display durations for toast notifications to match message importance and length. This example demonstrates using the `duration` option with `shopify.toast.show()` to control how long notifications remain visible. Use shorter durations for quick confirmations and longer durations for messages that require more reading time.',
6264
},
6365
],
6466
},

0 commit comments

Comments
 (0)