@taprootio/espalier 2.13.1 → 2.14.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/CHANGELOG.md +34 -0
- package/custom-elements.json +6012 -5743
- package/dist/flyout/esp-flyout.js +13 -13
- package/dist/page/esp-page.d.ts +27 -14
- package/dist/page/esp-page.js +85 -33
- package/package.json +1 -1
package/dist/page/esp-page.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var R=function(A,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(A,e,t,i);else for(var o=A.length-1;o>=0;o--)(r=A[o])&&(a=(s<3?r(a):s>3?r(e,t,a):r(e,t))||a);return s>3&&a&&Object.defineProperty(e,t,a),a};import{css as j,html as H,nothing as U}from"lit";import{customElement as Y,property as P,state as E}from"lit/decorators.js";import{classMap as Q}from"lit/directives/class-map.js";import{createRef as W,ref as x}from"lit/directives/ref.js";import{EspalierElementBase as N}from"../shared/esp-element-base.js";import{BiDirectionalStickyController as _}from"./bi-directional-sticky-controller.js";import{getEspBus as X}from"../shared/bus-events.js";import"../toaster/esp-toaster.js";const $='esp-footer, footer, [role~="contentinfo"]',Z="(max-width: 50em)",h=1,J=5,ee=12,te=48,ie=16,ae=64,se=250;let k=class extends N{constructor(){super(),this.dialogZone=W(),this.flyoutSlot=W(),this.footerSlot=W(),this.previewSlot=W(),this.previewSpace=W(),this.previewMinWidthProbe=W(),this.previewDefaultWidthProbe=W(),this.previewMaxWidthProbe=W(),this.flyoutMinWidthProbe=W(),this.flyoutDefaultWidthProbe=W(),this.flyoutMaxWidthProbe=W(),this.mainMinWidthProbe=W(),this.mainConfiguredMaxWidthProbe=W(),this.mainMaxWidthProbe=W(),this.resizeStepProbe=W(),this.resizeLargeStepProbe=W(),this.previewObservedWidths=new WeakMap,this.previewSyncRaf=null,this.previewSyncGeneration=0,this.previewSyncTask=Promise.resolve(),this.previewOverlayRecoveryRequested=!1,this.previewHeader=null,this.previewMenu=null,this.previewCollapsedSidebarWidth=0,this.previewNavigationCollapseTask=null,this.flyoutOverlayPromotionWidth=null,this.flyoutOverlayRecoveryReady=!1,this.flyoutOverlayRecoveryGeneration=0,this.preferredPreviewWidth=null,this.preferredFlyoutWidth=null,this.resizeSession=null,this.workspaceKeyboardSettlementTimer=null,this.footerWrapperIsLandmark=!0,this.allocatedPreviewWidth=0,this.allocatedFlyoutWidth=0,this.onWorkspaceResizePointerDown=(e,t)=>{if(t.button!==0||!this.separatorIsAvailable(e))return;const i=t.currentTarget,s=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,a=this.renderedWorkspaceWidths();this.endWorkspaceResize(),this.finishWorkspaceKeyboardResize(!1),this.suspendPreviewLayoutForWorkspaceResize(),this.resizeSession={separator:e,pointerId:t.pointerId,target:i,startClientX:t.clientX,startPreviewWidth:a.previewWidth,startFlyoutWidth:a.flyoutWidth,startMainWidth:s,startNavigationAllowance:this.previewNavigationResizeAllowance(),direction:this.workspaceResizeDirection()};try{i.setPointerCapture?.(t.pointerId)}catch{}this.toggleAttribute("data-workspace-resizing",!0),t.preventDefault()},this.onWorkspaceResizePointerMove=e=>{const t=this.resizeSession;!t||t.pointerId!==e.pointerId||(e.preventDefault(),this.applyWorkspaceResize(t.separator,e.clientX-t.startClientX,"pointer",t.startPreviewWidth,t.startFlyoutWidth,t.startMainWidth,t.startNavigationAllowance,t.direction))},this.onWorkspaceResizePointerEnd=e=>{!this.resizeSession||this.resizeSession.pointerId!==e.pointerId||(e.preventDefault(),this.endWorkspaceResize())},this.onWorkspaceResizeBlur=e=>{this.hasAttribute("data-workspace-keyboard-adjusting")&&(e.relatedTarget instanceof Element&&e.relatedTarget.classList.contains("esp-page-workspace-resize-handle")||this.finishWorkspaceKeyboardResize())},this.onWorkspaceResizeKeyDown=(e,t)=>{if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight"||!this.separatorIsAvailable(e))return;t.preventDefault(),this.hasAttribute("data-workspace-keyboard-adjusting")||this.suspendPreviewLayoutForWorkspaceResize();const i=(t.key==="ArrowLeft"?-1:1)*this.resizeStep(t.shiftKey),s=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,a=this.renderedWorkspaceWidths();this.applyWorkspaceResize(e,i,"keyboard",a.previewWidth,a.flyoutWidth,s,this.previewNavigationResizeAllowance(),this.workspaceResizeDirection())},this.schedulePreviewLayout=(e=!1)=>{if(!this.isConnected||!this.hasUpdated||(this.previewOverlayRecoveryRequested||=e===!0,this.resizeSession||this.hasAttribute("data-workspace-keyboard-adjusting")))return;this.previewSyncGeneration+=1;const t=this.previewSyncGeneration;this.previewSyncRaf!==null&&cancelAnimationFrame(this.previewSyncRaf),this.previewSyncRaf=requestAnimationFrame(()=>{this.previewSyncRaf=null;const i=this.previewOverlayRecoveryRequested;this.previewOverlayRecoveryRequested=!1,this.previewSyncTask=this.previewSyncTask.then(()=>this.syncPreviewLayout(t,i)).catch(()=>{})})},this.onPreviewMediaChange=()=>this.schedulePreviewLayout(!0),this.onPreviewResize=e=>{let t=!1;for(const i of e){const s=i.contentRect.width;if(i.target instanceof HTMLElement&&i.target.classList.contains("esp-page-left")){s>h&&!this.hasAttribute("data-preview-navigation-collapsed")&&(this.previewCollapsedSidebarWidth=s);continue}const a=this.previewObservedWidths.get(i.target);this.previewObservedWidths.set(i.target,s),t||=a===void 0||Math.abs(a-s)>.25}t&&this.schedulePreviewLayout(!0)},this.kind="wide",this.align="start",this.contained=!1,this.headerPosition="normal",this.fixedMenus=!1,this.previewOpen=!1,this.previewLabel="Preview",this.previewCollapseSidebar=!1,this.workspaceResizable=!1,this.previewVisible=!1,this.previewReclaiming=!1,new _(this,".esp-page-left > .sticky-wrapper"),new _(this,".esp-page-right > .sticky-wrapper"),new _(this,".esp-page-flyout > .sticky-wrapper"),new _(this,".esp-page-preview > .sticky-wrapper",{topOffset:()=>0}),this.addEventListener("flyout-state-changed",e=>this.syncFlyoutState(e))}connectedCallback(){const e=Array.from(this.children).filter(t=>t.getAttribute("slot")==="footer");this.footerWrapperIsLandmark=!e.some(t=>this.footerElementProvidesLandmark(t)),super.connectedCallback(),this.syncMainMaximumConfiguration(),this.hasUpdated&&queueMicrotask(()=>this.setupPreviewLayoutObserver())}disconnectedCallback(){this.finishWorkspaceKeyboardResize(!1),this.endWorkspaceResize(),this.previewResizeObserver?.disconnect(),this.previewResizeObserver=void 0,this.previewMediaQuery?.removeEventListener("change",this.onPreviewMediaChange),this.previewMediaQuery=void 0,this.previewSyncRaf!==null&&(cancelAnimationFrame(this.previewSyncRaf),this.previewSyncRaf=null),this.previewSyncGeneration+=1,this.previewOverlayRecoveryRequested=!1,this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1),this.toggleAttribute("data-workspace-keyboard-adjusting",!1),this.toggleAttribute("descendant-flyout-overlay-open",!1),this.clearFlyoutOverlayRecovery(),this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),this.preferredPreviewWidth=null,this.preferredFlyoutWidth=null,this.previewNavigationCollapseTask=null,this.setPreviewNavigationCollapse(!1),super.disconnectedCallback()}syncFlyoutState(e){if(e&&e.target?.closest?.("esp-page")!==this){this.syncDescendantFlyoutOverlayState();return}const t=r=>{const o=r;return(typeof o.mode=="string"?o.mode:r.getAttribute("mode"))==="overlay"||o.pageOverlayRequested===!0},i=r=>{const o=r.open;return typeof o=="boolean"?o:r.hasAttribute("open")},s=r=>r.anchor!=null,a=(this.flyoutSlot.value?.assignedElements()??[]).filter(r=>r.tagName==="ESP-FLYOUT");for(const r of a){const o=r,p=typeof o.mode=="string"?o.mode:r.getAttribute("mode");o.pageOverlayRequested&&(!i(r)||p!=="auto")&&(o.pageOverlayRequested=!1)}a.some(r=>r.pageOverlayRequested===!0)||this.clearFlyoutOverlayRecovery(),this.toggleAttribute("flyout-open",a.some(r=>i(r)&&!t(r))),this.toggleAttribute("flyout-overlay-open",a.some(r=>i(r)&&t(r))),this.toggleAttribute("flyout-anchored",a.some(r=>i(r)&&s(r))),this.resizeSession&&(this.hasAttribute("flyout-overlay-open")||this.resizeSession.separator==="preview-flyout"&&!this.hasAttribute("flyout-open"))&&this.endWorkspaceResize(),this.requestUpdate(),this.schedulePreviewLayout()}syncDescendantFlyoutOverlayState(){const e=Array.from(this.querySelectorAll("esp-flyout")).some(t=>{if(t.closest("esp-page")===this)return!1;const i=t,s=typeof i.open=="boolean"?i.open:t.hasAttribute("open"),a=typeof i.mode=="string"?i.mode:t.getAttribute("mode");return s&&(a==="overlay"||i.pageOverlayRequested===!0||t.getAttribute("aria-modal")==="true")});this.toggleAttribute("descendant-flyout-overlay-open",e)}assignedFlyouts(){return(this.flyoutSlot.value?.assignedElements()??[]).filter(e=>e.tagName==="ESP-FLYOUT")}openAutoFlyouts(){return this.assignedFlyouts().filter(e=>{const t=typeof e.open=="boolean"?e.open:e.hasAttribute("open"),i=typeof e.mode=="string"?e.mode:e.getAttribute("mode");return t&&i!=="overlay"})}async setPageFlyoutOverlay(e){let t=!1;const i=new Set(this.openAutoFlyouts());for(const s of this.assignedFlyouts()){const a=e&&i.has(s);s.pageOverlayRequested!==a&&(s.pageOverlayRequested=a,t=!0)}return t&&await Promise.all(this.assignedFlyouts().map(s=>s.updateComplete??Promise.resolve())),e||this.clearFlyoutOverlayRecovery(),t}clearFlyoutOverlayRecovery(){this.flyoutOverlayPromotionWidth=null,this.flyoutOverlayRecoveryReady=!1,this.flyoutOverlayRecoveryGeneration+=1}armFlyoutOverlayRecovery(){const e=++this.flyoutOverlayRecoveryGeneration;this.flyoutOverlayRecoveryReady=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e!==this.flyoutOverlayRecoveryGeneration||!this.openAutoFlyouts().some(t=>t.pageOverlayRequested===!0)||(this.flyoutOverlayPromotionWidth=this.visiblePageInlineBounds().width,this.flyoutOverlayRecoveryReady=!0)})})}previewHasContent(){const e=this.previewSlot.value?.assignedNodes({flatten:!0});return e?e.some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent?.trim().length??0)>0):Array.from(this.childNodes).some(t=>t instanceof Element&&t.getAttribute("slot")==="preview"&&!t.hasAttribute("hidden"))}getPreviewNavigationPair(){if(!this.previewCollapseSidebar)return null;const e=Array.from(this.children),t=e.find(r=>r.slot==="header"&&r.tagName==="ESP-HEADER"),i=e.find(r=>r.slot==="sidebar"&&r.tagName==="ESP-MENU");if(!t||!i||!i.id)return null;const s=typeof t.drawerTarget=="string"?t.drawerTarget:t.getAttribute("drawer-target")??"",a=typeof i.mode=="string"?i.mode:i.getAttribute("mode");return s!==i.id||a!=="vertical"||!("previewCollapseRequested"in t)||!("previewCollapseRequested"in i)?null:{header:t,menu:i}}async setPreviewNavigationCollapse(e){const t=e?this.getPreviewNavigationPair():null,i=t!==null&&this.previewHeader===t.header&&this.previewMenu===t.menu,s=this.previewHeader&&this.previewHeader!==t?.header?this.previewHeader:null,a=this.previewMenu&&this.previewMenu!==t?.menu?this.previewMenu:null;if(s&&(s.previewCollapseRequested=!1),a&&(a.previewCollapseRequested=!1),this.previewHeader=t?.header??null,this.previewMenu=t?.menu??null,this.toggleAttribute("data-preview-navigation-collapsed",!1),await s?.updateComplete,await a?.updateComplete,!t)return!1;const r=i?this.previewCollapsedSidebarWidth:this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0;return t.header.previewCollapseRequested=!0,t.menu.previewCollapseRequested=!0,await t.header.updateComplete,await t.menu.updateComplete,t.menu.hasExternalDrawerControl===!0?(this.previewCollapsedSidebarWidth=r,this.toggleAttribute("data-preview-navigation-collapsed",!0),!0):(t.header.previewCollapseRequested=!1,t.menu.previewCollapseRequested=!1,await t.header.updateComplete,await t.menu.updateComplete,this.previewHeader=null,this.previewMenu=null,!1)}requestPreviewNavigationCollapse(){if(this.hasAttribute("data-preview-navigation-collapsed")||this.previewNavigationCollapseTask)return;const e=this.setPreviewNavigationCollapse(!0);this.previewNavigationCollapseTask=e,e.then(()=>{this.previewNavigationCollapseTask===e&&(this.previewNavigationCollapseTask=null)},()=>{this.previewNavigationCollapseTask===e&&(this.previewNavigationCollapseTask=null)})}scheduleWorkspaceSettlement(e=null){const t=()=>{this.schedulePreviewLayout(),e&&requestAnimationFrame(()=>{this.previewSyncTask.then(()=>{const a=this.shadowRoot?.activeElement,r=this.ownerDocument.activeElement;!this.isConnected||!e.isConnected||a&&a!==e||r!==this&&r!==this.ownerDocument.body||getComputedStyle(e).display!=="none"&&e.focus({preventScroll:!0})})})},i=this.previewNavigationCollapseTask;if(!i){t();return}i.then(()=>t(),()=>t())}clearWorkspaceKeyboardSettlementTimer(){this.workspaceKeyboardSettlementTimer!==null&&(clearTimeout(this.workspaceKeyboardSettlementTimer),this.workspaceKeyboardSettlementTimer=null)}finishWorkspaceKeyboardResize(e=!0){this.clearWorkspaceKeyboardSettlementTimer();const t=this.hasAttribute("data-workspace-keyboard-adjusting");this.toggleAttribute("data-workspace-keyboard-adjusting",!1),t&&e&&!this.resizeSession&&this.scheduleWorkspaceSettlement()}deferWorkspaceKeyboardSettlement(){this.clearWorkspaceKeyboardSettlementTimer(),this.workspaceKeyboardSettlementTimer=setTimeout(()=>{if(this.workspaceKeyboardSettlementTimer=null,!this.hasAttribute("data-workspace-keyboard-adjusting"))return;const e=this.shadowRoot?.activeElement,t=e instanceof HTMLElement&&e.classList.contains("esp-page-workspace-resize-handle")?e:null;this.toggleAttribute("data-workspace-keyboard-adjusting",!1),this.resizeSession||this.scheduleWorkspaceSettlement(t)},se)}suspendPreviewLayoutForWorkspaceResize(){this.previewSyncRaf!==null&&(cancelAnimationFrame(this.previewSyncRaf),this.previewSyncRaf=null),this.previewSyncGeneration+=1,this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1)}setPreviewLayoutState(e,t){this.previewVisible=e,this.previewReclaiming=e&&t,e||this.endWorkspaceResize()}setWorkspaceWidths(e,t,i=!1){const s=Math.max(0,e),a=Math.max(0,t);this.style.setProperty("--_esp-page-preview-used-width",`${s}px`),this.style.setProperty("--_esp-page-flyout-used-width",`${a}px`),this.toggleAttribute("data-workspace-targeted",i),this.allocatedPreviewWidth=s,this.allocatedFlyoutWidth=a}clampWidth(e,t,i){return Math.min(Math.max(e,t),Math.max(t,i))}visiblePageInlineBounds(){const e=this.getBoundingClientRect();let t=e.left,i=e.right;const s=window.visualViewport,a=s?.offsetLeft??0,r=s?.width??document.documentElement.clientWidth;r>0&&(t=Math.max(t,a),i=Math.min(i,a+r));const o=this.getRootNode();let p=this.parentElement??(o instanceof ShadowRoot?o.host:null);for(;p;){const g=getComputedStyle(p).overflowX;if(["auto","clip","hidden","scroll"].includes(g)){const c=p.getBoundingClientRect();t=Math.max(t,c.left),i=Math.min(i,c.right)}const l=p.getRootNode();p=p.parentElement??(l instanceof ShadowRoot?l.host:null)}return{left:t,right:i,width:Math.max(0,i-t)}}probeWidth(e){return e.value?.getBoundingClientRect().width??0}optionalWidth(e,t){return getComputedStyle(this).getPropertyValue(e).trim()===""?null:this.probeWidth(t)}syncMainMaximumConfiguration(){const e=getComputedStyle(this).getPropertyValue("--esp-page-main-max-width").trim()!=="";this.toggleAttribute("data-main-max-configured",e)}workspaceWidthCapacity(e,t,i=0){const s=this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,a=this.shadowRoot?.querySelector(".esp-page-right")?.getBoundingClientRect().width??0,r=Math.max(0,this.visiblePageInlineBounds().width-s-a-Math.max(0,i)),o=t>0?Math.min(r,t):r;return{natural:Math.max(0,r-o),maximum:Math.max(0,r-Math.max(0,e))}}workspaceTargetWidth(e,t,i){return Math.min(e.maximum,Math.max(t,i,e.natural))}allocateWorkspaceWidths(e,t,i,s,a,r,o,p=null,g=null){const l=Math.max(0,e),c=Math.max(0,s),d=Math.max(c,a),n=Math.max(0,r),b=Math.max(n,o),f=t?this.preferredPreviewWidth??(p===null?null:this.clampWidth(p,c,d)):null,v=i?this.preferredFlyoutWidth??(g===null?null:this.clampWidth(g,n,b)):null;let w=0,y=0;t&&i?(w=Math.min(d,Math.max(c,l-n)),y=Math.min(b,Math.max(n,l-w))):t?w=Math.min(d,Math.max(c,l)):i&&(y=Math.min(b,Math.max(n,l))),t&&f!==null&&(w=this.clampWidth(f,c,d),i&&v===null&&(y=this.clampWidth(l-w,n,b))),i&&v!==null&&(y=this.clampWidth(v,n,b),t&&f===null&&(w=this.clampWidth(l-y,c,d)));let M=w+y-l;if(M>0&&i){const u=Math.min(M,Math.max(0,y-n));y-=u,M-=u}return M>0&&t&&(w-=Math.min(M,Math.max(0,w-c))),{previewWidth:w,flyoutWidth:y}}workspaceResizeDirection(){return getComputedStyle(this).direction==="rtl"?-1:1}resizeStep(e){const t=this.probeWidth(e?this.resizeLargeStepProbe:this.resizeStepProbe);return t>0?t:e?ae:ie}previewNavigationResizeAllowance(){if(this.hasAttribute("data-preview-navigation-collapsed")||this.getPreviewNavigationPair()===null)return 0;const e=Math.max(0,this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0);return e>h&&(this.previewCollapsedSidebarWidth=e),e>h?e:this.previewCollapsedSidebarWidth}renderedWorkspaceWidths(){const e=this.shadowRoot?.querySelector(".esp-page-preview"),t=this.shadowRoot?.querySelector(".esp-page-flyout");return{previewWidth:this.allocatedPreviewWidth>0?this.allocatedPreviewWidth:e?.getBoundingClientRect().width??0,flyoutWidth:this.allocatedFlyoutWidth>0?this.allocatedFlyoutWidth:t?.getBoundingClientRect().width??0}}mainPreviewResizeRange(e=this.renderedWorkspaceWidths().previewWidth,t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,i=this.previewNavigationResizeAllowance()){const s=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),a=Math.max(s,this.probeWidth(this.previewMaxWidthProbe)),r=Math.max(0,this.probeWidth(this.mainMinWidthProbe)),o=this.probeWidth(this.mainMaxWidthProbe),p=Math.max(0,t+e),g=o>0?Math.max(0,p-o):0,l=Math.max(s,g),c=Math.max(0,p+i-r);return{minimum:l,maximum:Math.max(l,Math.min(a,c))}}previewFlyoutResizeRange(e=this.renderedWorkspaceWidths().previewWidth,t=this.renderedWorkspaceWidths().flyoutWidth){const i=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),s=Math.max(i,this.probeWidth(this.previewMaxWidthProbe)),a=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),r=Math.max(a,this.probeWidth(this.flyoutMaxWidthProbe)),o=e+t;return{minimum:Math.max(i,o-r),maximum:Math.max(i,Math.min(s,o-a))}}separatorIsAvailable(e){return!this.workspaceResizable||this.hasAttribute("flyout-overlay-open")?!1:e==="main-preview"?this.previewVisible:this.hasAttribute("flyout-open")}flyoutOnlyResizeRange(e=this.renderedWorkspaceWidths().flyoutWidth,t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0){const i=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),s=Math.max(i,this.probeWidth(this.flyoutMaxWidthProbe)),a=Math.max(0,this.probeWidth(this.mainMinWidthProbe)),r=this.probeWidth(this.mainMaxWidthProbe),o=Math.max(0,t+e),p=r>0?Math.max(0,o-r):0,g=Math.max(i,p);return{minimum:g,maximum:Math.max(g,Math.min(s,o-a))}}applyWorkspaceResize(e,t,i,s,a,r,o,p){if(!this.separatorIsAvailable(e))return;const g=t*p;let l=e,c=s,d=a;if(e==="main-preview"){const n=this.mainPreviewResizeRange(s,r,o),b=s-g;c=this.clampWidth(b,n.minimum,n.maximum),this.preferredPreviewWidth=c;const f=Math.max(0,this.probeWidth(this.mainMinWidthProbe));o>0&&c>Math.max(0,r+s-f)+h&&this.requestPreviewNavigationCollapse();const v=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),w=Math.max(0,v-b),y=n.minimum<=v+h;if(w>0&&y&&a>0){const M=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),u=Math.max(M,this.probeWidth(this.flyoutMaxWidthProbe));d=this.clampWidth(a-w,M,u),this.preferredFlyoutWidth=d}else a>0&&(this.preferredFlyoutWidth??=a)}else if(this.previewVisible){const n=this.previewFlyoutResizeRange(s,a),b=s+g;c=this.clampWidth(b,n.minimum,n.maximum),d=s+a-c,this.preferredPreviewWidth=c;const f=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),v=Math.max(0,f-b),w=n.minimum<=f+h;if(v>0&&w){const y=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),M=Math.max(y,this.probeWidth(this.flyoutMaxWidthProbe)),u=Math.max(0,this.probeWidth(this.mainMinWidthProbe)),m=Math.max(0,r-u);d=this.clampWidth(d+Math.min(v,m),y,M)}this.preferredFlyoutWidth=d}else{l="main-flyout";const n=this.flyoutOnlyResizeRange(a,r);d=this.clampWidth(a-g,n.minimum,n.maximum),c=0,this.preferredFlyoutWidth=d}this.setWorkspaceWidths(c,d,!0),this.previewVisible&&this.setPreviewLayoutState(!0,!0),i==="keyboard"&&(this.toggleAttribute("data-workspace-keyboard-adjusting",!0),this.deferWorkspaceKeyboardSettlement()),this.dispatchEvent(new CustomEvent("esp-page-workspace-resize",{bubbles:!0,composed:!0,detail:{separator:l,source:i,previewWidth:c,flyoutWidth:d}}))}endWorkspaceResize(){const e=this.resizeSession;this.resizeSession=null,this.toggleAttribute("data-workspace-resizing",!1),e?.target.hasPointerCapture?.(e.pointerId)&&e.target.releasePointerCapture(e.pointerId),e&&this.scheduleWorkspaceSettlement()}previewFitsWithinPage(e,t,i,s,a,r){const o=this.shadowRoot?.querySelector(".esp-page-main"),p=this.shadowRoot?.querySelector(".esp-page-preview"),g=this.shadowRoot?.querySelector(".esp-page-flyout");if(!o||!p||!g)return!1;const l=this.visiblePageInlineBounds(),c=o.getBoundingClientRect(),d=p.getBoundingClientRect(),n=g.getBoundingClientRect(),b=Math.max(t,i),f=Math.max(a,r),v=d.width+h>=t&&d.width<=b+h,w=!s||n.width+h>=a&&n.width<=f+h,y=d.left+h>=l.left&&d.right<=l.right+h&&(!s||n.left+h>=l.left&&n.right<=l.right+h),M=getComputedStyle(this).direction==="rtl"?c.left+h>=d.right&&(!s||d.left+h>=n.right):c.right<=d.left+h&&(!s||d.right<=n.left+h);return c.width+h>=e&&v&&w&&y&&M}flyoutFitsWithinPage(e,t,i){const s=this.shadowRoot?.querySelector(".esp-page-main"),a=this.shadowRoot?.querySelector(".esp-page-flyout");if(!s||!a)return!1;const r=this.visiblePageInlineBounds(),o=s.getBoundingClientRect(),p=a.getBoundingClientRect(),g=Math.max(t,i),l=p.width+h>=t&&p.width<=g+h,c=p.left+h>=r.left&&p.right<=r.right+h,d=getComputedStyle(this).direction==="rtl"?o.left+h>=p.right:o.right<=p.left+h;return o.width+h>=e&&l&&c&&d}workspaceMinimumsCanFit(e,t,i,s,a){const r=this.visiblePageInlineBounds().width;if(r<=0||e<=0||t&&i<=0||s&&a<=0)return!1;const o=this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,p=this.shadowRoot?.querySelector(".esp-page-right")?.getBoundingClientRect().width??0,l=(t&&this.getPreviewNavigationPair()!==null?0:o)+p+e+(t?i:0)+(s?a:0);return r+h>=l}workspaceGeometrySample(){const e=this.visiblePageInlineBounds(),t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect(),i=this.shadowRoot?.querySelector(".esp-page-preview")?.getBoundingClientRect(),s=this.shadowRoot?.querySelector(".esp-page-flyout")?.getBoundingClientRect();return[e.left,e.right,e.width,t?.left??0,t?.right??0,t?.width??0,i?.left??0,i?.right??0,i?.width??0,s?.left??0,s?.right??0,s?.width??0]}workspaceGeometryMatches(e,t){return e.length===t.length&&e.every((i,s)=>Math.abs(i-(t[s]??i))<=h)}workspaceCandidateIsMeasurable(e,t){const i=this.shadowRoot?.querySelector(".esp-page-preview")?.getBoundingClientRect().width??0,s=this.shadowRoot?.querySelector(".esp-page-flyout")?.getBoundingClientRect().width??0;return(!e||i>h)&&(!t||s>h)}async candidateFitsAfterLayoutSettles(e,t,i){if(await this.updateComplete,e!==this.previewSyncGeneration||!this.isConnected)return null;let s=null,a=0;for(let r=0;r<ee;r+=1){if(await new Promise(p=>requestAnimationFrame(()=>p())),e!==this.previewSyncGeneration||!this.isConnected)return null;if(t())return!0;if(!i()){s=null,a=0;continue}const o=this.workspaceGeometrySample();if(a=s&&this.workspaceGeometryMatches(s,o)?a+1:1,a>=J)return!1;s=o}return null}async promoteFlyoutIfClipped(e,t,i,s){if(i<=0)return!1;const a=await this.candidateFitsAfterLayoutSettles(e,()=>this.flyoutFitsWithinPage(t,i,s),()=>this.workspaceCandidateIsMeasurable(!1,!0));return a===null?!0:a?!1:(await this.promoteFlyoutToOverlay(),!0)}async promoteFlyoutToOverlay(){this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),this.flyoutOverlayPromotionWidth===null&&(this.flyoutOverlayPromotionWidth=this.visiblePageInlineBounds().width,this.armFlyoutOverlayRecovery()),await this.setPageFlyoutOverlay(!0)}async syncPreviewLayout(e,t=!0){if(e!==this.previewSyncGeneration||!this.isConnected||this.resizeSession||this.hasAttribute("data-workspace-keyboard-adjusting"))return;let i=!1;const s=this.previewVisible;this.toggleAttribute("data-preview-measuring",!0);try{const a=this.previewOpen&&this.previewHasContent(),r=this.previewMediaQuery?.matches??!1,o=this.hasAttribute("flyout-overlay-open"),p=this.hasAttribute("flyout-open"),g=this.hasAttribute("data-preview-navigation-collapsed")?this.previewCollapsedSidebarWidth:0,l=this.probeWidth(this.previewMinWidthProbe),c=this.optionalWidth("--esp-page-preview-default-width",this.previewDefaultWidthProbe),d=this.probeWidth(this.previewMaxWidthProbe),n=this.probeWidth(this.flyoutMinWidthProbe),b=this.optionalWidth("--esp-page-flyout-default-width",this.flyoutDefaultWidthProbe),f=this.probeWidth(this.flyoutMaxWidthProbe),v=this.probeWidth(this.mainMinWidthProbe);this.syncMainMaximumConfiguration();const w=this.probeWidth(this.mainMaxWidthProbe),y=this.kind==="full"&&!this.hasAttribute("data-main-max-configured")?0:w,M=this.openAutoFlyouts().some(S=>S.pageOverlayRequested===!0);if(this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),M){const S=this.visiblePageInlineBounds().width,V=this.flyoutOverlayPromotionWidth===null||S>=this.flyoutOverlayPromotionWidth+te;!r&&t&&this.flyoutOverlayRecoveryReady&&V&&this.workspaceMinimumsCanFit(v,a,l,!0,n)?await this.setPageFlyoutOverlay(!1):r&&await this.setPageFlyoutOverlay(!1);return}if(this.toggleAttribute("data-preview-navigation-collapsed",!1),await this.updateComplete,e!==this.previewSyncGeneration)return;const u=a&&!r&&!o,m=p&&!r;if(v>0&&(!u||l>0)&&(!m||n>0)&&(u||m)&&!this.workspaceMinimumsCanFit(v,u,l,m,n)){m&&await this.promoteFlyoutToOverlay();return}const z=(u?l:0)+(m?n:0),T=u&&this.preferredPreviewWidth!==null||m&&this.preferredFlyoutWidth!==null||(u&&c!==null||m&&b!==null),L=(u?this.preferredPreviewWidth===null?l:this.clampWidth(this.preferredPreviewWidth,l,d):0)+(m?this.preferredFlyoutWidth===null?n:this.clampWidth(this.preferredFlyoutWidth,n,f):0),F=this.workspaceWidthCapacity(v,y,g),B=this.workspaceTargetWidth(F,z,L);let C=this.allocateWorkspaceWidths(B,u,m,l,d,n,f,c,b);if(this.setWorkspaceWidths(C.previewWidth,C.flyoutWidth,T),!u||l<=0){m&&await this.promoteFlyoutIfClipped(e,v,n,f);return}if(F.natural+h>=z){s||this.toggleAttribute("data-preview-validating",!0),this.setPreviewLayoutState(!0,B>F.natural+h);const S=await this.candidateFitsAfterLayoutSettles(e,()=>this.previewFitsWithinPage(v,l,d,m,n,f),()=>this.workspaceCandidateIsMeasurable(!0,m));if(S===null)return;if(S){this.toggleAttribute("data-preview-validating",!1);return}this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,m?n:0),m&&await this.promoteFlyoutToOverlay();return}const q=F.maximum+h>=z;if(i=q?!1:await this.setPreviewNavigationCollapse(this.previewCollapseSidebar),q&&await this.setPreviewNavigationCollapse(!1),e!==this.previewSyncGeneration)return;const O=this.workspaceWidthCapacity(v,y);if(O.maximum+h<z){this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,m?n:0),i=!1,m&&await this.promoteFlyoutToOverlay();return}const I=this.workspaceTargetWidth(O,z,L),G=I>O.natural+h;if(C=this.allocateWorkspaceWidths(I,!0,m,l,d,n,f,c,b),this.setWorkspaceWidths(C.previewWidth,C.flyoutWidth,T),s||this.toggleAttribute("data-preview-validating",!0),this.setPreviewLayoutState(!0,G),await this.updateComplete,e!==this.previewSyncGeneration)return;const D=await this.candidateFitsAfterLayoutSettles(e,()=>this.previewFitsWithinPage(v,l,d,m,n,f),()=>this.workspaceCandidateIsMeasurable(!0,m));if(D===null)return;D?this.toggleAttribute("data-preview-validating",!1):(this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,m?n:0),i=!1,m&&await this.promoteFlyoutToOverlay())}finally{e===this.previewSyncGeneration&&!i&&await this.setPreviewNavigationCollapse(!1),e===this.previewSyncGeneration&&(this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1),this.requestUpdate())}}setupPreviewLayoutObserver(){if(this.isConnected){if(!this.previewMediaQuery&&typeof window.matchMedia=="function"&&(this.previewMediaQuery=window.matchMedia(Z),this.previewMediaQuery.addEventListener("change",this.onPreviewMediaChange)),!this.previewResizeObserver&&typeof ResizeObserver<"u"){this.previewResizeObserver=new ResizeObserver(this.onPreviewResize),this.previewResizeObserver.observe(this);const e=this.shadowRoot?.querySelector(".esp-page-left");e&&this.previewResizeObserver.observe(e);for(const t of[this.previewMinWidthProbe,this.previewDefaultWidthProbe,this.previewMaxWidthProbe,this.flyoutMinWidthProbe,this.flyoutDefaultWidthProbe,this.flyoutMaxWidthProbe,this.mainMinWidthProbe,this.mainConfiguredMaxWidthProbe,this.mainMaxWidthProbe,this.resizeStepProbe,this.resizeLargeStepProbe])t.value&&this.previewResizeObserver.observe(t.value)}this.schedulePreviewLayout(!0)}}footerElementProvidesLandmark(e){return e.matches($)||e.querySelector($)!==null}syncFooterLandmark(){const t=(this.footerSlot.value?.assignedElements({flatten:!0})??[]).some(i=>this.footerElementProvidesLandmark(i));this.footerWrapperIsLandmark=!t}showPreview(){this.previewOpen=!0}closePreview(){this.previewOpen=!1}togglePreview(){this.previewOpen=!this.previewOpen}AddDialog(e){this.dialogZone.value?.appendChild(e)}firstUpdated(e){super.firstUpdated(e),this.syncFlyoutState(),this.setupPreviewLayoutObserver()}updated(e){super.updated(e),(e.has("fixedMenus")||e.has("headerPosition"))&&X().publish("fixed-menus-changed",{fixed:this.fixedMenus||this.headerPosition==="fixed"}),(e.has("previewOpen")||e.has("previewCollapseSidebar"))&&this.schedulePreviewLayout(!0),e.has("workspaceResizable")&&!this.workspaceResizable&&(this.finishWorkspaceKeyboardResize(),this.endWorkspaceResize())}render(){const e=this.fixedMenus||this.headerPosition==="fixed",t=!e&&this.headerPosition==="sticky",i=this.mainPreviewResizeRange(),s=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),a=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),r=Math.max(a,this.probeWidth(this.flyoutMaxWidthProbe)),o=Math.max(0,this.probeWidth(this.mainMinWidthProbe)),p=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,g=this.hasAttribute("flyout-open"),l=p+this.allocatedPreviewWidth,c=i.minimum<=s+h,d=g&&c?Math.max(0,this.allocatedFlyoutWidth-a):0,n=Math.max(o,l-i.maximum),b=Math.max(n,Math.max(o,l-i.minimum)+d);let f,v;if(this.previewVisible){const u=this.previewFlyoutResizeRange(),m=this.allocatedPreviewWidth+this.allocatedFlyoutWidth,z=u.minimum<=s+h?Math.max(0,p-o):0;f=Math.max(a,m-u.maximum),v=Math.max(f,Math.min(r,m-u.minimum+z))}else{const u=this.flyoutOnlyResizeRange();f=u.minimum,v=u.maximum}const w=this.previewVisible?"preview-flyout-resize-handle":"main-flyout-resize-handle",y=this.previewVisible?"Resize preview and help panes":"Resize help pane";return H`
|
|
2
|
-
<div part="wrapper" class="esp-page ${
|
|
1
|
+
var z=function(G,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(G,e,t,i);else for(var r=G.length-1;r>=0;r--)(o=G[r])&&(s=(a<3?o(s):a>3?o(e,t,s):o(e,t))||s);return a>3&&s&&Object.defineProperty(e,t,s),s};import{css as ie,html as ae,nothing as Z}from"lit";import{customElement as se,property as _,state as K}from"lit/decorators.js";import{classMap as re}from"lit/directives/class-map.js";import{createRef as M,ref as P}from"lit/directives/ref.js";import{EspalierElementBase as J}from"../shared/esp-element-base.js";import{BiDirectionalStickyController as q}from"./bi-directional-sticky-controller.js";import{getEspBus as oe}from"../shared/bus-events.js";import"../toaster/esp-toaster.js";const ee='esp-footer, footer, [role~="contentinfo"]',ne="(max-width: 50em)",h=1,le=5,he=12,pe=48,de=48,ce=16,ue=64,ge=250,me=250,ve=40;let x=class extends J{constructor(){super(),this.dialogZone=M(),this.flyoutSlot=M(),this.footerSlot=M(),this.previewSlot=M(),this.previewSpace=M(),this.previewMinWidthProbe=M(),this.previewDefaultWidthProbe=M(),this.previewMaxWidthProbe=M(),this.flyoutMinWidthProbe=M(),this.flyoutDefaultWidthProbe=M(),this.flyoutMaxWidthProbe=M(),this.mainMinWidthProbe=M(),this.mainConfiguredMaxWidthProbe=M(),this.mainMaxWidthProbe=M(),this.resizeStepProbe=M(),this.resizeLargeStepProbe=M(),this.previewObservedWidths=new WeakMap,this.previewSyncRaf=null,this.previewSyncGeneration=0,this.previewSyncTask=Promise.resolve(),this.previewOverlayRecoveryRequested=!1,this.previewHeader=null,this.previewMenu=null,this.previewCollapsedSidebarWidth=0,this.previewNavigationCollapseTask=null,this.flyoutOverlayPromotionWidth=null,this.flyoutOverlayRecoveryReady=!1,this.flyoutOverlayRecoveryGeneration=0,this.preferredPreviewWidth=null,this.preferredFlyoutWidth=null,this.flyoutFullHeightActive=!1,this.resizeSession=null,this.workspaceKeyboardSettlementTimer=null,this.workspaceRecenteringRaf=null,this.workspaceRecenteringTimer=null,this.footerWrapperIsLandmark=!0,this.allocatedPreviewWidth=0,this.allocatedFlyoutWidth=0,this.onWorkspaceResizePointerDown=(e,t)=>{if(t.button!==0||!this.separatorIsAvailable(e))return;const i=t.currentTarget,a=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,s=this.renderedWorkspaceWidths();this.endWorkspaceResize(),this.finishWorkspaceKeyboardResize(!1),this.suspendPreviewLayoutForWorkspaceResize();const o=i.getBoundingClientRect(),r=this.holdWorkspacePosition();this.toggleAttribute("data-workspace-resizing",!0);const{leading:n,trailing:d}=this.workspaceLogicalGutterWidths(),m=d>h?n+d:0,p=d>h?Math.max(1,m/d):1;this.resizeSession={separator:e,pointerId:t.pointerId,target:i,startClientX:t.clientX,startPreviewWidth:s.previewWidth,startFlyoutWidth:s.flyoutWidth,startMainWidth:a,startNavigationAllowance:this.previewNavigationResizeAllowance(),startOuterGrowthCapacity:m,trailingExpansionScale:p,trailingGroupPushDelta:0,startHandleClientX:o.left+o.width/2,startLeadingGutterWidth:r,heldLeadingGutterWidth:r,direction:this.workspaceResizeDirection()};try{i.setPointerCapture?.(t.pointerId)}catch{}t.preventDefault()},this.onWorkspaceResizePointerMove=e=>{const t=this.resizeSession;if(!t||t.pointerId!==e.pointerId)return;e.preventDefault();const i=e.clientX-t.startClientX,a=i*t.direction,s=t.separator==="main-preview"||t.separator==="preview-flyout"&&!this.previewVisible;t.trailingGroupPushDelta=s&&a>0?Math.min(a,t.startOuterGrowthCapacity/t.trailingExpansionScale,this.mainResizeGrowthCapacity(t.startMainWidth)):0,this.applyWorkspaceResize(t.separator,i,"pointer",t.startPreviewWidth,t.startFlyoutWidth,t.startMainWidth,t.startNavigationAllowance,t.startOuterGrowthCapacity,t.trailingExpansionScale,t.direction),this.align!=="start"&&!this.seedWorkspaceResizeLeadingGutter(t)&&this.trackWorkspaceResizePointer(t)},this.onWorkspaceResizePointerEnd=e=>{!this.resizeSession||this.resizeSession.pointerId!==e.pointerId||(e.preventDefault(),this.endWorkspaceResize())},this.onWorkspaceResizeBlur=e=>{this.hasAttribute("data-workspace-keyboard-adjusting")&&(e.relatedTarget instanceof Element&&e.relatedTarget.classList.contains("esp-page-workspace-resize-handle")||this.finishWorkspaceKeyboardResize())},this.onWorkspaceResizeKeyDown=(e,t)=>{if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight"||!this.separatorIsAvailable(e))return;t.preventDefault(),this.hasAttribute("data-workspace-keyboard-adjusting")||this.suspendPreviewLayoutForWorkspaceResize();const i=(t.key==="ArrowLeft"?-1:1)*this.resizeStep(t.shiftKey),a=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,s=this.renderedWorkspaceWidths();this.applyWorkspaceResize(e,i,"keyboard",s.previewWidth,s.flyoutWidth,a,this.previewNavigationResizeAllowance(),(()=>{const o=this.workspaceLogicalGutterWidths();return o.leading+o.trailing})(),1,this.workspaceResizeDirection())},this.schedulePreviewLayout=(e=!1)=>{if(!this.isConnected||!this.hasUpdated||(this.previewOverlayRecoveryRequested||=e===!0,this.resizeSession||this.hasAttribute("data-workspace-keyboard-adjusting")||this.hasAttribute("data-workspace-position-held")))return;this.previewSyncGeneration+=1;const t=this.previewSyncGeneration;this.previewSyncRaf!==null&&cancelAnimationFrame(this.previewSyncRaf),this.previewSyncRaf=requestAnimationFrame(()=>{this.previewSyncRaf=null;const i=this.previewOverlayRecoveryRequested;this.previewOverlayRecoveryRequested=!1,this.previewSyncTask=this.previewSyncTask.then(()=>this.syncPreviewLayout(t,i)).catch(()=>{})})},this.onPreviewMediaChange=()=>this.schedulePreviewLayout(!0),this.onPreviewResize=e=>{let t=!1;for(const i of e){const a=i.contentRect.width;if(i.target instanceof HTMLElement&&i.target.classList.contains("esp-page-left")){a>h&&!this.hasAttribute("data-preview-navigation-collapsed")&&(this.previewCollapsedSidebarWidth=a);continue}const s=this.previewObservedWidths.get(i.target);this.previewObservedWidths.set(i.target,a),t||=s===void 0||Math.abs(s-a)>.25}t&&this.schedulePreviewLayout(!0)},this.kind="wide",this.align="start",this.contained=!1,this.headerPosition="normal",this.fixedMenus=!1,this.previewOpen=!1,this.previewLabel="Preview",this.previewCollapseSidebar=!1,this.workspaceResizable=!1,this.previewVisible=!1,this.previewReclaiming=!1,new q(this,".esp-page-left > .sticky-wrapper"),new q(this,".esp-page-right > .sticky-wrapper"),new q(this,".esp-page-flyout > .sticky-wrapper",{topOffset:()=>this.flyoutFullHeightActive?0:void 0}),new q(this,".esp-page-preview > .sticky-wrapper",{topOffset:()=>0}),this.addEventListener("flyout-state-changed",e=>this.syncFlyoutState(e))}connectedCallback(){const e=Array.from(this.children).filter(t=>t.getAttribute("slot")==="footer");this.footerWrapperIsLandmark=!e.some(t=>this.footerElementProvidesLandmark(t)),super.connectedCallback(),this.syncMainMaximumConfiguration(),this.hasUpdated&&queueMicrotask(()=>this.setupPreviewLayoutObserver())}disconnectedCallback(){this.finishWorkspaceKeyboardResize(!1),this.endWorkspaceResize(),this.clearWorkspaceRecenteringState(),this.previewResizeObserver?.disconnect(),this.previewResizeObserver=void 0,this.previewMediaQuery?.removeEventListener("change",this.onPreviewMediaChange),this.previewMediaQuery=void 0,this.previewSyncRaf!==null&&(cancelAnimationFrame(this.previewSyncRaf),this.previewSyncRaf=null),this.previewSyncGeneration+=1,this.previewOverlayRecoveryRequested=!1,this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1),this.toggleAttribute("data-workspace-keyboard-adjusting",!1),this.toggleAttribute("descendant-flyout-overlay-open",!1),this.clearFlyoutOverlayRecovery(),this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),this.preferredPreviewWidth=null,this.preferredFlyoutWidth=null,this.previewNavigationCollapseTask=null,this.setPreviewNavigationCollapse(!1),super.disconnectedCallback()}syncFlyoutState(e){if(e&&e.target?.closest?.("esp-page")!==this){this.syncDescendantFlyoutOverlayState();return}const t=r=>{const n=r;return(typeof n.mode=="string"?n.mode:r.getAttribute("mode"))==="overlay"||n.pageOverlayRequested===!0},i=r=>{const n=r.open;return typeof n=="boolean"?n:r.hasAttribute("open")},a=r=>r.anchor!=null,s=r=>{const n=r.fullHeight;return typeof n=="boolean"?n:r.hasAttribute("full-height")},o=(this.flyoutSlot.value?.assignedElements()??[]).filter(r=>r.tagName==="ESP-FLYOUT");for(const r of o){const n=r,d=typeof n.mode=="string"?n.mode:r.getAttribute("mode");n.pageOverlayRequested&&(!i(r)||d!=="auto")&&(n.pageOverlayRequested=!1)}o.some(r=>r.pageOverlayRequested===!0)||this.clearFlyoutOverlayRecovery(),this.toggleAttribute("flyout-open",o.some(r=>i(r)&&!t(r))),this.toggleAttribute("flyout-overlay-open",o.some(r=>i(r)&&t(r))),this.toggleAttribute("flyout-anchored",o.some(r=>i(r)&&a(r))),this.flyoutFullHeightActive=o.some(r=>i(r)&&!t(r)&&s(r)),this.toggleAttribute("flyout-full-height",this.flyoutFullHeightActive),this.resizeSession&&(this.hasAttribute("flyout-overlay-open")||this.resizeSession.separator==="preview-flyout"&&!this.hasAttribute("flyout-open"))&&this.endWorkspaceResize(),this.requestUpdate(),this.schedulePreviewLayout()}syncDescendantFlyoutOverlayState(){const e=Array.from(this.querySelectorAll("esp-flyout")).some(t=>{if(t.closest("esp-page")===this)return!1;const i=t,a=typeof i.open=="boolean"?i.open:t.hasAttribute("open"),s=typeof i.mode=="string"?i.mode:t.getAttribute("mode");return a&&(s==="overlay"||i.pageOverlayRequested===!0||t.getAttribute("aria-modal")==="true")});this.toggleAttribute("descendant-flyout-overlay-open",e)}assignedFlyouts(){return(this.flyoutSlot.value?.assignedElements()??[]).filter(e=>e.tagName==="ESP-FLYOUT")}openAutoFlyouts(){return this.assignedFlyouts().filter(e=>{const t=typeof e.open=="boolean"?e.open:e.hasAttribute("open"),i=typeof e.mode=="string"?e.mode:e.getAttribute("mode");return t&&i!=="overlay"})}async setPageFlyoutOverlay(e){let t=!1;const i=new Set(this.openAutoFlyouts());for(const a of this.assignedFlyouts()){const s=e&&i.has(a);a.pageOverlayRequested!==s&&(a.pageOverlayRequested=s,t=!0)}return t&&await Promise.all(this.assignedFlyouts().map(a=>a.updateComplete??Promise.resolve())),e||this.clearFlyoutOverlayRecovery(),t}clearFlyoutOverlayRecovery(){this.flyoutOverlayPromotionWidth=null,this.flyoutOverlayRecoveryReady=!1,this.flyoutOverlayRecoveryGeneration+=1}armFlyoutOverlayRecovery(){const e=++this.flyoutOverlayRecoveryGeneration;this.flyoutOverlayRecoveryReady=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e!==this.flyoutOverlayRecoveryGeneration||!this.openAutoFlyouts().some(t=>t.pageOverlayRequested===!0)||(this.flyoutOverlayPromotionWidth=this.visiblePageInlineBounds().width,this.flyoutOverlayRecoveryReady=!0)})})}previewHasContent(){const e=this.previewSlot.value?.assignedNodes({flatten:!0});return e?e.some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent?.trim().length??0)>0):Array.from(this.childNodes).some(t=>t instanceof Element&&t.getAttribute("slot")==="preview"&&!t.hasAttribute("hidden"))}getPreviewNavigationPair(){if(!this.previewCollapseSidebar)return null;const e=Array.from(this.children),t=e.find(o=>o.slot==="header"&&o.tagName==="ESP-HEADER"),i=e.find(o=>o.slot==="sidebar"&&o.tagName==="ESP-MENU");if(!t||!i||!i.id)return null;const a=typeof t.drawerTarget=="string"?t.drawerTarget:t.getAttribute("drawer-target")??"",s=typeof i.mode=="string"?i.mode:i.getAttribute("mode");return a!==i.id||s!=="vertical"||!("previewCollapseRequested"in t)||!("previewCollapseRequested"in i)?null:{header:t,menu:i}}async setPreviewNavigationCollapse(e){const t=e?this.getPreviewNavigationPair():null,i=t!==null&&this.previewHeader===t.header&&this.previewMenu===t.menu,a=this.previewHeader&&this.previewHeader!==t?.header?this.previewHeader:null,s=this.previewMenu&&this.previewMenu!==t?.menu?this.previewMenu:null;if(a&&(a.previewCollapseRequested=!1),s&&(s.previewCollapseRequested=!1),this.previewHeader=t?.header??null,this.previewMenu=t?.menu??null,this.toggleAttribute("data-preview-navigation-collapsed",!1),await a?.updateComplete,await s?.updateComplete,!t)return!1;const o=i?this.previewCollapsedSidebarWidth:this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0;return t.header.previewCollapseRequested=!0,t.menu.previewCollapseRequested=!0,await t.header.updateComplete,await t.menu.updateComplete,t.menu.hasExternalDrawerControl===!0?(this.previewCollapsedSidebarWidth=o,this.toggleAttribute("data-preview-navigation-collapsed",!0),!0):(t.header.previewCollapseRequested=!1,t.menu.previewCollapseRequested=!1,await t.header.updateComplete,await t.menu.updateComplete,this.previewHeader=null,this.previewMenu=null,!1)}requestPreviewNavigationCollapse(){if(this.hasAttribute("data-preview-navigation-collapsed")||this.previewNavigationCollapseTask)return;const e=this.setPreviewNavigationCollapse(!0);this.previewNavigationCollapseTask=e,e.then(()=>{this.previewNavigationCollapseTask===e&&(this.previewNavigationCollapseTask=null)},()=>{this.previewNavigationCollapseTask===e&&(this.previewNavigationCollapseTask=null)})}scheduleWorkspaceSettlement(e=null){const t=()=>{this.schedulePreviewLayout(),e&&requestAnimationFrame(()=>{this.previewSyncTask.then(()=>{const s=this.shadowRoot?.activeElement,o=this.ownerDocument.activeElement;!this.isConnected||!e.isConnected||s&&s!==e||o!==this&&o!==this.ownerDocument.body||getComputedStyle(e).display!=="none"&&e.focus({preventScroll:!0})})})},i=this.previewNavigationCollapseTask;if(!i){t();return}i.then(()=>t(),()=>t())}clearWorkspaceKeyboardSettlementTimer(){this.workspaceKeyboardSettlementTimer!==null&&(clearTimeout(this.workspaceKeyboardSettlementTimer),this.workspaceKeyboardSettlementTimer=null)}finishWorkspaceKeyboardResize(e=!0){this.clearWorkspaceKeyboardSettlementTimer();const t=this.hasAttribute("data-workspace-keyboard-adjusting");this.toggleAttribute("data-workspace-keyboard-adjusting",!1),t&&e&&!this.resizeSession&&this.scheduleWorkspaceSettlement()}deferWorkspaceKeyboardSettlement(){this.clearWorkspaceKeyboardSettlementTimer(),this.workspaceKeyboardSettlementTimer=setTimeout(()=>{if(this.workspaceKeyboardSettlementTimer=null,!this.hasAttribute("data-workspace-keyboard-adjusting"))return;const e=this.shadowRoot?.activeElement,t=e instanceof HTMLElement&&e.classList.contains("esp-page-workspace-resize-handle")?e:null;this.toggleAttribute("data-workspace-keyboard-adjusting",!1),this.resizeSession||this.scheduleWorkspaceSettlement(t)},ge)}suspendPreviewLayoutForWorkspaceResize(){this.previewSyncRaf!==null&&(cancelAnimationFrame(this.previewSyncRaf),this.previewSyncRaf=null),this.previewSyncGeneration+=1,this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1)}setPreviewLayoutState(e,t){this.previewVisible=e,this.previewReclaiming=e&&t,e||this.endWorkspaceResize()}setWorkspaceWidths(e,t,i=!1){const a=Math.max(0,e),s=Math.max(0,t);this.style.setProperty("--_esp-page-preview-used-width",`${a}px`),this.style.setProperty("--_esp-page-flyout-used-width",`${s}px`),this.toggleAttribute("data-workspace-targeted",i),this.allocatedPreviewWidth=a,this.allocatedFlyoutWidth=s}clampWidth(e,t,i){return Math.min(Math.max(e,t),Math.max(t,i))}visiblePageInlineBounds(){const e=this.getBoundingClientRect();let t=e.left,i=e.right;const a=window.visualViewport,s=a?.offsetLeft??0,o=a?.width??document.documentElement.clientWidth;o>0&&(t=Math.max(t,s),i=Math.min(i,s+o));const r=this.getRootNode();let n=this.parentElement??(r instanceof ShadowRoot?r.host:null);for(;n;){const d=getComputedStyle(n).overflowX;if(["auto","clip","hidden","scroll"].includes(d)){const p=n.getBoundingClientRect();t=Math.max(t,p.left),i=Math.min(i,p.right)}const m=n.getRootNode();n=n.parentElement??(m instanceof ShadowRoot?m.host:null)}return{left:t,right:i,width:Math.max(0,i-t)}}probeWidth(e){return e.value?.getBoundingClientRect().width??0}optionalWidth(e,t){return getComputedStyle(this).getPropertyValue(e).trim()===""?null:this.probeWidth(t)}syncMainMaximumConfiguration(){const e=getComputedStyle(this).getPropertyValue("--esp-page-main-max-width").trim()!=="";this.toggleAttribute("data-main-max-configured",e)}workspaceWidthCapacity(e,t,i=0){const a=this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,s=this.shadowRoot?.querySelector(".esp-page-right")?.getBoundingClientRect().width??0,o=Math.max(0,this.visiblePageInlineBounds().width-a-s-Math.max(0,i));return this.workspaceWidthCapacityForAvailable(o,e,t)}workspaceWidthCapacityForAvailable(e,t,i){const a=Math.max(0,e),s=i>0?Math.min(a,i):a;return{natural:Math.max(0,a-s),maximum:Math.max(0,a-Math.max(0,t))}}workspaceTargetWidth(e,t,i){return Math.min(e.maximum,Math.max(t,i,e.natural))}allocateWorkspaceWidths(e,t,i,a,s,o,r,n=null,d=null){const m=Math.max(0,e),p=Math.max(0,a),u=Math.max(p,s),y=Math.max(0,o),W=Math.max(y,r),v=t?this.preferredPreviewWidth??(n===null?null:this.clampWidth(n,p,u)):null,w=i?this.preferredFlyoutWidth??(d===null?null:this.clampWidth(d,y,W)):null;let c=0,l=0;t&&i?(c=Math.min(u,Math.max(p,m-y)),l=Math.min(W,Math.max(y,m-c))):t?c=Math.min(u,Math.max(p,m)):i&&(l=Math.min(W,Math.max(y,m))),t&&v!==null&&(c=this.clampWidth(v,p,u),i&&w===null&&(l=this.clampWidth(m-c,y,W))),i&&w!==null&&(l=this.clampWidth(w,y,W),t&&v===null&&(c=this.clampWidth(m-l,p,u)));let b=c+l-m;if(b>0&&i){const R=Math.min(b,Math.max(0,l-y));l-=R,b-=R}return b>0&&t&&(c-=Math.min(b,Math.max(0,c-p))),{previewWidth:c,flyoutWidth:l}}workspaceResizeDirection(){return getComputedStyle(this).direction==="rtl"?-1:1}trailingWorkspaceSeparator(){return this.hasAttribute("flyout-open")&&!this.hasAttribute("flyout-overlay-open")?"flyout-end":this.previewVisible?"preview-end":null}trailingWorkspacePane(){const e=this.trailingWorkspaceSeparator()==="flyout-end"?".esp-page-flyout":this.trailingWorkspaceSeparator()==="preview-end"?".esp-page-preview":null;return e?this.shadowRoot?.querySelector(e)??null:null}workspaceLogicalGutterWidths(){const e=Math.max(0,this.shadowRoot?.querySelector(".esp-page-canvas--left")?.getBoundingClientRect().width??0),t=this.trailingWorkspacePane();if(!t)return{leading:e,trailing:0};const i=this.visiblePageInlineBounds(),a=t.getBoundingClientRect(),s=this.workspaceResizeDirection()===1?i.right-a.right:a.left-i.left;return{leading:e,trailing:Math.max(0,s)}}syncTrailingWorkspaceResizeAvailability(){const{trailing:e}=this.workspaceLogicalGutterWidths();this.toggleAttribute("data-workspace-trailing-edge-exposed",this.trailingWorkspaceSeparator()!==null&&e>h)}trailingPaneResizeRange(e,t,i){const a=e==="preview-end"?this.previewMinWidthProbe:this.flyoutMinWidthProbe,s=e==="preview-end"?this.previewMaxWidthProbe:this.flyoutMaxWidthProbe,o=Math.max(0,this.probeWidth(a)),r=Math.max(o,this.probeWidth(s));return{minimum:o,maximum:Math.max(o,Math.min(r,Math.max(0,t)+Math.max(0,i)))}}resizeStep(e){const t=this.probeWidth(e?this.resizeLargeStepProbe:this.resizeStepProbe);return t>0?t:e?ue:ce}previewNavigationResizeAllowance(){if(this.hasAttribute("data-preview-navigation-collapsed")||this.getPreviewNavigationPair()===null)return 0;const e=Math.max(0,this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0);return e>h&&(this.previewCollapsedSidebarWidth=e),e>h?e:this.previewCollapsedSidebarWidth}renderedWorkspaceWidths(){const e=this.shadowRoot?.querySelector(".esp-page-preview"),t=this.shadowRoot?.querySelector(".esp-page-flyout");return{previewWidth:this.allocatedPreviewWidth>0?this.allocatedPreviewWidth:e?.getBoundingClientRect().width??0,flyoutWidth:this.allocatedFlyoutWidth>0?this.allocatedFlyoutWidth:t?.getBoundingClientRect().width??0}}mainPreviewResizeRange(e=this.renderedWorkspaceWidths().previewWidth,t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,i=this.previewNavigationResizeAllowance()){const a=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),s=Math.max(a,this.probeWidth(this.previewMaxWidthProbe)),o=Math.max(0,this.probeWidth(this.mainMinWidthProbe)),r=Math.max(0,t+e),n=Math.max(0,r+i-o);return{minimum:a,maximum:Math.max(a,Math.min(s,n))}}previewFlyoutResizeRange(e=this.renderedWorkspaceWidths().previewWidth,t=this.renderedWorkspaceWidths().flyoutWidth){const i=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),a=Math.max(i,this.probeWidth(this.previewMaxWidthProbe)),s=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),o=Math.max(s,this.probeWidth(this.flyoutMaxWidthProbe)),r=e+t;return{minimum:Math.max(i,r-o),maximum:Math.max(i,Math.min(a,r-s))}}separatorIsAvailable(e){return!this.workspaceResizable||this.hasAttribute("flyout-overlay-open")?!1:e==="main-preview"?this.previewVisible:e==="preview-end"||e==="flyout-end"?this.trailingWorkspaceSeparator()===e&&(this.hasAttribute("data-workspace-trailing-edge-exposed")||this.hasAttribute("data-workspace-position-held")||this.hasAttribute("data-workspace-keyboard-adjusting")):this.hasAttribute("flyout-open")}flyoutOnlyResizeRange(e=this.renderedWorkspaceWidths().flyoutWidth,t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0){const i=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),a=Math.max(i,this.probeWidth(this.flyoutMaxWidthProbe)),s=Math.max(0,this.probeWidth(this.mainMinWidthProbe)),o=this.probeWidth(this.mainMaxWidthProbe),r=Math.max(0,t+e),n=o>0?Math.max(0,r-o):0,d=Math.max(i,n);return{minimum:d,maximum:Math.max(d,Math.min(a,r-s))}}mainResizeGrowthCapacity(e){return this.kind==="full"&&!this.hasAttribute("data-main-max-configured")?Number.POSITIVE_INFINITY:Math.max(0,this.probeWidth(this.mainMaxWidthProbe)-e)}applyWorkspaceResize(e,t,i,a,s,o,r,n,d,m){if(!this.separatorIsAvailable(e))return;const p=t*m,u=n/d,y=e==="main-preview"||e==="preview-flyout"&&!this.previewVisible,W=i==="pointer"&&y&&p>0?Math.min(p,u,this.mainResizeGrowthCapacity(o)):0;let v=e,w=a,c=s;if(e==="preview-end"||e==="flyout-end"){const l=e==="preview-end"?a:s,b=this.trailingPaneResizeRange(e,l,n),R=l+(p>0?p*d:p),C=this.clampWidth(R,b.minimum,b.maximum);e==="preview-end"?(w=C,this.preferredPreviewWidth=C):(c=C,this.preferredFlyoutWidth=C)}else if(e==="main-preview"){const l=this.mainPreviewResizeRange(a,o,r),b=a-(p-W);w=this.clampWidth(b,l.minimum,l.maximum),this.preferredPreviewWidth=w;const R=Math.max(0,this.probeWidth(this.mainMinWidthProbe)),C=this.probeWidth(this.mainMaxWidthProbe),k=this.kind==="full"&&!this.hasAttribute("data-main-max-configured")?0:C,g=this.workspaceWidthCapacity(R,k);r>0&&w+c>g.natural+h&&this.requestPreviewNavigationCollapse();const F=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),A=Math.max(0,F-b),E=l.minimum<=F+h;if(A>0&&E&&s>0){const O=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),L=Math.max(O,this.probeWidth(this.flyoutMaxWidthProbe));c=this.clampWidth(s-A,O,L),this.preferredFlyoutWidth=c}else s>0&&(this.preferredFlyoutWidth??=s)}else if(this.previewVisible){const l=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),b=Math.max(l,this.probeWidth(this.previewMaxWidthProbe)),R=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),C=Math.max(R,this.probeWidth(this.flyoutMaxWidthProbe));if(p>=0){const k=Math.max(0,s-R),g=Math.min(p,u),F=Math.max(0,p-g),A=g*d+F,E=k+n;w=this.clampWidth(a+A,l,Math.min(b,a+E));const O=Math.max(0,w-a),L=Math.min(O,n);c=s-Math.min(Math.max(0,O-L),k)}else{const k=this.previewFlyoutResizeRange(a,s),g=a+p;w=this.clampWidth(g,k.minimum,k.maximum),c=a+s-w;const F=Math.max(0,l-g),A=k.minimum<=l+h;if(F>0&&A){const E=Math.max(0,this.probeWidth(this.mainMinWidthProbe)),O=Math.max(0,o-E);c=this.clampWidth(c+Math.min(F,O),R,C)}}this.preferredPreviewWidth=w,this.preferredFlyoutWidth=c}else{v="main-flyout";const l=this.flyoutOnlyResizeRange(s,o);c=this.clampWidth(s-(p-W),l.minimum,l.maximum),w=0,this.preferredFlyoutWidth=c}this.setWorkspaceWidths(w,c,!0),this.requestUpdate(),this.previewVisible&&this.setPreviewLayoutState(!0,!0),i==="keyboard"&&(this.toggleAttribute("data-workspace-keyboard-adjusting",!0),this.deferWorkspaceKeyboardSettlement()),this.dispatchEvent(new CustomEvent("esp-page-workspace-resize",{bubbles:!0,composed:!0,detail:{separator:v,source:i,previewWidth:w,flyoutWidth:c}}))}appliedSeparatorInlineDelta(e){if(e.separator==="preview-end"){const a=this.allocatedPreviewWidth-e.startPreviewWidth;return a>0?a/e.trailingExpansionScale:a}if(e.separator==="flyout-end"){const a=this.allocatedFlyoutWidth-e.startFlyoutWidth;return a>0?a/e.trailingExpansionScale:a}if(e.separator==="main-preview")return e.trailingGroupPushDelta+e.startPreviewWidth-this.allocatedPreviewWidth+(e.startFlyoutWidth-this.allocatedFlyoutWidth);const t=e.startFlyoutWidth-this.allocatedFlyoutWidth;if(!this.previewVisible)return e.trailingGroupPushDelta+t;if(this.allocatedPreviewWidth<e.startPreviewWidth)return t;const i=Math.max(0,this.allocatedPreviewWidth+this.allocatedFlyoutWidth-e.startPreviewWidth-e.startFlyoutWidth);return t+i/e.trailingExpansionScale}clearWorkspaceRecenteringState(){this.workspaceRecenteringRaf!==null&&(cancelAnimationFrame(this.workspaceRecenteringRaf),this.workspaceRecenteringRaf=null),this.workspaceRecenteringTimer!==null&&(clearTimeout(this.workspaceRecenteringTimer),this.workspaceRecenteringTimer=null),this.toggleAttribute("data-workspace-position-held",!1),this.style.removeProperty("--_esp-page-resize-leading-gutter-width")}holdWorkspacePosition(){const e=this.workspaceLogicalGutterWidths().leading;return this.clearWorkspaceRecenteringState(),this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${e}px`),this.toggleAttribute("data-workspace-position-held",!0),e}trackWorkspaceResizePointer(e){const t=e.startHandleClientX+this.appliedSeparatorInlineDelta(e)*e.direction;for(let i=0;i<3;i+=1){const a=e.target.getBoundingClientRect(),s=a.left+a.width/2,o=(t-s)*e.direction;if(Math.abs(o)<=.25)return;const r=Math.max(0,e.heldLeadingGutterWidth+o);if(Math.abs(r-e.heldLeadingGutterWidth)<=.25)return;e.heldLeadingGutterWidth=r,this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${e.heldLeadingGutterWidth}px`)}}seedWorkspaceResizeLeadingGutter(e){if(this.align==="start")return!1;const t=this.appliedSeparatorInlineDelta(e);if(t<=0)return!1;let i=0;if(e.separator==="preview-end"||e.separator==="flyout-end")i=this.allocatedPreviewWidth-e.startPreviewWidth+this.allocatedFlyoutWidth-e.startFlyoutWidth;else if(e.separator==="preview-flyout"&&this.previewVisible)i=this.allocatedPreviewWidth-e.startPreviewWidth;else{const a=Math.max(0,e.startPreviewWidth-this.allocatedPreviewWidth+e.startFlyoutWidth-this.allocatedFlyoutWidth),s=this.probeWidth(this.mainMaxWidthProbe),o=this.kind==="full"&&!this.hasAttribute("data-main-max-configured")?Number.POSITIVE_INFINITY:Math.max(0,s-e.startMainWidth);i=Math.min(e.trailingGroupPushDelta+a,o)}return e.heldLeadingGutterWidth=Math.max(0,e.startLeadingGutterWidth+t-i),this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${e.heldLeadingGutterWidth}px`),!0}finishWorkspaceRecentering(){this.clearWorkspaceRecenteringState(),this.syncTrailingWorkspaceResizeAvailability(),this.isConnected&&this.scheduleWorkspaceSettlement()}beginWorkspaceRecentering(){const e=this.workspaceLogicalGutterWidths(),t=e.leading+e.trailing,i=this.align==="center"?t/2:this.align==="end"?t:0;if(Math.abs(i-e.leading)<=h){this.finishWorkspaceRecentering();return}this.workspaceRecenteringRaf=requestAnimationFrame(()=>{this.workspaceRecenteringRaf=null,!(this.resizeSession||!this.hasAttribute("data-workspace-position-held"))&&(this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${i}px`),this.workspaceRecenteringTimer=setTimeout(()=>this.finishWorkspaceRecentering(),me+ve))})}endWorkspaceResize(){const e=this.resizeSession;this.resizeSession=null,this.toggleAttribute("data-workspace-resizing",!1),e?.target.hasPointerCapture?.(e.pointerId)&&e.target.releasePointerCapture(e.pointerId),e&&this.beginWorkspaceRecentering()}previewFitsWithinPage(e,t,i,a,s,o){const r=this.shadowRoot?.querySelector(".esp-page-main"),n=this.shadowRoot?.querySelector(".esp-page-preview"),d=this.shadowRoot?.querySelector(".esp-page-flyout");if(!r||!n||!d)return!1;const m=this.visiblePageInlineBounds(),p=r.getBoundingClientRect(),u=n.getBoundingClientRect(),y=d.getBoundingClientRect(),W=Math.max(t,i),v=Math.max(s,o),w=u.width+h>=t&&u.width<=W+h,c=!a||y.width+h>=s&&y.width<=v+h,l=u.left+h>=m.left&&u.right<=m.right+h&&(!a||y.left+h>=m.left&&y.right<=m.right+h),b=getComputedStyle(this).direction==="rtl"?p.left+h>=u.right&&(!a||u.left+h>=y.right):p.right<=u.left+h&&(!a||u.right<=y.left+h);return p.width+h>=e&&w&&c&&l&&b}flyoutFitsWithinPage(e,t,i){const a=this.shadowRoot?.querySelector(".esp-page-main"),s=this.shadowRoot?.querySelector(".esp-page-flyout");if(!a||!s)return!1;const o=this.visiblePageInlineBounds(),r=a.getBoundingClientRect(),n=s.getBoundingClientRect(),d=Math.max(t,i),m=n.width+h>=t&&n.width<=d+h,p=n.left+h>=o.left&&n.right<=o.right+h,u=getComputedStyle(this).direction==="rtl"?r.left+h>=n.right:r.right<=n.left+h;return r.width+h>=e&&m&&p&&u}workspaceMinimumsCanFit(e,t,i,a,s){const o=this.visiblePageInlineBounds().width;if(o<=0||e<=0||t&&i<=0||a&&s<=0)return!1;const r=this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,n=this.shadowRoot?.querySelector(".esp-page-right")?.getBoundingClientRect().width??0,m=(t&&this.getPreviewNavigationPair()!==null?0:r)+n+e+(t?i:0)+(a?s:0);return o+h>=m}workspaceGeometrySample(){const e=this.visiblePageInlineBounds(),t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect(),i=this.shadowRoot?.querySelector(".esp-page-preview")?.getBoundingClientRect(),a=this.shadowRoot?.querySelector(".esp-page-flyout")?.getBoundingClientRect();return[e.left,e.right,e.width,t?.left??0,t?.right??0,t?.width??0,i?.left??0,i?.right??0,i?.width??0,a?.left??0,a?.right??0,a?.width??0]}workspaceGeometryMatches(e,t){return e.length===t.length&&e.every((i,a)=>Math.abs(i-(t[a]??i))<=h)}workspaceCandidateIsMeasurable(e,t){const i=this.shadowRoot?.querySelector(".esp-page-preview")?.getBoundingClientRect().width??0,a=this.shadowRoot?.querySelector(".esp-page-flyout")?.getBoundingClientRect().width??0;return(!e||i>h)&&(!t||a>h)}async candidateFitsAfterLayoutSettles(e,t,i){if(await this.updateComplete,e!==this.previewSyncGeneration||!this.isConnected)return null;let a=null,s=0;for(let o=0;o<he;o+=1){if(await new Promise(n=>requestAnimationFrame(()=>n())),e!==this.previewSyncGeneration||!this.isConnected)return null;if(t())return!0;if(!i()){a=null,s=0;continue}const r=this.workspaceGeometrySample();if(s=a&&this.workspaceGeometryMatches(a,r)?s+1:1,s>=le)return!1;a=r}return null}async promoteFlyoutIfClipped(e,t,i,a){if(i<=0)return!1;const s=await this.candidateFitsAfterLayoutSettles(e,()=>this.flyoutFitsWithinPage(t,i,a),()=>this.workspaceCandidateIsMeasurable(!1,!0));return s===null?!0:s?!1:(await this.promoteFlyoutToOverlay(),!0)}async promoteFlyoutToOverlay(){this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),this.flyoutOverlayPromotionWidth===null&&(this.flyoutOverlayPromotionWidth=this.visiblePageInlineBounds().width,this.armFlyoutOverlayRecovery()),await this.setPageFlyoutOverlay(!0)}async syncPreviewLayout(e,t=!0){if(e!==this.previewSyncGeneration||!this.isConnected||this.resizeSession||this.hasAttribute("data-workspace-keyboard-adjusting")||this.hasAttribute("data-workspace-position-held"))return;let i=!1;const a=this.previewVisible;this.toggleAttribute("data-preview-measuring",!0);try{const s=this.previewOpen&&this.previewHasContent(),o=this.previewMediaQuery?.matches??!1,r=this.hasAttribute("flyout-overlay-open"),n=this.hasAttribute("flyout-open"),d=this.hasAttribute("data-preview-navigation-collapsed"),m=this.getPreviewNavigationPair(),p=m===null?0:d?this.previewCollapsedSidebarWidth:this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,u=this.probeWidth(this.previewMinWidthProbe),y=this.optionalWidth("--esp-page-preview-default-width",this.previewDefaultWidthProbe),W=this.probeWidth(this.previewMaxWidthProbe),v=this.probeWidth(this.flyoutMinWidthProbe),w=this.optionalWidth("--esp-page-flyout-default-width",this.flyoutDefaultWidthProbe),c=this.probeWidth(this.flyoutMaxWidthProbe),l=this.probeWidth(this.mainMinWidthProbe);this.syncMainMaximumConfiguration();const b=this.probeWidth(this.mainMaxWidthProbe),R=this.kind==="full"&&!this.hasAttribute("data-main-max-configured")?0:b,C=this.openAutoFlyouts().some(S=>S.pageOverlayRequested===!0);if(this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),C){const S=this.visiblePageInlineBounds().width,T=this.flyoutOverlayPromotionWidth===null||S>=this.flyoutOverlayPromotionWidth+pe;!o&&t&&this.flyoutOverlayRecoveryReady&&T&&this.workspaceMinimumsCanFit(l,s,u,!0,v)?await this.setPageFlyoutOverlay(!1):o&&await this.setPageFlyoutOverlay(!1);return}if(await this.updateComplete,e!==this.previewSyncGeneration)return;const k=s&&!o&&!r,g=n&&!o;if(l>0&&(!k||u>0)&&(!g||v>0)&&(k||g)&&!this.workspaceMinimumsCanFit(l,k,u,g,v)){g&&await this.promoteFlyoutToOverlay();return}const A=(k?u:0)+(g?v:0),L=k&&this.preferredPreviewWidth!==null||g&&this.preferredFlyoutWidth!==null||(k&&y!==null||g&&w!==null),H=(k?this.preferredPreviewWidth===null?u:this.clampWidth(this.preferredPreviewWidth,u,W):0)+(g?this.preferredFlyoutWidth===null?v:this.clampWidth(this.preferredFlyoutWidth,v,c):0),f=S=>{const T=this.workspaceTargetWidth(S,A,H),B=this.allocateWorkspaceWidths(T,k,g,u,W,v,c,y,w),V=S.maximum+l,X=Math.max(0,V-S.natural),te=B.previewWidth+B.flyoutWidth,Q=Math.max(0,Math.min(X,V-te));return{allocation:B,mainWidth:Q,reclaimsMain:Q+h<X}},D=(S,T)=>Math.abs(S.mainWidth-T.mainWidth)>h||Math.abs(S.allocation.previewWidth-T.allocation.previewWidth)>h||Math.abs(S.allocation.flyoutWidth-T.allocation.flyoutWidth)>h,N=this.workspaceWidthCapacity(l,R,d?p:0),I=f(N);let $=I.allocation;if(this.setWorkspaceWidths($.previewWidth,$.flyoutWidth,L),!k||u<=0){g&&await this.promoteFlyoutIfClipped(e,l,v,c);return}if(m!==null&&p>h){const S=N.maximum+l,T=this.workspaceWidthCapacityForAvailable(S+p,l,R),B=f(T);(d?D(f(this.workspaceWidthCapacityForAvailable(Math.max(0,S-de),l,R)),B):I.reclaimsMain&&D(I,B))?i=await this.setPreviewNavigationCollapse(!0):await this.setPreviewNavigationCollapse(!1)}else await this.setPreviewNavigationCollapse(!1);if(e!==this.previewSyncGeneration)return;const j=this.workspaceWidthCapacity(l,R);if(j.maximum+h<A){this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,g?v:0),i=!1,g&&await this.promoteFlyoutToOverlay();return}const U=f(j);if($=U.allocation,this.setWorkspaceWidths($.previewWidth,$.flyoutWidth,L),a||this.toggleAttribute("data-preview-validating",!0),this.setPreviewLayoutState(!0,U.reclaimsMain),await this.updateComplete,e!==this.previewSyncGeneration)return;const Y=await this.candidateFitsAfterLayoutSettles(e,()=>this.previewFitsWithinPage(l,u,W,g,v,c),()=>this.workspaceCandidateIsMeasurable(!0,g));if(Y===null)return;Y?this.toggleAttribute("data-preview-validating",!1):(this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,g?v:0),i=!1,g&&await this.promoteFlyoutToOverlay())}finally{e===this.previewSyncGeneration&&!i&&await this.setPreviewNavigationCollapse(!1),e===this.previewSyncGeneration&&(this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1),this.syncTrailingWorkspaceResizeAvailability(),this.requestUpdate())}}setupPreviewLayoutObserver(){if(this.isConnected){if(!this.previewMediaQuery&&typeof window.matchMedia=="function"&&(this.previewMediaQuery=window.matchMedia(ne),this.previewMediaQuery.addEventListener("change",this.onPreviewMediaChange)),!this.previewResizeObserver&&typeof ResizeObserver<"u"){this.previewResizeObserver=new ResizeObserver(this.onPreviewResize),this.previewResizeObserver.observe(this);const e=this.shadowRoot?.querySelector(".esp-page-left");e&&this.previewResizeObserver.observe(e);for(const t of[this.previewMinWidthProbe,this.previewDefaultWidthProbe,this.previewMaxWidthProbe,this.flyoutMinWidthProbe,this.flyoutDefaultWidthProbe,this.flyoutMaxWidthProbe,this.mainMinWidthProbe,this.mainConfiguredMaxWidthProbe,this.mainMaxWidthProbe,this.resizeStepProbe,this.resizeLargeStepProbe])t.value&&this.previewResizeObserver.observe(t.value)}this.schedulePreviewLayout(!0)}}footerElementProvidesLandmark(e){return e.matches(ee)||e.querySelector(ee)!==null}syncFooterLandmark(){const t=(this.footerSlot.value?.assignedElements({flatten:!0})??[]).some(i=>this.footerElementProvidesLandmark(i));this.footerWrapperIsLandmark=!t}showPreview(){this.previewOpen=!0}closePreview(){this.previewOpen=!1}togglePreview(){this.previewOpen=!this.previewOpen}AddDialog(e){this.dialogZone.value?.appendChild(e)}firstUpdated(e){super.firstUpdated(e),this.syncFlyoutState(),this.setupPreviewLayoutObserver()}updated(e){super.updated(e),(e.has("fixedMenus")||e.has("headerPosition"))&&oe().publish("fixed-menus-changed",{fixed:this.fixedMenus||this.headerPosition==="fixed"}),(e.has("previewOpen")||e.has("previewCollapseSidebar")||e.has("align"))&&this.schedulePreviewLayout(!0),e.has("workspaceResizable")&&!this.workspaceResizable&&(this.finishWorkspaceKeyboardResize(),this.endWorkspaceResize(),this.clearWorkspaceRecenteringState())}render(){const e=this.fixedMenus||this.headerPosition==="fixed",t=!e&&this.headerPosition==="sticky",i=this.mainPreviewResizeRange(),a=Math.max(0,this.probeWidth(this.previewMinWidthProbe)),s=Math.max(0,this.probeWidth(this.flyoutMinWidthProbe)),o=Math.max(s,this.probeWidth(this.flyoutMaxWidthProbe)),r=Math.max(0,this.probeWidth(this.mainMinWidthProbe)),n=this.probeWidth(this.mainMaxWidthProbe),d=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,m=this.hasAttribute("flyout-open"),p=d+this.allocatedPreviewWidth,u=i.minimum<=a+h,y=m&&u?Math.max(0,this.allocatedFlyoutWidth-s):0,W=Math.max(r,p-i.maximum),v=Math.max(W,Math.max(r,p-i.minimum)+y),w=n>0?Math.max(W,Math.min(Math.max(r,n),v)):v,c=n>0&&d+h>=n?`${Math.round(d)}px main, ${Math.round(this.allocatedPreviewWidth)}px preview`:Z;let l,b;if(this.previewVisible){const f=this.previewFlyoutResizeRange(),D=this.allocatedPreviewWidth+this.allocatedFlyoutWidth,I=f.minimum<=a+h?Math.max(0,d-r):0;l=Math.max(s,D-f.maximum),b=Math.max(l,Math.min(o,D-f.minimum+I))}else{const f=this.flyoutOnlyResizeRange();l=f.minimum,b=f.maximum}const R=this.previewVisible?"preview-flyout-resize-handle":"main-flyout-resize-handle",C=this.previewVisible?"Resize preview and help panes":"Resize help pane",k=this.previewVisible?`${Math.round(this.allocatedPreviewWidth)}px preview, ${Math.round(this.allocatedFlyoutWidth)}px help`:`${Math.round(this.allocatedFlyoutWidth)}px help`,g=m?"flyout-end":"preview-end",F=g==="flyout-end"?this.allocatedFlyoutWidth:this.allocatedPreviewWidth,A=this.workspaceLogicalGutterWidths(),E=this.trailingPaneResizeRange(g,F,A.leading+A.trailing),O=g==="flyout-end"?"flyout-end-resize-handle":"preview-end-resize-handle",L=g==="flyout-end"?"Resize help pane from its outer edge":"Resize preview pane from its outer edge";return ae`
|
|
2
|
+
<div part="wrapper" class="esp-page ${re({"fixed-menus":e,"fixed-header":e,"sticky-header":t})}">
|
|
3
3
|
<div part="canvas" class="esp-page-canvas esp-page-canvas--left" aria-hidden="true"></div>
|
|
4
4
|
<div part="canvas" class="esp-page-canvas esp-page-canvas--right" aria-hidden="true"></div>
|
|
5
5
|
<div part="surface" class="esp-page-surface" aria-hidden="true"></div>
|
|
@@ -23,7 +23,7 @@ var R=function(A,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnP
|
|
|
23
23
|
<div class="sticky-wrapper">
|
|
24
24
|
<slot
|
|
25
25
|
name="flyout"
|
|
26
|
-
${
|
|
26
|
+
${P(this.flyoutSlot)}
|
|
27
27
|
@slotchange=${()=>this.syncFlyoutState()}
|
|
28
28
|
></slot>
|
|
29
29
|
</div>
|
|
@@ -31,64 +31,64 @@ var R=function(A,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnP
|
|
|
31
31
|
<div
|
|
32
32
|
class="esp-page-preview-width-probe esp-page-preview-min-width-probe"
|
|
33
33
|
aria-hidden="true"
|
|
34
|
-
${
|
|
34
|
+
${P(this.previewMinWidthProbe)}
|
|
35
35
|
></div>
|
|
36
36
|
<div
|
|
37
37
|
class="esp-page-preview-default-width-probe"
|
|
38
38
|
aria-hidden="true"
|
|
39
|
-
${
|
|
39
|
+
${P(this.previewDefaultWidthProbe)}
|
|
40
40
|
></div>
|
|
41
41
|
<div
|
|
42
42
|
class="esp-page-preview-max-width-probe"
|
|
43
43
|
aria-hidden="true"
|
|
44
|
-
${
|
|
44
|
+
${P(this.previewMaxWidthProbe)}
|
|
45
45
|
></div>
|
|
46
46
|
<div
|
|
47
47
|
class="esp-page-flyout-min-width-probe"
|
|
48
48
|
aria-hidden="true"
|
|
49
|
-
${
|
|
49
|
+
${P(this.flyoutMinWidthProbe)}
|
|
50
50
|
></div>
|
|
51
51
|
<div
|
|
52
52
|
class="esp-page-flyout-default-width-probe"
|
|
53
53
|
aria-hidden="true"
|
|
54
|
-
${
|
|
54
|
+
${P(this.flyoutDefaultWidthProbe)}
|
|
55
55
|
></div>
|
|
56
56
|
<div
|
|
57
57
|
class="esp-page-flyout-max-width-probe"
|
|
58
58
|
aria-hidden="true"
|
|
59
|
-
${
|
|
59
|
+
${P(this.flyoutMaxWidthProbe)}
|
|
60
60
|
></div>
|
|
61
61
|
<div
|
|
62
62
|
class="esp-page-preview-main-min-probe esp-page-main-min-width-probe"
|
|
63
63
|
aria-hidden="true"
|
|
64
|
-
${
|
|
64
|
+
${P(this.mainMinWidthProbe)}
|
|
65
65
|
></div>
|
|
66
66
|
<div
|
|
67
67
|
class="esp-page-main-configured-max-width-probe"
|
|
68
68
|
aria-hidden="true"
|
|
69
|
-
${
|
|
69
|
+
${P(this.mainConfiguredMaxWidthProbe)}
|
|
70
70
|
></div>
|
|
71
71
|
<div
|
|
72
72
|
class="esp-page-main-max-width-probe"
|
|
73
73
|
aria-hidden="true"
|
|
74
|
-
${
|
|
74
|
+
${P(this.mainMaxWidthProbe)}
|
|
75
75
|
></div>
|
|
76
76
|
<div
|
|
77
77
|
class="esp-page-resize-step-probe"
|
|
78
78
|
aria-hidden="true"
|
|
79
|
-
${
|
|
79
|
+
${P(this.resizeStepProbe)}
|
|
80
80
|
></div>
|
|
81
81
|
<div
|
|
82
82
|
class="esp-page-resize-large-step-probe"
|
|
83
83
|
aria-hidden="true"
|
|
84
|
-
${
|
|
84
|
+
${P(this.resizeLargeStepProbe)}
|
|
85
85
|
></div>
|
|
86
|
-
<div class="esp-page-preview-space" ${
|
|
86
|
+
<div class="esp-page-preview-space" ${P(this.previewSpace)}>
|
|
87
87
|
<aside part="preview" class="esp-page-preview" aria-label=${this.previewLabel}>
|
|
88
88
|
<div part="preview-content" class="sticky-wrapper">
|
|
89
89
|
<slot
|
|
90
90
|
name="preview"
|
|
91
|
-
${
|
|
91
|
+
${P(this.previewSlot)}
|
|
92
92
|
@slotchange=${this.schedulePreviewLayout}
|
|
93
93
|
></slot>
|
|
94
94
|
</div>
|
|
@@ -101,44 +101,64 @@ var R=function(A,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnP
|
|
|
101
101
|
role="separator"
|
|
102
102
|
aria-orientation="vertical"
|
|
103
103
|
aria-label="Resize main pane"
|
|
104
|
-
aria-valuemin=${Math.round(
|
|
105
|
-
aria-valuemax=${Math.round(
|
|
106
|
-
aria-valuenow=${Math.round(
|
|
104
|
+
aria-valuemin=${Math.round(W)}
|
|
105
|
+
aria-valuemax=${Math.round(w)}
|
|
106
|
+
aria-valuenow=${Math.round(d)}
|
|
107
|
+
aria-valuetext=${c}
|
|
107
108
|
tabindex="0"
|
|
108
|
-
@pointerdown=${
|
|
109
|
+
@pointerdown=${f=>this.onWorkspaceResizePointerDown("main-preview",f)}
|
|
109
110
|
@pointermove=${this.onWorkspaceResizePointerMove}
|
|
110
111
|
@pointerup=${this.onWorkspaceResizePointerEnd}
|
|
111
112
|
@pointercancel=${this.onWorkspaceResizePointerEnd}
|
|
112
113
|
@lostpointercapture=${this.onWorkspaceResizePointerEnd}
|
|
113
|
-
@keydown=${
|
|
114
|
+
@keydown=${f=>this.onWorkspaceResizeKeyDown("main-preview",f)}
|
|
114
115
|
@blur=${this.onWorkspaceResizeBlur}
|
|
115
116
|
></div>
|
|
116
117
|
<div
|
|
117
|
-
part=${
|
|
118
|
+
part=${R}
|
|
118
119
|
class="esp-page-workspace-resize-handle esp-page-preview-flyout-resize-handle"
|
|
119
120
|
role="separator"
|
|
120
121
|
aria-orientation="vertical"
|
|
121
|
-
aria-label=${
|
|
122
|
-
aria-valuemin=${Math.round(
|
|
123
|
-
aria-valuemax=${Math.round(
|
|
122
|
+
aria-label=${C}
|
|
123
|
+
aria-valuemin=${Math.round(l)}
|
|
124
|
+
aria-valuemax=${Math.round(b)}
|
|
124
125
|
aria-valuenow=${Math.round(this.allocatedFlyoutWidth)}
|
|
126
|
+
aria-valuetext=${k}
|
|
127
|
+
tabindex="0"
|
|
128
|
+
@pointerdown=${f=>this.onWorkspaceResizePointerDown("preview-flyout",f)}
|
|
129
|
+
@pointermove=${this.onWorkspaceResizePointerMove}
|
|
130
|
+
@pointerup=${this.onWorkspaceResizePointerEnd}
|
|
131
|
+
@pointercancel=${this.onWorkspaceResizePointerEnd}
|
|
132
|
+
@lostpointercapture=${this.onWorkspaceResizePointerEnd}
|
|
133
|
+
@keydown=${f=>this.onWorkspaceResizeKeyDown("preview-flyout",f)}
|
|
134
|
+
@blur=${this.onWorkspaceResizeBlur}
|
|
135
|
+
></div>
|
|
136
|
+
<div
|
|
137
|
+
part=${O}
|
|
138
|
+
class="esp-page-workspace-resize-handle esp-page-workspace-end-resize-handle"
|
|
139
|
+
role="separator"
|
|
140
|
+
aria-orientation="vertical"
|
|
141
|
+
aria-label=${L}
|
|
142
|
+
aria-valuemin=${Math.round(E.minimum)}
|
|
143
|
+
aria-valuemax=${Math.round(E.maximum)}
|
|
144
|
+
aria-valuenow=${Math.round(F)}
|
|
125
145
|
tabindex="0"
|
|
126
|
-
@pointerdown=${
|
|
146
|
+
@pointerdown=${f=>this.onWorkspaceResizePointerDown(g,f)}
|
|
127
147
|
@pointermove=${this.onWorkspaceResizePointerMove}
|
|
128
148
|
@pointerup=${this.onWorkspaceResizePointerEnd}
|
|
129
149
|
@pointercancel=${this.onWorkspaceResizePointerEnd}
|
|
130
150
|
@lostpointercapture=${this.onWorkspaceResizePointerEnd}
|
|
131
|
-
@keydown=${
|
|
151
|
+
@keydown=${f=>this.onWorkspaceResizeKeyDown(g,f)}
|
|
132
152
|
@blur=${this.onWorkspaceResizeBlur}
|
|
133
153
|
></div>
|
|
134
154
|
</div>
|
|
135
|
-
<div class="esp-page-footer" role=${this.footerWrapperIsLandmark?"contentinfo":
|
|
136
|
-
<slot name="footer" ${
|
|
155
|
+
<div class="esp-page-footer" role=${this.footerWrapperIsLandmark?"contentinfo":Z}>
|
|
156
|
+
<slot name="footer" ${P(this.footerSlot)} @slotchange=${this.syncFooterLandmark}></slot>
|
|
137
157
|
</div>
|
|
138
|
-
<div id="dialog-drop-zone" ${
|
|
158
|
+
<div id="dialog-drop-zone" ${P(this.dialogZone)}></div>
|
|
139
159
|
<esp-toaster></esp-toaster>
|
|
140
160
|
</div>
|
|
141
|
-
`}};
|
|
161
|
+
`}};x.styles=[...J.styles,ie`
|
|
142
162
|
:host {
|
|
143
163
|
--_esp-page-resolved-max-width: var(
|
|
144
164
|
--esp-page-main-max-width,
|
|
@@ -296,11 +316,20 @@ var R=function(A,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnP
|
|
|
296
316
|
}
|
|
297
317
|
|
|
298
318
|
|
|
299
|
-
:host([flyout-anchored]
|
|
319
|
+
:host([flyout-anchored]:not([flyout-full-height]))
|
|
320
|
+
.esp-page
|
|
321
|
+
> div.esp-page-flyout
|
|
322
|
+
> .sticky-wrapper {
|
|
300
323
|
position: static;
|
|
301
324
|
}
|
|
302
325
|
|
|
303
326
|
|
|
327
|
+
:host([flyout-full-height]) .esp-page > div.esp-page-flyout {
|
|
328
|
+
grid-row: top-start / footer-end;
|
|
329
|
+
z-index: calc(var(--esp-page-header-z-index, 20) + 2);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
|
|
304
333
|
:host([flyout-anchored][preview-visible]) .esp-page > div.esp-page-flyout {
|
|
305
334
|
z-index: calc(var(--esp-page-header-z-index, 20) + 2);
|
|
306
335
|
}
|
|
@@ -403,6 +432,23 @@ var R=function(A,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnP
|
|
|
403
432
|
display: block;
|
|
404
433
|
}
|
|
405
434
|
|
|
435
|
+
:host([workspace-resizable][data-workspace-trailing-edge-exposed]:not([flyout-overlay-open]))
|
|
436
|
+
.esp-page
|
|
437
|
+
> div.esp-page-workspace-resize-handles
|
|
438
|
+
> .esp-page-workspace-end-resize-handle,
|
|
439
|
+
:host([workspace-resizable][data-workspace-position-held]:not([flyout-overlay-open]))
|
|
440
|
+
.esp-page
|
|
441
|
+
> div.esp-page-workspace-resize-handles
|
|
442
|
+
> .esp-page-workspace-end-resize-handle {
|
|
443
|
+
display: block;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
:host([data-workspace-position-held]) {
|
|
448
|
+
--_esp-page-gutter-left: var(--_esp-page-resize-leading-gutter-width, 0px);
|
|
449
|
+
--_esp-page-gutter-right: 1fr;
|
|
450
|
+
}
|
|
451
|
+
|
|
406
452
|
:host([data-workspace-resizing]) {
|
|
407
453
|
cursor: col-resize;
|
|
408
454
|
user-select: none;
|
|
@@ -609,6 +655,12 @@ var R=function(A,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnP
|
|
|
609
655
|
inset-inline-start: var(--_esp-page-preview-used-width);
|
|
610
656
|
}
|
|
611
657
|
|
|
658
|
+
> div.esp-page-workspace-resize-handles > .esp-page-workspace-end-resize-handle {
|
|
659
|
+
inset-inline-start: calc(
|
|
660
|
+
var(--_esp-page-preview-used-width) + var(--_esp-page-flyout-used-width)
|
|
661
|
+
);
|
|
662
|
+
}
|
|
663
|
+
|
|
612
664
|
|
|
613
665
|
> .esp-page-preview-min-width-probe,
|
|
614
666
|
> .esp-page-preview-default-width-probe,
|
|
@@ -822,4 +874,4 @@ var R=function(A,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnP
|
|
|
822
874
|
transition: none;
|
|
823
875
|
}
|
|
824
876
|
}
|
|
825
|
-
`],
|
|
877
|
+
`],z([K()],x.prototype,"footerWrapperIsLandmark",void 0),z([K()],x.prototype,"allocatedPreviewWidth",void 0),z([K()],x.prototype,"allocatedFlyoutWidth",void 0),z([_({reflect:!0})],x.prototype,"kind",void 0),z([_({reflect:!0})],x.prototype,"align",void 0),z([_({type:Boolean,reflect:!0})],x.prototype,"contained",void 0),z([_({attribute:"header-position",reflect:!0})],x.prototype,"headerPosition",void 0),z([_({attribute:"fixed-menus",type:Boolean,reflect:!0})],x.prototype,"fixedMenus",void 0),z([_({attribute:"preview-open",type:Boolean,reflect:!0})],x.prototype,"previewOpen",void 0),z([_({attribute:"preview-label",type:String,reflect:!0})],x.prototype,"previewLabel",void 0),z([_({attribute:"preview-collapse-sidebar",type:Boolean,reflect:!0})],x.prototype,"previewCollapseSidebar",void 0),z([_({attribute:"workspace-resizable",type:Boolean,reflect:!0})],x.prototype,"workspaceResizable",void 0),z([_({attribute:"preview-visible",type:Boolean,reflect:!0})],x.prototype,"previewVisible",void 0),z([_({attribute:"preview-reclaiming",type:Boolean,reflect:!0})],x.prototype,"previewReclaiming",void 0),x=z([se("esp-page")],x);export{x as EspalierPage};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taprootio/espalier",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"packageManager": "bun@1.3.12",
|
|
5
5
|
"description": "Espalier — a themeable, accessible, framework-agnostic, enterprise-grade design system built on web standards and love.",
|
|
6
6
|
"customElements": "custom-elements.json",
|