@stacksjs/stx-vscode 0.2.875 → 0.2.876

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacksjs/stx-typescript-plugin",
3
- "version": "0.2.875",
3
+ "version": "0.2.876",
4
4
  "private": true,
5
5
  "main": "index.js"
6
6
  }
@@ -58,7 +58,7 @@ return { context: ${oe}${W.map((L)=>`, ${L.name}: { ...${oe}, ...(${L.args}) }`)
58
58
  `):"",checks:s,dependencies:r}}function ft(e,t){let n=Oe(e);if(!/<script\b(?=[^>]*(?:\bcomponent\b|\bstx:component\b))/i.test(n))return;let s;try{s=ct(e,"component")}catch(h){let b=e.search(/<script\b(?=[^>]*\bcomponent\b)/i),y=h instanceof Error?h.message:"Invalid component metadata";return{declarations:"",checks:[{text:`({})[${JSON.stringify(y)}];`,line:e.slice(0,b).split(`
59
59
  `).length,column:b-e.lastIndexOf(`
60
60
  `,b-1),origin:"component"}],project:(x)=>({code:x,columns:new Map})}}let r=[...n.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)].filter((h)=>/\bclient\b/.test(h[1])&&!/\bcomponent\b/.test(h[1])),i=r.map((h)=>{let b=h.index+h[0].indexOf(">")+1;return e.slice(b,b+h[2].length)}).join(`
61
- `),a=Me(i,t),o=/\b(?:interface|type)\s+ComponentState\b/.test(N(i)),c=Object.entries(s.properties||s.props||{}).map(([h,b])=>`${JSON.stringify(h)}: ${De(b)}`).join("; "),l=[...new Set(a.map((h)=>h.name))],u=[`interface __StxNativeProperties { ${c} }`,o?"declare const __stxStateProperties: Pick<ComponentState, Extract<keyof ComponentState, keyof __StxNativeProperties>>;":"",`type __StxNativeComponent = Omit<HTMLElement, keyof __StxNativeProperties | ${o?"keyof ComponentState | ":""}${l.map((h)=>JSON.stringify(h)).join(" | ")||"never"}> & ${o?"Omit<__StxNativeProperties, keyof ComponentState> & ComponentState":"__StxNativeProperties"} & {`,"readonly updateComplete: Promise<void>; requestUpdate(): Promise<void>; readonly renderRoot: HTMLElement | ShadowRoot;","emit<T = unknown>(name: string, detail?: T, options?: CustomEventInit<T>): boolean;",...l.map((h)=>`${JSON.stringify(h)}: typeof ${h};`),"}"].filter(Boolean).join(`
61
+ `),a=Me(i,t),o=/\b(?:interface|type)\s+ComponentState\b/.test(N(i)),c=Object.entries(s.properties||s.props||{}).map(([h,b])=>`${JSON.stringify(h)}: ${De(b)}`).join("; "),l=[...new Set(a.map((h)=>h.name))],u=[`interface __StxMetadataProperties { ${c} }`,"type __StxNativeProperties = Omit<__StxMetadataProperties, keyof HTMLElement> & Pick<HTMLElement, Extract<keyof __StxMetadataProperties, keyof HTMLElement>>;",o?"declare const __stxStateProperties: Pick<ComponentState, Extract<keyof ComponentState, keyof __StxNativeProperties>>;":"",`type __StxNativeComponent = Omit<HTMLElement, keyof __StxNativeProperties | ${o?"keyof ComponentState | ":""}${l.map((h)=>JSON.stringify(h)).join(" | ")||"never"}> & ${o?"Omit<__StxNativeProperties, keyof ComponentState> & ComponentState":"__StxNativeProperties"} & {`,"readonly updateComplete: Promise<void>; requestUpdate(): Promise<void>; readonly renderRoot: HTMLElement | ShadowRoot;","emit<T = unknown>(name: string, detail?: T, options?: CustomEventInit<T>): boolean;",...l.map((h)=>`${JSON.stringify(h)}: typeof ${h};`),"}"].filter(Boolean).join(`
62
62
  `),p=-1;for(let h of r){let b=h.index+h[0].indexOf(">")+1,y=/\b(?:interface|type)\s+ComponentState\b/.exec(N(e.slice(b,b+h[2].length)));if(y){p=b+y.index;break}}let m=o&&p>=0?[{origin:"client",text:"__stxStateProperties satisfies Pick<__StxNativeProperties, Extract<keyof ComponentState, keyof __StxNativeProperties>>;",line:e.slice(0,p).split(`
63
63
  `).length,column:p-e.lastIndexOf(`
64
64
  `,p-1)}]:[];for(let[h,b]of Object.entries(s.properties||s.props||{})){let y=e.indexOf(JSON.stringify(h),e.indexOf("<script")),x=e.slice(0,y).split(`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx-vscode",
3
3
  "type": "module",
4
- "version": "0.2.875",
4
+ "version": "0.2.876",
5
5
  "description": "stx language support for VS Code extensions to embed: the hovers, completions, diagnostics, grammar, snippets, language configuration and TypeScript server plugin behind the stx extension.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",