@yan-ad/nuxt-shopify 0.0.0-stage → 1.3.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/LICENSE +21 -0
- package/README.md +70 -2
- package/dist/chunks/codegen.mjs +125 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +199 -0
- package/dist/runtime/admin-api-client.d.ts +1 -0
- package/dist/runtime/admin-api-client.js +1 -0
- package/dist/runtime/app-bridge-types.d.ts +1 -0
- package/dist/runtime/app-bridge-types.js +0 -0
- package/dist/runtime/components/polaris/App.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/App.vue +22 -0
- package/dist/runtime/components/polaris/App.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/AppNav.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/AppNav.vue +9 -0
- package/dist/runtime/components/polaris/AppNav.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/Avatar.d.vue.ts +26 -0
- package/dist/runtime/components/polaris/Avatar.vue +22 -0
- package/dist/runtime/components/polaris/Avatar.vue.d.ts +26 -0
- package/dist/runtime/components/polaris/Badge.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/Badge.vue +17 -0
- package/dist/runtime/components/polaris/Badge.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/Banner.d.vue.ts +26 -0
- package/dist/runtime/components/polaris/Banner.vue +22 -0
- package/dist/runtime/components/polaris/Banner.vue.d.ts +26 -0
- package/dist/runtime/components/polaris/Box.d.vue.ts +40 -0
- package/dist/runtime/components/polaris/Box.vue +37 -0
- package/dist/runtime/components/polaris/Box.vue.d.ts +40 -0
- package/dist/runtime/components/polaris/Button.d.vue.ts +37 -0
- package/dist/runtime/components/polaris/Button.vue +32 -0
- package/dist/runtime/components/polaris/Button.vue.d.ts +37 -0
- package/dist/runtime/components/polaris/ButtonGroup.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ButtonGroup.vue +15 -0
- package/dist/runtime/components/polaris/ButtonGroup.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/Checkbox.d.vue.ts +35 -0
- package/dist/runtime/components/polaris/Checkbox.vue +41 -0
- package/dist/runtime/components/polaris/Checkbox.vue.d.ts +35 -0
- package/dist/runtime/components/polaris/Chip.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/Chip.vue +15 -0
- package/dist/runtime/components/polaris/Chip.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/Choice.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/Choice.vue +18 -0
- package/dist/runtime/components/polaris/Choice.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/ChoiceList.d.vue.ts +31 -0
- package/dist/runtime/components/polaris/ChoiceList.vue +37 -0
- package/dist/runtime/components/polaris/ChoiceList.vue.d.ts +31 -0
- package/dist/runtime/components/polaris/Clickable.d.vue.ts +49 -0
- package/dist/runtime/components/polaris/Clickable.vue +46 -0
- package/dist/runtime/components/polaris/Clickable.vue.d.ts +49 -0
- package/dist/runtime/components/polaris/ClickableChip.d.vue.ts +33 -0
- package/dist/runtime/components/polaris/ClickableChip.vue +28 -0
- package/dist/runtime/components/polaris/ClickableChip.vue.d.ts +33 -0
- package/dist/runtime/components/polaris/ColorField.d.vue.ts +41 -0
- package/dist/runtime/components/polaris/ColorField.vue +45 -0
- package/dist/runtime/components/polaris/ColorField.vue.d.ts +41 -0
- package/dist/runtime/components/polaris/ColorPicker.d.vue.ts +27 -0
- package/dist/runtime/components/polaris/ColorPicker.vue +33 -0
- package/dist/runtime/components/polaris/ColorPicker.vue.d.ts +27 -0
- package/dist/runtime/components/polaris/DateField.d.vue.ts +50 -0
- package/dist/runtime/components/polaris/DateField.vue +52 -0
- package/dist/runtime/components/polaris/DateField.vue.d.ts +50 -0
- package/dist/runtime/components/polaris/DatePicker.d.vue.ts +39 -0
- package/dist/runtime/components/polaris/DatePicker.vue +42 -0
- package/dist/runtime/components/polaris/DatePicker.vue.d.ts +39 -0
- package/dist/runtime/components/polaris/Divider.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/Divider.vue +15 -0
- package/dist/runtime/components/polaris/Divider.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/DropZone.d.vue.ts +35 -0
- package/dist/runtime/components/polaris/DropZone.vue +40 -0
- package/dist/runtime/components/polaris/DropZone.vue.d.ts +35 -0
- package/dist/runtime/components/polaris/EmailField.d.vue.ts +42 -0
- package/dist/runtime/components/polaris/EmailField.vue +46 -0
- package/dist/runtime/components/polaris/EmailField.vue.d.ts +42 -0
- package/dist/runtime/components/polaris/Grid.d.vue.ts +51 -0
- package/dist/runtime/components/polaris/Grid.vue +48 -0
- package/dist/runtime/components/polaris/Grid.vue.d.ts +51 -0
- package/dist/runtime/components/polaris/GridItem.d.vue.ts +42 -0
- package/dist/runtime/components/polaris/GridItem.vue +39 -0
- package/dist/runtime/components/polaris/GridItem.vue.d.ts +42 -0
- package/dist/runtime/components/polaris/Heading.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/Heading.vue +16 -0
- package/dist/runtime/components/polaris/Heading.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/Icon.d.vue.ts +21 -0
- package/dist/runtime/components/polaris/Icon.vue +18 -0
- package/dist/runtime/components/polaris/Icon.vue.d.ts +21 -0
- package/dist/runtime/components/polaris/Image.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/Image.vue +16 -0
- package/dist/runtime/components/polaris/Image.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/Link.d.vue.ts +24 -0
- package/dist/runtime/components/polaris/Link.vue +22 -0
- package/dist/runtime/components/polaris/Link.vue.d.ts +24 -0
- package/dist/runtime/components/polaris/ListItem.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ListItem.vue +9 -0
- package/dist/runtime/components/polaris/ListItem.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/LoadingIndicator.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/LoadingIndicator.vue +22 -0
- package/dist/runtime/components/polaris/LoadingIndicator.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/Menu.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/Menu.vue +14 -0
- package/dist/runtime/components/polaris/Menu.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/Modal.d.vue.ts +24 -0
- package/dist/runtime/components/polaris/Modal.vue +20 -0
- package/dist/runtime/components/polaris/Modal.vue.d.ts +24 -0
- package/dist/runtime/components/polaris/MoneyField.d.vue.ts +42 -0
- package/dist/runtime/components/polaris/MoneyField.vue +46 -0
- package/dist/runtime/components/polaris/MoneyField.vue.d.ts +42 -0
- package/dist/runtime/components/polaris/NumberField.d.vue.ts +46 -0
- package/dist/runtime/components/polaris/NumberField.vue +50 -0
- package/dist/runtime/components/polaris/NumberField.vue.d.ts +46 -0
- package/dist/runtime/components/polaris/Option.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/Option.vue +17 -0
- package/dist/runtime/components/polaris/Option.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/OptionGroup.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/OptionGroup.vue +15 -0
- package/dist/runtime/components/polaris/OptionGroup.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/OrderedList.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/OrderedList.vue +9 -0
- package/dist/runtime/components/polaris/OrderedList.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/Page.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/Page.vue +15 -0
- package/dist/runtime/components/polaris/Page.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/Paragraph.d.vue.ts +21 -0
- package/dist/runtime/components/polaris/Paragraph.vue +19 -0
- package/dist/runtime/components/polaris/Paragraph.vue.d.ts +21 -0
- package/dist/runtime/components/polaris/PasswordField.d.vue.ts +42 -0
- package/dist/runtime/components/polaris/PasswordField.vue +46 -0
- package/dist/runtime/components/polaris/PasswordField.vue.d.ts +42 -0
- package/dist/runtime/components/polaris/Popover.d.vue.ts +23 -0
- package/dist/runtime/components/polaris/Popover.vue +20 -0
- package/dist/runtime/components/polaris/Popover.vue.d.ts +23 -0
- package/dist/runtime/components/polaris/QueryContainer.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/QueryContainer.vue +14 -0
- package/dist/runtime/components/polaris/QueryContainer.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/SearchField.d.vue.ts +42 -0
- package/dist/runtime/components/polaris/SearchField.vue +46 -0
- package/dist/runtime/components/polaris/SearchField.vue.d.ts +42 -0
- package/dist/runtime/components/polaris/Section.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/Section.vue +16 -0
- package/dist/runtime/components/polaris/Section.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/Select.d.vue.ts +35 -0
- package/dist/runtime/components/polaris/Select.vue +40 -0
- package/dist/runtime/components/polaris/Select.vue.d.ts +35 -0
- package/dist/runtime/components/polaris/Spinner.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/Spinner.vue +15 -0
- package/dist/runtime/components/polaris/Spinner.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/Stack.d.vue.ts +47 -0
- package/dist/runtime/components/polaris/Stack.vue +44 -0
- package/dist/runtime/components/polaris/Stack.vue.d.ts +47 -0
- package/dist/runtime/components/polaris/Switch.d.vue.ts +34 -0
- package/dist/runtime/components/polaris/Switch.vue +40 -0
- package/dist/runtime/components/polaris/Switch.vue.d.ts +34 -0
- package/dist/runtime/components/polaris/Table.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/Table.vue +18 -0
- package/dist/runtime/components/polaris/Table.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/TableBody.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/TableBody.vue +9 -0
- package/dist/runtime/components/polaris/TableBody.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/TableCell.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/TableCell.vue +9 -0
- package/dist/runtime/components/polaris/TableCell.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/TableHeader.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/TableHeader.vue +15 -0
- package/dist/runtime/components/polaris/TableHeader.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/TableHeaderRow.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/TableHeaderRow.vue +9 -0
- package/dist/runtime/components/polaris/TableHeaderRow.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/TableRow.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/TableRow.vue +14 -0
- package/dist/runtime/components/polaris/TableRow.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/Text.d.vue.ts +22 -0
- package/dist/runtime/components/polaris/Text.vue +20 -0
- package/dist/runtime/components/polaris/Text.vue.d.ts +22 -0
- package/dist/runtime/components/polaris/TextArea.d.vue.ts +43 -0
- package/dist/runtime/components/polaris/TextArea.vue +47 -0
- package/dist/runtime/components/polaris/TextArea.vue.d.ts +43 -0
- package/dist/runtime/components/polaris/TextField.d.vue.ts +46 -0
- package/dist/runtime/components/polaris/TextField.vue +49 -0
- package/dist/runtime/components/polaris/TextField.vue.d.ts +46 -0
- package/dist/runtime/components/polaris/Thumbnail.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/Thumbnail.vue +16 -0
- package/dist/runtime/components/polaris/Thumbnail.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/Tooltip.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/Tooltip.vue +14 -0
- package/dist/runtime/components/polaris/Tooltip.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/UiModal.d.vue.ts +28 -0
- package/dist/runtime/components/polaris/UiModal.vue +23 -0
- package/dist/runtime/components/polaris/UiModal.vue.d.ts +28 -0
- package/dist/runtime/components/polaris/UiNavMenu.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/UiNavMenu.vue +9 -0
- package/dist/runtime/components/polaris/UiNavMenu.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/UiSaveBar.d.vue.ts +21 -0
- package/dist/runtime/components/polaris/UiSaveBar.vue +34 -0
- package/dist/runtime/components/polaris/UiSaveBar.vue.d.ts +21 -0
- package/dist/runtime/components/polaris/UiTitleBar.d.vue.ts +14 -0
- package/dist/runtime/components/polaris/UiTitleBar.vue +39 -0
- package/dist/runtime/components/polaris/UiTitleBar.vue.d.ts +14 -0
- package/dist/runtime/components/polaris/UnorderedList.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/UnorderedList.vue +9 -0
- package/dist/runtime/components/polaris/UnorderedList.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/UrlField.d.vue.ts +42 -0
- package/dist/runtime/components/polaris/UrlField.vue +46 -0
- package/dist/runtime/components/polaris/UrlField.vue.d.ts +42 -0
- package/dist/runtime/components/polaris/utils.d.ts +7 -0
- package/dist/runtime/components/polaris/utils.js +13 -0
- package/dist/runtime/composables/useAppBridge.d.ts +11 -0
- package/dist/runtime/composables/useAppBridge.js +32 -0
- package/dist/runtime/composables/useShopifyFetch.d.ts +12 -0
- package/dist/runtime/composables/useShopifyFetch.js +62 -0
- package/dist/runtime/middleware/shopify-auth.d.ts +2 -0
- package/dist/runtime/middleware/shopify-auth.js +19 -0
- package/dist/runtime/middleware/shopify-guest.d.ts +2 -0
- package/dist/runtime/middleware/shopify-guest.js +14 -0
- package/dist/runtime/pages/auth-login.d.vue.ts +3 -0
- package/dist/runtime/pages/auth-login.vue +111 -0
- package/dist/runtime/pages/auth-login.vue.d.ts +3 -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 +22 -0
- package/dist/runtime/server/index.d.ts +4 -0
- package/dist/runtime/server/index.js +8 -0
- package/dist/runtime/server/plugins/add-response-headers.d.ts +11 -0
- package/dist/runtime/server/plugins/add-response-headers.js +29 -0
- package/dist/runtime/server/plugins/shopify-defaults.d.ts +8 -0
- package/dist/runtime/server/plugins/shopify-defaults.js +13 -0
- package/dist/runtime/server/routes/auth-callback.d.ts +6 -0
- package/dist/runtime/server/routes/auth-callback.js +51 -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 +18 -0
- package/dist/runtime/server/utils/authenticate-admin.js +219 -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 +21 -0
- package/dist/runtime/server/utils/clients.js +22 -0
- package/dist/runtime/server/utils/helpers.d.ts +10 -0
- package/dist/runtime/server/utils/helpers.js +98 -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/shared/polaris.d.ts +4 -0
- package/dist/runtime/shared/polaris.js +4 -0
- package/dist/runtime/shopify-api.d.ts +1 -0
- package/dist/runtime/shopify-api.js +1 -0
- package/dist/runtime/shopify-app-session-storage-memory.d.ts +1 -0
- package/dist/runtime/shopify-app-session-storage-memory.js +1 -0
- package/dist/runtime/shopify-app-session-storage.d.ts +1 -0
- package/dist/runtime/shopify-app-session-storage.js +1 -0
- package/dist/runtime/types/icon.d.ts +114 -0
- package/dist/runtime/types/index.d.ts +221 -0
- package/dist/runtime/types/index.js +11 -0
- package/dist/runtime/types.d.ts +279 -0
- package/dist/runtime/types.js +11 -0
- package/dist/types.d.mts +3 -0
- package/package.json +134 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yanuar Aditia @yanuaraditia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,71 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@yan-ad/nuxt-shopify`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](LICENSE.md)
|
|
4
|
+
[](https://badge.fury.io/js/%40yan-ad%2Fnuxt-shopify)
|
|
5
|
+
[](https://npmtrends.com/%40yan-ad%2Fnuxt-shopify)
|
|
6
|
+
[](https://nuxt.com)
|
|
7
|
+
|
|
8
|
+
A [Nuxt](https://nuxt.com/) module for building Shopify apps — authentication, webhooks, billing, Polaris components, and App Bridge integration. The Nuxt equivalent of `@shopify/shopify-app-react-router`.
|
|
9
|
+
|
|
10
|
+
> [!IMPORTANT]
|
|
11
|
+
> This package is a **release candidate**. The API is mostly stable but may still change before the 1.0 release.
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx nuxi@latest module add @yan-ad/nuxt-shopify
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then configure your API credentials and app URL in `nuxt.config.ts`:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// nuxt.config.ts
|
|
23
|
+
export default defineNuxtConfig({
|
|
24
|
+
modules: ['@yan-ad/nuxt-shopify'],
|
|
25
|
+
shopify: {
|
|
26
|
+
apiKey: 'your-api-key',
|
|
27
|
+
apiSecretKey: 'your-api-secret',
|
|
28
|
+
appUrl: 'https://your-app-url.com'
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
For full documentation, guides, and API reference, visit the docs:
|
|
36
|
+
|
|
37
|
+
**[https://shopify-app-nuxt.vercel.app](https://shopify-app-nuxt.vercel.app)**
|
|
38
|
+
|
|
39
|
+
## License
|
|
40
|
+
|
|
41
|
+
[MIT](LICENSE.md)
|
|
42
|
+
|
|
43
|
+
## Contributing
|
|
44
|
+
|
|
45
|
+
### Local development
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Install dependencies
|
|
49
|
+
bun install
|
|
50
|
+
|
|
51
|
+
# Generate type stubs
|
|
52
|
+
bun run dev:prepare
|
|
53
|
+
|
|
54
|
+
# Develop with the playground
|
|
55
|
+
bun run dev
|
|
56
|
+
|
|
57
|
+
# Build the playground
|
|
58
|
+
bun run dev:build
|
|
59
|
+
|
|
60
|
+
# Run ESLint
|
|
61
|
+
bun run lint
|
|
62
|
+
|
|
63
|
+
# Run Vitest
|
|
64
|
+
bun run test
|
|
65
|
+
bun run test:watch
|
|
66
|
+
|
|
67
|
+
# Release new version
|
|
68
|
+
bun run release
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
</details>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
|
|
5
|
+
const INTROSPECTION_QUERY = `query IntrospectionQuery { __schema { queryType { name } mutationType { name } subscriptionType { name } types { ...FullType } directives { name description locations args { ...InputValue } } } } fragment FullType on __Type { kind name description fields(includeDeprecated: true) { name description args { ...InputValue } type { ...TypeRef } isDeprecated deprecationReason } inputFields { ...InputValue } interfaces { ...TypeRef } enumValues(includeDeprecated: true) { name description isDeprecated deprecationReason } possibleTypes { ...TypeRef } } fragment InputValue on __InputValue { name description type { ...TypeRef } defaultValue } fragment TypeRef on __Type { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } } } }`;
|
|
6
|
+
async function fetchSchema(version, domain, token, cacheDir, logger) {
|
|
7
|
+
const cachedPath = resolve(cacheDir, `${version}.json`);
|
|
8
|
+
if (existsSync(cachedPath)) {
|
|
9
|
+
logger.debug(`Using cached schema for API ${version}`);
|
|
10
|
+
return cachedPath;
|
|
11
|
+
}
|
|
12
|
+
const url = `https://${domain}/admin/api/${version}/graphql.json`;
|
|
13
|
+
logger.start(`Fetching schema for API ${version}...`);
|
|
14
|
+
const response = await fetch(url, {
|
|
15
|
+
method: "POST",
|
|
16
|
+
headers: {
|
|
17
|
+
"X-Shopify-Access-Token": token,
|
|
18
|
+
"Content-Type": "application/json"
|
|
19
|
+
},
|
|
20
|
+
body: JSON.stringify({ query: INTROSPECTION_QUERY })
|
|
21
|
+
});
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`Failed to fetch schema for ${version}: ${response.status} ${response.statusText}`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
const data = await response.json();
|
|
28
|
+
await writeFile(cachedPath, JSON.stringify(data, null, 2));
|
|
29
|
+
logger.success(`Fetched schema for API ${version}`);
|
|
30
|
+
return cachedPath;
|
|
31
|
+
}
|
|
32
|
+
async function generate(schemaPaths, rootDir, outputDir, logger) {
|
|
33
|
+
let codegen;
|
|
34
|
+
let shopifyCodegen;
|
|
35
|
+
try {
|
|
36
|
+
codegen = await import('@graphql-codegen/cli');
|
|
37
|
+
shopifyCodegen = await import('@shopify/graphql-codegen');
|
|
38
|
+
} catch {
|
|
39
|
+
logger.warn(
|
|
40
|
+
"Codegen peer dependencies not installed. Install them with:\n bun add -d @graphql-codegen/cli @shopify/graphql-codegen graphql\nSkipping codegen."
|
|
41
|
+
);
|
|
42
|
+
return /* @__PURE__ */ new Map();
|
|
43
|
+
}
|
|
44
|
+
if (!existsSync(outputDir)) await mkdir(outputDir, { recursive: true });
|
|
45
|
+
const { preset, pluckConfig } = shopifyCodegen;
|
|
46
|
+
const generates = {};
|
|
47
|
+
const outputPaths = /* @__PURE__ */ new Map();
|
|
48
|
+
for (const [version, schemaPath] of schemaPaths) {
|
|
49
|
+
const outputPath = resolve(outputDir, `admin-${version}.d.ts`);
|
|
50
|
+
outputPaths.set(version, outputPath);
|
|
51
|
+
generates[outputPath] = {
|
|
52
|
+
preset,
|
|
53
|
+
schema: schemaPath,
|
|
54
|
+
documents: [
|
|
55
|
+
resolve(rootDir, "server/**/*.{ts,tsx,js,jsx}"),
|
|
56
|
+
resolve(rootDir, "app/**/*.{ts,tsx,js,jsx}")
|
|
57
|
+
],
|
|
58
|
+
presetConfig: {
|
|
59
|
+
skipTypenameInOperations: true
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
logger.start(`Generating types for ${schemaPaths.size} API version(s)...`);
|
|
64
|
+
try {
|
|
65
|
+
await codegen.generate(
|
|
66
|
+
{
|
|
67
|
+
overwrite: true,
|
|
68
|
+
pluckConfig,
|
|
69
|
+
ignoreNoDocuments: true,
|
|
70
|
+
generates
|
|
71
|
+
},
|
|
72
|
+
true
|
|
73
|
+
);
|
|
74
|
+
logger.success(`Types generated in ${outputDir}`);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
logger.error("Code generation failed:", error);
|
|
77
|
+
return /* @__PURE__ */ new Map();
|
|
78
|
+
}
|
|
79
|
+
for (const [version] of outputPaths) {
|
|
80
|
+
const indexDir = resolve(outputDir, version);
|
|
81
|
+
if (!existsSync(indexDir)) await mkdir(indexDir, { recursive: true });
|
|
82
|
+
await writeFile(
|
|
83
|
+
resolve(indexDir, "admin.d.ts"),
|
|
84
|
+
`export * from '../admin-${version}'
|
|
85
|
+
`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
return outputPaths;
|
|
89
|
+
}
|
|
90
|
+
async function runCodegen(options) {
|
|
91
|
+
const { versions, rootDir, logger } = options;
|
|
92
|
+
const domain = process.env.SHOPIFY_CODEGEN_STORE_DOMAIN || process.env.SHOPIFY_STORE_DOMAIN;
|
|
93
|
+
const token = process.env.SHOPIFY_CODEGEN_ADMIN_ACCESS_TOKEN || process.env.SHOPIFY_ADMIN_ACCESS_TOKEN;
|
|
94
|
+
if (!domain || !token) {
|
|
95
|
+
logger.warn(
|
|
96
|
+
"Codegen requires store credentials. Set one of these env var pairs:\n SHOPIFY_CODEGEN_STORE_DOMAIN + SHOPIFY_CODEGEN_ADMIN_ACCESS_TOKEN\n SHOPIFY_STORE_DOMAIN + SHOPIFY_ADMIN_ACCESS_TOKEN\nSkipping."
|
|
97
|
+
);
|
|
98
|
+
return /* @__PURE__ */ new Map();
|
|
99
|
+
}
|
|
100
|
+
const cacheDir = resolve(rootDir, ".nuxt/shopify-schema");
|
|
101
|
+
const outputDir = resolve(rootDir, ".nuxt/types/shopify");
|
|
102
|
+
if (!existsSync(cacheDir)) await mkdir(cacheDir, { recursive: true });
|
|
103
|
+
const schemaPaths = /* @__PURE__ */ new Map();
|
|
104
|
+
for (const version of versions) {
|
|
105
|
+
try {
|
|
106
|
+
const schemaPath = await fetchSchema(
|
|
107
|
+
version,
|
|
108
|
+
domain,
|
|
109
|
+
token,
|
|
110
|
+
cacheDir,
|
|
111
|
+
logger
|
|
112
|
+
);
|
|
113
|
+
schemaPaths.set(version, schemaPath);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
logger.error(`Failed to fetch schema for ${version}:`, error);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (schemaPaths.size === 0) {
|
|
119
|
+
logger.warn("No schemas fetched. Skipping codegen.");
|
|
120
|
+
return /* @__PURE__ */ new Map();
|
|
121
|
+
}
|
|
122
|
+
return generate(schemaPaths, rootDir, outputDir, logger);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { runCodegen };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
|
+
import { ModuleOptions } from '../dist/runtime/types.js';
|
|
3
|
+
export { ModuleOptions, PolarisIcon } 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,199 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, useLogger, extendViteConfig, addServerImportsDir, addImportsDir, addPlugin, addServerHandler, addRouteMiddleware, extendPages, addNitroPlugin, useNitro } from '@nuxt/kit';
|
|
2
|
+
import { AppDistribution } from '../dist/runtime/types.js';
|
|
3
|
+
import { ApiVersion } from '@shopify/shopify-api';
|
|
4
|
+
import { APP_BRIDGE_URL, POLARIS_URL } from '../dist/runtime/shared/polaris.js';
|
|
5
|
+
|
|
6
|
+
const module$1 = defineNuxtModule({
|
|
7
|
+
meta: {
|
|
8
|
+
name: "@yan-ad/nuxt-shopify",
|
|
9
|
+
configKey: "shopify",
|
|
10
|
+
compatibility: {
|
|
11
|
+
nuxt: "^4.6.4"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaults: {
|
|
15
|
+
apiKey: "",
|
|
16
|
+
apiSecretKey: "",
|
|
17
|
+
appUrl: "",
|
|
18
|
+
allowedHosts: [".trycloudflare.com"],
|
|
19
|
+
apiVersion: ApiVersion.January26,
|
|
20
|
+
authPathPrefix: "/_shopify/auth",
|
|
21
|
+
distribution: AppDistribution.AppStore,
|
|
22
|
+
useOnlineTokens: false,
|
|
23
|
+
componentPrefix: "Sh",
|
|
24
|
+
redirectCookie: "sh-redirect-to"
|
|
25
|
+
},
|
|
26
|
+
onInstall() {
|
|
27
|
+
console.log("\u{1F6CD}\uFE0F Shopify App Module installed!");
|
|
28
|
+
},
|
|
29
|
+
onUpgrade() {
|
|
30
|
+
console.log(
|
|
31
|
+
`\u{1F6CD}\uFE0F Shopify App Module upgraded! Please always read the docs https://github.com/yan-ad/nuxt-shopify`
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
setup(options, nuxt) {
|
|
35
|
+
const { resolve } = createResolver(import.meta.url);
|
|
36
|
+
const logger = useLogger("@yan-ad/nuxt-shopify:module");
|
|
37
|
+
nuxt.options.runtimeConfig.shopify = {
|
|
38
|
+
apiKey: options.apiKey,
|
|
39
|
+
apiSecretKey: options.apiSecretKey,
|
|
40
|
+
scopes: options.scopes || [],
|
|
41
|
+
appUrl: options.appUrl,
|
|
42
|
+
apiVersion: options.apiVersion || ApiVersion.January26,
|
|
43
|
+
authPathPrefix: options.authPathPrefix || "/_shopify/auth",
|
|
44
|
+
distribution: options.distribution || AppDistribution.AppStore,
|
|
45
|
+
useOnlineTokens: options.useOnlineTokens || false
|
|
46
|
+
};
|
|
47
|
+
nuxt.options.runtimeConfig.public.shopify = {
|
|
48
|
+
apiKey: options.apiKey,
|
|
49
|
+
authPagePath: options.authPage !== false ? "/auth" : "",
|
|
50
|
+
authPathPrefix: options.authPathPrefix || "/_shopify/auth",
|
|
51
|
+
redirectCookie: options.redirectCookie || "sh-redirect-to",
|
|
52
|
+
navLinks: options.navLinks || []
|
|
53
|
+
};
|
|
54
|
+
if (nuxt.options.dev) {
|
|
55
|
+
if (nuxt.options.devtools !== false) {
|
|
56
|
+
nuxt.options.devtools = {
|
|
57
|
+
...typeof nuxt.options.devtools === "object" ? nuxt.options.devtools : {},
|
|
58
|
+
enabled: typeof nuxt.options.devtools === "object" ? nuxt.options.devtools.enabled ?? true : true,
|
|
59
|
+
disableAuthorization: true
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
extendViteConfig((config) => {
|
|
63
|
+
config.server = config.server || {};
|
|
64
|
+
const existingHosts = config.server.allowedHosts;
|
|
65
|
+
const configuredHosts = options.allowedHosts;
|
|
66
|
+
if (existingHosts === true || configuredHosts === true) {
|
|
67
|
+
config.server.allowedHosts = true;
|
|
68
|
+
} else {
|
|
69
|
+
config.server.allowedHosts = [
|
|
70
|
+
...Array.isArray(existingHosts) ? existingHosts : [],
|
|
71
|
+
...configuredHosts || []
|
|
72
|
+
].filter((host, index, hosts) => hosts.indexOf(host) === index);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
nuxt.options.alias["#shopify/server"] = resolve("./runtime/server");
|
|
77
|
+
addServerImportsDir(resolve("./runtime/server/utils"));
|
|
78
|
+
addImportsDir(resolve("./runtime/composables"));
|
|
79
|
+
const componentsDir = resolve("./runtime/components");
|
|
80
|
+
nuxt.hook("components:dirs", (dirs) => {
|
|
81
|
+
dirs.push({
|
|
82
|
+
path: componentsDir,
|
|
83
|
+
prefix: options.componentPrefix,
|
|
84
|
+
pathPrefix: false,
|
|
85
|
+
extensions: ["vue"]
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
nuxt.hook("app:resolve", () => {
|
|
89
|
+
nuxt.options.app.head = nuxt.options.app.head || {};
|
|
90
|
+
nuxt.options.app.head.meta = [...nuxt.options.app.head.meta || []];
|
|
91
|
+
nuxt.options.app.head.script = [
|
|
92
|
+
// 1. Inline script to create the meta tag imperatively — guarantees it exists in the DOM before the CDN script executes.
|
|
93
|
+
{
|
|
94
|
+
key: "shopify-api-key-meta",
|
|
95
|
+
innerHTML: `var m=document.createElement('meta');m.name='shopify-api-key';m.content='${options.apiKey}';document.head.appendChild(m);`,
|
|
96
|
+
tagPosition: "head"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
src: APP_BRIDGE_URL,
|
|
100
|
+
tagPosition: "head"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
src: POLARIS_URL,
|
|
104
|
+
tagPosition: "head"
|
|
105
|
+
},
|
|
106
|
+
...nuxt.options.app.head.script || []
|
|
107
|
+
];
|
|
108
|
+
logger.info("Configuring Vue to recognize Shopify web components...");
|
|
109
|
+
nuxt.options.vue.compilerOptions.isCustomElement = (tag) => {
|
|
110
|
+
return tag.startsWith("s-") || tag.startsWith("ui-");
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
addPlugin({
|
|
114
|
+
src: resolve("./runtime/plugins/app-bridge"),
|
|
115
|
+
mode: "client"
|
|
116
|
+
});
|
|
117
|
+
const authPrefix = options.authPathPrefix || "/_shopify/auth";
|
|
118
|
+
addServerHandler({
|
|
119
|
+
route: authPrefix,
|
|
120
|
+
method: "get",
|
|
121
|
+
handler: resolve("./runtime/server/routes/auth")
|
|
122
|
+
});
|
|
123
|
+
addServerHandler({
|
|
124
|
+
route: `${authPrefix}/callback`,
|
|
125
|
+
method: "get",
|
|
126
|
+
handler: resolve("./runtime/server/routes/auth-callback")
|
|
127
|
+
});
|
|
128
|
+
addServerHandler({
|
|
129
|
+
route: `${authPrefix}/exit-iframe`,
|
|
130
|
+
method: "get",
|
|
131
|
+
handler: resolve("./runtime/server/routes/auth-exit-iframe")
|
|
132
|
+
});
|
|
133
|
+
addServerHandler({
|
|
134
|
+
route: `${authPrefix}/session-token`,
|
|
135
|
+
method: "get",
|
|
136
|
+
handler: resolve("./runtime/server/routes/auth-session-token")
|
|
137
|
+
});
|
|
138
|
+
addRouteMiddleware({
|
|
139
|
+
name: "shopify-auth",
|
|
140
|
+
path: resolve("./runtime/middleware/shopify-auth"),
|
|
141
|
+
global: false
|
|
142
|
+
});
|
|
143
|
+
addRouteMiddleware({
|
|
144
|
+
name: "shopify-guest",
|
|
145
|
+
path: resolve("./runtime/middleware/shopify-guest"),
|
|
146
|
+
global: false
|
|
147
|
+
});
|
|
148
|
+
if (options.authPage !== false) {
|
|
149
|
+
logger.info(
|
|
150
|
+
"Adding default /auth login page for non-embedded apps (can be customized or disabled with the authPage option)..."
|
|
151
|
+
);
|
|
152
|
+
extendPages((pages) => {
|
|
153
|
+
pages.push({
|
|
154
|
+
name: "shopify-auth-login",
|
|
155
|
+
path: "/auth",
|
|
156
|
+
file: options.authPage || resolve("./runtime/pages/auth-login.vue")
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
addNitroPlugin(resolve("./runtime/server/plugins/shopify-defaults"));
|
|
161
|
+
addNitroPlugin(resolve("./runtime/server/plugins/add-response-headers"));
|
|
162
|
+
nuxt.options.build.transpile.push(resolve("./runtime"));
|
|
163
|
+
nuxt.hook("ready", () => {
|
|
164
|
+
const nitro = useNitro();
|
|
165
|
+
nitro.options.externals.inline = nitro.options.externals.inline || [];
|
|
166
|
+
nitro.options.externals.inline.push(
|
|
167
|
+
"@shopify/shopify-api",
|
|
168
|
+
"@shopify/shopify-api/adapters/node",
|
|
169
|
+
"@shopify/shopify-app-session-storage-memory",
|
|
170
|
+
"isbot"
|
|
171
|
+
);
|
|
172
|
+
});
|
|
173
|
+
nuxt.hook("prepare:types", ({ references }) => {
|
|
174
|
+
references.push({
|
|
175
|
+
path: resolve("./runtime/types/index.ts")
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
if (options.codegen) {
|
|
179
|
+
const codegenVersions = Array.isArray(options.codegen) ? options.codegen : [options.apiVersion || ApiVersion.January26];
|
|
180
|
+
logger.info(
|
|
181
|
+
`Codegen enabled for API version(s): ${codegenVersions.join(", ")}`
|
|
182
|
+
);
|
|
183
|
+
for (const version of codegenVersions) {
|
|
184
|
+
const outputPath = `${nuxt.options.buildDir}/types/shopify/${version}`;
|
|
185
|
+
nuxt.options.alias[`#shopify/types/${version}/admin`] = outputPath + "/admin";
|
|
186
|
+
}
|
|
187
|
+
nuxt.hook("prepare:types", async () => {
|
|
188
|
+
const { runCodegen } = await import('./chunks/codegen.mjs');
|
|
189
|
+
await runCodegen({
|
|
190
|
+
versions: codegenVersions,
|
|
191
|
+
rootDir: nuxt.options.rootDir,
|
|
192
|
+
logger
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
export { module$1 as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@shopify/admin-api-client';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@shopify/admin-api-client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from '@shopify/app-bridge-types';
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NavLink } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Override the nav links from module config */
|
|
4
|
+
links?: NavLink[];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
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>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot />
|
|
3
|
+
<ShAppNav v-if="navLinks.length">
|
|
4
|
+
<ShLink
|
|
5
|
+
v-for="link in navLinks"
|
|
6
|
+
:key="link.href"
|
|
7
|
+
:href="link.href"
|
|
8
|
+
:rel="link.rel"
|
|
9
|
+
>
|
|
10
|
+
{{ link.label }}
|
|
11
|
+
</ShLink>
|
|
12
|
+
</ShAppNav>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup>
|
|
16
|
+
import { useRuntimeConfig } from "#app";
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
links: { type: Array, required: false }
|
|
19
|
+
});
|
|
20
|
+
const config = useRuntimeConfig().public.shopify;
|
|
21
|
+
const navLinks = props.links || config.navLinks || [];
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NavLink } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Override the nav links from module config */
|
|
4
|
+
links?: NavLink[];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
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>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -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,26 @@
|
|
|
1
|
+
import type { SizeKeyword } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
initials?: string;
|
|
4
|
+
src?: string;
|
|
5
|
+
size?: SizeKeyword;
|
|
6
|
+
alt?: string;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_11: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_11) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
error: (event: Event) => void;
|
|
14
|
+
load: (event: Event) => void;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onError?: ((event: Event) => any) | undefined;
|
|
17
|
+
onLoad?: ((event: Event) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<s-avatar
|
|
3
|
+
v-bind="polarisAttrs"
|
|
4
|
+
@error="emit('error', $event)"
|
|
5
|
+
@load="emit('load', $event)"
|
|
6
|
+
>
|
|
7
|
+
<slot />
|
|
8
|
+
</s-avatar>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { usePolarisAttrs } from "./utils";
|
|
13
|
+
defineOptions({ inheritAttrs: false });
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
initials: { type: String, required: false },
|
|
16
|
+
src: { type: String, required: false },
|
|
17
|
+
size: { type: String, required: false },
|
|
18
|
+
alt: { type: String, required: false }
|
|
19
|
+
});
|
|
20
|
+
const polarisAttrs = usePolarisAttrs(props);
|
|
21
|
+
const emit = defineEmits(["load", "error"]);
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SizeKeyword } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
initials?: string;
|
|
4
|
+
src?: string;
|
|
5
|
+
size?: SizeKeyword;
|
|
6
|
+
alt?: string;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_11: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_11) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
error: (event: Event) => void;
|
|
14
|
+
load: (event: Event) => void;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onError?: ((event: Event) => any) | undefined;
|
|
17
|
+
onLoad?: ((event: Event) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ColorKeyword, PolarisIcon, SizeKeyword, ToneKeyword } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tone?: Extract<ToneKeyword, 'auto' | 'neutral' | 'info' | 'success' | 'caution' | 'warning' | 'critical'>;
|
|
4
|
+
color: Extract<ColorKeyword, 'base' | 'strong'>;
|
|
5
|
+
icon?: PolarisIcon;
|
|
6
|
+
size?: Extract<SizeKeyword, 'base' | 'large' | 'large-100'>;
|
|
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,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<s-badge v-bind="polarisAttrs">
|
|
3
|
+
<slot />
|
|
4
|
+
</s-badge>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { usePolarisAttrs } from "./utils";
|
|
9
|
+
defineOptions({ inheritAttrs: false });
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
tone: { type: String, required: false },
|
|
12
|
+
color: { type: String, required: true },
|
|
13
|
+
icon: { type: String, required: false },
|
|
14
|
+
size: { type: String, required: false }
|
|
15
|
+
});
|
|
16
|
+
const polarisAttrs = usePolarisAttrs(props);
|
|
17
|
+
</script>
|