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

contentful-ui-extensions-sdk

Package Overview
Dependencies
Maintainers
4
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentful-ui-extensions-sdk - npm Package Compare versions

Comparing version 3.12.1 to 3.13.0

70

dist/cf-extension-api.js

@@ -1,39 +0,31 @@

parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"pBGv":[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],"Zt7E":[function(require,module,exports) {
var define;
var global = arguments[3];
var process = require("process");
var t,e=arguments[3],n=require("process");!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof t&&t.amd?t(n):e.ES6Promise=n()}(this,function(){"use strict";function t(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,i=void 0,s=void 0,u=function(t,e){p[o]=t,p[o+1]=e,2===(o+=2)&&(s?s(_):w())};var c="undefined"!=typeof window?window:void 0,a=c||{},f=a.MutationObserver||a.WebKitMutationObserver,l="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function v(){var t=setTimeout;return function(){return t(_,1)}}var p=new Array(1e3);function _(){for(var t=0;t<o;t+=2){(0,p[t])(p[t+1]),p[t]=void 0,p[t+1]=void 0}o=0}var d,y,m,b,w=void 0;function g(t,e){var n=this,r=new this.constructor(S);void 0===r[j]&&K(r);var o=n._state;if(o){var i=arguments[o-1];u(function(){return k(o,r,i,n._result)})}else F(n,r,t,e);return r}function A(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(S);return x(e,t),e}l?w=function(){return n.nextTick(_)}:f?(y=0,m=new f(_),b=document.createTextNode(""),m.observe(b,{characterData:!0}),w=function(){b.data=y=++y%2}):h?((d=new MessageChannel).port1.onmessage=_,w=function(){return d.port2.postMessage(0)}):w=void 0===c&&"function"==typeof require?function(){try{var t=Function("return this")().require("vertx");return void 0!==(i=t.runOnLoop||t.runOnContext)?function(){i(_)}:v()}catch(e){return v()}}():v();var j=Math.random().toString(36).substring(2);function S(){}var E=void 0,T=1,M=2;function P(e,n,r){n.constructor===e.constructor&&r===g&&n.constructor.resolve===A?function(t,e){e._state===T?O(t,e._result):e._state===M?q(t,e._result):F(e,void 0,function(e){return x(t,e)},function(e){return q(t,e)})}(e,n):void 0===r?O(e,n):t(r)?function(t,e,n){u(function(t){var r=!1,o=function(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}(n,e,function(n){r||(r=!0,e!==n?x(t,n):O(t,n))},function(e){r||(r=!0,q(t,e))},t._label);!r&&o&&(r=!0,q(t,o))},t)}(e,n,r):O(e,n)}function x(t,e){if(t===e)q(t,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(r=e),null===r||"object"!==o&&"function"!==o)O(t,e);else{var n=void 0;try{n=e.then}catch(i){return void q(t,i)}P(t,e,n)}var r,o}function C(t){t._onerror&&t._onerror(t._result),Y(t)}function O(t,e){t._state===E&&(t._result=e,t._state=T,0!==t._subscribers.length&&u(Y,t))}function q(t,e){t._state===E&&(t._state=M,t._result=e,u(C,t))}function F(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+T]=n,o[i+M]=r,0===i&&t._state&&u(Y,t)}function Y(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?k(n,r,o,i):o(i);t._subscribers.length=0}}function k(e,n,r,o){var i=t(r),s=void 0,u=void 0,c=!0;if(i){try{s=r(o)}catch(a){c=!1,u=a}if(n===s)return void q(n,new TypeError("A promises callback cannot return that same promise."))}else s=o;n._state!==E||(i&&c?x(n,s):!1===c?q(n,u):e===T?O(n,s):e===M&&q(n,s))}var D=0;function K(t){t[j]=D++,t._state=void 0,t._result=void 0,t._subscribers=[]}var L=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(S),this.promise[j]||K(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&O(this.promise,this._result))):q(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===E&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===A){var o=void 0,i=void 0,s=!1;try{o=t.then}catch(c){s=!0,i=c}if(o===g&&t._state!==E)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===N){var u=new n(S);s?q(u,i):P(u,t,o),this._willSettleAt(u,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===E&&(this._remaining--,t===M?q(r,n):this._result[e]=n),0===this._remaining&&O(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;F(t,void 0,function(t){return n._settledAt(T,e,t)},function(t){return n._settledAt(M,e,t)})},t}();var N=function(){function e(t){this[j]=D++,this._result=this._state=void 0,this._subscribers=[],S!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e(function(e){x(t,e)},function(e){q(t,e)})}catch(n){q(t,n)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this.constructor;return t(e)?this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){throw t})}):this.then(e,e)},e}();return N.prototype.then=g,N.all=function(t){return new L(this,t).promise},N.race=function(t){var e=this;return r(t)?new e(function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})},N.resolve=A,N.reject=function(t){var e=new this(S);return q(e,t),e},N._setScheduler=function(t){s=t},N._setAsap=function(t){u=t},N._asap=u,N.polyfill=function(){var t=void 0;if(void 0!==e)t=e;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(o){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(o){}if("[object Promise]"===r&&!n.cast)return}t.Promise=N},N.Promise=N,N});
},{"process":"pBGv"}],"HrMX":[function(require,module,exports) {
function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t){return o(t)||r(t)||n()}function n(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function r(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function o(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function i(e,n){return!n||"object"!==t(n)&&"function"!=typeof n?u(e):n}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=a(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function a(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function h(t,e,n){return e&&y(t.prototype,e),n&&y(t,n),t}var b=function(){function t(){p(this,t),this._id=0,this._listeners={}}return h(t,[{key:"dispatch",value:function(){for(var t in this._listeners){var e;(e=this._listeners)[t].apply(e,arguments)}}},{key:"attach",value:function(t){var e=this;if("function"!=typeof t)throw new Error("listener function expected");var n=this._id++;return this._listeners[n]=t,function(){return delete e._listeners[n]}}}]),t}(),v="__private__memoized__arguments__",_=function(t){function n(){var t;p(this,n);for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];if(!r.length)throw new Error("Initial value to be memoized expected");return(t=i(this,f(n).call(this)))[v]=r,t}return l(n,b),h(n,[{key:"dispatch",value:function(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];this[v]=r,(t=c(f(n.prototype),"dispatch",this)).call.apply(t,[this].concat(r))}},{key:"attach",value:function(t){var r=c(f(n.prototype),"attach",this).call(this,t);return t.apply(void 0,e(this[v])),r}}]),n}();module.exports={Signal:b,MemoizedSignal:_};
},{}],"sCMk":[function(require,module,exports) {
function e(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function n(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function r(e,r,t){return r&&n(e.prototype,r),t&&n(e,t),e}function t(e){return i(e)||s(e)||a()}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function s(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function i(e){if(Array.isArray(e)){for(var n=0,r=new Array(e.length);n<e.length;n++)r[n]=e[n];return r}}var o=require("es6-promise"),l=o.Promise,u=require("./signal"),c=u.Signal;function d(e,n){e.addEventListener("message",function r(a){var s=a.data;"connect"===s.method&&(e.removeEventListener("message",r),n.apply(void 0,t(s.params)))})}module.exports=function(e,n){d(e,function(r,t){var a=new f(r.id,e);n(a,r,t)})};var f=function(){function n(r,t){var a=this;e(this,n),this._messageHandlers={},this._responseHandlers={},this._send=h(r,t.parent),t.addEventListener("message",function(e){a._handleMessage(e.data)})}return r(n,[{key:"call",value:function(e){for(var n=this,r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];var s=this._send(e,t);return new l(function(e,r){n._responseHandlers[s]={resolve:e,reject:r}})}},{key:"send",value:function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),t=1;t<n;t++)r[t-1]=arguments[t];this._send(e,r)}},{key:"addHandler",value:function(e,n){return e in this._messageHandlers||(this._messageHandlers[e]=new c),this._messageHandlers[e].attach(n)}},{key:"_handleMessage",value:function(e){if(e.method){var n=e.method,r=e.params,a=this._messageHandlers[n];a&&a.dispatch.apply(a,t(r))}else{var s=e.id,i=this._responseHandlers[s];if(!i)return;"result"in e?i.resolve(e.result):"error"in e&&i.reject(e.error),delete this._responseHandlers[s]}}}]),n}();function h(e,n){var r=0;return function(t,a){var s=r++;return n.postMessage({source:e,id:s,method:t,params:a},"*"),s}}
},{"es6-promise":"Zt7E","./signal":"HrMX"}],"Mq5l":[function(require,module,exports) {
var e=require("es6-promise"),n=e.Promise,r=require("./channel");function t(){var e={};return e.promise=new n(function(n){e.resolve=n}),e}module.exports=function(e,n){var o=t(),i=t();return i.promise.then(function(n){var r=e.document;r.addEventListener("focus",function(){return n.send("setActive",!0)},!0),r.addEventListener("blur",function(){return n.send("setActive",!1)},!0)}),r(e,function(r,t,s){i.resolve(r);var u=n(r,t,e);s.forEach(function(e){r._handleMessage(e)}),o.resolve(u)}),function(e){o.promise.then(e)}};
},{"es6-promise":"Zt7E","./channel":"sCMk"}],"GnXy":[function(require,module,exports) {
function e(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function a(e,a){for(var n=0;n<a.length;n++){var i=a[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&a(e.prototype,n),i&&a(e,i),e}var i=require("./signal"),l=i.MemoizedSignal,t=["id","locale","type","required","validations","items"];module.exports=function(){function a(n,i){var r=this;e(this,a),t.forEach(function(e){void 0!==i[e]&&(r[e]=i[e])}),this._value=i.value,this._valueSignal=new l(this._value),this._isDisabledSignal=new l(void 0),this._schemaErrorsChangedSignal=new l(void 0),this._channel=n,n.addHandler("valueChanged",function(e,a,n){e!==r.id||a&&a!==r.locale||(r._value=n,r._valueSignal.dispatch(n))}),n.addHandler("isDisabledChanged",function(e){r._isDisabledSignal.dispatch(e)}),n.addHandler("schemaErrorsChanged",function(e){r._schemaErrorsChangedSignal.dispatch(e)})}return n(a,[{key:"getValue",value:function(){return this._value}},{key:"setValue",value:function(e){return this._value=e,this._valueSignal.dispatch(e),this._channel.call("setValue",this.id,this.locale,e)}},{key:"removeValue",value:function(){return this._value=void 0,this._channel.call("removeValue",this.id,this.locale)}},{key:"setInvalid",value:function(e){return this._channel.call("setInvalid",e,this.locale)}},{key:"onValueChanged",value:function(e){return this._valueSignal.attach(e)}},{key:"onIsDisabledChanged",value:function(e){return this._isDisabledSignal.attach(e)}},{key:"onSchemaErrorsChanged",value:function(e){return this._schemaErrorsChangedSignal.attach(e)}}]),a}();
},{"./signal":"HrMX"}],"daBI":[function(require,module,exports) {
function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach(function(e){n(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}var l=require("./field-locale"),a=["id","locales","type","required","validations","items"];function c(e,t){if(!e._fieldLocales[t])throw new Error('Unknown locale "'.concat(t,'" for field "').concat(e.id,'"'))}module.exports=function(){function e(o,i,u){var f=this;r(this,e),a.forEach(function(e){void 0!==i[e]&&(f[e]=i[e])}),this._defaultLocale=u,this._fieldLocales=i.locales.reduce(function(e,r){return t({},e,n({},r,new l(o,{id:i.id,locale:r,value:i.values[r]})))},{}),c(this,u)}return i(e,[{key:"getValue",value:function(e){return this._getFieldLocale(e).getValue()}},{key:"setValue",value:function(e,t){return this._getFieldLocale(t).setValue(e)}},{key:"removeValue",value:function(e){return this.setValue(void 0,e)}},{key:"onValueChanged",value:function(e,t){return t||(t=e,e=void 0),this._getFieldLocale(e).onValueChanged(t)}},{key:"onIsDisabledChanged",value:function(e,t){return t||(t=e,e=void 0),this._getFieldLocale(e).onIsDisabledChanged(t)}},{key:"_getFieldLocale",value:function(e){return c(this,e=e||this._defaultLocale),this._fieldLocales[e]}}]),e}();
},{"./field-locale":"GnXy"}],"XV20":[function(require,module,exports) {
module.exports=function(e,t){var n=e.document,i=e.MutationObserver,r=function(){c.updateHeight()},u=new i(r),o=null,s=!1,c={startAutoResizer:function(){if(c.updateHeight(),s)return;s=!0,u.observe(n.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e.addEventListener("resize",r)},stopAutoResizer:function(){if(!s)return;s=!1,u.disconnect(),e.removeEventListener("resize",r)},updateHeight:function(e){null==e&&(e=Math.ceil(n.documentElement.getBoundingClientRect().height));e!==o&&(t.send("setHeight",e),o=e)}};return c};
},{}],"BZ3n":[function(require,module,exports) {
var n=require("./signal"),e=n.MemoizedSignal;module.exports=function(n,r,t,i){var u=r.sys,a=new e(u);return n.addHandler("sysChanged",function(n){u=n,a.dispatch(u)}),{getSys:function(){return u},onSysChanged:function(n){return a.attach(n)},fields:t.reduce(function(n,e){return n[e.id]=i(e),n},{})}};
},{"./signal":"HrMX"}],"iabO":[function(require,module,exports) {
function e(e){return r(e)||n(e)||t()}function t(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function n(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function r(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}var s=["getContentType","getEntry","getEntrySnapshots","getAsset","getEditorInterface","getPublishedEntries","getPublishedAssets","getContentTypes","getEntries","getEditorInterfaces","getAssets","createContentType","createEntry","createAsset","updateContentType","updateEntry","updateAsset","deleteContentType","deleteEntry","deleteAsset","publishEntry","publishAsset","unpublishEntry","unpublishAsset","archiveEntry","archiveAsset","unarchiveEntry","unarchiveAsset","createUpload","processAsset","waitUntilAssetProcessed","getUsers","getAllScheduledActions","getEntityScheduledActions"];module.exports=function(t,n){var r={};return s.forEach(function(e){r[e]=function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.call("callSpaceMethod",e,r)}}),r.getCachedContentTypes=function(){return e(n)},r};
},{}],"GEtI":[function(require,module,exports) {
function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(t)}var t=function(t){return"object"===n(t)&&null!==t&&!Array.isArray(t)},e=function(n){return t(n)?n:{}};module.exports=function(n,t){return{openAlert:o.bind(null,"alert"),openConfirm:o.bind(null,"confirm"),openPrompt:o.bind(null,"prompt"),openExtension:function(o){if((o=e(o)).id=o.id||t.extension,o.id)return n.call("openDialog","extension",o);throw new Error("Extension ID not provided.")},openCurrentApp:function(o){if((o=e(o)).id=t.app,o.id)return n.call("openDialog","app",o);throw new Error("Not in the app context.")},selectSingleEntry:r.bind(null,"Entry",!1),selectSingleAsset:r.bind(null,"Asset",!1),selectMultipleEntries:r.bind(null,"Entry",!0),selectMultipleAssets:r.bind(null,"Asset",!0)};function o(t,o){return n.call("openDialog",t,e(o))}function r(t,o,r){return(r=e(r)).entityType=t,r.multiple=o,n.call("openDialog","entitySelector",r)}};
},{}],"fqJo":[function(require,module,exports) {
var e=require("./signal"),n=e.MemoizedSignal;module.exports=function(e,a){var d=new n(void 0),t=new n(void 0);return e.addHandler("localeSettingsChanged",function(e){d.dispatch(e)}),e.addHandler("showDisabledFieldsChanged",function(e){t.dispatch(e)}),{editorInterface:a,onLocaleSettingsChanged:function(e){return d.attach(e)},onShowDisabledFieldsChanged:function(e){return t.attach(e)}}};
},{"./signal":"HrMX"}],"Y2Q9":[function(require,module,exports) {
function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function e(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var r=require("./signal"),i=r.Signal;module.exports=function(t,n){var r=new i;return t.addHandler("navigateSlideIn",function(t){r.dispatch(t)}),{openEntry:function(n,r){return t.call("navigateToContentEntity",e({},r,{entityType:"Entry",id:n}))},openNewEntry:function(n,r){return t.call("navigateToContentEntity",e({},r,{entityType:"Entry",id:null,contentTypeId:n}))},openBulkEditor:function(n,r){return t.call("navigateToBulkEditor",e({entryId:n},r))},openAsset:function(n,r){return t.call("navigateToContentEntity",e({},r,{entityType:"Asset",id:n}))},openNewAsset:function(n){return t.call("navigateToContentEntity",e({},n,{entityType:"Asset",id:null}))},openPageExtension:function(r){return t.call("navigateToPageExtension",e({id:n},r))},onSlideInNavigation:function(t){return r.attach(t)}}};
},{"./signal":"HrMX"}],"A2T1":[function(require,module,exports) {
function t(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var e="preInstall",r="postInstall",o=function(t){return"object"===n(t)&&null!==t&&!Array.isArray(t)},u=function(t){return"function"==typeof t},l=function(t){return o(t)&&u(t.then)},a=function(t,n,e){if(!u(t))return Promise.resolve(n);var r;try{r=void 0===e?t():t(e)}catch(i){return Promise.resolve(!1)}var a=r;return l(a)||(a=Promise.resolve(a)),a.then(function(t){return!(t instanceof Error||!1===t)&&(o(t)?t:n)},function(){return!1}).catch(function(){return!1})};module.exports=function(n){var o,l=(t(o={},e,null),t(o,r,null),o),i=function(t,n){if(!u(n))throw new Error("Handler must be a function.");l[t]=n};return n.addHandler("appHook",function(t){var o=t.stage,u=t.installationRequestId,i=t.err;return o===e?a(l[o],{}).then(function(t){return n.send("appHookResult",{stage:o,installationRequestId:u,result:t})}):o===r?a(l[o],void 0,i||null).then(function(){return n.send("appHookResult",{stage:o,installationRequestId:u})}):Promise.resolve()}),{setReady:function(){return n.call("callAppMethod","setReady")},isInstalled:function(){return n.call("callAppMethod","isInstalled")},getParameters:function(){return n.call("callAppMethod","getParameters")},getCurrentState:function(){return n.call("callAppMethod","getCurrentState")},onConfigure:function(t){i(e,t)},onConfigurationCompleted:function(t){i(r,t)}}};
},{}],"CHnp":[function(require,module,exports) {
module.exports={LOCATION_ENTRY_FIELD:"entry-field",LOCATION_ENTRY_FIELD_SIDEBAR:"entry-field-sidebar",LOCATION_ENTRY_SIDEBAR:"entry-sidebar",LOCATION_DIALOG:"dialog",LOCATION_ENTRY_EDITOR:"entry-editor",LOCATION_PAGE:"page",LOCATION_APP:"app",LOCATION_APP_CONFIG:"app-config"};
},{}],"LVu9":[function(require,module,exports) {
var e;function r(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,t)}return n}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach(function(r){t(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function t(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var o=require("./field"),i=require("./field-locale"),a=require("./window"),c=require("./entry"),u=require("./space"),l=require("./dialogs"),O=require("./editor"),s=require("./navigator"),f=require("./app"),p=require("./locations"),d=[A,P,T,y,b],I=(t(e={},p.LOCATION_ENTRY_FIELD,d),t(e,p.LOCATION_ENTRY_FIELD_SIDEBAR,d),t(e,p.LOCATION_ENTRY_SIDEBAR,[A,P,y,b]),t(e,p.LOCATION_ENTRY_EDITOR,[A,P,y]),t(e,p.LOCATION_DIALOG,[A,_,b]),t(e,p.LOCATION_PAGE,[A]),t(e,p.LOCATION_APP,[A,N]),t(e,p.LOCATION_APP_CONFIG,[A,N]),e);function A(e,r){var n=r.user,t=r.parameters,o=r.locales,i=r.ids,a=r.initialContentTypes;return{location:{is:function(e){var n=r.location||p.LOCATION_ENTRY_FIELD;return n===p.LOCATION_APP&&(n=p.LOCATION_APP_CONFIG),e===p.LOCATION_APP&&(e=p.LOCATION_APP_CONFIG),n===e}},user:n,parameters:t,locales:{available:o.available,default:o.default,names:o.names,fallbacks:o.fallbacks,optional:o.optional,direction:o.direction},space:u(e,a),dialogs:l(e,i),navigator:s(e,i.extension),notifier:{success:function(r){return e.send("notify",{type:"success",message:r})},error:function(r){return e.send("notify",{type:"error",message:r})}},ids:i}}function b(e,r,n){return{window:a(n,e)}}function y(e,r){var n=r.editorInterface;return{editor:O(e,n)}}function P(e,r){var n=r.locales,t=r.contentType,i=r.entry,a=r.fieldInfo;return{contentType:t,entry:c(e,i,a,function(r){return new o(e,r,n.default)})}}function T(e,r){var n=r.field;return{field:new i(e,n)}}function _(e){return{close:function(r){return e.send("closeDialog",r)}}}function N(e){var r=f(e);return{app:r,platformAlpha:{app:r}}}module.exports=function(e,r,t){return(I[r.location]||d).reduce(function(o,i){return n({},o,{},i(e,r,t))},{})};
},{"./field":"daBI","./field-locale":"GnXy","./window":"XV20","./entry":"BZ3n","./space":"iabO","./dialogs":"GEtI","./editor":"fqJo","./navigator":"Y2Q9","./app":"A2T1","./locations":"CHnp"}],"Focm":[function(require,module,exports) {
var i=require("./initialize"),e=require("./api"),r=require("./locations");module.exports={init:i(window,e),locations:r};
},{"./initialize":"Mq5l","./api":"LVu9","./locations":"CHnp"}]},{},["Focm"], "contentfulExtension")
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"Wswr":[function(require,module,exports) {
"use strict";var t,e=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0});var r=function(){function t(){this._id=0,this._listeners={}}return t.prototype.dispatch=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var n in this._listeners)(t=this._listeners)[n].apply(t,e)},t.prototype.attach=function(t){var e=this;if("function"!=typeof t)throw new Error("listener function expected");var r=this._id++;return this._listeners[r]=t,function(){return delete e._listeners[r]}},t}();exports.Signal=r;var n="__private__memoized__arguments__",o=function(r){function o(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var i=r.call(this)||this;if(i[t]=[],!e.length)throw new Error("Initial value to be memoized expected");return i[n]=e,i}return e(o,r),o.prototype.dispatch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this[n]=t,r.prototype.dispatch.apply(this,t)},o.prototype.attach=function(t){var e=r.prototype.attach.call(this,t);return t.apply(void 0,this[n]),e},o}(r);exports.MemoizedSignal=o,t=n;
},{}],"rwmg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./signal");function s(e,s){n(e,function(n,t){var a=new r(n.id,e);s(a,n,t)})}function n(e,s){e.addEventListener("message",function n(r){var t=r.data;"connect"===t.method&&(e.removeEventListener("message",n),s.apply(void 0,t.params))})}exports.default=s;var r=function(){function s(e,s){var n=this;this._messageHandlers={},this._responseHandlers={},this._send=t(e,s.parent),s.addEventListener("message",function(e){n._handleMessage(e.data)})}return s.prototype.call=function(e){for(var s=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var t=this._send(e,n);return new Promise(function(e,n){s._responseHandlers[t]={resolve:e,reject:n}})},s.prototype.send=function(e){for(var s=[],n=1;n<arguments.length;n++)s[n-1]=arguments[n];this._send(e,s)},s.prototype.addHandler=function(s,n){return s in this._messageHandlers||(this._messageHandlers[s]=new e.Signal),this._messageHandlers[s].attach(n)},s.prototype._handleMessage=function(e){if(e.method){var s=e.method,n=e.params,r=this._messageHandlers[s];r&&r.dispatch.apply(r,n)}else{var t=e.id,a=this._responseHandlers[t];if(!a)return;"result"in e?a.resolve(e.result):"error"in e&&a.reject(e.error),delete this._responseHandlers[t]}},s}();function t(e,s){var n=0;return function(r,t){var a=n++;return s.postMessage({source:e,id:a,method:r,params:t},"*"),a}}
},{"./signal":"Wswr"}],"uzbA":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("./channel"));function t(e,t){var o=r();return o.promise.then(function(n){var t=n[0],r=e.document;r.addEventListener("focus",function(){return t.send("setActive",!0)},!0),r.addEventListener("blur",function(){return t.send("setActive",!1)},!0)}),n.default(e,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o.resolve(e)}),function(n,r){var u=(void 0===r?{}:r).makeCustomApi,i=void 0===u?null:u;o.promise.then(function(r){var o,u=r[0],s=r[1],f=r[2],a=t(u,s,e);"function"==typeof i&&(o=i(u,s)),f.forEach(function(e){u._handleMessage(e)}),n(a,o)})}}function r(){var e={promise:null,resolve:null};return e.promise=new Promise(function(n){e.resolve=n}),e}exports.default=t;
},{"./channel":"rwmg"}],"QmLY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./signal"),a=["id","locale","type","required","validations","items"],i=function(){function i(i,t){var n=this;a.forEach(function(e){void 0!==t[e]&&(n[e]=t[e])}),this._value=t.value,this._valueSignal=new e.MemoizedSignal(this._value),this._isDisabledSignal=new e.MemoizedSignal(void 0),this._schemaErrorsChangedSignal=new e.MemoizedSignal(void 0),this._channel=i,i.addHandler("valueChanged",function(e,a,i){e!==n.id||a&&a!==n.locale||(n._value=i,n._valueSignal.dispatch(i))}),i.addHandler("isDisabledChangedForFieldLocale",function(e,a,i){e===n.id&&a===n.locale&&n._isDisabledSignal.dispatch(i)}),i.addHandler("schemaErrorsChanged",function(e){n._schemaErrorsChangedSignal.dispatch(e)})}return i.prototype.getValue=function(){return this._value},i.prototype.setValue=function(e){return this._value=e,this._valueSignal.dispatch(e),this._channel.call("setValue",this.id,this.locale,e)},i.prototype.removeValue=function(){return this._value=void 0,this._channel.call("removeValue",this.id,this.locale)},i.prototype.setInvalid=function(e){return this._channel.call("setInvalid",e,this.locale)},i.prototype.onValueChanged=function(e){return this._valueSignal.attach(e)},i.prototype.onIsDisabledChanged=function(e){return this._isDisabledSignal.attach(e)},i.prototype.onSchemaErrorsChanged=function(e){return this._schemaErrorsChangedSignal.attach(e)},i}();exports.default=i;
},{"./signal":"Wswr"}],"RMZU":[function(require,module,exports) {
"use strict";var e=this&&this.__assign||function(){return(e=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var o=t(require("./field-locale")),i=["id","locales","type","required","validations","items"],n=function(){function t(t,n,l){var a=this;i.forEach(function(e){void 0!==n[e]&&(a[e]=n[e])}),this._defaultLocale=l,this._fieldLocales=n.locales.reduce(function(i,r){var l,a=new o.default(t,{id:n.id,locale:r,value:n.values[r]});return e(e({},i),((l={})[r]=a,l))},{}),r(this,l)}return t.prototype.getValue=function(e){return this._getFieldLocale(e).getValue()},t.prototype.setValue=function(e,t){return this._getFieldLocale(t).setValue(e)},t.prototype.removeValue=function(e){return this.setValue(void 0,e)},t.prototype.onValueChanged=function(e,t){return t||(t=e,e=void 0),this._getFieldLocale(e).onValueChanged(t)},t.prototype.onIsDisabledChanged=function(e,t){return t||(t=e,e=void 0),this._getFieldLocale(e).onIsDisabledChanged(t)},t.prototype._getFieldLocale=function(e){return r(this,e=e||this._defaultLocale),this._fieldLocales[e]},t}();function r(e,t){if(!e._fieldLocales[t])throw new Error('Unknown locale "'+t+'" for field "'+e.id+'"')}exports.default=n;
},{"./field-locale":"QmLY"}],"ce7B":[function(require,module,exports) {
"use strict";function e(e,t){var n=e.document,i=e.MutationObserver,r=function(){c.updateHeight()},u=new i(r),o=null,s=!1,c={startAutoResizer:function(){if(c.updateHeight(),s)return;s=!0,u.observe(n.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e.addEventListener("resize",r)},stopAutoResizer:function(){if(!s)return;s=!1,u.disconnect(),e.removeEventListener("resize",r)},updateHeight:function(e){void 0===e&&(e=null);null===e&&(e=Math.ceil(n.documentElement.getBoundingClientRect().height));e!==o&&(t.send("setHeight",e),o=e)}};return c}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"QAnz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./signal");function n(n,t,r,u){var i=t.sys,s=new e.MemoizedSignal(i);return n.addHandler("sysChanged",function(e){i=e,s.dispatch(i)}),{getSys:function(){return i},onSysChanged:function(e){return s.attach(e)},fields:r.reduce(function(e,n){return e[n.id]=u(n),e},{})}}exports.default=n;
},{"./signal":"Wswr"}],"Stzf":[function(require,module,exports) {
"use strict";var e=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var s=Array(e),n=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,c=a.length;o<c;o++,n++)s[n]=a[o];return s};Object.defineProperty(exports,"__esModule",{value:!0});var t=["getContentType","getEntry","getEntrySnapshots","getAsset","getEditorInterface","getPublishedEntries","getPublishedAssets","getContentTypes","getEntries","getEditorInterfaces","getAssets","createContentType","createEntry","createAsset","updateContentType","updateEntry","updateAsset","deleteContentType","deleteEntry","deleteAsset","publishEntry","publishAsset","unpublishEntry","unpublishAsset","archiveEntry","archiveAsset","unarchiveEntry","unarchiveAsset","createUpload","processAsset","waitUntilAssetProcessed","getUsers","getAllScheduledActions","getEntityScheduledActions"];function r(r,s){var n={};return t.forEach(function(e){n[e]=function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];return r.call("callSpaceMethod",e,t)}}),n.getCachedContentTypes=function(){return e(s)},n}exports.default=r;
},{}],"ndXf":[function(require,module,exports) {
"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t=function(t){return"object"===n(t)&&null!==t&&!Array.isArray(t)},e=function(n){return t(n)?n:{}};function o(n,t){return{openAlert:o.bind(null,"alert"),openConfirm:o.bind(null,"confirm"),openPrompt:o.bind(null,"prompt"),openExtension:function(o){if((o=e(o)).id=o.id||t.extension,o.id)return n.call("openDialog","extension",o);throw new Error("Extension ID not provided.")},openCurrentApp:function(o){if((o=e(o)).id=t.app,o.id)return n.call("openDialog","app",o);throw new Error("Not in the app context.")},selectSingleEntry:r.bind(null,"Entry",!1),selectSingleAsset:r.bind(null,"Asset",!1),selectMultipleEntries:r.bind(null,"Entry",!0),selectMultipleAssets:r.bind(null,"Asset",!0)};function o(t,o){return n.call("openDialog",t,e(o))}function r(t,o,r){return(r=e(r)).entityType=t,r.multiple=o,n.call("openDialog","entitySelector",r)}}exports.default=o;
},{}],"bkb9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./signal");function n(n,t){var a=new e.MemoizedSignal(void 0),d=new e.MemoizedSignal(void 0);return n.addHandler("localeSettingsChanged",function(e){a.dispatch(e)}),n.addHandler("showDisabledFieldsChanged",function(e){d.dispatch(e)}),{editorInterface:t,onLocaleSettingsChanged:function(e){return a.attach(e)},onShowDisabledFieldsChanged:function(e){return d.attach(e)}}}exports.default=n;
},{"./signal":"Wswr"}],"Pdlz":[function(require,module,exports) {
"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(n){for(var t,e=1,i=arguments.length;e<i;e++)for(var a in t=arguments[e])Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a]);return n}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./signal");function e(e,i){var a=new t.Signal;return e.addHandler("navigateSlideIn",function(n){a.dispatch(n)}),{openEntry:function(t,i){return e.call("navigateToContentEntity",n(n({},i),{entityType:"Entry",id:t}))},openNewEntry:function(t,i){return e.call("navigateToContentEntity",n(n({},i),{entityType:"Entry",id:null,contentTypeId:t}))},openBulkEditor:function(t,i){return e.call("navigateToBulkEditor",n({entryId:t},i))},openAsset:function(t,i){return e.call("navigateToContentEntity",n(n({},i),{entityType:"Asset",id:t}))},openNewAsset:function(t){return e.call("navigateToContentEntity",n(n({},t),{entityType:"Asset",id:null}))},openPageExtension:function(t){return e.call("navigateToPage",n({type:"extension",id:i.extension},t))},openCurrentAppPage:function(t){return e.call("navigateToPage",n({type:"app",id:i.app},t))},onSlideInNavigation:function(n){return a.attach(n)}}}exports.default=e;
},{"./signal":"Wswr"}],"EVxB":[function(require,module,exports) {
"use strict";function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n)}Object.defineProperty(exports,"__esModule",{value:!0});var n="preInstall",e="postInstall",r=function(n){return"object"===t(n)&&null!==n&&!Array.isArray(n)},o=function(t){return"function"==typeof t},u=function(t){return r(t)&&o(t.then)},l=function(t,n,e){if(!o(t))return Promise.resolve(n);var l;try{l=void 0===e?t():t(e)}catch(a){return Promise.resolve(!1)}var i=l;return u(i)||(i=Promise.resolve(i)),i.then(function(t){return!(t instanceof Error||!1===t)&&(r(t)?t:n)},function(){return!1}).catch(function(){return!1})};function i(t){var r,u=((r={})[n]=null,r[e]=null,r),i=function(t,n){if(!o(n))throw new Error("Handler must be a function.");u[t]=n};return t.addHandler("appHook",function(r){var o=r.stage,i=r.installationRequestId,a=r.err;return o===n?l(u[o],{}).then(function(n){return t.send("appHookResult",{stage:o,installationRequestId:i,result:n})}):o===e?l(u[o],void 0,a||null).then(function(){return t.send("appHookResult",{stage:o,installationRequestId:i})}):Promise.resolve()}),{setReady:function(){return t.call("callAppMethod","setReady")},isInstalled:function(){return t.call("callAppMethod","isInstalled")},getParameters:function(){return t.call("callAppMethod","getParameters")},onConfigure:function(t){i(n,t)},onConfigurationCompleted:function(t){i(e,t)}}}exports.default=i;
},{}],"m7zR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={LOCATION_ENTRY_FIELD:"entry-field",LOCATION_ENTRY_FIELD_SIDEBAR:"entry-field-sidebar",LOCATION_ENTRY_SIDEBAR:"entry-sidebar",LOCATION_DIALOG:"dialog",LOCATION_ENTRY_EDITOR:"entry-editor",LOCATION_PAGE:"page",LOCATION_APP_CONFIG:"app-config"};exports.default=e;
},{}],"in7L":[function(require,module,exports) {
"use strict";var e,t=this&&this.__assign||function(){return(t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var n=r(require("./field")),a=r(require("./field-locale")),u=r(require("./window")),i=r(require("./entry")),o=r(require("./space")),l=r(require("./dialogs")),f=r(require("./editor")),s=r(require("./navigator")),c=r(require("./app")),d=r(require("./locations")),p=[I,N,v,y,T],O=((e={})[d.default.LOCATION_ENTRY_FIELD]=p,e[d.default.LOCATION_ENTRY_FIELD_SIDEBAR]=p,e[d.default.LOCATION_ENTRY_SIDEBAR]=[I,N,y,T],e[d.default.LOCATION_ENTRY_EDITOR]=[I,N,y],e[d.default.LOCATION_DIALOG]=[I,A,T],e[d.default.LOCATION_PAGE]=[I],e[d.default.LOCATION_APP_CONFIG]=[I,E],e);function _(e,r,n){return(O[r.location]||p).reduce(function(a,u){return t(t({},a),u(e,r,n))},{})}function I(e,t){var r=t.user,n=t.parameters,a=t.locales,u=t.ids,i=t.initialContentTypes,f=t.location||d.default.LOCATION_ENTRY_FIELD;return{location:{is:function(e){return f===e}},user:r,parameters:n,locales:{available:a.available,default:a.default,names:a.names,fallbacks:a.fallbacks,optional:a.optional,direction:a.direction},space:o.default(e,i),dialogs:l.default(e,u),navigator:s.default(e,u),notifier:{success:function(t){return e.send("notify",{type:"success",message:t})},error:function(t){return e.send("notify",{type:"error",message:t})}},ids:u}}function T(e,t,r){return{window:u.default(r,e)}}function y(e,t){var r=t.editorInterface;return{editor:f.default(e,r)}}function N(e,t){var r=t.locales,a=t.contentType,u=t.entry,o=t.fieldInfo;return{contentType:a,entry:i.default(e,u,o,function(t){return new n.default(e,t,r.default)})}}function v(e,t){var r=t.field;return{field:new a.default(e,r)}}function A(e){return{close:function(t){return e.send("closeDialog",t)}}}function E(e){return{app:c.default(e)}}exports.default=_;
},{"./field":"RMZU","./field-locale":"QmLY","./window":"ce7B","./entry":"QAnz","./space":"Stzf","./dialogs":"ndXf","./editor":"bkb9","./navigator":"Pdlz","./app":"EVxB","./locations":"m7zR"}],"QCba":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=e(require("./initialize")),t=e(require("./api")),u=e(require("./locations"));module.exports={init:i.default(window,t.default),locations:u.default};
},{"./initialize":"uzbA","./api":"in7L","./locations":"m7zR"}]},{},["QCba"], "contentfulExtension")
{
"name": "contentful-ui-extensions-sdk",
"description": "SDK to develop custom UI Extension for the Contentful Web App",
"version": "3.12.1",
"version": "3.13.0",
"author": "Contentful GmbH",

@@ -12,15 +12,15 @@ "license": "MIT",

"dist/cf-extension.css",
"lib/**/*.js",
"typings.d.ts"
],
"scripts": {
"test": "mocha test/unit/*.js",
"lint": "eslint lib/ test/",
"test": "ts-mocha 'test/unit/*.[jt]s'",
"lint": "tsc -b && eslint '{lib,test}/**/*.{t,j}s'",
"lint:fix": "eslint --fix lib/ test/",
"build": "parcel build lib/index.js --no-source-maps --out-file cf-extension-api.js --global contentfulExtension",
"build:debug": "parcel build lib/index.js --out-file cf-extension-api.js --global contentfulExtension",
"build": "npm run typings && parcel build lib/index.ts --no-source-maps --out-file cf-extension-api.js --global contentfulExtension",
"build:debug": "npm run typings && parcel build lib/index.ts --public-url '.' --out-file cf-extension-api.js --global contentfulExtension",
"typings": "tsc -b typings.tsconfig.json && mv lib/types.d.ts typings.d.ts && cat module-declaration.d.ts >> typings.d.ts",
"prepublishOnly": "npm run build",
"size": "echo \"Gzipped, estimate: $(gzip -9 -c dist/cf-extension-api.js | wc -c) bytes\"",
"integration": "node test/integration",
"integration:local": "node test/integration/local.js",
"integration": "ts-node test/integration",
"integration:local": "ts-node test/integration/local",
"cypress:open": "cypress open",

@@ -38,2 +38,6 @@ "cypress:run": "cypress run --browser chrome",

"@testing-library/dom": "6.12.2",
"@types/chai-as-promised": "^7.1.2",
"@types/jsdom": "^16.2.1",
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
"async-retry": "1.2.3",

@@ -45,3 +49,3 @@ "babel-eslint": "10.0.1",

"cross-spawn": "6.0.5",
"cypress": "^4.1.0",
"cypress": "^4.4.1",
"cypress-plugin-retries": "^1.5.2",

@@ -71,3 +75,6 @@ "dotenv": "8.0.0",

"sinon": "^7.5.0",
"sinon-chai": "^3.5.0"
"sinon-chai": "^3.5.0",
"ts-mocha": "^7.0.0",
"ts-node": "^8.9.0",
"typescript": "^3.8.3"
},

@@ -80,3 +87,3 @@ "husky": {

"lint-staged": {
"*.js": [
"*.ts": [
"prettier --write",

@@ -86,6 +93,2 @@ "eslint --fix",

],
"*.ts": [
"prettier --write",
"git add"
],
"*.md": [

@@ -92,0 +95,0 @@ "prettier --write",

@@ -1,632 +0,539 @@

declare module 'contentful-ui-extensions-sdk' {
type EntityType = 'Entry' | 'Asset'
interface SpaceMembership {
export declare type EntityType = 'Entry' | 'Asset';
export interface SpaceMembership {
sys: {
id: string
type: string
}
admin: boolean
roles: { name: string; description: string }[]
}
interface User {
id: string;
type: string;
};
admin: boolean;
roles: {
name: string;
description: string;
}[];
}
export interface User {
sys: {
id: string
type: string
}
firstName: string
lastName: string
email: string
avatarUrl: string
spaceMembership: SpaceMembership
}
interface Items {
type: string
linkType?: string
validations?: Object[]
}
interface Link {
id: string;
type: string;
};
firstName: string;
lastName: string;
email: string;
avatarUrl: string;
spaceMembership: SpaceMembership;
}
export interface Items {
type: string;
linkType?: string;
validations?: Object[];
}
export interface Link {
sys: {
id: string
type: string
linkType: string
}
}
interface EntrySys {
space: Link
id: string
type: string
createdAt: string
updatedAt: string
environment: Link
publishedVersion: number
deletedVersion?: number
archivedVersion?: number
publishedAt: string
firstPublishedAt: string
createdBy: Link
updatedBy: Link
publishedCounter: number
version: number
publishedBy: Link
contentType: Link
}
/* Field API */
interface FieldAPI {
id: string;
type: string;
linkType: string;
};
}
export interface EntrySys {
space: Link;
id: string;
type: string;
createdAt: string;
updatedAt: string;
environment: Link;
publishedVersion: number;
deletedVersion?: number;
archivedVersion?: number;
publishedAt: string;
firstPublishedAt: string;
createdBy: Link;
updatedBy: Link;
publishedCounter: number;
version: number;
publishedBy: Link;
contentType: Link;
}
export interface FieldAPI {
/** The ID of a field is defined in an entry's content type. */
id: string
id: string;
/** The current locale of a field the extension is attached to. */
locale: string
locale: string;
/** Holds the type of the field the extension is attached to. */
type: string
type: string;
/** Indicates if a value for this field is required **/
required: boolean
required: boolean;
/** A list of validations for this field that are defined in the content type. */
validations: Object[]
validations: Object[];
/** Defines the shape of array items **/
items?: Items
items?: Items;
/** Gets the current value of the field and locale. */
getValue: () => any
getValue: () => any;
/** Sets the value for the field and locale. */
setValue: (value: any) => Promise<any>
setValue: (value: any) => Promise<any>;
/** Removes the value for the field and locale. */
removeValue: () => Promise<void>
removeValue: () => Promise<void>;
/** Communicates to the web application if the field is in a valid state or not. */
setInvalid: (value: boolean) => void
setInvalid: (value: boolean) => void;
/** Calls the callback every time the value of the field is changed by an external event or when setValue() is called. */
onValueChanged: (callback: (value: any) => void) => Function
onValueChanged: (callback: (value: any) => void) => Function;
/** Calls the callback when the disabled status of the field changes. */
onIsDisabledChanged: (callback: Function) => Function
onIsDisabledChanged: (callback: Function) => Function;
/** Calls the callback immediately with the current validation errors and whenever the field is re-validated. */
onSchemaErrorsChanged: (callback: Function) => Function
}
/* Entry API */
interface EntryFieldAPI {
onSchemaErrorsChanged: (callback: Function) => Function;
}
export interface EntryFieldAPI {
/** The ID of a field is defined in an entry's content type. */
id: string
id: string;
/** The list of locales for the field. */
locales: string[]
locales: string[];
/** Holds the type of the field. */
type: string
type: string;
/** Indicates if a value for this field is required **/
required: boolean
required: boolean;
/** A list of validations for this field that are defined in the content type. */
validations: Object[]
validations: Object[];
/** Defines the shape of array items **/
items?: Items
items?: Items;
/** Gets the current value of the field and locale. */
getValue: (locale?: string) => any
getValue: (locale?: string) => any;
/** Sets the value for the field and locale. */
setValue: (value: any, locale?: string) => Promise<any>
setValue: (value: any, locale?: string) => Promise<any>;
/** Removes the value for the field and locale. */
removeValue: (locale?: string) => Promise<void>
removeValue: (locale?: string) => Promise<void>;
/** Calls the callback every time the value of the field is changed by an external event or when setValue() is called. */
onValueChanged: {
(callback: (value: any) => void): () => void
(locale: string, callback: (value: any) => void): () => void
}
(callback: (value: any) => void): () => void;
(locale: string, callback: (value: any) => void): () => void;
};
/** Calls the callback when the disabled status of the field changes. */
onIsDisabledChanged: {
(callback: (isDisabled: boolean) => void): () => void
(locale: string, callback: (isDisabled: boolean) => void): () => void
}
}
interface EntryAPI {
(callback: (isDisabled: boolean) => void): () => void;
(locale: string, callback: (isDisabled: boolean) => void): () => void;
};
}
export interface EntryAPI {
/** Returns metadata for an entry. */
getSys: () => EntrySys
getSys: () => EntrySys;
/** Calls the callback with metadata every time that metadata changes. */
onSysChanged: (callback: (sys: EntrySys) => void) => Function
onSysChanged: (callback: (sys: EntrySys) => void) => Function;
/** Allows to control the values of all other fields in the current entry. */
fields: { [key: string]: EntryFieldAPI }
}
/* Content Type API */
interface ContentTypeField {
disabled: boolean
id: string
localized: boolean
name: string
omitted: boolean
required: boolean
type: string
validations: Object[]
linkType?: string
items?: Items
}
interface ContentType {
fields: {
[key: string]: EntryFieldAPI;
};
}
export interface ContentTypeField {
disabled: boolean;
id: string;
localized: boolean;
name: string;
omitted: boolean;
required: boolean;
type: string;
validations: Object[];
linkType?: string;
items?: Items;
}
export interface ContentType {
sys: {
type: string
id: string
version?: number
space?: Link
environment?: Link
createdAt?: string
createdBy?: Link
updatedAt?: string
updatedBy?: Link
}
fields: ContentTypeField[]
name: string
displayField: string
description: string
}
interface EditorInterface {
sys: Object
type: string;
id: string;
version?: number;
space?: Link;
environment?: Link;
createdAt?: string;
createdBy?: Link;
updatedAt?: string;
updatedBy?: Link;
};
fields: ContentTypeField[];
name: string;
displayField: string;
description: string;
}
export interface EditorInterface {
sys: Object;
controls?: Array<{
fieldId: string
widgetId?: string
widgetNamespace?: string
settings?: Object
}>
fieldId: string;
widgetId?: string;
widgetNamespace?: string;
settings?: Object;
}>;
sidebar?: Array<{
widgetId: string
widgetNamespace: string
settings?: Object
disabled?: boolean
}>
widgetId: string;
widgetNamespace: string;
settings?: Object;
disabled?: boolean;
}>;
editor?: {
widgetId: string
widgetNamespace: string
settings?: Object
}
}
/* Space API */
interface SearchQuery {
order?: string
skip?: number
limit?: number
[key: string]: any
}
type CollectionResponse<T> = {
items: T[]
total: number
skip: number
limit: number
sys: { type: string }
}
interface SpaceAPI {
getCachedContentTypes: () => ContentType[]
getContentType: <T = Object>(id: string) => Promise<T>
getContentTypes: <T = Object>() => Promise<CollectionResponse<T>>
createContentType: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
updateContentType: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
deleteContentType: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
getEntry: <T = Object>(id: string) => Promise<T>
getEntrySnapshots: <T = Object>(id: string) => Promise<CollectionResponse<T>>
getEntries: <T = Object, InputArgs = SearchQuery>(
query?: InputArgs
) => Promise<CollectionResponse<T>>
createEntry: <T = Object, InputArgs = any>(contentTypeId: string, data: InputArgs) => Promise<T>
updateEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
publishEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
unpublishEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
archiveEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
unarchiveEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
deleteEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
getPublishedEntries: <T = Object, InputArgs = SearchQuery>(
query?: InputArgs
) => Promise<CollectionResponse<T>>
getAsset: <T = Object>(id: string) => Promise<T>
getAssets: <T = Object, InputArgs = SearchQuery>(
query?: SearchQuery
) => Promise<CollectionResponse<T>>
createAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
updateAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
deleteAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
publishAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
unpublishAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
archiveAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
processAsset: <T = Object, InputArgs = any>(data: InputArgs, locale: string) => Promise<T>
unarchiveAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>
getPublishedAssets: <T = Object, InputArgs = SearchQuery>(
query?: InputArgs
) => Promise<CollectionResponse<T>>
createUpload: (base64data: string) => void
waitUntilAssetProcessed: (assetId: string, locale: string) => void
widgetId: string;
widgetNamespace: string;
settings?: Object;
};
}
export interface SearchQuery {
order?: string;
skip?: number;
limit?: number;
[key: string]: any;
}
export declare type CollectionResponse<T> = {
items: T[];
total: number;
skip: number;
limit: number;
sys: {
type: string;
};
};
export interface SpaceAPI {
getCachedContentTypes: () => ContentType[];
getContentType: <T = Object>(id: string) => Promise<T>;
getContentTypes: <T = Object>() => Promise<CollectionResponse<T>>;
createContentType: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
updateContentType: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
deleteContentType: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
getEntry: <T = Object>(id: string) => Promise<T>;
getEntrySnapshots: <T = Object>(id: string) => Promise<CollectionResponse<T>>;
getEntries: <T = Object, InputArgs = SearchQuery>(query?: InputArgs) => Promise<CollectionResponse<T>>;
createEntry: <T = Object, InputArgs = any>(contentTypeId: string, data: InputArgs) => Promise<T>;
updateEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
publishEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
unpublishEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
archiveEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
unarchiveEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
deleteEntry: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
getPublishedEntries: <T = Object, InputArgs = SearchQuery>(query?: InputArgs) => Promise<CollectionResponse<T>>;
getAsset: <T = Object>(id: string) => Promise<T>;
getAssets: <T = Object, InputArgs = SearchQuery>(query?: SearchQuery) => Promise<CollectionResponse<T>>;
createAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
updateAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
deleteAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
publishAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
unpublishAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
archiveAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
processAsset: <T = Object, InputArgs = any>(data: InputArgs, locale: string) => Promise<T>;
unarchiveAsset: <T = Object, InputArgs = any>(data: InputArgs) => Promise<T>;
getPublishedAssets: <T = Object, InputArgs = SearchQuery>(query?: InputArgs) => Promise<CollectionResponse<T>>;
createUpload: (base64data: string) => void;
waitUntilAssetProcessed: (assetId: string, locale: string) => void;
/** Returns all users who belong to the space. */
getUsers: <T = Object>() => Promise<CollectionResponse<T>>
getUsers: <T = Object>() => Promise<CollectionResponse<T>>;
/** Returns editor interface for a given content type */
getEditorInterface: (contentTypeId: string) => Promise<EditorInterface>
getEditorInterface: (contentTypeId: string) => Promise<EditorInterface>;
/** Returns editor interfaces for a given environment */
getEditorInterfaces: () => Promise<CollectionResponse<EditorInterface>>
/* Returns a list of scheduled actions for a given entity */
getEntityScheduledActions: (
entityType: EntityType,
entityId: string
) => Promise<ScheduledAction[]>
/* Returns a list of scheduled actions for the currenst space & environment */
getAllScheduledActions: () => Promise<ScheduledAction[]>
}
/* Locales API */
interface LocalesAPI {
getEditorInterfaces: () => Promise<CollectionResponse<EditorInterface>>;
getEntityScheduledActions: (entityType: EntityType, entityId: string) => Promise<ScheduledAction[]>;
getAllScheduledActions: () => Promise<ScheduledAction[]>;
}
export interface LocalesAPI {
/** The default locale code for the current space. */
default: string
default: string;
/** A list of locale codes of all locales available for editing in the current space. */
available: string[]
available: string[];
/** An object with keys of locale codes and values of corresponding human-readable locale names. */
names: { [key: string]: string }
names: {
[key: string]: string;
};
/** An object with keys of locale codes and values of corresponding fallback locale codes. If there's no fallback then the value is undefined. */
fallbacks: { [key: string]: string | undefined }
fallbacks: {
[key: string]: string | undefined;
};
/** An object with keys of locale codes and values of corresponding boolean value indicating if the locale is optional or not. */
optional: { [key: string]: boolean }
optional: {
[key: string]: boolean;
};
/** An object with keys of locale codes and values of corresponding information indicating if the locale is right-to-left or left-to-right language. */
direction: { [key: string]: 'ltr' | 'rtl' }
}
/* Window API */
interface WindowAPI {
direction: {
[key: string]: 'ltr' | 'rtl';
};
}
export interface WindowAPI {
/** Sets the iframe height to the given value in pixels or using scrollHeight if value is not passed */
updateHeight: (height?: number) => void
updateHeight: (height?: number) => void;
/** Listens for DOM changes and updates height when the size changes. */
startAutoResizer: () => void
startAutoResizer: () => void;
/** Stops resizing the iframe automatically. */
stopAutoResizer: () => void
}
/* Scheduled Actions */
enum PublicActionStatus {
Scheduled = 'scheduled',
Succeeded = 'succeeded',
Failed = 'failed',
Canceled = 'canceled'
}
type ScheduledActionActionType = 'publish' | 'unpublish'
type ScheduledAction = {
stopAutoResizer: () => void;
}
export declare enum PublicActionStatus {
Scheduled = "scheduled",
Succeeded = "succeeded",
Failed = "failed",
Canceled = "canceled"
}
export declare type ScheduledActionActionType = 'publish' | 'unpublish';
export declare type ScheduledAction = {
sys: {
id: string
type: 'ScheduledAction'
createdAt: Date
createdBy: Link
canceledAt?: Date
canceledBy?: Link
space: {
id: string;
type: 'ScheduledAction';
createdAt: Date;
createdBy: Link;
canceledAt?: Date;
canceledBy?: Link;
space: {
sys: {
id: string;
linkType: 'Space';
type: string;
};
};
status: PublicActionStatus;
};
entity: {
sys: {
id: string
linkType: 'Space'
type: string
}
}
status: PublicActionStatus
}
entity: {
sys: {
id: string
linkType: EntityType
type: string
}
}
id: string;
linkType: EntityType;
type: string;
};
};
environment: {
sys: {
id: string
linkType: 'Environment'
type: string
}
}
sys: {
id: string;
linkType: 'Environment';
type: string;
};
};
scheduledFor: {
datetime: Date
}
action: ScheduledActionActionType
}
/* Dialogs API */
interface OpenAlertOptions {
title: string
message: string
confirmLabel?: string
shouldCloseOnEscapePress?: boolean
shouldCloseOnOverlayClick?: boolean
}
type OpenConfirmOptions = OpenAlertOptions & {
cancelLabel?: string
intent?: 'primary' | 'positive' | 'negative'
}
interface OpenCustomWidgetOptions {
id?: string
width?: number | 'small' | 'medium' | 'large' | 'fullWidth'
minHeight?: number | string
allowHeightOverflow?: boolean
position?: 'center' | 'top'
title?: string
shouldCloseOnOverlayClick?: boolean
shouldCloseOnEscapePress?: boolean
parameters?: Object
}
interface DialogsAPI {
datetime: Date;
};
action: ScheduledActionActionType;
};
export interface OpenAlertOptions {
title: string;
message: string;
confirmLabel?: string;
shouldCloseOnEscapePress?: boolean;
shouldCloseOnOverlayClick?: boolean;
}
export declare type OpenConfirmOptions = OpenAlertOptions & {
cancelLabel?: string;
intent?: 'primary' | 'positive' | 'negative';
};
export interface OpenCustomWidgetOptions {
id?: string;
width?: number | 'small' | 'medium' | 'large' | 'fullWidth';
minHeight?: number | string;
allowHeightOverflow?: boolean;
position?: 'center' | 'top';
title?: string;
shouldCloseOnOverlayClick?: boolean;
shouldCloseOnEscapePress?: boolean;
parameters?: Object;
}
export interface DialogsAPI {
/** Opens a simple alert window (which can only be closed). */
openAlert: (options: OpenAlertOptions) => Promise<boolean>
openAlert: (options: OpenAlertOptions) => Promise<boolean>;
/** Opens a confirmation window. A user can either confirm or cancel the dialog. */
openConfirm: (options: OpenConfirmOptions) => Promise<boolean>
openConfirm: (options: OpenConfirmOptions) => Promise<boolean>;
/** Opens a prompt window. A user can either provide a string input or cancel the dialog. */
openPrompt: (
options: OpenConfirmOptions & {
defaultValue?: string
}
) => Promise<string | boolean>
openPrompt: (options: OpenConfirmOptions & {
defaultValue?: string;
}) => Promise<string | boolean>;
/** Opens an extension in a dialog. */
openExtension: (options: OpenCustomWidgetOptions) => Promise<any>
openExtension: (options: OpenCustomWidgetOptions) => Promise<any>;
/** Opens the current app in a dialog */
openCurrentApp: (options?: Omit<OpenCustomWidgetOptions, 'id'>) => Promise<any>
openCurrentApp: (options?: Omit<OpenCustomWidgetOptions, 'id'>) => Promise<any>;
/** Opens a dialog for selecting a single entry. */
selectSingleEntry: <T = Object>(options?: {
locale?: string
contentTypes?: string[]
}) => Promise<T | null>
locale?: string;
contentTypes?: string[];
}) => Promise<T | null>;
/** Opens a dialog for selecting multiple entries. */
selectMultipleEntries: <T = Object>(options?: {
locale?: string
contentTypes?: string[]
min?: number
max?: number
}) => Promise<T[] | null>
locale?: string;
contentTypes?: string[];
min?: number;
max?: number;
}) => Promise<T[] | null>;
/** Opens a dialog for selecting a single asset. */
selectSingleAsset: <T = Object>(options?: {
locale?: string
mimetypeGroups?: string[]
}) => Promise<T | null>
locale?: string;
mimetypeGroups?: string[];
}) => Promise<T | null>;
/** Opens a dialog for selecting multiple assets. */
selectMultipleAssets: <T = Object>(options?: {
locale?: string
min?: number
max?: number
mimetypeGroups?: string[]
}) => Promise<T[] | null>
}
/* Navigator API */
interface NavigatorAPIOptions {
locale?: string;
min?: number;
max?: number;
mimetypeGroups?: string[];
}) => Promise<T[] | null>;
}
export interface NavigatorAPIOptions {
/** use `waitForClose` if you want promise to be resolved only after slide in editor is closed */
slideIn?: boolean | { waitForClose: boolean }
}
interface PageExtensionOptions {
slideIn?: boolean | {
waitForClose: boolean;
};
}
export interface PageExtensionOptions {
/** If included, you can navigate to a different page extension. If omitted, you will navigate within the current extension. */
id?: string
/** Navigate to a path withing your page extension. */
path?: string
}
interface NavigatorSlideInfo {
newSlideLevel: number
oldSlideLevel: number
}
interface NavigatorOpenResponse<T> {
navigated: boolean
entity: T
slide?: NavigatorSlideInfo
}
interface NavigatorAPI {
id?: string;
/** Navigate to a path within your page extension. */
path?: string;
}
export interface AppPageLocationOptions {
/** A path to navigate to within your app's page location. */
path?: string;
}
/** Information about current value of the navigation status. */
export interface NavigatorPageResponse {
/** Will be true if navigation was successfully executed by the web app. */
navigated: boolean;
/** The path that was navigated to by the web app. */
path: string;
}
export interface NavigatorSlideInfo {
newSlideLevel: number;
oldSlideLevel: number;
}
export interface NavigatorOpenResponse<T> {
navigated: boolean;
entity: T;
slide?: NavigatorSlideInfo;
}
export interface NavigatorAPI {
/** Opens an existing entry in the current Web App session. */
openEntry: <T = Object>(
entryId: string,
options?: NavigatorAPIOptions
) => Promise<NavigatorOpenResponse<T>>
openEntry: <T = Object>(entryId: string, options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<T>>;
/** Opens an existing asset in the current Web App session. */
openAsset: <T = Object>(
assetId: string,
options?: NavigatorAPIOptions
) => Promise<NavigatorOpenResponse<T>>
openAsset: <T = Object>(assetId: string, options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<T>>;
/** Opens a new entry in the current Web App session. */
openNewEntry: <T = Object>(
contentTypeId: string,
options?: NavigatorAPIOptions
) => Promise<NavigatorOpenResponse<T>>
openNewEntry: <T = Object>(contentTypeId: string, options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<T>>;
/** Opens a new asset in the current Web App session. */
openNewAsset: <T = Object>(options: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<T>>
openNewAsset: <T = Object>(options: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<T>>;
/** Navigates to a page extension in the current Web App session. Calling without `options` will navigate to the home route of your page extension. */
openPageExtension: (
options?: PageExtensionOptions
) => Promise<{
navigated: boolean
path: string
}>
openPageExtension: (options?: PageExtensionOptions) => Promise<NavigatorPageResponse>;
/** Navigates to the app's page location. */
openCurrentAppPage: (options?: AppPageLocationOptions) => Promise<NavigatorPageResponse>;
/** Navigates to a bulk entry editor */
openBulkEditor: (
entryId: string,
options: {
openBulkEditor: (entryId: string, options: {
/** ID of the reference field */
fieldId: string
fieldId: string;
/** Editable locale */
locale: string
locale: string;
/** Focused index */
index: number
}
) => Promise<{
navigated: boolean
slide?: NavigatorSlideInfo
}>
onSlideInNavigation: (fn: (slide: NavigatorSlideInfo) => void) => Function
}
/* Notifier API */
interface NotifierAPI {
index: number;
}) => Promise<{
navigated: boolean;
slide?: NavigatorSlideInfo;
}>;
onSlideInNavigation: (fn: (slide: NavigatorSlideInfo) => void) => Function;
}
export interface NotifierAPI {
/** Displays a success notification in the notification area of the Web App. */
success: (message: string) => void
success: (message: string) => void;
/** Displays an error notification in the notification area of the Web App. */
error: (message: string) => void
}
/* Location API */
interface LocationAPI {
error: (message: string) => void;
}
export interface LocationAPI {
/** Checks the location in which your extension is running */
is: (type: string) => boolean
}
/* Parameters API */
interface ParametersAPI {
installation: Object
instance: Object
invocation?: Object
}
/* IDs */
interface IdsAPI {
user: string
extension: string
app?: string
space: string
environment: string
field: string
entry: string
contentType: string
}
interface SharedEditorSDK {
is: (type: string) => boolean;
}
export interface ParametersAPI {
installation: Object;
instance: Object;
invocation?: Object;
}
export interface IdsAPI {
user: string;
extension: string;
app?: string;
space: string;
environment: string;
field: string;
entry: string;
contentType: string;
}
export interface SharedEditorSDK {
editor: {
editorInterface: EditorInterface
onLocaleSettingsChanged: (
callback: (value: {
mode: 'multi' | 'single'
focused?: string
active?: Array<string>
}) => any
) => Function
onShowDisabledFieldsChanged: (callback: (value: boolean) => any) => Function
}
}
export interface BaseExtensionSDK {
editorInterface: EditorInterface;
onLocaleSettingsChanged: (callback: (value: {
mode: 'multi' | 'single';
focused?: string;
active?: Array<string>;
}) => any) => Function;
onShowDisabledFieldsChanged: (callback: (value: boolean) => any) => Function;
};
}
export interface BaseExtensionSDK {
/** Allows to read and update the value of any field of the current entry and to get the entry's metadata */
entry: EntryAPI
entry: EntryAPI;
/** Information about the content type of the entry. */
contentType: ContentType
contentType: ContentType;
/** Exposes methods that allow the extension to read and manipulate a wide range of objects in the space. */
space: SpaceAPI
space: SpaceAPI;
/** Information about the current user and roles */
user: User
user: User;
/** Information about the current locales */
locales: LocalesAPI
locales: LocalesAPI;
/** Methods for opening UI dialogs: */
dialogs: DialogsAPI
dialogs: DialogsAPI;
/** Methods for navigating between entities stored in a Contentful space. */
navigator: NavigatorAPI
navigator: NavigatorAPI;
/** Methods for displaying notifications. */
notifier: NotifierAPI
notifier: NotifierAPI;
/** Exposes extension configuration parameters */
parameters: ParametersAPI
parameters: ParametersAPI;
/** Exposes method to identify extension's location */
location: LocationAPI
}
export type EditorExtensionSDK = BaseExtensionSDK &
SharedEditorSDK & {
/** A set of IDs actual for the extension */
ids: Pick<IdsAPI, 'entry' | 'contentType' | 'environment' | 'space' | 'extension' | 'user'>
}
export type SidebarExtensionSDK = BaseExtensionSDK &
SharedEditorSDK & {
/** A set of IDs actual for the extension */
ids: Pick<IdsAPI, 'entry' | 'contentType' | 'environment' | 'space' | 'extension' | 'user'>
/** Methods to update the size of the iframe the extension is contained within. */
window: WindowAPI
}
export type FieldExtensionSDK = BaseExtensionSDK &
SharedEditorSDK & {
/** A set of IDs actual for the extension */
ids: IdsAPI
/** Gives you access to the value and metadata of the field the extension is attached to. */
field: FieldAPI
/** Methods to update the size of the iframe the extension is contained within. */
window: WindowAPI
}
export type DialogExtensionSDK = BaseExtensionSDK & {
location: LocationAPI;
}
export declare type EditorExtensionSDK = BaseExtensionSDK & SharedEditorSDK & {
/** A set of IDs actual for the extension */
ids: Pick<IdsAPI, 'environment' | 'space' | 'extension' | 'user'>
ids: Pick<IdsAPI, 'entry' | 'contentType' | 'environment' | 'space' | 'extension' | 'user'>;
};
export declare type SidebarExtensionSDK = BaseExtensionSDK & SharedEditorSDK & {
/** A set of IDs actual for the extension */
ids: Pick<IdsAPI, 'entry' | 'contentType' | 'environment' | 'space' | 'extension' | 'user'>;
/** Methods to update the size of the iframe the extension is contained within. */
window: WindowAPI;
};
export declare type FieldExtensionSDK = BaseExtensionSDK & SharedEditorSDK & {
/** A set of IDs actual for the extension */
ids: IdsAPI;
/** Gives you access to the value and metadata of the field the extension is attached to. */
field: FieldAPI;
/** Methods to update the size of the iframe the extension is contained within. */
window: WindowAPI;
};
export declare type DialogExtensionSDK = BaseExtensionSDK & {
/** A set of IDs actual for the extension */
ids: Pick<IdsAPI, 'environment' | 'space' | 'extension' | 'user'>;
/** Closes the dialog and resolves openExtension promise with data */
close: (data: any) => void
close: (data?: any) => void;
/** Methods to update the size of the iframe the extension is contained within. */
window: WindowAPI
}
export type PageExtensionSDK = BaseExtensionSDK & {
window: WindowAPI;
};
export declare type PageExtensionSDK = BaseExtensionSDK & {
/** A set of IDs actual for the extension */
ids: Pick<IdsAPI, 'environment' | 'space' | 'extension' | 'user'>
}
interface AppConfigAPI {
ids: Pick<IdsAPI, 'environment' | 'space' | 'extension' | 'user'>;
};
export interface AppConfigAPI {
/** Tells the web app that the app is loaded */
setReady: () => Promise<void>
setReady: () => Promise<void>;
/** Returns true if an App is installed **/
isInstalled: () => Promise<boolean>
isInstalled: () => Promise<boolean>;
/** Returns parameters of an App, null otherwise **/
getParameters: <T = Object>() => Promise<null | T>
/** Returns current state of an App, null otherwise **/
getCurrentState: <T = Object>() => Promise<null | T>
getParameters: <T = Object>() => Promise<null | T>;
/** Registers a handler to be called to produce parameters for an App **/
onConfigure: (handler: Function) => Promise<void>
onConfigure: (handler: Function) => Promise<void>;
/** Registers a handler to be called once configuration was finished **/
onConfigurationCompleted: (handler: Function) => Promise<void>
}
export type AppExtensionSDK = BaseExtensionSDK & {
onConfigurationCompleted: (handler: Function) => Promise<void>;
}
export declare type AppExtensionSDK = BaseExtensionSDK & {
/** A set of IDs actual for the app */
ids: Pick<IdsAPI, 'environment' | 'space' | 'app' | 'user'>
/** Apps Platform __ALPHA__ methods: subject to change **/
app: AppConfigAPI
platformAlpha: { app: AppConfigAPI }
}
export type KnownSDK =
| FieldExtensionSDK
| SidebarExtensionSDK
| DialogExtensionSDK
| EditorExtensionSDK
| PageExtensionSDK
| AppExtensionSDK
ids: Pick<IdsAPI, 'environment' | 'space' | 'app' | 'user'>;
app: AppConfigAPI;
};
export declare type KnownSDK = FieldExtensionSDK | SidebarExtensionSDK | DialogExtensionSDK | EditorExtensionSDK | PageExtensionSDK | AppExtensionSDK;
export interface Locations {
LOCATION_ENTRY_FIELD: 'entry-field';
LOCATION_ENTRY_FIELD_SIDEBAR: 'entry-field-sidebar';
LOCATION_ENTRY_SIDEBAR: 'entry-sidebar';
LOCATION_DIALOG: 'dialog';
LOCATION_ENTRY_EDITOR: 'entry-editor';
LOCATION_PAGE: 'page';
LOCATION_APP_CONFIG: 'app-config';
}
// will be appended to generated typings.d.ts
declare module 'contentful-ui-extensions-sdk' {
export const init: <T extends KnownSDK = KnownSDK>(initCallback: (sdk: T) => any) => void
export const locations: {
LOCATION_ENTRY_FIELD: string
LOCATION_ENTRY_FIELD_SIDEBAR: string
LOCATION_ENTRY_SIDEBAR: string
LOCATION_DIALOG: string
LOCATION_ENTRY_EDITOR: string
LOCATION_PAGE: string
LOCATION_APP: string
LOCATION_APP_CONFIG: string
}
export const locations: Locations
}
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