Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopware-ag/admin-extension-sdk

Package Overview
Dependencies
Maintainers
8
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopware-ag/admin-extension-sdk - npm Package Compare versions

Comparing version 3.0.9 to 3.0.10

34

es/location/index.d.ts

@@ -7,2 +7,5 @@ export declare const is: (location: string) => boolean;

export declare const stopAutoResizer: () => void;
export declare const updateUrl: (url: URL) => Promise<void | null>;
export declare const startAutoUrlUpdater: () => void;
export declare const stopAutoUrlUpdater: () => void;
export declare const MAIN_HIDDEN = "sw-main-hidden";

@@ -20,1 +23,32 @@ export type locationUpdateHeight = {

};
export type locationUpdateUrl = {
responseType: void;
/**
* The hash of the url
*
* @example
* #/sw/dashboard
*/
hash: string;
/**
* The pathname of the url
*
* @example
* /
*/
pathname: string;
/**
* The searchParams of the url
*
* @example
* [
* ['foo', 'bar'],
* ['baz', 'qux'],
* ]
*/
searchParams: Array<[string, string]>;
/**
* The locationID of the current element
*/
locationId: string | null;
};

@@ -43,3 +43,30 @@ import { send } from '../channel';

};
export const updateUrl = (url) => {
return send('locationUpdateUrl', {
hash: url.hash,
pathname: url.pathname,
searchParams: [...url.searchParams.entries()],
locationId: getLocationId(),
});
};
let urlUpdateInterval = null;
export const startAutoUrlUpdater = () => {
let prevUrl = undefined;
if (urlUpdateInterval) {
clearInterval(urlUpdateInterval);
}
urlUpdateInterval = setInterval(() => {
const currUrl = window.location.href;
if (currUrl !== prevUrl) {
prevUrl = currUrl;
void updateUrl(new URL(currUrl));
}
}, 50);
};
export const stopAutoUrlUpdater = () => {
if (urlUpdateInterval) {
clearInterval(urlUpdateInterval);
}
};
export const MAIN_HIDDEN = 'sw-main-hidden';
//# sourceMappingURL=index.js.map

3

es/messages.types.d.ts

@@ -8,3 +8,3 @@ import type { notificationDispatch } from './notification/index';

import type { cmsRegisterElement } from './ui/cms';
import type { locationUpdateHeight } from './location/index';
import type { locationUpdateHeight, locationUpdateUrl } from './location/index';
import type { menuItemAdd } from './ui/menu';

@@ -45,2 +45,3 @@ import type { settingsItemAdd } from './ui/settings';

locationUpdateHeight: locationUpdateHeight;
locationUpdateUrl: locationUpdateUrl;
menuItemAdd: menuItemAdd;

@@ -47,0 +48,0 @@ settingsItemAdd: settingsItemAdd;

{
"name": "@shopware-ag/admin-extension-sdk",
"license": "MIT",
"version": "3.0.9",
"version": "3.0.10",
"repository": "git://github.com/shopware/admin-extension-sdk.git",

@@ -6,0 +6,0 @@ "description": "The SDK for App iframes to communicate with the Shopware Administration",

@@ -7,2 +7,5 @@ export declare const is: (location: string) => boolean;

export declare const stopAutoResizer: () => void;
export declare const updateUrl: (url: URL) => Promise<void | null>;
export declare const startAutoUrlUpdater: () => void;
export declare const stopAutoUrlUpdater: () => void;
export declare const MAIN_HIDDEN = "sw-main-hidden";

@@ -20,1 +23,32 @@ export type locationUpdateHeight = {

};
export type locationUpdateUrl = {
responseType: void;
/**
* The hash of the url
*
* @example
* #/sw/dashboard
*/
hash: string;
/**
* The pathname of the url
*
* @example
* /
*/
pathname: string;
/**
* The searchParams of the url
*
* @example
* [
* ['foo', 'bar'],
* ['baz', 'qux'],
* ]
*/
searchParams: Array<[string, string]>;
/**
* The locationID of the current element
*/
locationId: string | null;
};

@@ -12,3 +12,3 @@ (function (factory) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.MAIN_HIDDEN = exports.stopAutoResizer = exports.startAutoResizer = exports.updateHeight = exports.isIframe = exports.get = exports.is = void 0;
exports.MAIN_HIDDEN = exports.stopAutoUrlUpdater = exports.startAutoUrlUpdater = exports.updateUrl = exports.stopAutoResizer = exports.startAutoResizer = exports.updateHeight = exports.isIframe = exports.get = exports.is = void 0;
const channel_1 = require("../channel");

@@ -62,4 +62,34 @@ const utils_1 = require("../_internals/utils");

exports.stopAutoResizer = stopAutoResizer;
const updateUrl = (url) => {
return (0, channel_1.send)('locationUpdateUrl', {
hash: url.hash,
pathname: url.pathname,
searchParams: [...url.searchParams.entries()],
locationId: (0, utils_1.getLocationId)(),
});
};
exports.updateUrl = updateUrl;
let urlUpdateInterval = null;
const startAutoUrlUpdater = () => {
let prevUrl = undefined;
if (urlUpdateInterval) {
clearInterval(urlUpdateInterval);
}
urlUpdateInterval = setInterval(() => {
const currUrl = window.location.href;
if (currUrl !== prevUrl) {
prevUrl = currUrl;
void (0, exports.updateUrl)(new URL(currUrl));
}
}, 50);
};
exports.startAutoUrlUpdater = startAutoUrlUpdater;
const stopAutoUrlUpdater = () => {
if (urlUpdateInterval) {
clearInterval(urlUpdateInterval);
}
};
exports.stopAutoUrlUpdater = stopAutoUrlUpdater;
exports.MAIN_HIDDEN = 'sw-main-hidden';
});
//# sourceMappingURL=index.js.map

@@ -8,3 +8,3 @@ import type { notificationDispatch } from './notification/index';

import type { cmsRegisterElement } from './ui/cms';
import type { locationUpdateHeight } from './location/index';
import type { locationUpdateHeight, locationUpdateUrl } from './location/index';
import type { menuItemAdd } from './ui/menu';

@@ -45,2 +45,3 @@ import type { settingsItemAdd } from './ui/settings';

locationUpdateHeight: locationUpdateHeight;
locationUpdateUrl: locationUpdateUrl;
menuItemAdd: menuItemAdd;

@@ -47,0 +48,0 @@ settingsItemAdd: settingsItemAdd;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc