Skip to content

Commit 8db50fa

Browse files
committed
Improvements to example titles and descriptions
linting
1 parent 51be395 commit 8db50fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+436
-180
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,24 @@ const data: ReferenceEntityTemplateSchema = {
2222
category: 'APIs',
2323
related: [],
2424
examples: {
25-
description: 'Examples of using the Action API.',
25+
description:
26+
'Learn how to present full-screen modals from tiles and menu items using the Action API.',
2627
examples: [
2728
{
2829
codeblock: generateCodeBlockForActionApi(
29-
'Present a modal from post purchase.',
30+
'Open a modal from a post-purchase action',
3031
'present-modal',
3132
),
33+
description:
34+
"Create an action menu item that appears after a purchase is completed. When pressed, it launches a full-screen modal view using the Action API's `presentModal()` method, allowing you to display custom workflows or additional functionality in the post-purchase flow.",
3235
},
3336
{
3437
codeblock: generateCodeBlockForActionApi(
35-
'Present a modal from smart grid.',
38+
'Open a modal from a smart grid tile',
3639
'present-modal-tile',
3740
),
41+
description:
42+
"Create a smart grid tile on the POS home screen that launches a full-screen modal when tapped. This example shows how to use the Action API to present detailed views or workflows from your app's home tile, providing quick access to extended functionality.",
3843
},
3944
],
4045
},

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

Lines changed: 93 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -22,145 +22,192 @@ const data: ReferenceEntityTemplateSchema = {
2222
category: 'APIs',
2323
related: [],
2424
examples: {
25-
description: 'Examples of using the Cart API',
25+
description:
26+
'Learn how to manage cart contents, apply discounts, handle customer information, and track cart changes in real time.',
2627
examples: [
2728
{
2829
codeblock: generateCodeBlockForCartApi(
29-
'Subscribe to cart changes.',
30-
'subscribable',
30+
'Add a custom sale item to the cart',
31+
'add-custom-sale',
3132
),
33+
description:
34+
"Create and add a custom sale item that isn't tied to an existing product in your catalog. This example demonstrates using `addCustomSale()` to add a line item with a custom title, quantity, price, and tax settings—useful for services, custom orders, or special charges.",
3235
},
3336
{
3437
codeblock: generateCodeBlockForCartApi(
35-
'Apply a cart level discount',
36-
'apply-cart-discount',
38+
'Add a new address to the customer',
39+
'add-address',
3740
),
41+
description:
42+
"Create and add a new address to the customer associated with the cart. This example shows how to use `addAddress()` to add a complete address with street, city, province, name, and country information to the customer's profile for shipping or billing purposes.",
3843
},
3944
{
4045
codeblock: generateCodeBlockForCartApi(
41-
'Apply a cart level discount code',
42-
'apply-cart-code-discount',
46+
'Add a product to the cart',
47+
'add-line-item',
4348
),
49+
description:
50+
"Add a product to the cart by specifying its variant ID and quantity. This example uses `addLineItem()` to add a product variant with the specified quantity, returning the new line item's UUID for future reference or manipulation.",
4451
},
4552
{
4653
codeblock: generateCodeBlockForCartApi(
47-
'Remove all the discounts on the cart and line items',
48-
'remove-all-discounts',
54+
'Add custom properties to a line item',
55+
'add-line-item-properties',
4956
),
57+
description:
58+
"Attach custom key-value metadata to a specific line item using its UUID. This example uses `addLineItemProperties()` to add an `'Engraving'` property to a particular line item, useful for storing item-specific customizations, notes, or tracking data.",
5059
},
5160
{
5261
codeblock: generateCodeBlockForCartApi(
53-
'Set a custom discount on a line item',
54-
'set-line-item-discount',
62+
'Add custom properties to multiple line items',
63+
'bulk-add-line-item-properties',
5564
),
65+
description:
66+
'Attach different custom properties to multiple line items simultaneously in a single operation. This example shows how to use `bulkAddLineItemProperties()` to efficiently add unique engraving text to multiple items at once, reducing API calls and improving performance.',
5667
},
5768
{
5869
codeblock: generateCodeBlockForCartApi(
59-
'Set a custom discount on multiple line items',
60-
'bulk-set-line-item-discounts',
70+
'Add custom properties to the cart',
71+
'add-cart-properties',
6172
),
73+
description:
74+
"Attach custom key-value metadata to the cart for tracking, integrations, or additional context. This example uses `addCartProperties()` to add an `'Engraving'` property to the cart, which merges with existing properties and overwrites duplicate keys.",
6275
},
6376
{
6477
codeblock: generateCodeBlockForCartApi(
65-
'Remove a discount on a line item',
66-
'remove-line-item-discount',
78+
'Apply a discount code to the cart',
79+
'apply-cart-code-discount',
6780
),
81+
description:
82+
"Add a discount to the cart using a discount code. This example shows how to apply the discount code `'SUMMER_2024'` using the `addCartCodeDiscount()` method, which validates and applies the code server-side if it's valid and applicable to the current cart.",
6883
},
6984
{
7085
codeblock: generateCodeBlockForCartApi(
71-
'Clear the entire cart',
72-
'clear-cart',
86+
'Apply a discount to a line item',
87+
'set-line-item-discount',
7388
),
89+
description:
90+
"Add a discount to an individual line item in the cart using its UUID. This example applies a 10% discount titled `'Summer discount'` to a specific line item using the `setLineItemDiscount()` method, allowing you to target discounts at particular products.",
7491
},
7592
{
7693
codeblock: generateCodeBlockForCartApi(
77-
'Set the customer in the cart',
78-
'set-customer',
94+
'Apply a percentage discount to the cart',
95+
'apply-cart-discount',
7996
),
97+
description:
98+
"Add a cart-level discount that applies to the total cart value. This example demonstrates applying a 10% discount titled `'Summer discount'` to the cart using the `applyCartDiscount()` method with the `Percentage` discount type.",
8099
},
81100
{
82101
codeblock: generateCodeBlockForCartApi(
83-
'Remove the customer in the cart',
84-
'remove-customer',
102+
'Apply different discounts to multiple line items',
103+
'bulk-set-line-item-discounts',
85104
),
105+
description:
106+
'Add discounts to multiple line items simultaneously using a single operation. This example shows how to use `bulkSetLineItemDiscounts()` to apply different discount types and amounts to multiple items efficiently—one gets a 10% percentage discount while another receives a $15 fixed amount discount.',
86107
},
87108
{
88109
codeblock: generateCodeBlockForCartApi(
89-
'Add a custom sale to the cart',
90-
'add-custom-sale',
110+
'Associate a customer with the cart',
111+
'set-customer',
91112
),
113+
description:
114+
'Associate a customer with the cart using their ID to enable customer-specific features. This example shows how to use `setCustomer()` to associate a customer, which enables personalized pricing, applicable discounts, loyalty benefits, and streamlines the checkout process.',
92115
},
93116
{
94117
codeblock: generateCodeBlockForCartApi(
95-
'Add a line item to the cart',
96-
'add-line-item',
118+
'Attribute a staff member to a line item',
119+
'set-attributed-staff-to-line-item',
97120
),
121+
description:
122+
'Assign a staff member to an individual line item for detailed sales tracking. This example demonstrates using `setAttributedStaffToLineItem()` to track which staff member was responsible for selling a specific item, enabling item-level commission tracking and performance analysis.',
98123
},
99124
{
100125
codeblock: generateCodeBlockForCartApi(
101-
'Remove a line item from the cart',
102-
'remove-line-item',
126+
'Attribute a staff member to the cart',
127+
'set-attributed-staff',
103128
),
129+
description:
130+
'Assign a staff member to the cart for sales tracking and commission purposes. This example uses `setAttributedStaff()` with a staff member ID to track who facilitated or managed the sale, useful for performance metrics and incentive calculations.',
104131
},
105132
{
106133
codeblock: generateCodeBlockForCartApi(
107-
'Add custom properties to the cart',
108-
'add-cart-properties',
134+
'Clear all items from the cart',
135+
'clear-cart',
109136
),
137+
description:
138+
'Empty the cart completely, removing all line items, discounts, and properties. This example uses `clearCart()` to reset the cart to its initial empty state while preserving the customer association if present, useful for starting a new transaction or canceling a sale.',
110139
},
111140
{
112141
codeblock: generateCodeBlockForCartApi(
113-
'Remove custom properties from the cart',
114-
'remove-cart-properties',
142+
'Delete a customer address',
143+
'delete-address',
115144
),
145+
description:
146+
"Remove a specific address from the customer's profile using its ID. This example demonstrates using `deleteAddress()` to permanently delete an address from the customer associated with the cart, useful for cleaning up outdated or incorrect addresses.",
116147
},
117148
{
118149
codeblock: generateCodeBlockForCartApi(
119-
'Add custom properties to a line item',
120-
'add-line-item-properties',
150+
'Monitor cart updates in real time',
151+
'subscribable',
121152
),
153+
description:
154+
'Subscribe to cart state changes to display dynamic information based on cart contents. This example shows how to react to cart updates and display the current number of line items in the cart, automatically updating the tile subtitle whenever the cart changes.',
122155
},
123156
{
124157
codeblock: generateCodeBlockForCartApi(
125-
'Add custom properties to multiple line items',
126-
'bulk-add-line-item-properties',
158+
'Remove a discount from a line item',
159+
'remove-line-item-discount',
127160
),
161+
description:
162+
"Clear the discount from an individual line item while leaving other cart discounts intact. This example uses `removeLineItemDiscount()` with the line item's UUID to remove only that item's discount without affecting cart-level or other line item discounts.",
128163
},
129164
{
130165
codeblock: generateCodeBlockForCartApi(
131-
'Remove custom properties from a line item',
132-
'remove-line-item-properties',
166+
'Remove a line item from the cart',
167+
'remove-line-item',
133168
),
169+
description:
170+
'Delete a line item from the cart using its UUID. This example demonstrates using `removeLineItem()` to completely remove a specific item along with any associated discounts or properties, without affecting other cart contents.',
134171
},
135172
{
136173
codeblock: generateCodeBlockForCartApi(
137-
'Set an attributed staff member on the cart',
138-
'set-attributed-staff',
174+
'Remove all discounts from cart and line items',
175+
'remove-all-discounts',
139176
),
177+
description:
178+
"Clear all discounts applied to both the cart and individual line items in a single operation. This example uses `removeAllDiscounts(true)` to remove all discounts and disable automatic discounts from being reapplied, giving you full control over the cart's discount state.",
140179
},
141180
{
142181
codeblock: generateCodeBlockForCartApi(
143-
'Set an attributed staff member on a line item',
144-
'set-attributed-staff-to-line-item',
182+
'Remove custom properties from a line item',
183+
'remove-line-item-properties',
145184
),
185+
description:
186+
"Delete specific properties from a line item by its UUID and property keys. This example demonstrates using `removeLineItemProperties()` to remove the `'Engraving'` property from a specific line item while preserving other line item properties and data.",
146187
},
147188
{
148189
codeblock: generateCodeBlockForCartApi(
149-
'Add an address to the customer in the cart',
150-
'add-address',
190+
'Remove custom properties from the cart',
191+
'remove-cart-properties',
151192
),
193+
description:
194+
"Delete specific cart properties by their keys while leaving other properties intact. This example demonstrates using `removeCartProperties()` to remove the `'Engraving'` property from the cart without affecting other custom properties or cart data.",
152195
},
153196
{
154197
codeblock: generateCodeBlockForCartApi(
155-
'Delete an address corresponding to an ID',
156-
'delete-address',
198+
'Remove the customer from the cart',
199+
'remove-customer',
157200
),
201+
description:
202+
'Disassociate the customer from the cart and convert it to a guest cart. This example uses `removeCustomer()` to remove customer-specific pricing, discounts, and personalization while preserving all cart contents and line items.',
158203
},
159204
{
160205
codeblock: generateCodeBlockForCartApi(
161-
'Set the default address of the customer in the cart',
206+
"Set a customer's default address",
162207
'update-default-address',
163208
),
209+
description:
210+
"Update which address is marked as the default for the customer in the cart. This example uses `updateDefaultAddress()` with an address ID to set the customer's primary address, which will be automatically selected for future transactions.",
164211
},
165212
],
166213
},

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ const data: ReferenceEntityTemplateSchema = {
2121
category: 'APIs',
2222
related: [],
2323
examples: {
24-
description: 'Examples of using the Connectivity API',
24+
description:
25+
'Learn how to monitor internet connectivity status and respond to network changes in your extension.',
2526
examples: [
2627
{
2728
codeblock: generateCodeBlockForConnectivityApi(
28-
'Subscribe to connectivity changes.',
29+
'Monitor network connectivity changes',
2930
'subscribable',
3031
),
32+
description:
33+
'Subscribe to connectivity state changes to respond when the device goes online or offline. This example demonstrates using the connectivity subscription to track network status and display the current connection state, allowing your extension to adapt behavior based on network availability.',
3134
},
3235
],
3336
},

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ const data: ReferenceEntityTemplateSchema = {
2020
},
2121
],
2222
examples: {
23-
description: 'Examples of using the Customer API.',
23+
description:
24+
'Learn how to access customer information and build personalized experiences based on customer context.',
2425
examples: [
2526
{
2627
codeblock: generateCodeBlockForCustomerApi(
27-
'Retrieve the ID of the customer.',
28+
'Get the current customer ID',
2829
'id',
2930
),
31+
description:
32+
"Retrieve the unique identifier of the customer currently associated with the extension's context. This example shows how to access the customer ID from customer details screens, enabling you to fetch additional customer data, track customer-specific actions, or link to external systems.",
3033
},
3134
],
3235
},

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,29 @@ const data: ReferenceEntityTemplateSchema = {
2121
category: 'APIs',
2222
related: [],
2323
examples: {
24-
description: 'Examples of using the Device API.',
24+
description:
25+
'Learn how to access device information and adapt your extension based on hardware characteristics.',
2526
examples: [
2627
{
2728
codeblock: generateCodeBlockForDeviceApi(
28-
'Retrieve name of the device.',
29-
'name',
29+
'Check if the device is a tablet',
30+
'tablet',
3031
),
32+
description:
33+
'Check whether the extension is running on a tablet form factor. This example uses the `isTablet` property to determine the device type, allowing you to adapt layouts, adjust component sizing, or enable tablet-specific features for larger screen experiences.',
3134
},
3235
{
3336
codeblock: generateCodeBlockForDeviceApi(
34-
'Retrieve the ID of the device.',
37+
'Get the device ID',
3538
'device-id',
3639
),
40+
description:
41+
'Retrieve the unique identifier for the device running your extension. This example accesses the device ID, enabling device-specific tracking, settings synchronization, or associating actions with specific POS terminals for audit trails and analytics.',
3742
},
3843
{
39-
codeblock: generateCodeBlockForDeviceApi(
40-
'Check if device is a tablet.',
41-
'tablet',
42-
),
44+
codeblock: generateCodeBlockForDeviceApi('Get the device name', 'name'),
45+
description:
46+
"Retrieve the human-readable name of the device running your extension. This example accesses the device's name, which can be useful for debugging, analytics, device-specific customization, or displaying device information to staff members.",
4347
},
4448
],
4549
},

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ const data: ReferenceEntityTemplateSchema = {
1717
},
1818
],
1919
examples: {
20-
description: 'Examples of using the Draft Order API.',
20+
description:
21+
'Learn how to access draft order information and build contextual experiences for draft order workflows.',
2122
examples: [
2223
{
2324
codeblock: generateCodeBlock(
24-
'Retrieve the ID of the draft order.',
25+
'Get the current draft order ID',
2526
'draft-order-api',
2627
'id',
2728
),
29+
description:
30+
"Retrieve the unique identifier of the draft order currently associated with the extension's context. This example shows how to access the draft order ID from draft order detail screens, enabling you to fetch additional order data, implement custom workflows, or integrate with external systems.",
2831
},
2932
],
3033
},

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ const data: ReferenceEntityTemplateSchema = {
2121
category: 'APIs',
2222
related: [],
2323
examples: {
24-
description: 'Examples of using the Locale API',
24+
description:
25+
"Learn how to access locale information and internationalize your extension based on the merchant's language settings.",
2526
examples: [
2627
{
2728
codeblock: generateCodeBlockForLocaleApi(
28-
'Subscribe to locale changes.',
29+
'Track locale changes in real time',
2930
'subscribable',
3031
),
32+
description:
33+
"Subscribe to locale changes to dynamically update your extension's content when the merchant switches languages. This example demonstrates monitoring locale updates and displaying the current locale in IETF format, allowing you to provide properly localized content and adapt to language preferences in real time.",
3134
},
3235
],
3336
},

0 commit comments

Comments
 (0)