@lark-apaas/devtool-kits 1.0.2 → 1.0.4

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.
Files changed (2) hide show
  1. package/dist/error.html +22 -35
  2. package/package.json +1 -1
package/dist/error.html CHANGED
@@ -105,58 +105,24 @@
105
105
  background-color: #1E40AF; /* active:bg-blue-700 */
106
106
  }
107
107
  </style>
108
- </head>
109
- <body>
110
- <div class="container">
111
- <div class="content">
112
- <img
113
- src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylcylz_fsph_ryhs/ljhwZthlaukjlkulzlp/feisuda/template/render_error.svg"
114
- alt="render error"
115
- class="error-image"
116
- />
117
- <p class="title">哎呀,写错代码了</p>
118
- <p class="description">可复制错误信息,或告诉妙搭进行修复</p>
119
- <div class="button-group">
120
- <button class="button button-copy" id="copyBtn">
121
- 复制错误信息
122
- </button>
123
- <button class="button button-repair" id="repairBtn">
124
- 告诉妙搭修复
125
- </button>
126
- </div>
127
- </div>
128
- </div>
129
108
 
130
109
  <script>
131
110
  // 全局错误对象
132
111
  let errorData = {
133
112
  message: `{{.errorData.message}}`,
134
113
  };
135
- let locationData = null;
136
-
137
114
  // 初始化页面
138
115
  function init() {
139
- // 绑定事件
140
- document.getElementById('copyBtn').addEventListener('click', handleCopy);
141
- document.getElementById('repairBtn').addEventListener('click', handleRepair);
142
-
143
- // 获取当前位置信息
144
- locationData = {
145
- pathname: window.location.pathname,
146
- search: window.location.search,
147
- hash: window.location.hash,
148
- };
149
116
  // 通知前端,渲染错误页面已准备就绪
150
117
  sendPostMessage({
151
118
  type: 'PreviewReady'
152
119
  });
153
-
120
+
154
121
  // 如果有错误对象,发送 postMessage
155
122
  if (errorData) {
156
123
  sendPostMessage({
157
124
  type: 'RenderError',
158
125
  data: errorData,
159
- location: locationData,
160
126
  });
161
127
  }
162
128
  }
@@ -285,5 +251,26 @@
285
251
  init();
286
252
  }
287
253
  </script>
254
+ </head>
255
+ <body>
256
+ <div class="container">
257
+ <div class="content">
258
+ <img
259
+ src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylcylz_fsph_ryhs/ljhwZthlaukjlkulzlp/feisuda/template/render_error.svg"
260
+ alt="render error"
261
+ class="error-image"
262
+ />
263
+ <p class="title">哎呀,写错代码了</p>
264
+ <p class="description">可复制错误信息,或告诉妙搭进行修复</p>
265
+ <div class="button-group">
266
+ <button class="button button-copy" id="copyBtn" onclick="handleCopy()">
267
+ 复制错误信息
268
+ </button>
269
+ <button class="button button-repair" id="repairBtn" onclick="handleRepair()">
270
+ 告诉妙搭修复
271
+ </button>
272
+ </div>
273
+ </div>
274
+ </div>
288
275
  </body>
289
276
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/devtool-kits",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "FullStack Devtool Kits",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",