@contentful/app-sdk 4.67.0 → 4.68.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("contentful-management")):"function"==typeof define&&define.amd?define(["exports","contentful-management"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).contentfulExtension={},e.contentfulManagement)}(this,function(e,t){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=n(t),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=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},a.apply(this,arguments)};function s(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})}function u(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function l(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var c=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}(),d=function(e){function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.call(this)||this;if(!t.length)throw new Error("Initial value to be memoized expected");return r._memoizedArgs=t,r}return i(t,e),t.prototype.dispatch=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._memoizedArgs=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._memoizedArgs),n},t.prototype.getMemoizedArgs=function(){return this._memoizedArgs},t}(c);var f,p=function(){function e(e,t){var n=this;this._messageHandlers={},this._responseHandlers={},this._send=function(e,t){return function(n,r){var o=h.getMessageId();try{t.postMessage({source:e,id:o,method:n,params:r},"*")}catch(e){throw e instanceof DOMException&&"DataCloneError"===e.name&&"openDialog"===n&&console.error("Error: openCurrent[App] parameters could not be parsed. You likely tried to pass functions or DOM elements as a parameter. Tip: Use the App SDK directly within the dialog location.\n\nLearn more about the dialog location: https://ctfl.io/app-sdk-dialog"),e}return o}}(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 c),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}(),h=(f=0,{getMessageId:function(){return f++}});var g=function(){function e(e,t){var n=this;this.id=t.id,this.name=t.name,this.locale=t.locale,this.required=t.required,this.validations=t.validations,this._value=t.value,this._valueSignal=new d(this._value),this._isDisabledSignal=new d(t.isDisabled),this._schemaErrorsChangedSignal=new d(t.schemaErrors),this._channel=e,e.addHandler("valueChanged",function(e,t,r){e!==n.id||t&&t!==n.locale||(n._value=r,n._valueSignal.dispatch(r))}),e.addHandler("isDisabledChangedForFieldLocale",function(e,t,r){e===n.id&&t===n.locale&&n._isDisabledSignal.dispatch(r)}),e.addHandler("schemaErrorsChangedForFieldLocale",function(e,t,r){e===n.id&&t===n.locale&&n._schemaErrorsChangedSignal.dispatch(r)})}return e.prototype.getValue=function(){return this._value},e.prototype.setValue=function(e){return s(this,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return this._value=e,[4,this._channel.call("setValue",this.id,this.locale,e)];case 1:return[2,t.sent()]}})})},e.prototype.removeValue=function(){return s(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return this._value=void 0,[4,this._channel.call("removeValue",this.id,this.locale)];case 1:return e.sent(),[2]}})})},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.getIsDisabled=function(){return this._isDisabledSignal.getMemoizedArgs()[0]},e.prototype.onIsDisabledChanged=function(e){return this._isDisabledSignal.attach(e)},e.prototype.getSchemaErrors=function(){return this._schemaErrorsChangedSignal.getMemoizedArgs()[0]},e.prototype.onSchemaErrorsChanged=function(e){return this._schemaErrorsChangedSignal.attach(e)},e}(),y=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type,r}return i(t,e),t}(g),v=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type,r.items=n.items,r}return i(t,e),t}(g),m=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type,r.linkType=n.linkType,r}return i(t,e),t}(g);function E(e,t){switch(t.type){case"Link":return new m(e,t);case"Array":return new v(e,t);default:return new y(e,t)}}var A=function(){function e(e,t,n){var r=this;this.id=t.id,this.name=t.name,this.locales=t.locales,this.required=t.required,this.validations=t.validations,this._defaultLocale=n,this._fieldLocales=t.locales.reduce(function(n,o){var i,s=E(e,r.toFieldInfo(t,o));return a(a({},n),((i={})[o]=s,i))},{}),this.assertHasLocale(n)}return e.prototype.getValue=function(e){return this._getFieldLocale(e).getValue()},e.prototype.setValue=function(e,t){return s(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,this._getFieldLocale(t).setValue(e)];case 1:return[2,n.sent()]}})})},e.prototype.removeValue=function(e){return s(this,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,this.setValue(void 0,e)];case 1:return t.sent(),[2]}})})},e.prototype.onValueChanged=function(e,t){var n=t||e;return t||(e=""),this._getFieldLocale(e).onValueChanged(n)},e.prototype.onIsDisabledChanged=function(e,t){var n=t||e;return t||(e=""),this._getFieldLocale(e).onIsDisabledChanged(n)},e.prototype._getFieldLocale=function(e){return e=e||this._defaultLocale,this.assertHasLocale(e),this._fieldLocales[e]},e.prototype.getForLocale=function(e){if(!e)throw new Error("getForLocale must be passed a locale");return this._getFieldLocale(e)},e.prototype.assertHasLocale=function(e){if(!this._fieldLocales[e])throw new Error('Unknown locale "'.concat(e,'" for field "').concat(this.id,'"'))},e.prototype.toFieldInfo=function(e,t){var n={id:e.id,name:e.name,required:e.required,validations:e.validations,locale:t,value:e.values[t],isDisabled:e.isDisabled[t],schemaErrors:e.schemaErrors[t]};switch(e.type){case"Array":return a(a({},n),{type:e.type,items:e.items});case"Link":return a(a({},n),{type:e.type,linkType:e.linkType});default:return a(a({},n),{type:e.type})}},e}(),b=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.type=n.type,o}return i(t,e),t}(A),C=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.type=n.type,o.items=n.items,o}return i(t,e),t}(A),w=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.type=n.type,o.linkType=n.linkType,o}return i(t,e),t}(A);function _(e,t){var n,r=e.document,o=e.MutationObserver,i=e.ResizeObserver,a=!1,s=!1,u=new Set,l=new o(function(e){!function(e){e.forEach(function(e){switch(e.type){case"attributes":if(e.target.nodeType===Node.ELEMENT_NODE){var t=e.target;f(e.type,t)?u.add(t):u.delete(t)}break;case"childList":e.addedNodes.forEach(function(t){if(t.nodeType===Node.ELEMENT_NODE){var n=t;f(e.type,n)&&u.add(n)}}),e.removedNodes.forEach(function(e){var t=e;u.delete(t)})}})}(e),a&&d.updateHeight()}),c=new i(function(){d.updateHeight()});l.observe(r.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0});var d={startAutoResizer:function(e){var t=void 0===e?{}:e,n=t.absoluteElements;if(s=Boolean(n===void 0?false:n),d.updateHeight(),a)return;a=!0,c.observe(r.body)},stopAutoResizer:function(){if(!a)return;a=!1,c.disconnect()},updateHeight:function(e){void 0===e&&(e=null);if(null===e){var o=Math.ceil(r.documentElement.getBoundingClientRect().height);if(s&&u.size){var i=o;u.forEach(function(e){i=Math.max(e.getBoundingClientRect().bottom,i)}),e=i}else e=o}e!==n&&(t.send("setHeight",e),n=e)}};return d;function f(e,t){var n=getComputedStyle(t);return"absolute"===n.position&&("attributes"!==e||"none"!==n.display)}}var T=["getTask","getTasks","createTask","updateTask","deleteTask"];function I(e,t,n,r){var o=t.sys,i=x(o),s=new d(o),u=t.metadata,l=new d(u);e.addHandler("sysChanged",function(e){i=x(o=e),s.dispatch(o)}),e.addHandler("metadataChanged",function(e){u=e,l.dispatch(u)});var c={};return T.forEach(function(t){c[t]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.call("callEntryMethod",t,n)}}),a(a(a({getSys:function(){return o},publish:function(t){if(i)throw new Error('SDK method "publish" is not supported in release context');return e.call("callEntryMethod","publish",[t])},unpublish:function(){if(i)throw new Error('SDK method "unpublish" is not supported in release context');return e.call("callEntryMethod","unpublish")},save:function(){return e.call("callEntryMethod","save")},onSysChanged:function(e){return s.attach(e)},fields:n.reduce(function(e,t){return e[t.id]=r(t),e},{})},u?{metadata:u}:{}),{getMetadata:function(){return u},onMetadataChanged:function(e){return l.attach(e)}}),c)}function x(e){var t,n;return!!(null===(n=null===(t=null==e?void 0:e.release)||void 0===t?void 0:t.sys)||void 0===n?void 0:n.id)}function O(e,t){if(!t)throw new Error("Asset data is required");var n=t.sys,r=new d(n),o=t.metadata,i=new d(o);return e.addHandler("sysChanged",function(e){n=e,r.dispatch(n)}),e.addHandler("metadataChanged",function(e){o=e,i.dispatch(o)}),{getSys:function(){return n},publish:function(t){return e.call("callAssetMethod","publish",[t])},unpublish:function(){return e.call("callAssetMethod","unpublish")},save:function(){return e.call("callAssetMethod","save")},onSysChanged:function(e){return r.attach(e)},getMetadata:function(){return o},onMetadataChanged:function(e){return i.attach(e)}}}var L=["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","signRequest","createTag","readTags","updateTag","deleteTag","getTeams"];function S(e,t){var n={};return L.forEach(function(t){n[t]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return console.warn("You called ".concat(String(t)," on the Space API. Since version 4.0.0 the Space API and its methods are deprecated, and they will be removed from version 5.0.0 on. We recommend that you use the CMA client instead. See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details.")),e.call("callSpaceMethod",t,n)}}),n.getCachedContentTypes=function(){return l([],t,!0)},n}var D=function(e){return"object"!=typeof(t=e)||null===t||Array.isArray(t)?{}:e;var t};function N(e,t){return{openAlert:n.bind(null,"alert"),openConfirm:n.bind(null,"confirm"),openPrompt:n.bind(null,"prompt"),openExtension:r,openCurrentApp:o,openCurrent:function(e){return t.app?o(e):r(a(a({},e),{id:t.extension}))},selectSingleEntry:i.bind(null,"Entry",!1),selectSingleAsset:i.bind(null,"Asset",!1),selectMultipleEntries:i.bind(null,"Entry",!0),selectMultipleAssets:i.bind(null,"Asset",!0),selectSingleExperience:i.bind(null,"Experience",!1),selectMultipleExperiences:i.bind(null,"Experience",!0),selectSinglePattern:i.bind(null,"Pattern",!1),selectMultiplePatterns:i.bind(null,"Pattern",!0),selectSingleComponentDefinition:i.bind(null,"ComponentDefinition",!1),selectMultipleComponentDefinitions:i.bind(null,"ComponentDefinition",!0),selectSingleResourceEntity:function(e){return s(!1,e)},selectMultipleResourceEntities:function(e){return s(!0,e)}};function n(t,n){return e.call("openDialog",t,D(n))}function r(n){var r=D(n);if((r=a(a({},r),{id:r.id||t.extension})).id)return e.call("openDialog","extension",r);throw new Error("Extension ID not provided.")}function o(n){if(n=D(n),t.app){var r=a(a({},n),{id:t.app});return e.call("openDialog","app",r)}throw new Error("Not in the app context.")}function i(t,n,r){return(r=D(r)).entityType=t,r.multiple=n,e.call("openDialog","entitySelector",r)}function s(t,n){var r=D(n);return r.multiple=t,e.call("openDialog","resourceEntitySelector",r)}}function M(e,t,n){var r=new d(n.localeSettings),o=new d(n.showHiddenFields);return e.addHandler("localeSettingsChanged",function(e){r.dispatch(e)}),e.addHandler("showHiddenFieldsChanged",function(e){o.dispatch(e)}),{editorInterface:t,getLocaleSettings:function(){return r.getMemoizedArgs()[0]},onLocaleSettingsChanged:function(e){return r.attach(e)},onShowDisabledFieldsChanged:function(e){return o.attach(e)},getShowHiddenFields:function(){return o.getMemoizedArgs()[0]},onShowHiddenFieldsChanged:function(e){return o.attach(e)}}}function P(e,t,n){var r,o=new c;e.addHandler("navigateSlideIn",function(e){o.dispatch(e)});var i=n?null===(r=n.sys)||void 0===r?void 0:r.id:void 0;return{openEntry:function(t,n){return e.call("navigateToContentEntity",a(a({},n),{entityType:"Entry",id:t,releaseId:i}))},openNewEntry:function(t,n){return e.call("navigateToContentEntity",a(a({},n),{entityType:"Entry",id:null,contentTypeId:t}))},openBulkEditor:function(t,n){return e.call("navigateToBulkEditor",a({entryId:t},n))},openAsset:function(t,n){return e.call("navigateToContentEntity",a(a({},n),{entityType:"Asset",id:t,releaseId:i}))},openNewAsset:function(t){return e.call("navigateToContentEntity",a(a({},t),{entityType:"Asset",id:null}))},openPageExtension:function(n){return e.call("navigateToPage",a({type:"extension",id:t.extension},n))},openCurrentAppPage:function(n){return e.call("navigateToPage",a({type:"app",id:t.app},n))},openAppConfig:function(){return e.call("navigateToAppConfig")},openEntriesList:function(){return e.call("navigateToSpaceEnvRoute",{route:"entries",releaseId:i})},openAssetsList:function(){return e.call("navigateToSpaceEnvRoute",{route:"assets",releaseId:i})},openExperience:function(t){return e.call("navigateToExperience",{id:t,releaseId:i})},openComponent:function(t){return e.call("navigateToComponent",{id:t})},onSlideInNavigation:function(e){return o.attach(e)}}}var H="preInstall",R="postInstall",k=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},F=function(e){return"function"==typeof e},V=function(e){return console.error(e),Promise.resolve(!1)},z=function(e,t,n){if(!F(e))return Promise.resolve(t);var r;try{r=void 0===n?e():e(n)}catch(e){return V(e)}var o,i=r;return k(o=i)&&F(o.then)||(i=Promise.resolve(i)),i.then(function(e){return e instanceof Error?Promise.reject(e):!1!==e&&(k(e)?e:t)},V).catch(V)};function j(e){var t,n=((t={})[H]=null,t[R]=null,t),r=function(e,t){if(!F(t))throw new Error("Handler must be a function.");n[e]=t};return e.addHandler("appHook",function(t){var r=t.stage,o=t.installationRequestId,i=t.err;return r===H?z(n[r],{}).then(function(t){return e.send("appHookResult",{stage:r,installationRequestId:o,result:t})}):r===R?z(n[r],void 0,i||null).then(function(){return e.send("appHookResult",{stage:r,installationRequestId:o})}):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){r(H,e)},onConfigurationCompleted:function(e){r(R,e)}}}function q(e,t){if(!t)throw new Error("Context data is required");var n=new d(t),r=new c,o=new d("normal");return e.addHandler("contextChanged",function(e){n.dispatch(e)}),e.addHandler("toolbarAction",function(e){r.dispatch(e)}),e.addHandler("agentLayoutVariantChanged",function(e){o.dispatch(e)}),{onContextChange:function(e){return n.attach(e)},onToolbarAction:function(e){return r.attach(e)},onAgentLayoutVariantChange:function(e){return o.attach(e)},setAgentLayoutVariant:function(t){if("expanded"!==t&&"normal"!==t)throw new Error('Invalid layout variant "'.concat(t,'". Expected "expanded" or "normal".'));e.send("setAgentLayoutVariant",t)}}}function B(e,t){var n;if(void 0===t)throw new Error("Context data is required");var r=null!==(n=t.context)&&void 0!==n?n:{type:"experience",entityId:""},o=new d(r);e.addHandler("exo.contextChanged",function(e){o.dispatch(e)});var i=function(e,t){var n=new d(null!=t?t:{sys:{id:"",type:"Experience",version:0,template:{sys:{type:"ResourceLink",linkType:"Contentful:Template",urn:""}}}});e.addHandler("exo.experienceChanged",function(e){n.dispatch(e)});var r=function(e){var t=new d({nodeId:null});return e.addHandler("exo.selectionChanged",function(e){t.dispatch(e)}),{get:function(){return t.getMemoizedArgs()[0]},onChange:function(e){return t.attach(e)},set:function(t){e.send("exo.setSelection",{nodeId:t})},highlight:function(t,n){e.send("exo.highlightNode",a({nodeId:t},n))}}}(e),o=function(e){var t={id:"",parameters:{}},n=new d(t);return e.addHandler("exo.dataAssemblyChanged",function(e){n.dispatch(e)}),a(a({get:function(){return n.getMemoizedArgs()[0]},getAvailable:function(){return e.call("exo.getAvailableDataAssemblies")}},Y(e,G)),{onChange:function(e){return n.attach(e)}})}(e),i=new Map;function s(t,n){var r=i.get(t);if(void 0!==r&&(void 0===n||n===r.nodeType))return r;var o=function(e,t,n){void 0===n&&(n="Component");var r=new d({id:t,nodeType:n});return e.addHandler("exo.nodeChanged.".concat(t),function(e){r.dispatch(e)}),{id:t,nodeType:n,get:function(){return r.getMemoizedArgs()[0]},onChange:function(e){return r.attach(e)},dataAssembly:Y(e,K,t),getDesignProperty:function(n){return e.call("exo.getNodeDesignProperty",t,n)},setDesignProperty:function(n,r){return e.call("exo.setNodeDesignProperty",t,n,r)},onDesignPropertyChanged:function(n,r){return e.addHandler("exo.nodeDesignPropertyChanged.".concat(t,".").concat(n),r)},getProperties:function(){return e.call("exo.getNodeProperties",t)},getSlotDescriptor:function(){return e.call("exo.getNodeSlotDescriptor",t)}}}(e,t,n);return i.set(t,o),o}return{get:function(){return n.getMemoizedArgs()[0]},onChange:function(e){return n.attach(e)},getMetadata:function(){return n.getMemoizedArgs()[0].metadata},setMetadata:function(t){return e.call("exo.setExperienceMetadata",t)},onMetadataChanged:function(e){var t,r=!1;return n.attach(function(n){var o=JSON.stringify(n.metadata);r&&o===t||(r=!0,t=o,e(n.metadata))})},save:function(){return e.call("exo.saveExperience")},publish:function(){return e.call("exo.publishExperience")},getNode:function(e){return s(e)},getRootNodes:function(){return e.call("exo.getRootNodes").then(function(e){return e.map(function(e){return s(e.id,e.nodeType)})})},selection:r,dataAssembly:o}}(e,t.experience);return{get context(){return o.getMemoizedArgs()[0]},onContextChanged:function(e){return o.attach(e)},experience:i}}function Y(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return{getParameterDefinitions:function(){return e.call.apply(e,l([t.definitions],n,!1))},getParameterDefinition:function(r){return e.call.apply(e,l(l([t.definition],n,!1),[r],!1))},setParameterValue:function(r,o){return e.call.apply(e,l(l([t.setValue],n,!1),[r,o],!1))},setParameterValues:function(r){return e.call.apply(e,l(l([t.setValues],n,!1),[r],!1))}}}var G={definitions:"exo.getDataAssemblyParameterDefinitions",definition:"exo.getDataAssemblyParameterDefinition",setValue:"exo.setDataAssemblyParameterValue",setValues:"exo.setDataAssemblyParameterValues"},K={definitions:"exo.getNodeParameterDefinitions",definition:"exo.getNodeParameterDefinition",setValue:"exo.setNodeParameterValue",setValues:"exo.setNodeParameterValues"};var U,W={LOCATION_ENTRY_FIELD:"entry-field",LOCATION_ENTRY_FIELD_SIDEBAR:"entry-field-sidebar",LOCATION_ENTRY_SIDEBAR:"entry-sidebar",LOCATION_ASSET_SIDEBAR:"asset-sidebar",LOCATION_DIALOG:"dialog",LOCATION_ENTRY_EDITOR:"entry-editor",LOCATION_PAGE:"page",LOCATION_APP_CONFIG:"app-config",LOCATION_HOME:"home",LOCATION_AGENT:"agent",LOCATION_EXPERIENCE_TOOLBAR:"experience-toolbar"},X=function(e){return function(t){return e.call("CMAAdapterCall",t)}};function J(e){return{makeRequest:X(e)}}function Q(e,t){var n;return function(e){var t,n,r=null!==(t=e.createClient)&&void 0!==t?t:null===(n=e.default)||void 0===n?void 0:n.createClient;if("function"!=typeof r)throw new TypeError("Could not resolve `createClient` from 'contentful-management'. This usually means an incompatible or duplicate version was bundled. Ensure a single contentful-management copy resolves in your app.");return r}(r)({apiAdapter:J(t)},{type:"plain",defaults:{environmentId:null!==(n=e.environmentAlias)&&void 0!==n?n:e.environment,spaceId:e.space,organizationId:e.organization,releaseId:e.release}})}var Z=[ee,re,function(e,t){var n=t.field;if(!n)throw new Error('FieldAPI called for location without "field" property defined.');return{field:E(e,n)}},ne,te],$=((U={})[W.LOCATION_ENTRY_FIELD]=Z,U[W.LOCATION_ENTRY_FIELD_SIDEBAR]=Z,U[W.LOCATION_ENTRY_SIDEBAR]=[ee,re,ne,te],U[W.LOCATION_ASSET_SIDEBAR]=[ee,function(e,t){var n=t.asset;return{asset:O(e,n)}},te],U[W.LOCATION_ENTRY_EDITOR]=[ee,re,ne],U[W.LOCATION_DIALOG]=[ee,function(e){return{close:function(t){return e.send("closeDialog",t)}}},te],U[W.LOCATION_PAGE]=[ee],U[W.LOCATION_HOME]=[ee],U[W.LOCATION_APP_CONFIG]=[ee,function(e){return{app:j(e)}}],U[W.LOCATION_AGENT]=[ee,function(e,t){var n=t.agent;return{agent:q(e,n)}},te],U[W.LOCATION_EXPERIENCE_TOOLBAR]=[ee,function(e,t){return{experiences:B(e,t.experiences)}},te],U);function ee(e,t){var n=t.user,r=t.parameters,o=t.locales,i=t.ids,a=t.initialContentTypes,s=t.hostnames,u=t.release,l=t.uiLanguageLocale,c=t.location||W.LOCATION_ENTRY_FIELD;return{cma:Q(i,e),cmaAdapter:J(e),location:{is:function(e){return c===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:S(e,a),dialogs:N(e,i),navigator:P(e,i,u),notifier:{success:function(t){return e.send("notify",{type:"success",message:t})},error:function(t){return e.send("notify",{type:"error",message:t})},warning:function(t){return e.send("notify",{type:"warning",message:t})}},ids:i,hostnames:s,release:u,uiLanguageLocale:l,access:{can:function(t,n,r){return e.call("checkAccess",t,n,r)},canEditAppConfig:function(){return e.call("checkAppConfigAccess")}}}}function te(e,t,n){return{window:_(n,e)}}function ne(e,t){return{editor:M(e,t.editorInterface,t.editor)}}function re(e,t){var n=t.locales,r=t.contentType,o=t.entry,i=t.fieldInfo;return{contentType:r,entry:I(e,o,i,function(t){return function(e,t,n){switch(t.type){case"Array":return new C(e,t,n);case"Link":return new w(e,t,n);default:return new b(e,t,n)}}(e,t,n.default)})}}var oe=function(e,t){if(void 0===e.window||void 0===e.document)return function(){};var n,r,o=((n={promise:null,resolve:null,isFulfilled:!1}).promise=new Promise(function(e){n.resolve=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];n.isFulfilled=!0,e.apply(void 0,t)}}),n);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)}),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(n,r){var o=new p(n.id,e);t(o,n,r)})}(e,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.resolve(e)}),function(n,i){var a=void 0===i?{supressIframeWarning:!1}:i,s=a.makeCustomApi;a.supressIframeWarning||function(e){e.self===e.top&&console.error("Cannot use App SDK outside of Contenful:\n\nIn order for the App SDK to function correctly, your app needs to be run in an iframe in the Contentful Web App, Compose or Launch.\n\nLearn more about local development with the App SDK here:\nhttps://www.contentful.com/developers/docs/extensibility/ui-extensions/faq/#how-can-i-develop-with-the-ui-extension-sdk-locally")}(e),r||(r=o.promise.then(function(n){var r,o=n[0],i=n[1],a=n[2],u=t(o,i,e);return"function"==typeof s&&(r=s(o,i)),a.forEach(function(e){o._handleMessage(e)}),[u,r]}),o.isFulfilled||function(e){var t=h.getMessageId();e.parent.postMessage({id:t,method:"init",params:[]},"*")}(e)),r.then(function(e){var t=e[0],r=e[1];return n(t,r)})}}(globalThis,function(e,t,n){return($[t.location]||Z).reduce(function(r,o){return a(a({},r),o(e,t,n))},{})});e.init=oe,e.locations=W,Object.defineProperty(e,"__esModule",{value:!0})}),globalThis.contentfulApp=globalThis.contentfulExtension;
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("contentful-management")):"function"==typeof define&&define.amd?define(["exports","contentful-management"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).contentfulExtension={},e.contentfulManagement)}(this,function(e,t){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=n(t),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=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},a.apply(this,arguments)};function s(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 s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function l(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function u(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var c=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}(),d=function(e){function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.call(this)||this;if(!t.length)throw new Error("Initial value to be memoized expected");return r._memoizedArgs=t,r}return i(t,e),t.prototype.dispatch=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._memoizedArgs=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._memoizedArgs),n},t.prototype.getMemoizedArgs=function(){return this._memoizedArgs},t}(c);var f,p=function(){function e(e,t){var n=this;this._messageHandlers={},this._responseHandlers={},this._send=function(e,t){return function(n,r){var o=h.getMessageId();try{t.postMessage({source:e,id:o,method:n,params:r},"*")}catch(e){throw e instanceof DOMException&&"DataCloneError"===e.name&&"openDialog"===n&&console.error("Error: openCurrent[App] parameters could not be parsed. You likely tried to pass functions or DOM elements as a parameter. Tip: Use the App SDK directly within the dialog location.\n\nLearn more about the dialog location: https://ctfl.io/app-sdk-dialog"),e}return o}}(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 c),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}(),h=(f=0,{getMessageId:function(){return f++}});var g=function(){function e(e,t){var n=this;this.id=t.id,this.name=t.name,this.locale=t.locale,this.required=t.required,this.validations=t.validations,this._value=t.value,this._valueSignal=new d(this._value),this._isDisabledSignal=new d(t.isDisabled),this._schemaErrorsChangedSignal=new d(t.schemaErrors),this._channel=e,e.addHandler("valueChanged",function(e,t,r){e!==n.id||t&&t!==n.locale||(n._value=r,n._valueSignal.dispatch(r))}),e.addHandler("isDisabledChangedForFieldLocale",function(e,t,r){e===n.id&&t===n.locale&&n._isDisabledSignal.dispatch(r)}),e.addHandler("schemaErrorsChangedForFieldLocale",function(e,t,r){e===n.id&&t===n.locale&&n._schemaErrorsChangedSignal.dispatch(r)})}return e.prototype.getValue=function(){return this._value},e.prototype.setValue=function(e){return s(this,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return this._value=e,[4,this._channel.call("setValue",this.id,this.locale,e)];case 1:return[2,t.sent()]}})})},e.prototype.removeValue=function(){return s(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return this._value=void 0,[4,this._channel.call("removeValue",this.id,this.locale)];case 1:return e.sent(),[2]}})})},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.getIsDisabled=function(){return this._isDisabledSignal.getMemoizedArgs()[0]},e.prototype.onIsDisabledChanged=function(e){return this._isDisabledSignal.attach(e)},e.prototype.getSchemaErrors=function(){return this._schemaErrorsChangedSignal.getMemoizedArgs()[0]},e.prototype.onSchemaErrorsChanged=function(e){return this._schemaErrorsChangedSignal.attach(e)},e}(),y=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type,r}return i(t,e),t}(g),v=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type,r.items=n.items,r}return i(t,e),t}(g),m=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type,r.linkType=n.linkType,r}return i(t,e),t}(g);function E(e,t){switch(t.type){case"Link":return new m(e,t);case"Array":return new v(e,t);default:return new y(e,t)}}var A=function(){function e(e,t,n){var r=this;this.id=t.id,this.name=t.name,this.locales=t.locales,this.required=t.required,this.validations=t.validations,this._defaultLocale=n,this._fieldLocales=t.locales.reduce(function(n,o){var i,s=E(e,r.toFieldInfo(t,o));return a(a({},n),((i={})[o]=s,i))},{}),this.assertHasLocale(n)}return e.prototype.getValue=function(e){return this._getFieldLocale(e).getValue()},e.prototype.setValue=function(e,t){return s(this,void 0,void 0,function(){return l(this,function(n){switch(n.label){case 0:return[4,this._getFieldLocale(t).setValue(e)];case 1:return[2,n.sent()]}})})},e.prototype.removeValue=function(e){return s(this,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,this.setValue(void 0,e)];case 1:return t.sent(),[2]}})})},e.prototype.onValueChanged=function(e,t){var n=t||e;return t||(e=""),this._getFieldLocale(e).onValueChanged(n)},e.prototype.onIsDisabledChanged=function(e,t){var n=t||e;return t||(e=""),this._getFieldLocale(e).onIsDisabledChanged(n)},e.prototype._getFieldLocale=function(e){return e=e||this._defaultLocale,this.assertHasLocale(e),this._fieldLocales[e]},e.prototype.getForLocale=function(e){if(!e)throw new Error("getForLocale must be passed a locale");return this._getFieldLocale(e)},e.prototype.assertHasLocale=function(e){if(!this._fieldLocales[e])throw new Error('Unknown locale "'.concat(e,'" for field "').concat(this.id,'"'))},e.prototype.toFieldInfo=function(e,t){var n={id:e.id,name:e.name,required:e.required,validations:e.validations,locale:t,value:e.values[t],isDisabled:e.isDisabled[t],schemaErrors:e.schemaErrors[t]};switch(e.type){case"Array":return a(a({},n),{type:e.type,items:e.items});case"Link":return a(a({},n),{type:e.type,linkType:e.linkType});default:return a(a({},n),{type:e.type})}},e}(),b=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.type=n.type,o}return i(t,e),t}(A),C=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.type=n.type,o.items=n.items,o}return i(t,e),t}(A),w=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.type=n.type,o.linkType=n.linkType,o}return i(t,e),t}(A);function _(e,t){var n,r=e.document,o=e.MutationObserver,i=e.ResizeObserver,a=!1,s=!1,l=new Set,u=new o(function(e){!function(e){e.forEach(function(e){switch(e.type){case"attributes":if(e.target.nodeType===Node.ELEMENT_NODE){var t=e.target;f(e.type,t)?l.add(t):l.delete(t)}break;case"childList":e.addedNodes.forEach(function(t){if(t.nodeType===Node.ELEMENT_NODE){var n=t;f(e.type,n)&&l.add(n)}}),e.removedNodes.forEach(function(e){var t=e;l.delete(t)})}})}(e),a&&d.updateHeight()}),c=new i(function(){d.updateHeight()});u.observe(r.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0});var d={startAutoResizer:function(e){var t=void 0===e?{}:e,n=t.absoluteElements;if(s=Boolean(n===void 0?false:n),d.updateHeight(),a)return;a=!0,c.observe(r.body)},stopAutoResizer:function(){if(!a)return;a=!1,c.disconnect()},updateHeight:function(e){void 0===e&&(e=null);if(null===e){var o=Math.ceil(r.documentElement.getBoundingClientRect().height);if(s&&l.size){var i=o;l.forEach(function(e){i=Math.max(e.getBoundingClientRect().bottom,i)}),e=i}else e=o}e!==n&&(t.send("setHeight",e),n=e)}};return d;function f(e,t){var n=getComputedStyle(t);return"absolute"===n.position&&("attributes"!==e||"none"!==n.display)}}var T=["getTask","getTasks","createTask","updateTask","deleteTask"];function I(e,t,n,r){var o=t.sys,i=x(o),s=new d(o),l=t.metadata,u=new d(l);e.addHandler("sysChanged",function(e){i=x(o=e),s.dispatch(o)}),e.addHandler("metadataChanged",function(e){l=e,u.dispatch(l)});var c={};return T.forEach(function(t){c[t]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.call("callEntryMethod",t,n)}}),a(a(a({getSys:function(){return o},publish:function(t){if(i)throw new Error('SDK method "publish" is not supported in release context');return e.call("callEntryMethod","publish",[t])},unpublish:function(){if(i)throw new Error('SDK method "unpublish" is not supported in release context');return e.call("callEntryMethod","unpublish")},save:function(){return e.call("callEntryMethod","save")},onSysChanged:function(e){return s.attach(e)},fields:n.reduce(function(e,t){return e[t.id]=r(t),e},{})},l?{metadata:l}:{}),{getMetadata:function(){return l},onMetadataChanged:function(e){return u.attach(e)}}),c)}function x(e){var t,n;return!!(null===(n=null===(t=null==e?void 0:e.release)||void 0===t?void 0:t.sys)||void 0===n?void 0:n.id)}function O(e,t){if(!t)throw new Error("Asset data is required");var n=t.sys,r=new d(n),o=t.metadata,i=new d(o);return e.addHandler("sysChanged",function(e){n=e,r.dispatch(n)}),e.addHandler("metadataChanged",function(e){o=e,i.dispatch(o)}),{getSys:function(){return n},publish:function(t){return e.call("callAssetMethod","publish",[t])},unpublish:function(){return e.call("callAssetMethod","unpublish")},save:function(){return e.call("callAssetMethod","save")},onSysChanged:function(e){return r.attach(e)},getMetadata:function(){return o},onMetadataChanged:function(e){return i.attach(e)}}}var L=["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","signRequest","createTag","readTags","updateTag","deleteTag","getTeams"];function S(e,t){var n={};return L.forEach(function(t){n[t]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return console.warn("You called ".concat(String(t)," on the Space API. Since version 4.0.0 the Space API and its methods are deprecated, and they will be removed from version 5.0.0 on. We recommend that you use the CMA client instead. See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details.")),e.call("callSpaceMethod",t,n)}}),n.getCachedContentTypes=function(){return u([],t,!0)},n}var D=function(e){return"object"!=typeof(t=e)||null===t||Array.isArray(t)?{}:e;var t};function N(e,t){return{openAlert:n.bind(null,"alert"),openConfirm:n.bind(null,"confirm"),openPrompt:n.bind(null,"prompt"),openExtension:r,openCurrentApp:o,openCurrent:function(e){return t.app?o(e):r(a(a({},e),{id:t.extension}))},selectSingleEntry:i.bind(null,"Entry",!1),selectSingleAsset:i.bind(null,"Asset",!1),selectMultipleEntries:i.bind(null,"Entry",!0),selectMultipleAssets:i.bind(null,"Asset",!0),selectSingleExperience:i.bind(null,"Experience",!1),selectMultipleExperiences:i.bind(null,"Experience",!0),selectSinglePattern:i.bind(null,"Pattern",!1),selectMultiplePatterns:i.bind(null,"Pattern",!0),selectSingleComponentDefinition:i.bind(null,"ComponentDefinition",!1),selectMultipleComponentDefinitions:i.bind(null,"ComponentDefinition",!0),selectSingleResourceEntity:function(e){return s(!1,e)},selectMultipleResourceEntities:function(e){return s(!0,e)}};function n(t,n){return e.call("openDialog",t,D(n))}function r(n){var r=D(n);if((r=a(a({},r),{id:r.id||t.extension})).id)return e.call("openDialog","extension",r);throw new Error("Extension ID not provided.")}function o(n){if(n=D(n),t.app){var r=a(a({},n),{id:t.app});return e.call("openDialog","app",r)}throw new Error("Not in the app context.")}function i(t,n,r){return(r=D(r)).entityType=t,r.multiple=n,e.call("openDialog","entitySelector",r)}function s(t,n){var r=D(n);return r.multiple=t,e.call("openDialog","resourceEntitySelector",r)}}function M(e,t,n){var r=new d(n.localeSettings),o=new d(n.showHiddenFields);return e.addHandler("localeSettingsChanged",function(e){r.dispatch(e)}),e.addHandler("showHiddenFieldsChanged",function(e){o.dispatch(e)}),{editorInterface:t,getLocaleSettings:function(){return r.getMemoizedArgs()[0]},onLocaleSettingsChanged:function(e){return r.attach(e)},onShowDisabledFieldsChanged:function(e){return o.attach(e)},getShowHiddenFields:function(){return o.getMemoizedArgs()[0]},onShowHiddenFieldsChanged:function(e){return o.attach(e)}}}function P(e,t,n){var r,o=new c;e.addHandler("navigateSlideIn",function(e){o.dispatch(e)});var i=n?null===(r=n.sys)||void 0===r?void 0:r.id:void 0;return{openEntry:function(t,n){return e.call("navigateToContentEntity",a(a({},n),{entityType:"Entry",id:t,releaseId:i}))},openNewEntry:function(t,n){return e.call("navigateToContentEntity",a(a({},n),{entityType:"Entry",id:null,contentTypeId:t}))},openBulkEditor:function(t,n){return e.call("navigateToBulkEditor",a({entryId:t},n))},openAsset:function(t,n){return e.call("navigateToContentEntity",a(a({},n),{entityType:"Asset",id:t,releaseId:i}))},openNewAsset:function(t){return e.call("navigateToContentEntity",a(a({},t),{entityType:"Asset",id:null}))},openPageExtension:function(n){return e.call("navigateToPage",a({type:"extension",id:t.extension},n))},openCurrentAppPage:function(n){return e.call("navigateToPage",a({type:"app",id:t.app},n))},openAppConfig:function(){return e.call("navigateToAppConfig")},openEntriesList:function(){return e.call("navigateToSpaceEnvRoute",{route:"entries",releaseId:i})},openAssetsList:function(){return e.call("navigateToSpaceEnvRoute",{route:"assets",releaseId:i})},openExperience:function(t){return e.call("navigateToExperience",{id:t,releaseId:i})},openComponent:function(t){return e.call("navigateToComponent",{id:t})},onSlideInNavigation:function(e){return o.attach(e)}}}var H="preInstall",R="postInstall",k=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},F=function(e){return"function"==typeof e},V=function(e){return console.error(e),Promise.resolve(!1)},z=function(e,t,n){if(!F(e))return Promise.resolve(t);var r;try{r=void 0===n?e():e(n)}catch(e){return V(e)}var o,i=r;return k(o=i)&&F(o.then)||(i=Promise.resolve(i)),i.then(function(e){return e instanceof Error?Promise.reject(e):!1!==e&&(k(e)?e:t)},V).catch(V)};function j(e){var t,n=((t={})[H]=null,t[R]=null,t),r=function(e,t){if(!F(t))throw new Error("Handler must be a function.");n[e]=t};return e.addHandler("appHook",function(t){var r=t.stage,o=t.installationRequestId,i=t.err;return r===H?z(n[r],{}).then(function(t){return e.send("appHookResult",{stage:r,installationRequestId:o,result:t})}):r===R?z(n[r],void 0,i||null).then(function(){return e.send("appHookResult",{stage:r,installationRequestId:o})}):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){r(H,e)},onConfigurationCompleted:function(e){r(R,e)}}}function q(e,t){if(!t)throw new Error("Context data is required");var n=new d(t),r=new c,o=new d("normal");return e.addHandler("contextChanged",function(e){n.dispatch(e)}),e.addHandler("toolbarAction",function(e){r.dispatch(e)}),e.addHandler("agentLayoutVariantChanged",function(e){o.dispatch(e)}),{onContextChange:function(e){return n.attach(e)},onToolbarAction:function(e){return r.attach(e)},onAgentLayoutVariantChange:function(e){return o.attach(e)},setAgentLayoutVariant:function(t){if("expanded"!==t&&"normal"!==t)throw new Error('Invalid layout variant "'.concat(t,'". Expected "expanded" or "normal".'));e.send("setAgentLayoutVariant",t)}}}function B(e,t){var n;if(void 0===t)throw new Error("Context data is required");var r=null!==(n=t.context)&&void 0!==n?n:{type:"experience",entityId:""},o=new d(r);e.addHandler("exo.contextChanged",function(e){o.dispatch(e)});var i=function(e,t){var n=new d(null!=t?t:{sys:{id:"",type:"Experience",version:0,template:{sys:{type:"ResourceLink",linkType:"Contentful:Template",urn:""}}}});e.addHandler("exo.experienceChanged",function(e){n.dispatch(e)});var r=function(e){var t=new d({nodeId:null});return e.addHandler("exo.selectionChanged",function(e){t.dispatch(e)}),{get:function(){return t.getMemoizedArgs()[0]},onChange:function(e){return t.attach(e)},set:function(t){e.send("exo.setSelection",{nodeId:t})},highlight:function(t,n){e.send("exo.highlightNode",a({nodeId:t},n))}}}(e),o=function(e){var t={id:"",parameters:{}},n=new d(t);return e.addHandler("exo.dataAssemblyChanged",function(e){n.dispatch(e)}),a(a({get:function(){return n.getMemoizedArgs()[0]},getAvailable:function(){return e.call("exo.getAvailableDataAssemblies")}},Y(e,G)),{onChange:function(e){return n.attach(e)}})}(e),i=new Map;function s(t,n){var r=i.get(t);if(void 0!==r&&(void 0===n||n===r.nodeType))return r;var o=function(e,t,n){void 0===n&&(n="Component");var r=new d({id:t,nodeType:n});return e.addHandler("exo.nodeChanged.".concat(t),function(e){r.dispatch(e)}),{id:t,nodeType:n,get:function(){return r.getMemoizedArgs()[0]},onChange:function(e){return r.attach(e)},dataAssembly:Y(e,K,t),getDesignProperty:function(n){return e.call("exo.getNodeDesignProperty",t,n)},setDesignProperty:function(n,r){return e.call("exo.setNodeDesignProperty",t,n,r)},onDesignPropertyChanged:function(n,r){return e.addHandler("exo.nodeDesignPropertyChanged.".concat(t,".").concat(n),r)},getProperties:function(){return e.call("exo.getNodeProperties",t)},getSlotDescriptor:function(){return e.call("exo.getNodeSlotDescriptor",t)}}}(e,t,n);return i.set(t,o),o}return{get:function(){return n.getMemoizedArgs()[0]},onChange:function(e){return n.attach(e)},getMetadata:function(){return n.getMemoizedArgs()[0].metadata},setMetadata:function(t){return e.call("exo.setExperienceMetadata",t)},onMetadataChanged:function(e){var t,r=!1;return n.attach(function(n){var o=JSON.stringify(n.metadata);r&&o===t||(r=!0,t=o,e(n.metadata))})},save:function(){return e.call("exo.saveExperience")},publish:function(){return e.call("exo.publishExperience")},getNode:function(e){return s(e)},getRootNodes:function(){return e.call("exo.getRootNodes").then(function(e){return e.map(function(e){return s(e.id,e.nodeType)})})},selection:r,dataAssembly:o}}(e,t.experience);return{get context(){return o.getMemoizedArgs()[0]},onContextChanged:function(e){return o.attach(e)},experience:i}}function Y(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return{getParameterDefinitions:function(){return e.call.apply(e,u([t.definitions],n,!1))},getParameterDefinition:function(r){return e.call.apply(e,u(u([t.definition],n,!1),[r],!1))},setParameterValue:function(r,o){return e.call.apply(e,u(u([t.setValue],n,!1),[r,o],!1))},setParameterValues:function(r){return e.call.apply(e,u(u([t.setValues],n,!1),[r],!1))}}}var G={definitions:"exo.getDataAssemblyParameterDefinitions",definition:"exo.getDataAssemblyParameterDefinition",setValue:"exo.setDataAssemblyParameterValue",setValues:"exo.setDataAssemblyParameterValues"},K={definitions:"exo.getNodeParameterDefinitions",definition:"exo.getNodeParameterDefinition",setValue:"exo.setNodeParameterValue",setValues:"exo.setNodeParameterValues"};var U,W={LOCATION_ENTRY_FIELD:"entry-field",LOCATION_ENTRY_FIELD_SIDEBAR:"entry-field-sidebar",LOCATION_ENTRY_SIDEBAR:"entry-sidebar",LOCATION_ASSET_SIDEBAR:"asset-sidebar",LOCATION_DIALOG:"dialog",LOCATION_ENTRY_EDITOR:"entry-editor",LOCATION_PAGE:"page",LOCATION_APP_CONFIG:"app-config",LOCATION_HOME:"home",LOCATION_AGENT:"agent",LOCATION_EXPERIENCE_TOOLBAR:"experience-toolbar"},X=function(e){return function(t){return e.call("CMAAdapterCall",t)}};function J(e){return{makeRequest:X(e)}}function Q(e,t){var n;return function(e){var t,n,r=null!==(t=e.createClient)&&void 0!==t?t:null===(n=e.default)||void 0===n?void 0:n.createClient;if("function"!=typeof r){var o=null==e?String(e):typeof e;throw new TypeError("Could not resolve `createClient` from 'contentful-management' (resolved to a ".concat(o,"). ")+"Ensure your bundler bundles contentful-management as a module — some bundlers emit its `.cjs` entry as a static asset; excluding `.cjs` from asset/file loaders resolves this.")}return r}(r)({apiAdapter:J(t)},{type:"plain",defaults:{environmentId:null!==(n=e.environmentAlias)&&void 0!==n?n:e.environment,spaceId:e.space,organizationId:e.organization,releaseId:e.release}})}var Z=[ee,re,function(e,t){var n=t.field;if(!n)throw new Error('FieldAPI called for location without "field" property defined.');return{field:E(e,n)}},ne,te],$=((U={})[W.LOCATION_ENTRY_FIELD]=Z,U[W.LOCATION_ENTRY_FIELD_SIDEBAR]=Z,U[W.LOCATION_ENTRY_SIDEBAR]=[ee,re,ne,te],U[W.LOCATION_ASSET_SIDEBAR]=[ee,function(e,t){var n=t.asset;return{asset:O(e,n)}},te],U[W.LOCATION_ENTRY_EDITOR]=[ee,re,ne],U[W.LOCATION_DIALOG]=[ee,function(e){return{close:function(t){return e.send("closeDialog",t)}}},te],U[W.LOCATION_PAGE]=[ee],U[W.LOCATION_HOME]=[ee],U[W.LOCATION_APP_CONFIG]=[ee,function(e){return{app:j(e)}}],U[W.LOCATION_AGENT]=[ee,function(e,t){var n=t.agent;return{agent:q(e,n)}},te],U[W.LOCATION_EXPERIENCE_TOOLBAR]=[ee,function(e,t){return{experiences:B(e,t.experiences)}},te],U);function ee(e,t){var n=t.user,r=t.parameters,o=t.locales,i=t.ids,a=t.initialContentTypes,s=t.hostnames,l=t.release,u=t.uiLanguageLocale,c=t.location||W.LOCATION_ENTRY_FIELD;return{cma:Q(i,e),cmaAdapter:J(e),location:{is:function(e){return c===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:S(e,a),dialogs:N(e,i),navigator:P(e,i,l),notifier:{success:function(t){return e.send("notify",{type:"success",message:t})},error:function(t){return e.send("notify",{type:"error",message:t})},warning:function(t){return e.send("notify",{type:"warning",message:t})}},ids:i,hostnames:s,release:l,uiLanguageLocale:u,access:{can:function(t,n,r){return e.call("checkAccess",t,n,r)},canEditAppConfig:function(){return e.call("checkAppConfigAccess")}}}}function te(e,t,n){return{window:_(n,e)}}function ne(e,t){return{editor:M(e,t.editorInterface,t.editor)}}function re(e,t){var n=t.locales,r=t.contentType,o=t.entry,i=t.fieldInfo;return{contentType:r,entry:I(e,o,i,function(t){return function(e,t,n){switch(t.type){case"Array":return new C(e,t,n);case"Link":return new w(e,t,n);default:return new b(e,t,n)}}(e,t,n.default)})}}var oe=function(e,t){if(void 0===e.window||void 0===e.document)return function(){};var n,r,o=((n={promise:null,resolve:null,isFulfilled:!1}).promise=new Promise(function(e){n.resolve=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];n.isFulfilled=!0,e.apply(void 0,t)}}),n);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)}),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(n,r){var o=new p(n.id,e);t(o,n,r)})}(e,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.resolve(e)}),function(n,i){var a=void 0===i?{supressIframeWarning:!1}:i,s=a.makeCustomApi;a.supressIframeWarning||function(e){e.self===e.top&&console.error("Cannot use App SDK outside of Contenful:\n\nIn order for the App SDK to function correctly, your app needs to be run in an iframe in the Contentful Web App, Compose or Launch.\n\nLearn more about local development with the App SDK here:\nhttps://www.contentful.com/developers/docs/extensibility/ui-extensions/faq/#how-can-i-develop-with-the-ui-extension-sdk-locally")}(e),r||(r=o.promise.then(function(n){var r,o=n[0],i=n[1],a=n[2],l=t(o,i,e);return"function"==typeof s&&(r=s(o,i)),a.forEach(function(e){o._handleMessage(e)}),[l,r]}),o.isFulfilled||function(e){var t=h.getMessageId();e.parent.postMessage({id:t,method:"init",params:[]},"*")}(e)),r.then(function(e){var t=e[0],r=e[1];return n(t,r)})}}(globalThis,function(e,t,n){return($[t.location]||Z).reduce(function(r,o){return a(a({},r),o(e,t,n))},{})});e.init=oe,e.locations=W,Object.defineProperty(e,"__esModule",{value:!0})}),globalThis.contentfulApp=globalThis.contentfulExtension;
@@ -4,7 +4,7 @@ import { ExperienceSDK, ExperienceContext, ExperienceSnapshot } from './types';
4
4
  * Creates the Experience SDK namespace for the experience-toolbar location.
5
5
  *
6
6
  * Throws when called without handshake `experiences` data, mirroring `createAgent`. This keeps the
7
- * public `ExperienceEditorToolbarAppSDK['experiences']` type sound (non-optional, always present).
7
+ * public `ExperienceCanvasToolbarAppSDK['experiences']` type sound (non-optional, always present).
8
8
  */
9
9
  export default function createExperience(channel: Channel, experienceInit?: {
10
10
  context?: ExperienceContext;
@@ -262,14 +262,14 @@ export type AgentAppSDK<InstallationParameters extends KeyValueMap = KeyValueMap
262
262
  /** Methods to update the size of the iframe the app is contained within. */
263
263
  window: WindowAPI;
264
264
  };
265
- export type ExperienceEditorToolbarAppSDK<InstallationParameters extends KeyValueMap = KeyValueMap> = Omit<BaseAppSDK<InstallationParameters, never, never>, 'ids'> & {
265
+ export type ExperienceCanvasToolbarAppSDK<InstallationParameters extends KeyValueMap = KeyValueMap> = Omit<BaseAppSDK<InstallationParameters, never, never>, 'ids'> & {
266
266
  ids: Omit<IdsAPI, EntryScopedIds>;
267
267
  /** Experience SDK for experience-toolbar location */
268
268
  experiences: ExperienceSDK;
269
269
  /** Methods to update the size of the iframe the app is contained within. */
270
270
  window: WindowAPI;
271
271
  };
272
- export type KnownAppSDK<InstallationParameters extends KeyValueMap = KeyValueMap, InstanceParameters extends KeyValueMap = KeyValueMap, InvocationParameters extends SerializedJSONValue = SerializedJSONValue> = FieldAppSDK<InstallationParameters, InstanceParameters> | SidebarAppSDK<InstallationParameters, InstanceParameters> | DialogAppSDK<InstallationParameters, InvocationParameters> | EditorAppSDK<InstallationParameters, InstanceParameters> | PageAppSDK<InstallationParameters> | ConfigAppSDK<InstallationParameters> | HomeAppSDK<InstallationParameters> | AgentAppSDK<InstallationParameters> | ExperienceEditorToolbarAppSDK<InstallationParameters>;
272
+ export type KnownAppSDK<InstallationParameters extends KeyValueMap = KeyValueMap, InstanceParameters extends KeyValueMap = KeyValueMap, InvocationParameters extends SerializedJSONValue = SerializedJSONValue> = FieldAppSDK<InstallationParameters, InstanceParameters> | SidebarAppSDK<InstallationParameters, InstanceParameters> | DialogAppSDK<InstallationParameters, InvocationParameters> | EditorAppSDK<InstallationParameters, InstanceParameters> | PageAppSDK<InstallationParameters> | ConfigAppSDK<InstallationParameters> | HomeAppSDK<InstallationParameters> | AgentAppSDK<InstallationParameters> | ExperienceCanvasToolbarAppSDK<InstallationParameters>;
273
273
  /** @deprecated consider using {@link BaseAppSDK} */
274
274
  export type BaseExtensionSDK = BaseAppSDK;
275
275
  /** @deprecated consider using {@link EditorAppSDK} */
@@ -38,7 +38,7 @@ export interface ComponentPropertyDescriptor<C = unknown, D extends DesignValue
38
38
  export type SameSpaceContentSource = 'crn:contentful:::content:spaces/$self/environments/$self';
39
39
  /**
40
40
  * A reference to a Contentful resource, addressed by `urn`. `linkType` is a `Contentful:`-prefixed
41
- * resource type (e.g. `'Contentful:Template'`).
41
+ * resource type (e.g. `'Contentful:Template'` / its canonical `'Contentful:ExperienceTemplate'`).
42
42
  */
43
43
  export interface ResourceLink<T extends string = string> {
44
44
  sys: {
@@ -105,15 +105,22 @@ export interface DataAssemblyAPI extends DataAssemblyParameterAPI {
105
105
  /** Subscribes to Data Assembly snapshot changes. Returns an unsubscribe function. */
106
106
  onChange(cb: (snapshot: DataAssemblySnapshot) => void): Unsubscribe;
107
107
  }
108
- /** The type of a node within an experience/fragment tree. */
109
- export type ExperienceNodeType = 'Component' | 'Fragment' | 'InlineFragment' | 'Slot';
108
+ /**
109
+ * The type of a node within an experience/fragment tree. Accepts both the current
110
+ * (`Fragment`/`InlineFragment`) and upcoming canonical (`ExperienceFragment`/`InlineExperienceFragment`)
111
+ * vocabulary — the same node entity, named differently across the ExO data-model transition.
112
+ */
113
+ export type ExperienceNodeType = 'Component' | 'Fragment' | 'ExperienceFragment' | 'InlineFragment' | 'InlineExperienceFragment' | 'Slot';
110
114
  export interface ExperienceNodeSnapshot {
111
115
  id: string;
112
116
  nodeType: ExperienceNodeType;
113
117
  }
114
- /** One allowed resource for a slot: the Component(s) that may be placed in it. */
118
+ /**
119
+ * One allowed resource for a slot: the Component(s) that may be placed in it. `type` accepts both
120
+ * the current (`Contentful:ComponentType`) and upcoming canonical (`Contentful:Component`) URN.
121
+ */
115
122
  export interface SlotAllowedResource {
116
- type: 'Contentful:ComponentType';
123
+ type: 'Contentful:ComponentType' | 'Contentful:Component';
117
124
  source: string;
118
125
  allowedTypes: string[];
119
126
  }
@@ -122,7 +129,7 @@ export interface SlotDescriptor {
122
129
  allowedResources: SlotAllowedResource[];
123
130
  currentItems: Array<{
124
131
  nodeId: string;
125
- nodeType: 'Fragment' | 'InlineFragment';
132
+ nodeType: 'Fragment' | 'ExperienceFragment' | 'InlineFragment' | 'InlineExperienceFragment';
126
133
  }>;
127
134
  }
128
135
  /**
@@ -182,10 +189,13 @@ export interface ExperienceMetadata {
182
189
  name?: string;
183
190
  }
184
191
  /**
185
- * Snapshot of the root entity being edited. Discriminated on `sys.type`:
186
- * an `Experience` (optionally backed by a template) or a `Fragment` (no template).
187
- * `Experience.sys.template` is optional, and `Fragment.sys` carries a `componentType`
188
- * ResourceLink and no template.
192
+ * Snapshot of the root entity being edited, discriminated on `sys.type`. Three arms:
193
+ * an `Experience` (optionally backed by a template) plus two shapes of the same fragment
194
+ * entity — `Fragment` (current vocabulary: `sys.componentType`, `Contentful:ComponentType`)
195
+ * and `ExperienceFragment` (upcoming canonical vocabulary: `sys.component`, `Contentful:Component`).
196
+ * `Fragment` and `ExperienceFragment` are the same entity in legacy vs canonical shape; both are
197
+ * accepted so apps stay forward-compatible across the ExO data-model transition. The `Experience`
198
+ * arm carries an optional `template`/`experienceTemplate` (an experience may be un-templated).
189
199
  */
190
200
  export type ExperienceSnapshot = {
191
201
  sys: {
@@ -193,6 +203,7 @@ export type ExperienceSnapshot = {
193
203
  type: 'Experience';
194
204
  version: number;
195
205
  template?: ResourceLink<'Contentful:Template'>;
206
+ experienceTemplate?: ResourceLink<'Contentful:ExperienceTemplate'>;
196
207
  };
197
208
  metadata?: ExperienceMetadata;
198
209
  } | {
@@ -203,6 +214,14 @@ export type ExperienceSnapshot = {
203
214
  componentType: ResourceLink<'Contentful:ComponentType'>;
204
215
  };
205
216
  metadata?: ExperienceMetadata;
217
+ } | {
218
+ sys: {
219
+ id: string;
220
+ type: 'ExperienceFragment';
221
+ version: number;
222
+ component: ResourceLink<'Contentful:Component'>;
223
+ };
224
+ metadata?: ExperienceMetadata;
206
225
  };
207
226
  export interface ExperienceAPI {
208
227
  get(): ExperienceSnapshot;
@@ -226,7 +245,7 @@ export interface ExperienceAPI {
226
245
  dataAssembly: DataAssemblyAPI;
227
246
  }
228
247
  export interface ExperienceContext {
229
- type: 'experience' | 'fragment';
248
+ type: 'experience' | 'fragment' | 'experienceFragment';
230
249
  entityId: string;
231
250
  }
232
251
  export interface ExperienceSDK {
@@ -1,4 +1,8 @@
1
- export type { AppExtensionSDK, BaseExtensionSDK, DialogExtensionSDK, EditorExtensionSDK, FieldExtensionSDK, HomeExtensionSDK, KnownSDK, PageExtensionSDK, SidebarExtensionSDK, ConfigAppSDK, BaseAppSDK, DialogAppSDK, EditorAppSDK, FieldAppSDK, HomeAppSDK, KnownAppSDK, PageAppSDK, SidebarAppSDK, AccessAPI, ArchiveableAction, ConnectMessage, ContentTypeAPI, CrudAction, EditorLocaleSettings, IdsAPI, LocalesAPI, LocationAPI, Locations, NotifierAPI, ParametersAPI, PublishableAction, SharedEditorSDK, UserAPI, JSONPatchItem, HostnamesAPI, AgentAppSDK, ExperienceEditorToolbarAppSDK, } from './api.types';
1
+ import type { KeyValueMap } from 'contentful-management';
2
+ import type { ExperienceCanvasToolbarAppSDK } from './api.types';
3
+ export type { AppExtensionSDK, BaseExtensionSDK, DialogExtensionSDK, EditorExtensionSDK, FieldExtensionSDK, HomeExtensionSDK, KnownSDK, PageExtensionSDK, SidebarExtensionSDK, ConfigAppSDK, BaseAppSDK, DialogAppSDK, EditorAppSDK, FieldAppSDK, HomeAppSDK, KnownAppSDK, PageAppSDK, SidebarAppSDK, AccessAPI, ArchiveableAction, ConnectMessage, ContentTypeAPI, CrudAction, EditorLocaleSettings, IdsAPI, LocalesAPI, LocationAPI, Locations, NotifierAPI, ParametersAPI, PublishableAction, SharedEditorSDK, UserAPI, JSONPatchItem, HostnamesAPI, AgentAppSDK, ExperienceCanvasToolbarAppSDK, } from './api.types';
4
+ /** @deprecated Renamed to ExperienceCanvasToolbarAppSDK. Alias kept for the internal migration window; will be removed. */
5
+ export type ExperienceEditorToolbarAppSDK<InstallationParameters extends KeyValueMap = KeyValueMap> = ExperienceCanvasToolbarAppSDK<InstallationParameters>;
2
6
  export type { AgentAPI, AgentContext, LayoutVariant, ToolbarAction, ToolbarActionName, } from './agent.types';
3
7
  export type { AppConfigAPI, AppState, OnConfigureHandler, OnConfigureHandlerReturn, } from './app.types';
4
8
  export type { DialogsAPI, EntityDialogOptions, OpenAlertOptions, OpenConfirmOptions, OpenCustomWidgetOptions, RecommendationsOptions, CrossSpaceAllowedResource, ResourceEntitySelectorOptions, } from './dialogs.types';
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@contentful/app-sdk","description":"A JavaScript library to develop custom apps for Contentful","version":"4.67.0","author":"Contentful GmbH","license":"MIT","sideEffects":true,"repository":{"url":"https://github.com/contentful/ui-extensions-sdk.git","type":"git"},"homepage":"https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/","main":"dist/cf-extension-api.js","unpkg":"dist/cf-extension-api.bundled.js","jsdelivr":"dist/cf-extension-api.bundled.js","types":"dist/index.d.ts","files":["dist/cf-extension-api.js","dist/cf-extension-api.js.map","dist/cf-extension-api.bundled.js","dist/cf-extension.css","dist/**/*.d.ts"],"scripts":{"test":"ts-mocha -p tsconfig.test.json 'test/unit/*.[jt]s' --reporter mocha-multi-reporters --reporter-options configFile=mocha.unit-reporters.json","lint":"eslint '{lib,test}/**/*.{t,j}s'","lint:fix":"npm run lint -- --fix","build":"npm run check-types && rollup -c --compact","build:debug":"npm run build -- --sourcemap","prepublishOnly":"npm run build","size":"echo \"Gzipped, estimate: $(gzip -9 -c dist/cf-extension-api.js | wc -c) bytes\"","semantic-release":"semantic-release","publish-all":"node ./scripts/publish.js","verify":"node ./scripts/verify.js","check-types":"tsc --noEmit -m commonjs","prepare":"husky","lint-staged":"lint-staged"},"dependencies":{"contentful-management":"^12.3.1"},"devDependencies":{"@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.0","@semantic-release/changelog":"6.0.3","@semantic-release/exec":"7.1.0","@semantic-release/git":"10.0.1","@testing-library/dom":"10.4.1","@types/chai-as-promised":"7.1.8","@types/cross-spawn":"6.0.6","@types/fs-extra":"11.0.4","@types/jsdom":"28.0.3","@types/mocha":"10.0.10","@types/nanoid":"3.0.0","@types/sinon":"^21.0.0","@types/sinon-chai":"^3.2.5","@typescript-eslint/eslint-plugin":"7.18.0","@typescript-eslint/parser":"7.18.0","babel-eslint":"10.1.0","chai":"4.5.0","chai-as-promised":"7.1.2","cross-spawn":"7.0.6","eslint":"8.57.1","eslint-config-prettier":"10.1.8","eslint-config-standard":"17.1.0","eslint-plugin-import":"2.32.0","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"5.5.6","eslint-plugin-promise":"6.6.0","eslint-plugin-react":"7.37.5","eslint-plugin-standard":"5.0.0","fs-extra":"11.3.5","husky":"9.1.7","jsdom":"29.1.1","lint-staged":"17.0.8","mocha":"11.7.6","mocha-junit-reporter":"2.2.1","mocha-multi-reporters":"1.5.1","mochawesome":"7.1.4","mochawesome-merge":"5.1.1","mochawesome-report-generator":"6.3.2","prettier":"3.8.4","rollup":"2.80.0","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.37.0","semantic-release":"^25.0.2","sinon":"22.0.0","sinon-chai":"3.7.0","ts-mocha":"11.1.0","tslib":"2.8.1","typescript":"5.9.3"},"lint-staged":{"*.ts":["prettier --write","eslint --fix"],"*.md":["prettier --write"]},"release":{"branches":["main",{"name":"canary","channel":"canary","prerelease":"alpha"}],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog",["@semantic-release/npm",{"npmPublish":false}],["@semantic-release/exec",{"verifyConditionsCmd":"node ./scripts/verify.js","publishCmd":"npm run publish-all"}],["@semantic-release/git",{"message":"chore: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}","assets":["CHANGELOG.md","package.json","package-lock.json"]}],"@semantic-release/github"]}}
1
+ {"name":"@contentful/app-sdk","description":"A JavaScript library to develop custom apps for Contentful","version":"4.68.1","author":"Contentful GmbH","license":"MIT","sideEffects":true,"repository":{"url":"https://github.com/contentful/ui-extensions-sdk.git","type":"git"},"homepage":"https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/","main":"dist/cf-extension-api.js","unpkg":"dist/cf-extension-api.bundled.js","jsdelivr":"dist/cf-extension-api.bundled.js","types":"dist/index.d.ts","files":["dist/cf-extension-api.js","dist/cf-extension-api.js.map","dist/cf-extension-api.bundled.js","dist/cf-extension.css","dist/**/*.d.ts"],"scripts":{"test":"ts-mocha -p tsconfig.test.json 'test/unit/*.[jt]s' --reporter mocha-multi-reporters --reporter-options configFile=mocha.unit-reporters.json","lint":"eslint '{lib,test}/**/*.{t,j}s'","lint:fix":"npm run lint -- --fix","build":"npm run check-types && rollup -c --compact","build:debug":"npm run build -- --sourcemap","prepublishOnly":"npm run build","size":"echo \"Gzipped, estimate: $(gzip -9 -c dist/cf-extension-api.js | wc -c) bytes\"","semantic-release":"semantic-release","publish-all":"node ./scripts/publish.js","verify":"node ./scripts/verify.js","check-types":"tsc --noEmit -m commonjs","prepare":"husky","lint-staged":"lint-staged"},"dependencies":{"contentful-management":"^12.3.1"},"devDependencies":{"@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.0","@semantic-release/changelog":"6.0.3","@semantic-release/exec":"7.1.0","@semantic-release/git":"10.0.1","@testing-library/dom":"10.4.1","@types/chai-as-promised":"7.1.8","@types/cross-spawn":"6.0.6","@types/fs-extra":"11.0.4","@types/jsdom":"28.0.3","@types/mocha":"10.0.10","@types/nanoid":"3.0.0","@types/sinon":"^21.0.0","@types/sinon-chai":"^3.2.5","@typescript-eslint/eslint-plugin":"7.18.0","@typescript-eslint/parser":"7.18.0","babel-eslint":"10.1.0","chai":"4.5.0","chai-as-promised":"7.1.2","cross-spawn":"7.0.6","eslint":"8.57.1","eslint-config-prettier":"10.1.8","eslint-config-standard":"17.1.0","eslint-plugin-import":"2.32.0","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"5.5.6","eslint-plugin-promise":"6.6.0","eslint-plugin-react":"7.37.5","eslint-plugin-standard":"5.0.0","fs-extra":"11.3.5","husky":"9.1.7","jsdom":"29.1.1","lint-staged":"17.0.8","mocha":"11.7.6","mocha-junit-reporter":"2.2.1","mocha-multi-reporters":"1.5.1","mochawesome":"7.1.4","mochawesome-merge":"5.1.1","mochawesome-report-generator":"6.3.2","prettier":"3.8.4","rollup":"2.80.0","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.37.0","semantic-release":"^25.0.2","sinon":"22.0.0","sinon-chai":"3.7.0","ts-mocha":"11.1.0","tslib":"2.8.1","typescript":"5.9.3"},"lint-staged":{"*.ts":["prettier --write","eslint --fix"],"*.md":["prettier --write"]},"release":{"branches":["main",{"name":"canary","channel":"canary","prerelease":"alpha"}],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog",["@semantic-release/npm",{"npmPublish":false}],["@semantic-release/exec",{"verifyConditionsCmd":"node ./scripts/verify.js","publishCmd":"npm run publish-all"}],["@semantic-release/git",{"message":"chore: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}","assets":["CHANGELOG.md","package.json","package-lock.json"]}],"@semantic-release/github"]}}