Problem: the hexagonal refactor churns the backend tree for nine more phases; the UI delivery stack (web/ SPA, cmd/desktop Wails wrapper, compose/web image) must move to its own repo first so doc/layout rewrites land once on a backend-only tree. Change: - New repo git.hubris.network/dtoro/oikos-web (v0.33.0): web/, desktop/ (updateURL repointed to oikos-web releases), compose/, own CI (web + desktop jobs), own deploy script (CI-green gate, TOCTOU guard, version-tagged images, prune-to-3), own webhook receiver on :9798 + launchd unit, own compose project publishing the same 8091:80. - Cutover executed on mac-mini in order: oikos stack's web service stopped+removed, oikos-web project brought up on 8091; outer Caddy untouched (targets the published port) — serving + Authentik flow + /wails 404 quirk verified post-cutover. - Stripped from oikos: web/, cmd/desktop/, compose/web/, desktop CI workflow, ci.yml web job, Makefile ui/desktop/desktop-package/install targets, the compose web service, oikos-web from deploy.sh's fallback prune list; wails + go-keyring dropped from go.mod, vendor synced. - README / CONTRIBUTING / AGENTS.md / .agents dev+operations docs now point at the new repo; mbse + mascot design docs carry a path note. Risk: production SPA serving depends on the new pipeline now; rollback is versioned-image re-up of the old web service from a pre-split checkout (port 8091). Desktop builds installed before the split still check dtoro/oikos releases — one manual reinstall, noted in the oikos-web release notes. Verification: go vet, make test (race), make generate-check, golangci (no new findings; baseline down 400→365); post-cutover curls — localhost:8091 200, /wails/runtime.js 404, outer Caddy 302 Authentik.
2 lines
9.6 KiB
JavaScript
2 lines
9.6 KiB
JavaScript
import{rectToClientRect as t,arrow as e,autoPlacement as n,detectOverflow as o,flip as i,hide as r,inline as c,limitShift as l,offset as s,shift as f,size as u,computePosition as a}from"@floating-ui/core";const h=Math.min,d=Math.max,p=Math.round,g=Math.floor,m=t=>({x:t,y:t});function y(){return"undefined"!=typeof window}function w(t){return b(t)?(t.nodeName||"").toLowerCase():"#document"}function v(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function x(t){var e;return null==(e=(b(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function b(t){return!!y()&&(t instanceof Node||t instanceof v(t).Node)}function L(t){return!!y()&&(t instanceof Element||t instanceof v(t).Element)}function R(t){return!!y()&&(t instanceof HTMLElement||t instanceof v(t).HTMLElement)}function T(t){return!(!y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof v(t).ShadowRoot)}function C(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=V(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function S(t){return/^(table|td|th)$/.test(w(t))}function E(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const F=/transform|translate|scale|rotate|perspective|filter/,W=/paint|layout|strict|content/,D=t=>!!t&&"none"!==t;let O;function H(t){const e=L(t)?V(t):t;return D(e.transform)||D(e.translate)||D(e.scale)||D(e.rotate)||D(e.perspective)||!M()&&(D(e.backdropFilter)||D(e.filter))||F.test(e.willChange||"")||W.test(e.contain||"")}function M(){return null==O&&(O="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),O}function z(t){return/^(html|body|#document)$/.test(w(t))}function V(t){return v(t).getComputedStyle(t)}function P(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function B(t){if("html"===w(t))return t;const e=t.assignedSlot||t.parentNode||T(t)&&t.host||x(t);return T(e)?e.host:e}function A(t){const e=B(t);return z(e)?(t.ownerDocument||t).body:R(e)&&C(e)?e:A(e)}function N(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=A(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=v(i);if(r){const t=$(c);return e.concat(c,c.visualViewport||[],C(i)?i:[],t&&n?N(t):[])}return e.concat(i,N(i,[],n))}function $(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function k(t){const e=V(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=R(t),r=i?t.offsetWidth:n,c=i?t.offsetHeight:o,l=p(n)!==r||p(o)!==c;return l&&(n=r,o=c),{width:n,height:o,$:l}}function I(t){return L(t)?t:t.contextElement}function q(t){const e=I(t);if(!R(e))return m(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=k(e);let c=(r?p(n.width):n.width)/o,l=(r?p(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const X=m(0);function Y(t){const e=v(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:X}function _(e,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),c=I(e);let l=m(1);n&&(i?L(i)&&(l=q(i)):l=q(e));const s=function(t,e,n){return void 0===e&&(e=!1),!!n&&e&&n===v(t)}(c,o,i)?Y(c):m(0);let f=(r.left+s.x)/l.x,u=(r.top+s.y)/l.y,a=r.width/l.x,h=r.height/l.y;if(c&&i){const t=v(c),e=L(i)?v(i):i;let n=t,o=$(n);for(;o&&e!==n;){const t=q(o),e=o.getBoundingClientRect(),i=V(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;f*=t.x,u*=t.y,a*=t.x,h*=t.y,f+=r,u+=c,n=v(o),o=$(n)}}return t({width:a,height:h,x:f,y:u})}function j(t,e){const n=P(t).scrollLeft;return e?e.left+n:_(x(t)).left+n}function G(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-j(t,n),y:n.top+e.scrollTop}}function J(e,n,o){let i;if("viewport"===n||"layoutViewport"===n)i=function(t,e,n){void 0===n&&(n="viewport");const o="layoutViewport"===n,i=v(t),r=x(t),c=i.visualViewport;let l=r.clientWidth,s=r.clientHeight,f=0,u=0;if(c){const t=!M()||"fixed"===e;o?t||(f=-c.offsetLeft,u=-c.offsetTop):(l=c.width,s=c.height,t&&(f=c.offsetLeft,u=c.offsetTop))}if(j(r)<=0){const t=r.ownerDocument,e=t.body,n=getComputedStyle(e),o="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-e.clientWidth-o),c="stable both-edges"===getComputedStyle(r).scrollbarGutter?i/2:i;c<=25&&(l-=c)}return{width:l,height:s,x:f,y:u}}(e,o,n);else if("document"===n)i=function(t){const e=P(t),n=t.ownerDocument.body,o=d(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=d(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+j(t);const c=-e.scrollTop;return"rtl"===V(n).direction&&(r+=d(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:r,y:c}}(x(e));else if(L(n))i=function(t,e){const n=_(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=q(t);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,o);else{const t=Y(e);i={x:n.x-t.x,y:n.y-t.y,width:n.width,height:n.height}}return t(i)}function K(t,e,n){const o=R(e),i=x(e),r="fixed"===n,c=_(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const s=m(0);if((o||!r)&&(("body"!==w(e)||C(i))&&(l=P(e)),o)){const t=_(e,!0,r,e);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}!o&&i&&(s.x=j(i));const f=!i||o||r?m(0):G(i,l);return{x:c.left+l.scrollLeft-s.x-f.x,y:c.top+l.scrollTop-s.y-f.y,width:c.width,height:c.height}}function Q(t){return"static"===V(t).position}function U(t,e){if(!R(t)||"fixed"===V(t).position)return null;if(e)return e(t);let n=t.offsetParent;return x(t)===n&&(n=n.ownerDocument.body),n}function Z(t,e){const n=v(t);if(E(t))return n;if(!R(t)){let e=B(t);for(;e&&!z(e);){if(L(e)&&!Q(e))return e;e=B(e)}return n}let o=U(t,e);for(;o&&S(o)&&Q(o);)o=U(o,e);return o&&z(o)&&Q(o)&&!H(o)?n:o||function(t){let e=B(t);for(;R(e)&&!z(e);){if(H(e))return e;if(E(e))return null;e=B(e)}return null}(t)||n}const tt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,c=x(o),l=!!e&&E(e.floating);if(o===c||l&&r)return n;let s={scrollLeft:0,scrollTop:0},f=m(1);const u=m(0),a=R(o);if((a||!r)&&(("body"!==w(o)||C(c))&&(s=P(o)),a)){const t=_(o);f=q(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!c||a||r?m(0):G(c,s);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-s.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-s.scrollTop*f.y+u.y+h.y}},getDocumentElement:x,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?E(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=N(t,[],!1).filter((t=>L(t)&&"body"!==w(t))),i=null;const r="fixed"===V(t).position;let c=r?B(t):t;for(;L(c)&&!z(c);){const t=V(c),e=H(c),n=i?i.position:r?"fixed":"";e||"fixed"!==n&&("absolute"!==n||"static"!==t.position)?i=t:o=o.filter((t=>t!==c)),c=B(c)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=J(e,r[0],i);let l=c.top,s=c.right,f=c.bottom,u=c.left;for(let t=1;t<r.length;t++){const n=J(e,r[t],i);l=d(n.top,l),s=h(n.right,s),f=h(n.bottom,f),u=d(n.left,u)}return{width:s-u,height:f-l,x:u,y:l}},getOffsetParent:Z,getElementRects:async function(t){const e=this.getOffsetParent||Z,n=this.getDimensions,o=await n(t.floating);return{reference:K(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:n}=k(t);return{width:e,height:n}},getScale:q,isElement:L,isRTL:function(t){return"rtl"===V(t).direction}};function et(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function nt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,f=I(t),u=i||r?[...f?N(f):[],...e?N(e):[]]:[];u.forEach((t=>{i&&t.addEventListener("scroll",n),r&&t.addEventListener("resize",n)}));const a=f&&l?function(t,e,n){let o,i=null;const r=x(t);function c(){var t;clearTimeout(o),null==(t=i)||t.disconnect(),i=null}function l(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),c();const f=t.getBoundingClientRect(),{left:u,top:a,width:p,height:m}=f;if(n||e(),!p||!m)return;const y={rootMargin:-g(a)+"px "+-g(r.clientWidth-(u+p))+"px "+-g(r.clientHeight-(a+m))+"px "+-g(u)+"px",threshold:d(0,h(1,s))||1};let w=!0;function v(e){const n=e[0].intersectionRatio;if(!et(f,t.getBoundingClientRect()))return l();if(n!==s){if(!w)return l();n?l(!1,n):o=setTimeout((()=>{l(!1,1e-7)}),1e3)}w=!1}try{i=new IntersectionObserver(v,{...y,root:r.ownerDocument})}catch(t){i=new IntersectionObserver(v,y)}i.observe(t)}const s=v(t),f=()=>l(n);return s.addEventListener("resize",f),l(!0),()=>{s.removeEventListener("resize",f),c()}}(f,n,r):null;let p,m=-1,y=null;c&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===f&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),f&&!s&&y.observe(f),e&&y.observe(e));let w=s?_(t):null;return s&&function e(){const o=_(t);w&&!et(w,o)&&n();w=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==a||a(),null==(t=y)||t.disconnect(),y=null,s&&cancelAnimationFrame(p)}}const ot=o,it=s,rt=n,ct=f,lt=i,st=u,ft=r,ut=e,at=c,ht=l,dt=(t,e,n)=>{const o=new Map,i=null!=n?n:{},r={...tt,...i.platform,_c:o};return a(t,e,{...i,platform:r})};export{ut as arrow,rt as autoPlacement,nt as autoUpdate,dt as computePosition,ot as detectOverflow,lt as flip,N as getOverflowAncestors,ft as hide,at as inline,ht as limitShift,it as offset,tt as platform,ct as shift,st as size};
|