Socket
Socket
Sign inDemoInstall

@xo-union/pagelet

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xo-union/pagelet - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2-alpha.24

53

lib/core/index.js

@@ -131,4 +131,4 @@ module.exports =

// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
get hints() {
return pageletContainer.hints;
get props() {
return pageletContainer.props;
},

@@ -198,3 +198,2 @@

_this.props = props;
_this.hints = {};
_this.mountNode = null;

@@ -220,5 +219,4 @@ _this.willMount = null;

var rootNode = document.body.querySelector("[data-pagelet-container-id=\"".concat(this.id, "\"]"));
var hintsElement = rootNode.querySelector('script[type="application/json+union-pagelet-hints"]');
var pageletScriptElement = rootNode.querySelector('script[type="text/x-union-pagelet-script"]');
var mountNode = rootNode.querySelector('[data-pagelet-role="mount-root"]');
var hints = {};

@@ -231,8 +229,10 @@ if (!mountNode) {

if (hintsElement) {
hints = JSON.parse(hintsElement.innerHTML);
if (pageletScriptElement) {
/* eslint-disable no-new-func */
var source = pageletScriptElement.innerHTML;
var exec = new Function('pageletContainer', "'use strict';".concat(source));
exec.call({}, this.containerContext);
}
this.mountNode = mountNode;
this.hints = hints;
this.wasPrepared = true;

@@ -250,3 +250,8 @@ }

this.willMount = pagelet;
pagelet.load(this.containerContext).then(function () {
this.dispatchEvent(new external__customevent__default.a('will-load', {
detail: {
pagelet: pagelet
}
}));
pagelet.load().then(function () {
/**

@@ -260,5 +265,2 @@ * Cancel mounting if unmount was called or if mount was called consecutively with different pagelets

_this2.currentPagelet = pagelet;
pagelet.initialize({
props: _this2.props
});
pagelet.mount(_this2.containerContext);

@@ -278,6 +280,2 @@ _this2.willMount = null;

if (notCanceled) {
_this2.errorPagelet.initialize({
props: _this2.props
});
_this2.errorPagelet.mount(_this2.containerContext);

@@ -348,8 +346,6 @@ }

var js = _ref$links.js,
css = _ref$links.css,
_ref$hints = _ref.hints,
hints = _ref$hints === void 0 ? {} : _ref$hints;
css = _ref$links.css;
var dependencies = [js.toString()];
if (!hints.includesCSS && css) {
if (css) {
dependencies.push("css-loader!".concat(css));

@@ -392,8 +388,4 @@ }

var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
hints = _ref2.hints;
return loadLinks({
links: this.links,
hints: hints
links: this.links
}).then(function (exports) {

@@ -404,13 +396,2 @@ _this.pageletInstance = exports[_this.jsExportName];

}, {
key: "initialize",
value: function initialize() {
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref3$props = _ref3.props,
props = _ref3$props === void 0 ? {} : _ref3$props;
this.pageletInstance.initialize({
props: props
});
}
}, {
key: "mount",

@@ -417,0 +398,0 @@ value: function mount(params) {

{
"name": "@xo-union/pagelet",
"version": "1.0.1",
"version": "1.0.2-alpha.24+0e2dd3c4",
"main": "lib/core/index.js",

@@ -11,4 +11,4 @@ "scripts": {

"dependencies": {
"@xo-union/dist-url": "^1.1.0",
"@xo-union/util-snippet-generator": "^1.1.0",
"@xo-union/dist-url": "1.1.1-alpha.32+0e2dd3c4",
"@xo-union/util-snippet-generator": "1.1.0",
"customevent": "^1.0.1",

@@ -29,3 +29,3 @@ "event-target-shim": "GeorgeTaveras1231/event-target-shim"

},
"gitHead": "d932da696524cc39dba21c5661bc91b56e88c045"
"gitHead": "0e2dd3c49ca5fc98436cc56950cd44f04c79801f"
}
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