@code-inspector/core 1.2.9 → 1.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-inspector/core",
3
- "version": "1.2.9",
3
+ "version": "1.3.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "types/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "@vue/compiler-dom": "^3.5.13",
42
42
  "chalk": "^4.1.1",
43
43
  "dotenv": "^16.1.4",
44
- "launch-ide": "1.2.0",
44
+ "launch-ide": "1.2.1",
45
45
  "portfinder": "^1.0.28"
46
46
  },
47
47
  "devDependencies": {
@@ -45,6 +45,7 @@ export declare class CodeInspectorComponent extends LitElement {
45
45
  copy: boolean | string;
46
46
  target: string;
47
47
  ip: string;
48
+ modeKey: string;
48
49
  position: {
49
50
  top: number;
50
51
  right: number;
@@ -94,12 +95,22 @@ export declare class CodeInspectorComponent extends LitElement {
94
95
  preUserSelect: string;
95
96
  sendType: 'xhr' | 'img';
96
97
  activeNode: ActiveNode;
98
+ showSettingsModal: boolean;
99
+ internalLocate: boolean;
100
+ internalCopy: boolean;
101
+ internalTarget: boolean;
97
102
  inspectorSwitchRef: HTMLDivElement;
98
103
  codeInspectorContainerRef: HTMLDivElement;
99
104
  elementInfoRef: HTMLDivElement;
100
105
  nodeTreeRef: HTMLDivElement;
101
106
  nodeTreeTitleRef: HTMLDivElement;
102
107
  nodeTreeTooltipRef: HTMLDivElement;
108
+ features: {
109
+ label: string;
110
+ description: string;
111
+ checked: () => boolean;
112
+ onChange: () => void;
113
+ }[];
103
114
  isTracking: (e: any) => boolean | "";
104
115
  getDomPropertyValue: (target: HTMLElement, property: string) => number;
105
116
  calculateElementInfoPosition: (target: HTMLElement) => Promise<{
@@ -134,7 +145,10 @@ export declare class CodeInspectorComponent extends LitElement {
134
145
  sendImg: () => void;
135
146
  buildTargetUrl: () => string;
136
147
  trackCode: () => void;
148
+ private handleModeShortcut;
149
+ showNotification(message: string, type?: 'success' | 'error'): void;
137
150
  copyToClipboard(text: string): void;
151
+ private fallbackCopy;
138
152
  handleDrag: (e: MouseEvent | TouchEvent) => void;
139
153
  isSamePositionNode: (node1: HTMLElement, node2: HTMLElement) => boolean;
140
154
  handleMouseMove: (e: MouseEvent | TouchEvent) => Promise<void>;
@@ -154,6 +168,11 @@ export declare class CodeInspectorComponent extends LitElement {
154
168
  handleClickTreeNode: (node: TreeNode) => void;
155
169
  handleMouseEnterNode: (e: MouseEvent, node: TreeNode) => Promise<void>;
156
170
  handleMouseLeaveNode: () => void;
171
+ toggleSettingsModal: () => void;
172
+ closeSettingsModal: () => void;
173
+ toggleLocate: () => void;
174
+ toggleCopy: () => void;
175
+ toggleTarget: () => void;
157
176
  protected firstUpdated(): void;
158
177
  disconnectedCallback(): void;
159
178
  renderNodeTree: (node: TreeNode) => TemplateResult;
@@ -12,3 +12,4 @@ export declare function getCodeWithWebComponent({ options, record, file, code, i
12
12
  inject?: boolean;
13
13
  }): Promise<string>;
14
14
  export declare function isNextjsProject(): boolean;
15
+ export declare function isNextGET16(): boolean;
@@ -6,6 +6,7 @@ export type Behavior = {
6
6
  locate?: boolean;
7
7
  copy?: boolean | string;
8
8
  target?: string;
9
+ defaultAction?: 'copy' | 'locate' | 'target' | 'all';
9
10
  };
10
11
  export type RecordInfo = {
11
12
  port: number;
@@ -169,5 +170,15 @@ export type CodeOptions = {
169
170
  * - htmlScript: Skip injecting the code snippet that injects script tags in html, it is not recommended to skip this item for MPA projects
170
171
  */
171
172
  skipSnippets?: ('console' | 'htmlScript')[];
173
+ /**
174
+ * @zh 功能开关的快捷键,默认值为 `z`。同时按下 hotKeys 和 modeKey 可以打开功能开关设置
175
+ * @en The shortcut key of the feature switch, the default value is `z`. Pressing hotKeys and modeKey at the same time can open the feature switch settings
176
+ */
177
+ modeKey?: string;
178
+ /**
179
+ * @zh 是否启用 server 功能。默认值为 `open`,即启用 server 功能。使用代码定位功能时必须启用 server 功能,线上构建只看 dom 路径时可以关闭 server 功能。
180
+ * @en Whether to enable the server function. The default value is `open`, which means enabling the server function. The server function must be enabled when using the code location function, and it can be closed when building online only to view the dom path.
181
+ */
182
+ server?: 'open' | 'close';
172
183
  };
173
184
  export {};
@@ -5,6 +5,7 @@ export declare function isJsTypeFile(file: string): boolean;
5
5
  export declare function getFilePathWithoutExt(filePath: string): string;
6
6
  export declare function normalizePath(filepath: string): string;
7
7
  export declare function isEscapeTags(escapeTags: EscapeTags, tag: string): boolean;
8
+ export declare function getDependenciesMap(): any;
8
9
  export declare function getDenpendencies(): string[];
9
10
  type BooleanFunction = () => boolean;
10
11
  export declare function isDev(userDev: boolean | BooleanFunction | undefined, systemDev: boolean): boolean;