miaoda-expo-devkit 0.1.1-beta.2 → 0.1.1-beta.3

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.
@@ -118,7 +118,7 @@ var noDuplicateExpoRouterUrlRule = {
118
118
  const others = files.filter((f) => f !== rel);
119
119
  if (others.length === 0) return;
120
120
  context.report({
121
- loc: { line: 1, column: 0 },
121
+ node,
122
122
  messageId: "duplicateUrl",
123
123
  data: { url, other: others.join(", ") }
124
124
  });
@@ -33,6 +33,20 @@ const THROTTLE_INTERVAL = 8;
33
33
  const THROTTLE_OPTIONS = {
34
34
  edges: ["leading", "trailing"]
35
35
  };
36
+ function isInsideSvgButNotSvgElement(el) {
37
+ const tag = el.tagName.toLowerCase();
38
+ return tag !== "svg" && el.closest("svg") !== null;
39
+ }
40
+ function getTargetElement(el) {
41
+ const tag = el.tagName.toLowerCase();
42
+ if (tag === "html") {
43
+ return null;
44
+ }
45
+ if (isInsideSvgButNotSvgElement(el)) {
46
+ return el.closest("svg");
47
+ }
48
+ return el;
49
+ }
36
50
  function isEditorMessage(data) {
37
51
  return typeof data === "object" && data !== null && typeof data.type === "string" && data.type.startsWith("editor-");
38
52
  }
@@ -124,7 +138,8 @@ class EditorController {
124
138
  * 设置当前悬停元素的 hover 样式
125
139
  */
126
140
  this.onMouseOver = (e) => {
127
- const node = e.target;
141
+ const rawNode = e.target;
142
+ const node = getTargetElement(rawNode);
128
143
  if (!isEditable(node)) return;
129
144
  if (this.hoverNode) {
130
145
  const isActive = this.activeNode === this.hoverNode;
@@ -150,7 +165,8 @@ class EditorController {
150
165
  this.onClick = (e) => {
151
166
  e.stopPropagation();
152
167
  e.preventDefault();
153
- const node = e.target;
168
+ const rawNode = e.target;
169
+ const node = getTargetElement(rawNode);
154
170
  if (!isEditable(node) || this.activeNode === node) return;
155
171
  this.stopObservingActiveNode();
156
172
  this.activeNode && removeActiveAttr(this.activeNode);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miaoda-expo-devkit",
3
- "version": "0.1.1-beta.2",
3
+ "version": "0.1.1-beta.3",
4
4
  "description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -51,13 +51,12 @@
51
51
  ],
52
52
  "scripts": {
53
53
  "build": "tsup",
54
- "prepare": "tsup",
55
54
  "typecheck": "tsc --noEmit && tsc -p tsconfig.check.json --noEmit",
56
55
  "test": "vitest run",
57
56
  "test:rules": "node --test --test-reporter=./src/rules/test-reporter.mjs src/rules/__tests__/*.test.ts",
58
57
  "prepublishOnly": "pnpm run test && pnpm run build",
59
- "release": "pnpm run test && pnpm run build && npm publish",
60
- "release:beta": "npm version prerelease --preid=beta && pnpm run test && pnpm run build && npm publish --tag beta",
58
+ "release": "npm publish",
59
+ "release:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
61
60
  "release:patch": "npm version patch && pnpm run release",
62
61
  "release:minor": "npm version minor && pnpm run release",
63
62
  "release:major": "npm version major && pnpm run release"