@shijiu/jsview 1.9.921 → 1.9.931

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.
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@vue/compiler-dom",
3
+ "version": "3.2.45",
4
+ "description": "@vue/compiler-dom",
5
+ "main": "index.js",
6
+ "module": "dist/compiler-dom.esm-bundler.js",
7
+ "types": "dist/compiler-dom.d.ts",
8
+ "unpkg": "dist/compiler-dom.global.js",
9
+ "jsdelivr": "dist/compiler-dom.global.js",
10
+ "files": [
11
+ "index.js",
12
+ "dist"
13
+ ],
14
+ "sideEffects": false,
15
+ "buildOptions": {
16
+ "name": "VueCompilerDOM",
17
+ "compat": true,
18
+ "formats": [
19
+ "esm-bundler",
20
+ "esm-browser",
21
+ "cjs",
22
+ "global"
23
+ ]
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/vuejs/core.git",
28
+ "directory": "packages/compiler-dom"
29
+ },
30
+ "keywords": [
31
+ "vue"
32
+ ],
33
+ "author": "Evan You",
34
+ "license": "MIT",
35
+ "bugs": {
36
+ "url": "https://github.com/vuejs/core/issues"
37
+ },
38
+ "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-dom#readme",
39
+ "dependencies": {
40
+ "@vue/shared": "3.2.45",
41
+ "@vue/compiler-core": "3.2.45"
42
+ }
43
+ }
@@ -333,6 +333,23 @@ function parseName(name) {
333
333
  options[m[0].toLowerCase()] = true;
334
334
  }
335
335
  }
336
+ // JsView Added >>>
337
+ // 处理自定义的 addEventListener() options, 前缀为jsv
338
+ // onJsvXxx留给自定义Event,这样判断防止出现下面写法
339
+ // :jsvevent.jsvoption1.jsvoption2 => onJsvEventJsvOption1JsvOption2
340
+ if (name.lastIndexOf('Jsv') > 2) {
341
+ options = options ?? {};
342
+
343
+ const optNames = name.substring(3); // 过滤掉jsvEvent
344
+ const optArray = optNames.split('Jsv');
345
+ // optArray[0] 为EventName部分内容
346
+ for (let idx = optArray.length - 1; idx > 0; idx--) {
347
+ const optName = 'jsv' + optArray[idx];
348
+ options[optName] = true;
349
+ name = name.slice(0, name.length - optName.length);
350
+ }
351
+ }
352
+ // JsView Added <<<
336
353
  const event = name[2] === ':' ? name.slice(3) : hyphenate(name.slice(2));
337
354
  return [event, options];
338
355
  }
@@ -34,8 +34,8 @@ const jsviewConfig = defineConfig({
34
34
  'export-sfc': ['\0plugin-vue:export-helper'], // 将_export_sfc独立出来,防止被集成在jsview-vue中导致import deadloop.
35
35
  'vue': ['vue'], // 将vue独立出来,防止被集成在main.js中导致import deadloop.
36
36
  // 将dom-entry和forge-define分割出来,防止被集成在main.js中导致import deadloop.
37
- 'forge-define': ['@shijiu/jsview/dom/jsv-forge-define.mjs'],
38
- 'jsivew-dom-entry': ['@shijiu/jsview/dom/index.mjs'],
37
+ // 'forge-define': ['@shijiu/jsview/dom/jsv-forge-define.mjs'],
38
+ // 'jsivew-dom-entry': ['@shijiu/jsview/dom/index.mjs'],
39
39
  },
40
40
  },
41
41
  },
@@ -176,15 +176,45 @@ function upgradeStagePixel(options) {
176
176
  // 过滤 (+ px), (+ 'px'), (+ "px"), (+ `px`), ( + ' px ') 等
177
177
  replaceStageContent(options, options.sourcePathList, msgPrefix,
178
178
  / *\+ ['"`]* *px *['"`]*/g, '');
179
- // 过滤 (00px), ('00px'), ("00px"), (`00px`), ('00px') 等
180
- replaceStageContent(options, options.sourcePathList, msgPrefix,
181
- /['"`]*([0-9]+)px['"`]*/g, '$1');
182
179
  // 过滤 (' 00px '), (" 00px "), (` 00px `), ('00px ') 等
183
180
  replaceStageContent(options, options.sourcePathList, msgPrefix,
184
- /['"`] *([0-9]+)px *['"`]/g, '$1');
181
+ /' *([0-9]+)px *'/g, '$1');
182
+ replaceStageContent(options, options.sourcePathList, msgPrefix,
183
+ /" *([0-9]+)px *"/g, '$1');
184
+ replaceStageContent(options, options.sourcePathList, msgPrefix,
185
+ /` *([0-9]+)px *`/g, '$1');
185
186
  // 过滤 ('${00}px'), ("${00}px"), (`${00}px`), ( ' ${00}px ') 等
186
187
  replaceStageContent(options, options.sourcePathList, msgPrefix,
187
188
  /['"`]*(\${.*?})px *['"`]*/g, '$1');
189
+ // 过滤 (00px), ('00px'), ("00px"), (`00px`), ('00px') 等
190
+ replaceStageContent(options, options.sourcePathList, msgPrefix,
191
+ /'([0-9]+)px'/g, '$1');
192
+ replaceStageContent(options, options.sourcePathList, msgPrefix,
193
+ /"([0-9]+)px"/g, '$1');
194
+ replaceStageContent(options, options.sourcePathList, msgPrefix,
195
+ /`([0-9]+)px`/g, '$1');
196
+ replaceStageContent(options, options.sourcePathList, msgPrefix,
197
+ /([0-9]+)px/g, '$1');
198
+
199
+ const numberStyleList = [
200
+ 'height',
201
+ 'left',
202
+ 'top',
203
+ 'width',
204
+
205
+ 'borderRadius',
206
+
207
+ 'fontSize',
208
+ 'lineHeight',
209
+ ];
210
+
211
+ for (const numberStyle of numberStyleList) {
212
+ const regExp = new RegExp(`:${numberStyle}=['"\`] *([0-9]+) *['"\`]`, 'g');
213
+ const toValue = `:${numberStyle}=$1`;
214
+
215
+ replaceStageContent(options, options.sourcePathList, msgPrefix,
216
+ regExp, toValue);
217
+ }
188
218
 
189
219
  return;
190
220
  }
@@ -242,7 +272,12 @@ function upgradeStageImportPostfix(options)
242
272
 
243
273
  let fixedContent = content;
244
274
 
245
- const importFilePath = path.resolve(currentDir, importFromFile);
275
+ let importFilePath = null;
276
+ if (importFromFile.startsWith('@')) {
277
+ importFilePath = path.resolve(options.rootDir, 'src', importFromFile.replace('@/', ''));
278
+ } else {
279
+ importFilePath = path.resolve(currentDir, importFromFile);
280
+ }
246
281
  if (fs.existsSync(importFilePath + '.js')) {
247
282
  // 执行到此处,则需要给给import的文件加上js尾缀。当同时存在.js和.vue时,.js优先。
248
283
  fixedContent = content.replace(importFromFile, importFromFile + '.js');
@@ -197,6 +197,7 @@ function main(argv)
197
197
  switch (argv.framework) {
198
198
  case 'vue':
199
199
  pkgNeedPatch = [
200
+ '@vue/compiler-dom',
200
201
  '@vue/compiler-sfc',
201
202
  '@vue/runtime-core',
202
203
  '@vue/runtime-dom',