nodality 1.0.85 → 1.0.104
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.
- package/dist/animator.cjs.js +1 -2
- package/dist/animator.esm.js +1 -2
- package/dist/appleanim.cjs.js +1 -1
- package/dist/appleanim.esm.js +1 -1
- package/dist/audionew.cjs.js +1 -2
- package/dist/audionew.esm.js +1 -2
- package/dist/base.cjs.js +0 -1
- package/dist/base.esm.js +1 -2
- package/dist/beta-desktop-bar.cjs.js +1 -0
- package/dist/beta-desktop-bar.esm.js +1 -0
- package/dist/beta-mobile-bar.cjs.js +1 -0
- package/dist/beta-mobile-bar.esm.js +1 -0
- package/dist/betaDesktopBar.esm.js +1 -1
- package/dist/betaMobileBar.esm.js +1 -1
- package/dist/bundle.umd.js +1 -2
- package/dist/button.cjs.js +1 -2
- package/dist/button.esm.js +1 -2
- package/dist/card-getter.cjs.js +1 -0
- package/dist/card-getter.esm.js +1 -0
- package/dist/cardGetter.esm.js +1 -1
- package/dist/center.cjs.js +1 -2
- package/dist/center.esm.js +1 -2
- package/dist/checkbox.cjs.js +1 -2
- package/dist/checkbox.esm.js +1 -2
- package/dist/code.cjs.js +1 -2
- package/dist/code.esm.js +1 -2
- package/dist/container.cjs.js +1 -2
- package/dist/container.esm.js +1 -2
- package/dist/data-list.cjs.js +1 -0
- package/dist/data-list.esm.js +1 -0
- package/dist/designer.cjs.js +1 -2
- package/dist/designer.esm.js +1 -2
- package/dist/dropdown.cjs.js +1 -2
- package/dist/dropdown.esm.js +1 -2
- package/dist/element-mapper.cjs.js +1 -0
- package/dist/element-mapper.esm.js +1 -0
- package/dist/elementMapper.cjs.js +1 -1
- package/dist/elementMapper.esm.js +1 -1
- package/dist/finalresult.esm.js +1 -2
- package/dist/flex-card.cjs.js +1 -0
- package/dist/flex-card.esm.js +1 -0
- package/dist/flex-grid.cjs.js +1 -0
- package/dist/flex-grid.esm.js +1 -0
- package/dist/flex-row.cjs.js +1 -0
- package/dist/flex-row.esm.js +1 -0
- package/dist/flexCard.cjs.js +1 -1
- package/dist/flexCard.esm.js +1 -1
- package/dist/floating-input.cjs.js +1 -0
- package/dist/floating-input.esm.js +1 -0
- package/dist/free.cjs.js +1 -2
- package/dist/free.esm.js +1 -2
- package/dist/horizontal-scroller.cjs.js +1 -0
- package/dist/horizontal-scroller.esm.js +1 -0
- package/dist/image-picker.cjs.js +1 -0
- package/dist/image-picker.esm.js +1 -0
- package/dist/image.cjs.js +1 -2
- package/dist/image.esm.js +1 -2
- package/dist/index.cjs.js +1 -2
- package/dist/index.esm.js +1 -2
- package/dist/keyframe-animation.cjs.js +1 -0
- package/dist/keyframe-animation.esm.js +1 -0
- package/dist/link-getter.cjs.js +1 -0
- package/dist/link-getter.esm.js +1 -0
- package/dist/link.cjs.js +1 -2
- package/dist/link.esm.js +1 -2
- package/dist/linkGetter.cjs.js +1 -1
- package/dist/linkGetter.esm.js +1 -1
- package/dist/meta-adder.cjs.js +1 -0
- package/dist/meta-adder.esm.js +1 -0
- package/dist/modal-2025.cjs.js +1 -0
- package/dist/modal-2025.esm.js +1 -0
- package/dist/multiswitcher.cjs.js +1 -0
- package/dist/multiswitcher.esm.js +1 -0
- package/dist/new-nav-bar.cjs.js +1 -0
- package/dist/new-nav-bar.esm.js +1 -0
- package/dist/picker.cjs.js +1 -2
- package/dist/picker.esm.js +1 -2
- package/dist/progress.cjs.js +1 -2
- package/dist/progress.esm.js +1 -2
- package/dist/radio.cjs.js +1 -2
- package/dist/radio.esm.js +1 -2
- package/dist/range.cjs.js +1 -2
- package/dist/range.esm.js +1 -2
- package/dist/scroll-video.cjs.js +1 -0
- package/dist/scroll-video.esm.js +1 -0
- package/dist/scrollvideo.cjs.js +1 -1
- package/dist/scrollvideo.esm.js +1 -1
- package/dist/side-bar.cjs.js +1 -0
- package/dist/side-bar.esm.js +1 -0
- package/dist/side-nav-bar.cjs.js +1 -0
- package/dist/side-nav-bar.esm.js +1 -0
- package/dist/simple-bar.cjs.js +1 -0
- package/dist/simple-bar.esm.js +1 -0
- package/dist/slider-2025.cjs.js +1 -0
- package/dist/slider-2025.esm.js +1 -0
- package/dist/spacer.cjs.js +0 -1
- package/dist/spacer.esm.js +1 -0
- package/dist/stack.cjs.js +1 -2
- package/dist/stack.esm.js +1 -2
- package/dist/stacker.cjs.js +1 -2
- package/dist/stacker.esm.js +1 -2
- package/dist/table.cjs.js +1 -2
- package/dist/table.esm.js +1 -2
- package/dist/text-field.cjs.js +1 -0
- package/dist/text-field.esm.js +1 -0
- package/dist/text.cjs.js +1 -2
- package/dist/text.esm.js +1 -2
- package/dist/transform-anim.cjs.js +1 -0
- package/dist/transform-anim.esm.js +1 -0
- package/dist/transformanim.cjs.js +1 -1
- package/dist/transformanim.esm.js +1 -1
- package/dist/ulist.cjs.js +1 -2
- package/dist/ulist.esm.js +1 -2
- package/dist/video.cjs.js +1 -0
- package/dist/video.esm.js +1 -2
- package/dist/wrap.cjs.js +0 -1
- package/dist/wrap.esm.js +1 -2
- package/dist/zoom-card.cjs.js +1 -0
- package/dist/zoom-card.esm.js +1 -0
- package/layout/animator.js +1 -1
- package/layout/audio.js +1 -1
- package/layout/audionew.js +1 -1
- package/layout/base-2.js +1 -1
- package/layout/base.js +1 -1
- package/layout/{betaDesktopBar.js → beta-desktop-bar.js} +1 -1
- package/layout/{betaMobileBar.js → beta-mobile-bar.js} +1 -1
- package/layout/box.js +1 -1
- package/layout/button.js +1 -1
- package/layout/cards.js +2 -1
- package/layout/center.js +1 -1
- package/layout/checkbox.js +1 -1
- package/layout/circle.js +1 -1
- package/layout/{cleanRow.js → clean-row.js} +1 -1
- package/layout/code.js +1 -1
- package/layout/container.js +1 -1
- package/layout/custom.js +1 -1
- package/layout/{divImage.js → div-image.js} +1 -1
- package/layout/{dropdown2025.js → dropdown-2025.js} +1 -1
- package/layout/dropdown.js +1 -1
- package/layout/{emptyElement.js → empty-element.js} +1 -1
- package/layout/{externalStylesheet.js → external-stylesheet.js} +1 -1
- package/layout/{flexCard.js → flex-card.js} +3 -1
- package/layout/{flexGrid.js → flex-grid.js} +1 -1
- package/layout/{flexrow.js → flex-row.js} +1 -1
- package/layout/footer.js +1 -1
- package/layout/{formComponents → form-components}/custom.js +1 -1
- package/layout/{formComponents/dataList.js → form-components/data-list.js} +1 -1
- package/layout/{formComponents/floatingInput.js → form-components/floating-input.js} +1 -1
- package/layout/{formComponents → form-components}/form-all.js +1 -1
- package/layout/{formComponents → form-components}/form.js +1 -1
- package/layout/{formComponents/imagePicker.js → form-components/image-picker.js} +1 -1
- package/layout/{formComponents → form-components}/picker.js +1 -1
- package/layout/{formComponents → form-components}/radio.js +1 -1
- package/layout/{formComponents → form-components}/radiogroup.js +1 -1
- package/layout/{formComponents → form-components}/range.js +1 -1
- package/layout/free.js +1 -1
- package/layout/grid-new.js +1 -1
- package/layout/{gridSwitcher.js → grid-switcher.js} +1 -1
- package/layout/grid.js +1 -1
- package/layout/group.js +1 -1
- package/layout/header.js +1 -1
- package/layout/{horizontalScroller.js → horizontal-scroller.js} +1 -1
- package/layout/image-old.js +1 -1
- package/layout/image.js +1 -1
- package/layout/index.js +49 -37
- package/layout/label.js +1 -1
- package/layout/link.js +1 -1
- package/layout/list-OLD.js +1 -1
- package/layout/list.js +1 -1
- package/layout/{metaAdder.js → meta-adder.js} +1 -1
- package/layout/{modal2025.js → modal-2025.js} +1 -1
- package/layout/modernwrap.js +1 -1
- package/layout/multiswitcher.js +1 -1
- package/layout/multiswitcherBeta.js +1 -1
- package/layout/{navBar.js → nav-bar.js} +1 -1
- package/layout/{navFactor/customDiv.js → nav-factor/custom-div.js} +1 -1
- package/layout/navBar-OLD.js +1 -1
- package/layout/{newFlatAdder.js → new-flat-adder.js} +1 -1
- package/layout/{newNavBar.js → new-nav-bar.js} +1 -1
- package/layout/{offsetContainer.js → offset-container.js} +1 -1
- package/layout/polygon.js +1 -1
- package/layout/progress.js +1 -1
- package/layout/row.js +1 -1
- package/layout/{savedNewNavBar.js → saved-new-nav-bar.js} +1 -1
- package/layout/{scrollvideo.js → scroll-video.js} +1 -1
- package/layout/{sideBar.js → side-bar.js} +1 -1
- package/layout/{sideNavBar.js → side-nav-bar.js} +1 -1
- package/layout/{simpleBar.js → simple-bar.js} +1 -1
- package/layout/{slider2025.js → slider-2025.js} +1 -1
- package/layout/spacer.js +1 -1
- package/layout/stack.js +1 -1
- package/layout/styler.js +1 -1
- package/layout/switcher.js +1 -1
- package/layout/table.js +1 -1
- package/layout/{textField.js → text-field.js} +1 -1
- package/layout/text.js +1 -1
- package/layout/ulist.js +1 -1
- package/layout/video.js +1 -1
- package/layout/{withoutNew.js → without-new.js} +1 -1
- package/layout/wrap.js +1 -1
- package/layout/{zoomCard.js → zoom-card.js} +1 -1
- package/lib/{cardGetter.js → card-getter.js} +1 -1
- package/lib/designer.js +49 -49
- package/lib/{elementMapper.js → element-mapper.js} +56 -37
- package/lib/{KeyframeAnimation.js → keyframe-animation.js} +1 -1
- package/lib/{linkGetter.js → link-getter.js} +1 -1
- package/lib/{scrollvideo.js → scroll-video.js} +1 -1
- package/lib/{Stacker.js → stacker.js} +2 -1
- package/lib/{TransformAnim.js → transform-anim.js} +1 -1
- package/package.json +4 -2
- package/dist/KeyframeAnimation.cjs.js +0 -2
- package/dist/KeyframeAnimation.cjs.js.LICENSE.txt +0 -5
- package/dist/KeyframeAnimation.esm.js +0 -2
- package/dist/KeyframeAnimation.esm.js.LICENSE.txt +0 -5
- package/dist/animator.cjs.js.LICENSE.txt +0 -5
- package/dist/animator.esm.js.LICENSE.txt +0 -5
- package/dist/appleanim.cjs.js.LICENSE.txt +0 -5
- package/dist/appleanim.esm.js.LICENSE.txt +0 -5
- package/dist/audionew.cjs.js.LICENSE.txt +0 -5
- package/dist/audionew.esm.js.LICENSE.txt +0 -5
- package/dist/base.cjs.js.LICENSE.txt +0 -5
- package/dist/base.esm.js.LICENSE.txt +0 -5
- package/dist/betaDesktopBar.esm.js.LICENSE.txt +0 -5
- package/dist/betaMobileBar.esm.js.LICENSE.txt +0 -5
- package/dist/bundle.umd.js.LICENSE.txt +0 -5
- package/dist/button.cjs.js.LICENSE.txt +0 -5
- package/dist/button.esm.js.LICENSE.txt +0 -5
- package/dist/cardGetter.cjs.js.LICENSE.txt +0 -5
- package/dist/cardGetter.esm.js.LICENSE.txt +0 -5
- package/dist/center.cjs.js.LICENSE.txt +0 -5
- package/dist/center.esm.js.LICENSE.txt +0 -5
- package/dist/checkbox.cjs.js.LICENSE.txt +0 -5
- package/dist/checkbox.esm.js.LICENSE.txt +0 -5
- package/dist/circle.cjs.js +0 -2
- package/dist/circle.cjs.js.LICENSE.txt +0 -5
- package/dist/circle.esm.js +0 -2
- package/dist/circle.esm.js.LICENSE.txt +0 -5
- package/dist/code.cjs.js.LICENSE.txt +0 -5
- package/dist/code.esm.js.LICENSE.txt +0 -5
- package/dist/container.cjs.js.LICENSE.txt +0 -5
- package/dist/container.esm.js.LICENSE.txt +0 -5
- package/dist/datalist.cjs.js.LICENSE.txt +0 -5
- package/dist/datalist.esm.js.LICENSE.txt +0 -5
- package/dist/designer.cjs.js.LICENSE.txt +0 -5
- package/dist/designer.esm.js.LICENSE.txt +0 -5
- package/dist/dropdown.cjs.js.LICENSE.txt +0 -5
- package/dist/dropdown.esm.js.LICENSE.txt +0 -5
- package/dist/elementMapper.cjs.js.LICENSE.txt +0 -5
- package/dist/elementMapper.esm.js.LICENSE.txt +0 -5
- package/dist/finalresult.esm.js.LICENSE.txt +0 -5
- package/dist/flexCard.cjs.js.LICENSE.txt +0 -5
- package/dist/flexCard.esm.js.LICENSE.txt +0 -5
- package/dist/flexGrid.cjs.js.LICENSE.txt +0 -5
- package/dist/flexGrid.esm.js.LICENSE.txt +0 -5
- package/dist/flexRow.cjs.js.LICENSE.txt +0 -5
- package/dist/flexRow.esm.js.LICENSE.txt +0 -5
- package/dist/floatingInput.cjs.js.LICENSE.txt +0 -5
- package/dist/floatingInput.esm.js.LICENSE.txt +0 -5
- package/dist/free.cjs.js.LICENSE.txt +0 -5
- package/dist/free.esm.js.LICENSE.txt +0 -5
- package/dist/gridSwitcher.cjs.js +0 -2
- package/dist/gridSwitcher.cjs.js.LICENSE.txt +0 -5
- package/dist/gridSwitcher.esm.js +0 -2
- package/dist/gridSwitcher.esm.js.LICENSE.txt +0 -5
- package/dist/horizontalScroller.esm.js.LICENSE.txt +0 -5
- package/dist/image.cjs.js.LICENSE.txt +0 -5
- package/dist/image.esm.js.LICENSE.txt +0 -5
- package/dist/imagePicker.cjs.js.LICENSE.txt +0 -5
- package/dist/imagePicker.esm.js.LICENSE.txt +0 -5
- package/dist/index.cjs.js.LICENSE.txt +0 -5
- package/dist/index.esm.js.LICENSE.txt +0 -5
- package/dist/link.cjs.js.LICENSE.txt +0 -5
- package/dist/link.esm.js.LICENSE.txt +0 -5
- package/dist/linkGetter.cjs.js.LICENSE.txt +0 -5
- package/dist/linkGetter.esm.js.LICENSE.txt +0 -5
- package/dist/metaAdder.cjs.js.LICENSE.txt +0 -5
- package/dist/metaAdder.esm.js.LICENSE.txt +0 -5
- package/dist/modal2025.cjs.js.LICENSE.txt +0 -5
- package/dist/modal2025.esm.js.LICENSE.txt +0 -5
- package/dist/multiswitchers.esm.js.LICENSE.txt +0 -5
- package/dist/newNavBar.cjs.js.LICENSE.txt +0 -5
- package/dist/newNavBar.esm.js.LICENSE.txt +0 -5
- package/dist/picker.cjs.js.LICENSE.txt +0 -5
- package/dist/picker.esm.js.LICENSE.txt +0 -5
- package/dist/polygon.cjs.js +0 -2
- package/dist/polygon.cjs.js.LICENSE.txt +0 -5
- package/dist/polygon.esm.js +0 -2
- package/dist/polygon.esm.js.LICENSE.txt +0 -5
- package/dist/progress.cjs.js.LICENSE.txt +0 -5
- package/dist/progress.esm.js.LICENSE.txt +0 -5
- package/dist/radio.cjs.js.LICENSE.txt +0 -5
- package/dist/radio.esm.js.LICENSE.txt +0 -5
- package/dist/range.cjs.js.LICENSE.txt +0 -5
- package/dist/range.esm.js.LICENSE.txt +0 -5
- package/dist/scrollvideo.cjs.js.LICENSE.txt +0 -5
- package/dist/scrollvideo.esm.js.LICENSE.txt +0 -5
- package/dist/sideBar.cjs.js.LICENSE.txt +0 -5
- package/dist/sideBar.esm.js.LICENSE.txt +0 -5
- package/dist/sideNavBar.cjs.js.LICENSE.txt +0 -5
- package/dist/sideNavBar.esm.js.LICENSE.txt +0 -5
- package/dist/simpleBar.cjs.js.LICENSE.txt +0 -5
- package/dist/simpleBar.esm.js.LICENSE.txt +0 -5
- package/dist/slider2025.cjs.js +0 -2
- package/dist/slider2025.cjs.js.LICENSE.txt +0 -5
- package/dist/slider2025.esm.js +0 -2
- package/dist/slider2025.esm.js.LICENSE.txt +0 -5
- package/dist/spacer.cjs.js.LICENSE.txt +0 -5
- package/dist/stack.cjs.js.LICENSE.txt +0 -5
- package/dist/stack.esm.js.LICENSE.txt +0 -5
- package/dist/stacker.cjs.js.LICENSE.txt +0 -5
- package/dist/stacker.esm.js.LICENSE.txt +0 -5
- package/dist/table.cjs.js.LICENSE.txt +0 -5
- package/dist/table.esm.js.LICENSE.txt +0 -5
- package/dist/text.cjs.js.LICENSE.txt +0 -5
- package/dist/text.esm.js.LICENSE.txt +0 -5
- package/dist/textField.cjs.js.LICENSE.txt +0 -5
- package/dist/textField.esm.js.LICENSE.txt +0 -5
- package/dist/transformanim.cjs.js.LICENSE.txt +0 -5
- package/dist/transformanim.esm.js.LICENSE.txt +0 -5
- package/dist/ulist.cjs.js.LICENSE.txt +0 -5
- package/dist/ulist.esm.js.LICENSE.txt +0 -5
- package/dist/video.esm.js.LICENSE.txt +0 -5
- package/dist/wrap.cjs.js.LICENSE.txt +0 -5
- package/dist/wrap.esm.js.LICENSE.txt +0 -5
- package/dist/zoomCard.cjs.js.LICENSE.txt +0 -5
- package/dist/zoomCard.esm.js.LICENSE.txt +0 -5
- package/layout/<head> +0 -59
- package/layout/DEADJOE +0 -49
- package/layout/DEPRECATED-PARAGRAPH.js +0 -109
- package/layout/edit.sh +0 -39
- package/layout/formComponents/edit.sh +0 -39
- package/layout/navFactor/edit.sh +0 -39
- package/layout/newNavBar copy 2.js +0 -921
- package/layout/newNavBar copy.js +0 -780
- package/lib/AppleAnim.js +0 -794
package/dist/gridSwitcher.cjs.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see gridSwitcher.cjs.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},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={};function r(e){return r="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},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}e.r(t),e.d(t,{AreaSwitcher:()=>o});var o=function(){return e=function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.gridContainer=document.createElement("div"),this.gridContainer.classList.add("grid-container"),this.gridContainer.style.display="grid"},t=[{key:"set",value:function(e){return e.gap&&(this.gridContainer.style.gap=e.gap),e.height&&(this.gridContainer.style.height=e.height),e.width&&(this.gridContainer.style.width=e.width),this}},{key:"react",value:function(e){var t=this,r=function(){console.log(e.length);for(var r=0;r<e.length-1;r++){console.warn(window.innerWidth);var n=parseInt(e[r].at),i=parseInt(e[r+1].at);if(window.innerWidth>n&&window.innerWidth<i){console.log("FROM "+n+" TO "+i);var o=e[r].template.map((function(e){return e.split("").join(" ")})).map((function(e){return'"'.concat(e,'"')})).join(" ");t.gridContainer.style.gridTemplateAreas=o}else if(window.innerWidth>i){console.log("BIGGER THAN "+i);var a=e[e.length-1].template.map((function(e){return e.split("").join(" ")})).map((function(e){return'"'.concat(e,'"')})).join(" ");t.gridContainer.style.gridTemplateAreas=a}}};return r(),window.addEventListener("resize",r),this}},{key:"add",value:function(e){console.log(e);for(var t=function(e){for(var t=[],r=0;r<e;r++){var n="",i=r;do{n=String.fromCharCode(65+i%26)+n,i=Math.floor(i/26)-1}while(i>=0);t.push(n)}return t}(e.length),r=0;r<e.length;r++){var n=e[r].render();n.style.gridArea=t[r].toLowerCase();var i=document.createElement("div");i.textContent=e[r].text,i.style.gridArea=t[r].toLowerCase(),this.gridContainer.appendChild(n)}return this}},{key:"render",value:function(e){return e&&document.querySelector(e).appendChild(this.gridContainer),this.gridContainer}},{key:"toCode",value:function(){return"new Simple().set({}).react([])"}}],t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();module.exports=t})();
|
package/dist/gridSwitcher.esm.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see gridSwitcher.esm.js.LICENSE.txt */
|
|
2
|
-
var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}t.d(e,{t:()=>o});var o=function(){return t=function t(){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.gridContainer=document.createElement("div"),this.gridContainer.classList.add("grid-container"),this.gridContainer.style.display="grid"},e=[{key:"set",value:function(t){return t.gap&&(this.gridContainer.style.gap=t.gap),t.height&&(this.gridContainer.style.height=t.height),t.width&&(this.gridContainer.style.width=t.width),this}},{key:"react",value:function(t){var e=this,r=function(){console.log(t.length);for(var r=0;r<t.length-1;r++){console.warn(window.innerWidth);var n=parseInt(t[r].at),i=parseInt(t[r+1].at);if(window.innerWidth>n&&window.innerWidth<i){console.log("FROM "+n+" TO "+i);var o=t[r].template.map((function(t){return t.split("").join(" ")})).map((function(t){return'"'.concat(t,'"')})).join(" ");e.gridContainer.style.gridTemplateAreas=o}else if(window.innerWidth>i){console.log("BIGGER THAN "+i);var a=t[t.length-1].template.map((function(t){return t.split("").join(" ")})).map((function(t){return'"'.concat(t,'"')})).join(" ");e.gridContainer.style.gridTemplateAreas=a}}};return r(),window.addEventListener("resize",r),this}},{key:"add",value:function(t){console.log(t);for(var e=function(t){for(var e=[],r=0;r<t;r++){var n="",i=r;do{n=String.fromCharCode(65+i%26)+n,i=Math.floor(i/26)-1}while(i>=0);e.push(n)}return e}(t.length),r=0;r<t.length;r++){var n=t[r].render();n.style.gridArea=e[r].toLowerCase();var i=document.createElement("div");i.textContent=t[r].text,i.style.gridArea=e[r].toLowerCase(),this.gridContainer.appendChild(n)}return this}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.gridContainer),this.gridContainer}},{key:"toCode",value:function(){return"new Simple().set({}).react([])"}}],e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),a=e.t;export{a as AreaSwitcher};
|
package/dist/polygon.cjs.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see polygon.cjs.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},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={};function r(e){return r="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},r(e)}function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw s}}}}function i(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function c(e){return c="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},c(e)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function f(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d(n.key),n)}}function d(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},m.apply(null,arguments)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}e.r(t),e.d(t,{Polygon:()=>b});var b=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,r){return t=v(t),function(e,t){if(t&&("object"==c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,r||[],v(e).constructor):t.apply(e,r))}(this,t)).res=null,e.options={},e.code=[],e.elCSS=[],e.html=[],e.react=[],e.setup(r),e.code.push("new Polygon(".concat(JSON.stringify(r),")")),e}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(t,e),r=t,n=[{key:"setup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=document.createElement("div");return e.id&&t.setAttribute("id",e.id),this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.display=e.inline?"inline-block":"block",this}},{key:"toCode",value:function(){var e=this.options||{},t=JSON.stringify(e,null,2);return t=t.replace(/"([^"]+)":/g,"$1:"),"new Polygon().set(".concat(t,")")}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=p(p({},this.options),e),e.id&&(this.res.id=e.id),e.class&&(this.res.className=e.class),e.sides&&this.sides(e.sides),e.size&&this.size(e.size.width||e.size,e.size.height),e.color&&this.color(e.color),e.border&&this.border(e.border),e.margin&&this.margin(e.margin),e.padding&&this.padding(e.padding),e.background&&this.background(e.background),e.center&&this.center();var r=e;this.obj=e;var n,o,i,s=[];if(r.stroke||r.gradient||r.backgroundOp||r.layout||r.marginOp||r.shadow||r.animation||r.filtera||r.transform){var a;r.gradient&&(this.globalGradient=r.gradient.op.gradient),r.stroke&&(null===(n=t,o=this,a="function"==typeof(i=m(v(1&3?n.prototype:n),"setAny",o))?function(e){return i.apply(o,e)}:i)||void 0===a||a([{globalBlast:"".concat(r.stroke.op.width," ").concat(r.stroke.op.color)}]));for(var l=[r.stroke,r.gradient,r.animation,r.backgroundOp,r.layout,r.marginOp,r.shadow,r.animation,r.filtera,r.transform].filter((function(e){return null!=e})),c=0;c<l.length;c++)s.push({range:l[c].range,log:l[c].op.name,target:l[c].target,op:l[c].op});var u=[];r.border&&u.push("border"),r.background&&u.push("background"),(r.mar||r.margin)&&u.push("margin"),r.animation&&u.push("animation"),"radial"===r.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),this.chainReact(s,this.options.id,u)}return this}},{key:"size",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.res.style.width="number"==typeof e?e+"px":e,this.res.style.height="number"==typeof t?t+"px":t,this}},{key:"sides",value:function(e){return e<3&&(e=3),this.res.style.clipPath=t.makePolygon(e),this}},{key:"center",value:function(){return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this}},{key:"color",value:function(e){return this.res.style.background=e,this}},{key:"border",value:function(e){return this.res.style.border="string"==typeof e?e:"".concat((null==e?void 0:e.width)||"1px"," solid ").concat((null==e?void 0:e.color)||"black"),this}},{key:"margin",value:function(e){return this.res.style.margin="number"==typeof e?e+"px":e,this}},{key:"padding",value:function(e){return this.res.style.padding="number"==typeof e?e+"px":e,this}},{key:"background",value:function(e){return this.res.style.background=e,this}},{key:"render",value:function(e){return"string"==typeof e?document.querySelector(e).appendChild(this.res):e instanceof HTMLElement&&e.appendChild(this.res),this}}],o=[{key:"makePolygon",value:function(e){for(var t=2*Math.PI/e,r=[],n=0;n<e;n++){var o=50+50*Math.cos(n*t-Math.PI/2),i=50+50*Math.sin(n*t-Math.PI/2);r.push("".concat(o,"% ").concat(i,"%"))}return"polygon(".concat(r.join(","),")")}}],n&&y(r.prototype,n),o&&y(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(function(){return e=function e(){var t,r,n,o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,n=function(e){if(console.log("LOBJO IS"),console.log(e),e.transform||e.op&&e.op.transform){var t=e.transform;e.transform||(t=e.op.transform),t.duration||(t.duration="3s-ease-in-out"),o.setDefault=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===e.length?t+" ":e};var r=function(){var r="",n="",i="",s="",a="",l="",c="",u="",p="";if(0!==t.values.length){t.values.forEach((function(e){e.startsWith("tx:")&&(r=e.replace("tx:","")),e.startsWith("ty:")&&(n=e.replace("ty:","")),e.startsWith("tz:")?i=e.replace("tz:",""):e.startsWith("scale(")?s=e:e.startsWith("skew(")?a=e:e.startsWith("rotate(")?l=function(e){var t=e.match(/rotate\(([^)]+)\)/);if(!t)return e;var r=t[1].split(",").map((function(e){return e.trim()}));return 1===r.length?"rotate(".concat(r[0],")"):2===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],")"):3===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],") rotate(").concat(r[2],")"):e}(e):e.startsWith("perspective(")?c=e:e.startsWith("matrix(")?u=e:e.startsWith("opacity:")&&(p=e.replace("opacity:",""))})),r=o.setDefault(r),n=o.setDefault(n),i=o.setDefault(i);var f="";if("0px"!=n&&"0px"!=r&&"0px"!=i?f+="translate3d(".concat(r,", ").concat(n,", ").concat(i,")"):"0px"==n&&"0px"==r||(f+="translate(".concat(r,", ").concat(n,")")),s&&(f+=" ".concat(s)),l&&(f+=" ".concat(l)),a&&(f+=" ".concat(a)),c&&(f+=" ".concat(c)),u&&(f+=" ".concat(u)),f){if(e.op.transform.duration){var y=e.op.transform.duration.replace(/^(\d+)(s)-/,(function(e,t,r){return t/2+r+" "})),d="transform ".concat(y,", opacity ").concat(y);o.res.style.transition=d}else o.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";e.op.transform.static&&(o.res.style.transition=""),(o.blastTarget||o.res).style.transform=f,o.res.style.opacity=p}else alert("OPE")}};t.on?o.res.addEventListener(t.on,(function(){t.delay?setTimeout((function(){r()}),t.delay):r()})):window.addEventListener("load",(function(){t.delay?setTimeout((function(){r()}),t.delay):r()}));var n=function(){var e="";t.values.forEach((function(t){t.startsWith("tx:")?e+="translateX(0) ":t.startsWith("ty:")?e+="translateY(0) ":t.startsWith("tz:")?e+="translateZ(0) ":t.startsWith("scale(")?e+="scale(1) ":t.startsWith("skew(")?e+="skew(0, 0) ":t.startsWith("rotate(")?e+="rotate(0) ":t.startsWith("perspective(")?e+="perspective(0) ":t.startsWith("matrix(")&&(e+="matrix(1, 0, 0, 1, 0, 0) "),o.res.style.opacity="1"})),e&&(o.res.style.transform=e.trim())};if(t.on)o.res.addEventListener("mouseout",(function(){t.keep||n()}));else{var i=1e3*parseFloat(t.duration),s=t.closeAfter?t.closeAfter:0;setTimeout((function(){t.keep||n()}),i/2+s)}t.hardCSS&&(o.res.style.transform=t.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block"),console.log("INVALID BLOCKA"),console.log(e)},(r=l(r="reactOnTransform"))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}},t=[{key:"keySet",value:function(e){return this.temporaryVal=1,this.res.style[e.key]=e.value,this}},{key:"onScroll",value:function(e){var t=this;"opacity"===e.value?this.res.style.opacity=e.valMin:"scale"===e.value&&(this.res.style.transform="scale(".concat(e.valMax,")")),window.addEventListener("scroll",(function(){var r=t.smartRange(window.scrollY,{min:e.from,max:e.to},{min:e.valMin,max:e.valMax});"opacity"===e.value?t.res.style.opacity=r:"scale"===e.value&&(t.res.style.transform="scale(".concat(r,")"))}))}},{key:"setAny",value:function(e){this[Object.keys(e)[0]]=[Object.values(e)[0]]}},{key:"setID",value:function(e){this.id=e}},{key:"setPrevText",value:function(e){this.prevText=e}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(e){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[e]||"Invalid breakpoint"}},{key:"respad",value:function(e){var t=this,r=function(){t.pad(e[0].values);for(var r=0;r<e.length;r++){var n=e[r].breakpoint;window.matchMedia("(min-width: ".concat(t.getPX(n))).matches&&t.pad(e[r].values)}};window.addEventListener("resize",r),r()}},{key:"resmar",value:function(e){var t=this,r=function(){t.mar(e[0].values);for(var r=0;r<e.length;r++){var n=e[r].breakpoint;window.matchMedia("(max-width: ".concat(t.getPX(n))).matches&&t.mar(e[r].values)}};window.addEventListener("resize",r),r()}},{key:"resprop",value:function(e){var t=this;console.log("RES STYLE"),console.log(e),this.prevStyles={};for(var r=0;r<this.res.style.length;r++){var n=this.res.style[r];this.prevStyles[n]=this.res.style[n],console.log("kio")}var o=function(){for(var r in t.prevStyles)t.res.style[r]=t.prevStyles[r];console.log("mkio");for(var n=0;n<e.length;n++){var o=e[n].breakpoint,i="(max-width: ".concat(o,")");if(console.log("testing media query:",i,window.matchMedia(i).matches),window.matchMedia(i).matches)for(var s in e[n])"breakpoint"!==s&&(console.log("ukio"),t.res.style[s]=e[n][s])}};window.addEventListener("resize",o),o()}},{key:"isNumber",value:function(e){return"number"==typeof e&&!isNaN(e)}},{key:"pad",value:function(e){for(var t=0;t<e.length;t++)for(var r=Object.keys(e[t]),n=0;n<r.length;n++)for(var o=r[n],i=e[t][o],s=0;s<o.length;s++)switch(o[s]){case"a":this.res.style.padding=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.paddingTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.paddingLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.paddingRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.paddingBottom=this.isNumber(i)?"".concat(i,"px"):i}return this}},{key:"as",value:function(e){return this.res.style.alignSelf=e,this}},{key:"mar",value:function(e){for(var t=0;t<e.length;t++)for(var r=Object.keys(e[t]),n=0;n<r.length;n++)for(var o=r[n],i=e[t][o],s=0;s<o.length;s++){switch(o[s]){case"a":this.res.style.margin=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.marginTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.marginLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.marginRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.marginBottom=this.isNumber(i)?"".concat(i,"px"):i}"auto"===o[s]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}return this}},{key:"smartRange",value:function(e,t,r){e<t.min&&(e=t.min),e>t.max&&(e=t.max);var n=(e-t.min)/(t.max-t.min);t.min>t.max&&(n=(e-t.max)/(t.min-t.max));var o=(r.min-r.max)*n-r.min;if(o=Math.abs(o),r.min<r.max){var i=(r.max+Math.abs(r.min))*n;o=r.min+i}return o}},{key:"gpos",value:function(e){return this.res.style.gridColumn=e.col,this.res.style.gridRow=e.row,this}},{key:"fluidCopy",value:function(e){if(e instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var t=document.createTextNode(this.text);return this.res.appendChild(t),this.res.style.fontSize=e.exact,this}if("S1"===e){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===e){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===e){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===e){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===e){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var s=document.createTextNode(this.text);this.res.appendChild(s),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===e&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(e){this.index=e}},{key:"borderObj",value:function(e){var t,r=null!==(t=e.type)&&void 0!==t?t:"solid";return this.res.style.border="".concat(e.width," ").concat(r," ").concat(e.color),this.res.style.borderRadius=e.radius,this}},{key:"setPref",value:function(e){this.preffersId=e}},{key:"setClass",value:function(e){this.class=e}},{key:"setTags",value:function(e){this.openTag=e.open,this.closeTag=e.close,console.log("TAGS SET"),console.log(e)}},{key:"chainReact",value:function(e,t,r){var i=this;console.log("0P"),this.ap=!1,this.cta=0,this.once=!1;var s,a=o(e);try{for(a.s();!(s=a.n()).done;){var l=s.value;l.range||(l.range=["0px","999999px"])}}catch(e){a.e(e)}finally{a.f()}e.sort((function(e,t){return parseInt(e.range[0])-parseInt(t.range[0])}));var c=function(s){var a=window.visualViewport.width,l=[],c=[];i.resCopy=i.res,i.storedQueries=e.map((function(e){return e.target})).filter((function(e){return null!=e}));var u,p=o(e);try{for(p.s();!(u=p.n()).done;){var f=u.value;i.counterIndex++;var y=n(f.range,2),d=y[0],h=y[1],m=parseInt(d),v=parseInt(h),g=!0;if(f.target){g=!1;for(var b=0;b<f.target.length;b++)f.target[b]===t&&(g=!0)}a>=m&&a<=v&&g&&(l.push(f.log),c.push(f),f.op&&f.op.margin&&(i.useMargin=f.op.margin))}}catch(e){p.e(e)}finally{p.f()}if(r&&!r.includes("background")&&(i.res.style.background="",i.res.style.backgroundColor=""),i.res.style.textShadow="",r&&!r.includes("border")&&(i.res.style.border=""),r&&!r.includes("margin")&&(i.res.style.margin=""),i.res.style["-webkit-text-fill-color"]="",i.res.style["-webkit-text-stroke-color"]="",i.res.style["-webkit-text-stroke-width"]="",i.res.style.filter="",i.options.background&&(console.log(i.options.background),i.res.style.background=i.options.background),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(i.res.style.position="relative"),l.includes("blast")){var x,w=c.filter((function(e){return"blast"===e.log}))[0].op.color,k=null!==(x=c.filter((function(e){return"blast"===e.log}))[0].op.width)&&void 0!==x?x:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof k?k+"px":k," solid orange"),i.res.style.display="inline-block","FlexRowLayoutElement"===i.getType()&&(i.res.style.display="flex"),i.res.style.boxSizing="border-box",i.res.style.transformOrigin="center",i.blastTarget=i.res):(i.text&&(i.res.textContent=i.text),i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=w,i.res.style["-webkit-text-stroke-width"]="".concat(k))}if(l.includes("filter")){var S=c.filter((function(e){return"filter"===e.log}))[0].op.filter;i.res.style.filter=S}if(l.includes("background")&&(i.res.style.backgroundColor="green"),l.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["background-clip"]="text")),l.includes("shadow")){var O,T="",E=0;for(b=0;b<i.options.shadow.op.steps;b++){var j;T+="drop-shadow(".concat(E+=3,"px ").concat(E,"px ").concat(E,"px ").concat(null!==(j=i.options.shadow.color)&&void 0!==j?j:"gray",") ")}"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?i.res.style.boxShadow="".concat(E,"px ").concat(E,"px ").concat(E,"px ").concat(null!==(O=i.options.shadow.color)&&void 0!==O?O:"gray"):i.res.style.filter=T}if(l.includes("margin"))for(b=0;b<e.length;b++)if(e[b].op){var P=e[b].op.offsets;P&&void 0!==i.index&&(i.res.style.margin=P[Number(i.index)]+"px")}if(l.includes("spana")||l.includes("span")){if(i.res=i.resCopy,i.options.span){var L;for(L=Array.isArray(i.options.span)?i.options.span.filter((function(e){return"span"===e.op.name}))[0]:i.options.span,i.res.textContent="",b=0;b<L.op.parts.length;b++){var C=L.op.parts[b].style,A=new i.constructor(L.op.parts[b].text).setup({type:"span"}).set(C).render();i.res.appendChild(A)}}}else{var W=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&s&&i.res.appendChild(W)}if(l.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){console.warn(i.openTag),i.hasAnimated=!0;var I=i.options.animation.op;window.addEventListener("sidebar:open",(function(){i.res.animate(I.keyframesOpen,I.openOptions)})),window.addEventListener("sidebar:closed",(function(){i.res.animate(I.keyframesClose,I.closeOptions)})),i.res.animate(I.keyframesClose,{duration:0,fill:"forwards"}),i.openTag&&i.closeTag&&(window.addEventListener(i.openTag,(function(){i.res.animate(I.keyframesOpen,I.openOptions)})),window.addEventListener(i.closeTag,(function(){i.res.animate(I.keyframesClose,I.closeOptions)})))}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var N=i.options.animation.op;i.res.animate(N.keyframesClose,{duration:0,fill:"forwards"});var R=function(){window.scrollY>parseFloat(N.fireAt)&&(i.res.animate(N.keyframesOpen,N.openOptions),window.removeEventListener("scroll",R))};window.addEventListener("scroll",R)}if(i.options.animation&&i.options.animation.op.fireAt&&"inview"===i.options.animation.op.fireAt){var M=i.options.animation.op;i.res.animate(M.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(e,t){e.forEach((function(e){e.isIntersecting&&(i.res.animate(M.keyframesOpen,M.openOptions),t.disconnect())}))})).observe(i.res)}}};this.options.animation||window.addEventListener("resize",(function(){return c()})),c()}},{key:"maxWidth",value:function(e){return this.res.style.maxWidth=e,this}},{key:"removeQuotesFromFirstWord",value:function(e){return e.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(e,t){return e.includes("left")&&(this.res.style.marginLeft=t),e.includes("right")&&(this.res.style.marginRight=t),e.includes("top")&&(this.res.style.marginTop=t),e.includes("bottom")&&(this.res.style.marginBottom=t),e.includes("all")&&(this.res.style.margin=t),t||(this.res.style.marginBottom=e),this}}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());module.exports=t})();
|
package/dist/polygon.esm.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see polygon.esm.js.LICENSE.txt */
|
|
2
|
-
function e(t){return e="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(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw s}}}}function n(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}var a=function(){return e=function e(){var t,r,n,o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,n=function(e){if(console.log("LOBJO IS"),console.log(e),e.transform||e.op&&e.op.transform){var t=e.transform;e.transform||(t=e.op.transform),t.duration||(t.duration="3s-ease-in-out"),o.setDefault=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===e.length?t+" ":e};var r=function(){var r="",n="",i="",s="",a="",l="",c="",u="",p="";if(0!==t.values.length){t.values.forEach((function(e){e.startsWith("tx:")&&(r=e.replace("tx:","")),e.startsWith("ty:")&&(n=e.replace("ty:","")),e.startsWith("tz:")?i=e.replace("tz:",""):e.startsWith("scale(")?s=e:e.startsWith("skew(")?a=e:e.startsWith("rotate(")?l=function(e){var t=e.match(/rotate\(([^)]+)\)/);if(!t)return e;var r=t[1].split(",").map((function(e){return e.trim()}));return 1===r.length?"rotate(".concat(r[0],")"):2===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],")"):3===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],") rotate(").concat(r[2],")"):e}(e):e.startsWith("perspective(")?c=e:e.startsWith("matrix(")?u=e:e.startsWith("opacity:")&&(p=e.replace("opacity:",""))})),r=o.setDefault(r),n=o.setDefault(n),i=o.setDefault(i);var f="";if("0px"!=n&&"0px"!=r&&"0px"!=i?f+="translate3d(".concat(r,", ").concat(n,", ").concat(i,")"):"0px"==n&&"0px"==r||(f+="translate(".concat(r,", ").concat(n,")")),s&&(f+=" ".concat(s)),l&&(f+=" ".concat(l)),a&&(f+=" ".concat(a)),c&&(f+=" ".concat(c)),u&&(f+=" ".concat(u)),f){if(e.op.transform.duration){var y=e.op.transform.duration.replace(/^(\d+)(s)-/,(function(e,t,r){return t/2+r+" "})),h="transform ".concat(y,", opacity ").concat(y);o.res.style.transition=h}else o.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";e.op.transform.static&&(o.res.style.transition=""),(o.blastTarget||o.res).style.transform=f,o.res.style.opacity=p}else alert("OPE")}};t.on?o.res.addEventListener(t.on,(function(){t.delay?setTimeout((function(){r()}),t.delay):r()})):window.addEventListener("load",(function(){t.delay?setTimeout((function(){r()}),t.delay):r()}));var n=function(){var e="";t.values.forEach((function(t){t.startsWith("tx:")?e+="translateX(0) ":t.startsWith("ty:")?e+="translateY(0) ":t.startsWith("tz:")?e+="translateZ(0) ":t.startsWith("scale(")?e+="scale(1) ":t.startsWith("skew(")?e+="skew(0, 0) ":t.startsWith("rotate(")?e+="rotate(0) ":t.startsWith("perspective(")?e+="perspective(0) ":t.startsWith("matrix(")&&(e+="matrix(1, 0, 0, 1, 0, 0) "),o.res.style.opacity="1"})),e&&(o.res.style.transform=e.trim())};if(t.on)o.res.addEventListener("mouseout",(function(){t.keep||n()}));else{var i=1e3*parseFloat(t.duration),s=t.closeAfter?t.closeAfter:0;setTimeout((function(){t.keep||n()}),i/2+s)}t.hardCSS&&(o.res.style.transform=t.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block"),console.log("INVALID BLOCKA"),console.log(e)},(r=s(r="reactOnTransform"))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}},n=[{key:"keySet",value:function(e){return this.temporaryVal=1,this.res.style[e.key]=e.value,this}},{key:"onScroll",value:function(e){var t=this;"opacity"===e.value?this.res.style.opacity=e.valMin:"scale"===e.value&&(this.res.style.transform="scale(".concat(e.valMax,")")),window.addEventListener("scroll",(function(){var r=t.smartRange(window.scrollY,{min:e.from,max:e.to},{min:e.valMin,max:e.valMax});"opacity"===e.value?t.res.style.opacity=r:"scale"===e.value&&(t.res.style.transform="scale(".concat(r,")"))}))}},{key:"setAny",value:function(e){this[Object.keys(e)[0]]=[Object.values(e)[0]]}},{key:"setID",value:function(e){this.id=e}},{key:"setPrevText",value:function(e){this.prevText=e}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(e){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[e]||"Invalid breakpoint"}},{key:"respad",value:function(e){var t=this,r=function(){t.pad(e[0].values);for(var r=0;r<e.length;r++){var n=e[r].breakpoint;window.matchMedia("(min-width: ".concat(t.getPX(n))).matches&&t.pad(e[r].values)}};window.addEventListener("resize",r),r()}},{key:"resmar",value:function(e){var t=this,r=function(){t.mar(e[0].values);for(var r=0;r<e.length;r++){var n=e[r].breakpoint;window.matchMedia("(max-width: ".concat(t.getPX(n))).matches&&t.mar(e[r].values)}};window.addEventListener("resize",r),r()}},{key:"resprop",value:function(e){var t=this;console.log("RES STYLE"),console.log(e),this.prevStyles={};for(var r=0;r<this.res.style.length;r++){var n=this.res.style[r];this.prevStyles[n]=this.res.style[n],console.log("kio")}var o=function(){for(var r in t.prevStyles)t.res.style[r]=t.prevStyles[r];console.log("mkio");for(var n=0;n<e.length;n++){var o=e[n].breakpoint,i="(max-width: ".concat(o,")");if(console.log("testing media query:",i,window.matchMedia(i).matches),window.matchMedia(i).matches)for(var s in e[n])"breakpoint"!==s&&(console.log("ukio"),t.res.style[s]=e[n][s])}};window.addEventListener("resize",o),o()}},{key:"isNumber",value:function(e){return"number"==typeof e&&!isNaN(e)}},{key:"pad",value:function(e){for(var t=0;t<e.length;t++)for(var r=Object.keys(e[t]),n=0;n<r.length;n++)for(var o=r[n],i=e[t][o],s=0;s<o.length;s++)switch(o[s]){case"a":this.res.style.padding=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.paddingTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.paddingLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.paddingRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.paddingBottom=this.isNumber(i)?"".concat(i,"px"):i}return this}},{key:"as",value:function(e){return this.res.style.alignSelf=e,this}},{key:"mar",value:function(e){for(var t=0;t<e.length;t++)for(var r=Object.keys(e[t]),n=0;n<r.length;n++)for(var o=r[n],i=e[t][o],s=0;s<o.length;s++){switch(o[s]){case"a":this.res.style.margin=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.marginTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.marginLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.marginRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.marginBottom=this.isNumber(i)?"".concat(i,"px"):i}"auto"===o[s]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}return this}},{key:"smartRange",value:function(e,t,r){e<t.min&&(e=t.min),e>t.max&&(e=t.max);var n=(e-t.min)/(t.max-t.min);t.min>t.max&&(n=(e-t.max)/(t.min-t.max));var o=(r.min-r.max)*n-r.min;if(o=Math.abs(o),r.min<r.max){var i=(r.max+Math.abs(r.min))*n;o=r.min+i}return o}},{key:"gpos",value:function(e){return this.res.style.gridColumn=e.col,this.res.style.gridRow=e.row,this}},{key:"fluidCopy",value:function(e){if(e instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var t=document.createTextNode(this.text);return this.res.appendChild(t),this.res.style.fontSize=e.exact,this}if("S1"===e){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===e){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===e){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===e){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===e){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var s=document.createTextNode(this.text);this.res.appendChild(s),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===e&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(e){this.index=e}},{key:"borderObj",value:function(e){var t,r=null!==(t=e.type)&&void 0!==t?t:"solid";return this.res.style.border="".concat(e.width," ").concat(r," ").concat(e.color),this.res.style.borderRadius=e.radius,this}},{key:"setPref",value:function(e){this.preffersId=e}},{key:"setClass",value:function(e){this.class=e}},{key:"setTags",value:function(e){this.openTag=e.open,this.closeTag=e.close,console.log("TAGS SET"),console.log(e)}},{key:"chainReact",value:function(e,n,o){var i=this;console.log("0P"),this.ap=!1,this.cta=0,this.once=!1;var s,a=r(e);try{for(a.s();!(s=a.n()).done;){var l=s.value;l.range||(l.range=["0px","999999px"])}}catch(e){a.e(e)}finally{a.f()}e.sort((function(e,t){return parseInt(e.range[0])-parseInt(t.range[0])}));var c=function(s){var a=window.visualViewport.width,l=[],c=[];i.resCopy=i.res,i.storedQueries=e.map((function(e){return e.target})).filter((function(e){return null!=e}));var u,p=r(e);try{for(p.s();!(u=p.n()).done;){var f=u.value;i.counterIndex++;var y=t(f.range,2),h=y[0],d=y[1],m=parseInt(h),v=parseInt(d),g=!0;if(f.target){g=!1;for(var b=0;b<f.target.length;b++)f.target[b]===n&&(g=!0)}a>=m&&a<=v&&g&&(l.push(f.log),c.push(f),f.op&&f.op.margin&&(i.useMargin=f.op.margin))}}catch(e){p.e(e)}finally{p.f()}if(o&&!o.includes("background")&&(i.res.style.background="",i.res.style.backgroundColor=""),i.res.style.textShadow="",o&&!o.includes("border")&&(i.res.style.border=""),o&&!o.includes("margin")&&(i.res.style.margin=""),i.res.style["-webkit-text-fill-color"]="",i.res.style["-webkit-text-stroke-color"]="",i.res.style["-webkit-text-stroke-width"]="",i.res.style.filter="",i.options.background&&(console.log(i.options.background),i.res.style.background=i.options.background),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(i.res.style.position="relative"),l.includes("blast")){var x,w=c.filter((function(e){return"blast"===e.log}))[0].op.color,k=null!==(x=c.filter((function(e){return"blast"===e.log}))[0].op.width)&&void 0!==x?x:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof k?k+"px":k," solid orange"),i.res.style.display="inline-block","FlexRowLayoutElement"===i.getType()&&(i.res.style.display="flex"),i.res.style.boxSizing="border-box",i.res.style.transformOrigin="center",i.blastTarget=i.res):(i.text&&(i.res.textContent=i.text),i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=w,i.res.style["-webkit-text-stroke-width"]="".concat(k))}if(l.includes("filter")){var S=c.filter((function(e){return"filter"===e.log}))[0].op.filter;i.res.style.filter=S}if(l.includes("background")&&(i.res.style.backgroundColor="green"),l.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["background-clip"]="text")),l.includes("shadow")){var O,T="",E=0;for(b=0;b<i.options.shadow.op.steps;b++){var j;T+="drop-shadow(".concat(E+=3,"px ").concat(E,"px ").concat(E,"px ").concat(null!==(j=i.options.shadow.color)&&void 0!==j?j:"gray",") ")}"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?i.res.style.boxShadow="".concat(E,"px ").concat(E,"px ").concat(E,"px ").concat(null!==(O=i.options.shadow.color)&&void 0!==O?O:"gray"):i.res.style.filter=T}if(l.includes("margin"))for(b=0;b<e.length;b++)if(e[b].op){var P=e[b].op.offsets;P&&void 0!==i.index&&(i.res.style.margin=P[Number(i.index)]+"px")}if(l.includes("spana")||l.includes("span")){if(i.res=i.resCopy,i.options.span){var L;for(L=Array.isArray(i.options.span)?i.options.span.filter((function(e){return"span"===e.op.name}))[0]:i.options.span,i.res.textContent="",b=0;b<L.op.parts.length;b++){var C=L.op.parts[b].style,A=new i.constructor(L.op.parts[b].text).setup({type:"span"}).set(C).render();i.res.appendChild(A)}}}else{var W=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&s&&i.res.appendChild(W)}if(l.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){console.warn(i.openTag),i.hasAnimated=!0;var I=i.options.animation.op;window.addEventListener("sidebar:open",(function(){i.res.animate(I.keyframesOpen,I.openOptions)})),window.addEventListener("sidebar:closed",(function(){i.res.animate(I.keyframesClose,I.closeOptions)})),i.res.animate(I.keyframesClose,{duration:0,fill:"forwards"}),i.openTag&&i.closeTag&&(window.addEventListener(i.openTag,(function(){i.res.animate(I.keyframesOpen,I.openOptions)})),window.addEventListener(i.closeTag,(function(){i.res.animate(I.keyframesClose,I.closeOptions)})))}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var N=i.options.animation.op;i.res.animate(N.keyframesClose,{duration:0,fill:"forwards"});var R=function(){window.scrollY>parseFloat(N.fireAt)&&(i.res.animate(N.keyframesOpen,N.openOptions),window.removeEventListener("scroll",R))};window.addEventListener("scroll",R)}if(i.options.animation&&i.options.animation.op.fireAt&&"inview"===i.options.animation.op.fireAt){var z=i.options.animation.op;i.res.animate(z.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(e,t){e.forEach((function(e){e.isIntersecting&&(i.res.animate(z.keyframesOpen,z.openOptions),t.disconnect())}))})).observe(i.res)}}};this.options.animation||window.addEventListener("resize",(function(){return c()})),c()}},{key:"maxWidth",value:function(e){return this.res.style.maxWidth=e,this}},{key:"removeQuotesFromFirstWord",value:function(e){return e.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(e,t){return e.includes("left")&&(this.res.style.marginLeft=t),e.includes("right")&&(this.res.style.marginRight=t),e.includes("top")&&(this.res.style.marginTop=t),e.includes("bottom")&&(this.res.style.marginBottom=t),e.includes("all")&&(this.res.style.margin=t),t||(this.res.style.marginBottom=e),this}}],n&&i(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function l(e){return l="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},l(e)}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){p(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t,r){return(t=y(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function d(){return d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=m(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},d.apply(null,arguments)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}var g=function(){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(e,t,r){return t=m(t),function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,r||[],m(e).constructor):t.apply(e,r))}(this,e)).res=null,t.options={},t.code=[],t.elCSS=[],t.html=[],t.react=[],t.setup(r),t.code.push("new Polygon(".concat(JSON.stringify(r),")")),t}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(e,a),t=e,r=[{key:"setup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=document.createElement("div");return e.id&&t.setAttribute("id",e.id),this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.display=e.inline?"inline-block":"block",this}},{key:"toCode",value:function(){var e=this.options||{},t=JSON.stringify(e,null,2);return t=t.replace(/"([^"]+)":/g,"$1:"),"new Polygon().set(".concat(t,")")}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=u(u({},this.options),t),t.id&&(this.res.id=t.id),t.class&&(this.res.className=t.class),t.sides&&this.sides(t.sides),t.size&&this.size(t.size.width||t.size,t.size.height),t.color&&this.color(t.color),t.border&&this.border(t.border),t.margin&&this.margin(t.margin),t.padding&&this.padding(t.padding),t.background&&this.background(t.background),t.center&&this.center();var r=t;this.obj=t;var n,o,i,s=[];if(r.stroke||r.gradient||r.backgroundOp||r.layout||r.marginOp||r.shadow||r.animation||r.filtera||r.transform){var a;r.gradient&&(this.globalGradient=r.gradient.op.gradient),r.stroke&&(null===(n=e,o=this,a="function"==typeof(i=d(m(1&3?n.prototype:n),"setAny",o))?function(e){return i.apply(o,e)}:i)||void 0===a||a([{globalBlast:"".concat(r.stroke.op.width," ").concat(r.stroke.op.color)}]));for(var l=[r.stroke,r.gradient,r.animation,r.backgroundOp,r.layout,r.marginOp,r.shadow,r.animation,r.filtera,r.transform].filter((function(e){return null!=e})),c=0;c<l.length;c++)s.push({range:l[c].range,log:l[c].op.name,target:l[c].target,op:l[c].op});var p=[];r.border&&p.push("border"),r.background&&p.push("background"),(r.mar||r.margin)&&p.push("margin"),r.animation&&p.push("animation"),"radial"===r.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),this.chainReact(s,this.options.id,p)}return this}},{key:"size",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.res.style.width="number"==typeof e?e+"px":e,this.res.style.height="number"==typeof t?t+"px":t,this}},{key:"sides",value:function(t){return t<3&&(t=3),this.res.style.clipPath=e.makePolygon(t),this}},{key:"center",value:function(){return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this}},{key:"color",value:function(e){return this.res.style.background=e,this}},{key:"border",value:function(e){return this.res.style.border="string"==typeof e?e:"".concat((null==e?void 0:e.width)||"1px"," solid ").concat((null==e?void 0:e.color)||"black"),this}},{key:"margin",value:function(e){return this.res.style.margin="number"==typeof e?e+"px":e,this}},{key:"padding",value:function(e){return this.res.style.padding="number"==typeof e?e+"px":e,this}},{key:"background",value:function(e){return this.res.style.background=e,this}},{key:"render",value:function(e){return"string"==typeof e?document.querySelector(e).appendChild(this.res):e instanceof HTMLElement&&e.appendChild(this.res),this}}],n=[{key:"makePolygon",value:function(e){for(var t=2*Math.PI/e,r=[],n=0;n<e;n++){var o=50+50*Math.cos(n*t-Math.PI/2),i=50+50*Math.sin(n*t-Math.PI/2);r.push("".concat(o,"% ").concat(i,"%"))}return"polygon(".concat(r.join(","),")")}}],r&&f(t.prototype,r),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();export{g as Polygon};
|