wujie-event-scope 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -3
- package/dist/index.es.js +4 -3
- package/dist/types/index.d.ts +5 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +9 -3
package/dist/index.cjs.js
CHANGED
|
@@ -6844,10 +6844,11 @@ function patchElementHook(element, targetWindow) {
|
|
|
6844
6844
|
// console.log("===替换之后的结果", element.getAttribute('onclick'))
|
|
6845
6845
|
}
|
|
6846
6846
|
}
|
|
6847
|
-
function patchInlineCodeHook(
|
|
6848
|
-
const result = findDeclarationIdentifiers(code);
|
|
6847
|
+
function patchInlineCodeHook(target, targetWindow) {
|
|
6848
|
+
const result = findDeclarationIdentifiers(target.code);
|
|
6849
6849
|
console.log("===处理后的信息", result);
|
|
6850
|
-
|
|
6850
|
+
target.code = result;
|
|
6851
|
+
target.patch = true;
|
|
6851
6852
|
}
|
|
6852
6853
|
var index = {
|
|
6853
6854
|
patchElementHook,
|
package/dist/index.es.js
CHANGED
|
@@ -6842,10 +6842,11 @@ function patchElementHook(element, targetWindow) {
|
|
|
6842
6842
|
// console.log("===替换之后的结果", element.getAttribute('onclick'))
|
|
6843
6843
|
}
|
|
6844
6844
|
}
|
|
6845
|
-
function patchInlineCodeHook(
|
|
6846
|
-
const result = findDeclarationIdentifiers(code);
|
|
6845
|
+
function patchInlineCodeHook(target, targetWindow) {
|
|
6846
|
+
const result = findDeclarationIdentifiers(target.code);
|
|
6847
6847
|
console.log("===处理后的信息", result);
|
|
6848
|
-
|
|
6848
|
+
target.code = result;
|
|
6849
|
+
target.patch = true;
|
|
6849
6850
|
}
|
|
6850
6851
|
var index = {
|
|
6851
6852
|
patchElementHook,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
interface IpatchInlineCodeHook {
|
|
2
|
+
code: string;
|
|
3
|
+
patch: boolean;
|
|
4
|
+
}
|
|
1
5
|
declare function patchElementHook(element: HTMLElement, targetWindow: Window): void;
|
|
2
|
-
declare function patchInlineCodeHook(
|
|
6
|
+
declare function patchInlineCodeHook(target: IpatchInlineCodeHook, targetWindow: Window): void;
|
|
3
7
|
declare const _default: {
|
|
4
8
|
patchElementHook: typeof patchElementHook;
|
|
5
9
|
patchInlineCodeHook: typeof patchInlineCodeHook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,UAAU,oBAAoB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAClB;AAoCD,iBAAS,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,QAgCnE;AAED,iBAAS,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,QAK9E;;;;;AAED,wBAGE"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -3,6 +3,11 @@ import { targetToLNU } from "./utils"
|
|
|
3
3
|
import { findIdentifiers, findDeclarationIdentifiers } from "./babelParse"
|
|
4
4
|
import elementDataStore from "./elementDataStore"
|
|
5
5
|
|
|
6
|
+
interface IpatchInlineCodeHook {
|
|
7
|
+
code: string,
|
|
8
|
+
patch: boolean,
|
|
9
|
+
}
|
|
10
|
+
|
|
6
11
|
function dealAttributesOCPatch(targetString: string) {
|
|
7
12
|
const targetAttrLists = findIdentifiers(targetString);
|
|
8
13
|
let lastSliceEnd = 0;
|
|
@@ -71,10 +76,11 @@ function patchElementHook(element: HTMLElement, targetWindow: Window) {
|
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
function patchInlineCodeHook(
|
|
75
|
-
const result = findDeclarationIdentifiers(code)
|
|
79
|
+
function patchInlineCodeHook(target: IpatchInlineCodeHook, targetWindow: Window) {
|
|
80
|
+
const result = findDeclarationIdentifiers(target.code)
|
|
76
81
|
console.log("===处理后的信息", result)
|
|
77
|
-
|
|
82
|
+
target.code = result
|
|
83
|
+
target.patch = true
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
export default {
|