@murasoftware/next-core
Advanced tools
Comparing version 1.0.30 to 1.0.31
@@ -152,3 +152,3 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
try { | ||
var _temp22 = function _temp22() { | ||
var _temp27 = function _temp27() { | ||
var styleData = Mura$1.recordModuleStyles(item); | ||
@@ -166,3 +166,3 @@ return { | ||
var _temp23 = _catch(function () { | ||
var _temp28 = _catch(function () { | ||
var objectkey = item.object; | ||
@@ -174,6 +174,6 @@ | ||
var _temp19 = function () { | ||
var _temp24 = function () { | ||
if (typeof ComponentRegistry[objectkey] != 'undefined') { | ||
var _temp24 = function _temp24() { | ||
var _temp16 = function () { | ||
var _temp29 = function _temp29() { | ||
var _temp21 = function () { | ||
if (item.object == 'container') { | ||
@@ -188,3 +188,3 @@ if (typeof item.items != 'undefined' && !Array.isArray(item.items)) { | ||
var _temp26 = _forIn(item.items, function (containerIdx) { | ||
var _temp31 = _forIn(item.items, function (containerIdx) { | ||
var containerItem = item.items[containerIdx]; | ||
@@ -197,24 +197,31 @@ containerItem.instanceid = containerItem.instanceid || Mura$1.createUUID(); | ||
if (_temp26 && _temp26.then) return _temp26.then(function () {}); | ||
if (_temp31 && _temp31.then) return _temp31.then(function () {}); | ||
} | ||
}(); | ||
if (_temp16 && _temp16.then) return _temp16.then(function () {}); | ||
if (_temp21 && _temp21.then) return _temp21.then(function () {}); | ||
}; | ||
var _temp25 = function () { | ||
var _temp30 = function () { | ||
if (ComponentRegistry[objectkey].SSR) { | ||
return Promise.resolve(ComponentRegistry[objectkey].getDynamicProps(_extends({}, item, { | ||
content: content | ||
}))).then(function (_ComponentRegistry$ob) { | ||
item.dynamicProps = _ComponentRegistry$ob; | ||
var _temp32 = _catch(function () { | ||
return Promise.resolve(ComponentRegistry[objectkey].getDynamicProps(_extends({}, item, { | ||
content: content | ||
}))).then(function (_ComponentRegistry$ob) { | ||
item.dynamicProps = _ComponentRegistry$ob; | ||
}); | ||
}, function (e) { | ||
console.log('Error getting dynamicProps', e); | ||
item.dynamicProps = {}; | ||
}); | ||
if (_temp32 && _temp32.then) return _temp32.then(function () {}); | ||
} | ||
}(); | ||
return _temp25 && _temp25.then ? _temp25.then(_temp24) : _temp24(_temp25); | ||
return _temp30 && _temp30.then ? _temp30.then(_temp29) : _temp29(_temp30); | ||
} | ||
}(); | ||
if (_temp19 && _temp19.then) return _temp19.then(function () {}); | ||
if (_temp24 && _temp24.then) return _temp24.then(function () {}); | ||
}, function (e) { | ||
@@ -224,3 +231,3 @@ console.log(e); | ||
return Promise.resolve(_temp23 && _temp23.then ? _temp23.then(_temp22) : _temp22(_temp23)); | ||
return Promise.resolve(_temp28 && _temp28.then ? _temp28.then(_temp27) : _temp27(_temp28)); | ||
} catch (e) { | ||
@@ -238,5 +245,5 @@ return Promise.reject(e); | ||
var _temp13 = _forIn(regions, function (regionIdx) { | ||
function _temp11() { | ||
var _temp9 = _forIn(region.local.items, function (itemIdx) { | ||
var _temp17 = _forIn(regions, function (regionIdx) { | ||
function _temp15() { | ||
var _temp13 = _forIn(region.local.items, function (itemIdx) { | ||
var item = region.local.items[itemIdx]; | ||
@@ -249,3 +256,3 @@ item.instanceid = item.instanceid || Mura$1.createUUID(); | ||
if (_temp9 && _temp9.then) return _temp9.then(function () {}); | ||
if (_temp13 && _temp13.then) return _temp13.then(function () {}); | ||
} | ||
@@ -255,5 +262,5 @@ | ||
var _temp10 = function () { | ||
var _temp14 = function () { | ||
if (typeof region.inherited != 'undefined' && Array.isArray(region.inherited.items)) { | ||
var _temp14 = _forIn(region.inherited.items, function (itemdIx) { | ||
var _temp18 = _forIn(region.inherited.items, function (itemdIx) { | ||
var item = region.inherited.items[itemdIx]; | ||
@@ -266,10 +273,10 @@ item.instanceid = item.instanceid || Mura$1.createUUID(); | ||
if (_temp14 && _temp14.then) return _temp14.then(function () {}); | ||
if (_temp18 && _temp18.then) return _temp18.then(function () {}); | ||
} | ||
}(); | ||
return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10); | ||
return _temp14 && _temp14.then ? _temp14.then(_temp15) : _temp15(_temp14); | ||
}); | ||
return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () { | ||
return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () { | ||
return moduleStyleData; | ||
@@ -338,3 +345,3 @@ }) : moduleStyleData); | ||
return Promise.resolve(rendered); | ||
}, function (rendered) { | ||
}, function (error) { | ||
try { | ||
@@ -545,11 +552,15 @@ if (!rendered) { | ||
try { | ||
getMura(context); | ||
Mura$1.renderMode = 'dynamic'; | ||
var _content; | ||
if (!isEditMode) { | ||
Mura$1.renderMode = 'static'; | ||
} | ||
var _temp10 = function _temp10() { | ||
if (content.filename == '404') { | ||
console.log('404 rendering content', context); | ||
return Promise.resolve(renderContent(context, isEditMode, params)).then(function (muraObject) { | ||
var content = muraObject.getAll(); | ||
if (typeof context.res != 'undefined') { | ||
context.res.statusCode = 404; | ||
} | ||
} else if (typeof content.statusCode != 'undefined' && typeof context.res != 'undefined') { | ||
context.res.statusCode = content.statusCode; | ||
} | ||
return Promise.resolve(getRegionProps(content, isEditMode)).then(function (moduleStyleData) { | ||
@@ -609,3 +620,49 @@ function _temp7() { | ||
}); | ||
}; | ||
getMura(context); | ||
Mura$1.renderMode = 'dynamic'; | ||
if (!isEditMode) { | ||
Mura$1.renderMode = 'static'; | ||
} | ||
var content = (_content = { | ||
title: "We're sorry, an error occurred", | ||
menutitle: "We're sorry, an error occurred", | ||
body: "", | ||
contentid: Mura$1.createUUID(), | ||
isnew: 1, | ||
siteid: Mura$1.siteid, | ||
type: 'Page', | ||
subtype: 'Default' | ||
}, _content["contentid"] = Mura$1.createUUID(), _content.contenthistid = Mura$1.createUUID(), _content.filename = "500", _content.statusCode = 500, _content.errors = [], _content.displayregions = { | ||
primarycontent: { | ||
local: { | ||
items: [] | ||
} | ||
} | ||
}, _content); | ||
var _temp11 = _catch(function () { | ||
return Promise.resolve(renderContent(context, isEditMode, params)).then(function (muraObject) { | ||
if (typeof muraObject != 'undefined' && typeof muraObject.getAll != 'undefined') { | ||
content = muraObject.getAll(); | ||
} else { | ||
console.log('Error rendering content', muraObject); | ||
if (typeof context.res != 'undefined') { | ||
if (typeof muraObject != 'undefined' && typeof muraObject.statuscode != 'undefined') { | ||
context.res.statusCode = muraObject.statuscode; | ||
} else { | ||
context.res.statusCode = 500; | ||
} | ||
} | ||
} | ||
}); | ||
}, function (e) { | ||
console.log(e); | ||
}); | ||
return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(_temp10) : _temp10(_temp11)); | ||
} catch (e) { | ||
@@ -612,0 +669,0 @@ return Promise.reject(e); |
@@ -149,3 +149,3 @@ import React, { useEffect, createContext } from 'react'; | ||
try { | ||
var _temp22 = function _temp22() { | ||
var _temp27 = function _temp27() { | ||
var styleData = Mura$1.recordModuleStyles(item); | ||
@@ -163,3 +163,3 @@ return { | ||
var _temp23 = _catch(function () { | ||
var _temp28 = _catch(function () { | ||
var objectkey = item.object; | ||
@@ -171,6 +171,6 @@ | ||
var _temp19 = function () { | ||
var _temp24 = function () { | ||
if (typeof ComponentRegistry[objectkey] != 'undefined') { | ||
var _temp24 = function _temp24() { | ||
var _temp16 = function () { | ||
var _temp29 = function _temp29() { | ||
var _temp21 = function () { | ||
if (item.object == 'container') { | ||
@@ -185,3 +185,3 @@ if (typeof item.items != 'undefined' && !Array.isArray(item.items)) { | ||
var _temp26 = _forIn(item.items, function (containerIdx) { | ||
var _temp31 = _forIn(item.items, function (containerIdx) { | ||
var containerItem = item.items[containerIdx]; | ||
@@ -194,24 +194,31 @@ containerItem.instanceid = containerItem.instanceid || Mura$1.createUUID(); | ||
if (_temp26 && _temp26.then) return _temp26.then(function () {}); | ||
if (_temp31 && _temp31.then) return _temp31.then(function () {}); | ||
} | ||
}(); | ||
if (_temp16 && _temp16.then) return _temp16.then(function () {}); | ||
if (_temp21 && _temp21.then) return _temp21.then(function () {}); | ||
}; | ||
var _temp25 = function () { | ||
var _temp30 = function () { | ||
if (ComponentRegistry[objectkey].SSR) { | ||
return Promise.resolve(ComponentRegistry[objectkey].getDynamicProps(_extends({}, item, { | ||
content: content | ||
}))).then(function (_ComponentRegistry$ob) { | ||
item.dynamicProps = _ComponentRegistry$ob; | ||
var _temp32 = _catch(function () { | ||
return Promise.resolve(ComponentRegistry[objectkey].getDynamicProps(_extends({}, item, { | ||
content: content | ||
}))).then(function (_ComponentRegistry$ob) { | ||
item.dynamicProps = _ComponentRegistry$ob; | ||
}); | ||
}, function (e) { | ||
console.log('Error getting dynamicProps', e); | ||
item.dynamicProps = {}; | ||
}); | ||
if (_temp32 && _temp32.then) return _temp32.then(function () {}); | ||
} | ||
}(); | ||
return _temp25 && _temp25.then ? _temp25.then(_temp24) : _temp24(_temp25); | ||
return _temp30 && _temp30.then ? _temp30.then(_temp29) : _temp29(_temp30); | ||
} | ||
}(); | ||
if (_temp19 && _temp19.then) return _temp19.then(function () {}); | ||
if (_temp24 && _temp24.then) return _temp24.then(function () {}); | ||
}, function (e) { | ||
@@ -221,3 +228,3 @@ console.log(e); | ||
return Promise.resolve(_temp23 && _temp23.then ? _temp23.then(_temp22) : _temp22(_temp23)); | ||
return Promise.resolve(_temp28 && _temp28.then ? _temp28.then(_temp27) : _temp27(_temp28)); | ||
} catch (e) { | ||
@@ -235,5 +242,5 @@ return Promise.reject(e); | ||
var _temp13 = _forIn(regions, function (regionIdx) { | ||
function _temp11() { | ||
var _temp9 = _forIn(region.local.items, function (itemIdx) { | ||
var _temp17 = _forIn(regions, function (regionIdx) { | ||
function _temp15() { | ||
var _temp13 = _forIn(region.local.items, function (itemIdx) { | ||
var item = region.local.items[itemIdx]; | ||
@@ -246,3 +253,3 @@ item.instanceid = item.instanceid || Mura$1.createUUID(); | ||
if (_temp9 && _temp9.then) return _temp9.then(function () {}); | ||
if (_temp13 && _temp13.then) return _temp13.then(function () {}); | ||
} | ||
@@ -252,5 +259,5 @@ | ||
var _temp10 = function () { | ||
var _temp14 = function () { | ||
if (typeof region.inherited != 'undefined' && Array.isArray(region.inherited.items)) { | ||
var _temp14 = _forIn(region.inherited.items, function (itemdIx) { | ||
var _temp18 = _forIn(region.inherited.items, function (itemdIx) { | ||
var item = region.inherited.items[itemdIx]; | ||
@@ -263,10 +270,10 @@ item.instanceid = item.instanceid || Mura$1.createUUID(); | ||
if (_temp14 && _temp14.then) return _temp14.then(function () {}); | ||
if (_temp18 && _temp18.then) return _temp18.then(function () {}); | ||
} | ||
}(); | ||
return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10); | ||
return _temp14 && _temp14.then ? _temp14.then(_temp15) : _temp15(_temp14); | ||
}); | ||
return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () { | ||
return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () { | ||
return moduleStyleData; | ||
@@ -335,3 +342,3 @@ }) : moduleStyleData); | ||
return Promise.resolve(rendered); | ||
}, function (rendered) { | ||
}, function (error) { | ||
try { | ||
@@ -542,11 +549,15 @@ if (!rendered) { | ||
try { | ||
getMura(context); | ||
Mura$1.renderMode = 'dynamic'; | ||
var _content; | ||
if (!isEditMode) { | ||
Mura$1.renderMode = 'static'; | ||
} | ||
var _temp10 = function _temp10() { | ||
if (content.filename == '404') { | ||
console.log('404 rendering content', context); | ||
return Promise.resolve(renderContent(context, isEditMode, params)).then(function (muraObject) { | ||
var content = muraObject.getAll(); | ||
if (typeof context.res != 'undefined') { | ||
context.res.statusCode = 404; | ||
} | ||
} else if (typeof content.statusCode != 'undefined' && typeof context.res != 'undefined') { | ||
context.res.statusCode = content.statusCode; | ||
} | ||
return Promise.resolve(getRegionProps(content, isEditMode)).then(function (moduleStyleData) { | ||
@@ -606,3 +617,49 @@ function _temp7() { | ||
}); | ||
}; | ||
getMura(context); | ||
Mura$1.renderMode = 'dynamic'; | ||
if (!isEditMode) { | ||
Mura$1.renderMode = 'static'; | ||
} | ||
var content = (_content = { | ||
title: "We're sorry, an error occurred", | ||
menutitle: "We're sorry, an error occurred", | ||
body: "", | ||
contentid: Mura$1.createUUID(), | ||
isnew: 1, | ||
siteid: Mura$1.siteid, | ||
type: 'Page', | ||
subtype: 'Default' | ||
}, _content["contentid"] = Mura$1.createUUID(), _content.contenthistid = Mura$1.createUUID(), _content.filename = "500", _content.statusCode = 500, _content.errors = [], _content.displayregions = { | ||
primarycontent: { | ||
local: { | ||
items: [] | ||
} | ||
} | ||
}, _content); | ||
var _temp11 = _catch(function () { | ||
return Promise.resolve(renderContent(context, isEditMode, params)).then(function (muraObject) { | ||
if (typeof muraObject != 'undefined' && typeof muraObject.getAll != 'undefined') { | ||
content = muraObject.getAll(); | ||
} else { | ||
console.log('Error rendering content', muraObject); | ||
if (typeof context.res != 'undefined') { | ||
if (typeof muraObject != 'undefined' && typeof muraObject.statuscode != 'undefined') { | ||
context.res.statusCode = muraObject.statuscode; | ||
} else { | ||
context.res.statusCode = 500; | ||
} | ||
} | ||
} | ||
}); | ||
}, function (e) { | ||
console.log(e); | ||
}); | ||
return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(_temp10) : _temp10(_temp11)); | ||
} catch (e) { | ||
@@ -609,0 +666,0 @@ return Promise.reject(e); |
{ | ||
"name": "@murasoftware/next-core", | ||
"version": "1.0.30", | ||
"version": "1.0.31", | ||
"description": "Core utilties for Mura.js and Next.js", | ||
@@ -5,0 +5,0 @@ "author": "Mura Software", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
238590
1881