code-inspector-core
Advanced tools
Comparing version 0.19.2 to 0.20.0
{ | ||
"name": "code-inspector-core", | ||
"version": "0.19.2", | ||
"version": "0.20.0", | ||
"main": "dist/index.js", | ||
@@ -44,3 +44,3 @@ "module": "./dist/index.mjs", | ||
"dotenv": "^16.1.4", | ||
"launch-ide": "1.0.1", | ||
"launch-ide": "1.0.2", | ||
"portfinder": "^1.0.28" | ||
@@ -47,0 +47,0 @@ }, |
import { LitElement } from 'lit'; | ||
interface NodeParseResultTracked { | ||
isTrackNode: true; | ||
isAstroNode: boolean; | ||
originNode: HTMLElement; | ||
name: string; | ||
path: string; | ||
line: number; | ||
rect: string; | ||
column: number; | ||
} | ||
interface NodeParseResultUntracked { | ||
isTrackNode: false; | ||
} | ||
type NodeParseResult = NodeParseResultTracked | NodeParseResultUntracked; | ||
interface LayerPosition { | ||
left?: string; | ||
right?: string; | ||
top?: string; | ||
bottom?: string; | ||
} | ||
export declare class CodeInspectorComponent extends LitElement { | ||
@@ -47,2 +67,5 @@ hotKeys: string; | ||
show: boolean; | ||
showLayerPanel: boolean; | ||
layerPanelPosition: LayerPosition; | ||
elementTree: any[]; | ||
dragging: boolean; | ||
@@ -61,2 +84,3 @@ mousePosition: { | ||
inspectorSwitchRef: HTMLDivElement; | ||
inspectorLayersRef: HTMLDivElement; | ||
isTracking: (e: any) => boolean | ""; | ||
@@ -66,2 +90,7 @@ getDomPropertyValue: (target: HTMLElement, property: string) => number; | ||
removeCover: () => void; | ||
renderLayerPanel: (nodeTree: NodeParseResult[], { x, y }: { | ||
x: number; | ||
y: number; | ||
}) => void; | ||
removeLayerPanel: () => void; | ||
addGlobalCursorStyle: () => void; | ||
@@ -77,2 +106,8 @@ removeGlobalCursorStyle: () => void; | ||
handleMouseClick: (e: MouseEvent | TouchEvent) => void; | ||
handleContextMenu: (e: MouseEvent) => void; | ||
generateNodeTree: (nodePath: HTMLElement[]) => NodeParseResultTracked[]; | ||
/** | ||
* MARK: 解析节点信息 | ||
*/ | ||
parseNode: (node: HTMLElement) => NodeParseResult; | ||
handlePointerDown: (e: PointerEvent) => void; | ||
@@ -88,2 +123,3 @@ handleKeyUp: (e: KeyboardEvent) => void; | ||
switch: (e: Event) => void; | ||
handleLayerPanelClick: (e: MouseEvent) => void; | ||
protected firstUpdated(): void; | ||
@@ -94,1 +130,2 @@ disconnectedCallback(): void; | ||
} | ||
export {}; |
/// <reference types="node" /> | ||
import http from 'http'; | ||
import { type CodeOptions, type RecordInfo } from '../shared'; | ||
import { PathType, type CodeOptions, type RecordInfo } from '../shared'; | ||
export declare const ProjectRootPath: string; | ||
export declare function getRelativePath(filePath: string): string; | ||
export declare function getRelativeOrAbsolutePath(filePath: string, pathType?: PathType): string; | ||
export declare function createServer(callback: (port: number) => any, options?: CodeOptions): http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>; | ||
export declare function startServer(options: CodeOptions, record: RecordInfo): Promise<void>; |
@@ -1,2 +0,2 @@ | ||
import { EscapeTags } from '../../shared'; | ||
import { EscapeTags, PathType } from '../../shared'; | ||
type FileType = 'vue' | 'jsx' | 'svelte' | unknown; | ||
@@ -8,4 +8,5 @@ type TransformCodeParams = { | ||
escapeTags: EscapeTags; | ||
pathType: PathType; | ||
}; | ||
export declare function transformCode(params: TransformCodeParams): string; | ||
export {}; |
@@ -17,2 +17,3 @@ import type { Editor } from 'launch-ide'; | ||
export type ImportClientWay = 'file' | 'code'; | ||
export type PathType = 'relative' | 'absolute'; | ||
type SourceInfo = { | ||
@@ -152,3 +153,8 @@ file: string; | ||
printServer?: boolean; | ||
/** | ||
* @zh 注入在 DOM 上的路径类型,默认值为 `absolute`,即绝对路径 | ||
* @en The type of path injected into the DOM, the default value is `absolute`, which means the path is relative to the project root directory | ||
*/ | ||
pathType?: PathType; | ||
}; | ||
export {}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
10900802
2608
+ Added@babel/parser@7.26.8(transitive)
+ Added@babel/types@7.26.8(transitive)
+ Addedlaunch-ide@1.0.2(transitive)
- Removed@babel/parser@7.26.7(transitive)
- Removed@babel/types@7.26.7(transitive)
- Removedlaunch-ide@1.0.1(transitive)
Updatedlaunch-ide@1.0.2