���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /var/www/nitsch.de/wp-includes/php-compat/utils.tar
���ѧ٧ѧ�
fit-text-frontend.min.asset.php 0000775 00000000264 00000000000 0012506 0 ustar 00 <?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => 'f465b12ad4eba72e96bb'); fit-text-frontend.min.js 0000775 00000002134 00000000000 0011213 0 ustar 00 import{store as H,getElement as w,getContext as b}from"@wordpress/interactivity";function S(e,t){let o=e.scrollHeight>e.clientHeight,i=0,l=2400,g=i,f=window.getComputedStyle(e),p=parseFloat(f.paddingLeft)||0,h=parseFloat(f.paddingRight)||0,c=document.createRange();c.selectNodeContents(e);let r=e,s=e.parentElement;if(s){let n=window.getComputedStyle(s);n?.display==="flex"&&(r=s,p+=parseFloat(n.paddingLeft)||0,h+=parseFloat(n.paddingRight)||0)}let d=r.clientHeight;for(;i<=l;){let n=Math.floor((i+l)/2);t(n);let m=c.getBoundingClientRect().width,u=e.scrollWidth<=r.clientWidth&&m<=r.clientWidth-p-h,z=o||e.scrollHeight<=r.clientHeight||e.scrollHeight<=d;r.clientHeight>d&&(d=r.clientHeight),u&&z?(g=n,i=n+1):l=n-1}return c.detach(),g}function a(e,t){if(!e)return;t(0);let o=S(e,t);return t(o),o}H("core/fit-text",{callbacks:{init(){let e=b(),{ref:t}=w(),o=i=>{t&&(i===0?t.style.fontSize="":t.style.fontSize=`${i}px`)};if(e.fontSize=a(t,o),window.ResizeObserver&&t?.parentElement){let i=new window.ResizeObserver(()=>{e.fontSize=a(t,o)});return i.observe(t.parentElement),i.observe(t),()=>{i&&i.disconnect()}}}}}); fit-text-frontend.js 0000775 00000006177 00000000000 0010444 0 ustar 00 // packages/block-editor/build-module/utils/fit-text-frontend.mjs import { store, getElement, getContext } from "@wordpress/interactivity"; // packages/block-editor/build-module/utils/fit-text-utils.mjs function findOptimalFontSize(textElement, applyFontSize) { const alreadyHasScrollableHeight = textElement.scrollHeight > textElement.clientHeight; let minSize = 0; let maxSize = 2400; let bestSize = minSize; const computedStyle = window.getComputedStyle(textElement); let paddingLeft = parseFloat(computedStyle.paddingLeft) || 0; let paddingRight = parseFloat(computedStyle.paddingRight) || 0; const range = document.createRange(); range.selectNodeContents(textElement); let referenceElement = textElement; const parentElement = textElement.parentElement; if (parentElement) { const parentElementComputedStyle = window.getComputedStyle(parentElement); if (parentElementComputedStyle?.display === "flex") { referenceElement = parentElement; paddingLeft += parseFloat(parentElementComputedStyle.paddingLeft) || 0; paddingRight += parseFloat(parentElementComputedStyle.paddingRight) || 0; } } let maxclientHeight = referenceElement.clientHeight; while (minSize <= maxSize) { const midSize = Math.floor((minSize + maxSize) / 2); applyFontSize(midSize); const rect = range.getBoundingClientRect(); const textWidth = rect.width; const fitsWidth = textElement.scrollWidth <= referenceElement.clientWidth && textWidth <= referenceElement.clientWidth - paddingLeft - paddingRight; const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= referenceElement.clientHeight || textElement.scrollHeight <= maxclientHeight; if (referenceElement.clientHeight > maxclientHeight) { maxclientHeight = referenceElement.clientHeight; } if (fitsWidth && fitsHeight) { bestSize = midSize; minSize = midSize + 1; } else { maxSize = midSize - 1; } } range.detach(); return bestSize; } function optimizeFitText(textElement, applyFontSize) { if (!textElement) { return; } applyFontSize(0); const optimalSize = findOptimalFontSize(textElement, applyFontSize); applyFontSize(optimalSize); return optimalSize; } // packages/block-editor/build-module/utils/fit-text-frontend.mjs store("core/fit-text", { callbacks: { init() { const context = getContext(); const { ref } = getElement(); const applyFontSize = (fontSize) => { if (!ref) { return; } if (fontSize === 0) { ref.style.fontSize = ""; } else { ref.style.fontSize = `${fontSize}px`; } }; context.fontSize = optimizeFitText(ref, applyFontSize); if (window.ResizeObserver && ref?.parentElement) { const resizeObserver = new window.ResizeObserver(() => { context.fontSize = optimizeFitText(ref, applyFontSize); }); resizeObserver.observe(ref.parentElement); resizeObserver.observe(ref); return () => { if (resizeObserver) { resizeObserver.disconnect(); } }; } return void 0; } } });
| ver. 1.4 |
Github
|
.
| PHP 8.3.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�