@inc2734/unitone-css 0.60.4 → 0.60.5
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.js +1 -1
- package/dist/library.js +1 -1
- package/package.json +1 -1
- package/src/library.js +1 -4
package/dist/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t,e,n,o;function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t)||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 a(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 u(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)?u(t,e):void 0}}(t))||e){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw r}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}var l=function(t){var e=parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue("font-size")),n=parseFloat(window.getComputedStyle(t).getPropertyValue("font-size"));t.style.setProperty("--unitone--fluid-font-size-magnification",n/e)},d=function(t){var e,n,o=null===(e=[].slice.call(t.children))||void 0===e?void 0:e[0];o&&([].slice.call(t.children).forEach((function(t){var e=(t.getAttribute("data-unitone-layout")||"").split(" ");t.classList.contains("unitone-empty")?t.remove():t.setAttribute("data-unitone-layout",r(e.filter((function(t){return!["-bol","-linewrap"].includes(t)}))).join(" "))})),[].slice.call(t.children).forEach((function(t){var e,i=o.getBoundingClientRect(),a=null===(e=n)||void 0===e?void 0:e.getBoundingClientRect(),u=(t.getAttribute("data-unitone-layout")||"").split(" ");if((o===t||(null==a?void 0:a.top)<t.getBoundingClientRect().top)&&(u.includes("-bol")||(u=[].concat(r(u),["-bol"]))),(null==a?void 0:a.top)<t.getBoundingClientRect().top){var l=document.createElement("div");l.classList.add("unitone-empty"),t.before(l),(null==a?void 0:a.top)<l.getBoundingClientRect().top&&l.remove()}i.top<t.getBoundingClientRect().top&&(u.includes("-linewrap")||(u=[].concat(r(u),["-linewrap"]))),t.setAttribute("data-unitone-layout",u.join(" ")),n=t})))},c=function(t){var e,n=null===(e=[].slice.call(t.children))||void 0===e?void 0:e[0];if(n){var o,i=0,r=i;[].slice.call(t.children).forEach((function(t){var e,a=window.getComputedStyle(t).getPropertyValue("position");if("absolute"!==a&&"fixed"!==a){t.style.setProperty("--unitone--stairs-step","");var u=null===(e=o)||void 0===e?void 0:e.getBoundingClientRect(),l=t.getBoundingClientRect();n===t||null!=u&&u.left&&u.left>=l.left?(i=0,t.style.setProperty("--unitone--stairs-step",i)):(i++,t.style.setProperty("--unitone--stairs-step",i)),o=t,i>r&&(r=i)}})),t.getAttribute("data-unitone-layout").match(/-stairs-up:right/)?t.style.setProperty("--unitone--stairs-step",r):t.style.setProperty("--unitone--stairs-step",i)}},s=function(t){t.style.columnCount="",t.setAttribute("data-unitone-layout",t.getAttribute("data-unitone-layout").replace(" -force-switch",""));var e,n=getComputedStyle(t);if(String(n.getPropertyValue("--unitone--threshold")).trim()){var o=document.createElement("div");o.setAttribute("data-unitone-layout","vertical-writing__thresholder"),t.appendChild(o);var i=o.offsetWidth>=t.offsetWidth;if(t.removeChild(o),i)return void t.setAttribute("data-unitone-layout","".concat(t.getAttribute("data-unitone-layout")," -force-switch"))}if([].slice.call(t.children).reverse().some((function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position))return e=t,!0})),e){var r=!1;t.getBoundingClientRect().left>e.getBoundingClientRect().left&&(t.style.columnCount=2,r=!0),setTimeout((function(){var n=t.getBoundingClientRect().top+t.getBoundingClientRect().height,o=e.getBoundingClientRect().top+e.getBoundingClientRect().height;n!==o&&(t.parentNode.style.height="".concat(Math.ceil(o-t.getBoundingClientRect().top),"px"))}),r?250:0)}};o=function(t){var e=0;new ResizeObserver((function(t){var n,o=a(t);try{for(o.s();!(n=o.n()).done;){var i,r
|
|
1
|
+
"use strict";var t,e,n,o;function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t)||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 a(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 u(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)?u(t,e):void 0}}(t))||e){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw r}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}var l=function(t){var e=parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue("font-size")),n=parseFloat(window.getComputedStyle(t).getPropertyValue("font-size"));t.style.setProperty("--unitone--fluid-font-size-magnification",n/e)},d=function(t){var e,n,o=null===(e=[].slice.call(t.children))||void 0===e?void 0:e[0];o&&([].slice.call(t.children).forEach((function(t){var e=(t.getAttribute("data-unitone-layout")||"").split(" ");t.classList.contains("unitone-empty")?t.remove():t.setAttribute("data-unitone-layout",r(e.filter((function(t){return!["-bol","-linewrap"].includes(t)}))).join(" "))})),[].slice.call(t.children).forEach((function(t){var e,i=o.getBoundingClientRect(),a=null===(e=n)||void 0===e?void 0:e.getBoundingClientRect(),u=(t.getAttribute("data-unitone-layout")||"").split(" ");if((o===t||(null==a?void 0:a.top)<t.getBoundingClientRect().top)&&(u.includes("-bol")||(u=[].concat(r(u),["-bol"]))),(null==a?void 0:a.top)<t.getBoundingClientRect().top){var l=document.createElement("div");l.classList.add("unitone-empty"),t.before(l),(null==a?void 0:a.top)<l.getBoundingClientRect().top&&l.remove()}i.top<t.getBoundingClientRect().top&&(u.includes("-linewrap")||(u=[].concat(r(u),["-linewrap"]))),t.setAttribute("data-unitone-layout",u.join(" ")),n=t})))},c=function(t){var e,n=null===(e=[].slice.call(t.children))||void 0===e?void 0:e[0];if(n){var o,i=0,r=i;[].slice.call(t.children).forEach((function(t){var e,a=window.getComputedStyle(t).getPropertyValue("position");if("absolute"!==a&&"fixed"!==a){t.style.setProperty("--unitone--stairs-step","");var u=null===(e=o)||void 0===e?void 0:e.getBoundingClientRect(),l=t.getBoundingClientRect();n===t||null!=u&&u.left&&u.left>=l.left?(i=0,t.style.setProperty("--unitone--stairs-step",i)):(i++,t.style.setProperty("--unitone--stairs-step",i)),o=t,i>r&&(r=i)}})),t.getAttribute("data-unitone-layout").match(/-stairs-up:right/)?t.style.setProperty("--unitone--stairs-step",r):t.style.setProperty("--unitone--stairs-step",i)}},s=function(t){t.style.columnCount="",t.setAttribute("data-unitone-layout",t.getAttribute("data-unitone-layout").replace(" -force-switch",""));var e,n=getComputedStyle(t);if(String(n.getPropertyValue("--unitone--threshold")).trim()){var o=document.createElement("div");o.setAttribute("data-unitone-layout","vertical-writing__thresholder"),t.appendChild(o);var i=o.offsetWidth>=t.offsetWidth;if(t.removeChild(o),i)return void t.setAttribute("data-unitone-layout","".concat(t.getAttribute("data-unitone-layout")," -force-switch"))}if([].slice.call(t.children).reverse().some((function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position))return e=t,!0})),e){var r=!1;t.getBoundingClientRect().left>e.getBoundingClientRect().left&&(t.style.columnCount=2,r=!0),setTimeout((function(){var n=t.getBoundingClientRect().top+t.getBoundingClientRect().height,o=e.getBoundingClientRect().top+e.getBoundingClientRect().height;n!==o&&(t.parentNode.style.height="".concat(Math.ceil(o-t.getBoundingClientRect().top),"px"))}),r?250:0)}};o=function(t){var e=0;new ResizeObserver((function(t){var n,o=a(t);try{for(o.s();!(n=o.n()).done;){var i,r=n.value,u=null===(i=r.borderBoxSize)||void 0===i?void 0:i[0].inlineSize;u!==e&&(d(r.target),e=u)}}catch(t){o.e(t)}finally{o.f()}})).observe(t)},n=function(t){var e=0;new ResizeObserver((function(t){var n,o=a(t);try{for(o.s();!(n=o.n()).done;){var i,r=n.value,u=null===(i=r.borderBoxSize)||void 0===i?void 0:i[0].inlineSize;u!==e&&(l(r.target),e=u)}}catch(t){o.e(t)}finally{o.f()}})).observe(t)},e=function(t){var e=0;new ResizeObserver((function(t){var n,o=a(t);try{for(o.s();!(n=o.n()).done;){var i,r=n.value,u=null===(i=r.borderBoxSize)||void 0===i?void 0:i[0].inlineSize;u!==e&&(c(r.target),e=u)}}catch(t){o.e(t)}finally{o.f()}})).observe(t)},t=function(t){var e=0;t.setAttribute("data-unitone-layout","".concat(t.getAttribute("data-unitone-layout")," -initialized"));var n=new ResizeObserver((function(o,i){var r,u=a(o);try{var l=function(){var o,a=r.value,u=null===(o=a.contentRect)||void 0===o?void 0:o.width;parseInt(u)!==parseInt(e)&&(e=u,n.unobserve(t),i.unobserve(a.target),a.target.parentNode.style.height="",s(a.target),setTimeout((function(){i.observe(a.target)}),500))};for(u.s();!(r=u.n()).done;)l()}catch(t){u.e(t)}finally{u.f()}}));n.observe(t);var o,i={attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0};new MutationObserver((function(e,r){if(clearTimeout(o),0<e.length){var a,u,l=e[0],d=null===(a=l.addedNodes)||void 0===a?void 0:a[0],c=null===(u=l.removedNodes)||void 0===u?void 0:u[0];if((null==d?void 0:d.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===d.getAttribute("data-unitone-layout")||(null==c?void 0:c.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===c.getAttribute("data-unitone-layout"))return;r.disconnect(),n.unobserve(t),o=setTimeout((function(){s(t),setTimeout((function(){r.observe(t,i),n.observe(t)}),500)}),500)}})).observe(t,i)},document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(t){t.forEach((function(t){t.addedNodes.forEach((function(t){var e,o=null===(e=t.parentNode)||void 0===e?void 0:e.querySelectorAll('[data-unitone-layout~="-fluid-typography"]');null==o||o.forEach((function(t){n(t)}))}))}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(t){t.forEach((function(t){t.addedNodes.forEach((function(t){var e,n=null===(e=t.parentNode)||void 0===e?void 0:e.querySelectorAll('[data-unitone-layout*="-divider:"]');null==n||n.forEach((function(t){o(t)}))}))}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(t){t.forEach((function(t){t.addedNodes.forEach((function(t){var n,o=null===(n=t.parentNode)||void 0===n?void 0:n.querySelectorAll('[data-unitone-layout*="-stairs:"]');null==o||o.forEach((function(t){e(t)}))}))}))})).observe(document.body,{childList:!0,subtree:!0})})),document.addEventListener("DOMContentLoaded",(function(){new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){var n,o=null===(n=e.parentNode)||void 0===n?void 0:n.querySelectorAll('[data-unitone-layout~="vertical-writing"]');null==o||o.forEach((function(e){t(e)}))}))}))})).observe(document.body,{childList:!0,subtree:!0})}));
|
package/dist/library.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.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}}(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 n(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 r(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)?r(t,e):void 0}}(t))||e){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l
|
|
1
|
+
"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.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}}(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 n(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 r(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)?r(t,e):void 0}}(t))||e){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){u=!0,a=t},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw a}}}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var i=function(t){var e=parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue("font-size")),n=parseFloat(window.getComputedStyle(t).getPropertyValue("font-size"));t.style.setProperty("--unitone--fluid-font-size-magnification",n/e)},o=function(t){var n,r,i=null===(n=[].slice.call(t.children))||void 0===n?void 0:n[0];i&&([].slice.call(t.children).forEach((function(t){var n=(t.getAttribute("data-unitone-layout")||"").split(" ");t.classList.contains("unitone-empty")?t.remove():t.setAttribute("data-unitone-layout",e(n.filter((function(t){return!["-bol","-linewrap"].includes(t)}))).join(" "))})),[].slice.call(t.children).forEach((function(t){var n,o=i.getBoundingClientRect(),a=null===(n=r)||void 0===n?void 0:n.getBoundingClientRect(),l=(t.getAttribute("data-unitone-layout")||"").split(" ");if((i===t||(null==a?void 0:a.top)<t.getBoundingClientRect().top)&&(l.includes("-bol")||(l=[].concat(e(l),["-bol"]))),(null==a?void 0:a.top)<t.getBoundingClientRect().top){var u=document.createElement("div");u.classList.add("unitone-empty"),t.before(u),(null==a?void 0:a.top)<u.getBoundingClientRect().top&&u.remove()}o.top<t.getBoundingClientRect().top&&(l.includes("-linewrap")||(l=[].concat(e(l),["-linewrap"]))),t.setAttribute("data-unitone-layout",l.join(" ")),r=t})))},a=function(t){var e,n=null===(e=[].slice.call(t.children))||void 0===e?void 0:e[0];if(n){var r,i=0,o=i;[].slice.call(t.children).forEach((function(t){var e,a=window.getComputedStyle(t).getPropertyValue("position");if("absolute"!==a&&"fixed"!==a){t.style.setProperty("--unitone--stairs-step","");var l=null===(e=r)||void 0===e?void 0:e.getBoundingClientRect(),u=t.getBoundingClientRect();n===t||null!=l&&l.left&&l.left>=u.left?(i=0,t.style.setProperty("--unitone--stairs-step",i)):(i++,t.style.setProperty("--unitone--stairs-step",i)),r=t,i>o&&(o=i)}})),t.getAttribute("data-unitone-layout").match(/-stairs-up:right/)?t.style.setProperty("--unitone--stairs-step",o):t.style.setProperty("--unitone--stairs-step",i)}},l=function(t){t.style.columnCount="",t.setAttribute("data-unitone-layout",t.getAttribute("data-unitone-layout").replace(" -force-switch",""));var e,n=getComputedStyle(t);if(String(n.getPropertyValue("--unitone--threshold")).trim()){var r=document.createElement("div");r.setAttribute("data-unitone-layout","vertical-writing__thresholder"),t.appendChild(r);var i=r.offsetWidth>=t.offsetWidth;if(t.removeChild(r),i)return void t.setAttribute("data-unitone-layout","".concat(t.getAttribute("data-unitone-layout")," -force-switch"))}if([].slice.call(t.children).reverse().some((function(t){if(!["absolute","fixed"].includes(getComputedStyle(t).position))return e=t,!0})),e){var o=!1;t.getBoundingClientRect().left>e.getBoundingClientRect().left&&(t.style.columnCount=2,o=!0),setTimeout((function(){var n=t.getBoundingClientRect().top+t.getBoundingClientRect().height,r=e.getBoundingClientRect().top+e.getBoundingClientRect().height;n!==r&&(t.parentNode.style.height="".concat(Math.ceil(r-t.getBoundingClientRect().top),"px"))}),o?250:0)}};exports.dividersResizeObserver=function(t){var e=0;new ResizeObserver((function(t){var r,i=n(t);try{for(i.s();!(r=i.n()).done;){var a,l=r.value,u=null===(a=l.borderBoxSize)||void 0===a?void 0:a[0].inlineSize;u!==e&&(o(l.target),e=u)}}catch(t){i.e(t)}finally{i.f()}})).observe(t)},exports.fluidFontSizeResizeObserver=function(t){var e=0;new ResizeObserver((function(t){var r,o=n(t);try{for(o.s();!(r=o.n()).done;){var a,l=r.value,u=null===(a=l.borderBoxSize)||void 0===a?void 0:a[0].inlineSize;u!==e&&(i(l.target),e=u)}}catch(t){o.e(t)}finally{o.f()}})).observe(t)},exports.setDividerLinewrap=o,exports.stairsResizeObserver=function(t){var e=0;new ResizeObserver((function(t){var r,i=n(t);try{for(i.s();!(r=i.n()).done;){var o,l=r.value,u=null===(o=l.borderBoxSize)||void 0===o?void 0:o[0].inlineSize;u!==e&&(a(l.target),e=u)}}catch(t){i.e(t)}finally{i.f()}})).observe(t)},exports.verticalsResizeObserver=function(t){var e=0;t.setAttribute("data-unitone-layout","".concat(t.getAttribute("data-unitone-layout")," -initialized"));var r=new ResizeObserver((function(i,o){var a,u=n(i);try{var s=function(){var n,i=a.value,u=null===(n=i.contentRect)||void 0===n?void 0:n.width;parseInt(u)!==parseInt(e)&&(e=u,r.unobserve(t),o.unobserve(i.target),i.target.parentNode.style.height="",l(i.target),setTimeout((function(){o.observe(i.target)}),500))};for(u.s();!(a=u.n()).done;)s()}catch(t){u.e(t)}finally{u.f()}}));r.observe(t);var i,o={attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0};new MutationObserver((function(e,n){if(clearTimeout(i),0<e.length){var a,u,s=e[0],c=null===(a=s.addedNodes)||void 0===a?void 0:a[0],d=null===(u=s.removedNodes)||void 0===u?void 0:u[0];if((null==c?void 0:c.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===c.getAttribute("data-unitone-layout")||(null==d?void 0:d.nodeType)===Node.ELEMENT_NODE&&"vertical-writing__thresholder"===d.getAttribute("data-unitone-layout"))return;n.disconnect(),r.unobserve(t),i=setTimeout((function(){l(t),setTimeout((function(){n.observe(t,o),r.observe(t)}),500)}),500)}})).observe(t,o)};
|
package/package.json
CHANGED
package/src/library.js
CHANGED
|
@@ -76,16 +76,13 @@ export const setDividerLinewrap = (target) => {
|
|
|
76
76
|
|
|
77
77
|
export const dividersResizeObserver = (target) => {
|
|
78
78
|
let prevWidth = 0;
|
|
79
|
-
// let prevHeight = 0;
|
|
80
79
|
|
|
81
80
|
const observer = new ResizeObserver((entries) => {
|
|
82
81
|
for (const entry of entries) {
|
|
83
82
|
const width = entry.borderBoxSize?.[0].inlineSize;
|
|
84
|
-
|
|
85
|
-
if (width !== prevWidth || height !== prevHeight) {
|
|
83
|
+
if (width !== prevWidth) {
|
|
86
84
|
setDividerLinewrap(entry.target);
|
|
87
85
|
prevWidth = width;
|
|
88
|
-
prevHeight = height;
|
|
89
86
|
}
|
|
90
87
|
}
|
|
91
88
|
});
|