contentful-ui-extensions-sdk
Advanced tools
Comparing version 3.20.0 to 3.21.0
@@ -1,31 +0,1 @@ | ||
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("schemaErrorsChangedForFieldLocale",function(e,a,i){e===n.id&&a===n.locale&&n._schemaErrorsChangedSignal.dispatch(i)})}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 r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);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"],r=function(){function t(t,r,l){var a=this;i.forEach(function(e){void 0!==r[e]&&(a[e]=r[e])}),this._defaultLocale=l,this._fieldLocales=r.locales.reduce(function(i,n){var l,a=new o.default(t,{id:r.id,type:r.type,required:r.required,validations:r.validations,items:r.items,locale:n,value:r.values[n]});return e(e({},i),((l={})[n]=a,l))},{}),n(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 n(this,e=e||this._defaultLocale),this._fieldLocales[e]},t.prototype.getForLocale=function(e){if(!e)throw new Error("getForLocale must be passed a locale");return this._getFieldLocale(e)},t}();function n(e,t){if(!e._fieldLocales[t])throw new Error('Unknown locale "'+t+'" for field "'+e.id+'"')}exports.default=r; | ||
},{"./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";var t=this&&this.__assign||function(){return(t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./signal");function n(n,r,a,i){var s=r.sys,u=new e.MemoizedSignal(s),o=r.metadata;return n.addHandler("sysChanged",function(t){s=t,u.dispatch(s)}),t({getSys:function(){return s},onSysChanged:function(t){return u.attach(t)},fields:a.reduce(function(t,e){return t[e.id]=i(e),t},{})},o?{metadata:o}:{})}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)}var t=this&&this.__assign||function(){return(t=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0});var e=function(t){return"object"===n(t)&&null!==t&&!Array.isArray(t)},o=function(n){return e(n)?n:{}};function r(n,e){return{openAlert:r.bind(null,"alert"),openConfirm:r.bind(null,"confirm"),openPrompt:r.bind(null,"prompt"),openExtension:i,openCurrentApp:l,openCurrent:function(n){return e.app?l(n):i(t(t({},n),{id:e.extension}))},selectSingleEntry:u.bind(null,"Entry",!1),selectSingleAsset:u.bind(null,"Asset",!1),selectMultipleEntries:u.bind(null,"Entry",!0),selectMultipleAssets:u.bind(null,"Asset",!0)};function r(t,e){return n.call("openDialog",t,o(e))}function i(r){if(r=o(r),(r=t(t({},r),{id:r.id||e.extension})).id)return n.call("openDialog","extension",r);throw new Error("Extension ID not provided.")}function l(r){if(r=o(r),(r=t(t({},r),{id:e.app})).id)return n.call("openDialog","app",r);throw new Error("Not in the app context.")}function u(t,e,r){return(r=o(r)).entityType=t,r.multiple=e,n.call("openDialog","entitySelector",r)}}exports.default=r; | ||
},{}],"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(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)}Object.defineProperty(exports,"__esModule",{value:!0});var e="preInstall",n="postInstall",r=function(e){return"object"===t(e)&&null!==e&&!Array.isArray(e)},o=function(t){return"function"==typeof t},u=function(t){return r(t)&&o(t.then)},l=function(t){return console.error(t),Promise.resolve(!1)},a=function(t,e,n){if(!o(t))return Promise.resolve(e);var a;try{a=void 0===n?t():t(n)}catch(s){return l(s)}var i=a;return u(i)||(i=Promise.resolve(i)),i.then(function(t){return t instanceof Error?Promise.reject(t):!1!==t&&(r(t)?t:e)},l).catch(l)};function i(t){var r,u=((r={})[e]=null,r[n]=null,r),l=function(t,e){if(!o(e))throw new Error("Handler must be a function.");u[t]=e};return t.addHandler("appHook",function(r){var o=r.stage,l=r.installationRequestId,i=r.err;return o===e?a(u[o],{}).then(function(e){return t.send("appHookResult",{stage:o,installationRequestId:l,result:e})}):o===n?a(u[o],void 0,i||null).then(function(){return t.send("appHookResult",{stage:o,installationRequestId:l})}):Promise.resolve()}),{setReady:function(){return t.call("callAppMethod","setReady")},isInstalled:function(){return t.call("callAppMethod","isInstalled")},getParameters:function(){return t.call("callAppMethod","getParameters")},getCurrentState:function(){return t.call("callAppMethod","getCurrentState")},onConfigure:function(t){l(e,t)},onConfigurationCompleted:function(t){l(n,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")),c=r(require("./navigator")),s=r(require("./app")),d=r(require("./locations")),p=[I,A,N,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,A,y,T],e[d.default.LOCATION_ENTRY_EDITOR]=[I,A,y],e[d.default.LOCATION_DIALOG]=[I,v,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:c.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,access:{can:function(t,r){return e.call("checkAccess",t,r)}}}}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 A(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 N(e,t){var r=t.field;return{field:new a.default(e,r)}}function v(e){return{close:function(t){return e.send("closeDialog",t)}}}function E(e){return{app:s.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") | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).contentfulExtension=t()}(this,(function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};var t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function o(e){return this instanceof o?(this.v=e,this):new o(e)}var i=Object.freeze({__proto__:null,__extends:function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)},get __assign(){return t},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},__decorate:function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},__param:function(e,t){return function(n,r){t(n,r,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(a,u)}l((r=r.apply(e,t||[])).next())}))},__generator:function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},__exportStar:function(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])},__values:n,__read:r,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r},__await:o,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=i[e](t)).value instanceof o?Promise.resolve(n.value.v).then(s,c):f(a[0][2],n)}catch(e){f(a[0][3],e)}var n}function s(e){l("next",e)}function c(e){l("throw",e)}function f(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:o(e[r](t)),done:"return"===r}:i?i(t):t}:i}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=n(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}}});function a(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var u=a((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._id=0,this._listeners={}}return e.prototype.dispatch=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r in this._listeners)(e=this._listeners)[r].apply(e,t)},e.prototype.attach=function(e){var t=this;if("function"!=typeof e)throw new Error("listener function expected");var n=this._id++;return this._listeners[n]=e,function(){return delete t._listeners[n]}},e}();t.Signal=r;var o="__private__memoized__arguments__",a=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=e.call(this)||this;if(i[n]=[],!t.length)throw new Error("Initial value to be memoized expected");return i[o]=t,i}return i.__extends(t,e),t.prototype.dispatch=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this[o]=t,e.prototype.dispatch.apply(this,t)},t.prototype.attach=function(t){var n=e.prototype.attach.call(this,t);return t.apply(void 0,this[o]),n},t}(r);t.MemoizedSignal=a,n=o})),l=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){!function(e,t){function n(r){var o=r.data;"connect"===o.method&&(e.removeEventListener("message",n),t.apply(void 0,o.params))}e.addEventListener("message",n)}(e,(function(r,o){var i=new n(r.id,e);t(i,r,o)}))};var n=function(){function e(e,t){var n=this;this._messageHandlers={},this._responseHandlers={},this._send=function(e,t){var n=0;return function(r,o){var i=n++;return t.postMessage({source:e,id:i,method:r,params:o},"*"),i}}(e,t.parent),t.addEventListener("message",(function(e){n._handleMessage(e.data)}))}return e.prototype.call=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this._send(e,n);return new Promise((function(e,n){t._responseHandlers[o]={resolve:e,reject:n}}))},e.prototype.send=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._send(e,t)},e.prototype.addHandler=function(e,t){return e in this._messageHandlers||(this._messageHandlers[e]=new u.Signal),this._messageHandlers[e].attach(t)},e.prototype._handleMessage=function(e){if(e.method){var t=e.method,n=e.params,r=this._messageHandlers[t];r&&r.dispatch.apply(r,n)}else{var o=e.id,i=this._responseHandlers[o];if(!i)return;"result"in e?i.resolve(e.result):"error"in e&&i.reject(e.error),delete this._responseHandlers[o]}},e}()})),s=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=i.__importDefault(l);t.default=function(e,t){var r,o=((r={promise:null,resolve:null}).promise=new Promise((function(e){r.resolve=e})),r);return o.promise.then((function(t){var n=t[0],r=e.document;r.addEventListener("focus",(function(){return n.send("setActive",!0)}),!0),r.addEventListener("blur",(function(){return n.send("setActive",!1)}),!0)})),n.default(e,(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.resolve(e)})),function(n,r){var i=(void 0===r?{}:r).makeCustomApi,a=void 0===i?null:i;o.promise.then((function(r){var o,i=r[0],u=r[1],l=r[2],s=t(i,u,e);"function"==typeof a&&(o=a(i,u)),l.forEach((function(e){i._handleMessage(e)})),n(s,o)}))}}})),c=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=["id","locale","type","required","validations","items"],r=function(){function e(e,t){var r=this;n.forEach((function(e){void 0!==t[e]&&(r[e]=t[e])})),this._value=t.value,this._valueSignal=new u.MemoizedSignal(this._value),this._isDisabledSignal=new u.MemoizedSignal(void 0),this._schemaErrorsChangedSignal=new u.MemoizedSignal(void 0),this._channel=e,e.addHandler("valueChanged",(function(e,t,n){e!==r.id||t&&t!==r.locale||(r._value=n,r._valueSignal.dispatch(n))})),e.addHandler("isDisabledChangedForFieldLocale",(function(e,t,n){e===r.id&&t===r.locale&&r._isDisabledSignal.dispatch(n)})),e.addHandler("schemaErrorsChangedForFieldLocale",(function(e,t,n){e===r.id&&t===r.locale&&r._schemaErrorsChangedSignal.dispatch(n)}))}return e.prototype.getValue=function(){return this._value},e.prototype.setValue=function(e){return this._value=e,this._valueSignal.dispatch(e),this._channel.call("setValue",this.id,this.locale,e)},e.prototype.removeValue=function(){return this._value=void 0,this._channel.call("removeValue",this.id,this.locale)},e.prototype.setInvalid=function(e){return this._channel.call("setInvalid",e,this.locale)},e.prototype.onValueChanged=function(e){return this._valueSignal.attach(e)},e.prototype.onIsDisabledChanged=function(e){return this._isDisabledSignal.attach(e)},e.prototype.onSchemaErrorsChanged=function(e){return this._schemaErrorsChangedSignal.attach(e)},e}();t.default=r})),f=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=i.__importDefault(c),r=["id","locales","type","required","validations","items"],o=function(){function e(e,t,o){var u=this;r.forEach((function(e){void 0!==t[e]&&(u[e]=t[e])})),this._defaultLocale=o,this._fieldLocales=t.locales.reduce((function(r,o){var a,u=new n.default(e,{id:t.id,type:t.type,required:t.required,validations:t.validations,items:t.items,locale:o,value:t.values[o]});return i.__assign(i.__assign({},r),((a={})[o]=u,a))}),{}),a(this,o)}return e.prototype.getValue=function(e){return this._getFieldLocale(e).getValue()},e.prototype.setValue=function(e,t){return this._getFieldLocale(t).setValue(e)},e.prototype.removeValue=function(e){return this.setValue(void 0,e)},e.prototype.onValueChanged=function(e,t){return t||(t=e,e=void 0),this._getFieldLocale(e).onValueChanged(t)},e.prototype.onIsDisabledChanged=function(e,t){return t||(t=e,e=void 0),this._getFieldLocale(e).onIsDisabledChanged(t)},e.prototype._getFieldLocale=function(e){return a(this,e=e||this._defaultLocale),this._fieldLocales[e]},e.prototype.getForLocale=function(e){if(!e)throw new Error("getForLocale must be passed a locale");return this._getFieldLocale(e)},e}();function a(e,t){if(!e._fieldLocales[t])throw new Error('Unknown locale "'+t+'" for field "'+e.id+'"')}t.default=o})),d=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e.document,r=e.MutationObserver,o=function(){l.updateHeight()},i=new r(o),a=null,u=!1,l={startAutoResizer:function(){if(l.updateHeight(),u)return;u=!0,i.observe(n.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e.addEventListener("resize",o)},stopAutoResizer:function(){if(!u)return;u=!1,i.disconnect(),e.removeEventListener("resize",o)},updateHeight:function(e){void 0===e&&(e=null);null===e&&(e=Math.ceil(n.documentElement.getBoundingClientRect().height));e!==a&&(t.send("setHeight",e),a=e)}};return l}})),p=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r){var o=t.sys,a=new u.MemoizedSignal(o),l=t.metadata;return e.addHandler("sysChanged",(function(e){o=e,a.dispatch(o)})),i.__assign({getSys:function(){return o},onSysChanged:function(e){return a.attach(e)},fields:n.reduce((function(e,t){return e[t.id]=r(t),e}),{})},l?{metadata:l}:{})}})),_=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=["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"];t.default=function(e,t){var r={};return n.forEach((function(t){r[t]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.call("callSpaceMethod",t,n)}})),r.getCachedContentTypes=function(){return i.__spreadArrays(t)},r}})),h=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return"object"!=typeof(t=e)||null===t||Array.isArray(t)?{}:e;var t};t.default=function(e,t){return{openAlert:r.bind(null,"alert"),openConfirm:r.bind(null,"confirm"),openPrompt:r.bind(null,"prompt"),openExtension:o,openCurrentApp:a,openCurrent:function(e){return t.app?a(e):o(i.__assign(i.__assign({},e),{id:t.extension}))},selectSingleEntry:u.bind(null,"Entry",!1),selectSingleAsset:u.bind(null,"Asset",!1),selectMultipleEntries:u.bind(null,"Entry",!0),selectMultipleAssets:u.bind(null,"Asset",!0)};function r(t,r){return e.call("openDialog",t,n(r))}function o(r){if(r=n(r),(r=i.__assign(i.__assign({},r),{id:r.id||t.extension})).id)return e.call("openDialog","extension",r);throw new Error("Extension ID not provided.")}function a(r){if(r=n(r),(r=i.__assign(i.__assign({},r),{id:t.app})).id)return e.call("openDialog","app",r);throw new Error("Not in the app context.")}function u(t,r,o){return(o=n(o)).entityType=t,o.multiple=r,e.call("openDialog","entitySelector",o)}}})),y=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=new u.MemoizedSignal(void 0),r=new u.MemoizedSignal(void 0);return e.addHandler("localeSettingsChanged",(function(e){n.dispatch(e)})),e.addHandler("showDisabledFieldsChanged",(function(e){r.dispatch(e)})),{editorInterface:t,onLocaleSettingsChanged:function(e){return n.attach(e)},onShowDisabledFieldsChanged:function(e){return r.attach(e)}}}})),v=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=new u.Signal;return e.addHandler("navigateSlideIn",(function(e){n.dispatch(e)})),{openEntry:function(t,n){return e.call("navigateToContentEntity",i.__assign(i.__assign({},n),{entityType:"Entry",id:t}))},openNewEntry:function(t,n){return e.call("navigateToContentEntity",i.__assign(i.__assign({},n),{entityType:"Entry",id:null,contentTypeId:t}))},openBulkEditor:function(t,n){return e.call("navigateToBulkEditor",i.__assign({entryId:t},n))},openAsset:function(t,n){return e.call("navigateToContentEntity",i.__assign(i.__assign({},n),{entityType:"Asset",id:t}))},openNewAsset:function(t){return e.call("navigateToContentEntity",i.__assign(i.__assign({},t),{entityType:"Asset",id:null}))},openPageExtension:function(n){return e.call("navigateToPage",i.__assign({type:"extension",id:t.extension},n))},openCurrentAppPage:function(n){return e.call("navigateToPage",i.__assign({type:"app",id:t.app},n))},onSlideInNavigation:function(e){return n.attach(e)}}}})),g=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="preInstall",r="postInstall",o=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},i=function(e){return"function"==typeof e},a=function(e){return console.error(e),Promise.resolve(!1)},u=function(e,t,n){if(!i(e))return Promise.resolve(t);var r;try{r=void 0===n?e():e(n)}catch(e){return a(e)}var u,l=r;return o(u=l)&&i(u.then)||(l=Promise.resolve(l)),l.then((function(e){return e instanceof Error?Promise.reject(e):!1!==e&&(o(e)?e:t)}),a).catch(a)};t.default=function(e){var t,o=((t={}).preInstall=null,t.postInstall=null,t),a=function(e,t){if(!i(t))throw new Error("Handler must be a function.");o[e]=t};return e.addHandler("appHook",(function(t){var i=t.stage,a=t.installationRequestId,l=t.err;return i===n?u(o[i],{}).then((function(t){return e.send("appHookResult",{stage:i,installationRequestId:a,result:t})})):i===r?u(o[i],void 0,l||null).then((function(){return e.send("appHookResult",{stage:i,installationRequestId:a})})):Promise.resolve()})),{setReady:function(){return e.call("callAppMethod","setReady")},isInstalled:function(){return e.call("callAppMethod","isInstalled")},getParameters:function(){return e.call("callAppMethod","getParameters")},getCurrentState:function(){return e.call("callAppMethod","getCurrentState")},onConfigure:function(e){a(n,e)},onConfigurationCompleted:function(e){a(r,e)}}}})),m=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.default={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"}})),b=a((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0});var r=i.__importDefault(f),o=i.__importDefault(c),a=i.__importDefault(d),u=i.__importDefault(p),l=i.__importDefault(_),s=i.__importDefault(h),b=i.__importDefault(y),E=i.__importDefault(v),w=i.__importDefault(g),O=i.__importDefault(m),A=[C,T,function(e,t){var n=t.field;return{field:new o.default(e,n)}},P,S],I=((n={})[O.default.LOCATION_ENTRY_FIELD]=A,n[O.default.LOCATION_ENTRY_FIELD_SIDEBAR]=A,n[O.default.LOCATION_ENTRY_SIDEBAR]=[C,T,P,S],n[O.default.LOCATION_ENTRY_EDITOR]=[C,T,P],n[O.default.LOCATION_DIALOG]=[C,function(e){return{close:function(t){return e.send("closeDialog",t)}}},S],n[O.default.LOCATION_PAGE]=[C],n[O.default.LOCATION_APP_CONFIG]=[C,function(e){return{app:w.default(e)}}],n);function C(e,t){var n=t.user,r=t.parameters,o=t.locales,i=t.ids,a=t.initialContentTypes,u=t.location||O.default.LOCATION_ENTRY_FIELD;return{location:{is:function(e){return u===e}},user:n,parameters:r,locales:{available:o.available,default:o.default,names:o.names,fallbacks:o.fallbacks,optional:o.optional,direction:o.direction},space:l.default(e,a),dialogs:s.default(e,i),navigator:E.default(e,i),notifier:{success:function(t){return e.send("notify",{type:"success",message:t})},error:function(t){return e.send("notify",{type:"error",message:t})}},ids:i,access:{can:function(t,n){return e.call("checkAccess",t,n)}}}}function S(e,t,n){return{window:a.default(n,e)}}function P(e,t){var n=t.editorInterface;return{editor:b.default(e,n)}}function T(e,t){var n=t.locales,o=t.contentType,i=t.entry,a=t.fieldInfo;return{contentType:o,entry:u.default(e,i,a,(function(t){return new r.default(e,t,n.default)}))}}t.default=function(e,t,n){return(I[t.location]||A).reduce((function(r,o){return i.__assign(i.__assign({},r),o(e,t,n))}),{})}})),E=i.__importDefault(s),w=i.__importDefault(b),O=i.__importDefault(m);return{init:E.default(window,w.default),locations:O.default}})); |
{ | ||
"name": "contentful-ui-extensions-sdk", | ||
"description": "SDK to develop custom UI Extension for the Contentful Web App", | ||
"version": "3.20.0", | ||
"version": "3.21.0", | ||
"author": "Contentful GmbH", | ||
@@ -18,4 +18,4 @@ "license": "MIT", | ||
"lint:fix": "eslint --fix lib/ test/", | ||
"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", | ||
"build": "npm run typings && rollup -c --compact", | ||
"build:debug": "npm run build -- --sourcemap", | ||
"typings": "tsc -b typings.tsconfig.json && mv lib/types.d.ts typings.d.ts && cat module-declaration.d.ts >> typings.d.ts", | ||
@@ -36,2 +36,5 @@ "prepublishOnly": "npm run build", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^15.0.0", | ||
"@rollup/plugin-node-resolve": "^9.0.0", | ||
"@rollup/plugin-typescript": "^5.0.2", | ||
"@testing-library/cypress": "5.3.0", | ||
@@ -71,4 +74,5 @@ "@testing-library/dom": "6.12.2", | ||
"nanoid": "2.1.8", | ||
"parcel-bundler": "^1.12.4", | ||
"prettier": "1.17.1", | ||
"rollup": "^2.26.6", | ||
"rollup-plugin-terser": "^7.0.0", | ||
"sinon": "^7.5.0", | ||
@@ -75,0 +79,0 @@ "sinon-chai": "^3.5.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
66391
1
1
45
1183