@inc2734/unitone-css 0.98.0 → 0.100.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/behaviors/dividers.js +1 -1
- package/dist/behaviors/index.js +1 -1
- package/dist/behaviors/stairs.js +1 -1
- package/dist/compatibility/fluid-typography.js +1 -1
- package/dist/compatibility/index.js +1 -1
- package/dist/layout-primitives/both-sides/react.js +1 -1
- package/dist/layout-primitives/center/react.js +1 -1
- package/dist/layout-primitives/cluster/react.js +1 -1
- package/dist/layout-primitives/container/react.js +1 -1
- package/dist/layout-primitives/cover/react.js +1 -1
- package/dist/layout-primitives/decorator/react.js +1 -1
- package/dist/layout-primitives/dialog/react.js +1 -1
- package/dist/layout-primitives/divider/react.js +1 -0
- package/dist/layout-primitives/float/react.js +1 -1
- package/dist/layout-primitives/frame/react.js +1 -1
- package/dist/layout-primitives/index.js +1 -1
- package/dist/layout-primitives/layers/react.js +1 -1
- package/dist/layout-primitives/marquee/behavior.js +1 -1
- package/dist/layout-primitives/marquee/react.js +1 -1
- package/dist/layout-primitives/masonry/react.js +1 -1
- package/dist/layout-primitives/popover/react.js +1 -1
- package/dist/layout-primitives/reel/react.js +1 -1
- package/dist/layout-primitives/responsive-grid/react.js +1 -1
- package/dist/layout-primitives/stack/react.js +1 -1
- package/dist/layout-primitives/switcher/react.js +1 -1
- package/dist/layout-primitives/text/react.js +1 -1
- package/dist/layout-primitives/texture/react.js +1 -1
- package/dist/layout-primitives/vertical-writing/behavior.js +1 -1
- package/dist/layout-primitives/vertical-writing/react.js +1 -1
- package/dist/layout-primitives/with-sidebar/react.js +1 -1
- package/dist/library.js +1 -1
- package/package.json +14 -14
- package/src/layout-primitives/_layout-primitives-core.scss +2 -0
- package/src/layout-primitives/divider/_index.scss +62 -0
- package/src/layout-primitives/divider/index.jsx +25 -0
- package/src/layout-primitives/divider/react.jsx +1 -0
- package/src/utilities/_font-size.scss +1 -1
package/dist/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function e(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}function n(n){return function(e){if(Array.isArray(e))return t(e)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||e(n)||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,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(a=(i=o.call(n)).done)&&(u.push(i.value),u.length!==e);a=!0);}catch(t){d=!0,r=t}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw r}}return u}}(t,n)||e(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(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 i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}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(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){a=!0,l=t},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw l}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var l="data-unitone-layout",u="".concat(200,"px 0px"),a=function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).filter(Boolean)},d=function(t,e){return t.filter((function(t){return!e.includes(t)}))},s=function(t,e){var n,i=e.filter(Boolean).join(" ");(null!==(n=t.getAttribute(l))&&void 0!==n?n:"")!==i&&t.setAttribute(l,i)},c=function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.getValue,l=i.delay,u=!0,a=new ResizeObserver(g((function(t){var i,l=r(t);try{for(l.s();!(i=l.n()).done;){var a=i.value,d=null==o?void 0:o(a);u?(n=d,u=!1):void 0!==d&&d===n||(e(a.target,a),n=d)}}catch(t){l.e(t)}finally{l.f()}}),void 0===l?250:l));return a.observe(t),a},f=function(t,e,n){var i=new MutationObserver((function(e){requestAnimationFrame((function(){null!=t&&t.isConnected&&n(e)}))}));return i.observe(t,e),i},v=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,a=void 0===l?250:l,d=n.observeResize,s=void 0===d||d,v=n.observeIntersection,y=void 0!==v&&v,p=n.observeDirectChildrenResize,h=void 0!==p&&p,b=n.targetMutation,w=n.directChildMutation,A=y&&"undefined"!=typeof IntersectionObserver,z=!A||m(t),C=A&&!z,E=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;null!=n&&n.isConnected&&(!A||z?(C=!1,e(n)):C=!0)},S=function(t,e){var n,i=0;return function(){var r,o;null!==(o=n=null==t||null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)&&void 0!==o&&o.requestAnimationFrame?i||(i=n.requestAnimationFrame((function(){i=0,n=null,null!=t&&t.isConnected&&e(t)}))):e(t)}}(t,E),N=function(){null!=t&&t.isConnected&&(!A||z?(C=!0,S()):C=!0)},O=function(){},V=s?h?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.getValue,o=n.delay,l=void 0===o?250:o,u=n.onChildList,a=new WeakMap,d=new Set,s=new ResizeObserver(g((function(n){var o,l=!1,u=r(n);try{for(u.s();!(o=u.n()).done;){var d=o.value,s=null==i?void 0:i(d);a.has(d.target)?(void 0!==s&&s===a.get(d.target)||(l=!0),a.set(d.target,s)):a.set(d.target,s)}}catch(t){u.e(t)}finally{u.f()}l&&e(t)}),l)),c=function(){var e;Array.from(d).forEach((function(e){e.parentElement!==t&&(s.unobserve(e),d.delete(e),a.delete(e))})),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach((function(t){d.has(t)||(s.observe(t),d.add(t))}))};s.observe(t),c();var v=f(t,{childList:!0},(function(n){n.some((function(t){return"childList"===t.type}))&&(c(),null==u||u(n),e(t))}));return{resizeObserver:s,mutationObserver:v}}(t,N,{getValue:o,delay:a,onChildList:function(){O()}}):{resizeObserver:c(t,N,{getValue:o,delay:a})}:{mutationObserver:null};A&&function(t,e){var n=new IntersectionObserver((function(t){var n=i(t,1)[0];n&&e(n)}),{rootMargin:u});n.observe(t)}(t,(function(t){(z=t.isIntersecting)&&C&&N()})),null!=b&&b.options&&f(t,b.options,(function(t){var e,n;(null!==(e=null===(n=b.shouldApply)||void 0===n?void 0:n.call(b,t))&&void 0!==e?e:0<t.length)&&N()}));var M=null!=w&&w.attributeFilter&&w.shouldApply?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.attributeFilter,r=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver((function(n){requestAnimationFrame((function(){null!=t&&t.isConnected&&n.some((function(e){return"attributes"===e.type&&e.target.parentElement===t&&r(e)}))&&e(t)}))})),a=function(){var e;u.disconnect(),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach((function(t){u.observe(t,{attributes:!0,attributeFilter:i,attributeOldValue:l})}))};return a(),{observer:u,syncObservedChildren:a}}(t,N,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;M&&(O=M.syncObservedChildren),!V.mutationObserver&&M&&f(t,{childList:!0},(function(t){t.some((function(t){return"childList"===t.type}))&&(O(),N())})),A&&!z||E(t)},y=function(t){var e;return null===(e=t.borderBoxSize)||void 0===e?void 0:e[0].inlineSize},p=function(t){var e;return parseInt(null===(e=t.contentRect)||void 0===e?void 0:e.width)},h=function(t){return!(null==t||!t.isConnected)&&0<t.getClientRects().length},m=function(t){var e;if(!h(t))return!1;var n=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n)return!0;var i=t.getBoundingClientRect(),r=n.innerWidth,o=n.innerHeight;return i.bottom>-200&&i.right>0&&i.top<o+200&&i.left<r};function g(t,e){var n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];var l=this;clearTimeout(n),n=setTimeout((function(){t.apply(l,r)}),e)}}var b=function(t){var e,i=Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]),r=i[0];if(r){var o=d(a(t),["divider:initialized","-stack"]);s(t,o);var l=new Map;if(i.forEach((function(t){var e=d(a(t),["-bol","-linewrap"]);l.set(t,e),s(t,e)})),h(t)){var u,c=r.getBoundingClientRect(),f=i.reduce((function(t,e){var n,i=window.getComputedStyle(e).getPropertyValue("position"),r=window.getComputedStyle(e).getPropertyValue("display");"absolute"!==i&&"fixed"!==i&&"none"!==r&&t.push({child:e,layoutTokens:null!==(n=l.get(e))&&void 0!==n?n:[],rect:e.getBoundingClientRect()});return t}),[]);f.map((function(t,e){var i,r,o=t.child,l=t.layoutTokens,a=t.rect,d=n(l);return(0===e||(null===(i=u)||void 0===i?void 0:i.top)<a.top&&(null===(r=u)||void 0===r?void 0:r.left)>=a.left)&&d.push("-bol"),0<e&&c.top<a.top&&d.push("-linewrap"),u=a,{child:o,layoutTokens:d}})).forEach((function(t){var e=t.child,n=t.layoutTokens;s(e,n)}));var v=f.every((function(t){return t.rect.left===c.left})),y=n(o);v&&y.push("-stack"),y.push("divider:initialized"),s(t,y)}}},w=function(t){var e,i,r=Array.from(t.children),o=d(a(t),["stairs:initialized"]);s(t,o);var l=r[0];if(l){if(t.style.removeProperty("--unitone--stairs-step-overflow-volume"),t.style.removeProperty("--unitone--max-stairs-step"),r.forEach((function(t){t.style.removeProperty("--unitone--stairs-step")})),h(t)){var u,c=null===(e=(null!==(i=t.getAttribute("data-unitone-layout"))&&void 0!==i?i:"").split(/\s+/).find((function(t){return t.startsWith("-stairs-up:")})))||void 0===e?void 0:e.replace("-stairs-up:",""),f=["up-down","down-up"].includes(c),v=window.getComputedStyle(t).getPropertyValue("flex-direction"),y=t.getBoundingClientRect().bottom,p=r.reduce((function(t,e){var n=window.getComputedStyle(e).getPropertyValue("position"),i=window.getComputedStyle(e).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===i||t.push({child:e,rect:e.getBoundingClientRect()}),t}),[]),m=0,g=m;p.map((function(t,e){var n,i,r=t.child,o=t.rect,a="row-reverse"===v?(null===(n=u)||void 0===n?void 0:n.left)<=o.left:(null===(i=u)||void 0===i?void 0:i.left)>=o.left;return 0===e||l===r&&!u||a?m=0:f?m=0===m?1:0:m++,u=o,m>g&&(g=m),{child:r,stairsStep:m}})).forEach((function(t){var e=t.child,n=t.stairsStep;e.style.setProperty("--unitone--stairs-step",n)})),t.style.setProperty("--unitone--max-stairs-step",g);var b=p.reduce((function(t,e){var n=e.child.getBoundingClientRect().bottom-y;return t>n?t:n}),0);t.style.setProperty("--unitone--stairs-step-overflow-volume",b),s(t,[].concat(n(o),["stairs:initialized"]))}}else s(t,[].concat(n(o),["stairs:initialized"]))},A=function(t){return t.some((function(t){return"attributes"===t.type||"childList"===t.type&&[].concat(n(t.addedNodes),n(t.removedNodes)).some((function(t){return!function(t){return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&["vertical-writing__thresholder","vertical-writing:initialized","vertical-writing:safari"].includes(t.getAttribute("data-unitone-layout"))}(t)}))}))},z=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)},C=Symbol.for("@inc2734/unitone-css/layout-initializers"),E=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[C]||(globalThis[C]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[C])},S=function(t,e){var n,i;if(t.enabled()&&(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE){var r=new Set;null!==(n=e.matches)&&void 0!==n&&n.call(e,t.selector)&&r.add(e),null===(i=e.querySelectorAll)||void 0===i||i.call(e,t.selector).forEach((function(t){r.add(t)})),r.forEach((function(e){t.initialized.has(e)||(t.initialize(e),t.initialized.add(e))}))}},N=function(t){var e=E();e&&e.initializers.forEach((function(e){S(e,t)}))},O=function(){var t=E();t&&(t.pendingNodes.forEach((function(t){N(t)})),t.pendingNodes.clear(),t.rafId=0)},V=function(){var t=E();t&&!t.observer&&document.body&&(N(document.body),t.observer=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE&&t.pendingNodes.add(e)}))})),!t.rafId&&0<t.pendingNodes.size&&(t.rafId=requestAnimationFrame(O))})),t.observer.observe(document.body,{childList:!0,subtree:!0}))},M=function(t){var e=t.key,n=t.selector,i=t.initialize,r=t.enabled,o=void 0===r?function(){return!0}:r,l=E();if(l&&!l.initializers.has(e)){var u={selector:n,initialize:i,enabled:o,initialized:new WeakSet};l.initializers.set(e,u),l.observer?S(u,document.body):"loading"!==document.readyState?V():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",V,{once:!0}),l.hasDOMContentLoadedListener=!0)}};M({key:"layout-primitives/marquee",selector:'[data-unitone-layout~="marquee-wrapper"]',initialize:function(t){var e;v(t,(function(t){e=function(t){var e,n=function(t){var e,n=null!==(e=t.getAttribute("data-unitone-layout"))&&void 0!==e?e:"";n.split(/\s+/).includes("marquee:initialized")||t.setAttribute("data-unitone-layout","".concat(n," marquee:initialized").trim())},i=function(){return t.querySelectorAll(':scope > [data-unitone-layout~="marquee"]')},r=i();if(0!==r.length){var o=Array.from(r).some((function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).includes("marquee:initialized")}));if(1===t.childElementCount&&1===r.length){var u=r[0];(e=u.cloneNode(!0)).setAttribute("aria-hidden","true"),u.after(e)}return r=i(),o?(r.forEach((function(t){var e,n,i;i=(null!==(n=(e=t).getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).filter((function(t){return t&&"marquee:initialized"!==t})).join(" "),e.setAttribute("data-unitone-layout",i)})),requestAnimationFrame((function(){null!=t&&t.isConnected&&i().forEach((function(t){n(t)}))})),e):(r.forEach((function(t){n(t)})),e)}}(t)}),{observeResize:!1,observeIntersection:!0,targetMutation:{options:{childList:!0},shouldApply:function(t){var n,i=t.flatMap((function(t){var e;return Array.from(null!==(e=t.addedNodes)&&void 0!==e?e:[])})),r=t.flatMap((function(t){var e;return Array.from(null!==(e=t.removedNodes)&&void 0!==e?e:[])}));return null!==(n=e)&&void 0!==n&&n.isConnected&&1===i.length&&0===r.length&&i[0]===e?(e=null,!1):(e=null,!0)}}})}}),M({key:"layout-primitives/vertical-writing",selector:'[data-unitone-layout~="vertical-writing"]',initialize:function(t){v(t,(function(t){var e;null!==(e=t.parentNode)&&void 0!==e&&e.style&&(t.parentNode.style.height=""),function(t){if(t){var e,i=a(t),r=d(i,["vertical-writing:safari","-force-switch"]),o=d(i,["vertical-writing:initialized","vertical-writing:safari","-force-switch"]);if(s(t,r),Array.from(t.children).reverse().some((function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position)&&"none"!==getComputedStyle(t).display)return e=t,!0})),e){var u=getComputedStyle(t),c=String(u.getPropertyValue("--unitone--threshold")).trim(),f=!1;if(c){var v=t.ownerDocument.createElement("div");v.setAttribute(l,"vertical-writing__thresholder"),t.appendChild(v),f=v.offsetWidth>=t.offsetWidth,v.remove()}f?o.push("-force-switch"):t.getBoundingClientRect().left>e.getBoundingClientRect().left&&o.push("vertical-writing:safari"),s(t,[].concat(n(o),["vertical-writing:initialized"])),requestAnimationFrame((function(){var n;if(null!=t&&t.isConnected&&null!==(n=t.parentNode)&&void 0!==n&&n.style){if(f)return void(t.parentNode.style.height="");var i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=i.top+i.height,l=r.top+r.height;t.parentNode.style.height=o!==l?"".concat(Math.ceil(l-i.top),"px"):""}}))}else s(t,[].concat(n(o),["vertical-writing:initialized"]))}}(t)}),{getResizeValue:p,observeIntersection:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0},shouldApply:A}})}}),M({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(t){if("data-unitone-layout"===t.attributeName){var i,r,o,l,u=[].concat(n(null!==(i=null==e||null===(r=e.ignore)||void 0===r?void 0:r.layout)&&void 0!==i?i:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=t.target.getAttribute(t.attributeName))&&void 0!==o?o:"").split(" ").filter((function(t){return!u.includes(t)})).join(" ")!==(null!==(l=t.oldValue)&&void 0!==l?l:"").split(" ").filter((function(t){return!u.includes(t)})).join(" ")}if("class"===t.attributeName){var a,d,s,c,f=n(null!==(a=null==e||null===(d=e.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(s=t.target.getAttribute(t.attributeName))&&void 0!==s?s:"").split(" ").filter((function(t){return!f.includes(t)})).join(" ")!==(null!==(c=t.oldValue)&&void 0!==c?c:"").split(" ").filter((function(t){return!f.includes(t)})).join(" ")}return"style"===t.attributeName};v(t,b,{getResizeValue:y,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(e){return function(t,e){return t.some((function(t){return"attributes"===t.type&&e(t)}))}(e,(function(e){return e.target===t&&i(e)}))}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:i}})}}),M({key:"behaviors/stairs",selector:'[data-unitone-layout*="-stairs:"]',initialize:function(t){v(t,w,{observeIntersection:!0,observeDirectChildrenResize:!0})}});M({key:"compatibility/fluid-typography",selector:'[style*="font-size:"], [data-unitone-layout~="-fluid-typography"]',initialize:function(t){var e=t.ownerDocument;e.defaultView.getComputedStyle(e.documentElement).getPropertyValue("--unitone--is-firefox").trim()&&v(t,z,{getResizeValue:y,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0},shouldApply:function(){return!0}}})},enabled:function(){return"undefined"!=typeof window&&"undefined"!=typeof document&&!!window.getComputedStyle(document.documentElement).getPropertyValue("--unitone--is-firefox").trim()}});
|
|
1
|
+
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function e(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}function n(n){return function(e){if(Array.isArray(e))return t(e)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||e(n)||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,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(a=(i=o.call(n)).done)&&(u.push(i.value),u.length!==e);a=!0);}catch(t){d=!0,r=t}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw r}}return u}}(t,n)||e(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(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 i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}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(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){a=!0,l=t},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw l}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var l="data-unitone-layout",u="".concat(200,"px 0px"),a=function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).filter(Boolean)},d=function(t,e){return t.filter(function(t){return!e.includes(t)})},s=function(t,e){var n,i=e.filter(Boolean).join(" ");(null!==(n=t.getAttribute(l))&&void 0!==n?n:"")!==i&&t.setAttribute(l,i)},c=function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.getValue,l=i.delay,u=!0,a=new ResizeObserver(g(function(t){var i,l=r(t);try{for(l.s();!(i=l.n()).done;){var a=i.value,d=null==o?void 0:o(a);u?(n=d,u=!1):void 0!==d&&d===n||(e(a.target,a),n=d)}}catch(t){l.e(t)}finally{l.f()}},void 0===l?250:l));return a.observe(t),a},f=function(t,e,n){var i=new MutationObserver(function(e){requestAnimationFrame(function(){null!=t&&t.isConnected&&n(e)})});return i.observe(t,e),i},v=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,a=void 0===l?250:l,d=n.observeResize,s=void 0===d||d,v=n.observeIntersection,y=void 0!==v&&v,p=n.observeDirectChildrenResize,h=void 0!==p&&p,b=n.targetMutation,w=n.directChildMutation,A=y&&"undefined"!=typeof IntersectionObserver,z=!A||m(t),C=A&&!z,E=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;null!=n&&n.isConnected&&(!A||z?(C=!1,e(n)):C=!0)},S=function(t,e){var n,i=0;return function(){var r,o;null!==(o=n=null==t||null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)&&void 0!==o&&o.requestAnimationFrame?i||(i=n.requestAnimationFrame(function(){i=0,n=null,null!=t&&t.isConnected&&e(t)})):e(t)}}(t,E),N=function(){null!=t&&t.isConnected&&(!A||z?(C=!0,S()):C=!0)},O=function(){},V=s?h?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.getValue,o=n.delay,l=void 0===o?250:o,u=n.onChildList,a=new WeakMap,d=new Set,s=new ResizeObserver(g(function(n){var o,l=!1,u=r(n);try{for(u.s();!(o=u.n()).done;){var d=o.value,s=null==i?void 0:i(d);a.has(d.target)?(void 0!==s&&s===a.get(d.target)||(l=!0),a.set(d.target,s)):a.set(d.target,s)}}catch(t){u.e(t)}finally{u.f()}l&&e(t)},l)),c=function(){var e;Array.from(d).forEach(function(e){e.parentElement!==t&&(s.unobserve(e),d.delete(e),a.delete(e))}),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){d.has(t)||(s.observe(t),d.add(t))})};s.observe(t),c();var v=f(t,{childList:!0},function(n){n.some(function(t){return"childList"===t.type})&&(c(),null==u||u(n),e(t))});return{resizeObserver:s,mutationObserver:v}}(t,N,{getValue:o,delay:a,onChildList:function(){O()}}):{resizeObserver:c(t,N,{getValue:o,delay:a})}:{mutationObserver:null};A&&function(t,e){var n=new IntersectionObserver(function(t){var n=i(t,1)[0];n&&e(n)},{rootMargin:u});n.observe(t)}(t,function(t){(z=t.isIntersecting)&&C&&N()}),null!=b&&b.options&&f(t,b.options,function(t){var e,n;(null!==(e=null===(n=b.shouldApply)||void 0===n?void 0:n.call(b,t))&&void 0!==e?e:0<t.length)&&N()});var M=null!=w&&w.attributeFilter&&w.shouldApply?function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.attributeFilter,r=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver(function(n){requestAnimationFrame(function(){null!=t&&t.isConnected&&n.some(function(e){return"attributes"===e.type&&e.target.parentElement===t&&r(e)})&&e(t)})}),a=function(){var e;u.disconnect(),Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]).forEach(function(t){u.observe(t,{attributes:!0,attributeFilter:i,attributeOldValue:l})})};return a(),{observer:u,syncObservedChildren:a}}(t,N,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;M&&(O=M.syncObservedChildren),!V.mutationObserver&&M&&f(t,{childList:!0},function(t){t.some(function(t){return"childList"===t.type})&&(O(),N())}),A&&!z||E(t)},y=function(t){var e;return null===(e=t.borderBoxSize)||void 0===e?void 0:e[0].inlineSize},p=function(t){var e;return parseInt(null===(e=t.contentRect)||void 0===e?void 0:e.width)},h=function(t){return!(null==t||!t.isConnected)&&0<t.getClientRects().length},m=function(t){var e;if(!h(t))return!1;var n=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n)return!0;var i=t.getBoundingClientRect(),r=n.innerWidth,o=n.innerHeight;return i.bottom>-200&&i.right>0&&i.top<o+200&&i.left<r};function g(t,e){var n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];var l=this;clearTimeout(n),n=setTimeout(function(){t.apply(l,r)},e)}}var b=function(t){var e,i=Array.from(null!==(e=null==t?void 0:t.children)&&void 0!==e?e:[]),r=i[0];if(r){var o=d(a(t),["divider:initialized","-stack"]);s(t,o);var l=new Map;if(i.forEach(function(t){var e=d(a(t),["-bol","-linewrap"]);l.set(t,e),s(t,e)}),h(t)){var u,c=r.getBoundingClientRect(),f=i.reduce(function(t,e){var n,i=window.getComputedStyle(e).getPropertyValue("position"),r=window.getComputedStyle(e).getPropertyValue("display");"absolute"!==i&&"fixed"!==i&&"none"!==r&&t.push({child:e,layoutTokens:null!==(n=l.get(e))&&void 0!==n?n:[],rect:e.getBoundingClientRect()});return t},[]);f.map(function(t,e){var i,r,o=t.child,l=t.layoutTokens,a=t.rect,d=n(l);return(0===e||(null===(i=u)||void 0===i?void 0:i.top)<a.top&&(null===(r=u)||void 0===r?void 0:r.left)>=a.left)&&d.push("-bol"),0<e&&c.top<a.top&&d.push("-linewrap"),u=a,{child:o,layoutTokens:d}}).forEach(function(t){var e=t.child,n=t.layoutTokens;s(e,n)});var v=f.every(function(t){return t.rect.left===c.left}),y=n(o);v&&y.push("-stack"),y.push("divider:initialized"),s(t,y)}}},w=function(t){var e,i,r=Array.from(t.children),o=d(a(t),["stairs:initialized"]);s(t,o);var l=r[0];if(l){if(t.style.removeProperty("--unitone--stairs-step-overflow-volume"),t.style.removeProperty("--unitone--max-stairs-step"),r.forEach(function(t){t.style.removeProperty("--unitone--stairs-step")}),h(t)){var u,c=null===(e=(null!==(i=t.getAttribute("data-unitone-layout"))&&void 0!==i?i:"").split(/\s+/).find(function(t){return t.startsWith("-stairs-up:")}))||void 0===e?void 0:e.replace("-stairs-up:",""),f=["up-down","down-up"].includes(c),v=window.getComputedStyle(t).getPropertyValue("flex-direction"),y=t.getBoundingClientRect().bottom,p=r.reduce(function(t,e){var n=window.getComputedStyle(e).getPropertyValue("position"),i=window.getComputedStyle(e).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===i||t.push({child:e,rect:e.getBoundingClientRect()}),t},[]),m=0,g=m;p.map(function(t,e){var n,i,r=t.child,o=t.rect,a="row-reverse"===v?(null===(n=u)||void 0===n?void 0:n.left)<=o.left:(null===(i=u)||void 0===i?void 0:i.left)>=o.left;return 0===e||l===r&&!u||a?m=0:f?m=0===m?1:0:m++,u=o,m>g&&(g=m),{child:r,stairsStep:m}}).forEach(function(t){var e=t.child,n=t.stairsStep;e.style.setProperty("--unitone--stairs-step",n)}),t.style.setProperty("--unitone--max-stairs-step",g);var b=p.reduce(function(t,e){var n=e.child.getBoundingClientRect().bottom-y;return t>n?t:n},0);t.style.setProperty("--unitone--stairs-step-overflow-volume",b),s(t,[].concat(n(o),["stairs:initialized"]))}}else s(t,[].concat(n(o),["stairs:initialized"]))},A=function(t){return t.some(function(t){return"attributes"===t.type||"childList"===t.type&&[].concat(n(t.addedNodes),n(t.removedNodes)).some(function(t){return!function(t){return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&["vertical-writing__thresholder","vertical-writing:initialized","vertical-writing:safari"].includes(t.getAttribute("data-unitone-layout"))}(t)})})},z=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)},C=Symbol.for("@inc2734/unitone-css/layout-initializers"),E=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[C]||(globalThis[C]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[C])},S=function(t,e){var n,i;if(t.enabled()&&(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE){var r=new Set;null!==(n=e.matches)&&void 0!==n&&n.call(e,t.selector)&&r.add(e),null===(i=e.querySelectorAll)||void 0===i||i.call(e,t.selector).forEach(function(t){r.add(t)}),r.forEach(function(e){t.initialized.has(e)||(t.initialize(e),t.initialized.add(e))})}},N=function(t){var e=E();e&&e.initializers.forEach(function(e){S(e,t)})},O=function(){var t=E();t&&(t.pendingNodes.forEach(function(t){N(t)}),t.pendingNodes.clear(),t.rafId=0)},V=function(){var t=E();t&&!t.observer&&document.body&&(N(document.body),t.observer=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE&&t.pendingNodes.add(e)})}),!t.rafId&&0<t.pendingNodes.size&&(t.rafId=requestAnimationFrame(O))}),t.observer.observe(document.body,{childList:!0,subtree:!0}))},M=function(t){var e=t.key,n=t.selector,i=t.initialize,r=t.enabled,o=void 0===r?function(){return!0}:r,l=E();if(l&&!l.initializers.has(e)){var u={selector:n,initialize:i,enabled:o,initialized:new WeakSet};l.initializers.set(e,u),l.observer?S(u,document.body):"loading"!==document.readyState?V():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",V,{once:!0}),l.hasDOMContentLoadedListener=!0)}};M({key:"layout-primitives/marquee",selector:'[data-unitone-layout~="marquee-wrapper"]',initialize:function(t){var e;v(t,function(t){e=function(t){var e,n=function(t){var e,n=null!==(e=t.getAttribute("data-unitone-layout"))&&void 0!==e?e:"";n.split(/\s+/).includes("marquee:initialized")||t.setAttribute("data-unitone-layout","".concat(n," marquee:initialized").trim())},i=function(){return t.querySelectorAll(':scope > [data-unitone-layout~="marquee"]')},r=i();if(0!==r.length){var o=Array.from(r).some(function(t){var e;return(null!==(e=t.getAttribute(l))&&void 0!==e?e:"").split(/\s+/).includes("marquee:initialized")});if(1===t.childElementCount&&1===r.length){var u=r[0];(e=u.cloneNode(!0)).setAttribute("aria-hidden","true"),u.after(e)}return r=i(),o?(r.forEach(function(t){var e,n,i;i=(null!==(n=(e=t).getAttribute("data-unitone-layout"))&&void 0!==n?n:"").split(/\s+/).filter(function(t){return t&&"marquee:initialized"!==t}).join(" "),e.setAttribute("data-unitone-layout",i)}),requestAnimationFrame(function(){null!=t&&t.isConnected&&i().forEach(function(t){n(t)})}),e):(r.forEach(function(t){n(t)}),e)}}(t)},{observeResize:!1,observeIntersection:!0,targetMutation:{options:{childList:!0},shouldApply:function(t){var n,i=t.flatMap(function(t){var e;return Array.from(null!==(e=t.addedNodes)&&void 0!==e?e:[])}),r=t.flatMap(function(t){var e;return Array.from(null!==(e=t.removedNodes)&&void 0!==e?e:[])});return null!==(n=e)&&void 0!==n&&n.isConnected&&1===i.length&&0===r.length&&i[0]===e?(e=null,!1):(e=null,!0)}}})}}),M({key:"layout-primitives/vertical-writing",selector:'[data-unitone-layout~="vertical-writing"]',initialize:function(t){v(t,function(t){var e;null!==(e=t.parentNode)&&void 0!==e&&e.style&&(t.parentNode.style.height=""),function(t){if(t){var e,i=a(t),r=d(i,["vertical-writing:safari","-force-switch"]),o=d(i,["vertical-writing:initialized","vertical-writing:safari","-force-switch"]);if(s(t,r),Array.from(t.children).reverse().some(function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position)&&"none"!==getComputedStyle(t).display)return e=t,!0}),e){var u=getComputedStyle(t),c=String(u.getPropertyValue("--unitone--threshold")).trim(),f=!1;if(c){var v=t.ownerDocument.createElement("div");v.setAttribute(l,"vertical-writing__thresholder"),t.appendChild(v),f=v.offsetWidth>=t.offsetWidth,v.remove()}f?o.push("-force-switch"):t.getBoundingClientRect().left>e.getBoundingClientRect().left&&o.push("vertical-writing:safari"),s(t,[].concat(n(o),["vertical-writing:initialized"])),requestAnimationFrame(function(){var n;if(null!=t&&t.isConnected&&null!==(n=t.parentNode)&&void 0!==n&&n.style){if(f)return void(t.parentNode.style.height="");var i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=i.top+i.height,l=r.top+r.height;t.parentNode.style.height=o!==l?"".concat(Math.ceil(l-i.top),"px"):""}})}else s(t,[].concat(n(o),["vertical-writing:initialized"]))}}(t)},{getResizeValue:p,observeIntersection:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0},shouldApply:A}})}}),M({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(t){if("data-unitone-layout"===t.attributeName){var i,r,o,l,u=[].concat(n(null!==(i=null==e||null===(r=e.ignore)||void 0===r?void 0:r.layout)&&void 0!==i?i:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=t.target.getAttribute(t.attributeName))&&void 0!==o?o:"").split(" ").filter(function(t){return!u.includes(t)}).join(" ")!==(null!==(l=t.oldValue)&&void 0!==l?l:"").split(" ").filter(function(t){return!u.includes(t)}).join(" ")}if("class"===t.attributeName){var a,d,s,c,f=n(null!==(a=null==e||null===(d=e.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(s=t.target.getAttribute(t.attributeName))&&void 0!==s?s:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")!==(null!==(c=t.oldValue)&&void 0!==c?c:"").split(" ").filter(function(t){return!f.includes(t)}).join(" ")}return"style"===t.attributeName};v(t,b,{getResizeValue:y,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(e){return function(t,e){return t.some(function(t){return"attributes"===t.type&&e(t)})}(e,function(e){return e.target===t&&i(e)})}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:i}})}}),M({key:"behaviors/stairs",selector:'[data-unitone-layout*="-stairs:"]',initialize:function(t){v(t,w,{observeIntersection:!0,observeDirectChildrenResize:!0})}});M({key:"compatibility/fluid-typography",selector:'[style*="font-size:"], [data-unitone-layout~="-fluid-typography"]',initialize:function(t){var e=t.ownerDocument;e.defaultView.getComputedStyle(e.documentElement).getPropertyValue("--unitone--is-firefox").trim()&&v(t,z,{getResizeValue:y,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0},shouldApply:function(){return!0}}})},enabled:function(){return"undefined"!=typeof window&&"undefined"!=typeof document&&!!window.getComputedStyle(document.documentElement).getPropertyValue("--unitone--is-firefox").trim()}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(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 t(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}function n(n){return function(t){if(Array.isArray(t))return e(t)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t(n)||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 r(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){d=!0,i=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return u}}(e,n)||t(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function 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 l,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,l=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw l}}}}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}var l="data-unitone-layout",u="".concat(200,"px 0px"),a=function(e){var t;return(null!==(t=e.getAttribute(l))&&void 0!==t?t:"").split(/\s+/).filter(Boolean)},d=function(e,t){return e.filter((function(e){return!t.includes(e)}))},c=function(e,t){var n,r=t.filter(Boolean).join(" ");(null!==(n=e.getAttribute(l))&&void 0!==n?n:"")!==r&&e.setAttribute(l,r)},s=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.getValue,l=r.delay,u=!0,a=new ResizeObserver(p((function(e){var r,l=i(e);try{for(l.s();!(r=l.n()).done;){var a=r.value,d=null==o?void 0:o(a);u?(n=d,u=!1):void 0!==d&&d===n||(t(a.target,a),n=d)}}catch(e){l.e(e)}finally{l.f()}}),void 0===l?250:l));return a.observe(e),a},f=function(e,t,n){var r=new MutationObserver((function(t){requestAnimationFrame((function(){null!=e&&e.isConnected&&n(t)}))}));return r.observe(e,t),r},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,a=void 0===l?250:l,d=n.observeResize,c=void 0===d||d,v=n.observeIntersection,b=void 0!==v&&v,y=n.observeDirectChildrenResize,m=void 0!==y&&y,g=n.targetMutation,A=n.directChildMutation,w=b&&"undefined"!=typeof IntersectionObserver,O=!w||h(e),z=w&&!O,C=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=n&&n.isConnected&&(!w||O?(z=!1,t(n)):z=!0)},E=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame((function(){r=0,n=null,null!=e&&e.isConnected&&t(e)}))):t(e)}}(e,C),S=function(){null!=e&&e.isConnected&&(!w||O?(z=!0,E()):z=!0)},M=function(){},N=c?m?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,o=n.delay,l=void 0===o?250:o,u=n.onChildList,a=new WeakMap,d=new Set,c=new ResizeObserver(p((function(n){var o,l=!1,u=i(n);try{for(u.s();!(o=u.n()).done;){var d=o.value,c=null==r?void 0:r(d);a.has(d.target)?(void 0!==c&&c===a.get(d.target)||(l=!0),a.set(d.target,c)):a.set(d.target,c)}}catch(e){u.e(e)}finally{u.f()}l&&t(e)}),l)),s=function(){var t;Array.from(d).forEach((function(t){t.parentElement!==e&&(c.unobserve(t),d.delete(t),a.delete(t))})),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach((function(e){d.has(e)||(c.observe(e),d.add(e))}))};c.observe(e),s();var v=f(e,{childList:!0},(function(n){n.some((function(e){return"childList"===e.type}))&&(s(),null==u||u(n),t(e))}));return{resizeObserver:c,mutationObserver:v}}(e,S,{getValue:o,delay:a,onChildList:function(){M()}}):{resizeObserver:s(e,S,{getValue:o,delay:a})}:{mutationObserver:null};w&&function(e,t){var n=new IntersectionObserver((function(e){var n=r(e,1)[0];n&&t(n)}),{rootMargin:u});n.observe(e)}(e,(function(e){(O=e.isIntersecting)&&z&&S()})),null!=g&&g.options&&f(e,g.options,(function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&S()}));var V=null!=A&&A.attributeFilter&&A.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver((function(n){requestAnimationFrame((function(){null!=e&&e.isConnected&&n.some((function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)}))&&t(e)}))})),a=function(){var t;u.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach((function(e){u.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:l})}))};return a(),{observer:u,syncObservedChildren:a}}(e,S,{attributeFilter:A.attributeFilter,shouldApply:A.shouldApply,attributeOldValue:A.attributeOldValue}):null;V&&(M=V.syncObservedChildren),!N.mutationObserver&&V&&f(e,{childList:!0},(function(e){e.some((function(e){return"childList"===e.type}))&&(M(),S())})),w&&!O||C(e)},b=function(e){var t;return null===(t=e.borderBoxSize)||void 0===t?void 0:t[0].inlineSize},y=function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length},h=function(e){var t;if(!y(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function p(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 l=this;clearTimeout(n),n=setTimeout((function(){e.apply(l,i)}),t)}}var m=function(e){var t,r=Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]),i=r[0];if(i){var o=d(a(e),["divider:initialized","-stack"]);c(e,o);var l=new Map;if(r.forEach((function(e){var t=d(a(e),["-bol","-linewrap"]);l.set(e,t),c(e,t)})),y(e)){var u,s=i.getBoundingClientRect(),f=r.reduce((function(e,t){var n,r=window.getComputedStyle(t).getPropertyValue("position"),i=window.getComputedStyle(t).getPropertyValue("display");"absolute"!==r&&"fixed"!==r&&"none"!==i&&e.push({child:t,layoutTokens:null!==(n=l.get(t))&&void 0!==n?n:[],rect:t.getBoundingClientRect()});return e}),[]);f.map((function(e,t){var r,i,o=e.child,l=e.layoutTokens,a=e.rect,d=n(l);return(0===t||(null===(r=u)||void 0===r?void 0:r.top)<a.top&&(null===(i=u)||void 0===i?void 0:i.left)>=a.left)&&d.push("-bol"),0<t&&s.top<a.top&&d.push("-linewrap"),u=a,{child:o,layoutTokens:d}})).forEach((function(e){var t=e.child,n=e.layoutTokens;c(t,n)}));var v=f.every((function(e){return e.rect.left===s.left})),b=n(o);v&&b.push("-stack"),b.push("divider:initialized"),c(e,b)}}},g=Symbol.for("@inc2734/unitone-css/layout-initializers"),A=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[g]||(globalThis[g]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[g])},w=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach((function(e){i.add(e)})),i.forEach((function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))}))}},O=function(e){var t=A();t&&t.initializers.forEach((function(t){w(t,e)}))},z=function(){var e=A();e&&(e.pendingNodes.forEach((function(e){O(e)})),e.pendingNodes.clear(),e.rafId=0)},C=function(){var e=A();e&&!e.observer&&document.body&&(O(document.body),e.observer=new MutationObserver((function(t){t.forEach((function(t){t.addedNodes.forEach((function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)}))})),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(z))})),e.observer.observe(document.body,{childList:!0,subtree:!0}))};!function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,l=A();if(l&&!l.initializers.has(t)){var u={selector:n,initialize:r,enabled:o,initialized:new WeakSet};l.initializers.set(t,u),l.observer?w(u,document.body):"loading"!==document.readyState?C():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",C,{once:!0}),l.hasDOMContentLoadedListener=!0)}}({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=function(e){if("data-unitone-layout"===e.attributeName){var r,i,o,l,u=[].concat(n(null!==(r=null==t||null===(i=t.ignore)||void 0===i?void 0:i.layout)&&void 0!==r?r:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=e.target.getAttribute(e.attributeName))&&void 0!==o?o:"").split(" ").filter((function(e){return!u.includes(e)})).join(" ")!==(null!==(l=e.oldValue)&&void 0!==l?l:"").split(" ").filter((function(e){return!u.includes(e)})).join(" ")}if("class"===e.attributeName){var a,d,c,s,f=n(null!==(a=null==t||null===(d=t.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(c=e.target.getAttribute(e.attributeName))&&void 0!==c?c:"").split(" ").filter((function(e){return!f.includes(e)})).join(" ")!==(null!==(s=e.oldValue)&&void 0!==s?s:"").split(" ").filter((function(e){return!f.includes(e)})).join(" ")}return"style"===e.attributeName};v(e,m,{getResizeValue:b,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(t){return function(e,t){return e.some((function(e){return"attributes"===e.type&&t(e)}))}(t,(function(t){return t.target===e&&r(t)}))}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:r}})}});
|
|
1
|
+
"use strict";function e(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 t(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}function n(n){return function(t){if(Array.isArray(t))return e(t)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t(n)||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 r(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){d=!0,i=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return u}}(e,n)||t(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function 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 l,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,l=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw l}}}}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}var l="data-unitone-layout",u="".concat(200,"px 0px"),a=function(e){var t;return(null!==(t=e.getAttribute(l))&&void 0!==t?t:"").split(/\s+/).filter(Boolean)},d=function(e,t){return e.filter(function(e){return!t.includes(e)})},c=function(e,t){var n,r=t.filter(Boolean).join(" ");(null!==(n=e.getAttribute(l))&&void 0!==n?n:"")!==r&&e.setAttribute(l,r)},s=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.getValue,l=r.delay,u=!0,a=new ResizeObserver(p(function(e){var r,l=i(e);try{for(l.s();!(r=l.n()).done;){var a=r.value,d=null==o?void 0:o(a);u?(n=d,u=!1):void 0!==d&&d===n||(t(a.target,a),n=d)}}catch(e){l.e(e)}finally{l.f()}},void 0===l?250:l));return a.observe(e),a},f=function(e,t,n){var r=new MutationObserver(function(t){requestAnimationFrame(function(){null!=e&&e.isConnected&&n(t)})});return r.observe(e,t),r},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,a=void 0===l?250:l,d=n.observeResize,c=void 0===d||d,v=n.observeIntersection,b=void 0!==v&&v,y=n.observeDirectChildrenResize,m=void 0!==y&&y,g=n.targetMutation,A=n.directChildMutation,w=b&&"undefined"!=typeof IntersectionObserver,O=!w||h(e),z=w&&!O,C=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=n&&n.isConnected&&(!w||O?(z=!1,t(n)):z=!0)},E=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame(function(){r=0,n=null,null!=e&&e.isConnected&&t(e)})):t(e)}}(e,C),S=function(){null!=e&&e.isConnected&&(!w||O?(z=!0,E()):z=!0)},M=function(){},N=c?m?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,o=n.delay,l=void 0===o?250:o,u=n.onChildList,a=new WeakMap,d=new Set,c=new ResizeObserver(p(function(n){var o,l=!1,u=i(n);try{for(u.s();!(o=u.n()).done;){var d=o.value,c=null==r?void 0:r(d);a.has(d.target)?(void 0!==c&&c===a.get(d.target)||(l=!0),a.set(d.target,c)):a.set(d.target,c)}}catch(e){u.e(e)}finally{u.f()}l&&t(e)},l)),s=function(){var t;Array.from(d).forEach(function(t){t.parentElement!==e&&(c.unobserve(t),d.delete(t),a.delete(t))}),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){d.has(e)||(c.observe(e),d.add(e))})};c.observe(e),s();var v=f(e,{childList:!0},function(n){n.some(function(e){return"childList"===e.type})&&(s(),null==u||u(n),t(e))});return{resizeObserver:c,mutationObserver:v}}(e,S,{getValue:o,delay:a,onChildList:function(){M()}}):{resizeObserver:s(e,S,{getValue:o,delay:a})}:{mutationObserver:null};w&&function(e,t){var n=new IntersectionObserver(function(e){var n=r(e,1)[0];n&&t(n)},{rootMargin:u});n.observe(e)}(e,function(e){(O=e.isIntersecting)&&z&&S()}),null!=g&&g.options&&f(e,g.options,function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&S()});var V=null!=A&&A.attributeFilter&&A.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver(function(n){requestAnimationFrame(function(){null!=e&&e.isConnected&&n.some(function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)})&&t(e)})}),a=function(){var t;u.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){u.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:l})})};return a(),{observer:u,syncObservedChildren:a}}(e,S,{attributeFilter:A.attributeFilter,shouldApply:A.shouldApply,attributeOldValue:A.attributeOldValue}):null;V&&(M=V.syncObservedChildren),!N.mutationObserver&&V&&f(e,{childList:!0},function(e){e.some(function(e){return"childList"===e.type})&&(M(),S())}),w&&!O||C(e)},b=function(e){var t;return null===(t=e.borderBoxSize)||void 0===t?void 0:t[0].inlineSize},y=function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length},h=function(e){var t;if(!y(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function p(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 l=this;clearTimeout(n),n=setTimeout(function(){e.apply(l,i)},t)}}var m=function(e){var t,r=Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]),i=r[0];if(i){var o=d(a(e),["divider:initialized","-stack"]);c(e,o);var l=new Map;if(r.forEach(function(e){var t=d(a(e),["-bol","-linewrap"]);l.set(e,t),c(e,t)}),y(e)){var u,s=i.getBoundingClientRect(),f=r.reduce(function(e,t){var n,r=window.getComputedStyle(t).getPropertyValue("position"),i=window.getComputedStyle(t).getPropertyValue("display");"absolute"!==r&&"fixed"!==r&&"none"!==i&&e.push({child:t,layoutTokens:null!==(n=l.get(t))&&void 0!==n?n:[],rect:t.getBoundingClientRect()});return e},[]);f.map(function(e,t){var r,i,o=e.child,l=e.layoutTokens,a=e.rect,d=n(l);return(0===t||(null===(r=u)||void 0===r?void 0:r.top)<a.top&&(null===(i=u)||void 0===i?void 0:i.left)>=a.left)&&d.push("-bol"),0<t&&s.top<a.top&&d.push("-linewrap"),u=a,{child:o,layoutTokens:d}}).forEach(function(e){var t=e.child,n=e.layoutTokens;c(t,n)});var v=f.every(function(e){return e.rect.left===s.left}),b=n(o);v&&b.push("-stack"),b.push("divider:initialized"),c(e,b)}}},g=Symbol.for("@inc2734/unitone-css/layout-initializers"),A=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[g]||(globalThis[g]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[g])},w=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach(function(e){i.add(e)}),i.forEach(function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))})}},O=function(e){var t=A();t&&t.initializers.forEach(function(t){w(t,e)})},z=function(){var e=A();e&&(e.pendingNodes.forEach(function(e){O(e)}),e.pendingNodes.clear(),e.rafId=0)},C=function(){var e=A();e&&!e.observer&&document.body&&(O(document.body),e.observer=new MutationObserver(function(t){t.forEach(function(t){t.addedNodes.forEach(function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)})}),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(z))}),e.observer.observe(document.body,{childList:!0,subtree:!0}))};!function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,l=A();if(l&&!l.initializers.has(t)){var u={selector:n,initialize:r,enabled:o,initialized:new WeakSet};l.initializers.set(t,u),l.observer?w(u,document.body):"loading"!==document.readyState?C():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",C,{once:!0}),l.hasDOMContentLoadedListener=!0)}}({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=function(e){if("data-unitone-layout"===e.attributeName){var r,i,o,l,u=[].concat(n(null!==(r=null==t||null===(i=t.ignore)||void 0===i?void 0:i.layout)&&void 0!==r?r:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=e.target.getAttribute(e.attributeName))&&void 0!==o?o:"").split(" ").filter(function(e){return!u.includes(e)}).join(" ")!==(null!==(l=e.oldValue)&&void 0!==l?l:"").split(" ").filter(function(e){return!u.includes(e)}).join(" ")}if("class"===e.attributeName){var a,d,c,s,f=n(null!==(a=null==t||null===(d=t.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(c=e.target.getAttribute(e.attributeName))&&void 0!==c?c:"").split(" ").filter(function(e){return!f.includes(e)}).join(" ")!==(null!==(s=e.oldValue)&&void 0!==s?s:"").split(" ").filter(function(e){return!f.includes(e)}).join(" ")}return"style"===e.attributeName};v(e,m,{getResizeValue:b,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(t){return function(e,t){return e.some(function(e){return"attributes"===e.type&&t(e)})}(t,function(t){return t.target===e&&r(t)})}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:r}})}});
|
package/dist/behaviors/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(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 t(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}function n(n){return function(t){if(Array.isArray(t))return e(t)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t(n)||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 r(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){d=!0,i=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return u}}(e,n)||t(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function 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 l,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,l=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw l}}}}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}var l="data-unitone-layout",u="".concat(200,"px 0px"),a=function(e){var t;return(null!==(t=e.getAttribute(l))&&void 0!==t?t:"").split(/\s+/).filter(Boolean)},d=function(e,t){return e.filter((function(e){return!t.includes(e)}))},s=function(e,t){var n,r=t.filter(Boolean).join(" ");(null!==(n=e.getAttribute(l))&&void 0!==n?n:"")!==r&&e.setAttribute(l,r)},c=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.getValue,l=r.delay,u=!0,a=new ResizeObserver(h((function(e){var r,l=i(e);try{for(l.s();!(r=l.n()).done;){var a=r.value,d=null==o?void 0:o(a);u?(n=d,u=!1):void 0!==d&&d===n||(t(a.target,a),n=d)}}catch(e){l.e(e)}finally{l.f()}}),void 0===l?250:l));return a.observe(e),a},f=function(e,t,n){var r=new MutationObserver((function(t){requestAnimationFrame((function(){null!=e&&e.isConnected&&n(t)}))}));return r.observe(e,t),r},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,a=void 0===l?250:l,d=n.observeResize,s=void 0===d||d,v=n.observeIntersection,y=void 0!==v&&v,p=n.observeDirectChildrenResize,m=void 0!==p&&p,g=n.targetMutation,w=n.directChildMutation,A=y&&"undefined"!=typeof IntersectionObserver,C=!A||b(e),z=A&&!C,O=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=n&&n.isConnected&&(!A||C?(z=!1,t(n)):z=!0)},S=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame((function(){r=0,n=null,null!=e&&e.isConnected&&t(e)}))):t(e)}}(e,O),E=function(){null!=e&&e.isConnected&&(!A||C?(z=!0,S()):z=!0)},V=function(){},M=s?m?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,o=n.delay,l=void 0===o?250:o,u=n.onChildList,a=new WeakMap,d=new Set,s=new ResizeObserver(h((function(n){var o,l=!1,u=i(n);try{for(u.s();!(o=u.n()).done;){var d=o.value,s=null==r?void 0:r(d);a.has(d.target)?(void 0!==s&&s===a.get(d.target)||(l=!0),a.set(d.target,s)):a.set(d.target,s)}}catch(e){u.e(e)}finally{u.f()}l&&t(e)}),l)),c=function(){var t;Array.from(d).forEach((function(t){t.parentElement!==e&&(s.unobserve(t),d.delete(t),a.delete(t))})),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach((function(e){d.has(e)||(s.observe(e),d.add(e))}))};s.observe(e),c();var v=f(e,{childList:!0},(function(n){n.some((function(e){return"childList"===e.type}))&&(c(),null==u||u(n),t(e))}));return{resizeObserver:s,mutationObserver:v}}(e,E,{getValue:o,delay:a,onChildList:function(){V()}}):{resizeObserver:c(e,E,{getValue:o,delay:a})}:{mutationObserver:null};A&&function(e,t){var n=new IntersectionObserver((function(e){var n=r(e,1)[0];n&&t(n)}),{rootMargin:u});n.observe(e)}(e,(function(e){(C=e.isIntersecting)&&z&&E()})),null!=g&&g.options&&f(e,g.options,(function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&E()}));var N=null!=w&&w.attributeFilter&&w.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver((function(n){requestAnimationFrame((function(){null!=e&&e.isConnected&&n.some((function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)}))&&t(e)}))})),a=function(){var t;u.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach((function(e){u.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:l})}))};return a(),{observer:u,syncObservedChildren:a}}(e,E,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;N&&(V=N.syncObservedChildren),!M.mutationObserver&&N&&f(e,{childList:!0},(function(e){e.some((function(e){return"childList"===e.type}))&&(V(),E())})),A&&!C||O(e)},y=function(e){var t;return null===(t=e.borderBoxSize)||void 0===t?void 0:t[0].inlineSize},p=function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length},b=function(e){var t;if(!p(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function h(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 l=this;clearTimeout(n),n=setTimeout((function(){e.apply(l,i)}),t)}}var m=function(e){var t,r=Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]),i=r[0];if(i){var o=d(a(e),["divider:initialized","-stack"]);s(e,o);var l=new Map;if(r.forEach((function(e){var t=d(a(e),["-bol","-linewrap"]);l.set(e,t),s(e,t)})),p(e)){var u,c=i.getBoundingClientRect(),f=r.reduce((function(e,t){var n,r=window.getComputedStyle(t).getPropertyValue("position"),i=window.getComputedStyle(t).getPropertyValue("display");"absolute"!==r&&"fixed"!==r&&"none"!==i&&e.push({child:t,layoutTokens:null!==(n=l.get(t))&&void 0!==n?n:[],rect:t.getBoundingClientRect()});return e}),[]);f.map((function(e,t){var r,i,o=e.child,l=e.layoutTokens,a=e.rect,d=n(l);return(0===t||(null===(r=u)||void 0===r?void 0:r.top)<a.top&&(null===(i=u)||void 0===i?void 0:i.left)>=a.left)&&d.push("-bol"),0<t&&c.top<a.top&&d.push("-linewrap"),u=a,{child:o,layoutTokens:d}})).forEach((function(e){var t=e.child,n=e.layoutTokens;s(t,n)}));var v=f.every((function(e){return e.rect.left===c.left})),y=n(o);v&&y.push("-stack"),y.push("divider:initialized"),s(e,y)}}},g=function(e){var t,r,i=Array.from(e.children),o=d(a(e),["stairs:initialized"]);s(e,o);var l=i[0];if(l){if(e.style.removeProperty("--unitone--stairs-step-overflow-volume"),e.style.removeProperty("--unitone--max-stairs-step"),i.forEach((function(e){e.style.removeProperty("--unitone--stairs-step")})),p(e)){var u,c=null===(t=(null!==(r=e.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/).find((function(e){return e.startsWith("-stairs-up:")})))||void 0===t?void 0:t.replace("-stairs-up:",""),f=["up-down","down-up"].includes(c),v=window.getComputedStyle(e).getPropertyValue("flex-direction"),y=e.getBoundingClientRect().bottom,b=i.reduce((function(e,t){var n=window.getComputedStyle(t).getPropertyValue("position"),r=window.getComputedStyle(t).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===r||e.push({child:t,rect:t.getBoundingClientRect()}),e}),[]),h=0,m=h;b.map((function(e,t){var n,r,i=e.child,o=e.rect,a="row-reverse"===v?(null===(n=u)||void 0===n?void 0:n.left)<=o.left:(null===(r=u)||void 0===r?void 0:r.left)>=o.left;return 0===t||l===i&&!u||a?h=0:f?h=0===h?1:0:h++,u=o,h>m&&(m=h),{child:i,stairsStep:h}})).forEach((function(e){var t=e.child,n=e.stairsStep;t.style.setProperty("--unitone--stairs-step",n)})),e.style.setProperty("--unitone--max-stairs-step",m);var g=b.reduce((function(e,t){var n=t.child.getBoundingClientRect().bottom-y;return e>n?e:n}),0);e.style.setProperty("--unitone--stairs-step-overflow-volume",g),s(e,[].concat(n(o),["stairs:initialized"]))}}else s(e,[].concat(n(o),["stairs:initialized"]))},w=Symbol.for("@inc2734/unitone-css/layout-initializers"),A=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[w]||(globalThis[w]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[w])},C=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach((function(e){i.add(e)})),i.forEach((function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))}))}},z=function(e){var t=A();t&&t.initializers.forEach((function(t){C(t,e)}))},O=function(){var e=A();e&&(e.pendingNodes.forEach((function(e){z(e)})),e.pendingNodes.clear(),e.rafId=0)},S=function(){var e=A();e&&!e.observer&&document.body&&(z(document.body),e.observer=new MutationObserver((function(t){t.forEach((function(t){t.addedNodes.forEach((function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)}))})),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(O))})),e.observer.observe(document.body,{childList:!0,subtree:!0}))},E=function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,l=A();if(l&&!l.initializers.has(t)){var u={selector:n,initialize:r,enabled:o,initialized:new WeakSet};l.initializers.set(t,u),l.observer?C(u,document.body):"loading"!==document.readyState?S():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",S,{once:!0}),l.hasDOMContentLoadedListener=!0)}};E({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=function(e){if("data-unitone-layout"===e.attributeName){var r,i,o,l,u=[].concat(n(null!==(r=null==t||null===(i=t.ignore)||void 0===i?void 0:i.layout)&&void 0!==r?r:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=e.target.getAttribute(e.attributeName))&&void 0!==o?o:"").split(" ").filter((function(e){return!u.includes(e)})).join(" ")!==(null!==(l=e.oldValue)&&void 0!==l?l:"").split(" ").filter((function(e){return!u.includes(e)})).join(" ")}if("class"===e.attributeName){var a,d,s,c,f=n(null!==(a=null==t||null===(d=t.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(s=e.target.getAttribute(e.attributeName))&&void 0!==s?s:"").split(" ").filter((function(e){return!f.includes(e)})).join(" ")!==(null!==(c=e.oldValue)&&void 0!==c?c:"").split(" ").filter((function(e){return!f.includes(e)})).join(" ")}return"style"===e.attributeName};v(e,m,{getResizeValue:y,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(t){return function(e,t){return e.some((function(e){return"attributes"===e.type&&t(e)}))}(t,(function(t){return t.target===e&&r(t)}))}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:r}})}}),E({key:"behaviors/stairs",selector:'[data-unitone-layout*="-stairs:"]',initialize:function(e){v(e,g,{observeIntersection:!0,observeDirectChildrenResize:!0})}});
|
|
1
|
+
"use strict";function e(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 t(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}function n(n){return function(t){if(Array.isArray(t))return e(t)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t(n)||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 r(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){d=!0,i=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return u}}(e,n)||t(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function 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 l,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,l=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw l}}}}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}var l="data-unitone-layout",u="".concat(200,"px 0px"),a=function(e){var t;return(null!==(t=e.getAttribute(l))&&void 0!==t?t:"").split(/\s+/).filter(Boolean)},d=function(e,t){return e.filter(function(e){return!t.includes(e)})},s=function(e,t){var n,r=t.filter(Boolean).join(" ");(null!==(n=e.getAttribute(l))&&void 0!==n?n:"")!==r&&e.setAttribute(l,r)},c=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.getValue,l=r.delay,u=!0,a=new ResizeObserver(h(function(e){var r,l=i(e);try{for(l.s();!(r=l.n()).done;){var a=r.value,d=null==o?void 0:o(a);u?(n=d,u=!1):void 0!==d&&d===n||(t(a.target,a),n=d)}}catch(e){l.e(e)}finally{l.f()}},void 0===l?250:l));return a.observe(e),a},f=function(e,t,n){var r=new MutationObserver(function(t){requestAnimationFrame(function(){null!=e&&e.isConnected&&n(t)})});return r.observe(e,t),r},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,a=void 0===l?250:l,d=n.observeResize,s=void 0===d||d,v=n.observeIntersection,y=void 0!==v&&v,p=n.observeDirectChildrenResize,m=void 0!==p&&p,g=n.targetMutation,w=n.directChildMutation,A=y&&"undefined"!=typeof IntersectionObserver,C=!A||b(e),z=A&&!C,O=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=n&&n.isConnected&&(!A||C?(z=!1,t(n)):z=!0)},S=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame(function(){r=0,n=null,null!=e&&e.isConnected&&t(e)})):t(e)}}(e,O),E=function(){null!=e&&e.isConnected&&(!A||C?(z=!0,S()):z=!0)},V=function(){},M=s?m?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,o=n.delay,l=void 0===o?250:o,u=n.onChildList,a=new WeakMap,d=new Set,s=new ResizeObserver(h(function(n){var o,l=!1,u=i(n);try{for(u.s();!(o=u.n()).done;){var d=o.value,s=null==r?void 0:r(d);a.has(d.target)?(void 0!==s&&s===a.get(d.target)||(l=!0),a.set(d.target,s)):a.set(d.target,s)}}catch(e){u.e(e)}finally{u.f()}l&&t(e)},l)),c=function(){var t;Array.from(d).forEach(function(t){t.parentElement!==e&&(s.unobserve(t),d.delete(t),a.delete(t))}),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){d.has(e)||(s.observe(e),d.add(e))})};s.observe(e),c();var v=f(e,{childList:!0},function(n){n.some(function(e){return"childList"===e.type})&&(c(),null==u||u(n),t(e))});return{resizeObserver:s,mutationObserver:v}}(e,E,{getValue:o,delay:a,onChildList:function(){V()}}):{resizeObserver:c(e,E,{getValue:o,delay:a})}:{mutationObserver:null};A&&function(e,t){var n=new IntersectionObserver(function(e){var n=r(e,1)[0];n&&t(n)},{rootMargin:u});n.observe(e)}(e,function(e){(C=e.isIntersecting)&&z&&E()}),null!=g&&g.options&&f(e,g.options,function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&E()});var N=null!=w&&w.attributeFilter&&w.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver(function(n){requestAnimationFrame(function(){null!=e&&e.isConnected&&n.some(function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)})&&t(e)})}),a=function(){var t;u.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){u.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:l})})};return a(),{observer:u,syncObservedChildren:a}}(e,E,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;N&&(V=N.syncObservedChildren),!M.mutationObserver&&N&&f(e,{childList:!0},function(e){e.some(function(e){return"childList"===e.type})&&(V(),E())}),A&&!C||O(e)},y=function(e){var t;return null===(t=e.borderBoxSize)||void 0===t?void 0:t[0].inlineSize},p=function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length},b=function(e){var t;if(!p(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function h(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 l=this;clearTimeout(n),n=setTimeout(function(){e.apply(l,i)},t)}}var m=function(e){var t,r=Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]),i=r[0];if(i){var o=d(a(e),["divider:initialized","-stack"]);s(e,o);var l=new Map;if(r.forEach(function(e){var t=d(a(e),["-bol","-linewrap"]);l.set(e,t),s(e,t)}),p(e)){var u,c=i.getBoundingClientRect(),f=r.reduce(function(e,t){var n,r=window.getComputedStyle(t).getPropertyValue("position"),i=window.getComputedStyle(t).getPropertyValue("display");"absolute"!==r&&"fixed"!==r&&"none"!==i&&e.push({child:t,layoutTokens:null!==(n=l.get(t))&&void 0!==n?n:[],rect:t.getBoundingClientRect()});return e},[]);f.map(function(e,t){var r,i,o=e.child,l=e.layoutTokens,a=e.rect,d=n(l);return(0===t||(null===(r=u)||void 0===r?void 0:r.top)<a.top&&(null===(i=u)||void 0===i?void 0:i.left)>=a.left)&&d.push("-bol"),0<t&&c.top<a.top&&d.push("-linewrap"),u=a,{child:o,layoutTokens:d}}).forEach(function(e){var t=e.child,n=e.layoutTokens;s(t,n)});var v=f.every(function(e){return e.rect.left===c.left}),y=n(o);v&&y.push("-stack"),y.push("divider:initialized"),s(e,y)}}},g=function(e){var t,r,i=Array.from(e.children),o=d(a(e),["stairs:initialized"]);s(e,o);var l=i[0];if(l){if(e.style.removeProperty("--unitone--stairs-step-overflow-volume"),e.style.removeProperty("--unitone--max-stairs-step"),i.forEach(function(e){e.style.removeProperty("--unitone--stairs-step")}),p(e)){var u,c=null===(t=(null!==(r=e.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/).find(function(e){return e.startsWith("-stairs-up:")}))||void 0===t?void 0:t.replace("-stairs-up:",""),f=["up-down","down-up"].includes(c),v=window.getComputedStyle(e).getPropertyValue("flex-direction"),y=e.getBoundingClientRect().bottom,b=i.reduce(function(e,t){var n=window.getComputedStyle(t).getPropertyValue("position"),r=window.getComputedStyle(t).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===r||e.push({child:t,rect:t.getBoundingClientRect()}),e},[]),h=0,m=h;b.map(function(e,t){var n,r,i=e.child,o=e.rect,a="row-reverse"===v?(null===(n=u)||void 0===n?void 0:n.left)<=o.left:(null===(r=u)||void 0===r?void 0:r.left)>=o.left;return 0===t||l===i&&!u||a?h=0:f?h=0===h?1:0:h++,u=o,h>m&&(m=h),{child:i,stairsStep:h}}).forEach(function(e){var t=e.child,n=e.stairsStep;t.style.setProperty("--unitone--stairs-step",n)}),e.style.setProperty("--unitone--max-stairs-step",m);var g=b.reduce(function(e,t){var n=t.child.getBoundingClientRect().bottom-y;return e>n?e:n},0);e.style.setProperty("--unitone--stairs-step-overflow-volume",g),s(e,[].concat(n(o),["stairs:initialized"]))}}else s(e,[].concat(n(o),["stairs:initialized"]))},w=Symbol.for("@inc2734/unitone-css/layout-initializers"),A=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[w]||(globalThis[w]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[w])},C=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach(function(e){i.add(e)}),i.forEach(function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))})}},z=function(e){var t=A();t&&t.initializers.forEach(function(t){C(t,e)})},O=function(){var e=A();e&&(e.pendingNodes.forEach(function(e){z(e)}),e.pendingNodes.clear(),e.rafId=0)},S=function(){var e=A();e&&!e.observer&&document.body&&(z(document.body),e.observer=new MutationObserver(function(t){t.forEach(function(t){t.addedNodes.forEach(function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)})}),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(O))}),e.observer.observe(document.body,{childList:!0,subtree:!0}))},E=function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,l=A();if(l&&!l.initializers.has(t)){var u={selector:n,initialize:r,enabled:o,initialized:new WeakSet};l.initializers.set(t,u),l.observer?C(u,document.body):"loading"!==document.readyState?S():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",S,{once:!0}),l.hasDOMContentLoadedListener=!0)}};E({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=function(e){if("data-unitone-layout"===e.attributeName){var r,i,o,l,u=[].concat(n(null!==(r=null==t||null===(i=t.ignore)||void 0===i?void 0:i.layout)&&void 0!==r?r:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=e.target.getAttribute(e.attributeName))&&void 0!==o?o:"").split(" ").filter(function(e){return!u.includes(e)}).join(" ")!==(null!==(l=e.oldValue)&&void 0!==l?l:"").split(" ").filter(function(e){return!u.includes(e)}).join(" ")}if("class"===e.attributeName){var a,d,s,c,f=n(null!==(a=null==t||null===(d=t.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(s=e.target.getAttribute(e.attributeName))&&void 0!==s?s:"").split(" ").filter(function(e){return!f.includes(e)}).join(" ")!==(null!==(c=e.oldValue)&&void 0!==c?c:"").split(" ").filter(function(e){return!f.includes(e)}).join(" ")}return"style"===e.attributeName};v(e,m,{getResizeValue:y,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(t){return function(e,t){return e.some(function(e){return"attributes"===e.type&&t(e)})}(t,function(t){return t.target===e&&r(t)})}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:r}})}}),E({key:"behaviors/stairs",selector:'[data-unitone-layout*="-stairs:"]',initialize:function(e){v(e,g,{observeIntersection:!0,observeDirectChildrenResize:!0})}});
|
package/dist/behaviors/stairs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(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 t(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}function n(n){return function(t){if(Array.isArray(t))return e(t)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t(n)||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 r(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],u=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){d=!0,i=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return a}}(e,n)||t(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function 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 l,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,l=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw l}}}}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}var l="data-unitone-layout",a="".concat(200,"px 0px"),u=function(e,t){var n,r=t.filter(Boolean).join(" ");(null!==(n=e.getAttribute(l))&&void 0!==n?n:"")!==r&&e.setAttribute(l,r)},d=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.getValue,l=r.delay,a=!0,u=new ResizeObserver(y((function(e){var r,l=i(e);try{for(l.s();!(r=l.n()).done;){var u=r.value,d=null==o?void 0:o(u);a?(n=d,a=!1):void 0!==d&&d===n||(t(u.target,u),n=d)}}catch(e){l.e(e)}finally{l.f()}}),void 0===l?250:l));return u.observe(e),u},s=function(e,t,n){var r=new MutationObserver((function(t){requestAnimationFrame((function(){null!=e&&e.isConnected&&n(t)}))}));return r.observe(e,t),r},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,u=void 0===l?250:l,c=n.observeResize,f=void 0===c||c,b=n.observeIntersection,h=void 0!==b&&b,p=n.observeDirectChildrenResize,m=void 0!==p&&p,g=n.targetMutation,w=n.directChildMutation,A=h&&"undefined"!=typeof IntersectionObserver,O=!A||v(e),C=A&&!O,E=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=n&&n.isConnected&&(!A||O?(C=!1,t(n)):C=!0)},S=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame((function(){r=0,n=null,null!=e&&e.isConnected&&t(e)}))):t(e)}}(e,E),z=function(){null!=e&&e.isConnected&&(!A||O?(C=!0,S()):C=!0)},I=function(){},L=f?m?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,o=n.delay,l=void 0===o?250:o,a=n.onChildList,u=new WeakMap,d=new Set,c=new ResizeObserver(y((function(n){var o,l=!1,a=i(n);try{for(a.s();!(o=a.n()).done;){var d=o.value,s=null==r?void 0:r(d);u.has(d.target)?(void 0!==s&&s===u.get(d.target)||(l=!0),u.set(d.target,s)):u.set(d.target,s)}}catch(e){a.e(e)}finally{a.f()}l&&t(e)}),l)),f=function(){var t;Array.from(d).forEach((function(t){t.parentElement!==e&&(c.unobserve(t),d.delete(t),u.delete(t))})),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach((function(e){d.has(e)||(c.observe(e),d.add(e))}))};c.observe(e),f();var v=s(e,{childList:!0},(function(n){n.some((function(e){return"childList"===e.type}))&&(f(),null==a||a(n),t(e))}));return{resizeObserver:c,mutationObserver:v}}(e,z,{getValue:o,delay:u,onChildList:function(){I()}}):{resizeObserver:d(e,z,{getValue:o,delay:u})}:{mutationObserver:null};A&&function(e,t){var n=new IntersectionObserver((function(e){var n=r(e,1)[0];n&&t(n)}),{rootMargin:a});n.observe(e)}(e,(function(e){(O=e.isIntersecting)&&C&&z()})),null!=g&&g.options&&s(e,g.options,(function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&z()}));var M=null!=w&&w.attributeFilter&&w.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,a=new MutationObserver((function(n){requestAnimationFrame((function(){null!=e&&e.isConnected&&n.some((function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)}))&&t(e)}))})),u=function(){var t;a.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach((function(e){a.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:l})}))};return u(),{observer:a,syncObservedChildren:u}}(e,z,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;M&&(I=M.syncObservedChildren),!L.mutationObserver&&M&&s(e,{childList:!0},(function(e){e.some((function(e){return"childList"===e.type}))&&(I(),z())})),A&&!O||E(e)},f=function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length},v=function(e){var t;if(!f(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function y(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 l=this;clearTimeout(n),n=setTimeout((function(){e.apply(l,i)}),t)}}var b=function(e){var t,r,i,o,a,d=Array.from(e.children),s=(i=(null!==(a=e.getAttribute(l))&&void 0!==a?a:"").split(/\s+/).filter(Boolean),o=["stairs:initialized"],i.filter((function(e){return!o.includes(e)})));u(e,s);var c=d[0];if(c){if(e.style.removeProperty("--unitone--stairs-step-overflow-volume"),e.style.removeProperty("--unitone--max-stairs-step"),d.forEach((function(e){e.style.removeProperty("--unitone--stairs-step")})),f(e)){var v,y=null===(t=(null!==(r=e.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/).find((function(e){return e.startsWith("-stairs-up:")})))||void 0===t?void 0:t.replace("-stairs-up:",""),b=["up-down","down-up"].includes(y),h=window.getComputedStyle(e).getPropertyValue("flex-direction"),p=e.getBoundingClientRect().bottom,m=d.reduce((function(e,t){var n=window.getComputedStyle(t).getPropertyValue("position"),r=window.getComputedStyle(t).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===r||e.push({child:t,rect:t.getBoundingClientRect()}),e}),[]),g=0,w=g;m.map((function(e,t){var n,r,i=e.child,o=e.rect,l="row-reverse"===h?(null===(n=v)||void 0===n?void 0:n.left)<=o.left:(null===(r=v)||void 0===r?void 0:r.left)>=o.left;return 0===t||c===i&&!v||l?g=0:b?g=0===g?1:0:g++,v=o,g>w&&(w=g),{child:i,stairsStep:g}})).forEach((function(e){var t=e.child,n=e.stairsStep;t.style.setProperty("--unitone--stairs-step",n)})),e.style.setProperty("--unitone--max-stairs-step",w);var A=m.reduce((function(e,t){var n=t.child.getBoundingClientRect().bottom-p;return e>n?e:n}),0);e.style.setProperty("--unitone--stairs-step-overflow-volume",A),u(e,[].concat(n(s),["stairs:initialized"]))}}else u(e,[].concat(n(s),["stairs:initialized"]))},h=Symbol.for("@inc2734/unitone-css/layout-initializers"),p=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[h]||(globalThis[h]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[h])},m=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach((function(e){i.add(e)})),i.forEach((function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))}))}},g=function(e){var t=p();t&&t.initializers.forEach((function(t){m(t,e)}))},w=function(){var e=p();e&&(e.pendingNodes.forEach((function(e){g(e)})),e.pendingNodes.clear(),e.rafId=0)},A=function(){var e=p();e&&!e.observer&&document.body&&(g(document.body),e.observer=new MutationObserver((function(t){t.forEach((function(t){t.addedNodes.forEach((function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)}))})),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(w))})),e.observer.observe(document.body,{childList:!0,subtree:!0}))};!function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,l=p();if(l&&!l.initializers.has(t)){var a={selector:n,initialize:r,enabled:o,initialized:new WeakSet};l.initializers.set(t,a),l.observer?m(a,document.body):"loading"!==document.readyState?A():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",A,{once:!0}),l.hasDOMContentLoadedListener=!0)}}({key:"behaviors/stairs",selector:'[data-unitone-layout*="-stairs:"]',initialize:function(e){c(e,b,{observeIntersection:!0,observeDirectChildrenResize:!0})}});
|
|
1
|
+
"use strict";function e(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 t(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}function n(n){return function(t){if(Array.isArray(t))return e(t)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t(n)||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 r(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],u=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){d=!0,i=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return a}}(e,n)||t(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function 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 l,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,l=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw l}}}}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}var l="data-unitone-layout",a="".concat(200,"px 0px"),u=function(e,t){var n,r=t.filter(Boolean).join(" ");(null!==(n=e.getAttribute(l))&&void 0!==n?n:"")!==r&&e.setAttribute(l,r)},d=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.getValue,l=r.delay,a=!0,u=new ResizeObserver(y(function(e){var r,l=i(e);try{for(l.s();!(r=l.n()).done;){var u=r.value,d=null==o?void 0:o(u);a?(n=d,a=!1):void 0!==d&&d===n||(t(u.target,u),n=d)}}catch(e){l.e(e)}finally{l.f()}},void 0===l?250:l));return u.observe(e),u},s=function(e,t,n){var r=new MutationObserver(function(t){requestAnimationFrame(function(){null!=e&&e.isConnected&&n(t)})});return r.observe(e,t),r},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.getResizeValue,l=n.delay,u=void 0===l?250:l,c=n.observeResize,f=void 0===c||c,b=n.observeIntersection,h=void 0!==b&&b,p=n.observeDirectChildrenResize,m=void 0!==p&&p,g=n.targetMutation,w=n.directChildMutation,A=h&&"undefined"!=typeof IntersectionObserver,O=!A||v(e),C=A&&!O,E=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=n&&n.isConnected&&(!A||O?(C=!1,t(n)):C=!0)},S=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame(function(){r=0,n=null,null!=e&&e.isConnected&&t(e)})):t(e)}}(e,E),z=function(){null!=e&&e.isConnected&&(!A||O?(C=!0,S()):C=!0)},I=function(){},L=f?m?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,o=n.delay,l=void 0===o?250:o,a=n.onChildList,u=new WeakMap,d=new Set,c=new ResizeObserver(y(function(n){var o,l=!1,a=i(n);try{for(a.s();!(o=a.n()).done;){var d=o.value,s=null==r?void 0:r(d);u.has(d.target)?(void 0!==s&&s===u.get(d.target)||(l=!0),u.set(d.target,s)):u.set(d.target,s)}}catch(e){a.e(e)}finally{a.f()}l&&t(e)},l)),f=function(){var t;Array.from(d).forEach(function(t){t.parentElement!==e&&(c.unobserve(t),d.delete(t),u.delete(t))}),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){d.has(e)||(c.observe(e),d.add(e))})};c.observe(e),f();var v=s(e,{childList:!0},function(n){n.some(function(e){return"childList"===e.type})&&(f(),null==a||a(n),t(e))});return{resizeObserver:c,mutationObserver:v}}(e,z,{getValue:o,delay:u,onChildList:function(){I()}}):{resizeObserver:d(e,z,{getValue:o,delay:u})}:{mutationObserver:null};A&&function(e,t){var n=new IntersectionObserver(function(e){var n=r(e,1)[0];n&&t(n)},{rootMargin:a});n.observe(e)}(e,function(e){(O=e.isIntersecting)&&C&&z()}),null!=g&&g.options&&s(e,g.options,function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&z()});var M=null!=w&&w.attributeFilter&&w.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,a=new MutationObserver(function(n){requestAnimationFrame(function(){null!=e&&e.isConnected&&n.some(function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)})&&t(e)})}),u=function(){var t;a.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){a.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:l})})};return u(),{observer:a,syncObservedChildren:u}}(e,z,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;M&&(I=M.syncObservedChildren),!L.mutationObserver&&M&&s(e,{childList:!0},function(e){e.some(function(e){return"childList"===e.type})&&(I(),z())}),A&&!O||E(e)},f=function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length},v=function(e){var t;if(!f(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function y(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 l=this;clearTimeout(n),n=setTimeout(function(){e.apply(l,i)},t)}}var b=function(e){var t,r,i,o,a,d=Array.from(e.children),s=(i=(null!==(a=e.getAttribute(l))&&void 0!==a?a:"").split(/\s+/).filter(Boolean),o=["stairs:initialized"],i.filter(function(e){return!o.includes(e)}));u(e,s);var c=d[0];if(c){if(e.style.removeProperty("--unitone--stairs-step-overflow-volume"),e.style.removeProperty("--unitone--max-stairs-step"),d.forEach(function(e){e.style.removeProperty("--unitone--stairs-step")}),f(e)){var v,y=null===(t=(null!==(r=e.getAttribute("data-unitone-layout"))&&void 0!==r?r:"").split(/\s+/).find(function(e){return e.startsWith("-stairs-up:")}))||void 0===t?void 0:t.replace("-stairs-up:",""),b=["up-down","down-up"].includes(y),h=window.getComputedStyle(e).getPropertyValue("flex-direction"),p=e.getBoundingClientRect().bottom,m=d.reduce(function(e,t){var n=window.getComputedStyle(t).getPropertyValue("position"),r=window.getComputedStyle(t).getPropertyValue("display");return"absolute"===n||"fixed"===n||"none"===r||e.push({child:t,rect:t.getBoundingClientRect()}),e},[]),g=0,w=g;m.map(function(e,t){var n,r,i=e.child,o=e.rect,l="row-reverse"===h?(null===(n=v)||void 0===n?void 0:n.left)<=o.left:(null===(r=v)||void 0===r?void 0:r.left)>=o.left;return 0===t||c===i&&!v||l?g=0:b?g=0===g?1:0:g++,v=o,g>w&&(w=g),{child:i,stairsStep:g}}).forEach(function(e){var t=e.child,n=e.stairsStep;t.style.setProperty("--unitone--stairs-step",n)}),e.style.setProperty("--unitone--max-stairs-step",w);var A=m.reduce(function(e,t){var n=t.child.getBoundingClientRect().bottom-p;return e>n?e:n},0);e.style.setProperty("--unitone--stairs-step-overflow-volume",A),u(e,[].concat(n(s),["stairs:initialized"]))}}else u(e,[].concat(n(s),["stairs:initialized"]))},h=Symbol.for("@inc2734/unitone-css/layout-initializers"),p=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[h]||(globalThis[h]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[h])},m=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach(function(e){i.add(e)}),i.forEach(function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))})}},g=function(e){var t=p();t&&t.initializers.forEach(function(t){m(t,e)})},w=function(){var e=p();e&&(e.pendingNodes.forEach(function(e){g(e)}),e.pendingNodes.clear(),e.rafId=0)},A=function(){var e=p();e&&!e.observer&&document.body&&(g(document.body),e.observer=new MutationObserver(function(t){t.forEach(function(t){t.addedNodes.forEach(function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)})}),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(w))}),e.observer.observe(document.body,{childList:!0,subtree:!0}))};!function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,l=p();if(l&&!l.initializers.has(t)){var a={selector:n,initialize:r,enabled:o,initialized:new WeakSet};l.initializers.set(t,a),l.observer?m(a,document.body):"loading"!==document.readyState?A():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",A,{once:!0}),l.hasDOMContentLoadedListener=!0)}}({key:"behaviors/stairs",selector:'[data-unitone-layout*="-stairs:"]',initialize:function(e){c(e,b,{observeIntersection:!0,observeDirectChildrenResize:!0})}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(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 t(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,u,a=[],l=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){d=!0,i=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(d)throw i}}return a}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(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 r(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)?r(e,t):void 0}}(e))||t){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 u,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,u=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw u}}}}function r(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}var i="".concat(200,"px 0px"),o=function(e,t){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.getValue,u=i.delay,a=!0,l=new ResizeObserver(c(
|
|
1
|
+
"use strict";function e(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 t(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,u,a=[],l=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){d=!0,i=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(d)throw i}}return a}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(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 r(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)?r(e,t):void 0}}(e))||t){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 u,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,u=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw u}}}}function r(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}var i="".concat(200,"px 0px"),o=function(e,t){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.getValue,u=i.delay,a=!0,l=new ResizeObserver(c(function(e){var i,u=n(e);try{for(u.s();!(i=u.n()).done;){var l=i.value,d=null==o?void 0:o(l);a?(r=d,a=!1):void 0!==d&&d===r||(t(l.target,l),r=d)}}catch(e){u.e(e)}finally{u.f()}},void 0===u?250:u));return l.observe(e),l},u=function(e,t,n){var r=new MutationObserver(function(t){requestAnimationFrame(function(){null!=e&&e.isConnected&&n(t)})});return r.observe(e,t),r},a=function(e,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=a.getResizeValue,s=a.delay,f=void 0===s?250:s,v=a.observeResize,y=void 0===v||v,b=a.observeIntersection,h=void 0!==b&&b,m=a.observeDirectChildrenResize,p=void 0!==m&&m,g=a.targetMutation,w=a.directChildMutation,A=h&&"undefined"!=typeof IntersectionObserver,O=!A||d(e),z=A&&!O,E=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=t&&t.isConnected&&(!A||O?(z=!1,r(t)):z=!0)},C=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame(function(){r=0,n=null,null!=e&&e.isConnected&&t(e)})):t(e)}}(e,E),S=function(){null!=e&&e.isConnected&&(!A||O?(z=!0,C()):z=!0)},M=function(){},L=y?p?function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.getValue,o=r.delay,a=void 0===o?250:o,l=r.onChildList,d=new WeakMap,s=new Set,f=new ResizeObserver(c(function(r){var o,u=!1,a=n(r);try{for(a.s();!(o=a.n()).done;){var l=o.value,c=null==i?void 0:i(l);d.has(l.target)?(void 0!==c&&c===d.get(l.target)||(u=!0),d.set(l.target,c)):d.set(l.target,c)}}catch(e){a.e(e)}finally{a.f()}u&&t(e)},a)),v=function(){var t;Array.from(s).forEach(function(t){t.parentElement!==e&&(f.unobserve(t),s.delete(t),d.delete(t))}),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){s.has(e)||(f.observe(e),s.add(e))})};f.observe(e),v();var y=u(e,{childList:!0},function(n){n.some(function(e){return"childList"===e.type})&&(v(),null==l||l(n),t(e))});return{resizeObserver:f,mutationObserver:y}}(e,S,{getValue:l,delay:f,onChildList:function(){M()}}):{resizeObserver:o(e,S,{getValue:l,delay:f})}:{mutationObserver:null};A&&function(e,n){var r=new IntersectionObserver(function(e){var r=t(e,1)[0];r&&n(r)},{rootMargin:i});r.observe(e)}(e,function(e){(O=e.isIntersecting)&&z&&S()}),null!=g&&g.options&&u(e,g.options,function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&S()});var V=null!=w&&w.attributeFilter&&w.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,u=void 0===o||o,a=new MutationObserver(function(n){requestAnimationFrame(function(){null!=e&&e.isConnected&&n.some(function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)})&&t(e)})}),l=function(){var t;a.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){a.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:u})})};return l(),{observer:a,syncObservedChildren:l}}(e,S,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;V&&(M=V.syncObservedChildren),!L.mutationObserver&&V&&u(e,{childList:!0},function(e){e.some(function(e){return"childList"===e.type})&&(M(),S())}),A&&!O||E(e)},l=function(e){var t;return null===(t=e.borderBoxSize)||void 0===t?void 0:t[0].inlineSize},d=function(e){var t;if(!function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length}(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function c(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 u=this;clearTimeout(n),n=setTimeout(function(){e.apply(u,i)},t)}}var 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)},f=Symbol.for("@inc2734/unitone-css/layout-initializers"),v=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[f]||(globalThis[f]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[f])},y=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach(function(e){i.add(e)}),i.forEach(function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))})}},b=function(e){var t=v();t&&t.initializers.forEach(function(t){y(t,e)})},h=function(){var e=v();e&&(e.pendingNodes.forEach(function(e){b(e)}),e.pendingNodes.clear(),e.rafId=0)},m=function(){var e=v();e&&!e.observer&&document.body&&(b(document.body),e.observer=new MutationObserver(function(t){t.forEach(function(t){t.addedNodes.forEach(function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)})}),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(h))}),e.observer.observe(document.body,{childList:!0,subtree:!0}))};!function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,u=v();if(u&&!u.initializers.has(t)){var a={selector:n,initialize:r,enabled:o,initialized:new WeakSet};u.initializers.set(t,a),u.observer?y(a,document.body):"loading"!==document.readyState?m():u.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",m,{once:!0}),u.hasDOMContentLoadedListener=!0)}}({key:"compatibility/fluid-typography",selector:'[style*="font-size:"], [data-unitone-layout~="-fluid-typography"]',initialize:function(e){var t=e.ownerDocument;t.defaultView.getComputedStyle(t.documentElement).getPropertyValue("--unitone--is-firefox").trim()&&a(e,s,{getResizeValue:l,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0},shouldApply:function(){return!0}}})},enabled:function(){return"undefined"!=typeof window&&"undefined"!=typeof document&&!!window.getComputedStyle(document.documentElement).getPropertyValue("--unitone--is-firefox").trim()}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(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 t(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,u,a=[],l=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){d=!0,i=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(d)throw i}}return a}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(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 r(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)?r(e,t):void 0}}(e))||t){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 u,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,u=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw u}}}}function r(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}var i="".concat(200,"px 0px"),o=function(e,t){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.getValue,u=i.delay,a=!0,l=new ResizeObserver(c(
|
|
1
|
+
"use strict";function e(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 t(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,u,a=[],l=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){d=!0,i=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(d)throw i}}return a}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);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)?e(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(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 r(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)?r(e,t):void 0}}(e))||t){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 u,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,u=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw u}}}}function r(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}var i="".concat(200,"px 0px"),o=function(e,t){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.getValue,u=i.delay,a=!0,l=new ResizeObserver(c(function(e){var i,u=n(e);try{for(u.s();!(i=u.n()).done;){var l=i.value,d=null==o?void 0:o(l);a?(r=d,a=!1):void 0!==d&&d===r||(t(l.target,l),r=d)}}catch(e){u.e(e)}finally{u.f()}},void 0===u?250:u));return l.observe(e),l},u=function(e,t,n){var r=new MutationObserver(function(t){requestAnimationFrame(function(){null!=e&&e.isConnected&&n(t)})});return r.observe(e,t),r},a=function(e,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=a.getResizeValue,s=a.delay,f=void 0===s?250:s,v=a.observeResize,y=void 0===v||v,b=a.observeIntersection,h=void 0!==b&&b,m=a.observeDirectChildrenResize,p=void 0!==m&&m,g=a.targetMutation,w=a.directChildMutation,A=h&&"undefined"!=typeof IntersectionObserver,O=!A||d(e),z=A&&!O,E=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=t&&t.isConnected&&(!A||O?(z=!1,r(t)):z=!0)},C=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame(function(){r=0,n=null,null!=e&&e.isConnected&&t(e)})):t(e)}}(e,E),S=function(){null!=e&&e.isConnected&&(!A||O?(z=!0,C()):z=!0)},M=function(){},L=y?p?function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.getValue,o=r.delay,a=void 0===o?250:o,l=r.onChildList,d=new WeakMap,s=new Set,f=new ResizeObserver(c(function(r){var o,u=!1,a=n(r);try{for(a.s();!(o=a.n()).done;){var l=o.value,c=null==i?void 0:i(l);d.has(l.target)?(void 0!==c&&c===d.get(l.target)||(u=!0),d.set(l.target,c)):d.set(l.target,c)}}catch(e){a.e(e)}finally{a.f()}u&&t(e)},a)),v=function(){var t;Array.from(s).forEach(function(t){t.parentElement!==e&&(f.unobserve(t),s.delete(t),d.delete(t))}),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){s.has(e)||(f.observe(e),s.add(e))})};f.observe(e),v();var y=u(e,{childList:!0},function(n){n.some(function(e){return"childList"===e.type})&&(v(),null==l||l(n),t(e))});return{resizeObserver:f,mutationObserver:y}}(e,S,{getValue:l,delay:f,onChildList:function(){M()}}):{resizeObserver:o(e,S,{getValue:l,delay:f})}:{mutationObserver:null};A&&function(e,n){var r=new IntersectionObserver(function(e){var r=t(e,1)[0];r&&n(r)},{rootMargin:i});r.observe(e)}(e,function(e){(O=e.isIntersecting)&&z&&S()}),null!=g&&g.options&&u(e,g.options,function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&S()});var V=null!=w&&w.attributeFilter&&w.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,u=void 0===o||o,a=new MutationObserver(function(n){requestAnimationFrame(function(){null!=e&&e.isConnected&&n.some(function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)})&&t(e)})}),l=function(){var t;a.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){a.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:u})})};return l(),{observer:a,syncObservedChildren:l}}(e,S,{attributeFilter:w.attributeFilter,shouldApply:w.shouldApply,attributeOldValue:w.attributeOldValue}):null;V&&(M=V.syncObservedChildren),!L.mutationObserver&&V&&u(e,{childList:!0},function(e){e.some(function(e){return"childList"===e.type})&&(M(),S())}),A&&!O||E(e)},l=function(e){var t;return null===(t=e.borderBoxSize)||void 0===t?void 0:t[0].inlineSize},d=function(e){var t;if(!function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length}(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function c(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 u=this;clearTimeout(n),n=setTimeout(function(){e.apply(u,i)},t)}}var 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)},f=Symbol.for("@inc2734/unitone-css/layout-initializers"),v=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[f]||(globalThis[f]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[f])},y=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach(function(e){i.add(e)}),i.forEach(function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))})}},b=function(e){var t=v();t&&t.initializers.forEach(function(t){y(t,e)})},h=function(){var e=v();e&&(e.pendingNodes.forEach(function(e){b(e)}),e.pendingNodes.clear(),e.rafId=0)},m=function(){var e=v();e&&!e.observer&&document.body&&(b(document.body),e.observer=new MutationObserver(function(t){t.forEach(function(t){t.addedNodes.forEach(function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)})}),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(h))}),e.observer.observe(document.body,{childList:!0,subtree:!0}))};!function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,u=v();if(u&&!u.initializers.has(t)){var a={selector:n,initialize:r,enabled:o,initialized:new WeakSet};u.initializers.set(t,a),u.observer?y(a,document.body):"loading"!==document.readyState?m():u.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",m,{once:!0}),u.hasDOMContentLoadedListener=!0)}}({key:"compatibility/fluid-typography",selector:'[style*="font-size:"], [data-unitone-layout~="-fluid-typography"]',initialize:function(e){var t=e.ownerDocument;t.defaultView.getComputedStyle(t.documentElement).getPropertyValue("--unitone--is-firefox").trim()&&a(e,s,{getResizeValue:l,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],characterData:!0},shouldApply:function(){return!0}}})},enabled:function(){return"undefined"!=typeof window&&"undefined"!=typeof document&&!!window.getComputedStyle(document.documentElement).getPropertyValue("--unitone--is-firefox").trim()}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=require("react");function t(){return t=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},t.apply(null,arguments)}function e(r){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e(r)}function n(r){var t=function(r,t){if("object"!=e(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var o=n.call(r,t);if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(r,"string");return"symbol"==e(t)?t:t+""}function o(r,t,e){return(t=n(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var i=["gap","columnGap","rowGap","alignItems","style"];function c(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(
|
|
1
|
+
"use strict";var r=require("react");function t(){return t=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},t.apply(null,arguments)}function e(r){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e(r)}function n(r){var t=function(r,t){if("object"!=e(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var o=n.call(r,t);if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(r,"string");return"symbol"==e(t)?t:t+""}function o(r,t,e){return(t=n(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var i=["gap","columnGap","rowGap","alignItems","style"];function c(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),e.push.apply(e,n)}return e}exports.BothSides=function(e){var n=e.gap,l=e.columnGap,u=e.rowGap,a=e.alignItems,f=e.style,p=function(r,t){if(null==r)return{};var e,n,o=function(r,t){if(null==r)return{};var e={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==t.indexOf(n))continue;e[n]=r[n]}return e}(r,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)e=i[n],-1===t.indexOf(e)&&{}.propertyIsEnumerable.call(r,e)&&(o[e]=r[e])}return o}(e,i);return f=function(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?c(Object(e),!0).forEach(function(t){o(r,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}return r}({},f),r.createElement("div",t({"data-unitone-layout":["both-sides",""!==(null!=n?n:"")?"-gap:".concat(n):void 0,""!==(null!=l?l:"")?"-column-gap:".concat(l):void 0,""!==(null!=u?u:"")?"-row-gap:".concat(u):void 0,""!==(null!=a?a:"")?"-align-items:".concat(a):void 0].filter(Boolean).join(" "),style:f},p),p.children)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("react");function r(){return r=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},r.apply(null,arguments)}function e(t){return e="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},e(t)}function n(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r);if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}function o(t,r,e){return(r=n(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var i=["intrinsic","withText","gutters","maxWidth","style"];function u(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(
|
|
1
|
+
"use strict";var t=require("react");function r(){return r=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},r.apply(null,arguments)}function e(t){return e="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},e(t)}function n(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r);if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}function o(t,r,e){return(r=n(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var i=["intrinsic","withText","gutters","maxWidth","style"];function u(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function c(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?u(Object(e),!0).forEach(function(r){o(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}exports.Center=function(e){e.intrinsic;var n=e.withText,o=e.gutters,u=e.maxWidth,l=e.style,a=function(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==r.indexOf(n))continue;e[n]=t[n]}return e}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],-1===r.indexOf(e)&&{}.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}(e,i);return l=c(c({},l),{},{"--unitone--max-width":""!==u?u:void 0}),t.createElement("div",r({"data-unitone-layout":["center",!0===n?"-with-text":void 0,""!==(null!=o?o:"")?"-gutters:".concat(o):void 0].filter(Boolean).join(" "),style:l},a),a.children)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");function t(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 n(e,n){if(e){if("string"==typeof e)return t(e,n);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)?t(e,n):void 0}}function r(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(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){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){d=!0,i=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return u}}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(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 l(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)?l(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 o,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}function l(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}var u="data-unitone-layout",a="".concat(200,"px 0px"),d=function(e){var t;return(null!==(t=e.getAttribute(u))&&void 0!==t?t:"").split(/\s+/).filter(Boolean)},c=function(e,t){return e.filter((function(e){return!t.includes(e)}))},s=function(e,t){var n,r=t.filter(Boolean).join(" ");(null!==(n=e.getAttribute(u))&&void 0!==n?n:"")!==r&&e.setAttribute(u,r)},f=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.getValue,l=r.delay,u=!0,a=new ResizeObserver(m((function(e){var r,l=o(e);try{for(l.s();!(r=l.n()).done;){var a=r.value,d=null==i?void 0:i(a);u?(n=d,u=!1):void 0!==d&&d===n||(t(a.target,a),n=d)}}catch(e){l.e(e)}finally{l.f()}}),void 0===l?250:l));return a.observe(e),a},v=function(e,t,n){var r=new MutationObserver((function(t){requestAnimationFrame((function(){null!=e&&e.isConnected&&n(t)}))}));return r.observe(e,t),r},y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getResizeValue,l=n.delay,u=void 0===l?250:l,d=n.observeResize,c=void 0===d||d,s=n.observeIntersection,y=void 0!==s&&s,b=n.observeDirectChildrenResize,p=void 0!==b&&b,g=n.targetMutation,O=n.directChildMutation,w=y&&"undefined"!=typeof IntersectionObserver,A=!w||h(e),S=w&&!A,j=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=n&&n.isConnected&&(!w||A?(S=!1,t(n)):S=!0)},C=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame((function(){r=0,n=null,null!=e&&e.isConnected&&t(e)}))):t(e)}}(e,j),E=function(){null!=e&&e.isConnected&&(!w||A?(S=!0,C()):S=!0)},z=function(){},N=c?p?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,i=n.delay,l=void 0===i?250:i,u=n.onChildList,a=new WeakMap,d=new Set,c=new ResizeObserver(m((function(n){var i,l=!1,u=o(n);try{for(u.s();!(i=u.n()).done;){var d=i.value,c=null==r?void 0:r(d);a.has(d.target)?(void 0!==c&&c===a.get(d.target)||(l=!0),a.set(d.target,c)):a.set(d.target,c)}}catch(e){u.e(e)}finally{u.f()}l&&t(e)}),l)),s=function(){var t;Array.from(d).forEach((function(t){t.parentElement!==e&&(c.unobserve(t),d.delete(t),a.delete(t))})),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach((function(e){d.has(e)||(c.observe(e),d.add(e))}))};c.observe(e),s();var f=v(e,{childList:!0},(function(n){n.some((function(e){return"childList"===e.type}))&&(s(),null==u||u(n),t(e))}));return{resizeObserver:c,mutationObserver:f}}(e,E,{getValue:r,delay:u,onChildList:function(){z()}}):{resizeObserver:f(e,E,{getValue:r,delay:u})}:{mutationObserver:null};w&&function(e,t){var n=new IntersectionObserver((function(e){var n=i(e,1)[0];n&&t(n)}),{rootMargin:a});n.observe(e)}(e,(function(e){(A=e.isIntersecting)&&S&&E()})),null!=g&&g.options&&v(e,g.options,(function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&E()}));var I=null!=O&&O.attributeFilter&&O.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver((function(n){requestAnimationFrame((function(){null!=e&&e.isConnected&&n.some((function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)}))&&t(e)}))})),a=function(){var t;u.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach((function(e){u.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:l})}))};return a(),{observer:u,syncObservedChildren:a}}(e,E,{attributeFilter:O.attributeFilter,shouldApply:O.shouldApply,attributeOldValue:O.attributeOldValue}):null;I&&(z=I.syncObservedChildren),!N.mutationObserver&&I&&v(e,{childList:!0},(function(e){e.some((function(e){return"childList"===e.type}))&&(z(),E())})),w&&!A||j(e)},b=function(e){var t;return null===(t=e.borderBoxSize)||void 0===t?void 0:t[0].inlineSize},p=function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length},h=function(e){var t;if(!p(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function m(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 l=this;clearTimeout(n),n=setTimeout((function(){e.apply(l,i)}),t)}}var g=function(e){var t,n=Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]),i=n[0];if(i){var o=c(d(e),["divider:initialized","-stack"]);s(e,o);var l=new Map;if(n.forEach((function(e){var t=c(d(e),["-bol","-linewrap"]);l.set(e,t),s(e,t)})),p(e)){var u,a=i.getBoundingClientRect(),f=n.reduce((function(e,t){var n,r=window.getComputedStyle(t).getPropertyValue("position"),i=window.getComputedStyle(t).getPropertyValue("display");"absolute"!==r&&"fixed"!==r&&"none"!==i&&e.push({child:t,layoutTokens:null!==(n=l.get(t))&&void 0!==n?n:[],rect:t.getBoundingClientRect()});return e}),[]);f.map((function(e,t){var n,i,o=e.child,l=e.layoutTokens,d=e.rect,c=r(l);return(0===t||(null===(n=u)||void 0===n?void 0:n.top)<d.top&&(null===(i=u)||void 0===i?void 0:i.left)>=d.left)&&c.push("-bol"),0<t&&a.top<d.top&&c.push("-linewrap"),u=d,{child:o,layoutTokens:c}})).forEach((function(e){var t=e.child,n=e.layoutTokens;s(t,n)}));var v=f.every((function(e){return e.rect.left===a.left})),y=r(o);v&&y.push("-stack"),y.push("divider:initialized"),s(e,y)}}},O=Symbol.for("@inc2734/unitone-css/layout-initializers"),w=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[O]||(globalThis[O]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[O])},A=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach((function(e){i.add(e)})),i.forEach((function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))}))}},S=function(e){var t=w();t&&t.initializers.forEach((function(t){A(t,e)}))},j=function(){var e=w();e&&(e.pendingNodes.forEach((function(e){S(e)})),e.pendingNodes.clear(),e.rafId=0)},C=function(){var e=w();e&&!e.observer&&document.body&&(S(document.body),e.observer=new MutationObserver((function(t){t.forEach((function(t){t.addedNodes.forEach((function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)}))})),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(j))})),e.observer.observe(document.body,{childList:!0,subtree:!0}))};function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(null,arguments)}function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function N(e){var t=function(e,t){if("object"!=z(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==z(t)?t:t+""}function I(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,l=w();if(l&&!l.initializers.has(t)){var u={selector:n,initialize:r,enabled:o,initialized:new WeakSet};l.initializers.set(t,u),l.observer?A(u,document.body):"loading"!==document.readyState?C():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",C,{once:!0}),l.hasDOMContentLoadedListener=!0)}}({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(e){if("data-unitone-layout"===e.attributeName){var n,i,o,l,u=[].concat(r(null!==(n=null==t||null===(i=t.ignore)||void 0===i?void 0:i.layout)&&void 0!==n?n:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=e.target.getAttribute(e.attributeName))&&void 0!==o?o:"").split(" ").filter((function(e){return!u.includes(e)})).join(" ")!==(null!==(l=e.oldValue)&&void 0!==l?l:"").split(" ").filter((function(e){return!u.includes(e)})).join(" ")}if("class"===e.attributeName){var a,d,c,s,f=r(null!==(a=null==t||null===(d=t.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(c=e.target.getAttribute(e.attributeName))&&void 0!==c?c:"").split(" ").filter((function(e){return!f.includes(e)})).join(" ")!==(null!==(s=e.oldValue)&&void 0!==s?s:"").split(" ").filter((function(e){return!f.includes(e)})).join(" ")}return"style"===e.attributeName};y(e,g,{getResizeValue:b,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(t){return function(e,t){return e.some((function(e){return"attributes"===e.type&&t(e)}))}(t,(function(t){return t.target===e&&n(t)}))}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:n}})}});var M=["alignItems","divider","dividerWidth","dividerStyle","dividerColor","gap","columnGap","rowGap","justifyContent","nowrap","tagName","style"];function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){I(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}exports.Cluster=function(t){var n=t.alignItems,r=t.divider,i=t.dividerWidth,o=t.dividerStyle,l=t.dividerColor,u=t.gap,a=t.columnGap,d=t.rowGap,c=t.justifyContent,s=t.nowrap,f=t.tagName,v=void 0===f?"div":f,y=t.style,b=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,M),p=v;return y=L(L({},y),{},{"--unitone--divider-width":""!==i?i:void 0,"--unitone--divider-style":""!==o?o:void 0,"--unitone--divider-color":""!==l?l:void 0}),e.createElement(p,E({"data-unitone-layout":["cluster",""!==(null!=r?r:"")?"-divider:".concat(r):void 0,""!==(null!=u?u:"")?"-gap:".concat(u):void 0,""!==(null!=a?a:"")?"-column-gap:".concat(a):void 0,""!==(null!=d?d:"")?"-row-gap:".concat(d):void 0,""!==(null!=n?n:"")?"-align-items:".concat(n):void 0,""!==(null!=c?c:"")?"-justify-content:".concat(c):void 0,s?"-nowrap":void 0].filter(Boolean).join(" "),style:y},b),b.children)};
|
|
1
|
+
"use strict";var e=require("react");function t(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 n(e,n){if(e){if("string"==typeof e)return t(e,n);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)?t(e,n):void 0}}function r(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(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){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,u=[],a=!0,d=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){d=!0,i=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return u}}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(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 l(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)?l(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 o,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}function l(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}var u="data-unitone-layout",a="".concat(200,"px 0px"),d=function(e){var t;return(null!==(t=e.getAttribute(u))&&void 0!==t?t:"").split(/\s+/).filter(Boolean)},c=function(e,t){return e.filter(function(e){return!t.includes(e)})},s=function(e,t){var n,r=t.filter(Boolean).join(" ");(null!==(n=e.getAttribute(u))&&void 0!==n?n:"")!==r&&e.setAttribute(u,r)},f=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.getValue,l=r.delay,u=!0,a=new ResizeObserver(m(function(e){var r,l=o(e);try{for(l.s();!(r=l.n()).done;){var a=r.value,d=null==i?void 0:i(a);u?(n=d,u=!1):void 0!==d&&d===n||(t(a.target,a),n=d)}}catch(e){l.e(e)}finally{l.f()}},void 0===l?250:l));return a.observe(e),a},v=function(e,t,n){var r=new MutationObserver(function(t){requestAnimationFrame(function(){null!=e&&e.isConnected&&n(t)})});return r.observe(e,t),r},y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getResizeValue,l=n.delay,u=void 0===l?250:l,d=n.observeResize,c=void 0===d||d,s=n.observeIntersection,y=void 0!==s&&s,b=n.observeDirectChildrenResize,p=void 0!==b&&b,g=n.targetMutation,O=n.directChildMutation,w=y&&"undefined"!=typeof IntersectionObserver,A=!w||h(e),S=w&&!A,j=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;null!=n&&n.isConnected&&(!w||A?(S=!1,t(n)):S=!0)},C=function(e,t){var n,r=0;return function(){var i,o;null!==(o=n=null==e||null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView)&&void 0!==o&&o.requestAnimationFrame?r||(r=n.requestAnimationFrame(function(){r=0,n=null,null!=e&&e.isConnected&&t(e)})):t(e)}}(e,j),E=function(){null!=e&&e.isConnected&&(!w||A?(S=!0,C()):S=!0)},z=function(){},N=c?p?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getValue,i=n.delay,l=void 0===i?250:i,u=n.onChildList,a=new WeakMap,d=new Set,c=new ResizeObserver(m(function(n){var i,l=!1,u=o(n);try{for(u.s();!(i=u.n()).done;){var d=i.value,c=null==r?void 0:r(d);a.has(d.target)?(void 0!==c&&c===a.get(d.target)||(l=!0),a.set(d.target,c)):a.set(d.target,c)}}catch(e){u.e(e)}finally{u.f()}l&&t(e)},l)),s=function(){var t;Array.from(d).forEach(function(t){t.parentElement!==e&&(c.unobserve(t),d.delete(t),a.delete(t))}),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){d.has(e)||(c.observe(e),d.add(e))})};c.observe(e),s();var f=v(e,{childList:!0},function(n){n.some(function(e){return"childList"===e.type})&&(s(),null==u||u(n),t(e))});return{resizeObserver:c,mutationObserver:f}}(e,E,{getValue:r,delay:u,onChildList:function(){z()}}):{resizeObserver:f(e,E,{getValue:r,delay:u})}:{mutationObserver:null};w&&function(e,t){var n=new IntersectionObserver(function(e){var n=i(e,1)[0];n&&t(n)},{rootMargin:a});n.observe(e)}(e,function(e){(A=e.isIntersecting)&&S&&E()}),null!=g&&g.options&&v(e,g.options,function(e){var t,n;(null!==(t=null===(n=g.shouldApply)||void 0===n?void 0:n.call(g,e))&&void 0!==t?t:0<e.length)&&E()});var I=null!=O&&O.attributeFilter&&O.shouldApply?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.attributeFilter,i=n.shouldApply,o=n.attributeOldValue,l=void 0===o||o,u=new MutationObserver(function(n){requestAnimationFrame(function(){null!=e&&e.isConnected&&n.some(function(t){return"attributes"===t.type&&t.target.parentElement===e&&i(t)})&&t(e)})}),a=function(){var t;u.disconnect(),Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]).forEach(function(e){u.observe(e,{attributes:!0,attributeFilter:r,attributeOldValue:l})})};return a(),{observer:u,syncObservedChildren:a}}(e,E,{attributeFilter:O.attributeFilter,shouldApply:O.shouldApply,attributeOldValue:O.attributeOldValue}):null;I&&(z=I.syncObservedChildren),!N.mutationObserver&&I&&v(e,{childList:!0},function(e){e.some(function(e){return"childList"===e.type})&&(z(),E())}),w&&!A||j(e)},b=function(e){var t;return null===(t=e.borderBoxSize)||void 0===t?void 0:t[0].inlineSize},p=function(e){return!(null==e||!e.isConnected)&&0<e.getClientRects().length},h=function(e){var t;if(!p(e))return!1;var n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;if(!n)return!0;var r=e.getBoundingClientRect(),i=n.innerWidth,o=n.innerHeight;return r.bottom>-200&&r.right>0&&r.top<o+200&&r.left<i};function m(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 l=this;clearTimeout(n),n=setTimeout(function(){e.apply(l,i)},t)}}var g=function(e){var t,n=Array.from(null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]),i=n[0];if(i){var o=c(d(e),["divider:initialized","-stack"]);s(e,o);var l=new Map;if(n.forEach(function(e){var t=c(d(e),["-bol","-linewrap"]);l.set(e,t),s(e,t)}),p(e)){var u,a=i.getBoundingClientRect(),f=n.reduce(function(e,t){var n,r=window.getComputedStyle(t).getPropertyValue("position"),i=window.getComputedStyle(t).getPropertyValue("display");"absolute"!==r&&"fixed"!==r&&"none"!==i&&e.push({child:t,layoutTokens:null!==(n=l.get(t))&&void 0!==n?n:[],rect:t.getBoundingClientRect()});return e},[]);f.map(function(e,t){var n,i,o=e.child,l=e.layoutTokens,d=e.rect,c=r(l);return(0===t||(null===(n=u)||void 0===n?void 0:n.top)<d.top&&(null===(i=u)||void 0===i?void 0:i.left)>=d.left)&&c.push("-bol"),0<t&&a.top<d.top&&c.push("-linewrap"),u=d,{child:o,layoutTokens:c}}).forEach(function(e){var t=e.child,n=e.layoutTokens;s(t,n)});var v=f.every(function(e){return e.rect.left===a.left}),y=r(o);v&&y.push("-stack"),y.push("divider:initialized"),s(e,y)}}},O=Symbol.for("@inc2734/unitone-css/layout-initializers"),w=function(){return"undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof MutationObserver||"undefined"==typeof Node?null:(globalThis[O]||(globalThis[O]={initializers:new Map,pendingNodes:new Set,observer:null,rafId:0,hasDOMContentLoadedListener:!1}),globalThis[O])},A=function(e,t){var n,r;if(e.enabled()&&(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE){var i=new Set;null!==(n=t.matches)&&void 0!==n&&n.call(t,e.selector)&&i.add(t),null===(r=t.querySelectorAll)||void 0===r||r.call(t,e.selector).forEach(function(e){i.add(e)}),i.forEach(function(t){e.initialized.has(t)||(e.initialize(t),e.initialized.add(t))})}},S=function(e){var t=w();t&&t.initializers.forEach(function(t){A(t,e)})},j=function(){var e=w();e&&(e.pendingNodes.forEach(function(e){S(e)}),e.pendingNodes.clear(),e.rafId=0)},C=function(){var e=w();e&&!e.observer&&document.body&&(S(document.body),e.observer=new MutationObserver(function(t){t.forEach(function(t){t.addedNodes.forEach(function(t){(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE&&e.pendingNodes.add(t)})}),!e.rafId&&0<e.pendingNodes.size&&(e.rafId=requestAnimationFrame(j))}),e.observer.observe(document.body,{childList:!0,subtree:!0}))};function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(null,arguments)}function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function N(e){var t=function(e,t){if("object"!=z(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==z(t)?t:t+""}function I(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){var t=e.key,n=e.selector,r=e.initialize,i=e.enabled,o=void 0===i?function(){return!0}:i,l=w();if(l&&!l.initializers.has(t)){var u={selector:n,initialize:r,enabled:o,initialized:new WeakSet};l.initializers.set(t,u),l.observer?A(u,document.body):"loading"!==document.readyState?C():l.hasDOMContentLoadedListener||(document.addEventListener("DOMContentLoaded",C,{once:!0}),l.hasDOMContentLoadedListener=!0)}}({key:"behaviors/dividers",selector:'[data-unitone-layout*="-divider:"]',initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(e){if("data-unitone-layout"===e.attributeName){var n,i,o,l,u=[].concat(r(null!==(n=null==t||null===(i=t.ignore)||void 0===i?void 0:i.layout)&&void 0!==n?n:[]),["divider:initialized","-bol","-linewrap","-stack"]);return(null!==(o=e.target.getAttribute(e.attributeName))&&void 0!==o?o:"").split(" ").filter(function(e){return!u.includes(e)}).join(" ")!==(null!==(l=e.oldValue)&&void 0!==l?l:"").split(" ").filter(function(e){return!u.includes(e)}).join(" ")}if("class"===e.attributeName){var a,d,c,s,f=r(null!==(a=null==t||null===(d=t.ignore)||void 0===d?void 0:d.className)&&void 0!==a?a:[]);return(null!==(c=e.target.getAttribute(e.attributeName))&&void 0!==c?c:"").split(" ").filter(function(e){return!f.includes(e)}).join(" ")!==(null!==(s=e.oldValue)&&void 0!==s?s:"").split(" ").filter(function(e){return!f.includes(e)}).join(" ")}return"style"===e.attributeName};y(e,g,{getResizeValue:b,observeIntersection:!0,observeDirectChildrenResize:!0,targetMutation:{options:{attributes:!0,attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0},shouldApply:function(t){return function(e,t){return e.some(function(e){return"attributes"===e.type&&t(e)})}(t,function(t){return t.target===e&&n(t)})}},directChildMutation:{attributeFilter:["style","data-unitone-layout","class"],attributeOldValue:!0,shouldApply:n}})}});var M=["alignItems","divider","dividerWidth","dividerStyle","dividerColor","gap","columnGap","rowGap","justifyContent","nowrap","tagName","style"];function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}exports.Cluster=function(t){var n=t.alignItems,r=t.divider,i=t.dividerWidth,o=t.dividerStyle,l=t.dividerColor,u=t.gap,a=t.columnGap,d=t.rowGap,c=t.justifyContent,s=t.nowrap,f=t.tagName,v=void 0===f?"div":f,y=t.style,b=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,M),p=v;return y=L(L({},y),{},{"--unitone--divider-width":""!==i?i:void 0,"--unitone--divider-style":""!==o?o:void 0,"--unitone--divider-color":""!==l?l:void 0}),e.createElement(p,E({"data-unitone-layout":["cluster",""!==(null!=r?r:"")?"-divider:".concat(r):void 0,""!==(null!=u?u:"")?"-gap:".concat(u):void 0,""!==(null!=a?a:"")?"-column-gap:".concat(a):void 0,""!==(null!=d?d:"")?"-row-gap:".concat(d):void 0,""!==(null!=n?n:"")?"-align-items:".concat(n):void 0,""!==(null!=c?c:"")?"-justify-content:".concat(c):void 0,s?"-nowrap":void 0].filter(Boolean).join(" "),style:y},b),b.children)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("react");function r(){return r=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},r.apply(null,arguments)}function e(t){return e="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},e(t)}function n(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r);if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}function o(t,r,e){return(r=n(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var i=["align","gutters","maxWidth","text","style"];function u(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(
|
|
1
|
+
"use strict";var t=require("react");function r(){return r=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},r.apply(null,arguments)}function e(t){return e="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},e(t)}function n(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r);if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}function o(t,r,e){return(r=n(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var i=["align","gutters","maxWidth","text","style"];function u(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function c(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?u(Object(e),!0).forEach(function(r){o(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}exports.Container=function(e){var n=e.align,o=e.gutters,u=e.maxWidth;e.text;var l=e.style,a=function(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==r.indexOf(n))continue;e[n]=t[n]}return e}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],-1===r.indexOf(e)&&{}.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}(e,i);return l=c(c({},l),{},{"--unitone--max-width":""!==u?u:void 0}),t.createElement("div",r({"data-unitone-layout":["container",""!==(null!=n?n:"")?"-align:".concat(n):void 0,""!==(null!=o?o:"")?"-gutters:".concat(o):void 0].filter(Boolean).join(" "),style:l},a),a.children)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("react");function n(){return n=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},n.apply(null,arguments)}function e(t){return e="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},e(t)}function o(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,n);if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,n,e){return(n=o(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function i(t,n){if(null==t)return{};var e,o,r=function(t,n){if(null==t)return{};var e={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(-1!==n.indexOf(o))continue;e[o]=t[o]}return e}(t,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)e=i[o],-1===n.indexOf(e)&&{}.propertyIsEnumerable.call(t,e)&&(r[e]=t[e])}return r}var a=["gap","minHeight","justifyContent","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","noPadding","style"],l=["valign","position","top","right","bottom","left","zIndex","tagName","style"];function c(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(
|
|
1
|
+
"use strict";var t=require("react");function n(){return n=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},n.apply(null,arguments)}function e(t){return e="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},e(t)}function o(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,n);if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,n,e){return(n=o(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function i(t,n){if(null==t)return{};var e,o,r=function(t,n){if(null==t)return{};var e={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(-1!==n.indexOf(o))continue;e[o]=t[o]}return e}(t,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)e=i[o],-1===n.indexOf(e)&&{}.propertyIsEnumerable.call(t,e)&&(r[e]=t[e])}return r}var a=["gap","minHeight","justifyContent","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","noPadding","style"],l=["valign","position","top","right","bottom","left","zIndex","tagName","style"];function c(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),e.push.apply(e,o)}return e}function u(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?c(Object(e),!0).forEach(function(n){r(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}exports.Cover=function(n){var e=n.gap,o=n.minHeight;n.justifyContent;var r=n.padding,l=n.paddingTop,c=n.paddingRight,d=n.paddingBottom,p=n.paddingLeft,f=n.noPadding,g=n.style,v=i(n,a);return g=u(u({},g),{},{"--unitone--min-height":""!==o?o:void 0}),t.createElement("div",{"data-unitone-layout":["cover",f?"-no-padding":void 0,""!==(null!=e?e:"")?"-gap:".concat(e):void 0,""!==(null!=r?r:"")?"-padding:".concat(r):void 0,""!==(null!=l?l:"")?"-padding-top:".concat(l):void 0,""!==(null!=c?c:"")?"-padding-right:".concat(c):void 0,""!==(null!=d?d:"")?"-padding-bottom:".concat(d):void 0,""!==(null!=p?p:"")?"-padding-left:".concat(p):void 0].filter(Boolean).join(" "),style:g},v.children)},exports.CoverContent=function(e){var o=e.valign,r=e.position,a=e.top,c=e.right,d=e.bottom,p=e.left,f=e.zIndex,g=e.tagName,v=void 0===g?"div":g,y=e.style,b=i(e,l),s=v;return y=u(u({},y),{},{"--unitone--top":""!==a?a:void 0,"--unitone--right":""!==c?c:void 0,"--unitone--bottom":""!==d?d:void 0,"--unitone--left":""!==p?p:void 0,"--unitone--z-index":""!==f?f:void 0}),t.createElement(s,n({"data-unitone-layout":["cover__content",""!==(null!=o?o:"")?"-valign:".concat(o):void 0,""!==(null!=r?r:"")?"-position:".concat(r):void 0].filter(Boolean).join(" "),style:y},b),b.children)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o=require("react");function t(){return t=Object.assign?Object.assign.bind():function(o){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)({}).hasOwnProperty.call(r,e)&&(o[e]=r[e])}return o},t.apply(null,arguments)}function r(o){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},r(o)}function e(o){var t=function(o,t){if("object"!=r(o)||!o)return o;var e=o[Symbol.toPrimitive];if(void 0!==e){var n=e.call(o,t);if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(o)}(o,"string");return"symbol"==r(t)?t:t+""}function n(o,t,r){return(t=e(t))in o?Object.defineProperty(o,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[t]=r,o}var i=["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 d(o,t){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);t&&(e=e.filter(
|
|
1
|
+
"use strict";var o=require("react");function t(){return t=Object.assign?Object.assign.bind():function(o){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)({}).hasOwnProperty.call(r,e)&&(o[e]=r[e])}return o},t.apply(null,arguments)}function r(o){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},r(o)}function e(o){var t=function(o,t){if("object"!=r(o)||!o)return o;var e=o[Symbol.toPrimitive];if(void 0!==e){var n=e.call(o,t);if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(o)}(o,"string");return"symbol"==r(t)?t:t+""}function n(o,t,r){return(t=e(t))in o?Object.defineProperty(o,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[t]=r,o}var i=["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 d(o,t){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);t&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable})),r.push.apply(r,e)}return r}function a(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){n(o,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(r,t))})}return o}exports.Decorator=function(r){var e=r.backgroundColor,n=r.borderColor,d=r.borderRadius,l=r.borderWidth,c=r.maxHeight,u=r.minHeight,p=r.maxWidth,s=r.color,g=r.padding,v=r.paddingTop,f=r.paddingRight,b=r.paddingBottom,m=r.paddingLeft,y=r.gap,h=r.alignContent,O=r.justifyItems,j=r.shadow,w=r.position,k=r.top,x=r.right,P=r.bottom,S=r.left,B=r.zIndex,F=r.mixBlendMode,C=r.overflow,D=r.backdropFilter,E=r.progressiveBackdropFilter,I=r.progressiveBackdropFilterAngle,H=r.progressiveBackdropFilterStart,R=r.style,W=function(o,t){if(null==o)return{};var r,e,n=function(o,t){if(null==o)return{};var r={};for(var e in o)if({}.hasOwnProperty.call(o,e)){if(-1!==t.indexOf(e))continue;r[e]=o[e]}return r}(o,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(o);for(e=0;e<i.length;e++)r=i[e],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(o,r)&&(n[r]=o[r])}return n}(r,i);return R=a(a({},R),{},{"--unitone--background-color":""!==e?e:void 0,"--unitone--border-color":""!==n?n:void 0,"--unitone--border-radius":""!==d?d:void 0,"--unitone--border-width":""!==l?l:void 0,"--unitone--max-height":""!==c?c:void 0,"--unitone--min-height":""!==u?u:void 0,"--unitone--max-width":""!==p?p:void 0,"--unitone--color":""!==s?s:void 0,"--unitone--top":""!==k?k:void 0,"--unitone--right":""!==x?x:void 0,"--unitone--bottom":""!==P?P:void 0,"--unitone--left":""!==S?S:void 0,"--unitone--z-index":""!==B?B:void 0,"--unitone--backdrop-filter":""!==D?D:void 0,"--unitone--progressive-backdrop-filter-angle":E&&""!==I?I:void 0,"--unitone--progressive-backdrop-filter-start":H&&""!==H?H:void 0}),o.createElement("div",t({"data-unitone-layout":["decorator",""!==(null!=y?y:"")?"-gap:".concat(y):void 0,""!==(null!=h?h:"")?"-align-content:".concat(h):void 0,""!==(null!=O?O:"")?"-justify-items:".concat(O):void 0,""!==(null!=g?g:"")?"-padding:".concat(g):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!=m?m:"")?"-padding-left:".concat(m):void 0,j?"-shadow":void 0,""!==(null!=w?w:"")?"-position:".concat(w):void 0,""!==(null!=F?F:"")?"-mix-blend-mode:".concat(F):void 0,""!==(null!=C?C:"")?"-overflow:".concat(C):void 0,E?"-progressive-backdrop-filter":void 0].filter(Boolean).join(" "),style:R},W),W.children)};
|
|
@@ -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 n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}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 n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}function o(t,e,r){return(e=n(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,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var l=["tagName","style"],a=["tagName","style"],c=["closedBy","style"];function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(
|
|
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 n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}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 n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}function o(t,e,r){return(e=n(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,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var l=["tagName","style"],a=["tagName","style"],c=["closedBy","style"];function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function y(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){o(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}exports.Dialog=function(r){var n=r.tagName,o=void 0===n?"div":n,a=r.style,c=i(r,l),u=o;return a=y({},a),t.createElement(u,e({"data-unitone-layout":"dialog",style:a},c),c.children)},exports.DialogContent=function(r){var n=r.closedBy,o=void 0===n?"any":n,l=r.style,a=i(r,c);return l=y({},l),t.createElement("dialog",e({"data-unitone-layout":"dialog-content",closedby:o,style:l},a),a.children)},exports.DialogTrigger=function(r){var n=r.tagName,o=void 0===n?"div":n,l=r.style,c=i(r,a),u=o;return l=y({},l),t.createElement(u,e({"data-unitone-layout":"dialog-trigger",style:l},c),c.children)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=require("react");function e(){return e=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},e.apply(null,arguments)}function t(r){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},t(r)}function n(r){var e=function(r,e){if("object"!=t(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var i=n.call(r,e);if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}(r,"string");return"symbol"==t(e)?e:e+""}function i(r,e,t){return(e=n(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var o=["dividerColor","type","dividerSize","direction","style"];function c(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)}return t}function u(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?c(Object(t),!0).forEach(function(e){i(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}exports.Divider=function(t){var n=t.dividerColor,i=t.type,c=t.dividerSize,l=t.direction,f=t.style,a=function(r,e){if(null==r)return{};var t,n,i=function(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n]}return t}(r,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(n=0;n<o.length;n++)t=o[n],-1===e.indexOf(t)&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}(t,o);return f=u(u({},f),{},{"--unitone--divider-color":""!==n?n:void 0,"--unitone--divider-size":""!==c?c:void 0}),r.createElement("div",e({"data-unitone-layout":["divider",""!==(null!=i?i:"")?"-type:".concat(i):void 0,""!==(null!=l?l:"")?"-direction:".concat(l):void 0].filter(Boolean).join(" "),style:f},a),a.children)};
|