@rsmax/wechat 1.3.13 → 1.3.15-canary.19

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.3.14](https://github.com/remaxjs/remax/compare/v1.3.13...v1.3.14) (2025-09-10)
7
+
8
+ **Note:** Version bump only for package @rsmax/wechat
9
+
6
10
  ## [1.3.13](https://github.com/remaxjs/remax/compare/v1.3.12...v1.3.13) (2025-06-16)
7
11
 
8
12
  **Note:** Version bump only for package @rsmax/wechat
package/cjs/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from './hostComponents';
2
- export * from './api';
3
- export * from './types';
1
+ export * as component from './hostComponents';
2
+ export * as types from './types';
package/cjs/index.js CHANGED
@@ -10,10 +10,19 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
15
24
  };
16
25
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./hostComponents"), exports);
18
- __exportStar(require("./api"), exports);
19
- __exportStar(require("./types"), exports);
26
+ exports.types = exports.component = void 0;
27
+ exports.component = __importStar(require("./hostComponents"));
28
+ exports.types = __importStar(require("./types"));
package/esm/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from './hostComponents';
2
- export * from './api';
3
- export * from './types';
1
+ export * as component from './hostComponents';
2
+ export * as types from './types';
package/esm/index.js CHANGED
@@ -1,3 +1,2 @@
1
- export * from './hostComponents';
2
- export * from './api';
3
- export * from './types';
1
+ export * as component from './hostComponents';
2
+ export * as types from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsmax/wechat",
3
- "version": "1.3.13",
3
+ "version": "1.3.15-canary.19+89bcd6a",
4
4
  "description": "Rsmax for Wechat",
5
5
  "repository": "git+https://github.com/remaxjs/remax.git",
6
6
  "license": "MIT",
@@ -13,24 +13,55 @@
13
13
  "build:cjs": "tsc --module CommonJS --outDir cjs",
14
14
  "clean": "rimraf cjs esm tsconfig.tsbuildinfo",
15
15
  "dev": "rslib build",
16
- "test": "vitest run"
16
+ "test": "rstest run"
17
17
  },
18
18
  "dependencies": {
19
- "@rsmax/framework-shared": "1.3.13",
20
- "@rsmax/runtime": "1.3.13",
21
- "@rsmax/shared": "1.3.13",
22
- "miniprogram-api-typings": "^4.0.7"
19
+ "@rsmax/framework-shared": "1.3.15-canary.19+89bcd6a",
20
+ "@rsmax/runtime": "1.3.15-canary.19+89bcd6a",
21
+ "@rsmax/shared": "1.3.15-canary.19+89bcd6a",
22
+ "miniprogram-api-typings": "^4.1.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@rsmax/types": "1.3.13",
25
+ "@rsmax/types": "1.3.15-canary.19+89bcd6a",
26
26
  "@types/react": "^18.3.0",
27
27
  "@types/react-test-renderer": "^18.3.0",
28
28
  "react": "^18.3.0",
29
29
  "react-test-renderer": "^18.3.0"
30
30
  },
31
+ "sideEffects": false,
32
+ "exports": {
33
+ "./types": {
34
+ "types": "./esm/types/index.d.ts",
35
+ "import": "./esm/types/index.js",
36
+ "require": "./cjs/types/index.js"
37
+ },
38
+ "./component": {
39
+ "types": "./esm/hostComponents/index.d.ts",
40
+ "import": "./esm/hostComponents/index.js",
41
+ "require": "./cjs/hostComponents/index.js"
42
+ },
43
+ "./node": {
44
+ "types": "./esm/node/index.d.ts",
45
+ "import": "./esm/node/index.js",
46
+ "require": "./cjs/node/index.js"
47
+ }
48
+ },
49
+ "typesVersions": {
50
+ "*": {
51
+ "types": [
52
+ "esm/types/index.d.ts"
53
+ ],
54
+ "component": [
55
+ "esm/hostComponents/index.d.ts"
56
+ ],
57
+ "node": [
58
+ "esm/node/index.d.ts"
59
+ ]
60
+ }
61
+ },
31
62
  "publishConfig": {
32
63
  "access": "public"
33
64
  },
34
65
  "esnext": "./esm/index.js",
35
- "gitHead": "ff3656307036567c5b9d9b62dcaa599f539d56b7"
66
+ "gitHead": "89bcd6a55f580707f23f434c59d0f283a44d2597"
36
67
  }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from '@rstest/core';
2
+
3
+ export default defineConfig({
4
+ globals: true,
5
+ exclude: ['cjs/', 'esm/', 'node_modules/'],
6
+ });
@@ -5,24 +5,40 @@
5
5
  </template>
6
6
 
7
7
  <wxs module="_h">
8
- var elements = {};
8
+ var __cache = {};
9
+
9
10
  module.exports = {
10
- v: function(value) {
11
- return value!== undefined ? value : '';
12
- },
13
- tid: function (type, ancestor) {
14
- var items = ancestor.split(',');
15
- var depth = 1;
16
-
17
- for (var i = 0; i < items.length; i++) {
18
- if (type === items[i]) {
19
- depth = depth + 1;
20
- }
21
- }
22
-
23
- var id = 'REMAX_TPL_' + depth + '_' + type;
24
- return id;
25
- }
11
+ v: function (value) {
12
+ return value == null ? '' : value;
13
+ },
14
+
15
+ tid: function (type, ancestor) {
16
+ var chain = ancestor || '';
17
+ var key = type + '::' + chain;
18
+
19
+ var cached = __cache[key];
20
+ if (cached) {
21
+ return cached;
22
+ }
23
+
24
+ var count = 0;
25
+ if (chain) {
26
+ var items = chain.split(',');
27
+ for (var i = 0; i < items.length; i++) {
28
+ if (items[i] === type) {
29
+ count = count + 1;
30
+ }
31
+ }
32
+ }
33
+
34
+ var id = 'REMAX_TPL_' + (1 + count) + '_' + type;
35
+ __cache[key] = id;
36
+ return id;
37
+ }
38
+
39
+ container: function (tid) {
40
+ return 'REMAX_TPL_' + (tid + 1) + '_CONTAINER';
41
+ }
26
42
  };
27
43
  </wxs>
28
44
 
@@ -48,7 +64,7 @@ slotView: slotView
48
64
  <block>{{i.text}}</block>
49
65
  </template>
50
66
 
51
- <% for (var i = 1; i <= depth['view']; i++) { -%>
67
+ <% for (var i = 1; i <= depth['view'] + 1; i++) { -%>
52
68
  <template name="REMAX_TPL_<%=i%>_CONTAINER" data="{{i: i}}">
53
69
  <template is="{{_h.tid(i.type, a)}}" data="{{i: i, a: a + ',' + i.type, tid: <%=i%>}}" />
54
70
  </template>
@@ -2,7 +2,7 @@
2
2
  <block wx:for="{{i.children}}" wx:key="*this">
3
3
  <swiper-item class="{{i.nodes[item].props.class}}" item-id="{{i.nodes[item].props.itemId}}" key="{{i.nodes[item].props.key}}">
4
4
  <block wx:for="{{i.nodes[item].children}}" wx:key="*this" wx:for-item="sItem">
5
- <template is="{{'REMAX_TPL_' + (tid + 1) + '_CONTAINER'}}" data="{{i: i.nodes[item].nodes[sItem], a: a, tid: tid + 1 }}" />
5
+ <template is="{{_h.container(tid)}}" data="{{i: i.nodes[item].nodes[sItem], a: a, tid: tid + 1 }}" />
6
6
  </block>
7
7
  </swiper-item>
8
8
  </block>
@@ -11,20 +11,20 @@
11
11
  <block wx:if="{{i.nodes[item].props['slot']}}">
12
12
  <view slot="{{i.nodes[item].props['slot']}}"
13
13
  <%_ for(let i=0;i < slotView.props.length; i++) { %>
14
- <%=slotView.props[i]%>="{{i.nodes[item].props['<%=slotView.props[i]%>']}}"
14
+ <%=slotView.props[i]%>="{{_h.v(i.nodes[item].props['<%=slotView.props[i]%>'])}}"
15
15
  <%_ } -%>
16
16
  >
17
17
  <block wx:for="{{i.nodes[item].children}}" wx:key="*this" wx:for-item="sItem">
18
- <template is="{{'REMAX_TPL_' + (tid + 1) + '_CONTAINER'}}" data="{{i: i.nodes[item].nodes[sItem], a: a, tid: tid + 1 }}" />
18
+ <template is="{{_h.container(tid)}}" data="{{i: i.nodes[item].nodes[sItem], a: a, tid: tid + 1 }}" />
19
19
  </block>
20
20
  </view>
21
21
  </block>
22
22
  <block wx:else>
23
- <template is="{{'REMAX_TPL_' + (tid + 1) + '_CONTAINER'}}" data="{{i: i.nodes[item], a: a, tid: tid + 1 }}" />
23
+ <template is="{{_h.container(tid)}}" data="{{i: i.nodes[item], a: a, tid: tid + 1 }}" />
24
24
  </block>
25
25
  </block>
26
26
  <% } else { -%>
27
27
  <block wx:for="{{i.children}}" wx:key="*this">
28
- <template is="{{'REMAX_TPL_' + (tid + 1) + '_CONTAINER'}}" data="{{i: i.nodes[item], a: a, tid: tid + 1 }}" />
28
+ <template is="{{_h.container(tid)}}" data="{{i: i.nodes[item], a: a, tid: tid + 1 }}" />
29
29
  </block>
30
30
  <% } -%>