shopify-nuxt 0.0.3 → 0.0.5
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 +69 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -3
- package/dist/runtime/components/ShopifyAppProvider.d.vue.ts +18 -0
- package/dist/runtime/components/ShopifyAppProvider.vue +22 -0
- package/dist/runtime/components/ShopifyAppProvider.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/ShButton.d.vue.ts +1 -1
- package/dist/runtime/components/polaris/ShButton.vue.d.ts +1 -1
- package/dist/runtime/components/polaris/ShColorField.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShColorField.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShDateField.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShDateField.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShDatePicker.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShDatePicker.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShEmailField.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShEmailField.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShModal.d.vue.ts +7 -2
- package/dist/runtime/components/polaris/ShModal.vue +4 -1
- package/dist/runtime/components/polaris/ShModal.vue.d.ts +7 -2
- package/dist/runtime/components/polaris/ShMoneyField.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShMoneyField.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShNumberField.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShNumberField.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShPasswordField.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShPasswordField.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShSearchField.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShSearchField.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShTextArea.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShTextArea.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShTextField.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShTextField.vue.d.ts +4 -4
- package/dist/runtime/components/polaris/ShUrlField.d.vue.ts +4 -4
- package/dist/runtime/components/polaris/ShUrlField.vue.d.ts +4 -4
- package/dist/runtime/server/routes/auth-callback.js +2 -2
- package/dist/runtime/server/utils/authenticate-admin.js +1 -1
- package/dist/runtime/types.d.ts +15 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -99,6 +99,7 @@ Any config passed to `configureShopify()` is merged with the defaults — you on
|
|
|
99
99
|
| `distribution` | `AppDistribution` | `app_store` | App distribution type (`app_store`, `single_merchant`, `shopify_admin`) |
|
|
100
100
|
| `useOnlineTokens` | `boolean` | `false` | Use online (per-user) tokens in addition to offline (per-shop) tokens |
|
|
101
101
|
| `authPage` | `string \| false` | built-in page | Custom auth page component path, or `false` to disable |
|
|
102
|
+
| `navLinks` | `NavLink[]` | `[]` | Navigation links for the app sidebar (used by `<ShopifyAppProvider>`) |
|
|
102
103
|
|
|
103
104
|
## Authenticating admin requests
|
|
104
105
|
|
|
@@ -298,6 +299,46 @@ const { data: products } = await useAsyncData(
|
|
|
298
299
|
|
|
299
300
|
## Using Polaris components
|
|
300
301
|
|
|
302
|
+
### `<ShopifyAppProvider>`
|
|
303
|
+
|
|
304
|
+
Wrap your app pages with `<ShopifyAppProvider>` to automatically render the [App Bridge navigation menu](https://shopify.dev/docs/api/app-home/app-bridge-web-components/app-nav) from your module config:
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
// nuxt.config.ts
|
|
308
|
+
export default defineNuxtConfig({
|
|
309
|
+
modules: ['shopify-nuxt'],
|
|
310
|
+
shopify: {
|
|
311
|
+
// ...
|
|
312
|
+
navLinks: [
|
|
313
|
+
{ label: 'Home', href: '/', rel: 'home' },
|
|
314
|
+
{ label: 'Products', href: '/products' },
|
|
315
|
+
{ label: 'Settings', href: '/settings' }
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
})
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
```vue
|
|
322
|
+
<!-- layouts/default.vue -->
|
|
323
|
+
<template>
|
|
324
|
+
<ShopifyAppProvider>
|
|
325
|
+
<slot />
|
|
326
|
+
</ShopifyAppProvider>
|
|
327
|
+
</template>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
You can also override the links per-component via the `links` prop:
|
|
331
|
+
|
|
332
|
+
```vue
|
|
333
|
+
<ShopifyAppProvider :links="[{ label: 'Home', href: '/', rel: 'home' }]">
|
|
334
|
+
<slot />
|
|
335
|
+
</ShopifyAppProvider>
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Each `NavLink` has: `label` (string), `href` (string), and optionally `rel: 'home'` to set the default landing page.
|
|
339
|
+
|
|
340
|
+
### Polaris web components
|
|
341
|
+
|
|
301
342
|
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, v-model support for form components, and work seamlessly with Vue's reactivity system.
|
|
302
343
|
|
|
303
344
|
```vue
|
|
@@ -350,6 +391,34 @@ Content: `ShText`, `ShHeading`, `ShParagraph`, `ShIcon`, `ShImage`, `ShThumbnail
|
|
|
350
391
|
|
|
351
392
|
Other: `ShModal`, `ShQueryContainer`
|
|
352
393
|
|
|
394
|
+
### Using `ShModal`
|
|
395
|
+
|
|
396
|
+
`ShModal` wraps the [Polaris `<s-modal>`](https://shopify.dev/docs/api/app-home/web-components/overlays/modal) component — it renders **inside** your app's iframe. Open and close it using `commandFor` / `command` attributes:
|
|
397
|
+
|
|
398
|
+
```vue
|
|
399
|
+
<template>
|
|
400
|
+
<ShButton command-for="my-modal" command="--show">Open</ShButton>
|
|
401
|
+
|
|
402
|
+
<ShModal id="my-modal" heading="Confirm action">
|
|
403
|
+
<ShParagraph>Are you sure?</ShParagraph>
|
|
404
|
+
|
|
405
|
+
<ShButton slot="secondary-actions" command-for="my-modal" command="--hide">
|
|
406
|
+
Cancel
|
|
407
|
+
</ShButton>
|
|
408
|
+
<ShButton
|
|
409
|
+
slot="primary-action"
|
|
410
|
+
variant="primary"
|
|
411
|
+
command-for="my-modal"
|
|
412
|
+
command="--hide"
|
|
413
|
+
>
|
|
414
|
+
Confirm
|
|
415
|
+
</ShButton>
|
|
416
|
+
</ShModal>
|
|
417
|
+
</template>
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
> **Note**: `ShModal` is **not** the same as the [App Bridge `<ui-modal>`](https://shopify.dev/docs/api/app-bridge-library/apis/modal) which renders outside the iframe and is controlled via `shopify.modal.show(id)`. If you need the App Bridge modal, use `<ui-modal>` directly.
|
|
421
|
+
|
|
353
422
|
## OAuth routes
|
|
354
423
|
|
|
355
424
|
The module automatically registers these routes:
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -30,7 +30,8 @@ const module$1 = defineNuxtModule({
|
|
|
30
30
|
nuxt.options.runtimeConfig.public.shopify = {
|
|
31
31
|
apiKey: options.apiKey,
|
|
32
32
|
authPagePath: options.authPage !== false ? "/auth" : "",
|
|
33
|
-
authPathPrefix: options.authPathPrefix || "/_shopify/auth"
|
|
33
|
+
authPathPrefix: options.authPathPrefix || "/_shopify/auth",
|
|
34
|
+
navLinks: options.navLinks || []
|
|
34
35
|
};
|
|
35
36
|
nuxt.options.alias["#shopify/server"] = resolver.resolve("./runtime/server");
|
|
36
37
|
addServerImportsDir(resolver.resolve("./runtime/server/utils"));
|
|
@@ -44,7 +45,7 @@ const module$1 = defineNuxtModule({
|
|
|
44
45
|
nuxt.options.app.head.meta = [
|
|
45
46
|
{
|
|
46
47
|
name: "content-security-policy",
|
|
47
|
-
content: "frame-ancestors 'self' *.myshopify.com *.shopify.com"
|
|
48
|
+
content: "frame-ancestors 'self' *.myshopify.com *.shopify.com *.trycloudflare.com"
|
|
48
49
|
},
|
|
49
50
|
...nuxt.options.app.head.meta || []
|
|
50
51
|
];
|
|
@@ -69,7 +70,7 @@ const module$1 = defineNuxtModule({
|
|
|
69
70
|
...nuxt.options.app.head.script || []
|
|
70
71
|
];
|
|
71
72
|
nuxt.options.vue.compilerOptions.isCustomElement = (tag) => {
|
|
72
|
-
return tag.startsWith("s-");
|
|
73
|
+
return tag.startsWith("s-") || tag.startsWith("ui-");
|
|
73
74
|
};
|
|
74
75
|
});
|
|
75
76
|
addTypeTemplate({
|
|
@@ -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
|
+
};
|
|
@@ -22,8 +22,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
22
22
|
blur: (event: FocusEvent) => void;
|
|
23
23
|
focus: (event: FocusEvent) => void;
|
|
24
24
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
-
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
26
25
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
26
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
27
27
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
28
28
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
29
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -22,8 +22,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
22
22
|
blur: (event: FocusEvent) => void;
|
|
23
23
|
focus: (event: FocusEvent) => void;
|
|
24
24
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
-
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
26
25
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
26
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
27
27
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
28
28
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
29
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -20,15 +20,15 @@ type __VLS_Slots = {} & {
|
|
|
20
20
|
};
|
|
21
21
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
22
|
"update:modelValue": (v: string) => void;
|
|
23
|
-
blur: (event: InputEvent) => void;
|
|
24
|
-
focus: (event: InputEvent) => void;
|
|
25
23
|
input: (event: InputEvent) => void;
|
|
24
|
+
blur: (event: InputEvent) => void;
|
|
26
25
|
change: (event: InputEvent) => void;
|
|
26
|
+
focus: (event: InputEvent) => void;
|
|
27
27
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
29
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
30
28
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
29
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
31
30
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
31
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
32
32
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
33
33
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
34
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -20,15 +20,15 @@ type __VLS_Slots = {} & {
|
|
|
20
20
|
};
|
|
21
21
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
22
|
"update:modelValue": (v: string) => void;
|
|
23
|
-
blur: (event: InputEvent) => void;
|
|
24
|
-
focus: (event: InputEvent) => void;
|
|
25
23
|
input: (event: InputEvent) => void;
|
|
24
|
+
blur: (event: InputEvent) => void;
|
|
26
25
|
change: (event: InputEvent) => void;
|
|
26
|
+
focus: (event: InputEvent) => void;
|
|
27
27
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
29
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
30
28
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
29
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
31
30
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
31
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
32
32
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
33
33
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
34
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -25,17 +25,17 @@ type __VLS_Slots = {} & {
|
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
27
|
"update:modelValue": (v: string) => void;
|
|
28
|
-
blur: (event: Event) => void;
|
|
29
|
-
focus: (event: Event) => void;
|
|
30
28
|
input: (event: Event) => void;
|
|
29
|
+
blur: (event: Event) => void;
|
|
31
30
|
change: (event: Event) => void;
|
|
31
|
+
focus: (event: Event) => void;
|
|
32
32
|
invalid: (event: Event) => void;
|
|
33
33
|
viewchange: (event: Event) => void;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
-
onBlur?: ((event: Event) => any) | undefined;
|
|
36
|
-
onFocus?: ((event: Event) => any) | undefined;
|
|
37
35
|
onInput?: ((event: Event) => any) | undefined;
|
|
36
|
+
onBlur?: ((event: Event) => any) | undefined;
|
|
38
37
|
onChange?: ((event: Event) => any) | undefined;
|
|
38
|
+
onFocus?: ((event: Event) => any) | undefined;
|
|
39
39
|
onInvalid?: ((event: Event) => any) | undefined;
|
|
40
40
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
41
41
|
onViewchange?: ((event: Event) => any) | undefined;
|
|
@@ -25,17 +25,17 @@ type __VLS_Slots = {} & {
|
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
27
|
"update:modelValue": (v: string) => void;
|
|
28
|
-
blur: (event: Event) => void;
|
|
29
|
-
focus: (event: Event) => void;
|
|
30
28
|
input: (event: Event) => void;
|
|
29
|
+
blur: (event: Event) => void;
|
|
31
30
|
change: (event: Event) => void;
|
|
31
|
+
focus: (event: Event) => void;
|
|
32
32
|
invalid: (event: Event) => void;
|
|
33
33
|
viewchange: (event: Event) => void;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
-
onBlur?: ((event: Event) => any) | undefined;
|
|
36
|
-
onFocus?: ((event: Event) => any) | undefined;
|
|
37
35
|
onInput?: ((event: Event) => any) | undefined;
|
|
36
|
+
onBlur?: ((event: Event) => any) | undefined;
|
|
38
37
|
onChange?: ((event: Event) => any) | undefined;
|
|
38
|
+
onFocus?: ((event: Event) => any) | undefined;
|
|
39
39
|
onInvalid?: ((event: Event) => any) | undefined;
|
|
40
40
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
41
41
|
onViewchange?: ((event: Event) => any) | undefined;
|
|
@@ -16,16 +16,16 @@ type __VLS_Slots = {} & {
|
|
|
16
16
|
};
|
|
17
17
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
18
|
"update:modelValue": (v: string) => void;
|
|
19
|
-
blur: (event: Event) => void;
|
|
20
|
-
focus: (event: Event) => void;
|
|
21
19
|
input: (event: Event) => void;
|
|
20
|
+
blur: (event: Event) => void;
|
|
22
21
|
change: (event: Event) => void;
|
|
22
|
+
focus: (event: Event) => void;
|
|
23
23
|
viewchange: (event: Event) => void;
|
|
24
24
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
-
onBlur?: ((event: Event) => any) | undefined;
|
|
26
|
-
onFocus?: ((event: Event) => any) | undefined;
|
|
27
25
|
onInput?: ((event: Event) => any) | undefined;
|
|
26
|
+
onBlur?: ((event: Event) => any) | undefined;
|
|
28
27
|
onChange?: ((event: Event) => any) | undefined;
|
|
28
|
+
onFocus?: ((event: Event) => any) | undefined;
|
|
29
29
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
30
30
|
onViewchange?: ((event: Event) => any) | undefined;
|
|
31
31
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -16,16 +16,16 @@ type __VLS_Slots = {} & {
|
|
|
16
16
|
};
|
|
17
17
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
18
|
"update:modelValue": (v: string) => void;
|
|
19
|
-
blur: (event: Event) => void;
|
|
20
|
-
focus: (event: Event) => void;
|
|
21
19
|
input: (event: Event) => void;
|
|
20
|
+
blur: (event: Event) => void;
|
|
22
21
|
change: (event: Event) => void;
|
|
22
|
+
focus: (event: Event) => void;
|
|
23
23
|
viewchange: (event: Event) => void;
|
|
24
24
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
-
onBlur?: ((event: Event) => any) | undefined;
|
|
26
|
-
onFocus?: ((event: Event) => any) | undefined;
|
|
27
25
|
onInput?: ((event: Event) => any) | undefined;
|
|
26
|
+
onBlur?: ((event: Event) => any) | undefined;
|
|
28
27
|
onChange?: ((event: Event) => any) | undefined;
|
|
28
|
+
onFocus?: ((event: Event) => any) | undefined;
|
|
29
29
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
30
30
|
onViewchange?: ((event: Event) => any) | undefined;
|
|
31
31
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
|
|
2
|
+
id: string;
|
|
3
3
|
heading?: string;
|
|
4
|
+
accessibilityLabel?: string;
|
|
4
5
|
padding?: 'base' | 'none';
|
|
5
6
|
size?: 'small' | 'small-100' | 'base' | 'large' | 'large-100';
|
|
6
7
|
};
|
|
7
|
-
declare var __VLS_8: {};
|
|
8
|
+
declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
|
|
8
9
|
type __VLS_Slots = {} & {
|
|
9
10
|
default?: (props: typeof __VLS_8) => any;
|
|
11
|
+
} & {
|
|
12
|
+
'primary-action'?: (props: typeof __VLS_10) => any;
|
|
13
|
+
} & {
|
|
14
|
+
'secondary-actions'?: (props: typeof __VLS_12) => any;
|
|
10
15
|
};
|
|
11
16
|
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
17
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<s-modal v-bind="polarisAttrs">
|
|
3
3
|
<slot />
|
|
4
|
+
<slot name="primary-action" />
|
|
5
|
+
<slot name="secondary-actions" />
|
|
4
6
|
</s-modal>
|
|
5
7
|
</template>
|
|
6
8
|
|
|
@@ -8,8 +10,9 @@
|
|
|
8
10
|
import { usePolarisAttrs } from "./utils";
|
|
9
11
|
defineOptions({ name: "ShModal", inheritAttrs: false });
|
|
10
12
|
const props = defineProps({
|
|
11
|
-
|
|
13
|
+
id: { type: String, required: true },
|
|
12
14
|
heading: { type: String, required: false },
|
|
15
|
+
accessibilityLabel: { type: String, required: false },
|
|
13
16
|
padding: { type: String, required: false },
|
|
14
17
|
size: { type: String, required: false }
|
|
15
18
|
});
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
|
|
2
|
+
id: string;
|
|
3
3
|
heading?: string;
|
|
4
|
+
accessibilityLabel?: string;
|
|
4
5
|
padding?: 'base' | 'none';
|
|
5
6
|
size?: 'small' | 'small-100' | 'base' | 'large' | 'large-100';
|
|
6
7
|
};
|
|
7
|
-
declare var __VLS_8: {};
|
|
8
|
+
declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
|
|
8
9
|
type __VLS_Slots = {} & {
|
|
9
10
|
default?: (props: typeof __VLS_8) => any;
|
|
11
|
+
} & {
|
|
12
|
+
'primary-action'?: (props: typeof __VLS_10) => any;
|
|
13
|
+
} & {
|
|
14
|
+
'secondary-actions'?: (props: typeof __VLS_12) => any;
|
|
10
15
|
};
|
|
11
16
|
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
17
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -25,15 +25,15 @@ type __VLS_Slots = {} & {
|
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
27
|
"update:modelValue": (v: string) => void;
|
|
28
|
-
blur: (event: InputEvent) => void;
|
|
29
|
-
focus: (event: InputEvent) => void;
|
|
30
28
|
input: (event: InputEvent) => void;
|
|
29
|
+
blur: (event: InputEvent) => void;
|
|
31
30
|
change: (event: InputEvent) => void;
|
|
31
|
+
focus: (event: InputEvent) => void;
|
|
32
32
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
34
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
35
33
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
34
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
36
35
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
36
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
37
37
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
38
38
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
39
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -25,15 +25,15 @@ type __VLS_Slots = {} & {
|
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
27
|
"update:modelValue": (v: string) => void;
|
|
28
|
-
blur: (event: InputEvent) => void;
|
|
29
|
-
focus: (event: InputEvent) => void;
|
|
30
28
|
input: (event: InputEvent) => void;
|
|
29
|
+
blur: (event: InputEvent) => void;
|
|
31
30
|
change: (event: InputEvent) => void;
|
|
31
|
+
focus: (event: InputEvent) => void;
|
|
32
32
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
34
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
35
33
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
34
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
36
35
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
36
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
37
37
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
38
38
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
39
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -22,15 +22,15 @@ type __VLS_Slots = {} & {
|
|
|
22
22
|
};
|
|
23
23
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
24
|
"update:modelValue": (v: string) => void;
|
|
25
|
-
blur: (event: InputEvent) => void;
|
|
26
|
-
focus: (event: InputEvent) => void;
|
|
27
25
|
input: (event: InputEvent) => void;
|
|
26
|
+
blur: (event: InputEvent) => void;
|
|
28
27
|
change: (event: InputEvent) => void;
|
|
28
|
+
focus: (event: InputEvent) => void;
|
|
29
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
31
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
32
30
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
31
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
33
32
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
33
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
34
34
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
35
35
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -22,15 +22,15 @@ type __VLS_Slots = {} & {
|
|
|
22
22
|
};
|
|
23
23
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
24
|
"update:modelValue": (v: string) => void;
|
|
25
|
-
blur: (event: InputEvent) => void;
|
|
26
|
-
focus: (event: InputEvent) => void;
|
|
27
25
|
input: (event: InputEvent) => void;
|
|
26
|
+
blur: (event: InputEvent) => void;
|
|
28
27
|
change: (event: InputEvent) => void;
|
|
28
|
+
focus: (event: InputEvent) => void;
|
|
29
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
31
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
32
30
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
31
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
33
32
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
33
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
34
34
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
35
35
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -24,15 +24,15 @@ type __VLS_Slots = {} & {
|
|
|
24
24
|
};
|
|
25
25
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
26
|
"update:modelValue": (v: string) => void;
|
|
27
|
-
blur: (event: InputEvent) => void;
|
|
28
|
-
focus: (event: InputEvent) => void;
|
|
29
27
|
input: (event: InputEvent) => void;
|
|
28
|
+
blur: (event: InputEvent) => void;
|
|
30
29
|
change: (event: InputEvent) => void;
|
|
30
|
+
focus: (event: InputEvent) => void;
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
32
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
33
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
34
32
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
33
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
35
34
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
35
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
36
36
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
37
37
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -24,15 +24,15 @@ type __VLS_Slots = {} & {
|
|
|
24
24
|
};
|
|
25
25
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
26
|
"update:modelValue": (v: string) => void;
|
|
27
|
-
blur: (event: InputEvent) => void;
|
|
28
|
-
focus: (event: InputEvent) => void;
|
|
29
27
|
input: (event: InputEvent) => void;
|
|
28
|
+
blur: (event: InputEvent) => void;
|
|
30
29
|
change: (event: InputEvent) => void;
|
|
30
|
+
focus: (event: InputEvent) => void;
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
32
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
33
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
34
32
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
33
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
35
34
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
35
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
36
36
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
37
37
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"update:modelValue": (v: string) => void;
|
|
24
|
-
blur: (event: InputEvent) => void;
|
|
25
|
-
focus: (event: InputEvent) => void;
|
|
26
24
|
input: (event: InputEvent) => void;
|
|
25
|
+
blur: (event: InputEvent) => void;
|
|
27
26
|
change: (event: InputEvent) => void;
|
|
27
|
+
focus: (event: InputEvent) => void;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
-
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
30
|
-
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
31
29
|
onInput?: ((event: InputEvent) => any) | undefined;
|
|
30
|
+
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
32
31
|
onChange?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
33
33
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -27,7 +27,7 @@ export default defineEventHandler(async (event) => {
|
|
|
27
27
|
try {
|
|
28
28
|
await api.webhooks.register({ session });
|
|
29
29
|
} catch (e) {
|
|
30
|
-
console.
|
|
30
|
+
console.debug("[shopify-nuxt] Failed to register webhooks:", e);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
const shop = session.shop;
|
|
@@ -35,7 +35,7 @@ export default defineEventHandler(async (event) => {
|
|
|
35
35
|
const redirectUrl = `${config.appUrl}?shop=${shop}&host=${host}`;
|
|
36
36
|
return sendRedirect(event, redirectUrl, 302);
|
|
37
37
|
} catch (error) {
|
|
38
|
-
console.
|
|
38
|
+
console.debug("[shopify-nuxt] Auth callback error:", error.message);
|
|
39
39
|
throw createError({
|
|
40
40
|
statusCode: 500,
|
|
41
41
|
statusMessage: "Authentication failed",
|
|
@@ -142,7 +142,7 @@ async function performTokenExchange(api, config, sessionStorage, shop, sessionTo
|
|
|
142
142
|
});
|
|
143
143
|
onlineSession = result.session;
|
|
144
144
|
} catch (error) {
|
|
145
|
-
console.
|
|
145
|
+
console.debug("[shopify-nuxt] Token exchange failed:", {
|
|
146
146
|
shop,
|
|
147
147
|
requestedTokenType: config.useOnlineTokens ? OnlineAccessToken : OfflineAccessToken,
|
|
148
148
|
scopes: api.config.scopes?.toString(),
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -54,6 +54,20 @@ export interface ModuleOptions {
|
|
|
54
54
|
* @default undefined (uses built-in page)
|
|
55
55
|
*/
|
|
56
56
|
authPage?: string | false;
|
|
57
|
+
/**
|
|
58
|
+
* Navigation links for the app sidebar (`<ShAppNav>`).
|
|
59
|
+
* Used by `<ShopifyAppProvider>` to render the App Bridge nav menu.
|
|
60
|
+
* Each link has a `label`, `href`, and optionally `rel: 'home'` for the default landing page.
|
|
61
|
+
*/
|
|
62
|
+
navLinks?: NavLink[];
|
|
63
|
+
}
|
|
64
|
+
export interface NavLink {
|
|
65
|
+
/** The visible label text for the navigation item */
|
|
66
|
+
label: string;
|
|
67
|
+
/** The URL path for the navigation item (e.g., `/products`) */
|
|
68
|
+
href: string;
|
|
69
|
+
/** Set to `'home'` to designate this link as the app's default landing page */
|
|
70
|
+
rel?: 'home';
|
|
57
71
|
}
|
|
58
72
|
export type WebhookConfig = Record<string, WebhookHandler | WebhookHandler[]>;
|
|
59
73
|
export interface AfterAuthOptions {
|
|
@@ -146,6 +160,7 @@ export interface ShopifyPublicConfig {
|
|
|
146
160
|
apiKey: string;
|
|
147
161
|
authPagePath: string;
|
|
148
162
|
authPathPrefix: string;
|
|
163
|
+
navLinks: NavLink[];
|
|
149
164
|
}
|
|
150
165
|
declare module 'nuxt/schema' {
|
|
151
166
|
interface RuntimeConfig {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shopify-nuxt",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Shopify app integration for Nuxt - authentication, webhooks, billing, and App Bridge",
|
|
5
5
|
"repository": "kiriminaja/shopify-nuxt",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/types.d.mts",
|
|
12
|
-
"import": "./dist/module.mjs"
|
|
12
|
+
"import": "./dist/module.mjs",
|
|
13
|
+
"require": "./dist/module.mjs"
|
|
13
14
|
},
|
|
14
15
|
"./test-helpers": {
|
|
15
16
|
"types": "./dist/runtime/server/test-helpers/index.d.ts",
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
"main": "./dist/module.mjs",
|
|
21
|
+
"types": "./dist/types.d.mts",
|
|
20
22
|
"typesVersions": {
|
|
21
23
|
"*": {
|
|
22
24
|
".": [
|