wujie-event-scope 1.0.9 → 1.0.10

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 CHANGED
@@ -6844,10 +6844,10 @@ function patchElementHook(element, targetWindow) {
6844
6844
  // console.log("===替换之后的结果", element.getAttribute('onclick'))
6845
6845
  }
6846
6846
  }
6847
- function patchInlineCodeHook(code, targetWindow) {
6848
- const result = findDeclarationIdentifiers(code);
6847
+ function patchInlineCodeHook(target, targetWindow) {
6848
+ const result = findDeclarationIdentifiers(target.code);
6849
6849
  console.log("===处理后的信息", result);
6850
- return result;
6850
+ target.code = result;
6851
6851
  }
6852
6852
  var index = {
6853
6853
  patchElementHook,
package/dist/index.es.js CHANGED
@@ -6842,10 +6842,10 @@ function patchElementHook(element, targetWindow) {
6842
6842
  // console.log("===替换之后的结果", element.getAttribute('onclick'))
6843
6843
  }
6844
6844
  }
6845
- function patchInlineCodeHook(code, targetWindow) {
6846
- const result = findDeclarationIdentifiers(code);
6845
+ function patchInlineCodeHook(target, targetWindow) {
6846
+ const result = findDeclarationIdentifiers(target.code);
6847
6847
  console.log("===处理后的信息", result);
6848
- return result;
6848
+ target.code = result;
6849
6849
  }
6850
6850
  var index = {
6851
6851
  patchElementHook,
@@ -1,5 +1,8 @@
1
+ interface IpatchInlineCodeHook {
2
+ code: string;
3
+ }
1
4
  declare function patchElementHook(element: HTMLElement, targetWindow: Window): void;
2
- declare function patchInlineCodeHook(code: string, targetWindow: Window): string;
5
+ declare function patchInlineCodeHook(target: IpatchInlineCodeHook, targetWindow: Window): void;
3
6
  declare const _default: {
4
7
  patchElementHook: typeof patchElementHook;
5
8
  patchInlineCodeHook: typeof patchInlineCodeHook;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAuCA,iBAAS,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,QAgCnE;AAED,iBAAS,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAI9D;;;;;AAED,wBAGE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,UAAU,oBAAoB;IAC1B,IAAI,EAAE,MAAM,CAAA;CACf;AAoCD,iBAAS,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,QAgCnE;AAED,iBAAS,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,QAI9E;;;;;AAED,wBAGE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "wujie-event-scope",
4
- "version": "1.0.9",
4
+ "version": "1.0.10",
5
5
  "description": "处理wujie子应用HTML事件执行undefined问题",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",
package/src/index.ts CHANGED
@@ -3,6 +3,10 @@ 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
+ }
9
+
6
10
  function dealAttributesOCPatch(targetString: string) {
7
11
  const targetAttrLists = findIdentifiers(targetString);
8
12
  let lastSliceEnd = 0;
@@ -71,10 +75,10 @@ function patchElementHook(element: HTMLElement, targetWindow: Window) {
71
75
  }
72
76
  }
73
77
 
74
- function patchInlineCodeHook(code: string, targetWindow: Window) {
75
- const result = findDeclarationIdentifiers(code)
78
+ function patchInlineCodeHook(target: IpatchInlineCodeHook, targetWindow: Window) {
79
+ const result = findDeclarationIdentifiers(target.code)
76
80
  console.log("===处理后的信息", result)
77
- return result
81
+ target.code = result
78
82
  }
79
83
 
80
84
  export default {