@zerodep-dev/vue-tsx-pro-mini 0.9.0 → 0.11.0

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/build.js CHANGED
@@ -92,7 +92,7 @@ const BASE = [
92
92
  ].join("\n");
93
93
  /** 引擎收集的规则原文 → app 样式表 */
94
94
  function appStyles(styleText) {
95
- const rules = topLevelRules(styleText).filter((rule) => rule.startsWith(":root") || rule.startsWith("@keyframes") || rule.startsWith("@media") && rule.includes(":root{")).map((rule) => rule.replaceAll(":root{", "page{"));
95
+ const rules = topLevelRules(styleText).flatMap(unlayer).filter((rule) => rule.startsWith(":root") || rule.startsWith("@keyframes") || rule.startsWith("@media") && rule.includes(":root{")).map((rule) => rule.replaceAll(":root{", "page{"));
96
96
  for (const rule of rules) {
97
97
  const problem = WXSS_REJECTS.find(({ pattern }) => pattern.test(rule));
98
98
  if (problem) console.warn(`[vtp-mini] app 样式表里 ${problem.reason},WXSS 编不过:${rule}`);
@@ -108,6 +108,15 @@ const WXSS_REJECTS = [{
108
108
  reason: ":not 里写了选择器列表"
109
109
  }];
110
110
  /** 按顶层花括号配平切出规则(@media 等块规则整体算一条) */
111
+ /**
112
+ * 去掉级联层:WXSS 不认 @layer。引擎的规则都包在 `@layer vtp.…{…}` 里,最前面还有一句层的顺序(没有花括号,
113
+ * 按花括号切的时候粘在下一条规则前面);app 样式表里只有变量组与关键帧,各自一层,去掉层不改变谁盖过谁
114
+ */
115
+ function unlayer(rule) {
116
+ const text = rule.replace(/^(?:@layer [^{};]*;\s*)+/, "");
117
+ if (!text.startsWith("@layer ")) return [text];
118
+ return topLevelRules(text.slice(text.indexOf("{") + 1, -1)).flatMap(unlayer);
119
+ }
111
120
  function topLevelRules(css) {
112
121
  const rules = [];
113
122
  let depth = 0;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as onPageHide, c as pageUrl, d as createMiniApp, f as MiniNode, i as navigateTo, l as reLaunch, n as pageOptions, o as onPageShow, r as navigateBack, s as onReachBottom, t as dispatchToCurrentPage, u as redirectTo } from "./page-upnBSowU.js";
1
+ import { a as onPageHide, c as pageUrl, d as createMiniApp, f as MiniNode, i as navigateTo, l as reLaunch, n as pageOptions, o as onPageShow, r as navigateBack, s as onReachBottom, t as dispatchToCurrentPage, u as redirectTo } from "./page-tkqsbQtp.js";
2
2
  //#region src/index.ts
3
3
  /** 声明应用的页面;setup 对每个页面的 Vue 应用调用一次(装插件、provide) */
4
4
  function definePages(pages, setup) {
@@ -1,6 +1,6 @@
1
1
  import { i as templateOf, n as FORM_CONTROLS, r as baseClassOf, t as BOOLEAN_ATTRS } from "./elements-BDIG7-jU.js";
2
2
  import { createRenderer, inject, onBeforeUnmount } from "vue";
3
- import { inlineStyle } from "@zerodep-dev/vue-tsx-pro-tsx/styles";
3
+ import { inlineStyle } from "@zerodep-dev/vue-tsx-pro-tsx/styles/internal";
4
4
  //#region src/node.ts
5
5
  /**
6
6
  * 小程序里的节点树:Vue 渲染器(renderer.ts)往这里增删改,页面(page.ts)把变化攒成一次 setData。
package/dist/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as pageOptions } from "./page-upnBSowU.js";
1
+ import { n as pageOptions } from "./page-tkqsbQtp.js";
2
2
  import { nextTick } from "vue";
3
3
  //#region src/testing.ts
4
4
  /** 按小程序的规则应用 setData:键是 a.b[0].c 这样的路径,中间缺的对象、数组自动补上 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodep-dev/vue-tsx-pro-mini",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Render vue-tsx-pro components in WeChat and Alipay mini programs: a Vue renderer over setData with generic templates, runtime styles resolved inline",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -53,13 +53,13 @@
53
53
  "./package.json": "./package.json"
54
54
  },
55
55
  "peerDependencies": {
56
- "@zerodep-dev/vue-tsx-pro-tsx": "^0.9.0",
56
+ "@zerodep-dev/vue-tsx-pro-tsx": "^0.11.0",
57
57
  "vite": "^8.0.0",
58
58
  "vue": "^3.5.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/node": "24.19.2",
62
- "@zerodep-dev/vue-tsx-pro-tsx": "^0.9.0",
62
+ "@zerodep-dev/vue-tsx-pro-tsx": "^0.11.0",
63
63
  "tsdown": "0.23.1",
64
64
  "typescript": "7.1.0-beta",
65
65
  "vite": "8.3.4",
@@ -13,7 +13,7 @@
13
13
  "typecheck": "tsc -p ."
14
14
  },
15
15
  "dependencies": {
16
- "@lucide/icons": "^1.59.0"
16
+ "@lucide/icons": "^1.69.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/node": "^24.0.0",