Socket
Socket
Sign inDemoInstall

@lrnwebcomponents/hax-body-behaviors

Package Overview
Dependencies
Maintainers
4
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lrnwebcomponents/hax-body-behaviors - npm Package Compare versions

Comparing version 2.7.10 to 2.8.0

58

analysis.json

@@ -11,7 +11,7 @@ {

"start": {
"line": 774,
"line": 779,
"column": 26
},
"end": {
"line": 891,
"line": 896,
"column": 1

@@ -40,3 +40,3 @@ }

"end": {
"line": 769,
"line": 774,
"column": 1

@@ -60,7 +60,7 @@ }

"start": {
"line": 795,
"line": 800,
"column": 4
},
"end": {
"line": 812,
"line": 817,
"column": 5

@@ -90,7 +90,7 @@ }

"start": {
"line": 816,
"line": 821,
"column": 4
},
"end": {
"line": 824,
"line": 829,
"column": 5

@@ -111,7 +111,7 @@ }

"start": {
"line": 830,
"line": 835,
"column": 4
},
"end": {
"line": 832,
"line": 837,
"column": 5

@@ -141,7 +141,7 @@ }

"start": {
"line": 836,
"line": 841,
"column": 4
},
"end": {
"line": 838,
"line": 843,
"column": 5

@@ -163,7 +163,7 @@ }

"start": {
"line": 842,
"line": 847,
"column": 4
},
"end": {
"line": 844,
"line": 849,
"column": 5

@@ -185,7 +185,7 @@ }

"start": {
"line": 848,
"line": 853,
"column": 4
},
"end": {
"line": 850,
"line": 855,
"column": 5

@@ -203,7 +203,7 @@ }

"start": {
"line": 856,
"line": 861,
"column": 4
},
"end": {
"line": 858,
"line": 863,
"column": 5

@@ -232,7 +232,7 @@ }

"start": {
"line": 862,
"line": 867,
"column": 4
},
"end": {
"line": 864,
"line": 869,
"column": 5

@@ -254,7 +254,7 @@ }

"start": {
"line": 869,
"line": 874,
"column": 4
},
"end": {
"line": 871,
"line": 876,
"column": 5

@@ -276,7 +276,7 @@ }

"start": {
"line": 875,
"line": 880,
"column": 4
},
"end": {
"line": 877,
"line": 882,
"column": 5

@@ -298,7 +298,7 @@ }

"start": {
"line": 881,
"line": 886,
"column": 4
},
"end": {
"line": 883,
"line": 888,
"column": 5

@@ -316,7 +316,7 @@ }

"start": {
"line": 887,
"line": 892,
"column": 4
},
"end": {
"line": 889,
"line": 894,
"column": 5

@@ -334,7 +334,7 @@ }

"start": {
"line": 775,
"line": 780,
"column": 9
},
"end": {
"line": 890,
"line": 895,
"column": 3

@@ -341,0 +341,0 @@ }

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@lrnwebcomponents/simple-fields/simple-fields.js"),require("@lrnwebcomponents/hax-body/lib/hax-upload-field.js")):"function"==typeof define&&define.amd?define(["exports","@lrnwebcomponents/simple-fields/simple-fields.js","@lrnwebcomponents/hax-body/lib/hax-upload-field.js"],t):t((e=e||self).HaxBodyBehaviors={},e.simpleFields_js)}(this,function(e,t){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?a(Object(i),!0).forEach(function(t){r(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=d(e);if(t){var o=d(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return u(this,i)}}function p(e,t,i){return(p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i):o.value}})(e,t,i||e)}f={alt:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,required:!0}}},color:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"color"}}},colorpicker:{defaultSettings:{element:"simple-colors-picker",attributes:{autofocus:!0}}},date:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"date"}}},"date-time":{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"datetime-local"}}}},r(f,"date",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"date"}}}),r(f,"email",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"email"}}}),r(f,"fileupload",{defaultSettings:{element:"hax-upload-field",noWrap:!0,attributes:{autofocus:!0},properties:{accepts:"accepts"}}}),r(f,"iconpicker",{defaultSettings:{element:"simple-icon-picker",attributes:{autofocus:!0}}}),r(f,"month",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"month"}}}),r(f,"textarea",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"textarea"}}}),r(f,"time",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"time"}}}),r(f,"uri",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"file"},properties:{accepts:"accepts"}}});var f,h=function e(){var o=this;n(this,e),this.haxProperties={canScale:!1,canPosition:!1,canEditSource:!1,settings:{quick:[],configure:[],advanced:[]},wipeSlot:{}},this.pathFromUrl=function(e){return e.substring(0,e.lastIndexOf("/")+1)},this.setup=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;return"undefined"!==i(o.tagName)&&(t=o.tagName.toLowerCase()),window.addEventListener("hax-store-ready",o._haxStoreReady.bind(o)),"undefined"!==i(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.ready?o.setHaxProperties(e,t,n,!0):o.setHaxProperties(e,t,n,!1)},this._haxStoreReady=function(e){if(e.detail&&"undefined"!==i(o.tagName)&&"undefined"!==i(o.haxProperties)){var t=o.tagName,n=o.haxProperties,r=o;if(""!=t&&"undefined"===i(window.HaxStore)){var a=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:t.toLowerCase(),properties:n,polymer:!1}});r.dispatchEvent(a)}else if(""!=t&&"undefined"===i(window.HaxStore.instance.elementList[t.toLowerCase()])){var s=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:t.toLowerCase(),properties:n}});r.dispatchEvent(s)}else if("undefined"!==i(o.tagName)&&"undefined"===i(window.HaxStore.instance.elementList[o.tagName.toLowerCase()])){var d=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:o.tagName.toLowerCase(),properties:n}});r.dispatchEvent(d)}}},this.setHaxProperties=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("undefined"===i(e.api)&&(e.api="1"),"1"==e.api){if("undefined"===i(e.canPosition)&&(e.canPosition=!0),"undefined"===i(e.canScale)&&(e.canScale=!0),"undefined"===i(e.canEditSource)&&(e.canEditSource=!1),"undefined"===i(e.gizmo))e.gizmo=!1;else if("undefined"!==i(e.gizmo.iconLib)){var a=o.pathFromUrl(decodeURIComponent("undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("hax-body-behaviors.umd.js",document.baseURI).href));import("".concat(a,"../../../").concat(e.gizmo.iconLib))}if("undefined"!==i(e.settings)){"undefined"===i(e.settings.quick)&&(e.settings.quick=[]);for(var s=0;s<e.settings.quick.length;s++)e.settings.quick[s]=o.validateSetting(e.settings.quick[s]),e.settings.quick[s]||e.settings.quick.splice(s,1);"undefined"===i(e.settings.configure)&&(e.settings.configure=[]);for(var d=0;d<e.settings.configure.length;d++)e.settings.configure[d]=o.validateSetting(e.settings.configure[d]),e.settings.configure[d]||e.settings.configure.splice(d,1);"undefined"===i(e.settings.advanced)&&(e.settings.advanced=[]);for(var c=0;c<e.settings.advanced.length;c++)e.settings.advanced[c]=o.validateSetting(e.settings.advanced[c]),e.settings.advanced[c]||e.settings.advanced.splice(c,1);e=o.standardAdvancedProps(e)}"undefined"===i(e.saveOptions)&&(e.saveOptions={wipeSlot:!1}),"undefined"===i(e.demoSchema)&&(e.demoSchema=[]),r&&o.readyToFireHAXSchema(t,e,n),""===t&&("function"==typeof o._setHaxProperties?o._setHaxProperties(e):o.haxProperties=e)}else console.warn("This is't a valid usage of hax API. See hax-body-behaviors/lib/HAXWiring.js for more details on how to implement the API. https://haxtheweb.org/hax-schema for details but we will try and guess the wiring")},this.readyToFireHAXSchema=function(e,t,n){if(""!=e&&"undefined"===i(window.HaxStore)){var r=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t,polymer:!1}});n.dispatchEvent(r)}else if(""!=e){var a=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});n.dispatchEvent(a)}else if("undefined"!==i(o.tagName)){var s=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:o.tagName.toLowerCase(),properties:t}});n.dispatchEvent(s)}else if("undefined"!==i(n.tagName)){var d=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:n.tagName.toLowerCase(),properties:t}});n.dispatchEvent(d)}else console.warn(n),console.warn("".concat(e," missed our checks and has an issue in implementation with HAX"))},this.standardAdvancedProps=function(e){return e.settings.advanced.push({attribute:"class",title:"Classes",description:"CSS classes applied manually to the element",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"style",title:"Styles",description:"Custom CSS styles as applied to the element",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"prefix",title:"Schema: prefix",description:"Schema prefixes",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"typeof",title:"Schema: TypeOf",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"property",title:"Schema: Property",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"resource",title:"Schema: Resource ID",description:"Schema resource identifier",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"id",title:"ID",description:"element ID, only set this if you know why",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"slot",title:"slot",description:"DOM slot area",inputMethod:"textfield"}),e},this.validateSetting=function(e){return("undefined"!==i(e.property)||"undefined"!==i(e.slot)||"undefined"!==i(e.attribute))&&("undefined"===i(e.title)&&("undefined"===i(e.attribute)?e.title=e.property:e.title=e.attribute),"undefined"===i(e.description)&&(e.description=""),"undefined"===i(e.inputMethod)&&(e.inputMethod="textfield"),"undefined"===i(e.type)&&(e.type="settings"),"undefined"===i(e.icon)&&(e.icon="android"),"undefined"===i(e.options)&&(e.options={}),"undefined"===i(e.required)&&(e.required=!1),"undefined"===i(e.disabled)&&(e.disabled=!1),"undefined"===i(e.validation)&&(e.validation=".*"),"undefined"===i(e.validationType)&&(e.validationType=""),"undefined"!==i(e.slot)&&("undefined"===i(e.slotWrapper)&&(e.slotWrapper="span"),"undefined"===i(e.slotAttributes)&&(e.slotAttributes={})),e)},this.getHaxProperties=function(){return o.haxProperties},this.getHaxJSONSchema=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;"undefined"===i(e)&&(e="configure"),"undefined"===i(n)&&(n=r.haxProperties);var a=n.settings[e],s={$schema:"http://json-schema.org/schema#",title:"HAX "+e+" form schema",type:"object",properties:{}};if(s.properties=(new t.SimpleFields).fieldsToSchema(a),n.gizmo&&n.gizmo.tag&&window.customElements.get(n.gizmo.tag)){var d=document.createElement(n.gizmo.tag);s="function"==typeof d.postProcessgetHaxJSONSchema?d.postProcessgetHaxJSONSchema(s):r.postProcessgetHaxJSONSchema(s)}else s=r.postProcessgetHaxJSONSchema(s);return s},this.postProcessgetHaxJSONSchema=function(e){return e},this._getHaxJSONSchemaProperty=function(e){return(new t.SimpleFields).fieldsToSchema(e)},this.getHaxJSONSchemaType=function(e){var i=(new t.SimpleFields).fieldsConversion.inputMethod[e]||(new t.SimpleFields).fieldsConversion;return i&&i.defaultSettings&&i.defaultSettings.type?i.defaultSettings.type:"string"},this.validHAXPropertyInputMethod=function(){return Object.keys((new t.SimpleFields).fieldsConversion.inputMethod)},this.prototypeHaxProperties=function(){return{api:"1",canScale:!0,canPosition:!0,canEditSource:!1,gizmo:{title:"Tag name",description:"",icon:"icons:android",color:"purple",groups:["Content"],handles:[{type:"data",type_exclusive:!1,url:"src"}],meta:{author:"auto"}},settings:{quick:[{property:"title",title:"Title",inputMethod:"textfield",icon:"android"},{property:"primaryColor",title:"Primary color",inputMethod:"colorpicker",icon:"color"}],configure:[{slot:"",title:"Inner content",description:"The slotted content that lives inside the tag",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{slot:"button",title:"Button content",description:"The content that can override the button",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"title",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"primaryColor",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!1,validation:".*",validationType:"text"}],advanced:[{property:"secondaryColor",title:"Secondary color",description:"An optional secondary color used in certain edge cases.",inputMethod:"colorpicker",icon:"color"},{property:"endPoint",title:"API endpoint",description:"An optional endpoint to hit and load in more data dymaically.",inputMethod:"textfield",icon:"android",validation:"[a-z0-9]",validationType:"url"}]},saveOptions:{wipeSlot:!1,unsetAttributes:["end-point","secondary-color"]},demoSchema:[{tag:"my-tag",content:"<p>inner html</p>",properties:{endPoint:"https://cdn2.thecatapi.com/images/9j5.jpg",primaryColor:"yellow",title:"A cat"}}]}}};window.HAXWiring=new h,window.HAXBehaviors=window.HAXBehaviors||{},window.HAXBehaviors.PropertiesBehaviors={properties:{haxProperties:window.HAXWiring.haxProperties},setHaxProperties:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==t&&"undefined"!==i(this.tagName)&&(t=this.tagName.toLowerCase()),window.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),"undefined"!==i(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.ready?window.HAXWiring.setHaxProperties(e,t,n,!0):window.HAXWiring.setHaxProperties(e,t,n,!1)},_haxStoreReady:function(e){return window.HAXWiring._haxStoreReady(e)},validateSetting:function(e){return window.HAXWiring.validateSetting(e)},getHaxProperties:function(){return this.haxProperties},getHaxJSONSchema:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return window.HAXWiring.getHaxJSONSchema(e,t,i)},postProcessgetHaxJSONSchema:function(e){return window.HAXWiring.postProcessgetHaxJSONSchema(e)},_getHaxJSONSchemaProperty:function(e){return(new t.SimpleFields).fieldsToSchema(e)},getHaxJSONSchemaType:function(e){return window.HAXWiring.getHaxJSONSchemaType(e)},validHAXPropertyInputMethod:function(){return window.HAXWiring.validHAXPropertyInputMethod()},prototypeHaxProperties:function(){return window.HAXWiring.prototypeHaxProperties()}},e.HAXElement=function(e){return function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(m,e);var a,u,f,g=l(m);function m(){var e;return n(this,m),(e=g.call(this)).HAXWiring=new h,e}return a=m,f=[{key:"properties",get:function(){return s(s({},p(d(m),"properties",this)),{},{haxProperties:window.HAXWiring.haxProperties})}}],(u=[{key:"setHaxProperties",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==t&&"undefined"!==i(this.tagName)&&(t=this.tagName.toLowerCase()),window.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),"undefined"!==i(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.ready?this.HAXWiring.setHaxProperties(e,t,n,!0):this.HAXWiring.setHaxProperties(e,t,n,!1)}},{key:"disconnectedCallback",value:function(){window.removeEventListener("hax-store-ready",this._haxStoreReady.bind(this)),p(d(m.prototype),"disconnectedCallback",this)&&p(d(m.prototype),"disconnectedCallback",this).call(this)}},{key:"setup",value:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.HAXWiring.setup(e,"",this)}},{key:"_haxStoreReady",value:function(e){return this.HAXWiring._haxStoreReady(e)}},{key:"validateSetting",value:function(e){return this.HAXWiring.validateSetting(e)}},{key:"getHaxProperties",value:function(){return this.haxProperties}},{key:"getHaxJSONSchema",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return this.HAXWiring.getHaxJSONSchema(e,t,i)}},{key:"postProcessgetHaxJSONSchema",value:function(e){return this.HAXWiring.postProcessgetHaxJSONSchema(e)}},{key:"_getHaxJSONSchemaProperty",value:function(e){return(new t.SimpleFields).fieldsToSchema(e)}},{key:"getHaxJSONSchemaType",value:function(e){return this.HAXWiring.getHaxJSONSchemaType(e)}},{key:"validHAXPropertyInputMethod",value:function(){return this.HAXWiring.validHAXPropertyInputMethod()}},{key:"prototypeHaxProperties",value:function(){return this.HAXWiring.prototypeHaxProperties()}}])&&o(a.prototype,u),f&&o(a,f),m}()},e.HAXWiring=h,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@lrnwebcomponents/simple-fields/simple-fields.js")):"function"==typeof define&&define.amd?define(["exports","@lrnwebcomponents/simple-fields/simple-fields.js"],t):t((e=e||self).HaxBodyBehaviors={},e.simpleFields_js)}(this,function(e,t){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?a(Object(i),!0).forEach(function(t){r(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=d(e);if(t){var o=d(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return l(this,i)}}function p(e,t,i){return(p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i):o.value}})(e,t,i||e)}f={alt:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,required:!0}}},color:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"color"}}},colorpicker:{defaultSettings:{import:"@lrnwebcomponents/simple-colors/lib/simple-colors-picker.js",element:"simple-colors-picker",attributes:{autofocus:!0}}},date:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"date"}}},"date-time":{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"datetime-local"}}}},r(f,"date",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"date"}}}),r(f,"email",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"email"}}}),r(f,"fileupload",{defaultSettings:{import:"@lrnwebcomponents/hax-body/lib/hax-upload-field.js",element:"hax-upload-field",noWrap:!0,attributes:{autofocus:!0},properties:{accepts:"accepts"}}}),r(f,"iconpicker",{defaultSettings:{import:"@lrnwebcomponents/simple-icon-picker/simple-icon-picker.js",element:"simple-icon-picker",attributes:{autofocus:!0}}}),r(f,"month",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"month"}}}),r(f,"textarea",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"textarea"}}}),r(f,"time",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"time"}}}),r(f,"uri",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"file"},properties:{accepts:"accepts"}}});var f,h=function e(){var o=this;n(this,e),this.haxProperties={canScale:!1,canPosition:!1,canEditSource:!1,settings:{quick:[],configure:[],advanced:[]},wipeSlot:{}},this.pathFromUrl=function(e){return e.substring(0,e.lastIndexOf("/")+1)},this.setup=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;return"undefined"!==i(o.tagName)&&(t=o.tagName.toLowerCase()),window.addEventListener("hax-store-ready",o._haxStoreReady.bind(o)),"undefined"!==i(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.instance.ready?o.setHaxProperties(e,t,n,!0):o.setHaxProperties(e,t,n,!1)},this._haxStoreReady=function(e){if(e.detail&&"undefined"!==i(o.tagName)&&"undefined"!==i(o.haxProperties)){var t=o.tagName,n=o.haxProperties,r=o;if(""!=t&&"undefined"===i(window.HaxStore)){var a=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:t.toLowerCase(),properties:n,polymer:!1}});r.dispatchEvent(a)}else if(""!=t&&"undefined"===i(window.HaxStore.instance.elementList[t.toLowerCase()])){var s=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:t.toLowerCase(),properties:n}});r.dispatchEvent(s)}else if("undefined"!==i(o.tagName)&&"undefined"===i(window.HaxStore.instance.elementList[o.tagName.toLowerCase()])){var d=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:o.tagName.toLowerCase(),properties:n}});r.dispatchEvent(d)}}},this.setHaxProperties=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("undefined"===i(e.api)&&(e.api="1"),"1"==e.api){var a;if("undefined"===i(e.canPosition)&&(e.canPosition=!0),"undefined"===i(e.canScale)&&(e.canScale=!0),"undefined"===i(e.canEditSource)&&(e.canEditSource=!1),"undefined"===i(e.gizmo))e.gizmo=!1;else if("undefined"!==i(e.gizmo.iconLib))a=window.WCGlobalBasePath?window.WCGlobalBasePath:o.pathFromUrl(decodeURIComponent("undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("hax-body-behaviors.umd.js",document.baseURI).href))+"../../../",import("".concat(a).concat(e.gizmo.iconLib));if("undefined"!==i(e.settings)){"undefined"===i(e.settings.quick)&&(e.settings.quick=[]);for(var s=0;s<e.settings.quick.length;s++)e.settings.quick[s]=o.validateSetting(e.settings.quick[s]),e.settings.quick[s]||e.settings.quick.splice(s,1);"undefined"===i(e.settings.configure)&&(e.settings.configure=[]);for(var d=0;d<e.settings.configure.length;d++)e.settings.configure[d]=o.validateSetting(e.settings.configure[d]),e.settings.configure[d]||e.settings.configure.splice(d,1);"undefined"===i(e.settings.advanced)&&(e.settings.advanced=[]);for(var c=0;c<e.settings.advanced.length;c++)e.settings.advanced[c]=o.validateSetting(e.settings.advanced[c]),e.settings.advanced[c]||e.settings.advanced.splice(c,1);e=o.standardAdvancedProps(e)}"undefined"===i(e.saveOptions)&&(e.saveOptions={wipeSlot:!1}),"undefined"===i(e.demoSchema)&&(e.demoSchema=[]),r&&o.readyToFireHAXSchema(t,e,n),""===t&&("function"==typeof o._setHaxProperties?o._setHaxProperties(e):o.haxProperties=e)}else console.warn("This is't a valid usage of hax API. See hax-body-behaviors/lib/HAXWiring.js for more details on how to implement the API. https://haxtheweb.org/hax-schema for details but we will try and guess the wiring")},this.readyToFireHAXSchema=function(e,t,n){if(""!=e&&"undefined"===i(window.HaxStore)){var r=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t,polymer:!1}});n.dispatchEvent(r)}else if(""!=e){var a=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});n.dispatchEvent(a)}else if("undefined"!==i(o.tagName)){var s=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:o.tagName.toLowerCase(),properties:t}});n.dispatchEvent(s)}else if("undefined"!==i(n.tagName)){var d=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:n.tagName.toLowerCase(),properties:t}});n.dispatchEvent(d)}else console.warn(n),console.warn("".concat(e," missed our checks and has an issue in implementation with HAX"))},this.standardAdvancedProps=function(e){return e.settings.advanced.push({attribute:"class",title:"Classes",description:"CSS classes applied manually to the element",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"style",title:"Styles",description:"Custom CSS styles as applied to the element",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"prefix",title:"Schema: prefix",description:"Schema prefixes",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"typeof",title:"Schema: TypeOf",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"property",title:"Schema: Property",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"resource",title:"Schema: Resource ID",description:"Schema resource identifier",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"id",title:"ID",description:"element ID, only set this if you know why",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"slot",title:"slot",description:"DOM slot area",inputMethod:"textfield"}),e},this.validateSetting=function(e){return("undefined"!==i(e.property)||"undefined"!==i(e.slot)||"undefined"!==i(e.attribute))&&("undefined"===i(e.title)&&("undefined"===i(e.attribute)?e.title=e.property:e.title=e.attribute),"undefined"===i(e.description)&&(e.description=""),"undefined"===i(e.inputMethod)&&(e.inputMethod="textfield"),"undefined"===i(e.type)&&(e.type="settings"),"undefined"===i(e.icon)&&(e.icon="android"),"undefined"===i(e.options)&&(e.options={}),"undefined"===i(e.required)&&(e.required=!1),"undefined"===i(e.disabled)&&(e.disabled=!1),"undefined"===i(e.validation)&&(e.validation=".*"),"undefined"===i(e.validationType)&&(e.validationType=""),"undefined"!==i(e.slot)&&("undefined"===i(e.slotWrapper)&&(e.slotWrapper="span"),"undefined"===i(e.slotAttributes)&&(e.slotAttributes={})),e)},this.getHaxProperties=function(){return o.haxProperties},this.getHaxJSONSchema=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;"undefined"===i(e)&&(e="configure"),"undefined"===i(n)&&(n=r.haxProperties);var a=n.settings[e],s={$schema:"http://json-schema.org/schema#",title:"HAX "+e+" form schema",type:"object",properties:{}};if(s.properties=(new t.SimpleFields).fieldsToSchema(a),n.gizmo&&n.gizmo.tag&&window.customElements.get(n.gizmo.tag)){var d=document.createElement(n.gizmo.tag);s="function"==typeof d.postProcessgetHaxJSONSchema?d.postProcessgetHaxJSONSchema(s):r.postProcessgetHaxJSONSchema(s)}else s=r.postProcessgetHaxJSONSchema(s);return s},this.postProcessgetHaxJSONSchema=function(e){return e},this._getHaxJSONSchemaProperty=function(e){return(new t.SimpleFields).fieldsToSchema(e)},this.getHaxJSONSchemaType=function(e){var i=(new t.SimpleFields).fieldsConversion.inputMethod[e]||(new t.SimpleFields).fieldsConversion;return i&&i.defaultSettings&&i.defaultSettings.type?i.defaultSettings.type:"string"},this.validHAXPropertyInputMethod=function(){return Object.keys((new t.SimpleFields).fieldsConversion.inputMethod)},this.prototypeHaxProperties=function(){return{api:"1",canScale:!0,canPosition:!0,canEditSource:!1,gizmo:{title:"Tag name",description:"",icon:"icons:android",color:"purple",groups:["Content"],handles:[{type:"data",type_exclusive:!1,url:"src"}],meta:{author:"auto"}},settings:{quick:[{property:"title",title:"Title",inputMethod:"textfield",icon:"android"},{property:"primaryColor",title:"Primary color",inputMethod:"colorpicker",icon:"color"}],configure:[{slot:"",title:"Inner content",description:"The slotted content that lives inside the tag",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{slot:"button",title:"Button content",description:"The content that can override the button",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"title",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"primaryColor",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!1,validation:".*",validationType:"text"}],advanced:[{property:"secondaryColor",title:"Secondary color",description:"An optional secondary color used in certain edge cases.",inputMethod:"colorpicker",icon:"color"},{property:"endPoint",title:"API endpoint",description:"An optional endpoint to hit and load in more data dymaically.",inputMethod:"textfield",icon:"android",validation:"[a-z0-9]",validationType:"url"}]},saveOptions:{wipeSlot:!1,unsetAttributes:["end-point","secondary-color"]},demoSchema:[{tag:"my-tag",content:"<p>inner html</p>",properties:{endPoint:"https://cdn2.thecatapi.com/images/9j5.jpg",primaryColor:"yellow",title:"A cat"}}]}}};window.HAXWiring=new h,window.HAXBehaviors=window.HAXBehaviors||{},window.HAXBehaviors.PropertiesBehaviors={properties:{haxProperties:window.HAXWiring.haxProperties},setHaxProperties:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==t&&"undefined"!==i(this.tagName)&&(t=this.tagName.toLowerCase()),window.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),"undefined"!==i(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.instance.ready?window.HAXWiring.setHaxProperties(e,t,n,!0):window.HAXWiring.setHaxProperties(e,t,n,!1)},_haxStoreReady:function(e){return window.HAXWiring._haxStoreReady(e)},validateSetting:function(e){return window.HAXWiring.validateSetting(e)},getHaxProperties:function(){return this.haxProperties},getHaxJSONSchema:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return window.HAXWiring.getHaxJSONSchema(e,t,i)},postProcessgetHaxJSONSchema:function(e){return window.HAXWiring.postProcessgetHaxJSONSchema(e)},_getHaxJSONSchemaProperty:function(e){return(new t.SimpleFields).fieldsToSchema(e)},getHaxJSONSchemaType:function(e){return window.HAXWiring.getHaxJSONSchemaType(e)},validHAXPropertyInputMethod:function(){return window.HAXWiring.validHAXPropertyInputMethod()},prototypeHaxProperties:function(){return window.HAXWiring.prototypeHaxProperties()}},e.HAXElement=function(e){return function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(m,e);var a,l,f,g=u(m);function m(){var e;return n(this,m),(e=g.call(this)).HAXWiring=new h,e}return a=m,f=[{key:"properties",get:function(){return s(s({},p(d(m),"properties",this)),{},{haxProperties:window.HAXWiring.haxProperties})}}],(l=[{key:"setHaxProperties",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==t&&"undefined"!==i(this.tagName)&&(t=this.tagName.toLowerCase()),window.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),"undefined"!==i(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.instance.ready?this.HAXWiring.setHaxProperties(e,t,n,!0):this.HAXWiring.setHaxProperties(e,t,n,!1)}},{key:"disconnectedCallback",value:function(){window.removeEventListener("hax-store-ready",this._haxStoreReady.bind(this)),p(d(m.prototype),"disconnectedCallback",this)&&p(d(m.prototype),"disconnectedCallback",this).call(this)}},{key:"setup",value:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.HAXWiring.setup(e,"",this)}},{key:"_haxStoreReady",value:function(e){return this.HAXWiring._haxStoreReady(e)}},{key:"validateSetting",value:function(e){return this.HAXWiring.validateSetting(e)}},{key:"getHaxProperties",value:function(){return this.haxProperties}},{key:"getHaxJSONSchema",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return this.HAXWiring.getHaxJSONSchema(e,t,i)}},{key:"postProcessgetHaxJSONSchema",value:function(e){return this.HAXWiring.postProcessgetHaxJSONSchema(e)}},{key:"_getHaxJSONSchemaProperty",value:function(e){return(new t.SimpleFields).fieldsToSchema(e)}},{key:"getHaxJSONSchemaType",value:function(e){return this.HAXWiring.getHaxJSONSchemaType(e)}},{key:"validHAXPropertyInputMethod",value:function(){return this.HAXWiring.validHAXPropertyInputMethod()}},{key:"prototypeHaxProperties",value:function(){return this.HAXWiring.prototypeHaxProperties()}}])&&o(a.prototype,l),f&&o(a,f),m}()},e.HAXWiring=h,Object.defineProperty(e,"__esModule",{value:!0})});

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

import "@lrnwebcomponents/hax-body/lib/hax-upload-field.js";
/**

@@ -256,2 +255,3 @@ * fields array of input methods to JSON schema object conversion configuration

defaultSettings: {
import: "@lrnwebcomponents/hax-body/lib/hax-upload-field.js",
element: "hax-upload-field",

@@ -286,2 +286,3 @@ noWrap: true,

defaultSettings: {
import: "@lrnwebcomponents/simple-fields/lib/simple-fields-code.js",
element: "simple-fields-code",

@@ -331,5 +332,8 @@ setValueProperty: "editorValue",

defaultSettings: {
import: "@lrnwebcomponents/simple-fields/lib/simple-fields-tabs.js",
element: "simple-fields-tabs",
noWrap: true,
child: {
import:
"@lrnwebcomponents/simple-fields/lib/simple-fields-tab.js",
element: "simple-fields-tab",

@@ -383,2 +387,4 @@ noWrap: true,

defaultSettings: {
import:
"@lrnwebcomponents/simple-colors/lib/simple-colors-picker.js",
element: "simple-colors-picker",

@@ -432,2 +438,3 @@ attributes: {

defaultSettings: {
import: "@lrnwebcomponents/hax-body/lib/hax-upload-field.js",
element: "hax-upload-field",

@@ -445,2 +452,4 @@ noWrap: true,

defaultSettings: {
import:
"@lrnwebcomponents/simple-icon-picker/simple-icon-picker.js",
element: "simple-icon-picker",

@@ -447,0 +456,0 @@ attributes: {

@@ -41,3 +41,3 @@ /**

* 'icon': 'editor:border-all',
* 'iconLib': '@lrnwebcomponents/hax-iconset/hax-iconset.js', // optional ability to import custom icon libraries
* 'iconLib': '@lrnwebcomponents/hax-iconset/lib/simple-hax-iconset.js', // optional ability to import custom icon libraries
* 'color': 'green',

@@ -206,3 +206,3 @@ * 'groups': ['Presentation', 'Table', 'Data'],

window.HaxStore.instance != null &&
window.HaxStore.ready
window.HaxStore.instance.ready
) {

@@ -307,6 +307,11 @@ return this.setHaxProperties(props, tag, context, true);

if (typeof props.gizmo.iconLib !== typeof undefined) {
const basePath = this.pathFromUrl(
decodeURIComponent(import.meta.url)
);
import(`${basePath}../../../${props.gizmo.iconLib}`);
var basePath;
if (window.WCGlobalBasePath) {
basePath = window.WCGlobalBasePath;
} else {
basePath =
this.pathFromUrl(decodeURIComponent(import.meta.url)) +
"../../../";
}
import(`${basePath}${props.gizmo.iconLib}`);
}

@@ -810,3 +815,3 @@ }

window.HaxStore.instance != null &&
window.HaxStore.ready
window.HaxStore.instance.ready
) {

@@ -924,3 +929,3 @@ return this.HAXWiring.setHaxProperties(props, tag, context, true);

window.HaxStore.instance != null &&
window.HaxStore.ready
window.HaxStore.instance.ready
) {

@@ -927,0 +932,0 @@ return window.HAXWiring.setHaxProperties(props, tag, context, true);

@@ -15,3 +15,3 @@ {

},
"version": "2.7.10",
"version": "2.8.0",
"description": "Wire any element up to HAX",

@@ -40,3 +40,3 @@ "repository": {

"dependencies": {
"@lrnwebcomponents/simple-fields": "^2.7.10",
"@lrnwebcomponents/simple-fields": "^2.8.0",
"@polymer/polymer": "^3.3.1"

@@ -46,3 +46,3 @@ },

"@lrnwebcomponents/deduping-fix": "^2.7.7",
"@lrnwebcomponents/storybook-utilities": "^2.7.10",
"@lrnwebcomponents/storybook-utilities": "^2.8.0",
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page",

@@ -61,3 +61,3 @@ "@polymer/iron-demo-helpers": "3.1.0",

},
"gitHead": "5b8d225cec2bf64160b4f4cab0630b187fdcd2d8"
"gitHead": "3d847eff4969998e9c52c0246a81453e99749f66"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc