New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@agility/app-sdk

Package Overview
Dependencies
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agility/app-sdk - npm Package Compare versions

Comparing version

to
0.0.6

2

dist/agility-cms-app-sdk.browser.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("agilityAppSDK",[],t):"object"==typeof exports?exports.agilityAppSDK=t():e.agilityAppSDK=t()}("undefined"!=typeof self?self:this,(function(){return(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.d(t,{default:()=>h});var n={};e.r(n),e.d(n,{closeFlyout:()=>f,openFlyout:()=>l,subscribeToFieldValueChanges:()=>d,updateFieldValue:()=>c});var o={};e.r(o),e.d(o,{initializeAppConfig:()=>w,initializeField:()=>y,locations:()=>a,resolveAppComponent:()=>O});const a={APP_LOCATION_CUSTOM_FIELD:"CustomField",APP_LOCATION_FLYOUT:"Flyout",APP_LOCATION_UNKNOWN:"Unknown",APP_LOCATION_APP_CONFIG:"AppConfig"};var i=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(window.location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},r=function(e){return e.location+"_"+e.fieldName+"_"+e.fieldID},s=function(e){var t=e.containerRef,n=e.messageID;setInterval((function(){!function(e){var t=e.height,n=e.messageID;window.parent&&window.parent.postMessage({message:t,type:"setHeight_for_".concat(n)},"*")}({height:t.current?t.current.offsetHeight:t.offsetHeight,messageID:n})}),500)},c=function(e){var t=e.fieldName,n=e.fieldValue,o=r({location:this.location,fieldName:this.fieldName,fieldID:this.fieldID});t||(t=this.fieldName),window.parent?window.parent.postMessage({message:{fieldName:t,fieldValue:n},type:"setNewValue_for_".concat(o)},"*"):console.log("".concat(o," => 😞 Can't post message to parent."))},l=function(e){var t=e.title,n=e.size,o=e.name,i=e.onClose,s=e.params,c=r({location:a.APP_LOCATION_CUSTOM_FIELD,fieldID:this.fieldID,fieldName:this.fieldName});window.parent&&(window.parent.postMessage({message:{title:t,size:n,name:o,params:s},type:"openFlyout_for_".concat(c)},"*"),window.addEventListener("message",(function e(t){t.data.type==="closeFlyoutCallback_for_".concat(c)&&i(t.data.message),window.removeEventListener("message",e,!1)}),!1))},f=function(e){var t=e.params,n=a.APP_LOCATION_CUSTOM_FIELD,o=r({location:n,fieldID:this.fieldID,fieldName:this.fieldName});window.parent&&window.parent.postMessage({message:{location:n,fieldName:this.fieldName,fieldID:this.fieldID,params:t},type:"closeFlyout_for_".concat(o)},"*")},d=function(e){var t=e.fieldName,n=e.onChange,o=r({fieldID:this.fieldID,fieldName:this.fieldName,location:this.location});window.addEventListener("message",(function(e){e.data.type==="otherValueChanged_".concat(t,"_for_").concat(o)&&n(e.data.message)}),!1),window.parent?window.parent.postMessage({message:t,type:"subscribeToOtherValueChanges_".concat(o)},"*"):console.log("".concat(o," => 😞 Parent window not found. You must load this within Agility CMS as an iFrame."))};function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t,n,o,a,i,r){try{var s=e[i](r),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(o,a)}var w=function(e){window.parent&&window.parent.postMessage({message:e,type:"setAppConfig_for_".concat(e.name)},"*")},y=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.containerRef,e.abrupt("return",new Promise((function(e){var t=i("fieldID"),a=i("fieldName"),c=i("location"),l=r({location:c,fieldName:a,fieldID:t});s({containerRef:o,messageID:l}),console.log("".concat(l," => Waiting for message from Agility CMS")),window.addEventListener("message",(function(t){if(t.data.type==="setInitialProps_for_".concat(l)){console.log("".concat(l," => auth, fieldValue received from Agility CMS, setting up field..."));var o=t.data.message;o.location=c,e(new function(){return p(p({},o),n)})}else console.log("".concat(l," => IGNORING MESSAGE FROM PARENT: "),t.data)}),!1),window.parent?(console.log("".concat(l," => 😀 Notifying Agility CMS this field is ready to receive messages...")),window.parent.postMessage({message:"ready",type:"ready_for_".concat(l)},"*")):console.log("".concat(l," => 😞 Parent window not found. You must load this within Agility CMS as an iFrame."))})));case 2:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(o,a){var i=e.apply(t,n);function r(e){g(i,o,a,r,s,"next",e)}function s(e){g(i,o,a,r,s,"throw",e)}r(void 0)}))});return function(e){return t.apply(this,arguments)}}(),O=function(e){var t=_(),n=e.appComponents.find((function(e){return e.location===t.location&&(!t.name||e.name===t.name)}));if(n)return n.componentToRender;console.error("Could not render the '"+e.name+"' component for '"+t.location+"' with the name of '"+t.name+"'")},_=function(){var e=i("location");return e===a.APP_LOCATION_CUSTOM_FIELD?{location:e,name:i("fieldTypeName")}:e===a.APP_LOCATION_APP_CONFIG?{location:e}:e===a.APP_LOCATION_FLYOUT?{location:e,name:i("flyoutName")}:{location:a.APP_LOCATION_UNKNOWN,name:null}};const h=o;return t.default})()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("agilityAppSDK",[],t):"object"==typeof exports?exports.agilityAppSDK=t():e.agilityAppSDK=t()}("undefined"!=typeof self?self:this,(function(){return(()=>{var e={907:(e,t,n)=>{"use strict";n.d(t,{default:()=>_});var r={};n.r(r),n.d(r,{closeFlyout:()=>f,openFlyout:()=>u,subscribeToFieldValueChanges:()=>p,updateFieldValue:()=>l});var o={};n.r(o),n.d(o,{initializeAppConfig:()=>m,initializeField:()=>v,locations:()=>i,resolveAppComponent:()=>w});const i={APP_LOCATION_CUSTOM_FIELD:"CustomField",APP_LOCATION_FLYOUT:"Flyout",APP_LOCATION_UNKNOWN:"Unknown",APP_LOCATION_APP_CONFIG:"AppConfig"};var a=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(window.location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},c=function(e){return e.location+"_"+e.fieldName+"_"+e.fieldID},s=function(e){var t=e.containerRef,n=e.messageID;setInterval((function(){!function(e){var t=e.height,n=e.messageID;window.parent&&window.parent.postMessage({message:t,type:"setHeight_for_".concat(n)},"*")}({height:t.current?t.current.offsetHeight:t.offsetHeight,messageID:n})}),500)},l=function(e){var t=e.fieldName,n=e.fieldValue,r=c({location:this.location,fieldName:this.fieldName,fieldID:this.fieldID});t||(t=this.fieldName),window.parent?window.parent.postMessage({message:{fieldName:t,fieldValue:n},type:"setNewValue_for_".concat(r)},"*"):console.log("".concat(r," => 😞 Can't post message to parent."))},u=function(e){var t=e.title,n=e.size,r=e.name,o=e.onClose,a=e.params,s=c({location:i.APP_LOCATION_CUSTOM_FIELD,fieldID:this.fieldID,fieldName:this.fieldName});window.parent&&(window.parent.postMessage({message:{title:t,size:n,name:r,params:a},type:"openFlyout_for_".concat(s)},"*"),window.addEventListener("message",(function e(t){t.data.type==="closeFlyoutCallback_for_".concat(s)&&o(t.data.message),window.removeEventListener("message",e,!1)}),!1))},f=function(e){var t=e.params,n=i.APP_LOCATION_CUSTOM_FIELD,r=c({location:n,fieldID:this.fieldID,fieldName:this.fieldName});window.parent&&window.parent.postMessage({message:{location:n,fieldName:this.fieldName,fieldID:this.fieldID,params:t},type:"closeFlyout_for_".concat(r)},"*")},p=function(e){var t=e.fieldName,n=e.onChange,r=c({fieldID:this.fieldID,fieldName:this.fieldName,location:this.location});window.addEventListener("message",(function(e){e.data.type==="otherValueChanged_".concat(t,"_for_").concat(r)&&n(e.data.message)}),!1),window.parent?window.parent.postMessage({message:t,type:"subscribeToOtherValueChanges_".concat(r)},"*"):console.log("".concat(r," => 😞 Parent window not found. You must load this within Agility CMS as an iFrame."))};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}n(666);var m=function(e){window.parent&&window.parent.postMessage({message:e,type:"setAppConfig_for_".concat(e.name)},"*")},v=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.containerRef,e.abrupt("return",new Promise((function(e){var t=a("fieldID"),o=a("fieldName"),i=a("location"),l=c({location:i,fieldName:o,fieldID:t});s({containerRef:n,messageID:l}),console.log("".concat(l," => Waiting for message from Agility CMS")),window.addEventListener("message",(function(t){if(t.data.type==="setInitialProps_for_".concat(l)){console.log("".concat(l," => auth, fieldValue received from Agility CMS, setting up field..."));var n=t.data.message;n.location=i,e(new function(){return d(d({},n),r)})}else console.log("".concat(l," => IGNORING MESSAGE FROM PARENT: "),t.data)}),!1),window.parent?(console.log("".concat(l," => 😀 Notifying Agility CMS this field is ready to receive messages...")),window.parent.postMessage({message:"ready",type:"ready_for_".concat(l)},"*")):console.log("".concat(l," => 😞 Parent window not found. You must load this within Agility CMS as an iFrame."))})));case 2:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){g(i,r,o,a,c,"next",e)}function c(e){g(i,r,o,a,c,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}(),w=function(e){var t=O(),n=e.appComponents.find((function(e){return e.location===t.location&&(!t.name||e.name===t.name)}));if(n)return n.componentToRender;console.error("Could not render the '"+e.name+"' component for '"+t.location+"' with the name of '"+t.name+"'")},O=function(){var e=a("location");return e===i.APP_LOCATION_CUSTOM_FIELD?{location:e,name:a("fieldTypeName")}:e===i.APP_LOCATION_APP_CONFIG?{location:e}:e===i.APP_LOCATION_FLYOUT?{location:e,name:a("flyoutName")}:{location:i.APP_LOCATION_UNKNOWN,name:null}};const _=o},666:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),a=new A(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===h)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=L(a,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var s=u(e,t,n);if("normal"===s.type){if(r=n.done?d:p,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=d,n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f="suspendedStart",p="suspendedYield",h="executing",d="completed",y={};function g(){}function m(){}function v(){}var w={};s(w,i,(function(){return this}));var O=Object.getPrototypeOf,_=O&&O(O(C([])));_&&_!==n&&r.call(_,i)&&(w=_);var b=v.prototype=g.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(o,i,a,c){var s=u(e[o],e,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function L(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method))return y;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=u(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function C(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:E}}function E(){return{value:t,done:!0}}return m.prototype=v,s(b,"constructor",v),s(v,"constructor",m),m.displayName=s(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,s(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},N(P.prototype),s(P.prototype,a,(function(){return this})),e.AsyncIterator=P,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new P(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(b),s(b,c,"Generator"),s(b,i,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(666);var r=n(907);return r.default})()}));
{
"name": "@agility/app-sdk",
"version": "0.0.5",
"version": "0.0.6",
"description": "JavaScript library for building Agility CMS apps.",

@@ -29,3 +29,5 @@ "main": "src/index.js",

},
"dependencies": {}
"dependencies": {
"regenerator-runtime": "^0.13.9"
}
}
import * as fieldMethods from './fields'
import locations from './locations'
import 'regenerator-runtime/runtime.js'
import { getUrlParameter, getMessageID, autoSyncFieldHeight } from './utils'

@@ -4,0 +5,0 @@

@@ -5,3 +5,3 @@ const path = require('path');

target: 'web',
entry: './src/index.js',
entry: ['regenerator-runtime/runtime.js', './src/index.js'],
output: {

@@ -8,0 +8,0 @@ filename: 'agility-cms-app-sdk.browser.js',