@coreframe/vite 0.1.10 → 0.1.11

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.
@@ -1,2 +1,104 @@
1
- import{useEffect as e,useRef as t,useState as n,useSyncExternalStore as r}from"react";import{createPortal as i}from"react-dom";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";const c=()=>{if(typeof document>`u`)return;let e=document.querySelector(`meta[name="csp-nonce"]`);if(e?.content)return e.content;let t=document.querySelector(`script[nonce]`),n=t?.nonce||t?.getAttribute(`nonce`);if(n)return n},l=(e,t,n)=>{if(typeof document>`u`)return null;let r=`isolet-style-${e}`,i=typeof CSS<`u`&&CSS.escape?CSS.escape(r):r,a=`getElementById`in n?n.getElementById(r):n.querySelector(`#${i}`);if(a)return a.textContent=t,a;let o=document.createElement(`style`);o.id=r;let s=c();return s&&o.setAttribute(`nonce`,s),o.textContent=t,n.appendChild(o),o},u=`data-isolet`,d=(e,t,n={})=>{if(typeof document>`u`)return{host:null,shadowRoot:null,container:t,target:t};let r=n.isolation??`shadow-dom`;if(r===`none`){let r=`[${u}="${e}"]`,i=t.querySelector(r);if(i)return{host:i,shadowRoot:null,container:i,target:t};let a=document.createElement(`div`);if(a.setAttribute(u,e),n.hostAttributes)for(let[e,t]of Object.entries(n.hostAttributes))a.setAttribute(e,t);return f(a,n),n.css&&l(e,n.css,t),t.appendChild(a),{host:a,shadowRoot:null,container:a,target:t}}let i=`[${u}="${e}"]`,a=t.querySelector(i);if(a){if(r===`shadow-dom`&&a.shadowRoot){let e=a.shadowRoot.querySelector(`[${u}-root]`);if(e)return{host:a,shadowRoot:a.shadowRoot,container:e,target:t}}else if(r===`scoped`)return{host:a,shadowRoot:null,container:a,target:t}}let o=document.createElement(`div`);if(o.setAttribute(u,e),n.hostAttributes)for(let[e,t]of Object.entries(n.hostAttributes))o.setAttribute(e,t);if(r===`shadow-dom`){o.style.all=`initial`;let r=o.attachShadow({mode:n.shadowMode??`open`});n.css&&l(e,n.css,r);let i=document.createElement(`div`);return i.setAttribute(`${u}-root`,``),r.appendChild(i),f(o,n),t.appendChild(o),{host:o,shadowRoot:r,container:i,target:t}}return f(o,n),n.css&&l(e,n.css,t),t.appendChild(o),{host:o,shadowRoot:null,container:o,target:t}},f=(e,t)=>{if(t.hostStyles)for(let[n,r]of Object.entries(t.hostStyles))r==null||typeof r==`function`||e.style.setProperty(n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),String(r));t.zIndex!=null&&(e.style.zIndex=String(t.zIndex))};var p={actions:`actions`,button:`button`,checkbox:`checkbox`,closeButton:`closeButton`,content:`content`,dialog:`dialog`,error:`error`,filePath:`filePath`,files:`files`,header:`header`,indicatorButton:`indicatorButton`,indicatorDot:`indicatorDot`,message:`message`,paragraph:`paragraph`,primary:`primary`,radiate:`radiate`,title:`title`,warning:`warning`},m=`:host{color-scheme:light dark;font:14px/1.45 system-ui,sans-serif}.indicatorButton{appearance:none;cursor:pointer;pointer-events:auto;background:0 0;border:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;display:flex;position:fixed;bottom:10px;right:10px}.indicatorDot{background:var(--managed-dev-indicator-color);box-shadow:0 0 0 1px color-mix(in srgb, Canvas 70%, transparent);height:var(--managed-dev-indicator-size);width:var(--managed-dev-indicator-size);border-radius:50%;display:block;position:relative}.indicatorDot:before{border:max(1px, calc(var(--managed-dev-indicator-size) / 9)) solid var(--managed-dev-indicator-color);border-radius:inherit;content:"";animation:1.8s ease-out infinite radiate;position:absolute;inset:0}.dialog{border:1px solid color-mix(in srgb, CanvasText 18%, transparent);color:canvastext;box-sizing:border-box;pointer-events:auto;background:canvas;border-radius:14px;width:min(430px,100vw - 36px);max-width:min(430px,100vw - 36px);max-height:min(620px,100dvh - 80px);margin:0;padding:18px;position:fixed;inset:auto 18px 62px auto;overflow:auto;box-shadow:0 18px 60px #0005}.dialog[open]{gap:12px;display:grid}.header{justify-content:space-between;align-items:center;gap:12px;display:flex}.title{margin:0;font-size:16px}.closeButton{color:inherit;cursor:pointer;font:inherit;background:0 0;border:0;min-width:44px;min-height:44px;padding:6px}.content{gap:12px;display:grid}.paragraph{margin:0}.files{gap:7px;max-height:190px;display:grid;overflow:auto}.checkbox{overflow-wrap:anywhere;align-items:start;gap:8px;display:flex}.filePath{font-family:ui-monospace,monospace}.message{box-sizing:border-box;resize:vertical;width:100%;min-height:92px;font-family:ui-monospace,monospace}.actions{flex-wrap:wrap;justify-content:end;gap:8px;display:flex}.button{border:1px solid color-mix(in srgb, CanvasText 22%, transparent);cursor:pointer;font:inherit;border-radius:8px;padding:7px 11px}.primary{color:#fff;background:#2563eb;border-color:#2563eb}.button:disabled{cursor:wait;opacity:.55}.warning{color:#b45309;white-space:pre-wrap}.error{color:#dc2626;white-space:pre-wrap}@keyframes radiate{0%{opacity:.75;transform:scale(1)}to{opacity:0;transform:scale(2.4)}}@media (width<=600px){.dialog{width:auto;max-height:calc(100dvh - 86px);padding:16px;inset:auto 12px 62px}.button{min-height:44px}}@media (prefers-reduced-motion:reduce){.indicatorDot:before{opacity:.45;animation:none;transform:scale(1.65)}}
2
- `;const h=`/__coreframe/managed-dev`;let g=!1;const _=new Set;function v(){g=!g;for(let e of _)e()}function y({indicator:t=o(b,{})}){let[a,c]=n(null),{act:l,status:u}=D(),f=r(O,k,A);return e(()=>{let e=!0,t=d(`coreframe-managed-dev`,document.body,{css:m,hostAttributes:{"aria-live":`polite`,id:`coreframe-managed-dev`},hostStyles:{inset:`0`,pointerEvents:`none`,position:`fixed`},zIndex:2147483647});return queueMicrotask(()=>{e&&c(t.container)}),()=>{e=!1,t.host?.remove()}},[]),a?i(s(`div`,{className:p.surface,children:[E(u)?t:null,f?o(x,{act:l,status:u}):null]}),a):null}function b({color:e=`#2563eb`,size:t=14}){let n=r(O,k,A),i={"--managed-dev-indicator-color":e,"--managed-dev-indicator-size":typeof t==`number`?`${t}px`:t};return o(`button`,{"aria-controls":`coreframe-managed-dev-dialog`,"aria-expanded":n,"aria-label":`${n?`Hide`:`Show`} Coreframe managed development`,className:p.indicatorButton,onClick:v,style:i,type:`button`,children:o(`span`,{className:p.indicatorDot})})}function x({act:e,status:t}){let[r,i]=n({value:``}),[c,l]=n(()=>({paths:new Set})),u=t?.draft,d=t?.target,f=c.fingerprint===u?.fingerprint?c.paths:new Set(u?.untracked??[]),m=r.fingerprint===u?.fingerprint&&r.proposal===t?.proposal?r.value:t?.proposal??``,h=!!(u?.untracked.length&&u.untracked.every(e=>f.has(e)));return s(`dialog`,{"aria-labelledby":`coreframe-managed-title`,className:p.dialog,id:`coreframe-managed-dev-dialog`,open:!0,children:[s(`div`,{className:p.header,children:[o(`h2`,{className:p.title,id:`coreframe-managed-title`,children:`Coreframe update`}),o(`button`,{className:p.closeButton,onClick:v,type:`button`,children:`Close`})]}),s(`div`,{className:p.content,children:[o(`p`,{className:`${p.paragraph} ${t?.mode===`error`?p.error:``}`,children:t?t.busy||t.message||T(t):`Checking managed development status…`}),d?s(`p`,{className:p.paragraph,children:[d.subject,` (`,d.shortCommit,`)`]}):null,t?.warnings.map((e,t)=>o(`p`,{className:`${p.paragraph} ${p.warning}`,children:e},`${t}-${e}`)),u?s(a,{children:[s(`div`,{className:p.files,children:[u.untracked.map(e=>o(S,{checked:f.has(e),label:o(`span`,{className:p.filePath,children:e}),onChange:t=>l(()=>{let n=new Set(f);return t?n.add(e):n.delete(e),{fingerprint:u.fingerprint,paths:n}})},e)),u.untracked.length>0?o(S,{checked:h,label:`Include all untracked files`,onChange:e=>l({fingerprint:u.fingerprint,paths:e?new Set(u.untracked):new Set})}):null]}),t.proposal===void 0?s(C,{children:[o(w,{busy:t.busy,onClick:()=>void e({type:`reject`}),children:`Reject`}),o(w,{busy:t.busy,onClick:()=>void e({type:`message`,fingerprint:u.fingerprint,untracked:[...f]}),primary:!0,children:`Generate commit message`})]}):s(a,{children:[o(`textarea`,{"aria-label":`Commit message`,className:p.message,onChange:e=>i({fingerprint:u.fingerprint,proposal:t.proposal,value:e.target.value}),value:m}),s(C,{children:[o(w,{busy:t.busy,onClick:()=>void e({type:`reject`}),children:`Reject`}),o(w,{busy:t.busy,onClick:()=>{d&&e({type:`apply`,target:d.commit,fingerprint:u.fingerprint,untracked:[...f],message:m})},primary:!0,children:`Commit and refresh`})]})]})]}):d&&!t.busy?o(C,{children:o(w,{busy:t.busy,onClick:()=>void e({type:`prepare`,target:d.commit}),primary:!0,children:d.source===`upstream`?`Refresh`:String(d.source)===`dev`?`Sync with dev`:`Sync with main`})}):null]})]})}function S({checked:e,label:t,onChange:n}){return s(`label`,{className:p.checkbox,children:[o(`input`,{checked:e,onChange:e=>n(e.target.checked),type:`checkbox`}),t]})}function C({children:e}){return o(`div`,{className:p.actions,children:e})}function w({busy:e,children:t,onClick:n,primary:r=!1}){return o(`button`,{className:`${p.button} ${r?p.primary:``}`,disabled:!!e,onClick:n,type:`button`,children:t})}function T(e){return e.mode===`waiting`?`Waiting for managed development to start.`:e.mode===`unmanaged`?`Managed synchronization is unavailable for this session.`:e.mode===`error`?`Managed synchronization stopped.`:e.target&&e.target.source!==`upstream`?String(e.target?.source)===`dev`?`New changes are available in local dev.`:`New changes are available in local main.`:e.target?`A newer main commit is ready.`:`Managed development is active. No updates are available.`}function E(e){return!e||e.mode===`waiting`?!1:e.mode===`managed`?!!(e.busy||e.draft||e.message||e.target||e.warnings.length>0):!0}function D(){let[r,i]=n(),a=t(null);return e(()=>{let e=!0,t=new BroadcastChannel(`coreframe-managed-dev`);a.current=t;let n=async()=>{try{let t=await fetch(`${h}/status`);if(t.ok&&e){let e=await t.json();i(e.status)}}catch{}};t.onmessage=()=>void n();let r=setInterval(n,2e3);return n(),()=>{e=!1,clearInterval(r),t.close(),a.current=null}},[]),{act:async e=>{try{let t=await fetch(`${h}/action`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),n=await t.json();i(e=>{let r=n.status??e??{mode:`error`,warnings:[]};return t.ok?r:{...r,message:n.error}}),a.current?.postMessage(`changed`)}catch(e){i(t=>({...t??{warnings:[]},message:e instanceof Error?e.message:String(e),mode:`error`}))}},status:r}}function O(e){return _.add(e),()=>_.delete(e)}function k(){return g}function A(){return!1}export{y as ManagedDevOverlay,b as ManagedDevOverlayIndicator,v as toggleManagedDevOverlay};
1
+ import{managedDevEvents as e}from"@coreframe/scripts/managed-dev-protocol";import{createContext as t,createElement as n,forwardRef as r,useCallback as i,useContext as a,useEffect as o,useRef as s,useState as c,useSyncExternalStore as l}from"react";import{createPortal as u}from"react-dom";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";const m=()=>{if(typeof document>`u`)return;let e=document.querySelector(`meta[name="csp-nonce"]`);if(e?.content)return e.content;let t=document.querySelector(`script[nonce]`),n=t?.nonce||t?.getAttribute(`nonce`);if(n)return n},h=(e,t,n)=>{if(typeof document>`u`)return null;let r=`isolet-style-${e}`,i=typeof CSS<`u`&&CSS.escape?CSS.escape(r):r,a=`getElementById`in n?n.getElementById(r):n.querySelector(`#${i}`);if(a)return a.textContent=t,a;let o=document.createElement(`style`);o.id=r;let s=m();return s&&o.setAttribute(`nonce`,s),o.textContent=t,n.appendChild(o),o},g=`data-isolet`,_=(e,t,n={})=>{if(typeof document>`u`)return{host:null,shadowRoot:null,container:t,target:t};let r=n.isolation??`shadow-dom`;if(r===`none`){let r=`[${g}="${e}"]`,i=t.querySelector(r);if(i)return{host:i,shadowRoot:null,container:i,target:t};let a=document.createElement(`div`);if(a.setAttribute(g,e),n.hostAttributes)for(let[e,t]of Object.entries(n.hostAttributes))a.setAttribute(e,t);return v(a,n),n.css&&h(e,n.css,t),t.appendChild(a),{host:a,shadowRoot:null,container:a,target:t}}let i=`[${g}="${e}"]`,a=t.querySelector(i);if(a){if(r===`shadow-dom`&&a.shadowRoot){let e=a.shadowRoot.querySelector(`[${g}-root]`);if(e)return{host:a,shadowRoot:a.shadowRoot,container:e,target:t}}else if(r===`scoped`)return{host:a,shadowRoot:null,container:a,target:t}}let o=document.createElement(`div`);if(o.setAttribute(g,e),n.hostAttributes)for(let[e,t]of Object.entries(n.hostAttributes))o.setAttribute(e,t);if(r===`shadow-dom`){o.style.all=`initial`;let r=o.attachShadow({mode:n.shadowMode??`open`});n.css&&h(e,n.css,r);let i=document.createElement(`div`);return i.setAttribute(`${g}-root`,``),r.appendChild(i),v(o,n),t.appendChild(o),{host:o,shadowRoot:r,container:i,target:t}}return v(o,n),n.css&&h(e,n.css,t),t.appendChild(o),{host:o,shadowRoot:null,container:o,target:t}},v=(e,t)=>{if(t.hostStyles)for(let[n,r]of Object.entries(t.hostStyles))r==null||typeof r==`function`||e.style.setProperty(n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),String(r));t.zIndex!=null&&(e.style.zIndex=String(t.zIndex))},y=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ee=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),b=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),x=e=>{
2
+ /**
3
+ * @license lucide-react v1.24.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * @license lucide-react v1.24.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+ /**
15
+ * @license lucide-react v1.24.0 - ISC
16
+ *
17
+ * This source code is licensed under the ISC license.
18
+ * See the LICENSE file in the root directory of this source tree.
19
+ */
20
+ /**
21
+ * @license lucide-react v1.24.0 - ISC
22
+ *
23
+ * This source code is licensed under the ISC license.
24
+ * See the LICENSE file in the root directory of this source tree.
25
+ */
26
+ let t=b(e);return t.charAt(0).toUpperCase()+t.slice(1)};
27
+ /**
28
+ * @license lucide-react v1.24.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */
33
+ var S={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};
34
+ /**
35
+ * @license lucide-react v1.24.0 - ISC
36
+ *
37
+ * This source code is licensed under the ISC license.
38
+ * See the LICENSE file in the root directory of this source tree.
39
+ */
40
+ const C=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},w=t({}),T=()=>a(w),E=r(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:s,...c},l)=>{
41
+ /**
42
+ * @license lucide-react v1.24.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */
47
+ /**
48
+ * @license lucide-react v1.24.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */
53
+ let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=T()??{},h=i??f?Number(r??d)*24/Number(t??u):r??d;return n(`svg`,{ref:l,...S,width:t??u??S.width,height:t??u??S.height,stroke:e??p,strokeWidth:h,className:y(`lucide`,m,a),...!o&&!C(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>n(e,t)),...Array.isArray(o)?o:[o]])}),D=(e,t)=>{
54
+ /**
55
+ * @license lucide-react v1.24.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */
60
+ let i=r(({className:r,...i},a)=>n(E,{ref:a,iconNode:t,className:y(`lucide-${ee(x(e))}`,`lucide-${e}`,r),...i}));return i.displayName=x(e),i},O=D(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),k=D(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),A=D(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),j=D(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),M=D(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),N=D(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),P=D(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]])
61
+ /**
62
+ * @license lucide-react v1.24.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */
67
+ /**
68
+ * @license lucide-react v1.24.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */
73
+ /**
74
+ * @license lucide-react v1.24.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */
79
+ /**
80
+ * @license lucide-react v1.24.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */
85
+ /**
86
+ * @license lucide-react v1.24.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */
91
+ /**
92
+ * @license lucide-react v1.24.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */
97
+ /**
98
+ * @license lucide-react v1.24.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */
103
+ ;function te(){return import.meta.hot}var F={actionError:`actionError`,actions:`actions`,actionSuccess:`actionSuccess`,button:`button`,checkbox:`checkbox`,content:`content`,dialog:`dialog`,errorIcon:`errorIcon`,filePath:`filePath`,files:`files`,header:`header`,iconButton:`iconButton`,indicatorButton:`indicatorButton`,indicatorDot:`indicatorDot`,message:`message`,paragraph:`paragraph`,primary:`primary`,radiate:`radiate`,successIcon:`successIcon`,title:`title`,warning:`warning`},ne=`[data-isolet-root]{color-scheme:light dark;font:14px/1.45 system-ui,sans-serif}.indicatorButton{appearance:none;cursor:pointer;pointer-events:auto;background:0 0;border:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;display:flex;position:fixed;bottom:10px;right:10px}.indicatorDot{background:var(--managed-dev-indicator-color);box-shadow:0 0 0 1px color-mix(in srgb, Canvas 70%, transparent);height:var(--managed-dev-indicator-size);width:var(--managed-dev-indicator-size);border-radius:50%;display:block;position:relative}.indicatorDot:before{border:max(1px, calc(var(--managed-dev-indicator-size) / 9)) solid var(--managed-dev-indicator-color);border-radius:inherit;content:"";animation:1.8s ease-out infinite radiate;position:absolute;inset:0}.dialog{border:1px solid color-mix(in srgb, CanvasText 18%, transparent);color:canvastext;box-sizing:border-box;pointer-events:auto;background:canvas;border-radius:14px;width:min(430px,100vw - 36px);max-width:min(430px,100vw - 36px);max-height:min(620px,100dvh - 80px);margin:0;padding:18px;position:fixed;inset:auto 18px 62px auto;overflow:auto;box-shadow:0 18px 60px #0005}.dialog[open]{gap:12px;display:grid}.header{justify-content:space-between;align-items:center;gap:12px;display:flex}.title{margin:0;font-size:16px}.iconButton{color:inherit;cursor:pointer;background:0 0;border:0;flex:none;justify-content:center;align-items:center;min-width:32px;min-height:32px;padding:4px;display:inline-flex}.content{gap:12px;display:grid}.paragraph{margin:0}.files{gap:7px;max-height:190px;display:grid;overflow:auto}.checkbox{overflow-wrap:anywhere;align-items:start;gap:8px;display:flex}.filePath{font-family:ui-monospace,monospace}.message{box-sizing:border-box;resize:vertical;width:100%;min-height:92px;font-family:ui-monospace,monospace}.actions{flex-wrap:wrap;justify-content:end;gap:8px;display:flex}.button{border:1px solid color-mix(in srgb, CanvasText 22%, transparent);cursor:pointer;font:inherit;border-radius:999px;justify-content:center;align-items:center;gap:6px;padding:7px 11px;transition:opacity .14s;display:inline-flex}.primary{color:#fff;background:#2563eb;border-color:#2563eb}.button:disabled{cursor:wait;opacity:.55}.warning{color:#b45309;white-space:pre-wrap}.actionError{background:color-mix(in srgb, #facc15 18%, Canvas);color:color-mix(in srgb, #854d0e 82%, CanvasText);white-space:pre-wrap;border:1px solid #ca8a0485;border-radius:10px;grid-template-columns:auto 1fr auto;align-items:start;gap:8px;padding:10px;display:grid}.actionSuccess{background:color-mix(in srgb, #22c55e 16%, Canvas);color:color-mix(in srgb, #166534 82%, CanvasText);border:1px solid #16a34a7a;border-radius:10px;grid-template-columns:auto 1fr;align-items:start;gap:8px;padding:10px;display:grid}.errorIcon,.successIcon{margin-top:1px}@keyframes radiate{0%{opacity:.75;transform:scale(1)}to{opacity:0;transform:scale(2.4)}}@media (width<=600px){.dialog{width:auto;max-height:calc(100dvh - 86px);padding:16px;inset:auto 12px 62px}.button{min-height:44px}}@media (prefers-reduced-motion:reduce){.indicatorDot:before{opacity:.45;animation:none;transform:scale(1.65)}}
104
+ `;let I=!1,L=0;const R=new Set;function z(){B(!I)}function B(e){if(I!==e){I=e;for(let e of R)e()}}function V({indicator:e=f(H,{})}){let[t,n]=c(null),{act:r,dismissError:i,dismissSuccess:a,error:s,status:d,success:m}=re(),h=l(Z,Q,$);return o(()=>{let e=!0,t=_(`coreframe-managed-dev`,document.body,{css:ne,hostAttributes:{"aria-live":`polite`,id:`coreframe-managed-dev`},hostStyles:{inset:`0`,pointerEvents:`none`,position:`fixed`},zIndex:2147483647});return queueMicrotask(()=>{e&&n(t.container)}),()=>{e=!1,t.host?.remove()}},[]),o(()=>{if(!m)return;let e=setTimeout(()=>{a(),B(!1)},1600);return()=>clearTimeout(e)},[a,m]),t?u(p(`div`,{className:F.surface,children:[Y(d)?e:null,h?f(U,{act:r,dismissError:i,error:s,status:d,success:m}):null]}),t):null}function H({color:e=`#2563eb`,size:t=14}){let n=l(Z,Q,$),r={"--managed-dev-indicator-color":e,"--managed-dev-indicator-size":typeof t==`number`?`${t}px`:t};return f(`button`,{"aria-controls":`coreframe-managed-dev-dialog`,"aria-expanded":n,"aria-label":`${n?`Hide`:`Show`} Coreframe managed development`,className:F.indicatorButton,onClick:z,style:r,type:`button`,children:f(`span`,{className:F.indicatorDot})})}function U({act:e,dismissError:t,error:n,status:r,success:i}){let[a,o]=c({value:``}),[s,l]=c(()=>({paths:new Set})),u=r?.draft,m=r?.target,h=s.fingerprint===u?.fingerprint?s.paths:new Set(u?.untracked??[]),g=a.fingerprint===u?.fingerprint&&a.proposal===r?.proposal?a.value:r?.proposal??``,_=!!(u?.untracked.length&&u.untracked.every(e=>h.has(e)));return p(`dialog`,{"aria-labelledby":`coreframe-managed-title`,className:F.dialog,id:`coreframe-managed-dev-dialog`,open:!0,children:[p(`div`,{className:F.header,children:[f(`h2`,{className:F.title,id:`coreframe-managed-title`,children:i?.heading??q(r)}),f(`button`,{"aria-label":`Close managed development`,className:F.iconButton,onClick:z,type:`button`,children:f(P,{"aria-hidden":`true`,size:18})})]}),p(`div`,{className:F.content,children:[i?p(`div`,{className:F.actionSuccess,role:`status`,children:[f(O,{"aria-hidden":`true`,className:F.successIcon,size:18}),f(`p`,{className:F.paragraph,children:i.message})]}):null,n?p(`div`,{className:F.actionError,role:`alert`,children:[f(N,{"aria-hidden":`true`,className:F.errorIcon,size:18}),f(`p`,{className:F.paragraph,children:n}),f(`button`,{"aria-label":`Dismiss error`,className:F.iconButton,onClick:t,type:`button`,children:f(P,{"aria-hidden":`true`,size:16})})]}):null,i?null:f(`p`,{className:F.paragraph,children:r?r.busy||r.message||J(r):`Checking managed development status…`}),m?p(`p`,{className:F.paragraph,children:[m.subject,` (`,m.shortCommit,`)`]}):null,r?.warnings.map((e,t)=>f(`p`,{className:`${F.paragraph} ${F.warning}`,children:e},`${t}-${e}`)),u?p(d,{children:[p(`div`,{className:F.files,children:[u.untracked.map(e=>f(W,{checked:h.has(e),label:f(`span`,{className:F.filePath,children:e}),onChange:t=>l(()=>{let n=new Set(h);return t?n.add(e):n.delete(e),{fingerprint:u.fingerprint,paths:n}})},e)),u.untracked.length>0?f(W,{checked:_,label:`Include all untracked files`,onChange:e=>l({fingerprint:u.fingerprint,paths:e?new Set(u.untracked):new Set})}):null]}),r.proposal===void 0?p(G,{children:[f(K,{busy:r.busy,icon:j,onClick:()=>void e({type:`reject`}),children:`Reject`}),f(K,{busy:r.busy,icon:M,onClick:()=>void e({type:`message`,fingerprint:u.fingerprint,untracked:[...h]}),primary:!0,children:`Generate commit message`})]}):p(d,{children:[f(`textarea`,{"aria-label":`Commit message`,className:F.message,onChange:e=>o({fingerprint:u.fingerprint,proposal:r.proposal,value:e.target.value}),value:g}),p(G,{children:[f(K,{busy:r.busy,icon:j,onClick:()=>void e({type:`reject`}),children:`Reject`}),f(K,{busy:r.busy,icon:k,onClick:()=>{m&&e({type:`apply`,target:m.commit,fingerprint:u.fingerprint,untracked:[...h],message:g})},primary:!0,children:`Commit and refresh`})]})]})]}):m?f(G,{children:f(K,{busy:r.busy,icon:A,onClick:()=>void e({type:`prepare`,target:m.commit}),primary:!0,children:m.source===`upstream`?`Refresh`:String(m.source)===`dev`?`Sync with dev`:`Sync with main`})}):null]})]})}function W({checked:e,label:t,onChange:n}){return p(`label`,{className:F.checkbox,children:[f(`input`,{checked:e,onChange:e=>n(e.target.checked),type:`checkbox`}),t]})}function G({children:e}){return f(`div`,{className:F.actions,children:e})}function K({busy:e,children:t,icon:n,onClick:r,primary:i=!1}){return p(`button`,{"aria-busy":!!e,className:`${F.button} ${i?F.primary:``}`,disabled:!!e,onClick:r,type:`button`,children:[n?f(n,{"aria-hidden":`true`,size:16}):null,t]})}function q(e){return e?e.mode===`unmanaged`?`Managed development unavailable`:e.mode===`error`?`Managed development stopped`:e.draft?e.proposal===void 0?`Review local changes`:`Confirm your commit`:e.target?.source===`upstream`?`Refresh from upstream`:String(e.target?.source)===`dev`?`Sync with local dev`:e.target?`Sync with local main`:e.warnings.length>0?`Managed development warning`:`Managed development status`:`Checking managed development`}function J(e){return e.mode===`waiting`?`Waiting for managed development to start.`:e.mode===`unmanaged`?`Managed synchronization is unavailable for this session.`:e.mode===`error`?`Managed synchronization stopped.`:e.target&&e.target.source!==`upstream`?String(e.target?.source)===`dev`?`New changes are available in local dev.`:`New changes are available in local main.`:e.target?`A newer main commit is ready.`:`Managed development is active. No updates are available.`}function Y(e){return!e||e.mode===`waiting`?!1:e.mode===`managed`?!!(e.busy||e.draft||e.message||e.target||e.warnings.length>0):!0}function X(e){return e.type===`apply`?{heading:`Refresh complete`,message:`Your changes were committed and the project is up to date.`}:e.type===`prepare`?{heading:`Refresh complete`,message:`Your project is up to date.`}:e.type===`reject`?{heading:`Update dismissed`,message:`No further action is required.`}:{heading:`Action complete`,message:`No further action is required.`}}function re(){let[t,n]=c(),[r,a]=c(),[l,u]=c(),d=s(new Map),f=te();return o(()=>{if(!f)return;let t=d.current,r=({status:e})=>{n(e),Y(e)&&u(void 0)},i=e=>{let r=t.get(e.requestId);r&&(t.delete(e.requestId),e.status&&n(e.status),e.error?a(e.error):e.status&&!Y(e.status)&&u(X(r)))};return f.on(e.status,r),f.on(e.actionResult,i),f.send(e.statusRequest),()=>{t.clear(),f.off(e.status,r),f.off(e.actionResult,i)}},[f]),{act:async t=>{if(a(void 0),u(void 0),!f){a(`The Vite HMR connection is unavailable.`);return}let n=String(++L);d.current.set(n,t),f.send(e.action,{action:t,requestId:n})},dismissError:()=>a(void 0),dismissSuccess:i(()=>u(void 0),[]),error:r,status:t,success:l}}function Z(e){return R.add(e),()=>R.delete(e)}function Q(){return I}function $(){return!1}export{V as ManagedDevOverlay,H as ManagedDevOverlayIndicator,z as toggleManagedDevOverlay};
@@ -1 +1 @@
1
- import{readProjectConfig as e}from"@coreframe/scripts/config";import{startManagedDevSession as t}from"@coreframe/scripts/managed-dev";import{managedDevEnv as n}from"@coreframe/scripts/managed-dev-protocol";const r=`/__coreframe/managed-dev`;function i({env:i=process.env,startSession:c=t}={}){let l=i[n]===`1`,u;return{name:`coreframe:managed-dev`,apply:`serve`,config(){return{define:{"import.meta.env.COREFRAME_MANAGED_DEV":JSON.stringify(l)}}},async configureServer(t){if(!l)return;let n=t.config.root;u=await c({config:await e({cwd:n}),cwd:n,env:i,onRestart:()=>queueMicrotask(()=>void t.restart())}),await u.activate(),t.httpServer?.once(`close`,()=>void u?.close()),t.middlewares.use(async(e,t,n)=>{if(!e.url){n();return}let i=new URL(e.url,`http://coreframe.local`).pathname;if(i===`${r}/status`&&e.method===`GET`){s(t,200,{status:u.getStatus()});return}if(i===`${r}/action`&&e.method===`POST`){if(!o(e.socket.remoteAddress)){s(t,403,{error:`Managed development actions require a loopback client.`});return}try{let n=await a(e);s(t,200,await u.action(n))}catch(e){s(t,400,{error:e instanceof Error?e.message:String(e),status:u.getStatus()})}return}n()})},async closeBundle(){await u?.close()}}}async function a(e){let t=``;for await(let n of e)if(t+=String(n),t.length>1e6)throw Error(`Managed development request is too large.`);return t?JSON.parse(t):{}}function o(e){return e===`127.0.0.1`||e===`::1`||e?.startsWith(`::ffff:127.`)}function s(e,t,n){e.statusCode=t,e.setHeader(`Content-Type`,`application/json`),e.end(JSON.stringify(n))}export{i as coreframeManagedDevPlugin};
1
+ import{readProjectConfig as e}from"@coreframe/scripts/config";import{startManagedDevSession as t}from"@coreframe/scripts/managed-dev";import{managedDevEnv as n,managedDevEvents as r}from"@coreframe/scripts/managed-dev-protocol";function i({env:i=process.env,startSession:s=t}={}){let c=i[n]===`1`,l;return{name:`coreframe:managed-dev`,apply:`serve`,config(){return{define:{"import.meta.env.COREFRAME_MANAGED_DEV":JSON.stringify(c)}}},async configureServer(t){if(!c)return;let n=t.config.root;l=await s({config:await e({cwd:n}),cwd:n,env:i,onRestart:()=>queueMicrotask(()=>void t.restart()),onStatusChange:()=>t.ws.send(r.status,{status:l.getStatus()})}),await l.activate();let u=(e,t)=>t.send(r.status,{status:l.getStatus()}),d=async(e,n)=>{let i;if(!o(a(n)))i=Error(`Managed development actions require a loopback client.`);else try{let t=await l.action(e.action);n.send(r.actionResult,{requestId:e.requestId,...t});return}catch(e){i=e}let s=i instanceof Error?i.message:String(i);t.config.logger.error(`Coreframe managed development action failed: ${s}`,{error:i instanceof Error?i:void 0}),n.send(r.actionResult,{error:s,requestId:e.requestId,status:l.getStatus()})};t.ws.on(r.statusRequest,u),t.ws.on(r.action,d),t.httpServer?.once(`close`,()=>{t.ws.off(r.statusRequest,u),t.ws.off(r.action,d),l?.close()})},async closeBundle(){await l?.close()}}}function a(e){return e.socket._socket?.remoteAddress}function o(e){return e===`127.0.0.1`||e===`::1`||e?.startsWith(`::ffff:127.`)}export{i as coreframeManagedDevPlugin};
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- :host{color-scheme:light dark;font:14px/1.45 system-ui,sans-serif}.indicatorButton{appearance:none;cursor:pointer;pointer-events:auto;background:0 0;border:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;display:flex;position:fixed;bottom:10px;right:10px}.indicatorDot{background:var(--managed-dev-indicator-color);box-shadow:0 0 0 1px color-mix(in srgb, Canvas 70%, transparent);height:var(--managed-dev-indicator-size);width:var(--managed-dev-indicator-size);border-radius:50%;display:block;position:relative}.indicatorDot:before{border:max(1px, calc(var(--managed-dev-indicator-size) / 9)) solid var(--managed-dev-indicator-color);border-radius:inherit;content:"";animation:1.8s ease-out infinite radiate;position:absolute;inset:0}.dialog{border:1px solid color-mix(in srgb, CanvasText 18%, transparent);color:canvastext;box-sizing:border-box;pointer-events:auto;background:canvas;border-radius:14px;width:min(430px,100vw - 36px);max-width:min(430px,100vw - 36px);max-height:min(620px,100dvh - 80px);margin:0;padding:18px;position:fixed;inset:auto 18px 62px auto;overflow:auto;box-shadow:0 18px 60px #0005}.dialog[open]{gap:12px;display:grid}.header{justify-content:space-between;align-items:center;gap:12px;display:flex}.title{margin:0;font-size:16px}.closeButton{color:inherit;cursor:pointer;font:inherit;background:0 0;border:0;min-width:44px;min-height:44px;padding:6px}.content{gap:12px;display:grid}.paragraph{margin:0}.files{gap:7px;max-height:190px;display:grid;overflow:auto}.checkbox{overflow-wrap:anywhere;align-items:start;gap:8px;display:flex}.filePath{font-family:ui-monospace,monospace}.message{box-sizing:border-box;resize:vertical;width:100%;min-height:92px;font-family:ui-monospace,monospace}.actions{flex-wrap:wrap;justify-content:end;gap:8px;display:flex}.button{border:1px solid color-mix(in srgb, CanvasText 22%, transparent);cursor:pointer;font:inherit;border-radius:8px;padding:7px 11px}.primary{color:#fff;background:#2563eb;border-color:#2563eb}.button:disabled{cursor:wait;opacity:.55}.warning{color:#b45309;white-space:pre-wrap}.error{color:#dc2626;white-space:pre-wrap}@keyframes radiate{0%{opacity:.75;transform:scale(1)}to{opacity:0;transform:scale(2.4)}}@media (width<=600px){.dialog{width:auto;max-height:calc(100dvh - 86px);padding:16px;inset:auto 12px 62px}.button{min-height:44px}}@media (prefers-reduced-motion:reduce){.indicatorDot:before{opacity:.45;animation:none;transform:scale(1.65)}}
1
+ [data-isolet-root]{color-scheme:light dark;font:14px/1.45 system-ui,sans-serif}.indicatorButton{appearance:none;cursor:pointer;pointer-events:auto;background:0 0;border:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;display:flex;position:fixed;bottom:10px;right:10px}.indicatorDot{background:var(--managed-dev-indicator-color);box-shadow:0 0 0 1px color-mix(in srgb, Canvas 70%, transparent);height:var(--managed-dev-indicator-size);width:var(--managed-dev-indicator-size);border-radius:50%;display:block;position:relative}.indicatorDot:before{border:max(1px, calc(var(--managed-dev-indicator-size) / 9)) solid var(--managed-dev-indicator-color);border-radius:inherit;content:"";animation:1.8s ease-out infinite radiate;position:absolute;inset:0}.dialog{border:1px solid color-mix(in srgb, CanvasText 18%, transparent);color:canvastext;box-sizing:border-box;pointer-events:auto;background:canvas;border-radius:14px;width:min(430px,100vw - 36px);max-width:min(430px,100vw - 36px);max-height:min(620px,100dvh - 80px);margin:0;padding:18px;position:fixed;inset:auto 18px 62px auto;overflow:auto;box-shadow:0 18px 60px #0005}.dialog[open]{gap:12px;display:grid}.header{justify-content:space-between;align-items:center;gap:12px;display:flex}.title{margin:0;font-size:16px}.iconButton{color:inherit;cursor:pointer;background:0 0;border:0;flex:none;justify-content:center;align-items:center;min-width:32px;min-height:32px;padding:4px;display:inline-flex}.content{gap:12px;display:grid}.paragraph{margin:0}.files{gap:7px;max-height:190px;display:grid;overflow:auto}.checkbox{overflow-wrap:anywhere;align-items:start;gap:8px;display:flex}.filePath{font-family:ui-monospace,monospace}.message{box-sizing:border-box;resize:vertical;width:100%;min-height:92px;font-family:ui-monospace,monospace}.actions{flex-wrap:wrap;justify-content:end;gap:8px;display:flex}.button{border:1px solid color-mix(in srgb, CanvasText 22%, transparent);cursor:pointer;font:inherit;border-radius:999px;justify-content:center;align-items:center;gap:6px;padding:7px 11px;transition:opacity .14s;display:inline-flex}.primary{color:#fff;background:#2563eb;border-color:#2563eb}.button:disabled{cursor:wait;opacity:.55}.warning{color:#b45309;white-space:pre-wrap}.actionError{background:color-mix(in srgb, #facc15 18%, Canvas);color:color-mix(in srgb, #854d0e 82%, CanvasText);white-space:pre-wrap;border:1px solid #ca8a0485;border-radius:10px;grid-template-columns:auto 1fr auto;align-items:start;gap:8px;padding:10px;display:grid}.actionSuccess{background:color-mix(in srgb, #22c55e 16%, Canvas);color:color-mix(in srgb, #166534 82%, CanvasText);border:1px solid #16a34a7a;border-radius:10px;grid-template-columns:auto 1fr;align-items:start;gap:8px;padding:10px;display:grid}.errorIcon,.successIcon{margin-top:1px}@keyframes radiate{0%{opacity:.75;transform:scale(1)}to{opacity:0;transform:scale(2.4)}}@media (width<=600px){.dialog{width:auto;max-height:calc(100dvh - 86px);padding:16px;inset:auto 12px 62px}.button{min-height:44px}}@media (prefers-reduced-motion:reduce){.indicatorDot:before{opacity:.45;animation:none;transform:scale(1.65)}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreframe/vite",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/airlock-labs/coreframe.git",
@@ -52,10 +52,11 @@
52
52
  "@iconify/utils": "^3.1.4",
53
53
  "@svgr/core": "^8.1.0",
54
54
  "@svgr/plugin-jsx": "^8.1.0",
55
+ "lucide-react": "^1.24.0",
55
56
  "unplugin-icons": "^23.0.1",
56
- "@coreframe/dashboard": "^0.2.1",
57
+ "@coreframe/dashboard": "^0.2.2",
57
58
  "@coreframe/lib": "^0.1.6",
58
- "@coreframe/scripts": "^0.1.23"
59
+ "@coreframe/scripts": "^0.1.24"
59
60
  },
60
61
  "devDependencies": {
61
62
  "@tsdown/css": "0.22.3",