@coreframe/vite 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/icons-Dn2tl9hg.js +25 -0
- package/dist/{managed-dev-overlay.d.ts → overlay/managed-dev-overlay.d.ts} +6 -2
- package/dist/overlay/managed-dev-overlay.js +111 -0
- package/dist/{assets.d.ts → plugins/assets.d.ts} +1 -1
- package/dist/{cloudflare.d.ts → plugins/cloudflare.d.ts} +1 -1
- package/dist/plugins/cloudflare.js +1 -0
- package/dist/{dashboard.d.ts → plugins/dashboard.d.ts} +1 -1
- package/dist/{icons.d.ts → plugins/icons.d.ts} +1 -1
- package/dist/plugins/icons.js +1 -0
- package/dist/{index.d.ts → plugins/index.d.ts} +1 -1
- package/dist/{managed-dev.d.ts → plugins/managed-dev.d.ts} +1 -1
- package/dist/plugins/managed-dev.js +1 -0
- package/dist/{markdown-frontmatter.d.ts → plugins/markdown-frontmatter.d.ts} +1 -1
- package/dist/{preset.d.ts → plugins/preset.d.ts} +1 -1
- package/dist/plugins/preset.js +1 -0
- package/dist/style.css +1 -1
- package/package.json +15 -37
- package/dist/cloudflare.js +0 -1
- package/dist/icons.js +0 -14
- package/dist/managed-dev-overlay.js +0 -110
- package/dist/managed-dev.js +0 -1
- package/dist/preset.js +0 -1
- /package/dist/{assets.js → plugins/assets.js} +0 -0
- /package/dist/{dashboard.js → plugins/dashboard.js} +0 -0
- /package/dist/{index.js → plugins/index.js} +0 -0
- /package/dist/{markdown-frontmatter.js → plugins/markdown-frontmatter.js} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{readFile as e}from"node:fs/promises";import{isAbsolute as t,relative as n,resolve as r}from"node:path";import{createHash as i}from"node:crypto";import{buildParsedSVG as a,parseSVGContent as o}from"@iconify/utils";import{loadNodeIcon as s}from"@iconify/utils/lib/loader/node-loader";import{createUnplugin as c}from"unplugin";import{camelize as l}from"@iconify/utils/lib/misc/strings";import u from"node:process";import{createDebug as d}from"obug";const f=(e=>`---
|
|
2
|
+
interface Props extends astroHTML.JSX.SVGAttributes {};
|
|
3
|
+
const props = Astro.props;
|
|
4
|
+
---
|
|
5
|
+
${e.replace(`<svg`,`<svg {...props}`)}`),p=(e=>{let t=e.replace(`<svg`,`<svg ...attributes`);return`import { template } from "@ember/template-compiler";
|
|
6
|
+
|
|
7
|
+
const Icon = template(${JSON.stringify(t)})
|
|
8
|
+
export default Icon;`}),m=(async(e,t,n,r)=>{let i=await import(`@svgr/core`),a=await(i.transform||(i.default?i.default.transform??i.default:i.default)||i)(e,{plugins:[`@svgr/plugin-jsx`],ref:r.jsx===`react`,titleProp:r.jsx===`react`},{componentName:l(`${t}-${n}`)});return r.jsx!==`react`&&(a=a.replace(`import * as React from "react";`,``)),a}),h=(e=>{let t=e.indexOf(`>`,e.indexOf(`<svg `)),n=e.lastIndexOf(`</svg`);return`${`${e.slice(0,t)} ...input>`}${`$!{\`${g(e.slice(t+1,n))}\`}`}${e.slice(n)}`});function g(e){return e.replace(/\\.|[$`]/g,e=>{switch(e){case`$`:return`$`;case"`":return```;default:return e}})}const _=(e=>e),ee=(async(e,t,n,r)=>{let i={importSource:`@builder.io/qwik`,runtime:`automatic`,componentName:l(`${t}-${n}`)},a=Object.assign({},i,r),o=(await importModule(`@svgx/core`)).toJsxComponent;return o(e,{...a,defaultExport:!0})}),v=(e=>`export default ${JSON.stringify(e)}`),y=(e=>`export default (props = {}) => ${e.replace(/([{}])/g,`{'$1'}`).replace(/(?<=<svg[\s\S]*?)(>)/i,`{...props}>`)}`);let b;const x=(async e=>{if(b==null)try{let{VERSION:e}=await import(`svelte/compiler`);b=Number(e.split(`.`)[0])>=5}catch{b=!1}let t=e.indexOf(`>`,e.indexOf(`<svg `)),n=e.lastIndexOf(`</svg`),r=`${e.slice(0,t)} {...${b?`p`:`$$props`}}>`;return b?r+=e.slice(t+1,n):r+=`{@html \`${S(e.slice(t+1,n))}\`}`,r+=e.slice(n),b?`<script>const{...p}=$props()<\/script>${r}`:r});function S(e){return e.replace(/\{/g,`{`).replace(/\}/g,`}`).replace(/`/g,```).replace(/\\([trn])/g,` `)}function C(e){let t=/="url\(#/.test(e),n={},r=``;return t&&(e=e.replace(/\b([\w-]+)="url\(#(.+?)\)"/g,(e,t,r)=>(n[r]=`'${r}':'uicons-'+__randId()`,`:${t}="'url(#'+idMap['${r}']+')'"`)).replace(/\bid="(.+?)"/g,(e,t)=>n[t]?`:id="idMap['${t}']"`:e),r=`const __randId = () => Math.random().toString(36).substr(2, 10);const idMap = {${Object.values(n).join(`,`)}};`),{hasID:t,svg:e,injectScripts:r}}const w={astro:f,ember:p,jsx:m,marko:h,none:_,raw:v,solid:y,svelte:x,vue3:(async(e,t,n)=>{let{compileTemplate:r}=await importModule(`@vue/compiler-sfc`),{injectScripts:i,svg:a}=C(e),{code:o}=r({source:a,id:`${t}:${n}`,filename:`${t}-${n}.vue`});return o=`import { markRaw } from 'vue'\n${o}`,o=o.replace(/^export /gm,``),o+=`\n\nexport default markRaw({ name: '${t}-${n}', render${i?`, setup() {${i};return { idMap }}`:``} })`,o+=`
|
|
9
|
+
/* vite-plugin-components disabled */`,o}),"web-components":((e,t,n,{webComponents:r})=>{let i=`${t}-${n}`;r.iconPrefix&&(i=`${r.iconPrefix}-${i}`);let a=l(i),o=`export default class ${a} extends HTMLElement {`;return r.shadow?o+=`constructor() {
|
|
10
|
+
super()
|
|
11
|
+
this.attachShadow({ mode: 'open' }).innerHTML = ${JSON.stringify(e)}
|
|
12
|
+
}`:o+=`connectedCallback() { this.innerHTML = ${JSON.stringify(e)} }`,o+=`}`,r.autoDefine&&(o+=`\ncustomElements.define('${i}', ${a})`),o}),qwik:ee},T=[`/~icons/`,`~icons/`,`virtual:icons/`,`virtual/icons/`],E=RegExp(`${T.map(e=>`^${e}`).join(`|`)}`);function D(e){return E.test(e)}function O(e){return e.replace(E,T[0])}function k(e){if(!D(e))return null;e=e.replace(E,``);let t={},n=e.indexOf(`?`);if(n!==-1){let r=e.slice(n+1);e=e.slice(0,n),new URLSearchParams(r).forEach((e,n)=>{n===`raw`?t.raw=e===``||e===`true`?`true`:`false`:t[n]=e})}e=e.replace(/\.\w+$/,``);let[r,i]=e.split(`/`);return{collection:r,icon:i,query:t}}async function A({collection:e,icon:t,query:n},r){let i=`${e}/${t}`,{scale:a,defaultStyle:o,defaultClass:c,customCollections:l,iconCustomizer:u,transform:d,autoInstall:f=!1,collectionsNodeResolvePath:p}=r,m=await s(e,t,{addXmlNs:!1,scale:a,customCollections:l,autoInstall:f,defaultClass:c,defaultStyle:o,cwd:p,warn:void 0,customizations:{transform:d,async iconCustomizer(e,t,r){await u?.(e,t,r),Object.keys(n).forEach(e=>{let t=n[e];e!==`raw`&&t!=null&&(r[e]=t)})}}});if(!m)throw Error(`Icon \`${i}\` not found`);let h=n.raw===`true`?`raw`:r.compiler;if(h){let n=typeof h==`string`?w[h]:await h.compiler;if(n)return n(m,e,t,r)}throw Error(`Unknown compiler: ${h}`)}async function j(e,t){let n=k(e);return n?A(n,t):null}const M=d(`unplugin-icons:options`);async function N(e){let{scale:t=1.2,defaultStyle:n=``,defaultClass:r=``,compiler:i=await P(),jsx:a=F(),customCollections:o={},iconCustomizer:s=()=>{},transform:c,autoInstall:l=!1,collectionsNodeResolvePath:d=u.cwd()}=e,f=Object.assign({autoDefine:!1,iconPrefix:`icon`},e.webComponents);return M(`compiler`,i),{scale:t,defaultStyle:n,defaultClass:r,customCollections:o,iconCustomizer:s,compiler:i,jsx:a,webComponents:f,transform:c,autoInstall:l,collectionsNodeResolvePath:d}}async function P(){return`jsx`}function F(){return`react`}var I=c((e={})=>{let t=N(e);return{name:`unplugin-icons`,enforce:`pre`,resolveId(t){if(D(t)){let n=O(t),r=n.indexOf(`?`),i=`${(r>-1?n.slice(0,r):n).replace(/\.\w+$/,``).replace(/^\//,``)}${r>-1?`?${n.slice(r+1)}`:``}`,a=k(i)?.query?.raw===`true`?`raw`:e.compiler;if(a&&typeof a!=`string`){let e=a.extension;if(e)return`${i}.${e.startsWith(`.`)?e.slice(1):e}`}else switch(a){case`astro`:return`${i}.astro`;case`jsx`:return`${i}.jsx`;case`qwik`:return`${i}.jsx`;case`marko`:return`${i}.marko`;case`svelte`:return`${i}.svelte`;case`solid`:return`${i}.tsx`}return i}return null},loadInclude(e){return D(e)},async load(e){let n=await j(e,await t)||null;if(n)return{code:n,map:{version:3,mappings:``,sources:[]}}},rollup:{api:{config:e}}}}).vite;const L=`src/assets/icons`,R=`\0coreframe:sprite-icon:`,z=`__COREFRAME_SPRITE_URL__`,B=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function V(t={}){let n=r(t.appIconsDirectory??L);async function i(t){if(B.test(t))try{let i=await e(r(n,`${t}.svg`),`utf8`);X(i,`app/${t}`);let s=o(i);if(!s||!a(s))throw Error(`Icon \`app/${t}\` must contain a valid viewBox`);return i}catch(e){if(re(e)&&e.code===`ENOENT`)return;throw e}}return[H({options:t,loadAppIcon:i,setAppIconsDirectory(e){n=e}}),I({compiler:`jsx`,jsx:`react`,customCollections:{app:i}})]}function H({options:e,loadAppIcon:t,setAppIconsDirectory:n}){let i=new Map,a=``,o,c;return{name:`coreframe:icons`,enforce:`pre`,configResolved(t){o=t,a=Q(t.root,e.appIconsDirectory??L),n(a)},resolveId(e){let t=W(e);return t?`${R}${encodeURIComponent(JSON.stringify(t))}.js`:null},async load(e){let n=U(e);if(!n)return null;n.collection===`app`&&this.addWatchFile(r(a,`${n.icon}.svg`));let c=n.collection===`app`?await t(n.icon):await s(n.collection,n.icon,{addXmlNs:!1,autoInstall:!1,cwd:o.root,scale:1.2});if(!c)throw Error(`Icon \`${n.collection}/${n.icon}\` not found`);let l=G(c,n.collection,n.icon);return i.set(l.id,l),K(l,n.props,o.command===`serve`)},renderStart(){o.command!==`build`||i.size===0||(c=this.emitFile({type:`asset`,name:`coreframe-icons.svg`,source:q(i.values())}))},renderChunk(e){if(!e.includes(z))return null;if(!c)throw Error(`Coreframe sprite asset was not emitted before chunk rendering`);let t=J(o.base,this.getFileName(c));return e.replaceAll(z,t)},handleHotUpdate(e){if(te(a,e.file)){for(let t of e.server.moduleGraph.idToModuleMap.values())(t.id?.includes(`~icons/app/`)||t.id?.startsWith(R))&&e.server.moduleGraph.invalidateModule(t);return e.server.ws.send({type:`full-reload`}),[]}}}}function U(e){if(!e.startsWith(R)||!e.endsWith(`.js`))return null;let t=e.slice(23,-3);return JSON.parse(decodeURIComponent(t))}function W(e){let t=e.indexOf(`?`);if(t===-1)return null;let n=new URLSearchParams(e.slice(t+1));if(!n.has(`sprite`))return null;n.delete(`sprite`);let r=e.slice(0,t).replace(/^\/?(?:~icons|virtual:icons|virtual\/icons)\//,``).replace(/\.\w+$/,``).split(`/`);if(r.length!==2||r.some(e=>!B.test(e)))throw Error(`Invalid sprite icon import: ${e}`);let i=Object.create(null);return n.forEach((e,t)=>{if(t===`raw`)throw Error(`An icon import cannot use both ?sprite and ?raw`);if(t===`style`)throw Error(`Pass sprite icon styles through the component style prop`);i[Z(t)]=e}),{collection:r[0],icon:r[1],props:i}}function G(e,t,n){X(e,`${t}/${n}`);let r=o(e),s=r&&a(r);if(!r||!s)throw Error(`Icon \`${t}/${n}\` must contain a valid viewBox`);let c=`coreframe-icon-${t}-${n}-${i(`sha256`).update(`${t}/${n}\0${s.attributes.viewBox}\0${s.body}`).digest(`hex`).slice(0,12)}`,l=Y(s.body,c),u=r.attribs.preserveAspectRatio?` preserveAspectRatio="${$(r.attribs.preserveAspectRatio)}"`:``;return{id:c,markup:`<symbol id="${c}" viewBox="${$(s.attributes.viewBox)}"${u}>${l}</symbol>`,viewBox:s.attributes.viewBox,width:s.attributes.width,height:s.attributes.height}}function K(e,t,n){let r={...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...t},i=n?`\nregisterSpriteSymbol(${JSON.stringify({id:e.id,markup:e.markup})})\n`:``,a=n?`import { registerSpriteSymbol, SpriteIcon } from "@coreframe/lib/sprite-icon"`:`import { SpriteIcon } from "@coreframe/lib/sprite-icon"`,o=n?`#${e.id}`:`${z}#${e.id}`;return`${a}
|
|
13
|
+
import { createElement } from "react"
|
|
14
|
+
${i}
|
|
15
|
+
const defaultProps = ${JSON.stringify(r)}
|
|
16
|
+
|
|
17
|
+
export default function CoreframeSpriteIcon(props) {
|
|
18
|
+
return createElement(SpriteIcon, {
|
|
19
|
+
...defaultProps,
|
|
20
|
+
...props,
|
|
21
|
+
href: "${o}",
|
|
22
|
+
viewBox: "${e.viewBox}",
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
`}function q(e){return`<svg xmlns="http://www.w3.org/2000/svg" id="coreframe-icon-sprite">${Array.from(e,e=>e.markup).join(``)}</svg>`}function J(e,t){return`${e.endsWith(`/`)?e:`${e}/`}${t}`}function Y(e,t){let n=Array.from(e.matchAll(/\bid=(['"])(.*?)\1/g),e=>e[2]),r=e;for(let[e,i]of n.entries()){let n=ne(i),a=`${t}-${e+1}`;r=r.replace(RegExp(`\\bid=(['"])${n}\\1`,`g`),`id="${a}"`).replace(RegExp(`(["#;])${n}(?=[)"']|\\.[a-z])`,`g`),`$1${a}`)}return r}function X(e,t){if(/<(?:script|foreignObject)\b/i.test(e)||/\son[a-z]+\s*=/i.test(e))throw Error(`Icon \`${t}\` contains executable SVG content`);if(/\b(?:href|xlink:href)\s*=\s*['"](?!#)/i.test(e))throw Error(`Icon \`${t}\` contains an external SVG reference`)}function Z(e){return e===`class`?`className`:e.startsWith(`aria-`)||e.startsWith(`data-`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Q(e,n){return t(n)?n:r(e,n)}function te(e,r){let i=n(e,r);return i!==``&&!i.startsWith(`..`)&&!t(i)}function $(e){return e.replaceAll(`&`,`&`).replaceAll(`"`,`"`)}function ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function re(e){return e instanceof Error&&`code`in e}export{V as t};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
|
|
3
|
-
//#region managed-dev-overlay.d.ts
|
|
3
|
+
//#region overlay/managed-dev-overlay.d.ts
|
|
4
4
|
type ManagedDevOverlayIndicatorProps = {
|
|
5
5
|
color?: string;
|
|
6
|
+
paused?: boolean;
|
|
6
7
|
size?: number | string;
|
|
8
|
+
warningColor?: string;
|
|
7
9
|
};
|
|
8
10
|
type ManagedDevOverlayProps = {
|
|
9
11
|
indicator?: ReactNode;
|
|
@@ -14,7 +16,9 @@ declare function ManagedDevOverlay({
|
|
|
14
16
|
}: ManagedDevOverlayProps): import("react").ReactPortal | null;
|
|
15
17
|
declare function ManagedDevOverlayIndicator({
|
|
16
18
|
color,
|
|
17
|
-
|
|
19
|
+
paused,
|
|
20
|
+
size,
|
|
21
|
+
warningColor
|
|
18
22
|
}: ManagedDevOverlayIndicatorProps): import("react").JSX.Element;
|
|
19
23
|
//#endregion
|
|
20
24
|
export { ManagedDevOverlay, ManagedDevOverlayIndicator, ManagedDevOverlayIndicatorProps, ManagedDevOverlayProps, toggleManagedDevOverlay };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import{managedDevEvents as e}from"@coreframe/scripts/managed-dev-protocol";import{cloneElement as t,createContext as n,createElement as r,forwardRef as i,isValidElement as a,useCallback as o,useContext as s,useEffect as c,useRef as l,useState as u,useSyncExternalStore as d}from"react";import{createPortal as f}from"react-dom";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g=()=>{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},_=(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=g();return s&&o.setAttribute(`nonce`,s),o.textContent=t,n.appendChild(o),o},v=`data-isolet`,y=(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=`[${v}="${e}"]`,i=t.querySelector(r);if(i)return{host:i,shadowRoot:null,container:i,target:t};let a=document.createElement(`div`);if(a.setAttribute(v,e),n.hostAttributes)for(let[e,t]of Object.entries(n.hostAttributes))a.setAttribute(e,t);return b(a,n),n.css&&_(e,n.css,t),t.appendChild(a),{host:a,shadowRoot:null,container:a,target:t}}let i=`[${v}="${e}"]`,a=t.querySelector(i);if(a){if(r===`shadow-dom`&&a.shadowRoot){let e=a.shadowRoot.querySelector(`[${v}-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(v,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&&_(e,n.css,r);let i=document.createElement(`div`);return i.setAttribute(`${v}-root`,``),r.appendChild(i),b(o,n),t.appendChild(o),{host:o,shadowRoot:r,container:i,target:t}}return b(o,n),n.css&&_(e,n.css,t),t.appendChild(o),{host:o,shadowRoot:null,container:o,target:t}},b=(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))},x=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),S=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),C=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),w=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=C(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 T={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 ee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=n({}),D=()=>s(E),O=i(({color:e,size:t,strokeWidth:n,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=``}=D()??{},h=i??f?Number(n??d)*24/Number(t??u):n??d;return r(`svg`,{ref:l,...T,width:t??u??T.width,height:t??u??T.height,stroke:e??p,strokeWidth:h,className:x(`lucide`,m,a),...!o&&!ee(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>r(e,t)),...Array.isArray(o)?o:[o]])}),k=(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 n=i(({className:n,...i},a)=>r(O,{ref:a,iconNode:t,className:x(`lucide-${S(w(e))}`,`lucide-${e}`,n),...i}));return n.displayName=w(e),n},A=k(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),j=k(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),te=k(`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`}]]),M=k(`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`}]]),N=k(`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`}]]),P=k(`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`}]]),F=k(`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`}]]),I=k(`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
|
+
/**
|
|
104
|
+
* @license lucide-react v1.24.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/
|
|
109
|
+
;function L(){return import.meta.hot}var R={actionError:`actionError`,actions:`actions`,actionSuccess:`actionSuccess`,button:`button`,checkbox:`checkbox`,checkCommand:`checkCommand`,checkFailure:`checkFailure`,checkMessage:`checkMessage`,codexOutput:`codexOutput`,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`,setupFailure:`setupFailure`,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}.codexOutput{background:color-mix(in srgb, CanvasText 6%, Canvas);border:1px solid color-mix(in srgb, CanvasText 14%, transparent);box-sizing:border-box;white-space:pre-wrap;word-break:break-word;border-radius:10px;max-height:280px;margin:0;padding:10px;font:12px/1.5 ui-monospace,monospace;overflow:auto}.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}.checkFailure{background:color-mix(in srgb, #ef4444 10%, Canvas);border:1px solid #dc26266b;border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:10px;display:flex}.checkCommand{margin:0;font-family:ui-monospace,monospace;font-weight:600}.checkMessage{margin:3px 0 0;font-size:12px}.setupFailure{background:color-mix(in srgb, #ef4444 10%, Canvas);border:1px solid #dc26266b;border-radius:10px;grid-template-columns:auto 1fr;align-items:start;gap:8px;padding:10px;display:grid}.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)}}
|
|
110
|
+
`;let z=!1,re=0;const B=new Set;function V(){H(!z)}function H(e){if(z!==e){z=e;for(let e of B)e()}}function U({indicator:e}){let[n,r]=u(null),{act:i,codex:o,dismissError:s,dismissSuccess:l,error:p,status:g,success:_}=se(),v=d(Z,Q,$);c(()=>{let e=!0,t=y(`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&&r(t.container)}),()=>{e=!1,t.host?.remove()}},[]),c(()=>{if(!_||_.persistent)return;let e=setTimeout(()=>{l(),H(!1)},1600);return()=>clearTimeout(e)},[l,_]);let b=g?.mode===`waiting`&&!!g.message,x=e??m(W,{}),S=a(x)&&x.type===W?t(x,{paused:b}):x;return n?f(h(`div`,{className:R.surface,children:[X(g)?S:null,v?m(G,{act:i,codex:o,dismissError:s,error:p,status:g,success:_}):null]}),n):null}function W({color:e=`#2563eb`,paused:t=!1,size:n=14,warningColor:r=`#f97316`}){let i=d(Z,Q,$),a={"--managed-dev-indicator-color":t?r:e,"--managed-dev-indicator-size":typeof n==`number`?`${n}px`:n};return m(`button`,{"aria-controls":`coreframe-managed-dev-dialog`,"aria-expanded":i,"aria-label":`${i?`Hide`:`Show`} Coreframe managed development`,className:R.indicatorButton,onClick:V,style:a,type:`button`,children:m(`span`,{className:R.indicatorDot})})}function G({act:e,codex:t,dismissError:n,error:r,status:i,success:a}){let[o,s]=u({value:``}),[d,f]=u(()=>({paths:new Set})),g=l(null),_=i?.draft,v=i?.target,y=d.fingerprint===_?.fingerprint?d.paths:new Set(_?.untracked??[]),b=o.fingerprint===_?.fingerprint&&o.proposal===i?.proposal?o.value:i?.proposal??``,x=!!(_?.untracked.length&&_.untracked.every(e=>y.has(e)));return c(()=>{let e=g.current;e&&t?.phase===`running`&&(e.scrollTop=e.scrollHeight)},[t]),h(`dialog`,{"aria-labelledby":`coreframe-managed-title`,className:R.dialog,id:`coreframe-managed-dev-dialog`,open:!0,children:[h(`div`,{className:R.header,children:[m(`h2`,{className:R.title,id:`coreframe-managed-title`,children:a?.heading??(t?.phase===`complete`?`Rebase completed.`:t?.phase===`error`?`Rebase failed.`:t?`Rebasing with Codex…`:Y(i))}),m(`button`,{"aria-label":`Close managed development`,className:R.iconButton,onClick:V,type:`button`,children:m(I,{"aria-hidden":`true`,size:18})})]}),h(`div`,{className:R.content,children:[a?h(`div`,{className:R.actionSuccess,role:`status`,children:[m(A,{"aria-hidden":`true`,className:R.successIcon,size:18}),m(`p`,{className:R.paragraph,children:a.message})]}):null,r?h(`div`,{className:R.actionError,role:`alert`,children:[m(F,{"aria-hidden":`true`,className:R.errorIcon,size:18}),m(`p`,{className:R.paragraph,children:r}),m(`button`,{"aria-label":`Dismiss error`,className:R.iconButton,onClick:n,type:`button`,children:m(I,{"aria-hidden":`true`,size:16})})]}):null,!a&&t?m(`pre`,{"aria-live":`polite`,className:R.codexOutput,ref:g,role:`log`,children:t.message||`Waiting for Codex output…`}):!a&&i?.setupFailure?h(p,{children:[h(`div`,{className:R.setupFailure,role:`alert`,children:[m(F,{"aria-hidden":`true`,className:R.errorIcon,size:18}),m(`p`,{className:R.paragraph,children:i.setupFailure.message})]}),m(`pre`,{className:R.codexOutput,children:i.setupFailure.output}),h(q,{children:[m(J,{busy:i.busy,icon:j,onClick:()=>void navigator.clipboard.writeText(ae(i.setupFailure)),children:`Copy diagnostics`}),i.setupFailure.stage===`dependencies`?m(J,{busy:i.busy,icon:M,onClick:()=>void e({type:`retry-install`}),primary:!0,children:`Retry install`}):m(J,{busy:i.busy,icon:N,onClick:()=>{window.confirm(`Reset the local database? This permanently deletes its current data, then reapplies migrations and seed scripts.`)&&e({type:`reset-database`})},primary:!0,children:`Reset database`})]})]}):a?null:m(`p`,{className:R.paragraph,children:i?i.busy||i.message||ie(i):`Checking managed development status…`}),!a&&!t&&i?.mode===`waiting`&&i.message?h(`p`,{className:R.paragraph,children:[`To re-enable managed development, run `,m(`code`,{children:`git switch main`}),` in the primary checkout. Synchronization will resume automatically.`]}):null,!a&&!t&&v&&!_?h(`p`,{className:R.paragraph,children:[v.subject,` (`,v.shortCommit,`)`]}):null,!a&&!t?i?.warnings.map((e,t)=>m(`p`,{className:`${R.paragraph} ${R.warning}`,children:e},`${t}-${e}`)):null,a?null:i?.checks?.commands.filter(e=>e.status===`failed`).map(e=>h(`div`,{className:R.checkFailure,role:`alert`,children:[h(`div`,{children:[h(`p`,{className:R.checkCommand,children:[e.command,` failed`]}),m(`p`,{className:R.checkMessage,children:`Copy the output and paste it into your agent orchestration tool.`})]}),m(J,{icon:j,onClick:()=>void navigator.clipboard.writeText(e.output??``),children:`Copy output`})]},e.command)),!a&&!t&&_?h(p,{children:[h(`div`,{className:R.files,children:[_.untracked.map(e=>m(K,{checked:y.has(e),label:m(`span`,{className:R.filePath,children:e}),onChange:t=>f(()=>{let n=new Set(y);return t?n.add(e):n.delete(e),{fingerprint:_.fingerprint,paths:n}})},e)),_.untracked.length>0?m(K,{checked:x,label:`Include all untracked files`,onChange:e=>f({fingerprint:_.fingerprint,paths:e?new Set(_.untracked):new Set})}):null]}),i.proposal===void 0?h(q,{children:[v?m(J,{busy:i.busy,icon:N,onClick:()=>void e({type:`reject`}),children:`Reject`}):null,m(J,{busy:i.busy,icon:P,onClick:()=>void e({type:`message`,fingerprint:_.fingerprint,untracked:[...y]}),primary:!0,children:`Generate commit message`})]}):h(p,{children:[m(`textarea`,{"aria-label":`Commit message`,className:R.message,onChange:e=>s({fingerprint:_.fingerprint,proposal:i.proposal,value:e.target.value}),value:b}),h(q,{children:[v?m(J,{busy:i.busy,icon:N,onClick:()=>void e({type:`reject`}),children:`Reject`}):null,m(J,{busy:i.busy,icon:te,onClick:()=>{e(v?{type:`apply`,target:v.commit,fingerprint:_.fingerprint,untracked:[...y],message:b}:{type:`commit`,fingerprint:_.fingerprint,untracked:[...y],message:b})},primary:!0,children:v?`Commit and refresh`:`Commit changes`})]})]})]}):!a&&v?m(q,{children:m(J,{busy:i.busy,icon:M,onClick:()=>void e({type:`prepare`,target:v.commit}),primary:!0,children:v.source===`upstream`?`Refresh`:String(v.source)===`dev`?`Sync with dev`:`Sync with main`})}):null]})]})}function K({checked:e,label:t,onChange:n}){return h(`label`,{className:R.checkbox,children:[m(`input`,{checked:e,onChange:e=>n(e.target.checked),type:`checkbox`}),t]})}function q({children:e}){return m(`div`,{className:R.actions,children:e})}function J({busy:e,children:t,icon:n,onClick:r,primary:i=!1}){return h(`button`,{"aria-busy":!!e,className:`${R.button} ${i?R.primary:``}`,disabled:!!e,onClick:r,type:`button`,children:[n?m(n,{"aria-hidden":`true`,size:16}):null,t]})}function Y(e){return e?e.mode===`waiting`&&e.message?`Managed development paused`:e.mode===`unmanaged`?`Managed development unavailable`:e.mode===`error`?`Managed development stopped`:e.setupFailure?.stage===`dependencies`?`Dependency installation failed`:e.setupFailure?.stage===`migration`?`Database setup failed`: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.checks?.commands.some(e=>e.status===`failed`)?`Managed development checks failed`:e.warnings.length>0?`Managed development warning`:`Managed development status`:`Checking managed development`}function ie(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.draft&&!e.target?`Commit the local changes before managed development checks for updates.`: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 X(e){return e?e.mode===`waiting`?!!e.message:e.mode!==`managed`||e.checks?.commands.some(e=>e.status===`failed`)?!0:!!(e.busy||e.draft||e.message||e.setupFailure||e.target||e.warnings.length>0):!1}function ae(e){return[e.message,`Commit: ${e.commit}`,`Command: ${e.command}`,``,e.output].join(`
|
|
111
|
+
`)}function oe(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===`commit`?{heading:`Changes committed`,message:`Your local changes are committed. Checking for managed development updates…`,preserveDuringStatus:!0}:e.type===`reject`?{heading:`Update dismissed`,message:`No further action is required.`}:e.type===`retry-install`?{heading:`Setup complete`,message:`Dependencies installed and the project is ready.`}:e.type===`reset-database`?{heading:`Database reset complete`,message:`The database was recreated, migrated, and seeded.`}:{heading:`Action complete`,message:`No further action is required.`}}function se(){let[t,n]=u(),[r,i]=u(),[a,s]=u(),[d,f]=u(),p=l(void 0),m=l(new Map),h=L();return c(()=>{if(!h)return;let t=m.current,r=({status:e})=>{n(e),X(e)&&s(e=>e?.preserveDuringStatus?e:void 0)},a=e=>{let r=t.get(e.requestId);if(r){if(t.delete(e.requestId),e.status&&n(e.status),e.error)i(e.error);else if(e.status&&(r.type===`commit`||!X(e.status))){let t=p.current;t?.requestId===e.requestId&&t.phase===`complete`?(s({heading:`Rebase completed.`,message:t.message||`Codex resolved the conflicts.`,persistent:!0}),p.current=void 0,f(void 0)):s(oe(r))}}},o=e=>{if(!t.has(e.requestId))return;if(e.phase===`start`){let t={message:``,phase:`running`,requestId:e.requestId};p.current=t,f(t),H(!0);return}let n=p.current;if(!n||n.requestId!==e.requestId)return;let r=e.phase===`stderr`?{...n,message:`${n.message}${e.text}`.slice(-1e5)}:e.phase===`complete`?{message:e.message||`Codex resolved the conflicts.`,phase:`complete`,requestId:e.requestId}:{...n,phase:`error`};p.current=r,f(r)};return h.on(e.status,r),h.on(e.actionResult,a),h.on(e.codex,o),h.send(e.statusRequest),()=>{t.clear(),p.current=void 0,h.off(e.status,r),h.off(e.actionResult,a),h.off(e.codex,o)}},[h]),{act:async t=>{if(i(void 0),s(void 0),p.current=void 0,f(void 0),!h){i(`The Vite HMR connection is unavailable.`);return}let n=String(++re);m.current.set(n,t),h.send(e.action,{action:t,requestId:n})},codex:d,dismissError:()=>i(void 0),dismissSuccess:o(()=>s(void 0),[]),error:r,status:t,success:a}}function Z(e){return B.add(e),()=>B.delete(e)}function Q(){return z}function $(){return!1}export{U as ManagedDevOverlay,W as ManagedDevOverlayIndicator,V as toggleManagedDevOverlay};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[`DATABASE_URL`,`PGDATABASE`,`PGHOST`,`PGPASSWORD`,`PGPORT`,`PGUSER`,`TURSO_AUTH_TOKEN`,`TURSO_DATABASE_URL`,`PORTLESS_URL`];function t(t){if(process.env.CLOUDFLARE_ENV!==`development`)return;let n=Object.fromEntries(e.flatMap(e=>{let t=process.env[e];return t?[[e,t]]:[]}));if(Object.keys(n).length!==0)return{vars:{...t.vars,...n}}}export{t as coreframeCloudflareConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"../icons-Dn2tl9hg.js";export{e as coreframeIconsPlugin};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { startManagedDevSession } from "@coreframe/scripts/managed-dev";
|
|
2
2
|
import { Plugin } from "vite";
|
|
3
3
|
|
|
4
|
-
//#region managed-dev.d.ts
|
|
4
|
+
//#region plugins/managed-dev.d.ts
|
|
5
5
|
type CoreframeManagedDevPluginOptions = {
|
|
6
6
|
env?: NodeJS.ProcessEnv;
|
|
7
7
|
startSession?: typeof startManagedDevSession;
|
|
@@ -0,0 +1 @@
|
|
|
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:a=t}={}){let o=i[n]===`1`,l;return{name:`coreframe:managed-dev`,apply:`serve`,config(){return{define:{"import.meta.env.COREFRAME_MANAGED_DEV":JSON.stringify(o)}}},async configureServer(t){if(!o)return;let n=t.config.root,u=!1,d=new WeakMap,f=(e,t)=>{d.set(t,{forwardedFor:c(e.headers[`x-forwarded-for`]),forwardedHost:c(e.headers[`x-forwarded-host`]),forwardedProto:c(e.headers[`x-forwarded-proto`])})};t.httpServer?.prependListener(`upgrade`,f),l=await a({config:await e({cwd:n}),cwd:n,env:i,onRestart:()=>{u=!0},onStatusChange:()=>t.ws.send(r.status,{status:l.getStatus()})}),await l.activate();let p=(e,t)=>t.send(r.status,{status:l.getStatus()}),m=async(e,n)=>{let a;if(!s(n,i,d))a=Error(`Managed development actions require a loopback client.`);else try{let i=await l.action(e.action,{onCodexEvent:t=>n.send(r.codex,{...t,requestId:e.requestId})});n.send(r.actionResult,{requestId:e.requestId,...i}),u&&(u=!1,queueMicrotask(()=>void t.restart()));return}catch(e){a=e}let o=a instanceof Error?a.message:String(a);t.config.logger.error(`Coreframe managed development action failed: ${o}`,{error:a instanceof Error?a:void 0}),n.send(r.actionResult,{error:o,requestId:e.requestId,status:l.getStatus()})};t.ws.on(r.statusRequest,p),t.ws.on(r.action,m),t.httpServer?.once(`close`,()=>{t.httpServer?.off(`upgrade`,f),t.ws.off(r.statusRequest,p),t.ws.off(r.action,m),l?.close()})},async closeBundle(){await l?.close()}}}function a(e){return e.socket._socket?.remoteAddress}function o(e){return e.socket._socket}function s(e,t,n){if(!u(a(e)))return!1;let r=t.PORTLESS_URL;if(!r)return!0;if(l(t))return!1;let i=o(e),s=i&&n.get(i);if(!s)return!1;let c;try{c=new URL(r)}catch{return!1}let d=c.protocol.slice(0,-1),f=s.forwardedFor?.split(`,`).map(e=>e.trim());return c.protocol===`https:`&&s.forwardedHost?.toLowerCase()===c.host&&s.forwardedProto?.toLowerCase()===d&&f!==void 0&&f.length>0&&f.every(e=>e.length>0&&u(e))}function c(e){return typeof e==`string`?e:void 0}function l(e){return e.PORTLESS_LAN===`1`||e.PORTLESS_TAILSCALE===`1`||e.PORTLESS_FUNNEL===`1`||e.PORTLESS_NGROK===`1`||!!e.PORTLESS_TAILSCALE_URL||!!e.PORTLESS_NGROK_URL}function u(e){return e===`127.0.0.1`||e===`::1`||e?.startsWith(`::ffff:127.`)}export{i as coreframeManagedDevPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{coreframeAssetsPlugin as e}from"./assets.js";import{coreframeDashboardPlugin as t}from"./dashboard.js";import{t as n}from"../icons-Dn2tl9hg.js";import{coreframeManagedDevPlugin as r}from"./managed-dev.js";function i(){return[e(),...n(),r(),t()]}export{i as coreframeVitePreset};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
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}.codexOutput{background:color-mix(in srgb, CanvasText 6%, Canvas);border:1px solid color-mix(in srgb, CanvasText 14%, transparent);box-sizing:border-box;white-space:pre-wrap;word-break:break-word;border-radius:10px;max-height:280px;margin:0;padding:10px;font:12px/1.5 ui-monospace,monospace;overflow:auto}.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}.checkFailure{background:color-mix(in srgb, #ef4444 10%, Canvas);border:1px solid #dc26266b;border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:10px;display:flex}.checkCommand{margin:0;font-family:ui-monospace,monospace;font-weight:600}.checkMessage{margin:3px 0 0;font-size:12px}.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)}}
|
|
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}.codexOutput{background:color-mix(in srgb, CanvasText 6%, Canvas);border:1px solid color-mix(in srgb, CanvasText 14%, transparent);box-sizing:border-box;white-space:pre-wrap;word-break:break-word;border-radius:10px;max-height:280px;margin:0;padding:10px;font:12px/1.5 ui-monospace,monospace;overflow:auto}.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}.checkFailure{background:color-mix(in srgb, #ef4444 10%, Canvas);border:1px solid #dc26266b;border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:10px;display:flex}.checkCommand{margin:0;font-family:ui-monospace,monospace;font-weight:600}.checkMessage{margin:3px 0 0;font-size:12px}.setupFailure{background:color-mix(in srgb, #ef4444 10%, Canvas);border:1px solid #dc26266b;border-radius:10px;grid-template-columns:auto 1fr;align-items:start;gap:8px;padding:10px;display:grid}.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.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/airlock-labs/coreframe.git",
|
|
@@ -12,40 +12,16 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"default": "./dist/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./assets": {
|
|
19
|
-
"types": "./dist/assets.d.ts",
|
|
20
|
-
"default": "./dist/assets.js"
|
|
21
|
-
},
|
|
22
|
-
"./cloudflare": {
|
|
23
|
-
"types": "./dist/cloudflare.d.ts",
|
|
24
|
-
"default": "./dist/cloudflare.js"
|
|
25
|
-
},
|
|
26
|
-
"./dashboard": {
|
|
27
|
-
"types": "./dist/dashboard.d.ts",
|
|
28
|
-
"default": "./dist/dashboard.js"
|
|
29
|
-
},
|
|
30
|
-
"./icons": {
|
|
31
|
-
"types": "./dist/icons.d.ts",
|
|
32
|
-
"default": "./dist/icons.js"
|
|
33
|
-
},
|
|
34
|
-
"./markdown-frontmatter": {
|
|
35
|
-
"types": "./dist/markdown-frontmatter.d.ts",
|
|
36
|
-
"default": "./dist/markdown-frontmatter.js"
|
|
37
|
-
},
|
|
38
|
-
"./managed-dev": {
|
|
39
|
-
"types": "./dist/managed-dev.d.ts",
|
|
40
|
-
"default": "./dist/managed-dev.js"
|
|
15
|
+
"types": "./dist/plugins/index.d.ts",
|
|
16
|
+
"default": "./dist/plugins/index.js"
|
|
41
17
|
},
|
|
42
18
|
"./managed-dev-overlay": {
|
|
43
|
-
"types": "./dist/managed-dev-overlay.d.ts",
|
|
44
|
-
"default": "./dist/managed-dev-overlay.js"
|
|
19
|
+
"types": "./dist/overlay/managed-dev-overlay.d.ts",
|
|
20
|
+
"default": "./dist/overlay/managed-dev-overlay.js"
|
|
45
21
|
},
|
|
46
|
-
"
|
|
47
|
-
"types": "./dist/
|
|
48
|
-
"default": "./dist/
|
|
22
|
+
"./*": {
|
|
23
|
+
"types": "./dist/plugins/*.d.ts",
|
|
24
|
+
"default": "./dist/plugins/*.js"
|
|
49
25
|
}
|
|
50
26
|
},
|
|
51
27
|
"dependencies": {
|
|
@@ -53,10 +29,11 @@
|
|
|
53
29
|
"@svgr/core": "^8.1.0",
|
|
54
30
|
"@svgr/plugin-jsx": "^8.1.0",
|
|
55
31
|
"lucide-react": "^1.24.0",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"@coreframe/lib": "^0.1.
|
|
59
|
-
"@coreframe/
|
|
32
|
+
"obug": "^2.1.3",
|
|
33
|
+
"unplugin": "^2.3.11",
|
|
34
|
+
"@coreframe/lib": "^0.1.10",
|
|
35
|
+
"@coreframe/dashboard": "^0.2.8",
|
|
36
|
+
"@coreframe/scripts": "^0.1.30"
|
|
60
37
|
},
|
|
61
38
|
"devDependencies": {
|
|
62
39
|
"@tsdown/css": "0.22.3",
|
|
@@ -68,6 +45,7 @@
|
|
|
68
45
|
"react-dom": "^19.2.7",
|
|
69
46
|
"tsdown": "0.22.3",
|
|
70
47
|
"typescript": "6.0.3",
|
|
48
|
+
"unplugin-icons": "^23.0.1",
|
|
71
49
|
"vite": "^8.1.0",
|
|
72
50
|
"vitest": "^4.1.9"
|
|
73
51
|
},
|
|
@@ -77,7 +55,7 @@
|
|
|
77
55
|
"vite": "^8.0.0"
|
|
78
56
|
},
|
|
79
57
|
"scripts": {
|
|
80
|
-
"build": "tsdown
|
|
58
|
+
"build": "tsdown",
|
|
81
59
|
"test": "vitest run",
|
|
82
60
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
83
61
|
"format": "oxfmt",
|
package/dist/cloudflare.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=[`DATABASE_URL`,`PGDATABASE`,`PGHOST`,`PGPASSWORD`,`PGPORT`,`PGUSER`,`PORTLESS_URL`];function t(t){if(process.env.CLOUDFLARE_ENV!==`development`)return;let n=Object.fromEntries(e.flatMap(e=>{let t=process.env[e];return t?[[e,t]]:[]}));if(Object.keys(n).length!==0)return{vars:{...t.vars,...n}}}export{t as coreframeCloudflareConfig};
|
package/dist/icons.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{readFile as e}from"node:fs/promises";import{isAbsolute as t,relative as n,resolve as r}from"node:path";import{createHash as i}from"node:crypto";import{buildParsedSVG as a,parseSVGContent as o}from"@iconify/utils";import{loadNodeIcon as s}from"@iconify/utils/lib/loader/node-loader";import c from"unplugin-icons/vite";const l=`src/assets/icons`,u=`\0coreframe:sprite-icon:`,d=`__COREFRAME_SPRITE_URL__`,f=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function p(t={}){let n=r(t.appIconsDirectory??l);async function i(t){if(f.test(t))try{let i=await e(r(n,`${t}.svg`),`utf8`);S(i,`app/${t}`);let s=o(i);if(!s||!a(s))throw Error(`Icon \`app/${t}\` must contain a valid viewBox`);return i}catch(e){if(O(e)&&e.code===`ENOENT`)return;throw e}}return[m({options:t,loadAppIcon:i,setAppIconsDirectory(e){n=e}}),c({compiler:`jsx`,jsx:`react`,customCollections:{app:i}})]}function m({options:e,loadAppIcon:t,setAppIconsDirectory:n}){let i=new Map,a=``,o,c;return{name:`coreframe:icons`,enforce:`pre`,configResolved(t){o=t,a=w(t.root,e.appIconsDirectory??l),n(a)},resolveId(e){let t=g(e);return t?`${u}${encodeURIComponent(JSON.stringify(t))}.js`:null},async load(e){let n=h(e);if(!n)return null;n.collection===`app`&&this.addWatchFile(r(a,`${n.icon}.svg`));let c=n.collection===`app`?await t(n.icon):await s(n.collection,n.icon,{addXmlNs:!1,autoInstall:!1,cwd:o.root,scale:1.2});if(!c)throw Error(`Icon \`${n.collection}/${n.icon}\` not found`);let l=_(c,n.collection,n.icon);return i.set(l.id,l),v(l,n.props,o.command===`serve`)},renderStart(){o.command!==`build`||i.size===0||(c=this.emitFile({type:`asset`,name:`coreframe-icons.svg`,source:y(i.values())}))},renderChunk(e){if(!e.includes(d))return null;if(!c)throw Error(`Coreframe sprite asset was not emitted before chunk rendering`);let t=b(o.base,this.getFileName(c));return e.replaceAll(d,t)},handleHotUpdate(e){if(T(a,e.file)){for(let t of e.server.moduleGraph.idToModuleMap.values())(t.id?.includes(`~icons/app/`)||t.id?.startsWith(u))&&e.server.moduleGraph.invalidateModule(t);return e.server.ws.send({type:`full-reload`}),[]}}}}function h(e){if(!e.startsWith(u)||!e.endsWith(`.js`))return null;let t=e.slice(23,-3);return JSON.parse(decodeURIComponent(t))}function g(e){let t=e.indexOf(`?`);if(t===-1)return null;let n=new URLSearchParams(e.slice(t+1));if(!n.has(`sprite`))return null;n.delete(`sprite`);let r=e.slice(0,t).replace(/^\/?(?:~icons|virtual:icons|virtual\/icons)\//,``).replace(/\.\w+$/,``).split(`/`);if(r.length!==2||r.some(e=>!f.test(e)))throw Error(`Invalid sprite icon import: ${e}`);let i=Object.create(null);return n.forEach((e,t)=>{if(t===`raw`)throw Error(`An icon import cannot use both ?sprite and ?raw`);if(t===`style`)throw Error(`Pass sprite icon styles through the component style prop`);i[C(t)]=e}),{collection:r[0],icon:r[1],props:i}}function _(e,t,n){S(e,`${t}/${n}`);let r=o(e),s=r&&a(r);if(!r||!s)throw Error(`Icon \`${t}/${n}\` must contain a valid viewBox`);let c=`coreframe-icon-${t}-${n}-${i(`sha256`).update(`${t}/${n}\0${s.attributes.viewBox}\0${s.body}`).digest(`hex`).slice(0,12)}`,l=x(s.body,c),u=r.attribs.preserveAspectRatio?` preserveAspectRatio="${E(r.attribs.preserveAspectRatio)}"`:``;return{id:c,markup:`<symbol id="${c}" viewBox="${E(s.attributes.viewBox)}"${u}>${l}</symbol>`,viewBox:s.attributes.viewBox,width:s.attributes.width,height:s.attributes.height}}function v(e,t,n){let r={...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...t},i=n?`\nregisterSpriteSymbol(${JSON.stringify({id:e.id,markup:e.markup})})\n`:``,a=n?`import { registerSpriteSymbol, SpriteIcon } from "@coreframe/lib/sprite-icon"`:`import { SpriteIcon } from "@coreframe/lib/sprite-icon"`,o=n?`#${e.id}`:`${d}#${e.id}`;return`${a}
|
|
2
|
-
import { createElement } from "react"
|
|
3
|
-
${i}
|
|
4
|
-
const defaultProps = ${JSON.stringify(r)}
|
|
5
|
-
|
|
6
|
-
export default function CoreframeSpriteIcon(props) {
|
|
7
|
-
return createElement(SpriteIcon, {
|
|
8
|
-
...defaultProps,
|
|
9
|
-
...props,
|
|
10
|
-
href: "${o}",
|
|
11
|
-
viewBox: "${e.viewBox}",
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
`}function y(e){return`<svg xmlns="http://www.w3.org/2000/svg" id="coreframe-icon-sprite">${Array.from(e,e=>e.markup).join(``)}</svg>`}function b(e,t){return`${e.endsWith(`/`)?e:`${e}/`}${t}`}function x(e,t){let n=Array.from(e.matchAll(/\bid=(['"])(.*?)\1/g),e=>e[2]),r=e;for(let[e,i]of n.entries()){let n=D(i),a=`${t}-${e+1}`;r=r.replace(RegExp(`\\bid=(['"])${n}\\1`,`g`),`id="${a}"`).replace(RegExp(`(["#;])${n}(?=[)"']|\\.[a-z])`,`g`),`$1${a}`)}return r}function S(e,t){if(/<(?:script|foreignObject)\b/i.test(e)||/\son[a-z]+\s*=/i.test(e))throw Error(`Icon \`${t}\` contains executable SVG content`);if(/\b(?:href|xlink:href)\s*=\s*['"](?!#)/i.test(e))throw Error(`Icon \`${t}\` contains an external SVG reference`)}function C(e){return e===`class`?`className`:e.startsWith(`aria-`)||e.startsWith(`data-`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function w(e,n){return t(n)?n:r(e,n)}function T(e,r){let i=n(e,r);return i!==``&&!i.startsWith(`..`)&&!t(i)}function E(e){return e.replaceAll(`&`,`&`).replaceAll(`"`,`"`)}function D(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function O(e){return e instanceof Error&&`code`in e}export{p as coreframeIconsPlugin};
|
|
@@ -1,110 +0,0 @@
|
|
|
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(),b=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),x=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),S=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=x(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 C={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 ee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},w=t({}),T=()=>a(w),te=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,...C,width:t??u??C.width,height:t??u??C.height,stroke:e??p,strokeWidth:h,className:y(`lucide`,m,a),...!o&&!ee(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>n(e,t)),...Array.isArray(o)?o:[o]])}),E=(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(te,{ref:a,iconNode:t,className:y(`lucide-${b(S(e))}`,`lucide-${e}`,r),...i}));return i.displayName=S(e),i},D=E(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),O=E(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),k=E(`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=E(`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=E(`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=E(`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=E(`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=E(`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
|
-
/**
|
|
104
|
-
* @license lucide-react v1.24.0 - ISC
|
|
105
|
-
*
|
|
106
|
-
* This source code is licensed under the ISC license.
|
|
107
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/
|
|
109
|
-
;function F(){return import.meta.hot}var I={actionError:`actionError`,actions:`actions`,actionSuccess:`actionSuccess`,button:`button`,checkbox:`checkbox`,checkCommand:`checkCommand`,checkFailure:`checkFailure`,checkMessage:`checkMessage`,codexOutput:`codexOutput`,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}.codexOutput{background:color-mix(in srgb, CanvasText 6%, Canvas);border:1px solid color-mix(in srgb, CanvasText 14%, transparent);box-sizing:border-box;white-space:pre-wrap;word-break:break-word;border-radius:10px;max-height:280px;margin:0;padding:10px;font:12px/1.5 ui-monospace,monospace;overflow:auto}.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}.checkFailure{background:color-mix(in srgb, #ef4444 10%, Canvas);border:1px solid #dc26266b;border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:10px;display:flex}.checkCommand{margin:0;font-family:ui-monospace,monospace;font-weight:600}.checkMessage{margin:3px 0 0;font-size:12px}.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)}}
|
|
110
|
-
`;let L=!1,R=0;const z=new Set;function B(){V(!L)}function V(e){if(L!==e){L=e;for(let e of z)e()}}function H({indicator:e=f(U,{})}){let[t,n]=c(null),{act:r,codex:i,dismissError:a,dismissSuccess:s,error:d,status:m,success:h}=ie(),g=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(!h||h.persistent)return;let e=setTimeout(()=>{s(),V(!1)},1600);return()=>clearTimeout(e)},[s,h]),t?u(p(`div`,{className:I.surface,children:[X(m)?e:null,g?f(W,{act:r,codex:i,dismissError:a,error:d,status:m,success:h}):null]}),t):null}function U({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:I.indicatorButton,onClick:B,style:r,type:`button`,children:f(`span`,{className:I.indicatorDot})})}function W({act:e,codex:t,dismissError:n,error:r,status:i,success:a}){let[l,u]=c({value:``}),[m,h]=c(()=>({paths:new Set})),g=s(null),_=i?.draft,v=i?.target,y=m.fingerprint===_?.fingerprint?m.paths:new Set(_?.untracked??[]),b=l.fingerprint===_?.fingerprint&&l.proposal===i?.proposal?l.value:i?.proposal??``,x=!!(_?.untracked.length&&_.untracked.every(e=>y.has(e)));return o(()=>{let e=g.current;e&&t?.phase===`running`&&(e.scrollTop=e.scrollHeight)},[t]),p(`dialog`,{"aria-labelledby":`coreframe-managed-title`,className:I.dialog,id:`coreframe-managed-dev-dialog`,open:!0,children:[p(`div`,{className:I.header,children:[f(`h2`,{className:I.title,id:`coreframe-managed-title`,children:a?.heading??(t?.phase===`complete`?`Rebase completed.`:t?.phase===`error`?`Rebase failed.`:t?`Rebasing with Codex…`:J(i))}),f(`button`,{"aria-label":`Close managed development`,className:I.iconButton,onClick:B,type:`button`,children:f(P,{"aria-hidden":`true`,size:18})})]}),p(`div`,{className:I.content,children:[a?p(`div`,{className:I.actionSuccess,role:`status`,children:[f(D,{"aria-hidden":`true`,className:I.successIcon,size:18}),f(`p`,{className:I.paragraph,children:a.message})]}):null,r?p(`div`,{className:I.actionError,role:`alert`,children:[f(N,{"aria-hidden":`true`,className:I.errorIcon,size:18}),f(`p`,{className:I.paragraph,children:r}),f(`button`,{"aria-label":`Dismiss error`,className:I.iconButton,onClick:n,type:`button`,children:f(P,{"aria-hidden":`true`,size:16})})]}):null,!a&&t?f(`pre`,{"aria-live":`polite`,className:I.codexOutput,ref:g,role:`log`,children:t.message||`Waiting for Codex output…`}):a?null:f(`p`,{className:I.paragraph,children:i?i.busy||i.message||Y(i):`Checking managed development status…`}),!a&&!t&&v&&!_?p(`p`,{className:I.paragraph,children:[v.subject,` (`,v.shortCommit,`)`]}):null,!a&&!t?i?.warnings.map((e,t)=>f(`p`,{className:`${I.paragraph} ${I.warning}`,children:e},`${t}-${e}`)):null,a?null:i?.checks?.commands.filter(e=>e.status===`failed`).map(e=>p(`div`,{className:I.checkFailure,role:`alert`,children:[p(`div`,{children:[p(`p`,{className:I.checkCommand,children:[e.command,` failed`]}),f(`p`,{className:I.checkMessage,children:`Copy the output and paste it into your agent orchestration tool.`})]}),f(q,{icon:O,onClick:()=>void navigator.clipboard.writeText(e.output??``),children:`Copy output`})]},e.command)),!a&&!t&&_?p(d,{children:[p(`div`,{className:I.files,children:[_.untracked.map(e=>f(G,{checked:y.has(e),label:f(`span`,{className:I.filePath,children:e}),onChange:t=>h(()=>{let n=new Set(y);return t?n.add(e):n.delete(e),{fingerprint:_.fingerprint,paths:n}})},e)),_.untracked.length>0?f(G,{checked:x,label:`Include all untracked files`,onChange:e=>h({fingerprint:_.fingerprint,paths:e?new Set(_.untracked):new Set})}):null]}),i.proposal===void 0?p(K,{children:[v?f(q,{busy:i.busy,icon:j,onClick:()=>void e({type:`reject`}),children:`Reject`}):null,f(q,{busy:i.busy,icon:M,onClick:()=>void e({type:`message`,fingerprint:_.fingerprint,untracked:[...y]}),primary:!0,children:`Generate commit message`})]}):p(d,{children:[f(`textarea`,{"aria-label":`Commit message`,className:I.message,onChange:e=>u({fingerprint:_.fingerprint,proposal:i.proposal,value:e.target.value}),value:b}),p(K,{children:[v?f(q,{busy:i.busy,icon:j,onClick:()=>void e({type:`reject`}),children:`Reject`}):null,f(q,{busy:i.busy,icon:k,onClick:()=>{e(v?{type:`apply`,target:v.commit,fingerprint:_.fingerprint,untracked:[...y],message:b}:{type:`commit`,fingerprint:_.fingerprint,untracked:[...y],message:b})},primary:!0,children:v?`Commit and refresh`:`Commit changes`})]})]})]}):!a&&v?f(K,{children:f(q,{busy:i.busy,icon:A,onClick:()=>void e({type:`prepare`,target:v.commit}),primary:!0,children:v.source===`upstream`?`Refresh`:String(v.source)===`dev`?`Sync with dev`:`Sync with main`})}):null]})]})}function G({checked:e,label:t,onChange:n}){return p(`label`,{className:I.checkbox,children:[f(`input`,{checked:e,onChange:e=>n(e.target.checked),type:`checkbox`}),t]})}function K({children:e}){return f(`div`,{className:I.actions,children:e})}function q({busy:e,children:t,icon:n,onClick:r,primary:i=!1}){return p(`button`,{"aria-busy":!!e,className:`${I.button} ${i?I.primary:``}`,disabled:!!e,onClick:r,type:`button`,children:[n?f(n,{"aria-hidden":`true`,size:16}):null,t]})}function J(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.checks?.commands.some(e=>e.status===`failed`)?`Managed development checks failed`:e.warnings.length>0?`Managed development warning`:`Managed development status`:`Checking managed development`}function Y(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.draft&&!e.target?`Commit the local changes before managed development checks for updates.`: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 X(e){return!e||e.mode===`waiting`?!1:e.mode!==`managed`||e.checks?.commands.some(e=>e.status===`failed`)?!0:!!(e.busy||e.draft||e.message||e.target||e.warnings.length>0)}function re(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===`commit`?{heading:`Changes committed`,message:`Your local changes are committed. Checking for managed development updates…`,preserveDuringStatus:!0}:e.type===`reject`?{heading:`Update dismissed`,message:`No further action is required.`}:{heading:`Action complete`,message:`No further action is required.`}}function ie(){let[t,n]=c(),[r,a]=c(),[l,u]=c(),[d,f]=c(),p=s(void 0),m=s(new Map),h=F();return o(()=>{if(!h)return;let t=m.current,r=({status:e})=>{n(e),X(e)&&u(e=>e?.preserveDuringStatus?e:void 0)},i=e=>{let r=t.get(e.requestId);if(r){if(t.delete(e.requestId),e.status&&n(e.status),e.error)a(e.error);else if(e.status&&(r.type===`commit`||!X(e.status))){let t=p.current;t?.requestId===e.requestId&&t.phase===`complete`?(u({heading:`Rebase completed.`,message:t.message||`Codex resolved the conflicts.`,persistent:!0}),p.current=void 0,f(void 0)):u(re(r))}}},o=e=>{if(!t.has(e.requestId))return;if(e.phase===`start`){let t={message:``,phase:`running`,requestId:e.requestId};p.current=t,f(t),V(!0);return}let n=p.current;if(!n||n.requestId!==e.requestId)return;let r=e.phase===`stderr`?{...n,message:`${n.message}${e.text}`.slice(-1e5)}:e.phase===`complete`?{message:e.message||`Codex resolved the conflicts.`,phase:`complete`,requestId:e.requestId}:{...n,phase:`error`};p.current=r,f(r)};return h.on(e.status,r),h.on(e.actionResult,i),h.on(e.codex,o),h.send(e.statusRequest),()=>{t.clear(),p.current=void 0,h.off(e.status,r),h.off(e.actionResult,i),h.off(e.codex,o)}},[h]),{act:async t=>{if(a(void 0),u(void 0),p.current=void 0,f(void 0),!h){a(`The Vite HMR connection is unavailable.`);return}let n=String(++R);m.current.set(n,t),h.send(e.action,{action:t,requestId:n})},codex:d,dismissError:()=>a(void 0),dismissSuccess:i(()=>u(void 0),[]),error:r,status:t,success:l}}function Z(e){return z.add(e),()=>z.delete(e)}function Q(){return L}function $(){return!1}export{H as ManagedDevOverlay,U as ManagedDevOverlayIndicator,B as toggleManagedDevOverlay};
|
package/dist/managed-dev.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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:a=t}={}){let o=i[n]===`1`,l;return{name:`coreframe:managed-dev`,apply:`serve`,config(){return{define:{"import.meta.env.COREFRAME_MANAGED_DEV":JSON.stringify(o)}}},async configureServer(t){if(!o)return;let n=t.config.root,u=new WeakMap,d=(e,t)=>{u.set(t,{forwardedFor:c(e.headers[`x-forwarded-for`]),forwardedHost:c(e.headers[`x-forwarded-host`]),forwardedProto:c(e.headers[`x-forwarded-proto`])})};t.httpServer?.prependListener(`upgrade`,d),l=await a({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 f=(e,t)=>t.send(r.status,{status:l.getStatus()}),p=async(e,n)=>{let a;if(!s(n,i,u))a=Error(`Managed development actions require a loopback client.`);else try{let t=await l.action(e.action,{onCodexEvent:t=>n.send(r.codex,{...t,requestId:e.requestId})});n.send(r.actionResult,{requestId:e.requestId,...t});return}catch(e){a=e}let o=a instanceof Error?a.message:String(a);t.config.logger.error(`Coreframe managed development action failed: ${o}`,{error:a instanceof Error?a:void 0}),n.send(r.actionResult,{error:o,requestId:e.requestId,status:l.getStatus()})};t.ws.on(r.statusRequest,f),t.ws.on(r.action,p),t.httpServer?.once(`close`,()=>{t.httpServer?.off(`upgrade`,d),t.ws.off(r.statusRequest,f),t.ws.off(r.action,p),l?.close()})},async closeBundle(){await l?.close()}}}function a(e){return e.socket._socket?.remoteAddress}function o(e){return e.socket._socket}function s(e,t,n){if(!u(a(e)))return!1;let r=t.PORTLESS_URL;if(!r)return!0;if(l(t))return!1;let i=o(e),s=i&&n.get(i);if(!s)return!1;let c;try{c=new URL(r)}catch{return!1}let d=c.protocol.slice(0,-1),f=s.forwardedFor?.split(`,`).map(e=>e.trim());return c.protocol===`https:`&&s.forwardedHost?.toLowerCase()===c.host&&s.forwardedProto?.toLowerCase()===d&&f!==void 0&&f.length>0&&f.every(e=>e.length>0&&u(e))}function c(e){return typeof e==`string`?e:void 0}function l(e){return e.PORTLESS_LAN===`1`||e.PORTLESS_TAILSCALE===`1`||e.PORTLESS_FUNNEL===`1`||e.PORTLESS_NGROK===`1`||!!e.PORTLESS_TAILSCALE_URL||!!e.PORTLESS_NGROK_URL}function u(e){return e===`127.0.0.1`||e===`::1`||e?.startsWith(`::ffff:127.`)}export{i as coreframeManagedDevPlugin};
|
package/dist/preset.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{coreframeAssetsPlugin as e}from"./assets.js";import{coreframeDashboardPlugin as t}from"./dashboard.js";import{coreframeIconsPlugin as n}from"./icons.js";import{coreframeManagedDevPlugin as r}from"./managed-dev.js";function i(){return[e(),...n(),r(),t()]}export{i as coreframeVitePreset};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|