@plentymarkets/shop-core 1.27.1 → 1.27.3

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/dist/module.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { ModuleOptions } from '../dist/runtime/types/module.js';
3
- export { CacheControlMeta, Cookie, CookieGroup, CookieGroupFromNuxtConfig, Events, ExtensionEntry, JsonCookie, LocalizationMessage, Notification, PaymentButtonComponent, PaymentButtonComponentProps, SSRMetrics, ShopCoreConfigInput } from '../dist/runtime/types/index.js';
3
+ export { CacheControlMeta, Cookie, CookieGroup, CookieGroupFromNuxtConfig, Events, ExtensionEntry, JsonCookie, LocalizationMessage, Notification, PaymentButtonComponent, PaymentButtonComponentProps, ReInitializePaymentButtonComponentProps, SSRMetrics, ShopCoreConfigInput } from '../dist/runtime/types/index.js';
4
4
 
5
5
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
6
 
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plentymarkets/shop-core",
3
3
  "configKey": "shopCore",
4
- "version": "1.27.1",
4
+ "version": "1.27.3",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -1,5 +1,8 @@
1
1
  import type { PaymentButtonComponent } from '../types/index.js';
2
2
  export declare const useDynamicPaymentButtons: () => {
3
3
  components: import("vue").Ref<PaymentButtonComponent[], PaymentButtonComponent[]>;
4
+ reInitializeComponents: import("vue").Ref<PaymentButtonComponent[], PaymentButtonComponent[]>;
5
+ createOrderLoading: import("vue").Ref<boolean, boolean>;
4
6
  addComponent: (component: PaymentButtonComponent) => void;
7
+ addReInitializeComponent: (component: PaymentButtonComponent) => void;
5
8
  };
@@ -2,7 +2,9 @@ import { useState } from "nuxt/app";
2
2
  import { toRefs } from "vue";
3
3
  export const useDynamicPaymentButtons = () => {
4
4
  const state = useState("useDynamicPaymentButtons", () => ({
5
- components: []
5
+ components: [],
6
+ reInitializeComponents: [],
7
+ createOrderLoading: false
6
8
  }));
7
9
  const addComponent = (component) => {
8
10
  if (state.value.components.some(
@@ -12,8 +14,17 @@ export const useDynamicPaymentButtons = () => {
12
14
  }
13
15
  state.value.components.push(component);
14
16
  };
17
+ const addReInitializeComponent = (component) => {
18
+ if (state.value.reInitializeComponents.some(
19
+ (stateComponent) => stateComponent.componentName === component.componentName
20
+ )) {
21
+ return;
22
+ }
23
+ state.value.reInitializeComponents.push(component);
24
+ };
15
25
  return {
16
26
  addComponent,
27
+ addReInitializeComponent,
17
28
  ...toRefs(state.value)
18
29
  };
19
30
  };
@@ -1,3 +1,4 @@
1
+ import type { Order } from '@plentymarkets/shop-api';
1
2
  export type CacheControlMeta = {
2
3
  type: 'public' | 'private';
3
4
  maxAge: number;
@@ -15,3 +16,8 @@ export type PaymentButtonComponentProps = {
15
16
  disabled: boolean;
16
17
  paymentKey?: string;
17
18
  };
19
+ export type ReInitializePaymentButtonComponentProps = {
20
+ disabled: boolean;
21
+ order: Order;
22
+ paymentKey?: string;
23
+ };
package/dist/types.d.mts CHANGED
@@ -4,6 +4,6 @@ import type { default as Module } from './module.mjs'
4
4
 
5
5
  export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
6
 
7
- export { type CacheControlMeta, type Cookie, type CookieGroup, type CookieGroupFromNuxtConfig, type Events, type ExtensionEntry, type JsonCookie, type LocalizationMessage, type Notification, type PaymentButtonComponent, type PaymentButtonComponentProps, type SSRMetrics, type ShopCoreConfigInput } from '../dist/runtime/types/index.js'
7
+ export { type CacheControlMeta, type Cookie, type CookieGroup, type CookieGroupFromNuxtConfig, type Events, type ExtensionEntry, type JsonCookie, type LocalizationMessage, type Notification, type PaymentButtonComponent, type PaymentButtonComponentProps, type ReInitializePaymentButtonComponentProps, type SSRMetrics, type ShopCoreConfigInput } from '../dist/runtime/types/index.js'
8
8
 
9
9
  export { default } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plentymarkets/shop-core",
3
- "version": "1.27.1",
3
+ "version": "1.27.3",
4
4
  "description": "Core module for PlentyONE Shop",
5
5
  "repository": {
6
6
  "type": "git",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@noble/hashes": "^2.0.1",
54
- "@plentymarkets/shop-api": "^0.173.0",
54
+ "@plentymarkets/shop-api": "^0.173.1",
55
55
  "@vue-storefront/sdk": "^3.4.1",
56
56
  "cookie-es": "^2.0.0",
57
57
  "knitwork": "^1.3.0",