shopify-nuxt 0.0.1
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 +275 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +134 -0
- package/dist/runtime/components/ShopifyAppProvider.d.vue.ts +13 -0
- package/dist/runtime/components/ShopifyAppProvider.vue +11 -0
- package/dist/runtime/components/ShopifyAppProvider.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShAppNav.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShAppNav.vue +9 -0
- package/dist/runtime/components/polaris/ShAppNav.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShAvatar.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShAvatar.vue +15 -0
- package/dist/runtime/components/polaris/ShAvatar.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShBadge.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/ShBadge.vue +16 -0
- package/dist/runtime/components/polaris/ShBadge.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/ShBanner.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShBanner.vue +15 -0
- package/dist/runtime/components/polaris/ShBanner.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShBox.d.vue.ts +39 -0
- package/dist/runtime/components/polaris/ShBox.vue +35 -0
- package/dist/runtime/components/polaris/ShBox.vue.d.ts +39 -0
- package/dist/runtime/components/polaris/ShButton.d.vue.ts +28 -0
- package/dist/runtime/components/polaris/ShButton.vue +24 -0
- package/dist/runtime/components/polaris/ShButton.vue.d.ts +28 -0
- package/dist/runtime/components/polaris/ShButtonGroup.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShButtonGroup.vue +13 -0
- package/dist/runtime/components/polaris/ShButtonGroup.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShCheckbox.d.vue.ts +28 -0
- package/dist/runtime/components/polaris/ShCheckbox.vue +24 -0
- package/dist/runtime/components/polaris/ShCheckbox.vue.d.ts +28 -0
- package/dist/runtime/components/polaris/ShChip.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShChip.vue +13 -0
- package/dist/runtime/components/polaris/ShChip.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShChoice.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/ShChoice.vue +16 -0
- package/dist/runtime/components/polaris/ShChoice.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/ShChoiceList.d.vue.ts +23 -0
- package/dist/runtime/components/polaris/ShChoiceList.vue +19 -0
- package/dist/runtime/components/polaris/ShChoiceList.vue.d.ts +23 -0
- package/dist/runtime/components/polaris/ShClickable.d.vue.ts +48 -0
- package/dist/runtime/components/polaris/ShClickable.vue +44 -0
- package/dist/runtime/components/polaris/ShClickable.vue.d.ts +48 -0
- package/dist/runtime/components/polaris/ShClickableChip.d.vue.ts +24 -0
- package/dist/runtime/components/polaris/ShClickableChip.vue +20 -0
- package/dist/runtime/components/polaris/ShClickableChip.vue.d.ts +24 -0
- package/dist/runtime/components/polaris/ShColorField.d.vue.ts +29 -0
- package/dist/runtime/components/polaris/ShColorField.vue +25 -0
- package/dist/runtime/components/polaris/ShColorField.vue.d.ts +29 -0
- package/dist/runtime/components/polaris/ShColorPicker.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShColorPicker.vue +15 -0
- package/dist/runtime/components/polaris/ShColorPicker.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShDateField.d.vue.ts +34 -0
- package/dist/runtime/components/polaris/ShDateField.vue +30 -0
- package/dist/runtime/components/polaris/ShDateField.vue.d.ts +34 -0
- package/dist/runtime/components/polaris/ShDatePicker.d.vue.ts +25 -0
- package/dist/runtime/components/polaris/ShDatePicker.vue +21 -0
- package/dist/runtime/components/polaris/ShDatePicker.vue.d.ts +25 -0
- package/dist/runtime/components/polaris/ShDivider.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShDivider.vue +13 -0
- package/dist/runtime/components/polaris/ShDivider.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShDropZone.d.vue.ts +25 -0
- package/dist/runtime/components/polaris/ShDropZone.vue +21 -0
- package/dist/runtime/components/polaris/ShDropZone.vue.d.ts +25 -0
- package/dist/runtime/components/polaris/ShEmailField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShEmailField.vue +26 -0
- package/dist/runtime/components/polaris/ShEmailField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/ShGrid.d.vue.ts +50 -0
- package/dist/runtime/components/polaris/ShGrid.vue +46 -0
- package/dist/runtime/components/polaris/ShGrid.vue.d.ts +50 -0
- package/dist/runtime/components/polaris/ShGridItem.d.vue.ts +41 -0
- package/dist/runtime/components/polaris/ShGridItem.vue +37 -0
- package/dist/runtime/components/polaris/ShGridItem.vue.d.ts +41 -0
- package/dist/runtime/components/polaris/ShHeading.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/ShHeading.vue +14 -0
- package/dist/runtime/components/polaris/ShHeading.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/ShIcon.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/ShIcon.vue +16 -0
- package/dist/runtime/components/polaris/ShIcon.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/ShImage.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/ShImage.vue +14 -0
- package/dist/runtime/components/polaris/ShImage.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/ShLink.d.vue.ts +24 -0
- package/dist/runtime/components/polaris/ShLink.vue +20 -0
- package/dist/runtime/components/polaris/ShLink.vue.d.ts +24 -0
- package/dist/runtime/components/polaris/ShListItem.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShListItem.vue +9 -0
- package/dist/runtime/components/polaris/ShListItem.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShMenu.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/ShMenu.vue +12 -0
- package/dist/runtime/components/polaris/ShMenu.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/ShModal.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShModal.vue +15 -0
- package/dist/runtime/components/polaris/ShModal.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShMoneyField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShMoneyField.vue +26 -0
- package/dist/runtime/components/polaris/ShMoneyField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/ShNumberField.d.vue.ts +34 -0
- package/dist/runtime/components/polaris/ShNumberField.vue +30 -0
- package/dist/runtime/components/polaris/ShNumberField.vue.d.ts +34 -0
- package/dist/runtime/components/polaris/ShOption.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShOption.vue +15 -0
- package/dist/runtime/components/polaris/ShOption.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShOptionGroup.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShOptionGroup.vue +13 -0
- package/dist/runtime/components/polaris/ShOptionGroup.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShOrderedList.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShOrderedList.vue +9 -0
- package/dist/runtime/components/polaris/ShOrderedList.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShPage.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShPage.vue +13 -0
- package/dist/runtime/components/polaris/ShPage.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShParagraph.d.vue.ts +21 -0
- package/dist/runtime/components/polaris/ShParagraph.vue +17 -0
- package/dist/runtime/components/polaris/ShParagraph.vue.d.ts +21 -0
- package/dist/runtime/components/polaris/ShPasswordField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShPasswordField.vue +26 -0
- package/dist/runtime/components/polaris/ShPasswordField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/ShPopover.d.vue.ts +21 -0
- package/dist/runtime/components/polaris/ShPopover.vue +17 -0
- package/dist/runtime/components/polaris/ShPopover.vue.d.ts +21 -0
- package/dist/runtime/components/polaris/ShQueryContainer.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/ShQueryContainer.vue +12 -0
- package/dist/runtime/components/polaris/ShQueryContainer.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/ShSearchField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShSearchField.vue +26 -0
- package/dist/runtime/components/polaris/ShSearchField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/ShSection.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/ShSection.vue +14 -0
- package/dist/runtime/components/polaris/ShSection.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/ShSelect.d.vue.ts +26 -0
- package/dist/runtime/components/polaris/ShSelect.vue +22 -0
- package/dist/runtime/components/polaris/ShSelect.vue.d.ts +26 -0
- package/dist/runtime/components/polaris/ShSpinner.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShSpinner.vue +13 -0
- package/dist/runtime/components/polaris/ShSpinner.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShStack.d.vue.ts +46 -0
- package/dist/runtime/components/polaris/ShStack.vue +42 -0
- package/dist/runtime/components/polaris/ShStack.vue.d.ts +46 -0
- package/dist/runtime/components/polaris/ShSwitch.d.vue.ts +27 -0
- package/dist/runtime/components/polaris/ShSwitch.vue +23 -0
- package/dist/runtime/components/polaris/ShSwitch.vue.d.ts +27 -0
- package/dist/runtime/components/polaris/ShTable.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/ShTable.vue +16 -0
- package/dist/runtime/components/polaris/ShTable.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/ShTableBody.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShTableBody.vue +9 -0
- package/dist/runtime/components/polaris/ShTableBody.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShTableCell.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShTableCell.vue +9 -0
- package/dist/runtime/components/polaris/ShTableCell.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShTableHeader.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShTableHeader.vue +13 -0
- package/dist/runtime/components/polaris/ShTableHeader.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShTableHeaderRow.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShTableHeaderRow.vue +9 -0
- package/dist/runtime/components/polaris/ShTableHeaderRow.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShTableRow.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/ShTableRow.vue +12 -0
- package/dist/runtime/components/polaris/ShTableRow.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/ShText.d.vue.ts +22 -0
- package/dist/runtime/components/polaris/ShText.vue +18 -0
- package/dist/runtime/components/polaris/ShText.vue.d.ts +22 -0
- package/dist/runtime/components/polaris/ShTextArea.d.vue.ts +31 -0
- package/dist/runtime/components/polaris/ShTextArea.vue +27 -0
- package/dist/runtime/components/polaris/ShTextArea.vue.d.ts +31 -0
- package/dist/runtime/components/polaris/ShTextField.d.vue.ts +33 -0
- package/dist/runtime/components/polaris/ShTextField.vue +29 -0
- package/dist/runtime/components/polaris/ShTextField.vue.d.ts +33 -0
- package/dist/runtime/components/polaris/ShThumbnail.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/ShThumbnail.vue +14 -0
- package/dist/runtime/components/polaris/ShThumbnail.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/ShTooltip.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShTooltip.vue +9 -0
- package/dist/runtime/components/polaris/ShTooltip.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShUnorderedList.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShUnorderedList.vue +9 -0
- package/dist/runtime/components/polaris/ShUnorderedList.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShUrlField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShUrlField.vue +26 -0
- package/dist/runtime/components/polaris/ShUrlField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/types.d.ts +1 -0
- package/dist/runtime/components/polaris/types.js +0 -0
- package/dist/runtime/composables/useAppBridge.d.ts +8 -0
- package/dist/runtime/composables/useAppBridge.js +21 -0
- package/dist/runtime/composables/useShopifyFetch.d.ts +4 -0
- package/dist/runtime/composables/useShopifyFetch.js +32 -0
- package/dist/runtime/middleware/shopify-auth.d.ts +2 -0
- package/dist/runtime/middleware/shopify-auth.js +11 -0
- package/dist/runtime/plugin.d.ts +1 -0
- package/dist/runtime/plugin.js +1 -0
- package/dist/runtime/plugins/app-bridge.d.ts +12 -0
- package/dist/runtime/plugins/app-bridge.js +28 -0
- package/dist/runtime/plugins/polaris.d.ts +1 -0
- package/dist/runtime/plugins/polaris.js +0 -0
- package/dist/runtime/server/index.d.ts +2 -0
- package/dist/runtime/server/index.js +7 -0
- package/dist/runtime/server/routes/auth-callback.d.ts +6 -0
- package/dist/runtime/server/routes/auth-callback.js +45 -0
- package/dist/runtime/server/routes/auth-exit-iframe.d.ts +6 -0
- package/dist/runtime/server/routes/auth-exit-iframe.js +11 -0
- package/dist/runtime/server/routes/auth-session-token.d.ts +7 -0
- package/dist/runtime/server/routes/auth-session-token.js +27 -0
- package/dist/runtime/server/routes/auth.d.ts +6 -0
- package/dist/runtime/server/routes/auth.js +23 -0
- package/dist/runtime/server/services/shopify.d.ts +38 -0
- package/dist/runtime/server/services/shopify.js +89 -0
- package/dist/runtime/server/test-helpers/index.d.ts +25 -0
- package/dist/runtime/server/test-helpers/index.js +25 -0
- package/dist/runtime/server/test-helpers/package.json +4 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/authenticate-admin.d.ts +17 -0
- package/dist/runtime/server/utils/authenticate-admin.js +197 -0
- package/dist/runtime/server/utils/authenticate-flow.d.ts +17 -0
- package/dist/runtime/server/utils/authenticate-flow.js +70 -0
- package/dist/runtime/server/utils/authenticate-fulfillment-service.d.ts +16 -0
- package/dist/runtime/server/utils/authenticate-fulfillment-service.js +54 -0
- package/dist/runtime/server/utils/authenticate-pos.d.ts +18 -0
- package/dist/runtime/server/utils/authenticate-pos.js +31 -0
- package/dist/runtime/server/utils/authenticate-public.d.ts +17 -0
- package/dist/runtime/server/utils/authenticate-public.js +31 -0
- package/dist/runtime/server/utils/authenticate-webhook.d.ts +26 -0
- package/dist/runtime/server/utils/authenticate-webhook.js +76 -0
- package/dist/runtime/server/utils/clients.d.ts +25 -0
- package/dist/runtime/server/utils/clients.js +36 -0
- package/dist/runtime/server/utils/helpers.d.ts +10 -0
- package/dist/runtime/server/utils/helpers.js +96 -0
- package/dist/runtime/server/utils/login.d.ts +17 -0
- package/dist/runtime/server/utils/login.js +44 -0
- package/dist/runtime/server/utils/register-webhooks.d.ts +19 -0
- package/dist/runtime/server/utils/register-webhooks.js +5 -0
- package/dist/runtime/server/utils/unauthenticated-admin.d.ts +21 -0
- package/dist/runtime/server/utils/unauthenticated-admin.js +15 -0
- package/dist/runtime/server/utils/unauthenticated-storefront.d.ts +24 -0
- package/dist/runtime/server/utils/unauthenticated-storefront.js +21 -0
- package/dist/runtime/types.d.ts +141 -0
- package/dist/runtime/types.js +11 -0
- package/dist/types.d.mts +3 -0
- package/package.json +66 -0
package/README.md
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# `shopify-nuxt`
|
|
2
|
+
|
|
3
|
+
> **NOTE** This package is in early alpha and is not yet recommended for production use. The API may change without a major version bump. Please try it out and share your feedback!
|
|
4
|
+
|
|
5
|
+
<!-- ![Build Status]() -->
|
|
6
|
+
|
|
7
|
+
[](LICENSE.md)
|
|
8
|
+
[](https://badge.fury.io/js/shopify-nuxt)
|
|
9
|
+
[](https://nuxt.com)
|
|
10
|
+
|
|
11
|
+
This package makes it easy to use [Nuxt](https://nuxt.com/) to build Shopify apps.
|
|
12
|
+
|
|
13
|
+
It builds on the `@shopify/shopify-api` package and creates a Nuxt module layer that allows your app to communicate with and authenticate requests from Shopify.
|
|
14
|
+
|
|
15
|
+
> **Note**: this package will enable your app's backend to work with Shopify APIs, and by default it will behave as an [embedded app](https://shopify.dev/docs/apps/auth/oauth/session-tokens). It uses the CDN-based [Shopify App Bridge](https://shopify.dev/docs/apps/tools/app-bridge) for frontend authentication.
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
To follow these usage guides, you will need to:
|
|
20
|
+
|
|
21
|
+
- Have a [Shopify Partner account](https://partners.shopify.com/signup) and development store
|
|
22
|
+
- Have an app already set up on your partner account
|
|
23
|
+
- Have a JavaScript package manager such as [bun](https://bun.sh), [yarn](https://yarnpkg.com), or [npm](https://www.npmjs.com/) installed
|
|
24
|
+
- Have [Nuxt](https://nuxt.com/) v4 or later installed
|
|
25
|
+
|
|
26
|
+
## Getting started
|
|
27
|
+
|
|
28
|
+
Install the module to your Nuxt application:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Using bun
|
|
32
|
+
bun add shopify-nuxt
|
|
33
|
+
|
|
34
|
+
# Using npm
|
|
35
|
+
npm install shopify-nuxt
|
|
36
|
+
|
|
37
|
+
# Using yarn
|
|
38
|
+
yarn add shopify-nuxt
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then add `shopify-nuxt` to the `modules` section and configure it in your `nuxt.config.ts`:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
export default defineNuxtConfig({
|
|
45
|
+
modules: ['shopify-nuxt'],
|
|
46
|
+
|
|
47
|
+
shopify: {
|
|
48
|
+
apiKey: 'ApiKeyFromPartnersDashboard',
|
|
49
|
+
apiSecretKey: 'ApiSecretKeyFromPartnersDashboard',
|
|
50
|
+
scopes: ['read_products', 'write_products'],
|
|
51
|
+
appUrl: 'https://your-app-url.com'
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For session storage and post-auth hooks, create a Nitro server plugin:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
// server/plugins/shopify.ts
|
|
60
|
+
import { configureShopify } from '#shopify/server'
|
|
61
|
+
import { MemorySessionStorage } from '@shopify/shopify-app-session-storage-memory'
|
|
62
|
+
|
|
63
|
+
export default defineNitroPlugin(() => {
|
|
64
|
+
configureShopify({
|
|
65
|
+
sessionStorage: new MemorySessionStorage(),
|
|
66
|
+
hooks: {
|
|
67
|
+
afterAuth: async ({ session, admin }) => {
|
|
68
|
+
// Register webhooks, seed data, etc.
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Authenticating admin requests
|
|
76
|
+
|
|
77
|
+
Use `useShopifyAdmin()` in your server API routes to authenticate requests from the Shopify admin:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
// server/api/products.ts
|
|
81
|
+
export default defineEventHandler(async (event) => {
|
|
82
|
+
const { admin } = await useShopifyAdmin(event)
|
|
83
|
+
|
|
84
|
+
const response = await admin.graphql(`{
|
|
85
|
+
products(first: 5) {
|
|
86
|
+
edges {
|
|
87
|
+
node {
|
|
88
|
+
id
|
|
89
|
+
title
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}`)
|
|
94
|
+
|
|
95
|
+
return response
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Handling webhooks
|
|
100
|
+
|
|
101
|
+
Use `useShopifyWebhook()` to validate and process incoming webhooks:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
// server/api/webhooks.ts
|
|
105
|
+
export default defineEventHandler(async (event) => {
|
|
106
|
+
const { topic, shop, payload } = await useShopifyWebhook(event)
|
|
107
|
+
|
|
108
|
+
switch (topic) {
|
|
109
|
+
case 'APP_UNINSTALLED':
|
|
110
|
+
// Clean up shop data
|
|
111
|
+
break
|
|
112
|
+
case 'PRODUCTS_CREATE':
|
|
113
|
+
// Handle new product
|
|
114
|
+
break
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return { success: true }
|
|
118
|
+
})
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Using App Bridge on the client
|
|
122
|
+
|
|
123
|
+
The module automatically injects the Shopify App Bridge CDN script and provides typed access via composables:
|
|
124
|
+
|
|
125
|
+
```vue
|
|
126
|
+
<script setup>
|
|
127
|
+
// Access the App Bridge instance (typed as ShopifyGlobal)
|
|
128
|
+
const shopify = useAppBridge()
|
|
129
|
+
|
|
130
|
+
// Or use the authenticated fetch wrapper
|
|
131
|
+
const shopifyFetch = useShopifyFetch()
|
|
132
|
+
const { data } = await shopifyFetch('/api/products')
|
|
133
|
+
</script>
|
|
134
|
+
|
|
135
|
+
<template>
|
|
136
|
+
<ShopifyAppProvider>
|
|
137
|
+
<!-- Your app content -->
|
|
138
|
+
</ShopifyAppProvider>
|
|
139
|
+
</template>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Using Polaris components
|
|
143
|
+
|
|
144
|
+
This module provides Vue wrapper components for [Shopify Polaris web components](https://shopify.dev/docs/api/app-home/web-components). Use the `Sh`-prefixed wrappers instead of the raw `s-*` web components — they provide typed props with autocomplete and work seamlessly with Vue's reactivity system.
|
|
145
|
+
|
|
146
|
+
```vue
|
|
147
|
+
<template>
|
|
148
|
+
<ShPage heading="Products">
|
|
149
|
+
<ShStack gap="base">
|
|
150
|
+
<ShButton variant="primary" @click="save">Save</ShButton>
|
|
151
|
+
<ShButton @click="cancel">Cancel</ShButton>
|
|
152
|
+
</ShStack>
|
|
153
|
+
|
|
154
|
+
<ShBanner heading="Welcome" tone="info" dismissible>
|
|
155
|
+
Start by adding your first product.
|
|
156
|
+
</ShBanner>
|
|
157
|
+
|
|
158
|
+
<ShTextField
|
|
159
|
+
label="Product title"
|
|
160
|
+
:value="title"
|
|
161
|
+
placeholder="Enter product title"
|
|
162
|
+
/>
|
|
163
|
+
</ShPage>
|
|
164
|
+
</template>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
All `Sh*` components are auto-imported — no manual imports needed. Each component maps directly to its Polaris web component counterpart (e.g., `<ShButton>` → `<s-button>`, `<ShTextField>` → `<s-text-field>`).
|
|
168
|
+
|
|
169
|
+
### Loading your app in Shopify Admin
|
|
170
|
+
|
|
171
|
+
To load your app within the Shopify Admin, you need to:
|
|
172
|
+
|
|
173
|
+
1. Update your app's URL in your Partners Dashboard app setup page to your app URL (e.g., `https://your-app-url.com`)
|
|
174
|
+
1. Update your app's callback URL to `https://your-app-url.com/_shopify/auth/callback` in that same page
|
|
175
|
+
1. Go to **Test your app** in Partners Dashboard and select your development store
|
|
176
|
+
|
|
177
|
+
## Features
|
|
178
|
+
|
|
179
|
+
| Feature | Description |
|
|
180
|
+
| ------------------- | ------------------------------------------------------------------------------- |
|
|
181
|
+
| **Authentication** | OAuth flow, session tokens, token exchange — all handled automatically |
|
|
182
|
+
| **App Bridge** | CDN-based App Bridge with full TypeScript types via `@shopify/app-bridge-types` |
|
|
183
|
+
| **Polaris** | Vue wrapper components (`Sh*`) for all Polaris web components with typed props |
|
|
184
|
+
| **Webhooks** | HMAC validation, payload parsing, and webhook registration |
|
|
185
|
+
| **Admin API** | GraphQL and REST clients with automatic session management |
|
|
186
|
+
| **Billing** | Billing context for subscription and usage-based charges |
|
|
187
|
+
| **Session storage** | Pluggable session storage via `@shopify/shopify-app-session-storage` |
|
|
188
|
+
| **Auto-imports** | Server utilities and client composables are auto-imported |
|
|
189
|
+
|
|
190
|
+
## Server utilities
|
|
191
|
+
|
|
192
|
+
These are auto-imported in your `server/` directory:
|
|
193
|
+
|
|
194
|
+
| Utility | Purpose |
|
|
195
|
+
| ------------------------------------------- | ----------------------------------------------------- |
|
|
196
|
+
| `useShopifyAdmin(event)` | Authenticate admin requests (token exchange, session) |
|
|
197
|
+
| `useShopifyWebhook(event)` | Validate webhook HMAC + parse payload |
|
|
198
|
+
| `useShopifyFlow(event)` | Authenticate Shopify Flow extension requests |
|
|
199
|
+
| `useShopifyPublic(event)` | Authenticate public/checkout extension requests |
|
|
200
|
+
| `useShopifyPos(event)` | Authenticate POS extension requests |
|
|
201
|
+
| `useShopifyFulfillmentService(event)` | Authenticate fulfillment service callbacks |
|
|
202
|
+
| `useShopifyLogin(event)` | Handle merchant login (non-embedded apps) |
|
|
203
|
+
| `useShopifyUnauthenticatedAdmin(shop)` | Offline session admin API access |
|
|
204
|
+
| `useShopifyUnauthenticatedStorefront(shop)` | Offline session storefront API access |
|
|
205
|
+
| `registerShopifyWebhooks(session)` | Register webhooks for a shop |
|
|
206
|
+
|
|
207
|
+
## Client composables
|
|
208
|
+
|
|
209
|
+
These are auto-imported in your Vue components:
|
|
210
|
+
|
|
211
|
+
| Composable | Purpose |
|
|
212
|
+
| ------------------- | ------------------------------------------------- |
|
|
213
|
+
| `useAppBridge()` | Returns typed `ShopifyGlobal` from App Bridge CDN |
|
|
214
|
+
| `useShopifyFetch()` | Fetch wrapper with automatic session token auth |
|
|
215
|
+
|
|
216
|
+
## Testing your app
|
|
217
|
+
|
|
218
|
+
This package exports test helpers through `shopify-nuxt/test-helpers` to simplify testing:
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
import { testConfig, testSession } from 'shopify-nuxt/test-helpers'
|
|
222
|
+
|
|
223
|
+
// testConfig() returns a dummy configuration for testing
|
|
224
|
+
const config = testConfig()
|
|
225
|
+
|
|
226
|
+
// testSession() returns a mock Shopify session
|
|
227
|
+
const session = testSession()
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Resources
|
|
231
|
+
|
|
232
|
+
Getting started:
|
|
233
|
+
|
|
234
|
+
- [Nuxt docs](https://nuxt.com/docs)
|
|
235
|
+
- [Build a Shopify app](https://shopify.dev/docs/apps/build/build)
|
|
236
|
+
|
|
237
|
+
Shopify:
|
|
238
|
+
|
|
239
|
+
- [Intro to Shopify apps](https://shopify.dev/docs/apps/getting-started)
|
|
240
|
+
- [Shopify CLI](https://shopify.dev/docs/apps/tools/cli)
|
|
241
|
+
- [Shopify App Bridge](https://shopify.dev/docs/api/app-bridge-library)
|
|
242
|
+
- [Polaris Web Components](https://shopify.dev/docs/api/app-home/using-polaris-components)
|
|
243
|
+
- [App extensions](https://shopify.dev/docs/apps/app-extensions/list)
|
|
244
|
+
- [Shopify Functions](https://shopify.dev/docs/api/functions)
|
|
245
|
+
|
|
246
|
+
## Contributing
|
|
247
|
+
|
|
248
|
+
<details>
|
|
249
|
+
<summary>Local development</summary>
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# Install dependencies
|
|
253
|
+
bun install
|
|
254
|
+
|
|
255
|
+
# Generate type stubs
|
|
256
|
+
bun run dev:prepare
|
|
257
|
+
|
|
258
|
+
# Develop with the playground
|
|
259
|
+
bun run dev
|
|
260
|
+
|
|
261
|
+
# Build the playground
|
|
262
|
+
bun run dev:build
|
|
263
|
+
|
|
264
|
+
# Run ESLint
|
|
265
|
+
bun run lint
|
|
266
|
+
|
|
267
|
+
# Run Vitest
|
|
268
|
+
bun run test
|
|
269
|
+
bun run test:watch
|
|
270
|
+
|
|
271
|
+
# Release new version
|
|
272
|
+
bun run release
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
</details>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { ModuleOptions } from '../dist/runtime/types.js';
|
|
3
|
+
export { ModuleOptions } from '../dist/runtime/types.js';
|
|
4
|
+
|
|
5
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
6
|
+
|
|
7
|
+
export { _default as default };
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, addServerImportsDir, addImportsDir, addComponentsDir, addTypeTemplate, addPlugin, addServerHandler, addRouteMiddleware } from '@nuxt/kit';
|
|
2
|
+
import { ApiVersion } from '@shopify/shopify-api';
|
|
3
|
+
|
|
4
|
+
const module$1 = defineNuxtModule({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "shopify-nuxt",
|
|
7
|
+
configKey: "shopify"
|
|
8
|
+
},
|
|
9
|
+
defaults: {
|
|
10
|
+
apiKey: "",
|
|
11
|
+
apiSecretKey: "",
|
|
12
|
+
scopes: [],
|
|
13
|
+
appUrl: "",
|
|
14
|
+
apiVersion: ApiVersion.January26,
|
|
15
|
+
authPathPrefix: "/_shopify/auth",
|
|
16
|
+
distribution: "app_store",
|
|
17
|
+
useOnlineTokens: false
|
|
18
|
+
},
|
|
19
|
+
setup(options, nuxt) {
|
|
20
|
+
const resolver = createResolver(import.meta.url);
|
|
21
|
+
nuxt.options.runtimeConfig.shopify = {
|
|
22
|
+
apiKey: options.apiKey,
|
|
23
|
+
apiSecretKey: options.apiSecretKey,
|
|
24
|
+
scopes: options.scopes,
|
|
25
|
+
appUrl: options.appUrl,
|
|
26
|
+
apiVersion: options.apiVersion || ApiVersion.January26,
|
|
27
|
+
authPathPrefix: options.authPathPrefix || "/_shopify/auth",
|
|
28
|
+
distribution: options.distribution || "app_store",
|
|
29
|
+
useOnlineTokens: options.useOnlineTokens || false
|
|
30
|
+
};
|
|
31
|
+
nuxt.options.runtimeConfig.public.shopify = {
|
|
32
|
+
apiKey: options.apiKey
|
|
33
|
+
};
|
|
34
|
+
nuxt.options.alias["#shopify/server"] = resolver.resolve("./runtime/server");
|
|
35
|
+
addServerImportsDir(resolver.resolve("./runtime/server/utils"));
|
|
36
|
+
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
37
|
+
addComponentsDir({
|
|
38
|
+
path: resolver.resolve("./runtime/components")
|
|
39
|
+
});
|
|
40
|
+
nuxt.hook("app:resolve", () => {
|
|
41
|
+
nuxt.options.app.head = nuxt.options.app.head || {};
|
|
42
|
+
nuxt.options.app.head.meta = [
|
|
43
|
+
{
|
|
44
|
+
name: "content-security-policy",
|
|
45
|
+
content: "frame-ancestors 'self' *.myshopify.com *.shopify.com"
|
|
46
|
+
},
|
|
47
|
+
...nuxt.options.app.head.meta || []
|
|
48
|
+
];
|
|
49
|
+
nuxt.options.app.head.script = [
|
|
50
|
+
// 1. Inline script to create the meta tag imperatively — guarantees it
|
|
51
|
+
// exists in the DOM before the CDN script executes.
|
|
52
|
+
{
|
|
53
|
+
key: "shopify-api-key-meta",
|
|
54
|
+
innerHTML: `var m=document.createElement('meta');m.name='shopify-api-key';m.content='${options.apiKey}';document.head.appendChild(m);`,
|
|
55
|
+
tagPosition: "head"
|
|
56
|
+
},
|
|
57
|
+
// 2. App Bridge CDN — reads the meta tag on load
|
|
58
|
+
{
|
|
59
|
+
src: "https://cdn.shopify.com/shopifycloud/app-bridge.js",
|
|
60
|
+
tagPosition: "head"
|
|
61
|
+
},
|
|
62
|
+
// 3. Polaris CDN
|
|
63
|
+
{
|
|
64
|
+
src: "https://cdn.shopify.com/shopifycloud/polaris.js",
|
|
65
|
+
tagPosition: "head"
|
|
66
|
+
},
|
|
67
|
+
...nuxt.options.app.head.script || []
|
|
68
|
+
];
|
|
69
|
+
nuxt.options.vue.compilerOptions.isCustomElement = (tag) => {
|
|
70
|
+
return tag.startsWith("s-");
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
addTypeTemplate({
|
|
74
|
+
filename: "types/polaris.d.ts",
|
|
75
|
+
getContents: () => `
|
|
76
|
+
/// <reference types="@shopify/polaris-types" />
|
|
77
|
+
|
|
78
|
+
declare module 'vue' {
|
|
79
|
+
interface HTMLAttributes {
|
|
80
|
+
slot?: string
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {}
|
|
85
|
+
`
|
|
86
|
+
});
|
|
87
|
+
addPlugin({
|
|
88
|
+
src: resolver.resolve("./runtime/plugins/app-bridge"),
|
|
89
|
+
mode: "client"
|
|
90
|
+
});
|
|
91
|
+
const authPrefix = options.authPathPrefix || "/_shopify/auth";
|
|
92
|
+
addServerHandler({
|
|
93
|
+
route: authPrefix,
|
|
94
|
+
method: "get",
|
|
95
|
+
handler: resolver.resolve("./runtime/server/routes/auth")
|
|
96
|
+
});
|
|
97
|
+
addServerHandler({
|
|
98
|
+
route: `${authPrefix}/callback`,
|
|
99
|
+
method: "get",
|
|
100
|
+
handler: resolver.resolve("./runtime/server/routes/auth-callback")
|
|
101
|
+
});
|
|
102
|
+
addServerHandler({
|
|
103
|
+
route: `${authPrefix}/exit-iframe`,
|
|
104
|
+
method: "get",
|
|
105
|
+
handler: resolver.resolve("./runtime/server/routes/auth-exit-iframe")
|
|
106
|
+
});
|
|
107
|
+
addServerHandler({
|
|
108
|
+
route: `${authPrefix}/session-token`,
|
|
109
|
+
method: "get",
|
|
110
|
+
handler: resolver.resolve("./runtime/server/routes/auth-session-token")
|
|
111
|
+
});
|
|
112
|
+
addRouteMiddleware({
|
|
113
|
+
name: "shopify-auth",
|
|
114
|
+
path: resolver.resolve("./runtime/middleware/shopify-auth"),
|
|
115
|
+
global: false
|
|
116
|
+
});
|
|
117
|
+
nuxt.options.build.transpile.push(resolver.resolve("./runtime"));
|
|
118
|
+
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
119
|
+
nitroConfig.externals = nitroConfig.externals || {};
|
|
120
|
+
nitroConfig.externals.inline = nitroConfig.externals.inline || [];
|
|
121
|
+
nitroConfig.externals.inline.push(
|
|
122
|
+
"@shopify/shopify-api",
|
|
123
|
+
"@shopify/shopify-api/adapters/node"
|
|
124
|
+
);
|
|
125
|
+
});
|
|
126
|
+
nuxt.hook("prepare:types", ({ references }) => {
|
|
127
|
+
references.push({
|
|
128
|
+
path: resolver.resolve("./runtime/types.ts")
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
initials?: string;
|
|
3
|
+
src?: string;
|
|
4
|
+
size?: 'small' | 'small-200' | 'base' | 'large' | 'large-200';
|
|
5
|
+
alt?: string;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_8: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_8) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<s-avatar v-bind="$attrs">
|
|
3
|
+
<slot />
|
|
4
|
+
</s-avatar>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
defineOptions({ name: "ShAvatar", inheritAttrs: false });
|
|
9
|
+
defineProps({
|
|
10
|
+
initials: { type: String, required: false },
|
|
11
|
+
src: { type: String, required: false },
|
|
12
|
+
size: { type: String, required: false },
|
|
13
|
+
alt: { type: String, required: false }
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
initials?: string;
|
|
3
|
+
src?: string;
|
|
4
|
+
size?: 'small' | 'small-200' | 'base' | 'large' | 'large-200';
|
|
5
|
+
alt?: string;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_8: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_8) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
content?: string;
|
|
3
|
+
progress?: string;
|
|
4
|
+
tone?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
size?: 'base' | 'large';
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_8: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_8) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<s-badge v-bind="$attrs">
|
|
3
|
+
<slot />
|
|
4
|
+
</s-badge>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
defineOptions({ name: "ShBadge", inheritAttrs: false });
|
|
9
|
+
defineProps({
|
|
10
|
+
content: { type: String, required: false },
|
|
11
|
+
progress: { type: String, required: false },
|
|
12
|
+
tone: { type: String, required: false },
|
|
13
|
+
icon: { type: String, required: false },
|
|
14
|
+
size: { type: String, required: false }
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
content?: string;
|
|
3
|
+
progress?: string;
|
|
4
|
+
tone?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
size?: 'base' | 'large';
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_8: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_8) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
heading?: string;
|
|
3
|
+
tone?: 'info' | 'success' | 'warning' | 'critical' | 'auto';
|
|
4
|
+
hidden?: boolean;
|
|
5
|
+
dismissible?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_8: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_8) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<s-banner v-bind="$attrs">
|
|
3
|
+
<slot />
|
|
4
|
+
</s-banner>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
defineOptions({ name: "ShBanner", inheritAttrs: false });
|
|
9
|
+
defineProps({
|
|
10
|
+
heading: { type: String, required: false },
|
|
11
|
+
tone: { type: String, required: false },
|
|
12
|
+
hidden: { type: Boolean, required: false },
|
|
13
|
+
dismissible: { type: Boolean, required: false }
|
|
14
|
+
});
|
|
15
|
+
</script>
|