@lrnwebcomponents/parallax-image
Advanced tools
Comparing version 3.0.6 to 4.0.0
@@ -20,3 +20,3 @@ { | ||
}, | ||
"version": "3.0.6", | ||
"version": "4.0.0", | ||
"description": "Automated conversion of parallax-image/", | ||
@@ -32,9 +32,11 @@ "repository": { | ||
"scripts": { | ||
"test": "wct --configFile ../../wct.conf.json node_modules/@lrnwebcomponents/parallax-image/test/", | ||
"start": "yarn run dev", | ||
"build": "gulp --gulpfile=gulpfile.cjs && rollup -c && prettier --ignore-path ../../.prettierignore --write \"**/*.{js,json}\" && wca analyze \"**/*.js\" --format vscode --outFile vscode-html-custom-data.json", | ||
"build": "gulp --gulpfile=gulpfile.cjs && node --experimental-json-modules ../../node_modules/.bin/rollup --config && prettier --ignore-path ../../.prettierignore --write \"**/*.{js,json}\" && wca analyze \"**/*.js\" --format vscode --outFile vscode-html-custom-data.json", | ||
"dev": "concurrently --kill-others \"yarn run watch\" \"yarn run serve\"", | ||
"watch": "gulp dev --gulpfile=gulpfile.cjs", | ||
"serve": "es-dev-server -c ../../es-dev-server.config.js", | ||
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs" | ||
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs", | ||
"test": "web-test-runner \"test/**/*.test.js\" --node-resolve --config=../../web-test-runner.config.mjs", | ||
"test:watch": "web-test-runner \"test/**/*.test.js\" --node-resolve --config=../../web-test-runner.config.mjs --watch", | ||
"test:browsers": "web-test-runner \"test/**/*.test.js\" --node-resolve --config=../../web-test-runner.config.mjs --playwright --browsers chromium firefox webkit" | ||
}, | ||
@@ -46,14 +48,19 @@ "author": { | ||
"dependencies": { | ||
"@lrnwebcomponents/schema-behaviors": "^3.0.6", | ||
"lit-element": "2.4.0" | ||
"@lrnwebcomponents/schema-behaviors": "^4.0.0", | ||
"lit": "2.0.0-rc.2" | ||
}, | ||
"devDependencies": { | ||
"@lrnwebcomponents/deduping-fix": "^3.0.0", | ||
"@lrnwebcomponents/storybook-utilities": "^3.0.6", | ||
"@lrnwebcomponents/deduping-fix": "^4.0.0", | ||
"@lrnwebcomponents/storybook-utilities": "^4.0.0", | ||
"@open-wc/testing": "2.5.33", | ||
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page", | ||
"@polymer/iron-demo-helpers": "3.1.0", | ||
"@web/test-runner": "0.13.5", | ||
"@web/test-runner-commands": "0.4.5", | ||
"@web/test-runner-playwright": "0.8.6", | ||
"@web/test-runner-puppeteer": "0.10.0", | ||
"@webcomponents/webcomponentsjs": "2.5.0", | ||
"concurrently": "5.3.0", | ||
"gulp-babel": "8.0.0", | ||
"lodash": "4.17.19", | ||
"lodash": "^4.17.21", | ||
"polymer-cli": "1.9.11", | ||
@@ -71,3 +78,3 @@ "wct-browser-legacy": "1.0.2" | ||
], | ||
"gitHead": "ce5d24bc5829a7d5ea73218759db007619359682" | ||
"gitHead": "e877f54ece91fb0b2f7aba62f9f9fd15060600f2" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { LitElement, html, css } from "lit-element/lit-element.js"; | ||
import { LitElement, html, css } from "lit"; | ||
import { SchemaBehaviors } from "@lrnwebcomponents/schema-behaviors/schema-behaviors.js"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lit-element/lit-element.js"),require("@lrnwebcomponents/schema-behaviors/schema-behaviors.js")):"function"==typeof define&&define.amd?define(["exports","lit-element/lit-element.js","@lrnwebcomponents/schema-behaviors/schema-behaviors.js"],t):t((e=e||self).ParallaxImage={},e.litElement_js,e.schemaBehaviors_js)}(this,function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=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 f(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 n,r=l(e);if(t){var a=l(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return u(this,n)}}function p(e,t,n){return(p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}function d(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function b(){var e=d(['\n :host {\n display: block;\n --parallax-image-background: "";\n --parallax-title-background: rgba(0, 0, 0, 0.3);\n --parallax-title-font: #fff;\n }\n\n .parallax_container {\n height: 400px;\n width: 100%;\n overflow: hidden;\n display: flex;\n justify-content: center;\n }\n\n .parallax {\n background-image: var(--parallax-image-background);\n background-attachment: fixed;\n background-position: top center;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n height: 100%;\n justify-content: center;\n }\n\n #bgParallax {\n display: flex;\n align-items: center;\n }\n\n .title {\n background: var(--parallax-title-background);\n display: block;\n padding: 20px 15px;\n text-align: center;\n width: 40%;\n color: var(--parallax-title-font);\n font-size: 32px;\n position: absolute;\n margin-top: 120px;\n }\n\n @media screen and (max-width: 900px) {\n .title {\n font-size: 16px;\n }\n }\n ']);return b=function(){return e},e}function g(){var e=d(['\n <div\n class="parallax_container"\n aria-describedby="','"\n >\n <div id="bgParallax" class="parallax">\n <div class="title" id="titleParallax">\n <slot name="parallax_heading"></slot>\n </div>\n </div>\n </div>\n ']);return g=function(){return e},e}var y=function(e){!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&&s(e,t)}(i,n.SchemaBehaviors(t.LitElement));var r=f(i);function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).imageBg="",e}return a(i,[{key:"render",value:function(){return t.html(g(),this.describedBy||"")}}],[{key:"styles",get:function(){return[t.css(b())]}},{key:"tag",get:function(){return"parallax-image"}},{key:"properties",get:function(){return c(c({},p(l(i),"properties",this)),{},{imageBg:{type:String,attribute:"image-bg",reflect:!0},describedBy:{type:String,attribute:"described-by"}})}}]),a(i,[{key:"updated",value:function(e){var t=this;e.forEach(function(e,n){"imageBg"==n&&t.style.setProperty("--parallax-image-background","url(".concat(t.imageBg,")"))})}},{key:"scrollBy",value:function(e){var t=this.shadowRoot.querySelector("#bgParallax"),n=this.shadowRoot.querySelector("#titleParallax"),r=-.2*window.scrollY,a=1.4*r;t.style.backgroundPosition="center ".concat(r,"px"),n.style.transform="translate3D(0, ".concat(a,"px, 0)")}},{key:"connectedCallback",value:function(){var e=this;p(l(i.prototype),"connectedCallback",this).call(this),setTimeout(function(){window.addEventListener("scroll",e.scrollBy.bind(e))},0)}},{key:"disconnectedCallback",value:function(){window.removeEventListener("scroll",this.scrollBy.bind(this)),p(l(i.prototype),"disconnectedCallback",this).call(this)}}],[{key:"haxProperties",get:function(){return{canScale:!0,canPosition:!0,canEditSource:!0,gizmo:{title:"Parallax image",description:"Image scroll by",icon:"av:play-circle-filled",color:"grey",groups:["Image","Media"],handles:[{type:"image",url:"source",ariaDescribedby:"describedBy"}],meta:{author:"ELMS:LN"}},settings:{configure:[{property:"imageBg",title:"Image",description:"image to be involved in the background",inputMethod:"haxupload"},{slot:"parallax_heading",title:"Heading area",description:"Heading text area",inputMethod:"textarea"}],advanced:[{property:"describedBy",title:"aria-describedby",description:"Space-separated list of IDs for elements that describe the image.",inputMethod:"textfield"}]}}}}]),i}();window.customElements.define(y.tag,y),e.ParallaxImage=y,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lit"),require("@lrnwebcomponents/schema-behaviors/schema-behaviors.js")):"function"==typeof define&&define.amd?define(["exports","lit","@lrnwebcomponents/schema-behaviors/schema-behaviors.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ParallaxImage={},e.lit,e.schemaBehaviors_js)}(this,(function(e,t,n){"use strict";function r(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var a=c(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return s(this,n)}}function f(e,t,n){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}function p(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var d,b,g=function(e){!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&&l(e,t)}(g,e);var n,r,i,s=u(g);function g(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),(e=s.call(this)).imageBg="",e}return n=g,i=[{key:"styles",get:function(){return[t.css(b||(b=p(['\n :host {\n display: block;\n --parallax-image-background: "";\n --parallax-title-background: rgba(0, 0, 0, 0.3);\n --parallax-title-font: #fff;\n }\n\n .parallax_container {\n height: 400px;\n width: 100%;\n overflow: hidden;\n display: flex;\n justify-content: center;\n }\n\n .parallax {\n background-image: var(--parallax-image-background);\n background-attachment: fixed;\n background-position: top center;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n height: 100%;\n justify-content: center;\n }\n\n #bgParallax {\n display: flex;\n align-items: center;\n }\n\n .title {\n background: var(--parallax-title-background);\n display: block;\n padding: 20px 15px;\n text-align: center;\n width: 40%;\n color: var(--parallax-title-font);\n font-size: 32px;\n position: absolute;\n margin-top: 120px;\n }\n\n @media screen and (max-width: 900px) {\n .title {\n font-size: 16px;\n }\n }\n '])))]}},{key:"tag",get:function(){return"parallax-image"}},{key:"properties",get:function(){return a(a({},f(c(g),"properties",this)),{},{imageBg:{type:String,attribute:"image-bg",reflect:!0},describedBy:{type:String,attribute:"described-by"}})}},{key:"haxProperties",get:function(){return{canScale:!0,canPosition:!0,canEditSource:!0,gizmo:{title:"Parallax image",description:"Image scroll by",icon:"av:play-circle-filled",color:"grey",groups:["Image","Media"],handles:[{type:"image",url:"source",ariaDescribedby:"describedBy"}],meta:{author:"ELMS:LN"}},settings:{configure:[{property:"imageBg",title:"Image",description:"image to be involved in the background",inputMethod:"haxupload"},{slot:"parallax_heading",title:"Heading area",description:"Heading text area",inputMethod:"textarea"}],advanced:[{property:"describedBy",title:"aria-describedby",description:"Space-separated list of IDs for elements that describe the image.",inputMethod:"textfield"}]}}}}],(r=[{key:"render",value:function(){return t.html(d||(d=p(['\n <div\n class="parallax_container"\n aria-describedby="','"\n >\n <div id="bgParallax" class="parallax">\n <div class="title" id="titleParallax">\n <slot name="parallax_heading"></slot>\n </div>\n </div>\n </div>\n '])),this.describedBy||"")}},{key:"updated",value:function(e){var t=this;e.forEach((function(e,n){"imageBg"==n&&t.style.setProperty("--parallax-image-background","url(".concat(t.imageBg,")"))}))}},{key:"scrollBy",value:function(e){var t=this.shadowRoot.querySelector("#bgParallax"),n=this.shadowRoot.querySelector("#titleParallax"),r=-.2*window.scrollY,a=1.4*r;t.style.backgroundPosition="center ".concat(r,"px"),n.style.transform="translate3D(0, ".concat(a,"px, 0)")}},{key:"connectedCallback",value:function(){var e=this;f(c(g.prototype),"connectedCallback",this).call(this),setTimeout((function(){window.addEventListener("scroll",e.scrollBy.bind(e))}),0)}},{key:"disconnectedCallback",value:function(){window.removeEventListener("scroll",this.scrollBy.bind(this)),f(c(g.prototype),"disconnectedCallback",this).call(this)}}])&&o(n.prototype,r),i&&o(n,i),g}(n.SchemaBehaviors(t.LitElement));window.customElements.define(g.tag,g),e.ParallaxImage=g,Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -1,2 +0,2 @@ | ||
import { LitElement, html, css } from "lit-element/lit-element.js"; | ||
import { LitElement, html, css } from "lit"; | ||
import { SchemaBehaviors } from "@lrnwebcomponents/schema-behaviors/schema-behaviors.js"; | ||
@@ -3,0 +3,0 @@ /** |
61451
954
15
20
+ Addedlit@2.0.0-rc.2
+ Added@lit-labs/ssr-dom-shim@1.2.0(transitive)
+ Added@lit/reactive-element@1.6.3(transitive)
+ Added@lrnwebcomponents/schema-behaviors@4.2.0(transitive)
+ Added@lrnwebcomponents/utils@4.2.0(transitive)
+ Added@types/trusted-types@2.0.7(transitive)
+ Addedlit@2.0.0-rc.2(transitive)
+ Addedlit-element@3.3.3(transitive)
+ Addedlit-html@2.8.0(transitive)
- Removedlit-element@2.4.0
- Removed@lrnwebcomponents/schema-behaviors@3.0.6(transitive)
- Removed@lrnwebcomponents/utils@3.0.0(transitive)
- Removedlit-element@2.4.0(transitive)
- Removedlit-html@1.4.1(transitive)