@inc2734/unitone-css 0.92.0 → 0.94.0
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/app.css +1 -1
- package/dist/app.js +1 -1
- package/dist/index.js +1 -1
- package/dist/library.js +1 -1
- package/package.json +1 -1
- package/src/app.js +23 -0
- package/src/layout-primitives/_layout-primitives.scss +2 -0
- package/src/layout-primitives/cluster/_cluster.scss +9 -0
- package/src/layout-primitives/cluster/index.jsx +2 -0
- package/src/layout-primitives/index.js +1 -0
- package/src/layout-primitives/marquee/_marquee.scss +72 -0
- package/src/layout-primitives/marquee/index.jsx +31 -0
- package/src/library.js +86 -0
package/dist/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t,e={};var n=function(){if(t)return e;function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},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 a,u=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){l=!0,a=t},f:function(){try{u||null==n.return||n.return()}finally{if(l)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){var n;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=this;clearTimeout(n),n=setTimeout((function(){t.apply(a,i)}),e)}}t=1;var u=function(t){var e,n,r,i=null===(e=[].slice.call(null!==(n=null==t?void 0:t.children)&&void 0!==n?n:[]))||void 0===e?void 0:e[0];if(i){var o,a=i.getBoundingClientRect(),u=(null!==(r=t.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/);u.some((function(t){return["divider:initialized","-stack"].includes(t)}))&&(u=u.filter((function(t){return!["divider:initialized","-stack"].includes(t)})),t.setAttribute("data-unitone-layout",u.join(" ")));var l=[].slice.call(t.children).filter((function(t){var e=window.getComputedStyle(t).getPropertyValue("position"),n=window.getComputedStyle(t).getPropertyValue("display");return"absolute"!==e&&"fixed"!==e&&"none"!==n}));l.forEach((function(t,e){var n,r,i=(null!==(n=t.getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/);i.some((function(t){return["-bol","-linewrap"].includes(t)}))&&(i=i.filter((function(t){return!["-bol","-linewrap"].includes(t)})),t.setAttribute("data-unitone-layout",i.join(" ")));var u=null===(r=o)||void 0===r?void 0:r.getBoundingClientRect(),l=t.getBoundingClientRect(),d=!1;(0===e||(null==u?void 0:u.top)<l.top&&(null==u?void 0:u.left)>=l.left)&&(i.push("-bol"),d=!0),0<e&&a.top<l.top&&(i.push("-linewrap"),d=!0),d&&t.setAttribute("data-unitone-layout",i.join(" ")),o=t})),[].slice.call(l).every((function(t){return t.getBoundingClientRect().left===a.left}))&&u.push("-stack"),u.push("divider:initialized"),t.setAttribute("data-unitone-layout",u.join(" "))}},l=function(t){var e,n,r,i=[].slice.call(t.children),o=null==i?void 0:i[0];if(o){t.style.removeProperty("--unitone--stairs-step-overflow-volume"),t.style.removeProperty("--unitone--max-stairs-step"),[].slice.call(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach((function(t){t.style.removeProperty("--unitone--stairs-step")}));var a,u=[],l=0,d=l,s=null===(n=(null!==(r=t.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/).find((function(t){return t.startsWith("-stairs-up:")})))||void 0===n?void 0:n.replace("-stairs-up:",""),c=["up-down","down-up"].includes(s),v=window.getComputedStyle(t).getPropertyValue("flex-direction");i.forEach((function(t){var e,n,r=window.getComputedStyle(t).getPropertyValue("position"),i=window.getComputedStyle(t).getPropertyValue("display");if("absolute"!==r&&"fixed"!==r&&"none"!==i){u.push(t);var s="row-reverse"===v?(null===(e=a)||void 0===e||null===(e=e.getBoundingClientRect())||void 0===e?void 0:e.left)<=t.getBoundingClientRect().left:(null===(n=a)||void 0===n||null===(n=n.getBoundingClientRect())||void 0===n?void 0:n.left)>=t.getBoundingClientRect().left;o===t||s?l=0:c?l=0===l?1:0:l++,t.style.setProperty("--unitone--stairs-step",l),a=t,l>d&&(d=l)}})),t.style.setProperty("--unitone--max-stairs-step",d);var f=t.getBoundingClientRect().bottom,y=u.reduce((function(t,e){var n=e.getBoundingClientRect().bottom-f;return t>n?t:n}),0);t.style.setProperty("--unitone--stairs-step-overflow-volume",y)}},d=function(t){var e;if(t){var n,r=(null!==(e=t.getAttribute("data-unitone-layout"))&&void 0!==e?e:"").split(/\s+/);if(r.some((function(t){return["vertical-writing:initialized","vertical-writing:safari","-force-switch"].includes(t)}))&&(r=r.filter((function(t){return!["vertical-writing:initialized","vertical-writing:safari","-force-switch"].includes(t)})),t.setAttribute("data-unitone-layout",r.join(" "))),[].slice.call(t.children).reverse().some((function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position)&&"none"!==getComputedStyle(t).display)return n=t,!0})),!n)return r.push("vertical-writing:initialized"),void t.setAttribute("data-unitone-layout",r.join(" "));var i=getComputedStyle(t),o=String(i.getPropertyValue("--unitone--threshold")).trim(),a=!1;setTimeout((function(){if(null!=t&&t.isConnected){if(o){var e=document.createElement("div");e.setAttribute("data-unitone-layout","vertical-writing__thresholder"),t.appendChild(e),a=e.offsetWidth>=t.offsetWidth,e.parentNode&&e.parentNode.removeChild(e)}var i;a?(r.push("-force-switch"),null!==(i=t.parentNode)&&void 0!==i&&i.style&&(t.parentNode.style.height="")):(t.getBoundingClientRect().left>n.getBoundingClientRect().left&&r.push("vertical-writing:safari"),t.setAttribute("data-unitone-layout",r.join(" ")),requestAnimationFrame((function(){if(null!=t&&t.isConnected){var e,r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.top+r.height,a=i.top+i.height;o!==a&&null!==(e=t.parentNode)&&void 0!==e&&e.style&&(t.parentNode.style.height="".concat(Math.ceil(a-r.top),"px"))}}))),r.push("vertical-writing:initialized"),t.setAttribute("data-unitone-layout",r.join(" "))}}),250)}},s=function(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.fontSize);n!==parseFloat(e.getPropertyValue("--unitone--result--1em-px"))&&t.style.setProperty("--unitone--result--1em-px",n)};return e.debounce=a,e.dividersResizeObserver=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,o=new ResizeObserver(a((function(t){var e,r=i(t);try{for(r.s();!(e=r.n()).done;){var o,a=e.value,l=null===(o=a.borderBoxSize)||void 0===o?void 0:o[0].inlineSize;l!==n&&(u(a.target),n=l)}}catch(t){r.e(t)}finally{r.f()}}),250)),l=new MutationObserver((function(n){requestAnimationFrame((function(){var o,a=i(n);try{var l=function(){var n=o.value;if("attributes"===n.type&&"data-unitone-layout"===n.attributeName){var i,a,l,d,s=[].concat(r(null!==(i=null==e||null===(a=e.ignore)||void 0===a?void 0:a.layout)&&void 0!==i?i:[]),["divider:initialized","-bol","-linewrap","-stack"]);(null!==(l=n.target.getAttribute(n.attributeName))&&void 0!==l?l:"").split(" ").filter((function(t){return!s.includes(t)})).join(" ")!==(null!==(d=n.oldValue)&&void 0!==d?d:"").split(" ").filter((function(t){return!s.includes(t)})).join(" ")&&u(t)}else if("attributes"===n.type&&"class"===n.attributeName){var c,v,f,y,p=r(null!==(c=null==e||null===(v=e.ignore)||void 0===v?void 0:v.className)&&void 0!==c?c:[]);(null!==(f=n.target.getAttribute(n.attributeName))&&void 0!==f?f:"").split(" ").filter((function(t){return!p.includes(t)})).join(" ")!==(null!==(y=n.oldValue)&&void 0!==y?y:"").split(" ").filter((function(t){return!p.includes(t)})).join(" ")&&u(t)}else"attributes"===n.type&&"style"===n.attributeName&&u(t)};for(a.s();!(o=a.n()).done;)l()}catch(t){a.e(t)}finally{a.f()}}))}));return o.observe(t),l.observe(t,{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,subtree:!0,characterData:!0}),{resizeObserver:o,mutationObserver:l}},e.result1emPxForFireFoxObserver=function(t){var e=t.ownerDocument;if(e.defaultView.getComputedStyle(e.documentElement).getPropertyValue("--unitone--is-firefox").trim()){var n=0,r=new ResizeObserver(a((function(t){var e,r=i(t);try{for(r.s();!(e=r.n()).done;){var o,a=e.value,u=null===(o=a.borderBoxSize)||void 0===o?void 0:o[0].inlineSize;u!==n&&(s(a.target),n=u)}}catch(t){r.e(t)}finally{r.f()}}),250)),o=new MutationObserver((function(){requestAnimationFrame((function(){s(t)}))}));return r.observe(t),o.observe(t,{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0}),{resizeObserver:r,mutationObserver:o}}},e.setColumnCountForVertical=d,e.setDividerLinewrap=u,e.setResult1emPxForFireFox=s,e.setStairsStep=l,e.stairsResizeObserver=function(t){var e=new ResizeObserver(a((function(t){var e,n=i(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;l(r.target)}}catch(t){n.e(t)}finally{n.f()}}),250));return e.observe(t),e},e.verticalsResizeObserver=function(t){var e=0,n=new ResizeObserver(a((function(t){var n,r=i(t);try{for(r.s();!(n=r.n()).done;){var o,a=n.value,u=null===(o=a.contentRect)||void 0===o?void 0:o.width;parseInt(u)!==parseInt(e)&&(e=u,a.target.parentNode.style.height="",d(a.target))}}catch(t){r.e(t)}finally{r.f()}}),250));n.observe(t);var r=new MutationObserver((function(e){requestAnimationFrame((function(){if(0<e.length){var n,r,i=e[0],o=null===(n=i.addedNodes)||void 0===n?void 0:n[0],a=null===(r=i.removedNodes)||void 0===r?void 0:r[0];if((null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===o.getAttribute("data-unitone-layout")||(null==a?void 0:a.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===a.getAttribute("data-unitone-layout")||(null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:initialized"===o.getAttribute("data-unitone-layout")||(null==a?void 0:a.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:initialized"===a.getAttribute("data-unitone-layout")||(null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:safari"===o.getAttribute("data-unitone-layout")||(null==a?void 0:a.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:safari"===a.getAttribute("data-unitone-layout"))return;d(t)}}))}));return r.observe(t,{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0}),{resizeObserver:n,mutationObserver:r}},e}();function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return i(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t))||e){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},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 a,u=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){l=!0,a=t},f:function(){try{u||null==n.return||n.return()}finally{if(l)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(t){requestAnimationFrame((function(){var e,i=r(t);try{for(i.s();!(e=i.n()).done;){e.value.addedNodes.forEach((function(t){var e,r=null===(e=t.parentNode)||void 0===e?void 0:e.querySelectorAll('[data-unitone-layout*="-divider:"]');null==r||r.forEach((function(t){n.dividersResizeObserver(t)}))}))}}catch(t){i.e(t)}finally{i.f()}}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(t){requestAnimationFrame((function(){var e,i=r(t);try{for(i.s();!(e=i.n()).done;){e.value.addedNodes.forEach((function(t){var e,r=null===(e=t.parentNode)||void 0===e?void 0:e.querySelectorAll('[data-unitone-layout*="-stairs:"]');null==r||r.forEach((function(t){n.stairsResizeObserver(t)}))}))}}catch(t){i.e(t)}finally{i.f()}}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(t){requestAnimationFrame((function(){var e,i=r(t);try{for(i.s();!(e=i.n()).done;){e.value.addedNodes.forEach((function(t){var e,r=null===(e=t.parentNode)||void 0===e?void 0:e.querySelectorAll('[data-unitone-layout~="vertical-writing"]');null==r||r.forEach((function(t){n.verticalsResizeObserver(t)}))}))}}catch(t){i.e(t)}finally{i.f()}}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){window.getComputedStyle(document.documentElement).getPropertyValue("--unitone--is-firefox").trim()&&new MutationObserver((function(t){requestAnimationFrame((function(){var e,i=r(t);try{for(i.s();!(e=i.n()).done;){e.value.addedNodes.forEach((function(t){var e,r=null===(e=t.parentNode)||void 0===e?void 0:e.querySelectorAll('[style*="font-size:"], [data-unitone-layout~="-fluid-typography"]');null==r||r.forEach((function(t){n.result1emPxForFireFoxObserver(t)}))}))}}catch(t){i.e(t)}finally{i.f()}}))})).observe(document.body,{childList:!0,subtree:!0})}));
|
|
1
|
+
"use strict";var e,t={};var n=function(){if(e)return t;function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function r(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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 a,u=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){l=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(l)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t){var n;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=this;clearTimeout(n),n=setTimeout((function(){e.apply(a,i)}),t)}}e=1;var u=function(e){var t,n,r,i=null===(t=[].slice.call(null!==(n=null==e?void 0:e.children)&&void 0!==n?n:[]))||void 0===t?void 0:t[0];if(i){var o,a=i.getBoundingClientRect(),u=(null!==(r=e.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/);u.some((function(e){return["divider:initialized","-stack"].includes(e)}))&&(u=u.filter((function(e){return!["divider:initialized","-stack"].includes(e)})),e.setAttribute("data-unitone-layout",u.join(" ")));var l=[].slice.call(e.children).filter((function(e){var t=window.getComputedStyle(e).getPropertyValue("position"),n=window.getComputedStyle(e).getPropertyValue("display");return"absolute"!==t&&"fixed"!==t&&"none"!==n}));l.forEach((function(e,t){var n,r,i=(null!==(n=e.getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/);i.some((function(e){return["-bol","-linewrap"].includes(e)}))&&(i=i.filter((function(e){return!["-bol","-linewrap"].includes(e)})),e.setAttribute("data-unitone-layout",i.join(" ")));var u=null===(r=o)||void 0===r?void 0:r.getBoundingClientRect(),l=e.getBoundingClientRect(),d=!1;(0===t||(null==u?void 0:u.top)<l.top&&(null==u?void 0:u.left)>=l.left)&&(i.push("-bol"),d=!0),0<t&&a.top<l.top&&(i.push("-linewrap"),d=!0),d&&e.setAttribute("data-unitone-layout",i.join(" ")),o=e})),[].slice.call(l).every((function(e){return e.getBoundingClientRect().left===a.left}))&&u.push("-stack"),u.push("divider:initialized"),e.setAttribute("data-unitone-layout",u.join(" "))}},l=function(e){var t,n,r,i=[].slice.call(e.children),o=null==i?void 0:i[0];if(o){e.style.removeProperty("--unitone--stairs-step-overflow-volume"),e.style.removeProperty("--unitone--max-stairs-step"),[].slice.call(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach((function(e){e.style.removeProperty("--unitone--stairs-step")}));var a,u=[],l=0,d=l,s=null===(n=(null!==(r=e.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/).find((function(e){return e.startsWith("-stairs-up:")})))||void 0===n?void 0:n.replace("-stairs-up:",""),c=["up-down","down-up"].includes(s),v=window.getComputedStyle(e).getPropertyValue("flex-direction");i.forEach((function(e){var t,n,r=window.getComputedStyle(e).getPropertyValue("position"),i=window.getComputedStyle(e).getPropertyValue("display");if("absolute"!==r&&"fixed"!==r&&"none"!==i){u.push(e);var s="row-reverse"===v?(null===(t=a)||void 0===t||null===(t=t.getBoundingClientRect())||void 0===t?void 0:t.left)<=e.getBoundingClientRect().left:(null===(n=a)||void 0===n||null===(n=n.getBoundingClientRect())||void 0===n?void 0:n.left)>=e.getBoundingClientRect().left;o===e||s?l=0:c?l=0===l?1:0:l++,e.style.setProperty("--unitone--stairs-step",l),a=e,l>d&&(d=l)}})),e.style.setProperty("--unitone--max-stairs-step",d);var f=e.getBoundingClientRect().bottom,y=u.reduce((function(e,t){var n=t.getBoundingClientRect().bottom-f;return e>n?e:n}),0);e.style.setProperty("--unitone--stairs-step-overflow-volume",y)}},d=function(e){var t;if(e){var n,r=(null!==(t=e.getAttribute("data-unitone-layout"))&&void 0!==t?t:"").split(/\s+/);if(r.some((function(e){return["vertical-writing:initialized","vertical-writing:safari","-force-switch"].includes(e)}))&&(r=r.filter((function(e){return!["vertical-writing:initialized","vertical-writing:safari","-force-switch"].includes(e)})),e.setAttribute("data-unitone-layout",r.join(" "))),[].slice.call(e.children).reverse().some((function(e){if(!["absolute","fixed"].includes(getComputedStyle(e).position)&&"none"!==getComputedStyle(e).display)return n=e,!0})),!n)return r.push("vertical-writing:initialized"),void e.setAttribute("data-unitone-layout",r.join(" "));var i=getComputedStyle(e),o=String(i.getPropertyValue("--unitone--threshold")).trim(),a=!1;setTimeout((function(){if(null!=e&&e.isConnected){if(o){var t=document.createElement("div");t.setAttribute("data-unitone-layout","vertical-writing__thresholder"),e.appendChild(t),a=t.offsetWidth>=e.offsetWidth,t.parentNode&&t.parentNode.removeChild(t)}var i;a?(r.push("-force-switch"),null!==(i=e.parentNode)&&void 0!==i&&i.style&&(e.parentNode.style.height="")):(e.getBoundingClientRect().left>n.getBoundingClientRect().left&&r.push("vertical-writing:safari"),e.setAttribute("data-unitone-layout",r.join(" ")),requestAnimationFrame((function(){if(null!=e&&e.isConnected){var t,r=e.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.top+r.height,a=i.top+i.height;o!==a&&null!==(t=e.parentNode)&&void 0!==t&&t.style&&(e.parentNode.style.height="".concat(Math.ceil(a-r.top),"px"))}}))),r.push("vertical-writing:initialized"),e.setAttribute("data-unitone-layout",r.join(" "))}}),250)}},s=function(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.fontSize);n!==parseFloat(t.getPropertyValue("--unitone--result--1em-px"))&&e.style.setProperty("--unitone--result--1em-px",n)},c=function(e){var t=function(){return e.querySelectorAll(':scope > [data-unitone-layout~="marquee"]')},n=t();if(0!==n.length){if(1===e.childElementCount&&1===n.length){var r=n[0],i=r.cloneNode(!0);i.setAttribute("aria-hidden","true"),r.after(i)}(n=t()).forEach((function(e){var t,n,r;r=(null!==(n=(t=e).getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).filter((function(e){return e&&"marquee:initialized"!==e})).join(" "),t.setAttribute("data-unitone-layout",r)})),requestAnimationFrame((function(){null!=e&&e.isConnected&&t().forEach((function(e){var t,n,r;(r=null!==(n=(t=e).getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).includes("marquee:initialized")||t.setAttribute("data-unitone-layout","".concat(r," marquee:initialized").trim())}))}))}};return t.debounce=a,t.dividersResizeObserver=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,o=new ResizeObserver(a((function(e){var t,r=i(e);try{for(r.s();!(t=r.n()).done;){var o,a=t.value,l=null===(o=a.borderBoxSize)||void 0===o?void 0:o[0].inlineSize;l!==n&&(u(a.target),n=l)}}catch(e){r.e(e)}finally{r.f()}}),250)),l=new MutationObserver((function(n){requestAnimationFrame((function(){var o,a=i(n);try{var l=function(){var n=o.value;if("attributes"===n.type&&"data-unitone-layout"===n.attributeName){var i,a,l,d,s=[].concat(r(null!==(i=null==t||null===(a=t.ignore)||void 0===a?void 0:a.layout)&&void 0!==i?i:[]),["divider:initialized","-bol","-linewrap","-stack"]);(null!==(l=n.target.getAttribute(n.attributeName))&&void 0!==l?l:"").split(" ").filter((function(e){return!s.includes(e)})).join(" ")!==(null!==(d=n.oldValue)&&void 0!==d?d:"").split(" ").filter((function(e){return!s.includes(e)})).join(" ")&&u(e)}else if("attributes"===n.type&&"class"===n.attributeName){var c,v,f,y,b=r(null!==(c=null==t||null===(v=t.ignore)||void 0===v?void 0:v.className)&&void 0!==c?c:[]);(null!==(f=n.target.getAttribute(n.attributeName))&&void 0!==f?f:"").split(" ").filter((function(e){return!b.includes(e)})).join(" ")!==(null!==(y=n.oldValue)&&void 0!==y?y:"").split(" ").filter((function(e){return!b.includes(e)})).join(" ")&&u(e)}else"attributes"===n.type&&"style"===n.attributeName&&u(e)};for(a.s();!(o=a.n()).done;)l()}catch(e){a.e(e)}finally{a.f()}}))}));return o.observe(e),l.observe(e,{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,subtree:!0,characterData:!0}),{resizeObserver:o,mutationObserver:l}},t.marqueeResizeObserver=function(e){var t=0;c(e);var n=new ResizeObserver(a((function(e){var n,r=i(e);try{for(r.s();!(n=r.n()).done;){var o,a=n.value,u=null===(o=a.contentRect)||void 0===o?void 0:o.width;parseInt(u)!==parseInt(t)&&(t=u,c(a.target))}}catch(e){r.e(e)}finally{r.f()}}),250));n.observe(e);var r=new MutationObserver((function(){requestAnimationFrame((function(){null!=e&&e.isConnected&&c(e)}))}));return r.observe(e,{childList:!0}),{resizeObserver:n,mutationObserver:r}},t.result1emPxForFireFoxObserver=function(e){var t=e.ownerDocument;if(t.defaultView.getComputedStyle(t.documentElement).getPropertyValue("--unitone--is-firefox").trim()){var n=0,r=new ResizeObserver(a((function(e){var t,r=i(e);try{for(r.s();!(t=r.n()).done;){var o,a=t.value,u=null===(o=a.borderBoxSize)||void 0===o?void 0:o[0].inlineSize;u!==n&&(s(a.target),n=u)}}catch(e){r.e(e)}finally{r.f()}}),250)),o=new MutationObserver((function(){requestAnimationFrame((function(){s(e)}))}));return r.observe(e),o.observe(e,{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0}),{resizeObserver:r,mutationObserver:o}}},t.setColumnCountForVertical=d,t.setDividerLinewrap=u,t.setMarquee=c,t.setResult1emPxForFireFox=s,t.setStairsStep=l,t.stairsResizeObserver=function(e){var t=new ResizeObserver(a((function(e){var t,n=i(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;l(r.target)}}catch(e){n.e(e)}finally{n.f()}}),250));return t.observe(e),t},t.verticalsResizeObserver=function(e){var t=0,n=new ResizeObserver(a((function(e){var n,r=i(e);try{for(r.s();!(n=r.n()).done;){var o,a=n.value,u=null===(o=a.contentRect)||void 0===o?void 0:o.width;parseInt(u)!==parseInt(t)&&(t=u,a.target.parentNode.style.height="",d(a.target))}}catch(e){r.e(e)}finally{r.f()}}),250));n.observe(e);var r=new MutationObserver((function(t){requestAnimationFrame((function(){if(0<t.length){var n,r,i=t[0],o=null===(n=i.addedNodes)||void 0===n?void 0:n[0],a=null===(r=i.removedNodes)||void 0===r?void 0:r[0];if((null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===o.getAttribute("data-unitone-layout")||(null==a?void 0:a.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===a.getAttribute("data-unitone-layout")||(null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:initialized"===o.getAttribute("data-unitone-layout")||(null==a?void 0:a.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:initialized"===a.getAttribute("data-unitone-layout")||(null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:safari"===o.getAttribute("data-unitone-layout")||(null==a?void 0:a.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:safari"===a.getAttribute("data-unitone-layout"))return;d(e)}}))}));return r.observe(e,{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0}),{resizeObserver:n,mutationObserver:r}},t}();function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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 a,u=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){l=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(e){requestAnimationFrame((function(){var t,i=r(e);try{for(i.s();!(t=i.n()).done;){t.value.addedNodes.forEach((function(e){var t,r=null===(t=e.parentNode)||void 0===t?void 0:t.querySelectorAll('[data-unitone-layout*="-divider:"]');null==r||r.forEach((function(e){n.dividersResizeObserver(e)}))}))}}catch(e){i.e(e)}finally{i.f()}}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(e){requestAnimationFrame((function(){var t,i=r(e);try{for(i.s();!(t=i.n()).done;){t.value.addedNodes.forEach((function(e){var t,r=null===(t=e.parentNode)||void 0===t?void 0:t.querySelectorAll('[data-unitone-layout*="-stairs:"]');null==r||r.forEach((function(e){n.stairsResizeObserver(e)}))}))}}catch(e){i.e(e)}finally{i.f()}}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(e){requestAnimationFrame((function(){var t,i=r(e);try{for(i.s();!(t=i.n()).done;){t.value.addedNodes.forEach((function(e){var t,r=null===(t=e.parentNode)||void 0===t?void 0:t.querySelectorAll('[data-unitone-layout~="vertical-writing"]');null==r||r.forEach((function(e){n.verticalsResizeObserver(e)}))}))}}catch(e){i.e(e)}finally{i.f()}}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){window.getComputedStyle(document.documentElement).getPropertyValue("--unitone--is-firefox").trim()&&new MutationObserver((function(e){requestAnimationFrame((function(){var t,i=r(e);try{for(i.s();!(t=i.n()).done;){t.value.addedNodes.forEach((function(e){var t,r=null===(t=e.parentNode)||void 0===t?void 0:t.querySelectorAll('[style*="font-size:"], [data-unitone-layout~="-fluid-typography"]');null==r||r.forEach((function(e){n.result1emPxForFireFoxObserver(e)}))}))}}catch(e){i.e(e)}finally{i.f()}}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(e){requestAnimationFrame((function(){var t,i=r(e);try{for(i.s();!(t=i.n()).done;){t.value.addedNodes.forEach((function(e){var t,r=null===(t=e.parentNode)||void 0===t?void 0:t.querySelectorAll('[data-unitone-layout~="marquee-wrapper"]');null==r||r.forEach((function(e){n.marqueeResizeObserver(e)}))}))}}catch(e){i.e(e)}finally{i.f()}}))})).observe(document.body,{childList:!0,subtree:!0})}));
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("react");function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)({}).hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},e.apply(null,arguments)}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 o(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var n=o.call(t,e);if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}function n(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){if(null==t)return{};var r,o,n=function(t,e){if(null==t)return{};var r={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(-1!==e.indexOf(o))continue;r[o]=t[o]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)r=i[o],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var c=["gap","columnGap","rowGap","alignItems","style"];function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}var l=["intrinsic","withText","gutters","maxWidth","style"];function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var d=["alignItems","divider","gap","columnGap","rowGap","justifyContent","tagName","style"],s=["align","gutters","maxWidth","text","style"];function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var g=["gap","minHeight","justifyContent","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","noPadding","style"],b=["valign","position","top","right","bottom","left","zIndex","tagName","style"];function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?y(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var j=["backgroundColor","borderColor","borderRadius","borderWidth","maxHeight","minHeight","maxWidth","color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","alignContent","justifyItems","shadow","position","top","right","bottom","left","zIndex","mixBlendMode","overflow","backdropFilter","progressiveBackdropFilter","progressiveBackdropFilterAngle","progressiveBackdropFilterStart","style"];function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var w=["gap","minWidth","minMeasure","position","style"];function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var D=["ratio","switchRatio","style"];function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var S=["padding","style"],k=["cover","fill","fixed","applyBlur","blur","portrait","gap","minHeight","columns","rows","style"];function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function W(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var G=["gap","columnWidth","style"];function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var T=["gap","height","itemWidth","noBar","style"];function L(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?L(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var F=["columnMinWidth","gap","autoRepeat","divider","stairs","stairsUp","style"];function H(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?H(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var N=["center","divider","gap","negative","revert","style"];function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}var A=["gap","columnGap","rowGap","limit","revert","threshold","alignItems","stairs","stairsUp","style"];function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var V=["center","column","applyGap","gap","gutters","maxWidth","columnWidth","style"];function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function K(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Q=["texture","textureColor","textureGap","textureSize","textureTop","textureRight","textureBottom","textureLeft","textureBorderRadius","textureBorderTopLeftRadius","textureBorderTopRightRadius","textureBorderBottomLeftRadius","textureBorderBottomRightRadius","style"];function X(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?X(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Z=["textOrientation","gap","maxHeight","switchWritingMode","threshold","style"];function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function tt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var et=["gap","columnGap","rowGap","contentMinWidth","revert","sidebar","sidebarWidth","alignItems","overflow","divider","style"];function rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}exports.BothSides=function(r){var o=r.gap,l=r.columnGap,u=r.rowGap,p=r.alignItems,d=r.style,s=i(r,c);return d=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},d),t.createElement("div",e({"data-unitone-layout":["both-sides",""!==(null!=o?o:"")?"-gap:".concat(o):void 0,""!==(null!=l?l:"")?"-column-gap:".concat(l):void 0,""!==(null!=u?u:"")?"-row-gap:".concat(u):void 0,""!==(null!=p?p:"")?"-align-items:".concat(p):void 0].filter(Boolean).join(" "),style:d},s),s.children)},exports.Center=function(r){r.intrinsic;var o=r.withText,n=r.gutters,c=r.maxWidth,a=r.style,u=i(r,l);return a=p(p({},a),{},{"--unitone--max-width":""!==c?c:void 0}),t.createElement("div",e({"data-unitone-layout":["center",!0===o?"-with-text":void 0,""!==(null!=n?n:"")?"-gutters:".concat(n):void 0].filter(Boolean).join(" "),style:a},u),u.children)},exports.Cluster=function(r){var o=r.alignItems,n=r.divider,c=r.gap,a=r.columnGap,l=r.rowGap,u=r.justifyContent,p=r.tagName,s=void 0===p?"div":p,v=r.style,f=i(r,d),g=s;return t.createElement(g,e({"data-unitone-layout":["cluster",""!==(null!=n?n:"")?"-divider:".concat(n):void 0,""!==(null!=c?c:"")?"-gap:".concat(c):void 0,""!==(null!=a?a:"")?"-column-gap:".concat(a):void 0,""!==(null!=l?l:"")?"-row-gap:".concat(l):void 0,""!==(null!=o?o:"")?"-align-items:".concat(o):void 0,""!==(null!=u?u:"")?"-justify-content:".concat(u):void 0].filter(Boolean).join(" "),style:v},f),f.children)},exports.Container=function(r){var o=r.align,n=r.gutters,c=r.maxWidth;r.text;var a=r.style,l=i(r,s);return a=f(f({},a),{},{"--unitone--max-width":""!==c?c:void 0}),t.createElement("div",e({"data-unitone-layout":["container",""!==(null!=o?o:"")?"-align:".concat(o):void 0,""!==(null!=n?n:"")?"-gutters:".concat(n):void 0].filter(Boolean).join(" "),style:a},l),l.children)},exports.Cover=function(e){var r=e.gap,o=e.minHeight;e.justifyContent;var n=e.padding,c=e.paddingTop,a=e.paddingRight,l=e.paddingBottom,u=e.paddingLeft,p=e.noPadding,d=e.style,s=i(e,g);return d=O(O({},d),{},{"--unitone--min-height":""!==o?o:void 0}),t.createElement("div",{"data-unitone-layout":["cover",p?"-no-padding":void 0,""!==(null!=r?r:"")?"-gap:".concat(r):void 0,""!==(null!=n?n:"")?"-padding:".concat(n):void 0,""!==(null!=c?c:"")?"-padding-top:".concat(c):void 0,""!==(null!=a?a:"")?"-padding-right:".concat(a):void 0,""!==(null!=l?l:"")?"-padding-bottom:".concat(l):void 0,""!==(null!=u?u:"")?"-padding-left:".concat(u):void 0].filter(Boolean).join(" "),style:d},s.children)},exports.CoverContent=function(r){var o=r.valign,n=r.position,c=r.top,a=r.right,l=r.bottom,u=r.left,p=r.zIndex,d=r.tagName,s=void 0===d?"div":d,v=r.style,f=i(r,b),g=s;return v=O(O({},v),{},{"--unitone--top":""!==c?c:void 0,"--unitone--right":""!==a?a:void 0,"--unitone--bottom":""!==l?l:void 0,"--unitone--left":""!==u?u:void 0,"--unitone--z-index":""!==p?p:void 0}),t.createElement(g,e({"data-unitone-layout":["cover__content",""!==(null!=o?o:"")?"-valign:".concat(o):void 0,""!==(null!=n?n:"")?"-position:".concat(n):void 0].filter(Boolean).join(" "),style:v},f),f.children)},exports.Decorator=function(r){var o=r.backgroundColor,n=r.borderColor,c=r.borderRadius,a=r.borderWidth,l=r.maxHeight,u=r.minHeight,p=r.maxWidth,d=r.color,s=r.padding,v=r.paddingTop,f=r.paddingRight,g=r.paddingBottom,b=r.paddingLeft,y=r.gap,O=r.alignContent,h=r.justifyItems,w=r.shadow,P=r.position,x=r.top,D=r.right,E=r.bottom,B=r.left,S=r.zIndex,k=r.mixBlendMode,R=r.overflow,W=r.backdropFilter,G=r.progressiveBackdropFilter,C=r.progressiveBackdropFilterAngle,I=r.progressiveBackdropFilterStart,T=r.style,L=i(r,j);return T=m(m({},T),{},{"--unitone--background-color":""!==o?o:void 0,"--unitone--border-color":""!==n?n:void 0,"--unitone--border-radius":""!==c?c:void 0,"--unitone--border-width":""!==a?a:void 0,"--unitone--max-height":""!==l?l:void 0,"--unitone--min-height":""!==u?u:void 0,"--unitone--max-width":""!==p?p:void 0,"--unitone--color":""!==d?d:void 0,"--unitone--top":""!==x?x:void 0,"--unitone--right":""!==D?D:void 0,"--unitone--bottom":""!==E?E:void 0,"--unitone--left":""!==B?B:void 0,"--unitone--z-index":""!==S?S:void 0,"--unitone--backdrop-filter":""!==W?W:void 0,"--unitone--progressive-backdrop-filter-angle":G&&""!==C?C:void 0,"--unitone--progressive-backdrop-filter-start":I&&""!==I?I:void 0}),t.createElement("div",e({"data-unitone-layout":["decorator",""!==(null!=y?y:"")?"-gap:".concat(y):void 0,""!==(null!=O?O:"")?"-align-content:".concat(O):void 0,""!==(null!=h?h:"")?"-justify-items:".concat(h):void 0,""!==(null!=s?s:"")?"-padding:".concat(s):void 0,""!==(null!=v?v:"")?"-padding-top:".concat(v):void 0,""!==(null!=f?f:"")?"-padding-right:".concat(f):void 0,""!==(null!=g?g:"")?"-padding-bottom:".concat(g):void 0,""!==(null!=b?b:"")?"-padding-left:".concat(b):void 0,w?"-shadow":void 0,""!==(null!=P?P:"")?"-position:".concat(P):void 0,""!==(null!=k?k:"")?"-mix-blend-mode:".concat(k):void 0,""!==(null!=R?R:"")?"-overflow:".concat(R):void 0,G?"-progressive-backdrop-filter":void 0].filter(Boolean).join(" "),style:T},L),L.children)},exports.Float=function(r){var o=r.gap,n=r.minWidth,c=r.minMeasure,a=r.position,l=r.style,u=i(r,w);return l=x(x({},l),{},{"--unitone--min-width":""!==n?n:void 0,"--unitone--min-measure":""!==c?c:void 0}),t.createElement("div",e({"data-unitone-layout":["float",""!==(null!=a?a:"")?"-position:".concat(a):void 0,""!==(null!=o?o:"")?"-gap:".concat(o):void 0].filter(Boolean).join(" "),style:l},u),u.children)},exports.Frame=function(r){var o=r.ratio,n=r.switchRatio,c=r.style,a=i(r,D);return c=B(B({},c),{},{"--unitone--ratio":""!==o?o:void 0}),t.createElement("div",e({"data-unitone-layout":["frame",n?"-switch":void 0].filter(Boolean).join(" "),style:c},a),a.children)},exports.Gutters=function(r){var o=r.padding,n=r.style,c=i(r,S);return t.createElement("div",e({"data-unitone-layout":["gutters",""!==(null!=o?o:"")?"-padding:".concat(o):void 0].filter(Boolean).join(" "),style:n},c),c.children)},exports.Layers=function(r){var o=r.cover,n=r.fill,c=r.fixed,a=r.applyBlur,l=r.blur,u=r.portrait,p=r.gap,d=r.minHeight,s=r.columns,v=r.rows,f=r.style,g=i(r,k);return f=W(W({},f),{},{"--unitone--min-height":""!==d?d:void 0,"--unitone--columns":""!==s?s:void 0,"--unitone--rows":""!==v?v:void 0,"--unitone--blur":""!==l?l:void 0}),t.createElement("div",e({"data-unitone-layout":["layers",""!==(null!=p?p:"")?"-gap:".concat(p):void 0,o?"-cover":void 0,n?"-fill":void 0,c?"-fixed":void 0,a?"-blur":void 0,u?"-portrait":void 0].filter(Boolean).join(" "),style:f},g),g.children)},exports.Masonry=function(r){var o=r.gap,n=r.columnWidth,c=r.style,a=i(r,G);return c=I(I({},c),{},{"--unitone--column-width":""!==n?n:void 0}),t.createElement("div",e({"data-unitone-layout":["masonry",""!==(null!=o?o:"")?"-gap:".concat(o):void 0].filter(Boolean).join(" "),style:c},a),a.children)},exports.Reel=function(r){var o=r.gap,n=r.height,c=r.itemWidth,a=r.noBar,l=r.style,u=i(r,T);return l=M(M({},l),{},{"--unitone--height":""!==n?n:void 0,"--unitone--item-width":""!==c?c:void 0}),t.createElement("div",e({"data-unitone-layout":["reel",""!==(null!=o?o:"")?"-gap:".concat(o):void 0,a?"-no-bar":void 0].filter(Boolean).join(" "),style:l},u),u.children)},exports.ResponsiveGrid=function(r){var o=r.columnMinWidth,n=r.gap,c=r.autoRepeat,a=r.divider,l=r.stairs,u=r.stairsUp,p=r.style,d=i(r,F);return p=z(z({},p),{},{"--unitone--column-min-width":""!==o?o:void 0}),t.createElement("div",e({"data-unitone-layout":["responsive-grid",""!==(null!=n?n:"")?"-gap:".concat(n):void 0,""!==(null!=c?c:"")?"-auto-repeat:".concat(c):void 0,""!==(null!=a?a:"")?"-divider:".concat(a):void 0,""!==(null!=l?l:"")?"-stairs:".concat(l):void 0,""!==(null!=u?u:"")?"-stairs-up:".concat(u):void 0].filter(Boolean).join(" "),style:p},d),d.children)},exports.Stack=function(r){r.center;var o=r.divider,c=r.gap,a=r.negative,l=r.revert,u=r.style,p=i(r,N);return u=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},u),t.createElement("div",e({"data-unitone-layout":["stack",l?"-revert":void 0,""!==(null!=o?o:"")?"-divider:".concat(o):void 0,""!==(null!=c?c:"")?"-gap:".concat(c):void 0,a?"-negative":void 0].filter(Boolean).join(" "),style:u},p),p.children)},exports.Switcher=function(r){var o=r.gap,n=r.columnGap,c=r.rowGap;r.limit;var a=r.revert,l=r.threshold,u=r.alignItems,p=r.stairs,d=r.stairsUp,s=r.style,v=i(r,A);return s=q(q({},s),{},{"--unitone--threshold":""!==l?l:void 0}),t.createElement("div",e({"data-unitone-layout":["switcher",a?"-revert":void 0,""!==(null!=o?o:"")?"-gap:".concat(o):void 0,""!==(null!=n?n:"")?"-column-gap:".concat(n):void 0,""!==(null!=c?c:"")?"-row-gap:".concat(c):void 0,""!==(null!=u?u:"")?"-align-items:".concat(u):void 0,""!==(null!=p?p:"")?"-stairs:".concat(p):void 0,""!==(null!=d?d:"")?"-stairs-up:".concat(d):void 0].filter(Boolean).join(" "),style:s},v),v.children)},exports.Text=function(r){var o=r.center,n=r.column,c=r.applyGap,a=r.gap,l=r.gutters,u=r.maxWidth,p=r.columnWidth,d=r.style,s=i(r,V);return d=K(K({},d),{},{"--unitone--max-width":""!==u?u:void 0,"--unitone--column-width":""!==p?p:void 0}),t.createElement("div",e({"data-unitone-layout":["text",o?"-center":void 0,n?"-column":void 0,c?"-gap":void 0,""!==(null!=a?a:"")?"-gap:".concat(a):void 0,""!==(null!=l?l:"")?"-gutters:".concat(l):void 0].filter(Boolean).join(" "),style:d},s),s.children)},exports.Texture=function(r){var o=r.texture,n=r.textureColor,c=r.textureGap,a=r.textureSize,l=r.textureTop,u=r.textureRight,p=r.textureBottom,d=r.textureLeft,s=r.textureBorderRadius,v=r.textureBorderTopLeftRadius,f=r.textureBorderTopRightRadius,g=r.textureBorderBottomLeftRadius,b=r.textureBorderBottomRightRadius,y=r.style,O=i(r,Q);return y=Y(Y({},y),{},{"--unitone--texture-color":""!==n?n:void 0,"--unitone--texture-gap":""!==c?c:void 0,"--unitone--texture-size":""!==a?a:void 0,"--unitone--texture-top":""!==l?l:void 0,"--unitone--texture-right":""!==u?u:void 0,"--unitone--texture-bottom":""!==p?p:void 0,"--unitone--texture-left":""!==d?d:void 0,"--unitone--texture-border-radius":""!==s?s:void 0,"--unitone--texture-border-top-left-radius":""!==v?v:void 0,"--unitone--texture-border-top-right-radius":""!==f?f:void 0,"--unitone--texture-border-bottom-left-radius":""!==g?g:void 0,"--unitone--texture-border-bottom-right-radius":""!==b?b:void 0}),t.createElement("div",e({"data-unitone-layout":["texture",""!==(null!=o?o:"")?"-texture:".concat(o):void 0].filter(Boolean).join(" "),style:y},O),O.children)},exports.VerticalWriting=function(r){var o=r.textOrientation,n=r.gap,c=r.maxHeight,a=r.switchWritingMode,l=r.threshold,u=r.style,p=i(r,Z);return u=tt(tt({},u),{},{"--unitone--max-height":""!==c?c:void 0,"--unitone--threshold":""!==l?l:void 0}),t.createElement("div",{"data-unitone-layout":"vertical-writing-wrapper"},t.createElement("div",e({"data-unitone-layout":["vertical-writing",""!==(null!=o?o:"")?"-text-orientation:".concat(o):void 0,""!==(null!=n?n:"")?"-gap:".concat(n):void 0,a?"-switch":void 0].filter(Boolean).join(" "),style:u},p),p.children))},exports.WithSidebar=function(r){var o=r.gap,n=r.columnGap,c=r.rowGap,a=r.contentMinWidth,l=r.revert,u=r.sidebar,p=r.sidebarWidth,d=r.alignItems,s=r.overflow,v=r.divider,f=r.style,g=i(r,et);return f=ot(ot({},f),{},{"--unitone--sidebar-width":""!==p?p:void 0,"--unitone--content-min-width":""!==a?a:void 0}),t.createElement("div",e({"data-unitone-layout":["with-sidebar",l?"-revert":void 0,""!==(null!=o?o:"")?"-gap:".concat(o):void 0,""!==(null!=n?n:"")?"-column-gap:".concat(n):void 0,""!==(null!=c?c:"")?"-row-gap:".concat(c):void 0,""!==(null!=u?u:"")?"-sidebar:".concat(u):void 0,""!==(null!=d?d:"")?"-align-items:".concat(d):void 0,""!==(null!=s?s:"")?"-overflow:".concat(s):void 0,""!==(null!=v?v:"")?"-divider:".concat(v):void 0].filter(Boolean).join(" "),style:f},g),g.children)};
|
|
1
|
+
"use strict";var t=require("react");function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)({}).hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},e.apply(null,arguments)}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 o(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var n=o.call(t,e);if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}function n(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){if(null==t)return{};var r,o,n=function(t,e){if(null==t)return{};var r={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(-1!==e.indexOf(o))continue;r[o]=t[o]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)r=i[o],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var c=["gap","columnGap","rowGap","alignItems","style"];function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}var l=["intrinsic","withText","gutters","maxWidth","style"];function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var d=["alignItems","divider","gap","columnGap","rowGap","justifyContent","nowrap","tagName","style"],s=["align","gutters","maxWidth","text","style"];function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var b=["gap","minHeight","justifyContent","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","noPadding","style"],g=["valign","position","top","right","bottom","left","zIndex","tagName","style"];function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?y(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var j=["backgroundColor","borderColor","borderRadius","borderWidth","maxHeight","minHeight","maxWidth","color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","alignContent","justifyItems","shadow","position","top","right","bottom","left","zIndex","mixBlendMode","overflow","backdropFilter","progressiveBackdropFilter","progressiveBackdropFilterAngle","progressiveBackdropFilterStart","style"];function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var w=["gap","minWidth","minMeasure","position","style"];function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var D=["ratio","switchRatio","style"];function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var S=["padding","style"],k=["cover","fill","fixed","applyBlur","blur","portrait","gap","minHeight","columns","rows","style"];function W(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var G=["duration","gap","itemWidth","reverse","pauseOnHover","style"];function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var T=["gap","columnWidth","style"];function H(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?H(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var L=["gap","height","itemWidth","noBar","style"];function F(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?F(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var N=["columnMinWidth","gap","autoRepeat","divider","stairs","stairsUp","style"];function q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function U(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?q(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var A=["center","divider","gap","negative","revert","style"];function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}var V=["gap","columnGap","rowGap","limit","revert","threshold","alignItems","stairs","stairsUp","style"];function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function K(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Q=["center","column","applyGap","gap","gutters","maxWidth","columnWidth","style"];function X(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?X(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Z=["texture","textureColor","textureGap","textureSize","textureTop","textureRight","textureBottom","textureLeft","textureBorderRadius","textureBorderTopLeftRadius","textureBorderTopRightRadius","textureBorderBottomLeftRadius","textureBorderBottomRightRadius","style"];function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function tt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var et=["textOrientation","gap","maxHeight","switchWritingMode","threshold","style"];function rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var nt=["gap","columnGap","rowGap","contentMinWidth","revert","sidebar","sidebarWidth","alignItems","overflow","divider","style"];function it(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?it(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}exports.BothSides=function(r){var o=r.gap,l=r.columnGap,u=r.rowGap,p=r.alignItems,d=r.style,s=i(r,c);return d=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},d),t.createElement("div",e({"data-unitone-layout":["both-sides",""!==(null!=o?o:"")?"-gap:".concat(o):void 0,""!==(null!=l?l:"")?"-column-gap:".concat(l):void 0,""!==(null!=u?u:"")?"-row-gap:".concat(u):void 0,""!==(null!=p?p:"")?"-align-items:".concat(p):void 0].filter(Boolean).join(" "),style:d},s),s.children)},exports.Center=function(r){r.intrinsic;var o=r.withText,n=r.gutters,c=r.maxWidth,a=r.style,u=i(r,l);return a=p(p({},a),{},{"--unitone--max-width":""!==c?c:void 0}),t.createElement("div",e({"data-unitone-layout":["center",!0===o?"-with-text":void 0,""!==(null!=n?n:"")?"-gutters:".concat(n):void 0].filter(Boolean).join(" "),style:a},u),u.children)},exports.Cluster=function(r){var o=r.alignItems,n=r.divider,c=r.gap,a=r.columnGap,l=r.rowGap,u=r.justifyContent,p=r.nowrap,s=r.tagName,v=void 0===s?"div":s,f=r.style,b=i(r,d),g=v;return t.createElement(g,e({"data-unitone-layout":["cluster",""!==(null!=n?n:"")?"-divider:".concat(n):void 0,""!==(null!=c?c:"")?"-gap:".concat(c):void 0,""!==(null!=a?a:"")?"-column-gap:".concat(a):void 0,""!==(null!=l?l:"")?"-row-gap:".concat(l):void 0,""!==(null!=o?o:"")?"-align-items:".concat(o):void 0,""!==(null!=u?u:"")?"-justify-content:".concat(u):void 0,p?"-nowrap":void 0].filter(Boolean).join(" "),style:f},b),b.children)},exports.Container=function(r){var o=r.align,n=r.gutters,c=r.maxWidth;r.text;var a=r.style,l=i(r,s);return a=f(f({},a),{},{"--unitone--max-width":""!==c?c:void 0}),t.createElement("div",e({"data-unitone-layout":["container",""!==(null!=o?o:"")?"-align:".concat(o):void 0,""!==(null!=n?n:"")?"-gutters:".concat(n):void 0].filter(Boolean).join(" "),style:a},l),l.children)},exports.Cover=function(e){var r=e.gap,o=e.minHeight;e.justifyContent;var n=e.padding,c=e.paddingTop,a=e.paddingRight,l=e.paddingBottom,u=e.paddingLeft,p=e.noPadding,d=e.style,s=i(e,b);return d=O(O({},d),{},{"--unitone--min-height":""!==o?o:void 0}),t.createElement("div",{"data-unitone-layout":["cover",p?"-no-padding":void 0,""!==(null!=r?r:"")?"-gap:".concat(r):void 0,""!==(null!=n?n:"")?"-padding:".concat(n):void 0,""!==(null!=c?c:"")?"-padding-top:".concat(c):void 0,""!==(null!=a?a:"")?"-padding-right:".concat(a):void 0,""!==(null!=l?l:"")?"-padding-bottom:".concat(l):void 0,""!==(null!=u?u:"")?"-padding-left:".concat(u):void 0].filter(Boolean).join(" "),style:d},s.children)},exports.CoverContent=function(r){var o=r.valign,n=r.position,c=r.top,a=r.right,l=r.bottom,u=r.left,p=r.zIndex,d=r.tagName,s=void 0===d?"div":d,v=r.style,f=i(r,g),b=s;return v=O(O({},v),{},{"--unitone--top":""!==c?c:void 0,"--unitone--right":""!==a?a:void 0,"--unitone--bottom":""!==l?l:void 0,"--unitone--left":""!==u?u:void 0,"--unitone--z-index":""!==p?p:void 0}),t.createElement(b,e({"data-unitone-layout":["cover__content",""!==(null!=o?o:"")?"-valign:".concat(o):void 0,""!==(null!=n?n:"")?"-position:".concat(n):void 0].filter(Boolean).join(" "),style:v},f),f.children)},exports.Decorator=function(r){var o=r.backgroundColor,n=r.borderColor,c=r.borderRadius,a=r.borderWidth,l=r.maxHeight,u=r.minHeight,p=r.maxWidth,d=r.color,s=r.padding,v=r.paddingTop,f=r.paddingRight,b=r.paddingBottom,g=r.paddingLeft,y=r.gap,O=r.alignContent,m=r.justifyItems,w=r.shadow,P=r.position,x=r.top,D=r.right,E=r.bottom,B=r.left,S=r.zIndex,k=r.mixBlendMode,W=r.overflow,R=r.backdropFilter,G=r.progressiveBackdropFilter,C=r.progressiveBackdropFilterAngle,I=r.progressiveBackdropFilterStart,T=r.style,H=i(r,j);return T=h(h({},T),{},{"--unitone--background-color":""!==o?o:void 0,"--unitone--border-color":""!==n?n:void 0,"--unitone--border-radius":""!==c?c:void 0,"--unitone--border-width":""!==a?a:void 0,"--unitone--max-height":""!==l?l:void 0,"--unitone--min-height":""!==u?u:void 0,"--unitone--max-width":""!==p?p:void 0,"--unitone--color":""!==d?d:void 0,"--unitone--top":""!==x?x:void 0,"--unitone--right":""!==D?D:void 0,"--unitone--bottom":""!==E?E:void 0,"--unitone--left":""!==B?B:void 0,"--unitone--z-index":""!==S?S:void 0,"--unitone--backdrop-filter":""!==R?R:void 0,"--unitone--progressive-backdrop-filter-angle":G&&""!==C?C:void 0,"--unitone--progressive-backdrop-filter-start":I&&""!==I?I:void 0}),t.createElement("div",e({"data-unitone-layout":["decorator",""!==(null!=y?y:"")?"-gap:".concat(y):void 0,""!==(null!=O?O:"")?"-align-content:".concat(O):void 0,""!==(null!=m?m:"")?"-justify-items:".concat(m):void 0,""!==(null!=s?s:"")?"-padding:".concat(s):void 0,""!==(null!=v?v:"")?"-padding-top:".concat(v):void 0,""!==(null!=f?f:"")?"-padding-right:".concat(f):void 0,""!==(null!=b?b:"")?"-padding-bottom:".concat(b):void 0,""!==(null!=g?g:"")?"-padding-left:".concat(g):void 0,w?"-shadow":void 0,""!==(null!=P?P:"")?"-position:".concat(P):void 0,""!==(null!=k?k:"")?"-mix-blend-mode:".concat(k):void 0,""!==(null!=W?W:"")?"-overflow:".concat(W):void 0,G?"-progressive-backdrop-filter":void 0].filter(Boolean).join(" "),style:T},H),H.children)},exports.Float=function(r){var o=r.gap,n=r.minWidth,c=r.minMeasure,a=r.position,l=r.style,u=i(r,w);return l=x(x({},l),{},{"--unitone--min-width":""!==n?n:void 0,"--unitone--min-measure":""!==c?c:void 0}),t.createElement("div",e({"data-unitone-layout":["float",""!==(null!=a?a:"")?"-position:".concat(a):void 0,""!==(null!=o?o:"")?"-gap:".concat(o):void 0].filter(Boolean).join(" "),style:l},u),u.children)},exports.Frame=function(r){var o=r.ratio,n=r.switchRatio,c=r.style,a=i(r,D);return c=B(B({},c),{},{"--unitone--ratio":""!==o?o:void 0}),t.createElement("div",e({"data-unitone-layout":["frame",n?"-switch":void 0].filter(Boolean).join(" "),style:c},a),a.children)},exports.Gutters=function(r){var o=r.padding,n=r.style,c=i(r,S);return t.createElement("div",e({"data-unitone-layout":["gutters",""!==(null!=o?o:"")?"-padding:".concat(o):void 0].filter(Boolean).join(" "),style:n},c),c.children)},exports.Layers=function(r){var o=r.cover,n=r.fill,c=r.fixed,a=r.applyBlur,l=r.blur,u=r.portrait,p=r.gap,d=r.minHeight,s=r.columns,v=r.rows,f=r.style,b=i(r,k);return f=R(R({},f),{},{"--unitone--min-height":""!==d?d:void 0,"--unitone--columns":""!==s?s:void 0,"--unitone--rows":""!==v?v:void 0,"--unitone--blur":""!==l?l:void 0}),t.createElement("div",e({"data-unitone-layout":["layers",""!==(null!=p?p:"")?"-gap:".concat(p):void 0,o?"-cover":void 0,n?"-fill":void 0,c?"-fixed":void 0,a?"-blur":void 0,u?"-portrait":void 0].filter(Boolean).join(" "),style:f},b),b.children)},exports.Marquee=function(r){var o=r.duration,n=r.gap,c=r.itemWidth,a=r.reverse,l=r.pauseOnHover,u=r.style,p=i(r,G);return u=I(I({},u),{},{"--unitone--animation-duration":""!==o?o:void 0,"--unitone--item-width":""!==c?c:void 0}),t.createElement("div",e({"data-unitone-layout":["marquee-wrapper",a?"-reverse":void 0,l?"-pause-on-hover":void 0].filter(Boolean).join(" "),style:u},p),t.createElement("div",{"data-unitone-layout":["marquee",""!==(null!=n?n:"")?"-gap:".concat(n):void 0].filter(Boolean).join(" ")},p.children))},exports.Masonry=function(r){var o=r.gap,n=r.columnWidth,c=r.style,a=i(r,T);return c=M(M({},c),{},{"--unitone--column-width":""!==n?n:void 0}),t.createElement("div",e({"data-unitone-layout":["masonry",""!==(null!=o?o:"")?"-gap:".concat(o):void 0].filter(Boolean).join(" "),style:c},a),a.children)},exports.Reel=function(r){var o=r.gap,n=r.height,c=r.itemWidth,a=r.noBar,l=r.style,u=i(r,L);return l=z(z({},l),{},{"--unitone--height":""!==n?n:void 0,"--unitone--item-width":""!==c?c:void 0}),t.createElement("div",e({"data-unitone-layout":["reel",""!==(null!=o?o:"")?"-gap:".concat(o):void 0,a?"-no-bar":void 0].filter(Boolean).join(" "),style:l},u),u.children)},exports.ResponsiveGrid=function(r){var o=r.columnMinWidth,n=r.gap,c=r.autoRepeat,a=r.divider,l=r.stairs,u=r.stairsUp,p=r.style,d=i(r,N);return p=U(U({},p),{},{"--unitone--column-min-width":""!==o?o:void 0}),t.createElement("div",e({"data-unitone-layout":["responsive-grid",""!==(null!=n?n:"")?"-gap:".concat(n):void 0,""!==(null!=c?c:"")?"-auto-repeat:".concat(c):void 0,""!==(null!=a?a:"")?"-divider:".concat(a):void 0,""!==(null!=l?l:"")?"-stairs:".concat(l):void 0,""!==(null!=u?u:"")?"-stairs-up:".concat(u):void 0].filter(Boolean).join(" "),style:p},d),d.children)},exports.Stack=function(r){r.center;var o=r.divider,c=r.gap,a=r.negative,l=r.revert,u=r.style,p=i(r,A);return u=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},u),t.createElement("div",e({"data-unitone-layout":["stack",l?"-revert":void 0,""!==(null!=o?o:"")?"-divider:".concat(o):void 0,""!==(null!=c?c:"")?"-gap:".concat(c):void 0,a?"-negative":void 0].filter(Boolean).join(" "),style:u},p),p.children)},exports.Switcher=function(r){var o=r.gap,n=r.columnGap,c=r.rowGap;r.limit;var a=r.revert,l=r.threshold,u=r.alignItems,p=r.stairs,d=r.stairsUp,s=r.style,v=i(r,V);return s=K(K({},s),{},{"--unitone--threshold":""!==l?l:void 0}),t.createElement("div",e({"data-unitone-layout":["switcher",a?"-revert":void 0,""!==(null!=o?o:"")?"-gap:".concat(o):void 0,""!==(null!=n?n:"")?"-column-gap:".concat(n):void 0,""!==(null!=c?c:"")?"-row-gap:".concat(c):void 0,""!==(null!=u?u:"")?"-align-items:".concat(u):void 0,""!==(null!=p?p:"")?"-stairs:".concat(p):void 0,""!==(null!=d?d:"")?"-stairs-up:".concat(d):void 0].filter(Boolean).join(" "),style:s},v),v.children)},exports.Text=function(r){var o=r.center,n=r.column,c=r.applyGap,a=r.gap,l=r.gutters,u=r.maxWidth,p=r.columnWidth,d=r.style,s=i(r,Q);return d=Y(Y({},d),{},{"--unitone--max-width":""!==u?u:void 0,"--unitone--column-width":""!==p?p:void 0}),t.createElement("div",e({"data-unitone-layout":["text",o?"-center":void 0,n?"-column":void 0,c?"-gap":void 0,""!==(null!=a?a:"")?"-gap:".concat(a):void 0,""!==(null!=l?l:"")?"-gutters:".concat(l):void 0].filter(Boolean).join(" "),style:d},s),s.children)},exports.Texture=function(r){var o=r.texture,n=r.textureColor,c=r.textureGap,a=r.textureSize,l=r.textureTop,u=r.textureRight,p=r.textureBottom,d=r.textureLeft,s=r.textureBorderRadius,v=r.textureBorderTopLeftRadius,f=r.textureBorderTopRightRadius,b=r.textureBorderBottomLeftRadius,g=r.textureBorderBottomRightRadius,y=r.style,O=i(r,Z);return y=tt(tt({},y),{},{"--unitone--texture-color":""!==n?n:void 0,"--unitone--texture-gap":""!==c?c:void 0,"--unitone--texture-size":""!==a?a:void 0,"--unitone--texture-top":""!==l?l:void 0,"--unitone--texture-right":""!==u?u:void 0,"--unitone--texture-bottom":""!==p?p:void 0,"--unitone--texture-left":""!==d?d:void 0,"--unitone--texture-border-radius":""!==s?s:void 0,"--unitone--texture-border-top-left-radius":""!==v?v:void 0,"--unitone--texture-border-top-right-radius":""!==f?f:void 0,"--unitone--texture-border-bottom-left-radius":""!==b?b:void 0,"--unitone--texture-border-bottom-right-radius":""!==g?g:void 0}),t.createElement("div",e({"data-unitone-layout":["texture",""!==(null!=o?o:"")?"-texture:".concat(o):void 0].filter(Boolean).join(" "),style:y},O),O.children)},exports.VerticalWriting=function(r){var o=r.textOrientation,n=r.gap,c=r.maxHeight,a=r.switchWritingMode,l=r.threshold,u=r.style,p=i(r,et);return u=ot(ot({},u),{},{"--unitone--max-height":""!==c?c:void 0,"--unitone--threshold":""!==l?l:void 0}),t.createElement("div",{"data-unitone-layout":"vertical-writing-wrapper"},t.createElement("div",e({"data-unitone-layout":["vertical-writing",""!==(null!=o?o:"")?"-text-orientation:".concat(o):void 0,""!==(null!=n?n:"")?"-gap:".concat(n):void 0,a?"-switch":void 0].filter(Boolean).join(" "),style:u},p),p.children))},exports.WithSidebar=function(r){var o=r.gap,n=r.columnGap,c=r.rowGap,a=r.contentMinWidth,l=r.revert,u=r.sidebar,p=r.sidebarWidth,d=r.alignItems,s=r.overflow,v=r.divider,f=r.style,b=i(r,nt);return f=ct(ct({},f),{},{"--unitone--sidebar-width":""!==p?p:void 0,"--unitone--content-min-width":""!==a?a:void 0}),t.createElement("div",e({"data-unitone-layout":["with-sidebar",l?"-revert":void 0,""!==(null!=o?o:"")?"-gap:".concat(o):void 0,""!==(null!=n?n:"")?"-column-gap:".concat(n):void 0,""!==(null!=c?c:"")?"-row-gap:".concat(c):void 0,""!==(null!=u?u:"")?"-sidebar:".concat(u):void 0,""!==(null!=d?d:"")?"-align-items:".concat(d):void 0,""!==(null!=s?s:"")?"-overflow:".concat(s):void 0,""!==(null!=v?v:"")?"-divider:".concat(v):void 0].filter(Boolean).join(" "),style:f},b),b.children)};
|
package/dist/library.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(e,i){if(e){if("string"==typeof e)return t(e,i);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,i):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return n(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}(t))||e){i&&(t=i);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},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 l,u=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return u=t.done,t},e:function(t){a=!0,l=t},f:function(){try{u||null==i.return||i.return()}finally{if(a)throw l}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function r(t,e){var i;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var l=this;clearTimeout(i),i=setTimeout((function(){t.apply(l,r)}),e)}}var o=function(t){var e,i,n,r=null===(e=[].slice.call(null!==(i=null==t?void 0:t.children)&&void 0!==i?i:[]))||void 0===e?void 0:e[0];if(r){var o,l=r.getBoundingClientRect(),u=(null!==(n=t.getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/);u.some((function(t){return["divider:initialized","-stack"].includes(t)}))&&(u=u.filter((function(t){return!["divider:initialized","-stack"].includes(t)})),t.setAttribute("data-unitone-layout",u.join(" ")));var a=[].slice.call(t.children).filter((function(t){var e=window.getComputedStyle(t).getPropertyValue("position"),i=window.getComputedStyle(t).getPropertyValue("display");return"absolute"!==e&&"fixed"!==e&&"none"!==i}));a.forEach((function(t,e){var i,n,r=(null!==(i=t.getAttribute("data-unitone-layout"))&&void 0!==i?i:"").split(/\s+/);r.some((function(t){return["-bol","-linewrap"].includes(t)}))&&(r=r.filter((function(t){return!["-bol","-linewrap"].includes(t)})),t.setAttribute("data-unitone-layout",r.join(" ")));var u=null===(n=o)||void 0===n?void 0:n.getBoundingClientRect(),a=t.getBoundingClientRect(),s=!1;(0===e||(null==u?void 0:u.top)<a.top&&(null==u?void 0:u.left)>=a.left)&&(r.push("-bol"),s=!0),0<e&&l.top<a.top&&(r.push("-linewrap"),s=!0),s&&t.setAttribute("data-unitone-layout",r.join(" ")),o=t})),[].slice.call(a).every((function(t){return t.getBoundingClientRect().left===l.left}))&&u.push("-stack"),u.push("divider:initialized"),t.setAttribute("data-unitone-layout",u.join(" "))}},l=function(t){var e,i,n,r=[].slice.call(t.children),o=null==r?void 0:r[0];if(o){t.style.removeProperty("--unitone--stairs-step-overflow-volume"),t.style.removeProperty("--unitone--max-stairs-step"),[].slice.call(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach((function(t){t.style.removeProperty("--unitone--stairs-step")}));var l,u=[],a=0,s=a,d=null===(i=(null!==(n=t.getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).find((function(t){return t.startsWith("-stairs-up:")})))||void 0===i?void 0:i.replace("-stairs-up:",""),c=["up-down","down-up"].includes(d),v=window.getComputedStyle(t).getPropertyValue("flex-direction");r.forEach((function(t){var e,i,n=window.getComputedStyle(t).getPropertyValue("position"),r=window.getComputedStyle(t).getPropertyValue("display");if("absolute"!==n&&"fixed"!==n&&"none"!==r){u.push(t);var d="row-reverse"===v?(null===(e=l)||void 0===e||null===(e=e.getBoundingClientRect())||void 0===e?void 0:e.left)<=t.getBoundingClientRect().left:(null===(i=l)||void 0===i||null===(i=i.getBoundingClientRect())||void 0===i?void 0:i.left)>=t.getBoundingClientRect().left;o===t||d?a=0:c?a=0===a?1:0:a++,t.style.setProperty("--unitone--stairs-step",a),l=t,a>s&&(s=a)}})),t.style.setProperty("--unitone--max-stairs-step",s);var f=t.getBoundingClientRect().bottom,p=u.reduce((function(t,e){var i=e.getBoundingClientRect().bottom-f;return t>i?t:i}),0);t.style.setProperty("--unitone--stairs-step-overflow-volume",p)}},u=function(t){var e;if(t){var i,n=(null!==(e=t.getAttribute("data-unitone-layout"))&&void 0!==e?e:"").split(/\s+/);if(n.some((function(t){return["vertical-writing:initialized","vertical-writing:safari","-force-switch"].includes(t)}))&&(n=n.filter((function(t){return!["vertical-writing:initialized","vertical-writing:safari","-force-switch"].includes(t)})),t.setAttribute("data-unitone-layout",n.join(" "))),[].slice.call(t.children).reverse().some((function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position)&&"none"!==getComputedStyle(t).display)return i=t,!0})),!i)return n.push("vertical-writing:initialized"),void t.setAttribute("data-unitone-layout",n.join(" "));var r=getComputedStyle(t),o=String(r.getPropertyValue("--unitone--threshold")).trim(),l=!1;setTimeout((function(){if(null!=t&&t.isConnected){if(o){var e=document.createElement("div");e.setAttribute("data-unitone-layout","vertical-writing__thresholder"),t.appendChild(e),l=e.offsetWidth>=t.offsetWidth,e.parentNode&&e.parentNode.removeChild(e)}var r;if(l)n.push("-force-switch"),null!==(r=t.parentNode)&&void 0!==r&&r.style&&(t.parentNode.style.height="");else t.getBoundingClientRect().left>i.getBoundingClientRect().left&&n.push("vertical-writing:safari"),t.setAttribute("data-unitone-layout",n.join(" ")),requestAnimationFrame((function(){if(null!=t&&t.isConnected){var e,n=t.getBoundingClientRect(),r=i.getBoundingClientRect(),o=n.top+n.height,l=r.top+r.height;if(o!==l)null!==(e=t.parentNode)&&void 0!==e&&e.style&&(t.parentNode.style.height="".concat(Math.ceil(l-n.top),"px"))}}));n.push("vertical-writing:initialized"),t.setAttribute("data-unitone-layout",n.join(" "))}}),250)}},a=function(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),i=parseFloat(e.fontSize);i!==parseFloat(e.getPropertyValue("--unitone--result--1em-px"))&&t.style.setProperty("--unitone--result--1em-px",i)};exports.debounce=r,exports.dividersResizeObserver=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=0,u=new ResizeObserver(r((function(t){var e,n=i(t);try{for(n.s();!(e=n.n()).done;){var r,u=e.value,a=null===(r=u.borderBoxSize)||void 0===r?void 0:r[0].inlineSize;a!==l&&(o(u.target),l=a)}}catch(t){n.e(t)}finally{n.f()}}),250)),a=new MutationObserver((function(r){requestAnimationFrame((function(){var l,u=i(r);try{var a=function(){var i=l.value;if("attributes"===i.type&&"data-unitone-layout"===i.attributeName){var r,u,a,s,d=[].concat(e(null!==(r=null==n||null===(u=n.ignore)||void 0===u?void 0:u.layout)&&void 0!==r?r:[]),["divider:initialized","-bol","-linewrap","-stack"]);(null!==(a=i.target.getAttribute(i.attributeName))&&void 0!==a?a:"").split(" ").filter((function(t){return!d.includes(t)})).join(" ")!==(null!==(s=i.oldValue)&&void 0!==s?s:"").split(" ").filter((function(t){return!d.includes(t)})).join(" ")&&o(t)}else if("attributes"===i.type&&"class"===i.attributeName){var c,v,f,p,y=e(null!==(c=null==n||null===(v=n.ignore)||void 0===v?void 0:v.className)&&void 0!==c?c:[]);(null!==(f=i.target.getAttribute(i.attributeName))&&void 0!==f?f:"").split(" ").filter((function(t){return!y.includes(t)})).join(" ")!==(null!==(p=i.oldValue)&&void 0!==p?p:"").split(" ").filter((function(t){return!y.includes(t)})).join(" ")&&o(t)}else"attributes"===i.type&&"style"===i.attributeName&&o(t)};for(u.s();!(l=u.n()).done;)a()}catch(t){u.e(t)}finally{u.f()}}))}));return u.observe(t),a.observe(t,{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,subtree:!0,characterData:!0}),{resizeObserver:u,mutationObserver:a}},exports.result1emPxForFireFoxObserver=function(t){var e=t.ownerDocument;if(e.defaultView.getComputedStyle(e.documentElement).getPropertyValue("--unitone--is-firefox").trim()){var n=0,o=new ResizeObserver(r((function(t){var e,r=i(t);try{for(r.s();!(e=r.n()).done;){var o,l=e.value,u=null===(o=l.borderBoxSize)||void 0===o?void 0:o[0].inlineSize;u!==n&&(a(l.target),n=u)}}catch(t){r.e(t)}finally{r.f()}}),250)),l=new MutationObserver((function(){requestAnimationFrame((function(){a(t)}))}));return o.observe(t),l.observe(t,{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0}),{resizeObserver:o,mutationObserver:l}}},exports.setColumnCountForVertical=u,exports.setDividerLinewrap=o,exports.setResult1emPxForFireFox=a,exports.setStairsStep=l,exports.stairsResizeObserver=function(t){var e=new ResizeObserver(r((function(t){var e,n=i(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;l(r.target)}}catch(t){n.e(t)}finally{n.f()}}),250));return e.observe(t),e},exports.verticalsResizeObserver=function(t){var e=0,n=new ResizeObserver(r((function(t){var n,r=i(t);try{for(r.s();!(n=r.n()).done;){var o,l=n.value,a=null===(o=l.contentRect)||void 0===o?void 0:o.width;parseInt(a)!==parseInt(e)&&(e=a,l.target.parentNode.style.height="",u(l.target))}}catch(t){r.e(t)}finally{r.f()}}),250));n.observe(t);var o=new MutationObserver((function(e){requestAnimationFrame((function(){if(0<e.length){var i,n,r=e[0],o=null===(i=r.addedNodes)||void 0===i?void 0:i[0],l=null===(n=r.removedNodes)||void 0===n?void 0:n[0];if((null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===o.getAttribute("data-unitone-layout")||(null==l?void 0:l.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===l.getAttribute("data-unitone-layout")||(null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:initialized"===o.getAttribute("data-unitone-layout")||(null==l?void 0:l.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:initialized"===l.getAttribute("data-unitone-layout")||(null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:safari"===o.getAttribute("data-unitone-layout")||(null==l?void 0:l.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:safari"===l.getAttribute("data-unitone-layout"))return;u(t)}}))}));return o.observe(t,{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0}),{resizeObserver:n,mutationObserver:o}};
|
|
1
|
+
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(e,i){if(e){if("string"==typeof e)return t(e,i);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,i):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return n(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}(t))||e){i&&(t=i);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},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 a,l=!0,u=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return l=t.done,t},e:function(t){u=!0,a=t},f:function(){try{l||null==i.return||i.return()}finally{if(u)throw a}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function r(t,e){var i;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=this;clearTimeout(i),i=setTimeout((function(){t.apply(a,r)}),e)}}var o=function(t){var e,i,n,r=null===(e=[].slice.call(null!==(i=null==t?void 0:t.children)&&void 0!==i?i:[]))||void 0===e?void 0:e[0];if(r){var o,a=r.getBoundingClientRect(),l=(null!==(n=t.getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/);l.some((function(t){return["divider:initialized","-stack"].includes(t)}))&&(l=l.filter((function(t){return!["divider:initialized","-stack"].includes(t)})),t.setAttribute("data-unitone-layout",l.join(" ")));var u=[].slice.call(t.children).filter((function(t){var e=window.getComputedStyle(t).getPropertyValue("position"),i=window.getComputedStyle(t).getPropertyValue("display");return"absolute"!==e&&"fixed"!==e&&"none"!==i}));u.forEach((function(t,e){var i,n,r=(null!==(i=t.getAttribute("data-unitone-layout"))&&void 0!==i?i:"").split(/\s+/);r.some((function(t){return["-bol","-linewrap"].includes(t)}))&&(r=r.filter((function(t){return!["-bol","-linewrap"].includes(t)})),t.setAttribute("data-unitone-layout",r.join(" ")));var l=null===(n=o)||void 0===n?void 0:n.getBoundingClientRect(),u=t.getBoundingClientRect(),s=!1;(0===e||(null==l?void 0:l.top)<u.top&&(null==l?void 0:l.left)>=u.left)&&(r.push("-bol"),s=!0),0<e&&a.top<u.top&&(r.push("-linewrap"),s=!0),s&&t.setAttribute("data-unitone-layout",r.join(" ")),o=t})),[].slice.call(u).every((function(t){return t.getBoundingClientRect().left===a.left}))&&l.push("-stack"),l.push("divider:initialized"),t.setAttribute("data-unitone-layout",l.join(" "))}},a=function(t){var e,i,n,r=[].slice.call(t.children),o=null==r?void 0:r[0];if(o){t.style.removeProperty("--unitone--stairs-step-overflow-volume"),t.style.removeProperty("--unitone--max-stairs-step"),[].slice.call(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach((function(t){t.style.removeProperty("--unitone--stairs-step")}));var a,l=[],u=0,s=u,d=null===(i=(null!==(n=t.getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).find((function(t){return t.startsWith("-stairs-up:")})))||void 0===i?void 0:i.replace("-stairs-up:",""),c=["up-down","down-up"].includes(d),v=window.getComputedStyle(t).getPropertyValue("flex-direction");r.forEach((function(t){var e,i,n=window.getComputedStyle(t).getPropertyValue("position"),r=window.getComputedStyle(t).getPropertyValue("display");if("absolute"!==n&&"fixed"!==n&&"none"!==r){l.push(t);var d="row-reverse"===v?(null===(e=a)||void 0===e||null===(e=e.getBoundingClientRect())||void 0===e?void 0:e.left)<=t.getBoundingClientRect().left:(null===(i=a)||void 0===i||null===(i=i.getBoundingClientRect())||void 0===i?void 0:i.left)>=t.getBoundingClientRect().left;o===t||d?u=0:c?u=0===u?1:0:u++,t.style.setProperty("--unitone--stairs-step",u),a=t,u>s&&(s=u)}})),t.style.setProperty("--unitone--max-stairs-step",s);var f=t.getBoundingClientRect().bottom,p=l.reduce((function(t,e){var i=e.getBoundingClientRect().bottom-f;return t>i?t:i}),0);t.style.setProperty("--unitone--stairs-step-overflow-volume",p)}},l=function(t){var e;if(t){var i,n=(null!==(e=t.getAttribute("data-unitone-layout"))&&void 0!==e?e:"").split(/\s+/);if(n.some((function(t){return["vertical-writing:initialized","vertical-writing:safari","-force-switch"].includes(t)}))&&(n=n.filter((function(t){return!["vertical-writing:initialized","vertical-writing:safari","-force-switch"].includes(t)})),t.setAttribute("data-unitone-layout",n.join(" "))),[].slice.call(t.children).reverse().some((function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position)&&"none"!==getComputedStyle(t).display)return i=t,!0})),!i)return n.push("vertical-writing:initialized"),void t.setAttribute("data-unitone-layout",n.join(" "));var r=getComputedStyle(t),o=String(r.getPropertyValue("--unitone--threshold")).trim(),a=!1;setTimeout((function(){if(null!=t&&t.isConnected){if(o){var e=document.createElement("div");e.setAttribute("data-unitone-layout","vertical-writing__thresholder"),t.appendChild(e),a=e.offsetWidth>=t.offsetWidth,e.parentNode&&e.parentNode.removeChild(e)}var r;if(a)n.push("-force-switch"),null!==(r=t.parentNode)&&void 0!==r&&r.style&&(t.parentNode.style.height="");else t.getBoundingClientRect().left>i.getBoundingClientRect().left&&n.push("vertical-writing:safari"),t.setAttribute("data-unitone-layout",n.join(" ")),requestAnimationFrame((function(){if(null!=t&&t.isConnected){var e,n=t.getBoundingClientRect(),r=i.getBoundingClientRect(),o=n.top+n.height,a=r.top+r.height;if(o!==a)null!==(e=t.parentNode)&&void 0!==e&&e.style&&(t.parentNode.style.height="".concat(Math.ceil(a-n.top),"px"))}}));n.push("vertical-writing:initialized"),t.setAttribute("data-unitone-layout",n.join(" "))}}),250)}},u=function(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),i=parseFloat(e.fontSize);i!==parseFloat(e.getPropertyValue("--unitone--result--1em-px"))&&t.style.setProperty("--unitone--result--1em-px",i)},s=function(t){var e=function(){return t.querySelectorAll(':scope > [data-unitone-layout~="marquee"]')},i=e();if(0!==i.length){if(1===t.childElementCount&&1===i.length){var n=i[0],r=n.cloneNode(!0);r.setAttribute("aria-hidden","true"),n.after(r)}(i=e()).forEach((function(t){var e,i,n;n=(null!==(i=(e=t).getAttribute("data-unitone-layout"))&&void 0!==i?i:"").split(/\s+/).filter((function(t){return t&&"marquee:initialized"!==t})).join(" "),e.setAttribute("data-unitone-layout",n)})),requestAnimationFrame((function(){null!=t&&t.isConnected&&e().forEach((function(t){var e,i,n;(n=null!==(i=(e=t).getAttribute("data-unitone-layout"))&&void 0!==i?i:"").split(/\s+/).includes("marquee:initialized")||e.setAttribute("data-unitone-layout","".concat(n," marquee:initialized").trim())}))}))}};exports.debounce=r,exports.dividersResizeObserver=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=0,l=new ResizeObserver(r((function(t){var e,n=i(t);try{for(n.s();!(e=n.n()).done;){var r,l=e.value,u=null===(r=l.borderBoxSize)||void 0===r?void 0:r[0].inlineSize;u!==a&&(o(l.target),a=u)}}catch(t){n.e(t)}finally{n.f()}}),250)),u=new MutationObserver((function(r){requestAnimationFrame((function(){var a,l=i(r);try{var u=function(){var i=a.value;if("attributes"===i.type&&"data-unitone-layout"===i.attributeName){var r,l,u,s,d=[].concat(e(null!==(r=null==n||null===(l=n.ignore)||void 0===l?void 0:l.layout)&&void 0!==r?r:[]),["divider:initialized","-bol","-linewrap","-stack"]);(null!==(u=i.target.getAttribute(i.attributeName))&&void 0!==u?u:"").split(" ").filter((function(t){return!d.includes(t)})).join(" ")!==(null!==(s=i.oldValue)&&void 0!==s?s:"").split(" ").filter((function(t){return!d.includes(t)})).join(" ")&&o(t)}else if("attributes"===i.type&&"class"===i.attributeName){var c,v,f,p,y=e(null!==(c=null==n||null===(v=n.ignore)||void 0===v?void 0:v.className)&&void 0!==c?c:[]);(null!==(f=i.target.getAttribute(i.attributeName))&&void 0!==f?f:"").split(" ").filter((function(t){return!y.includes(t)})).join(" ")!==(null!==(p=i.oldValue)&&void 0!==p?p:"").split(" ").filter((function(t){return!y.includes(t)})).join(" ")&&o(t)}else"attributes"===i.type&&"style"===i.attributeName&&o(t)};for(l.s();!(a=l.n()).done;)u()}catch(t){l.e(t)}finally{l.f()}}))}));return l.observe(t),u.observe(t,{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,subtree:!0,characterData:!0}),{resizeObserver:l,mutationObserver:u}},exports.marqueeResizeObserver=function(t){var e=0;s(t);var n=new ResizeObserver(r((function(t){var n,r=i(t);try{for(r.s();!(n=r.n()).done;){var o,a=n.value,l=null===(o=a.contentRect)||void 0===o?void 0:o.width;parseInt(l)!==parseInt(e)&&(e=l,s(a.target))}}catch(t){r.e(t)}finally{r.f()}}),250));n.observe(t);var o=new MutationObserver((function(){requestAnimationFrame((function(){null!=t&&t.isConnected&&s(t)}))}));return o.observe(t,{childList:!0}),{resizeObserver:n,mutationObserver:o}},exports.result1emPxForFireFoxObserver=function(t){var e=t.ownerDocument;if(e.defaultView.getComputedStyle(e.documentElement).getPropertyValue("--unitone--is-firefox").trim()){var n=0,o=new ResizeObserver(r((function(t){var e,r=i(t);try{for(r.s();!(e=r.n()).done;){var o,a=e.value,l=null===(o=a.borderBoxSize)||void 0===o?void 0:o[0].inlineSize;l!==n&&(u(a.target),n=l)}}catch(t){r.e(t)}finally{r.f()}}),250)),a=new MutationObserver((function(){requestAnimationFrame((function(){u(t)}))}));return o.observe(t),a.observe(t,{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0}),{resizeObserver:o,mutationObserver:a}}},exports.setColumnCountForVertical=l,exports.setDividerLinewrap=o,exports.setMarquee=s,exports.setResult1emPxForFireFox=u,exports.setStairsStep=a,exports.stairsResizeObserver=function(t){var e=new ResizeObserver(r((function(t){var e,n=i(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;a(r.target)}}catch(t){n.e(t)}finally{n.f()}}),250));return e.observe(t),e},exports.verticalsResizeObserver=function(t){var e=0,n=new ResizeObserver(r((function(t){var n,r=i(t);try{for(r.s();!(n=r.n()).done;){var o,a=n.value,u=null===(o=a.contentRect)||void 0===o?void 0:o.width;parseInt(u)!==parseInt(e)&&(e=u,a.target.parentNode.style.height="",l(a.target))}}catch(t){r.e(t)}finally{r.f()}}),250));n.observe(t);var o=new MutationObserver((function(e){requestAnimationFrame((function(){if(0<e.length){var i,n,r=e[0],o=null===(i=r.addedNodes)||void 0===i?void 0:i[0],a=null===(n=r.removedNodes)||void 0===n?void 0:n[0];if((null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===o.getAttribute("data-unitone-layout")||(null==a?void 0:a.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===a.getAttribute("data-unitone-layout")||(null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:initialized"===o.getAttribute("data-unitone-layout")||(null==a?void 0:a.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:initialized"===a.getAttribute("data-unitone-layout")||(null==o?void 0:o.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:safari"===o.getAttribute("data-unitone-layout")||(null==a?void 0:a.nodeType)===Node.ELEMENT_NODE&&"vertical-writing:safari"===a.getAttribute("data-unitone-layout"))return;l(t)}}))}));return o.observe(t,{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0}),{resizeObserver:n,mutationObserver:o}};
|
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
stairsResizeObserver,
|
|
4
4
|
verticalsResizeObserver,
|
|
5
5
|
result1emPxForFireFoxObserver,
|
|
6
|
+
marqueeResizeObserver,
|
|
6
7
|
} from '@inc2734/unitone-css/library';
|
|
7
8
|
|
|
8
9
|
document.addEventListener('DOMContentLoaded', () => {
|
|
@@ -98,3 +99,25 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
98
99
|
subtree: true,
|
|
99
100
|
});
|
|
100
101
|
});
|
|
102
|
+
|
|
103
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
104
|
+
const observer = new MutationObserver((entries) => {
|
|
105
|
+
requestAnimationFrame(() => {
|
|
106
|
+
for (const entry of entries) {
|
|
107
|
+
entry.addedNodes.forEach((addedNode) => {
|
|
108
|
+
const targets = addedNode.parentNode?.querySelectorAll(
|
|
109
|
+
'[data-unitone-layout~="marquee-wrapper"]',
|
|
110
|
+
);
|
|
111
|
+
targets?.forEach((target) => {
|
|
112
|
+
marqueeResizeObserver(target);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
observer.observe(document.body, {
|
|
120
|
+
childList: true,
|
|
121
|
+
subtree: true,
|
|
122
|
+
});
|
|
123
|
+
});
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
@use 'float/float';
|
|
7
7
|
@use 'frame/frame';
|
|
8
8
|
@use 'layers/layers';
|
|
9
|
+
@use 'marquee/marquee';
|
|
9
10
|
@use 'masonry/masonry';
|
|
10
11
|
@use 'reel/reel';
|
|
11
12
|
@use 'responsive-grid/responsive-grid';
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
@include float.float();
|
|
28
29
|
@include frame.frame();
|
|
29
30
|
@include layers.layers();
|
|
31
|
+
@include marquee.marquee();
|
|
30
32
|
@include masonry.masonry();
|
|
31
33
|
@include reel.reel();
|
|
32
34
|
@include responsive-grid.responsive-grid();
|
|
@@ -18,6 +18,15 @@
|
|
|
18
18
|
min-width: 0;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
&:where([data-unitone-layout~="-nowrap"]) {
|
|
22
|
+
flex-wrap: nowrap;
|
|
23
|
+
min-width: max-content;
|
|
24
|
+
|
|
25
|
+
> * {
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
21
30
|
&:where([data-unitone-layout*="-divider\:"]) {
|
|
22
31
|
--unitone--divider-width: 1px;
|
|
23
32
|
--unitone--divider-style: solid;
|
|
@@ -7,6 +7,7 @@ export const Cluster = ({
|
|
|
7
7
|
columnGap,
|
|
8
8
|
rowGap,
|
|
9
9
|
justifyContent,
|
|
10
|
+
nowrap,
|
|
10
11
|
tagName = 'div',
|
|
11
12
|
style,
|
|
12
13
|
...props
|
|
@@ -23,6 +24,7 @@ export const Cluster = ({
|
|
|
23
24
|
'' !== (rowGap ?? '') ? `-row-gap:${rowGap}` : undefined,
|
|
24
25
|
'' !== (alignItems ?? '') ? `-align-items:${alignItems}` : undefined,
|
|
25
26
|
'' !== (justifyContent ?? '') ? `-justify-content:${justifyContent}` : undefined,
|
|
27
|
+
nowrap ? '-nowrap' : undefined,
|
|
26
28
|
]
|
|
27
29
|
.filter(Boolean)
|
|
28
30
|
.join(' ')}
|
|
@@ -8,6 +8,7 @@ export { Float } from './float';
|
|
|
8
8
|
export { Frame } from './frame';
|
|
9
9
|
export { Gutters } from './gutters';
|
|
10
10
|
export { Layers } from './layers';
|
|
11
|
+
export { Marquee } from './marquee';
|
|
11
12
|
export { Masonry } from './masonry';
|
|
12
13
|
export { Reel } from './reel';
|
|
13
14
|
export { ResponsiveGrid } from './responsive-grid';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
@mixin abstract-marquee-wrapper() {
|
|
2
|
+
--unitone--animation-duration: 20s;
|
|
3
|
+
--unitone--gap: var(--unitone--global--text-gap);
|
|
4
|
+
--unitone--item-width: auto;
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: var(--unitone--gap);
|
|
8
|
+
overflow: clip;
|
|
9
|
+
|
|
10
|
+
&[data-unitone-layout~="-reverse"] {
|
|
11
|
+
flex-direction: row-reverse;
|
|
12
|
+
|
|
13
|
+
> [data-unitone-layout~="marquee:initialized"] {
|
|
14
|
+
animation-name: marquee-reverse;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@media (any-hover: hover) {
|
|
19
|
+
&[data-unitone-layout~="-pause-on-hover"]:hover {
|
|
20
|
+
> [data-unitone-layout~="marquee:initialized"] {
|
|
21
|
+
animation-play-state: paused;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&[data-unitone-layout~="-pause-on-hover"]:focus-within {
|
|
27
|
+
> [data-unitone-layout~="marquee:initialized"] {
|
|
28
|
+
animation-play-state: paused;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@mixin abstract-marquee() {
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
display: flex;
|
|
36
|
+
gap: inherit;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: space-around;
|
|
39
|
+
min-width: 100%;
|
|
40
|
+
|
|
41
|
+
&[data-unitone-layout~="marquee:initialized"] {
|
|
42
|
+
animation-name: marquee;
|
|
43
|
+
animation-timing-function: linear;
|
|
44
|
+
animation-duration: var(--unitone--animation-duration);
|
|
45
|
+
animation-iteration-count: infinite;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
> * {
|
|
49
|
+
flex: 0 0 var(--unitone--item-width);
|
|
50
|
+
min-width: 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@mixin marquee() {
|
|
55
|
+
[data-unitone-layout~="marquee-wrapper"] {
|
|
56
|
+
@include abstract-marquee-wrapper();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-unitone-layout~="marquee"] {
|
|
60
|
+
@include abstract-marquee();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@keyframes marquee {
|
|
65
|
+
0% { translate: 0; }
|
|
66
|
+
100% { translate: calc(-100% - var(--unitone--gap)); }
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@keyframes marquee-reverse {
|
|
70
|
+
0% { translate: 0; }
|
|
71
|
+
100% { translate: calc(100% + var(--unitone--gap)); }
|
|
72
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export const Marquee = ({ duration, gap, itemWidth, reverse, pauseOnHover, style, ...props }) => {
|
|
4
|
+
style = {
|
|
5
|
+
...style,
|
|
6
|
+
'--unitone--animation-duration': '' !== duration ? duration : undefined,
|
|
7
|
+
'--unitone--item-width': '' !== itemWidth ? itemWidth : undefined,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
data-unitone-layout={[
|
|
13
|
+
'marquee-wrapper',
|
|
14
|
+
reverse ? '-reverse' : undefined,
|
|
15
|
+
pauseOnHover ? '-pause-on-hover' : undefined,
|
|
16
|
+
]
|
|
17
|
+
.filter(Boolean)
|
|
18
|
+
.join(' ')}
|
|
19
|
+
style={style}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
<div
|
|
23
|
+
data-unitone-layout={['marquee', '' !== (gap ?? '') ? `-gap:${gap}` : undefined]
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.join(' ')}
|
|
26
|
+
>
|
|
27
|
+
{props.children}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
package/src/library.js
CHANGED
|
@@ -454,3 +454,89 @@ export const result1emPxForFireFoxObserver = (target) => {
|
|
|
454
454
|
mutationObserver: mObserver,
|
|
455
455
|
};
|
|
456
456
|
};
|
|
457
|
+
|
|
458
|
+
export const setMarquee = (target) => {
|
|
459
|
+
const addInitializedToken = (element) => {
|
|
460
|
+
const layout = element.getAttribute('data-unitone-layout') ?? '';
|
|
461
|
+
if (layout.split(/\s+/).includes('marquee:initialized')) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
element.setAttribute('data-unitone-layout', `${layout} marquee:initialized`.trim());
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
const removeInitializedToken = (element) => {
|
|
468
|
+
const layout = element.getAttribute('data-unitone-layout') ?? '';
|
|
469
|
+
const next = layout
|
|
470
|
+
.split(/\s+/)
|
|
471
|
+
.filter((value) => value && 'marquee:initialized' !== value)
|
|
472
|
+
.join(' ');
|
|
473
|
+
element.setAttribute('data-unitone-layout', next);
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
const getMarquees = () => target.querySelectorAll(':scope > [data-unitone-layout~="marquee"]');
|
|
477
|
+
let marquees = getMarquees();
|
|
478
|
+
if (0 === marquees.length) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if (1 === target.childElementCount && 1 === marquees.length) {
|
|
483
|
+
const marquee = marquees[0];
|
|
484
|
+
const clonedMarquee = marquee.cloneNode(true);
|
|
485
|
+
clonedMarquee.setAttribute('aria-hidden', 'true');
|
|
486
|
+
marquee.after(clonedMarquee);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
marquees = getMarquees();
|
|
490
|
+
marquees.forEach((marquee) => {
|
|
491
|
+
removeInitializedToken(marquee);
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
requestAnimationFrame(() => {
|
|
495
|
+
if (!target?.isConnected) {
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
getMarquees().forEach((marquee) => {
|
|
499
|
+
addInitializedToken(marquee);
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
export const marqueeResizeObserver = (target) => {
|
|
505
|
+
let prevWidth = 0;
|
|
506
|
+
|
|
507
|
+
setMarquee(target);
|
|
508
|
+
|
|
509
|
+
const observer = new ResizeObserver(
|
|
510
|
+
debounce((entries) => {
|
|
511
|
+
for (const entry of entries) {
|
|
512
|
+
const width = entry.contentRect?.width;
|
|
513
|
+
if (parseInt(width) !== parseInt(prevWidth)) {
|
|
514
|
+
prevWidth = width;
|
|
515
|
+
setMarquee(entry.target);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}, 250),
|
|
519
|
+
);
|
|
520
|
+
|
|
521
|
+
observer.observe(target);
|
|
522
|
+
|
|
523
|
+
const mObserverArgs = {
|
|
524
|
+
childList: true,
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
const mObserver = new MutationObserver(() => {
|
|
528
|
+
requestAnimationFrame(() => {
|
|
529
|
+
if (!target?.isConnected) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
setMarquee(target);
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
mObserver.observe(target, mObserverArgs);
|
|
537
|
+
|
|
538
|
+
return {
|
|
539
|
+
resizeObserver: observer,
|
|
540
|
+
mutationObserver: mObserver,
|
|
541
|
+
};
|
|
542
|
+
};
|