@vtj/uni 0.10.0 → 0.10.1-alpha.1

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/index.mjs CHANGED
@@ -3,10 +3,10 @@ import { adoptedStyleSheets as m } from "@vtj/renderer";
3
3
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
4
4
  * @name @vtj/uni
5
5
  * @author CHC chenhuachun1549@dingtalk.com
6
- * @version 0.10.0
6
+ * @version 0.10.1-alpha.1
7
7
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
8
8
  */
9
- const Y = "0.10.0", E = [
9
+ const z = "0.10.1-alpha.1", E = [
10
10
  "onLaunch",
11
11
  "onShow",
12
12
  "onHide",
@@ -17,7 +17,7 @@ const Y = "0.10.0", E = [
17
17
  "onPageNotFound",
18
18
  "onUniNViewMessage",
19
19
  "onExit"
20
- ], z = [
20
+ ], X = [
21
21
  "onLoad",
22
22
  "onShow",
23
23
  "onReady",
@@ -44,13 +44,13 @@ const Y = "0.10.0", E = [
44
44
  "updated",
45
45
  "beforeUnmount",
46
46
  "unmounted"
47
- ], T = "VTJ", N = "__UNI__1FC118B", S = "VTJ移动跨端项目", A = "1.0.0", I = "100", h = !1, U = {}, w = { enable: !1 }, R = "3", B = {
47
+ ], T = "VTJ", N = "__UNI__1FC118B", S = "VTJ移动跨端项目", A = "1.0.0", h = "100", I = !1, U = {}, w = { enable: !1 }, R = "3", B = {
48
48
  name: T,
49
49
  appid: N,
50
50
  description: S,
51
51
  versionName: A,
52
- versionCode: I,
53
- transformPx: h,
52
+ versionCode: h,
53
+ transformPx: I,
54
54
  "app-plus": { usingComponents: !0, nvueStyleCompiler: "uni-app", compilerVersion: 3, splashscreen: { alwaysShowBeforeRender: !0, waiting: !0, autoclose: !0, delay: 0 }, modules: {}, distribute: { android: { permissions: ['<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>', '<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>', '<uses-permission android:name="android.permission.VIBRATE"/>', '<uses-permission android:name="android.permission.READ_LOGS"/>', '<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>', '<uses-feature android:name="android.hardware.camera.autofocus"/>', '<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>', '<uses-permission android:name="android.permission.CAMERA"/>', '<uses-permission android:name="android.permission.GET_ACCOUNTS"/>', '<uses-permission android:name="android.permission.READ_PHONE_STATE"/>', '<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>', '<uses-permission android:name="android.permission.WAKE_LOCK"/>', '<uses-permission android:name="android.permission.FLASHLIGHT"/>', '<uses-feature android:name="android.hardware.camera"/>', '<uses-permission android:name="android.permission.WRITE_SETTINGS"/>'] }, ios: {}, sdkConfigs: {}, icons: { android: { hdpi: "src/static/logo.png", xhdpi: "src/static/logo.png", xxhdpi: "src/static/logo.png", xxxhdpi: "src/static/logo.png" } } } },
55
55
  quickapp: U,
56
56
  "mp-weixin": { appid: "", setting: { urlCheck: !1 }, usingComponents: !0 },
@@ -59,31 +59,32 @@ const Y = "0.10.0", E = [
59
59
  "mp-toutiao": { usingComponents: !0 },
60
60
  uniStatistics: w,
61
61
  vueVersion: R
62
- }, C = [], y = { navigationBarTextStyle: "black", navigationBarTitleText: "uni-app", navigationBarBackgroundColor: "#F8F8F8", backgroundColor: "#F8F8F8" }, b = {
62
+ }, C = [], y = { navigationBarTextStyle: "black", navigationBarTitleText: "uni-app", navigationBarBackgroundColor: "#F8F8F8", backgroundColor: "#F8F8F8" }, b = { autoscan: !0, custom: { "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue" } }, v = {
63
63
  pages: C,
64
- globalStyle: y
64
+ globalStyle: y,
65
+ easycom: b
65
66
  };
66
- function X(e) {
67
+ function Z(e) {
67
68
  const [t, ...n] = e;
68
- return [t.toLowerCase(), ...n].join("").replace(/[A-Z]/g, (o) => `-${o.toLowerCase()}`);
69
+ return [t.toLowerCase(), ...n].join("").replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
69
70
  }
70
- function v(e) {
71
- let { manifestJson: t = {}, pagesJson: n = {}, routes: i = [] } = e;
72
- const o = i.map((s) => {
73
- const { path: a, style: r, needLogin: c } = s;
71
+ function F(e) {
72
+ let { manifestJson: t = {}, pagesJson: n = {}, routes: o = [] } = e;
73
+ const i = o.map((a) => {
74
+ const { path: c, style: s, needLogin: r } = a;
74
75
  return {
75
- path: a,
76
- style: r,
77
- needLogin: c
76
+ path: c,
77
+ style: s,
78
+ needLogin: r
78
79
  };
79
80
  });
80
81
  return {
81
82
  ...e,
82
83
  manifestJson: Object.assign({}, B, t),
83
- pagesJson: Object.assign({}, b, n, { pages: o })
84
+ pagesJson: Object.assign({}, v, n, { pages: i })
84
85
  };
85
86
  }
86
- const g = {
87
+ const f = {
87
88
  navigationBarBackgroundColor: "backgroundColor",
88
89
  navigationBarTextStyle: "titleColor",
89
90
  navigationBarTitleText: "titleText",
@@ -92,63 +93,63 @@ const g = {
92
93
  titlePenetrate: "titlePenetrate",
93
94
  transparentTitle: "transparentTitle"
94
95
  };
95
- function f(e) {
96
+ function g(e) {
96
97
  const t = {}, n = {
97
98
  black: "#000000",
98
99
  white: "#ffffff"
99
100
  };
100
- for (const i in e)
101
- g[i] && (t[g[i]] = i === "navigationBarTextStyle" ? n[e[i]] || n.black : e[i]);
101
+ for (const o in e)
102
+ f[o] && (t[f[o]] = o === "navigationBarTextStyle" ? n[e[o]] || n.black : e[o]);
102
103
  return t;
103
104
  }
104
- function F(e) {
105
+ function O(e) {
105
106
  const t = {};
106
107
  for (const n in e)
107
- g[n] || (t[n] = e[n]);
108
+ f[n] || (t[n] = e[n]);
108
109
  return t;
109
110
  }
110
- function Z(e) {
111
+ function Q(e) {
111
112
  return e.split("?")[0].match(/\#\/pages\/([\w\W]*)/i)?.[1] ?? "";
112
113
  }
113
114
  function P(e) {
114
115
  return e.h5?.router?.mode || "hash";
115
116
  }
116
- function O(e) {
117
+ function V(e) {
117
118
  return {
118
119
  topWindow: !!e.topWindow?.path,
119
120
  leftWindow: !!e.leftWindow?.path,
120
121
  rightWindow: !!e.rightWindow?.path
121
122
  };
122
123
  }
123
- function V(e) {
124
- const { pagesJson: t = {} } = e, { globalStyle: n, pages: i = [] } = t;
125
- return !!(n?.enablePullDownRefresh || i.find((o) => !!o.style?.enablePullDownRefresh));
126
- }
127
124
  function x(e) {
128
- const { pagesJson: t = {} } = e, { globalStyle: n, pages: i = [] } = t;
129
- let o = !1;
130
- return n?.navigationStyle === "custom" ? (o = !0, i.find((s) => s.style?.navigationStyle === "default") && (o = !1)) : i.every((s) => s.style?.navigationStyle === "custom") && (o = !0), o;
125
+ const { pagesJson: t = {} } = e, { globalStyle: n, pages: o = [] } = t;
126
+ return !!(n?.enablePullDownRefresh || o.find((i) => !!i.style?.enablePullDownRefresh));
131
127
  }
132
128
  function L(e) {
133
- const t = x(e), n = {
129
+ const { pagesJson: t = {} } = e, { globalStyle: n, pages: o = [] } = t;
130
+ let i = !1;
131
+ return n?.navigationStyle === "custom" ? (i = !0, o.find((a) => a.style?.navigationStyle === "default") && (i = !1)) : o.every((a) => a.style?.navigationStyle === "custom") && (i = !0), i;
132
+ }
133
+ function k(e) {
134
+ const t = L(e), n = {
134
135
  navigationBar: !1,
135
136
  navigationBarButtons: !1,
136
137
  navigationBarSearchInput: !1,
137
138
  navigationBarTransparent: !1
138
- }, { pagesJson: i = {} } = e, { globalStyle: o, pages: s = [] } = i;
139
+ }, { pagesJson: o = {} } = e, { globalStyle: i, pages: a = [] } = o;
139
140
  if (t)
140
141
  return n;
141
142
  n.navigationBar = !0;
142
- const a = o?.h5?.titleNView;
143
- return s.find((r) => !!r.style?.h5?.titleNView?.buttons.length) && (n.navigationBarButtons = !0), (a?.searchInput || s.find((r) => !!r.style?.h5?.titleNView?.searchInput)) && (n.navigationBarSearchInput = !0), (a?.type === "transparent" || s.find((r) => r.style?.h5?.titleNView?.type === "transparent")) && (n.navigationBarTransparent = !0), n;
143
+ const c = i?.h5?.titleNView;
144
+ return a.find((s) => !!s.style?.h5?.titleNView?.buttons.length) && (n.navigationBarButtons = !0), (c?.searchInput || a.find((s) => !!s.style?.h5?.titleNView?.searchInput)) && (n.navigationBarSearchInput = !0), (c?.type === "transparent" || a.find((s) => s.style?.h5?.titleNView?.type === "transparent")) && (n.navigationBarTransparent = !0), n;
144
145
  }
145
- function k(e, t = window) {
146
- const { pagesJson: n = {}, manifestJson: i = {} } = e, { topWindow: o, leftWindow: s, rightWindow: a } = O(n), {
147
- navigationBar: r,
148
- navigationBarButtons: c,
149
- navigationBarSearchInput: _,
150
- navigationBarTransparent: u
151
- } = L(e), d = {
146
+ function W(e, t = window) {
147
+ const { pagesJson: n = {}, manifestJson: o = {} } = e, { topWindow: i, leftWindow: a, rightWindow: c } = V(n), {
148
+ navigationBar: s,
149
+ navigationBarButtons: r,
150
+ navigationBarSearchInput: u,
151
+ navigationBarTransparent: _
152
+ } = k(e), d = {
152
153
  // vue
153
154
  __VUE_OPTIONS_API__: !0,
154
155
  // enable/disable Options API support, default: true
@@ -183,7 +184,7 @@ function k(e, t = window) {
183
184
  // 是否启用i18n
184
185
  __UNI_FEATURE_NVUE__: !1,
185
186
  // 是否启用nvue
186
- __UNI_FEATURE_ROUTER_MODE__: P(i),
187
+ __UNI_FEATURE_ROUTER_MODE__: P(o),
187
188
  // 路由模式
188
189
  __UNI_FEATURE_PAGES__: !!n.pages?.length,
189
190
  // 是否多页面
@@ -191,56 +192,56 @@ function k(e, t = window) {
191
192
  // 是否包含tabBar
192
193
  __UNI_FEATURE_TABBAR_MIDBUTTON__: !!n.tabBar?.midButton,
193
194
  // 是否包含midButton
194
- __UNI_FEATURE_TOPWINDOW__: o,
195
+ __UNI_FEATURE_TOPWINDOW__: i,
195
196
  // 是否包含topWindow
196
- __UNI_FEATURE_LEFTWINDOW__: s,
197
+ __UNI_FEATURE_LEFTWINDOW__: a,
197
198
  // 是否包含leftWindow
198
- __UNI_FEATURE_RIGHTWINDOW__: a,
199
+ __UNI_FEATURE_RIGHTWINDOW__: c,
199
200
  // 是否包含rightWindow
200
201
  __UNI_FEATURE_RESPONSIVE__: !1,
201
202
  // 是否启用响应式
202
- __UNI_FEATURE_NAVIGATIONBAR__: r,
203
+ __UNI_FEATURE_NAVIGATIONBAR__: s,
203
204
  // 是否启用标题栏
204
- __UNI_FEATURE_PULL_DOWN_REFRESH__: V(e),
205
+ __UNI_FEATURE_PULL_DOWN_REFRESH__: x(e),
205
206
  // 是否启用下拉刷新
206
- __UNI_FEATURE_NAVIGATIONBAR_BUTTONS__: c,
207
+ __UNI_FEATURE_NAVIGATIONBAR_BUTTONS__: r,
207
208
  // 是否启用标题栏按钮
208
- __UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__: _,
209
+ __UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__: u,
209
210
  // 是否启用标题栏搜索框
210
- __UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__: u
211
+ __UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__: _
211
212
  // 是否启用透明标题栏
212
213
  };
213
214
  Object.entries(d).forEach(([p, l]) => {
214
215
  t[p] = l;
215
216
  });
216
217
  }
217
- const W = "4.45";
218
- function M(e, t = window) {
219
- const { pagesJson: n = {}, manifestJson: i = {} } = e, { easycom: o = {} } = n, {
220
- appid: s = "",
221
- name: a = "",
222
- versionCode: r = "",
223
- versionName: c = ""
224
- } = i, _ = n.globalStyle, u = i.h5?.router || {};
218
+ const M = "4.45";
219
+ function D(e, t = window) {
220
+ const { pagesJson: n = {}, manifestJson: o = {} } = e, { easycom: i = {} } = n, {
221
+ appid: a = "",
222
+ name: c = "",
223
+ versionCode: s = "",
224
+ versionName: r = ""
225
+ } = o, u = n.globalStyle, _ = o.h5?.router || {};
225
226
  t.__uniConfig = {
226
- easycom: o,
227
+ easycom: i,
227
228
  globalStyle: {
228
- ...F(_),
229
- navigationBar: f(_),
229
+ ...O(u),
230
+ navigationBar: g(u),
230
231
  isNVue: !1
231
232
  },
232
- compilerVersion: W,
233
- appId: s,
234
- appName: a,
235
- appVersion: c,
236
- appVersionCode: String(r),
233
+ compilerVersion: M,
234
+ appId: a,
235
+ appName: c,
236
+ appVersion: r,
237
+ appVersionCode: String(s),
237
238
  async: {
238
239
  loading: "AsyncLoading",
239
240
  error: "AsyncError",
240
241
  delay: 200,
241
242
  timeout: 6e4,
242
243
  suspensible: !0,
243
- ...i.h5?.async || {}
244
+ ...o.h5?.async || {}
244
245
  },
245
246
  debug: !1,
246
247
  networkTimeout: {
@@ -248,7 +249,7 @@ function M(e, t = window) {
248
249
  connectSocket: 6e4,
249
250
  uploadFile: 6e4,
250
251
  downloadFile: 6e4,
251
- ...i.networkTimeout || {}
252
+ ...o.networkTimeout || {}
252
253
  },
253
254
  sdkConfigs: {},
254
255
  nvue: {
@@ -261,8 +262,8 @@ function M(e, t = window) {
261
262
  mode: "hash",
262
263
  base: "/",
263
264
  assets: "assets",
264
- routerBase: u.base || "/",
265
- ...u
265
+ routerBase: _.base || "/",
266
+ ..._
266
267
  },
267
268
  darkmode: !1,
268
269
  themeConfig: {},
@@ -284,28 +285,28 @@ function M(e, t = window) {
284
285
  // tabBar: pagesJson.tabBar
285
286
  };
286
287
  }
287
- function D(e, t = window) {
288
+ function G(e, t = window) {
288
289
  const {
289
290
  UniServiceJSBridge: n,
290
- UniViewJSBridge: i,
291
- getApp: o,
292
- uni: s,
293
- getCurrentPages: a,
294
- upx2px: r,
295
- setupPage: c
291
+ UniViewJSBridge: o,
292
+ getApp: i,
293
+ uni: a,
294
+ getCurrentPages: c,
295
+ upx2px: s,
296
+ setupPage: r
296
297
  } = e;
297
- t.UniServiceJSBridge = n, t.UniViewJSBridge = i, t.getApp = o, t.uni = s, t.wx = s, t.getCurrentPages = a, t.upx2px = r, t.__setupPage = (_) => c(_);
298
+ t.UniServiceJSBridge = n, t.UniViewJSBridge = o, t.getApp = i, t.uni = a, t.wx = a, t.getCurrentPages = c, t.upx2px = s, t.__setupPage = (u) => r(u);
298
299
  }
299
- function G(e, t, n) {
300
- const { defineAsyncComponent: i, openBlock: o, createBlock: s, withCtx: a, createVNode: r } = e, { PageComponent: c, setupPage: _, getApp: u } = t;
300
+ function J(e, t, n) {
301
+ const { defineAsyncComponent: o, openBlock: i, createBlock: a, withCtx: c, createVNode: s } = e, { PageComponent: r, setupPage: u, getApp: _ } = t;
301
302
  return {
302
303
  mpType: "page",
303
304
  setup() {
304
- const p = u()?.$route?.query || {}, l = typeof n == "function" ? i(n) : n;
305
- return () => (o(), s(c, null, {
306
- page: a(() => [
307
- r(
308
- _(l),
305
+ const p = _()?.$route?.query || {}, l = typeof n == "function" ? o(n) : n;
306
+ return () => (i(), a(r, null, {
307
+ page: c(() => [
308
+ s(
309
+ u(l),
309
310
  Object.assign({}, p, { ref: "page" }),
310
311
  null,
311
312
  512
@@ -316,35 +317,35 @@ function G(e, t, n) {
316
317
  }
317
318
  };
318
319
  }
319
- function J(e, t, n) {
320
- const { path: i, style: o = {}, meta: s = {}, home: a } = t, c = (e.tabBar?.list || []).findIndex((d) => d.pagePath === i), _ = c > -1, u = n === 0;
320
+ function H(e, t, n) {
321
+ const { path: o, style: i = {}, meta: a = {}, home: c } = t, r = (e.tabBar?.list || []).findIndex((d) => d.pagePath === o), u = r > -1, _ = n === 0;
321
322
  return {
322
- isTabBar: _,
323
- tabBarIndex: c,
324
- isQuit: a ?? u,
325
- isEntry: a ?? u,
323
+ isTabBar: u,
324
+ tabBarIndex: r,
325
+ isQuit: c ?? _,
326
+ isEntry: c ?? _,
326
327
  navigationBar: {
327
328
  type: "default",
328
- ...f(o)
329
+ ...g(i)
329
330
  },
330
331
  isNVue: !1,
331
- route: i,
332
- ...s
332
+ route: o,
333
+ ...a
333
334
  };
334
335
  }
335
- function H(e, t, n, i, o = window) {
336
- const s = n.map((a, r) => {
337
- const c = J(i, a, r), _ = G(e, t, a.component), { path: u } = a;
336
+ function j(e, t, n, o, i = window) {
337
+ const a = n.map((c, s) => {
338
+ const r = H(o, c, s), u = J(e, t, c.component), { path: _ } = c;
338
339
  return {
339
- path: u,
340
- alias: u,
341
- meta: c,
342
- component: _
340
+ path: _,
341
+ alias: _,
342
+ meta: r,
343
+ component: u
343
344
  };
344
345
  });
345
- o.__uniRoutes = s, o.__uniLayout = {};
346
+ i.__uniRoutes = a, i.__uniLayout = {};
346
347
  }
347
- function j(e, t, n = window) {
348
+ function $(e, t, n = window) {
348
349
  m(n, String(e), t);
349
350
  }
350
351
  function K(e, t) {
@@ -384,63 +385,66 @@ function K(e, t) {
384
385
  "PickerViewColumn",
385
386
  "ResizeSensor",
386
387
  "SwiperItem"
387
- ].forEach((i) => {
388
- const o = t[i];
389
- e.component(i, o);
388
+ ].forEach((o) => {
389
+ const i = t[o];
390
+ e.component(o, i);
390
391
  });
391
392
  }
392
- function Q(e) {
393
- const t = v(e), {
393
+ function ee(e) {
394
+ const t = F(e), {
394
395
  Vue: n,
395
- App: i,
396
- UniH5: o,
397
- routes: s = [],
398
- pagesJson: a = {},
399
- manifestJson: r = {},
400
- window: c,
401
- css: _
402
- } = t, { plugin: u, setupApp: d } = o;
403
- k(t, c), M(t, c), D(o, c), H(n, o, s, a, c), _ && j(r.appid || Date.now(), _, c);
404
- const p = n.createApp(d(i));
405
- return p.use(K, o), p.use(u), p;
396
+ App: o,
397
+ UniH5: i,
398
+ routes: a = [],
399
+ pagesJson: c = {},
400
+ manifestJson: s = {},
401
+ window: r,
402
+ css: u = ""
403
+ } = t, { plugin: _, setupApp: d } = i;
404
+ W(t, r), D(t, r), G(i, r), j(n, i, a, c, r), $(s.appid || Date.now(), u, r);
405
+ const p = n.createApp(d(o));
406
+ return p.use(K, i), p.use(_), p;
406
407
  }
407
- function ee(e, t) {
408
+ function ne(e, t) {
408
409
  const n = {};
409
- return Object.entries(e).forEach(([i, o]) => {
410
- E.includes(i) && o && (n[i] = t(o));
410
+ return Object.entries(e).forEach(([o, i]) => {
411
+ E.includes(o) && i && (n[o] = t(i));
411
412
  }), n;
412
413
  }
413
- async function ne(e, t, n = !1) {
414
- const i = e.project?.pages || [], o = [];
415
- for (const a of i) {
416
- const r = await e.getDsl(a.id);
414
+ async function te(e, t, n = !1, o = "/pages") {
415
+ const i = e.project?.pages || [], a = [];
416
+ for (const s of i) {
417
+ const r = await e.getDsl(s.id);
417
418
  if (!r) continue;
418
- const { renderer: c } = t({ dsl: r, components: {} }), _ = e.project?.homepage === a.id;
419
- o.push({
420
- id: a.id,
421
- path: `/pages/${a.id}`,
422
- component: c,
419
+ const { renderer: u } = t({ dsl: r, components: {} }), _ = e.project?.homepage === s.id;
420
+ a.push({
421
+ id: s.id,
422
+ path: `${o}/${s.id}`,
423
+ component: u,
423
424
  style: {
424
- navigationBarTitleText: a.title,
425
- ...a.style
425
+ navigationBarTitleText: s.title,
426
+ ...s.style
426
427
  },
427
- needLogin: a.needLogin,
428
+ needLogin: s.needLogin,
428
429
  home: _
429
430
  });
430
431
  }
431
- const s = o.find((a) => !!a.home) || o[0];
432
- if (s && o.unshift({
433
- ...s,
432
+ const c = a.find((s) => !!s.home) || a[0];
433
+ if (c && (a.unshift({
434
+ ...c,
434
435
  path: "/"
435
- }), n) {
436
- const a = e.project?.blocks || [];
437
- for (const r of a) {
438
- const c = await e.getDsl(r.id);
439
- if (!c) continue;
440
- const { renderer: _ } = t({ dsl: c, components: {} });
441
- o.push({
436
+ }), a.unshift({
437
+ ...c,
438
+ path: o
439
+ })), n) {
440
+ const s = e.project?.blocks || [];
441
+ for (const r of s) {
442
+ const u = await e.getDsl(r.id);
443
+ if (!u) continue;
444
+ const { renderer: _ } = t({ dsl: u, components: {} });
445
+ a.push({
442
446
  id: r.id,
443
- path: `/pages/${r.id}`,
447
+ path: `${o}/${r.id}`,
444
448
  component: _,
445
449
  style: {
446
450
  navigationStyle: "custom"
@@ -448,9 +452,9 @@ async function ne(e, t, n = !1) {
448
452
  });
449
453
  }
450
454
  }
451
- return o;
455
+ return a;
452
456
  }
453
- function te() {
457
+ function oe() {
454
458
  if (window.uni)
455
459
  return window.uni.showLoading({
456
460
  title: "加载中...",
@@ -459,38 +463,38 @@ function te() {
459
463
  window.uni.hideLoading();
460
464
  };
461
465
  }
462
- function $(e, t = "", n = "warning") {
466
+ function q(e, t = "", n = "warning") {
463
467
  window.uni && window.uni.showModal({
464
468
  title: t,
465
469
  content: e,
466
470
  showCancel: !1
467
471
  });
468
472
  }
469
- function oe(e) {
470
- $(e);
473
+ function ie(e) {
474
+ q(e);
471
475
  }
472
476
  export {
473
477
  E as APP_LIFE_CYCLE,
474
478
  B as MANIFEST_JSON,
475
- b as PAGES_JSON,
476
- z as PAGE_LIFE_CYCLES_LIST,
477
- oe as alert,
478
- ee as createUniAppComponent,
479
- ne as createUniRoutes,
480
- Z as getFileId,
481
- F as getGobalStyle,
482
- f as getNavigationBar,
483
- j as injectUniCSS,
484
- M as injectUniConfig,
485
- k as injectUniFeatures,
486
- D as injectUniGlobal,
487
- H as injectUniRoutes,
479
+ v as PAGES_JSON,
480
+ X as PAGE_LIFE_CYCLES_LIST,
481
+ ie as alert,
482
+ ne as createUniAppComponent,
483
+ te as createUniRoutes,
484
+ Q as getFileId,
485
+ O as getGobalStyle,
486
+ g as getNavigationBar,
487
+ $ as injectUniCSS,
488
+ D as injectUniConfig,
489
+ W as injectUniFeatures,
490
+ G as injectUniGlobal,
491
+ j as injectUniRoutes,
488
492
  K as install,
489
- te as loading,
490
- v as mergeOptions,
491
- g as navigationBarMaps,
492
- $ as notify,
493
- Q as setupUniApp,
494
- X as toKebabCase,
495
- Y as version
493
+ oe as loading,
494
+ F as mergeOptions,
495
+ f as navigationBarMaps,
496
+ q as notify,
497
+ ee as setupUniApp,
498
+ Z as toKebabCase,
499
+ z as version
496
500
  };
package/dist/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
- (function(u,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("@vtj/renderer")):typeof define=="function"&&define.amd?define(["exports","@vtj/renderer"],f):(u=typeof globalThis<"u"?globalThis:u||self,f(u.VtjUni={},u.renderer))})(this,function(u,f){"use strict";/**!
1
+ (function(c,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("@vtj/renderer")):typeof define=="function"&&define.amd?define(["exports","@vtj/renderer"],g):(c=typeof globalThis<"u"?globalThis:c||self,g(c.VtjUni={},c.renderer))})(this,function(c,g){"use strict";/**!
2
2
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/uni
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.10.0
5
+ * @version 0.10.1-alpha.1
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const b="0.10.0",S=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onPageNotFound","onUniNViewMessage","onExit"],P=["onLoad","onShow","onReady","onHide","onUnload","onResize","onPullDownRefresh","onReachBottom","onTabItemTap","onShareAppMessage","onPageScroll","onNavigationBarButtonTap","onBackPress","onNavigationBarSearchInputChanged","onNavigationBarSearchInputConfirmed","onNavigationBarSearchInputClicked","onShareTimeline","onAddToFavorites","beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted"],A={name:"VTJ",appid:"__UNI__1FC118B",description:"VTJ移动跨端项目",versionName:"1.0.0",versionCode:"100",transformPx:!1,"app-plus":{usingComponents:!0,nvueStyleCompiler:"uni-app",compilerVersion:3,splashscreen:{alwaysShowBeforeRender:!0,waiting:!0,autoclose:!0,delay:0},modules:{},distribute:{android:{permissions:['<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>','<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>','<uses-permission android:name="android.permission.VIBRATE"/>','<uses-permission android:name="android.permission.READ_LOGS"/>','<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>','<uses-feature android:name="android.hardware.camera.autofocus"/>','<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>','<uses-permission android:name="android.permission.CAMERA"/>','<uses-permission android:name="android.permission.GET_ACCOUNTS"/>','<uses-permission android:name="android.permission.READ_PHONE_STATE"/>','<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>','<uses-permission android:name="android.permission.WAKE_LOCK"/>','<uses-permission android:name="android.permission.FLASHLIGHT"/>','<uses-feature android:name="android.hardware.camera"/>','<uses-permission android:name="android.permission.WRITE_SETTINGS"/>']},ios:{},sdkConfigs:{},icons:{android:{hdpi:"src/static/logo.png",xhdpi:"src/static/logo.png",xxhdpi:"src/static/logo.png",xxxhdpi:"src/static/logo.png"}}}},quickapp:{},"mp-weixin":{appid:"",setting:{urlCheck:!1},usingComponents:!0},"mp-alipay":{usingComponents:!0},"mp-baidu":{usingComponents:!0},"mp-toutiao":{usingComponents:!0},uniStatistics:{enable:!1},vueVersion:"3"},N={pages:[],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"uni-app",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"}};function O(e){const[t,...n]=e;return[t.toLowerCase(),...n].join("").replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}function I(e){let{manifestJson:t={},pagesJson:n={},routes:o=[]}=e;const i=o.map(r=>{const{path:a,style:p,needLogin:_}=r;return{path:a,style:p,needLogin:_}});return{...e,manifestJson:Object.assign({},A,t),pagesJson:Object.assign({},N,n,{pages:i})}}const m={navigationBarBackgroundColor:"backgroundColor",navigationBarTextStyle:"titleColor",navigationBarTitleText:"titleText",navigationStyle:"style",titleImage:"titleImage",titlePenetrate:"titlePenetrate",transparentTitle:"transparentTitle"};function T(e){const t={},n={black:"#000000",white:"#ffffff"};for(const o in e)m[o]&&(t[m[o]]=o==="navigationBarTextStyle"?n[e[o]]||n.black:e[o]);return t}function U(e){const t={};for(const n in e)m[n]||(t[n]=e[n]);return t}function L(e){var o;const n=e.split("?")[0].match(/\#\/pages\/([\w\W]*)/i);return(o=n==null?void 0:n[1])!=null?o:""}function V(e){var n;const t=e.h5;return((n=t==null?void 0:t.router)==null?void 0:n.mode)||"hash"}function k(e){var t,n,o;return{topWindow:!!((t=e.topWindow)!=null&&t.path),leftWindow:!!((n=e.leftWindow)!=null&&n.path),rightWindow:!!((o=e.rightWindow)!=null&&o.path)}}function W(e){const{pagesJson:t={}}=e,{globalStyle:n,pages:o=[]}=t;return!!(n!=null&&n.enablePullDownRefresh||o.find(i=>{var r;return!!((r=i.style)!=null&&r.enablePullDownRefresh)}))}function j(e){const{pagesJson:t={}}=e,{globalStyle:n,pages:o=[]}=t;let i=!1;return(n==null?void 0:n.navigationStyle)==="custom"?(i=!0,o.find(r=>{var a;return((a=r.style)==null?void 0:a.navigationStyle)==="default"})&&(i=!1)):o.every(r=>{var a;return((a=r.style)==null?void 0:a.navigationStyle)==="custom"})&&(i=!0),i}function G(e){var p;const t=j(e),n={navigationBar:!1,navigationBarButtons:!1,navigationBarSearchInput:!1,navigationBarTransparent:!1},{pagesJson:o={}}=e,{globalStyle:i,pages:r=[]}=o;if(t)return n;n.navigationBar=!0;const a=(p=i==null?void 0:i.h5)==null?void 0:p.titleNView;return r.find(_=>{var s,c,d;return!!((d=(c=(s=_.style)==null?void 0:s.h5)==null?void 0:c.titleNView)!=null&&d.buttons.length)})&&(n.navigationBarButtons=!0),(a!=null&&a.searchInput||r.find(_=>{var s,c,d;return!!((d=(c=(s=_.style)==null?void 0:s.h5)==null?void 0:c.titleNView)!=null&&d.searchInput)}))&&(n.navigationBarSearchInput=!0),((a==null?void 0:a.type)==="transparent"||r.find(_=>{var s,c,d;return((d=(c=(s=_.style)==null?void 0:s.h5)==null?void 0:c.titleNView)==null?void 0:d.type)==="transparent"}))&&(n.navigationBarTransparent=!0),n}function h(e,t=window){var l,E,g,F;const{pagesJson:n={},manifestJson:o={}}=e,{topWindow:i,leftWindow:r,rightWindow:a}=k(n),{navigationBar:p,navigationBarButtons:_,navigationBarSearchInput:s,navigationBarTransparent:c}=G(e),d={__VUE_OPTIONS_API__:!0,__VUE_PROD_DEVTOOLS__:!1,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:!1,__UNI_FEATURE_WX__:!1,__UNI_FEATURE_WXS__:!1,__UNI_FEATURE_RPX__:!1,__UNI_FEATURE_PROMISE__:!1,__UNI_FEATURE_LONGPRESS__:!1,__UNI_FEATURE_I18N_EN__:!1,__UNI_FEATURE_I18N_ES__:!1,__UNI_FEATURE_I18N_FR__:!1,__UNI_FEATURE_I18N_ZH_HANS__:!0,__UNI_FEATURE_I18N_ZH_HANT__:!1,__UNI_FEATURE_UNI_CLOUD__:!1,__UNI_FEATURE_I18N_LOCALE__:!1,__UNI_FEATURE_NVUE__:!1,__UNI_FEATURE_ROUTER_MODE__:V(o),__UNI_FEATURE_PAGES__:!!((l=n.pages)!=null&&l.length),__UNI_FEATURE_TABBAR__:!!((g=(E=n.tabBar)==null?void 0:E.list)!=null&&g.length),__UNI_FEATURE_TABBAR_MIDBUTTON__:!!((F=n.tabBar)!=null&&F.midButton),__UNI_FEATURE_TOPWINDOW__:i,__UNI_FEATURE_LEFTWINDOW__:r,__UNI_FEATURE_RIGHTWINDOW__:a,__UNI_FEATURE_RESPONSIVE__:!1,__UNI_FEATURE_NAVIGATIONBAR__:p,__UNI_FEATURE_PULL_DOWN_REFRESH__:W(e),__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__:_,__UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__:s,__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__:c};Object.entries(d).forEach(([$,z])=>{t[$]=z})}const M="4.45";function C(e,t=window){var d,l;const{pagesJson:n={},manifestJson:o={}}=e,{easycom:i={}}=n,{appid:r="",name:a="",versionCode:p="",versionName:_=""}=o,s=n.globalStyle,c=((d=o.h5)==null?void 0:d.router)||{};t.__uniConfig={easycom:i,globalStyle:{...U(s),navigationBar:T(s),isNVue:!1},compilerVersion:M,appId:r,appName:a,appVersion:_,appVersionCode:String(p),async:{loading:"AsyncLoading",error:"AsyncError",delay:200,timeout:6e4,suspensible:!0,...((l=o.h5)==null?void 0:l.async)||{}},debug:!1,networkTimeout:{request:6e4,connectSocket:6e4,uploadFile:6e4,downloadFile:6e4,...o.networkTimeout||{}},sdkConfigs:{},nvue:{"flex-direction":"column"},locale:"",fallbackLocale:"",locales:{},router:{mode:"hash",base:"/",assets:"assets",routerBase:c.base||"/",...c},darkmode:!1,themeConfig:{},tabBar:n.tabBar?{position:"bottom",color:"#7A7E83",selectedColor:"#3cc51f",borderStyle:"black",blurEffect:"none",fontSize:"10px",iconWidth:"24px",spacing:"3px",height:"50px",backgroundColor:"#ffffff",selectedIndex:0,shown:!0,...n.tabBar}:void 0}}function w(e,t=window){const{UniServiceJSBridge:n,UniViewJSBridge:o,getApp:i,uni:r,getCurrentPages:a,upx2px:p,setupPage:_}=e;t.UniServiceJSBridge=n,t.UniViewJSBridge=o,t.getApp=i,t.uni=r,t.wx=r,t.getCurrentPages=a,t.upx2px=p,t.__setupPage=s=>_(s)}function D(e,t,n){const{defineAsyncComponent:o,openBlock:i,createBlock:r,withCtx:a,createVNode:p}=e,{PageComponent:_,setupPage:s,getApp:c}=t;return{mpType:"page",setup(){var g;const d=c(),l=((g=d==null?void 0:d.$route)==null?void 0:g.query)||{},E=typeof n=="function"?o(n):n;return()=>(i(),r(_,null,{page:a(()=>[p(s(E),Object.assign({},l,{ref:"page"}),null,512)]),_:1}))}}}function J(e,t,n){var d;const{path:o,style:i={},meta:r={},home:a}=t,_=(((d=e.tabBar)==null?void 0:d.list)||[]).findIndex(l=>l.pagePath===o),s=_>-1,c=n===0;return{isTabBar:s,tabBarIndex:_,isQuit:a!=null?a:c,isEntry:a!=null?a:c,navigationBar:{type:"default",...T(i)},isNVue:!1,route:o,...r}}function R(e,t,n,o,i=window){const r=n.map((a,p)=>{const _=J(o,a,p),s=D(e,t,a.component),{path:c}=a;return{path:c,alias:c,meta:_,component:s}});i.__uniRoutes=r,i.__uniLayout={}}function B(e,t,n=window){f.adoptedStyleSheets(n,String(e),t)}function v(e,t){if(!t)return;["View","ScrollView","Swiper","MovableArea","MovableView","CoverView","CoverImage","Icon","Text","RichText","Progress","Button","CheckboxGroup","Checkbox","Editor","Form","Input","Label","Picker","PickerView","RadioGroup","Radio","Slider","Switch","Textarea","Navigator","Image","Video","Map","Canvas","WebView","PickerViewColumn","ResizeSensor","SwiperItem"].forEach(o=>{const i=t[o];e.component(o,i)})}function x(e){const t=I(e),{Vue:n,App:o,UniH5:i,routes:r=[],pagesJson:a={},manifestJson:p={},window:_,css:s}=t,{plugin:c,setupApp:d}=i;h(t,_),C(t,_),w(i,_),R(n,i,r,a,_),s&&B(p.appid||Date.now(),s,_);const l=n.createApp(d(o));return l.use(v,i),l.use(c),l}function H(e,t){const n={};return Object.entries(e).forEach(([o,i])=>{S.includes(o)&&i&&(n[o]=t(i))}),n}async function q(e,t,n=!1){var a,p,_;const o=((a=e.project)==null?void 0:a.pages)||[],i=[];for(const s of o){const c=await e.getDsl(s.id);if(!c)continue;const{renderer:d}=t({dsl:c,components:{}}),l=((p=e.project)==null?void 0:p.homepage)===s.id;i.push({id:s.id,path:`/pages/${s.id}`,component:d,style:{navigationBarTitleText:s.title,...s.style},needLogin:s.needLogin,home:l})}const r=i.find(s=>!!s.home)||i[0];if(r&&i.unshift({...r,path:"/"}),n){const s=((_=e.project)==null?void 0:_.blocks)||[];for(const c of s){const d=await e.getDsl(c.id);if(!d)continue;const{renderer:l}=t({dsl:d,components:{}});i.push({id:c.id,path:`/pages/${c.id}`,component:l,style:{navigationStyle:"custom"}})}}return i}function K(){if(window.uni)return window.uni.showLoading({title:"加载中...",mask:!0}),()=>{window.uni.hideLoading()}}function y(e,t="",n="warning"){window.uni&&window.uni.showModal({title:t,content:e,showCancel:!1})}function Y(e){y(e)}u.APP_LIFE_CYCLE=S,u.MANIFEST_JSON=A,u.PAGES_JSON=N,u.PAGE_LIFE_CYCLES_LIST=P,u.alert=Y,u.createUniAppComponent=H,u.createUniRoutes=q,u.getFileId=L,u.getGobalStyle=U,u.getNavigationBar=T,u.injectUniCSS=B,u.injectUniConfig=C,u.injectUniFeatures=h,u.injectUniGlobal=w,u.injectUniRoutes=R,u.install=v,u.loading=K,u.mergeOptions=I,u.navigationBarMaps=m,u.notify=y,u.setupUniApp=x,u.toKebabCase=O,u.version=b,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
7
+ */const b="0.10.1-alpha.1",S=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onPageNotFound","onUniNViewMessage","onExit"],P=["onLoad","onShow","onReady","onHide","onUnload","onResize","onPullDownRefresh","onReachBottom","onTabItemTap","onShareAppMessage","onPageScroll","onNavigationBarButtonTap","onBackPress","onNavigationBarSearchInputChanged","onNavigationBarSearchInputConfirmed","onNavigationBarSearchInputClicked","onShareTimeline","onAddToFavorites","beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted"],A={name:"VTJ",appid:"__UNI__1FC118B",description:"VTJ移动跨端项目",versionName:"1.0.0",versionCode:"100",transformPx:!1,"app-plus":{usingComponents:!0,nvueStyleCompiler:"uni-app",compilerVersion:3,splashscreen:{alwaysShowBeforeRender:!0,waiting:!0,autoclose:!0,delay:0},modules:{},distribute:{android:{permissions:['<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>','<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>','<uses-permission android:name="android.permission.VIBRATE"/>','<uses-permission android:name="android.permission.READ_LOGS"/>','<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>','<uses-feature android:name="android.hardware.camera.autofocus"/>','<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>','<uses-permission android:name="android.permission.CAMERA"/>','<uses-permission android:name="android.permission.GET_ACCOUNTS"/>','<uses-permission android:name="android.permission.READ_PHONE_STATE"/>','<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>','<uses-permission android:name="android.permission.WAKE_LOCK"/>','<uses-permission android:name="android.permission.FLASHLIGHT"/>','<uses-feature android:name="android.hardware.camera"/>','<uses-permission android:name="android.permission.WRITE_SETTINGS"/>']},ios:{},sdkConfigs:{},icons:{android:{hdpi:"src/static/logo.png",xhdpi:"src/static/logo.png",xxhdpi:"src/static/logo.png",xxxhdpi:"src/static/logo.png"}}}},quickapp:{},"mp-weixin":{appid:"",setting:{urlCheck:!1},usingComponents:!0},"mp-alipay":{usingComponents:!0},"mp-baidu":{usingComponents:!0},"mp-toutiao":{usingComponents:!0},uniStatistics:{enable:!1},vueVersion:"3"},N={pages:[],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"uni-app",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"},easycom:{autoscan:!0,custom:{"^uni-(.*)":"@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"}}};function O(e){const[t,...n]=e;return[t.toLowerCase(),...n].join("").replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}function I(e){let{manifestJson:t={},pagesJson:n={},routes:o=[]}=e;const i=o.map(s=>{const{path:a,style:p,needLogin:u}=s;return{path:a,style:p,needLogin:u}});return{...e,manifestJson:Object.assign({},A,t),pagesJson:Object.assign({},N,n,{pages:i})}}const E={navigationBarBackgroundColor:"backgroundColor",navigationBarTextStyle:"titleColor",navigationBarTitleText:"titleText",navigationStyle:"style",titleImage:"titleImage",titlePenetrate:"titlePenetrate",transparentTitle:"transparentTitle"};function T(e){const t={},n={black:"#000000",white:"#ffffff"};for(const o in e)E[o]&&(t[E[o]]=o==="navigationBarTextStyle"?n[e[o]]||n.black:e[o]);return t}function U(e){const t={};for(const n in e)E[n]||(t[n]=e[n]);return t}function L(e){var o;const n=e.split("?")[0].match(/\#\/pages\/([\w\W]*)/i);return(o=n==null?void 0:n[1])!=null?o:""}function V(e){var n;const t=e.h5;return((n=t==null?void 0:t.router)==null?void 0:n.mode)||"hash"}function k(e){var t,n,o;return{topWindow:!!((t=e.topWindow)!=null&&t.path),leftWindow:!!((n=e.leftWindow)!=null&&n.path),rightWindow:!!((o=e.rightWindow)!=null&&o.path)}}function W(e){const{pagesJson:t={}}=e,{globalStyle:n,pages:o=[]}=t;return!!(n!=null&&n.enablePullDownRefresh||o.find(i=>{var s;return!!((s=i.style)!=null&&s.enablePullDownRefresh)}))}function j(e){const{pagesJson:t={}}=e,{globalStyle:n,pages:o=[]}=t;let i=!1;return(n==null?void 0:n.navigationStyle)==="custom"?(i=!0,o.find(s=>{var a;return((a=s.style)==null?void 0:a.navigationStyle)==="default"})&&(i=!1)):o.every(s=>{var a;return((a=s.style)==null?void 0:a.navigationStyle)==="custom"})&&(i=!0),i}function G(e){var p;const t=j(e),n={navigationBar:!1,navigationBarButtons:!1,navigationBarSearchInput:!1,navigationBarTransparent:!1},{pagesJson:o={}}=e,{globalStyle:i,pages:s=[]}=o;if(t)return n;n.navigationBar=!0;const a=(p=i==null?void 0:i.h5)==null?void 0:p.titleNView;return s.find(u=>{var d,r,_;return!!((_=(r=(d=u.style)==null?void 0:d.h5)==null?void 0:r.titleNView)!=null&&_.buttons.length)})&&(n.navigationBarButtons=!0),(a!=null&&a.searchInput||s.find(u=>{var d,r,_;return!!((_=(r=(d=u.style)==null?void 0:d.h5)==null?void 0:r.titleNView)!=null&&_.searchInput)}))&&(n.navigationBarSearchInput=!0),((a==null?void 0:a.type)==="transparent"||s.find(u=>{var d,r,_;return((_=(r=(d=u.style)==null?void 0:d.h5)==null?void 0:r.titleNView)==null?void 0:_.type)==="transparent"}))&&(n.navigationBarTransparent=!0),n}function h(e,t=window){var l,f,m,F;const{pagesJson:n={},manifestJson:o={}}=e,{topWindow:i,leftWindow:s,rightWindow:a}=k(n),{navigationBar:p,navigationBarButtons:u,navigationBarSearchInput:d,navigationBarTransparent:r}=G(e),_={__VUE_OPTIONS_API__:!0,__VUE_PROD_DEVTOOLS__:!1,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:!1,__UNI_FEATURE_WX__:!1,__UNI_FEATURE_WXS__:!1,__UNI_FEATURE_RPX__:!1,__UNI_FEATURE_PROMISE__:!1,__UNI_FEATURE_LONGPRESS__:!1,__UNI_FEATURE_I18N_EN__:!1,__UNI_FEATURE_I18N_ES__:!1,__UNI_FEATURE_I18N_FR__:!1,__UNI_FEATURE_I18N_ZH_HANS__:!0,__UNI_FEATURE_I18N_ZH_HANT__:!1,__UNI_FEATURE_UNI_CLOUD__:!1,__UNI_FEATURE_I18N_LOCALE__:!1,__UNI_FEATURE_NVUE__:!1,__UNI_FEATURE_ROUTER_MODE__:V(o),__UNI_FEATURE_PAGES__:!!((l=n.pages)!=null&&l.length),__UNI_FEATURE_TABBAR__:!!((m=(f=n.tabBar)==null?void 0:f.list)!=null&&m.length),__UNI_FEATURE_TABBAR_MIDBUTTON__:!!((F=n.tabBar)!=null&&F.midButton),__UNI_FEATURE_TOPWINDOW__:i,__UNI_FEATURE_LEFTWINDOW__:s,__UNI_FEATURE_RIGHTWINDOW__:a,__UNI_FEATURE_RESPONSIVE__:!1,__UNI_FEATURE_NAVIGATIONBAR__:p,__UNI_FEATURE_PULL_DOWN_REFRESH__:W(e),__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__:u,__UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__:d,__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__:r};Object.entries(_).forEach(([Y,z])=>{t[Y]=z})}const M="4.45";function C(e,t=window){var _,l;const{pagesJson:n={},manifestJson:o={}}=e,{easycom:i={}}=n,{appid:s="",name:a="",versionCode:p="",versionName:u=""}=o,d=n.globalStyle,r=((_=o.h5)==null?void 0:_.router)||{};t.__uniConfig={easycom:i,globalStyle:{...U(d),navigationBar:T(d),isNVue:!1},compilerVersion:M,appId:s,appName:a,appVersion:u,appVersionCode:String(p),async:{loading:"AsyncLoading",error:"AsyncError",delay:200,timeout:6e4,suspensible:!0,...((l=o.h5)==null?void 0:l.async)||{}},debug:!1,networkTimeout:{request:6e4,connectSocket:6e4,uploadFile:6e4,downloadFile:6e4,...o.networkTimeout||{}},sdkConfigs:{},nvue:{"flex-direction":"column"},locale:"",fallbackLocale:"",locales:{},router:{mode:"hash",base:"/",assets:"assets",routerBase:r.base||"/",...r},darkmode:!1,themeConfig:{},tabBar:n.tabBar?{position:"bottom",color:"#7A7E83",selectedColor:"#3cc51f",borderStyle:"black",blurEffect:"none",fontSize:"10px",iconWidth:"24px",spacing:"3px",height:"50px",backgroundColor:"#ffffff",selectedIndex:0,shown:!0,...n.tabBar}:void 0}}function w(e,t=window){const{UniServiceJSBridge:n,UniViewJSBridge:o,getApp:i,uni:s,getCurrentPages:a,upx2px:p,setupPage:u}=e;t.UniServiceJSBridge=n,t.UniViewJSBridge=o,t.getApp=i,t.uni=s,t.wx=s,t.getCurrentPages=a,t.upx2px=p,t.__setupPage=d=>u(d)}function D(e,t,n){const{defineAsyncComponent:o,openBlock:i,createBlock:s,withCtx:a,createVNode:p}=e,{PageComponent:u,setupPage:d,getApp:r}=t;return{mpType:"page",setup(){var m;const _=r(),l=((m=_==null?void 0:_.$route)==null?void 0:m.query)||{},f=typeof n=="function"?o(n):n;return()=>(i(),s(u,null,{page:a(()=>[p(d(f),Object.assign({},l,{ref:"page"}),null,512)]),_:1}))}}}function J(e,t,n){var _;const{path:o,style:i={},meta:s={},home:a}=t,u=(((_=e.tabBar)==null?void 0:_.list)||[]).findIndex(l=>l.pagePath===o),d=u>-1,r=n===0;return{isTabBar:d,tabBarIndex:u,isQuit:a!=null?a:r,isEntry:a!=null?a:r,navigationBar:{type:"default",...T(i)},isNVue:!1,route:o,...s}}function R(e,t,n,o,i=window){const s=n.map((a,p)=>{const u=J(o,a,p),d=D(e,t,a.component),{path:r}=a;return{path:r,alias:r,meta:u,component:d}});i.__uniRoutes=s,i.__uniLayout={}}function B(e,t,n=window){g.adoptedStyleSheets(n,String(e),t)}function v(e,t){if(!t)return;["View","ScrollView","Swiper","MovableArea","MovableView","CoverView","CoverImage","Icon","Text","RichText","Progress","Button","CheckboxGroup","Checkbox","Editor","Form","Input","Label","Picker","PickerView","RadioGroup","Radio","Slider","Switch","Textarea","Navigator","Image","Video","Map","Canvas","WebView","PickerViewColumn","ResizeSensor","SwiperItem"].forEach(o=>{const i=t[o];e.component(o,i)})}function x(e){const t=I(e),{Vue:n,App:o,UniH5:i,routes:s=[],pagesJson:a={},manifestJson:p={},window:u,css:d=""}=t,{plugin:r,setupApp:_}=i;h(t,u),C(t,u),w(i,u),R(n,i,s,a,u),B(p.appid||Date.now(),d,u);const l=n.createApp(_(o));return l.use(v,i),l.use(r),l}function H(e,t){const n={};return Object.entries(e).forEach(([o,i])=>{S.includes(o)&&i&&(n[o]=t(i))}),n}async function $(e,t,n=!1,o="/pages"){var p,u,d;const i=((p=e.project)==null?void 0:p.pages)||[],s=[];for(const r of i){const _=await e.getDsl(r.id);if(!_)continue;const{renderer:l}=t({dsl:_,components:{}}),f=((u=e.project)==null?void 0:u.homepage)===r.id;s.push({id:r.id,path:`${o}/${r.id}`,component:l,style:{navigationBarTitleText:r.title,...r.style},needLogin:r.needLogin,home:f})}const a=s.find(r=>!!r.home)||s[0];if(a&&(s.unshift({...a,path:"/"}),s.unshift({...a,path:o})),n){const r=((d=e.project)==null?void 0:d.blocks)||[];for(const _ of r){const l=await e.getDsl(_.id);if(!l)continue;const{renderer:f}=t({dsl:l,components:{}});s.push({id:_.id,path:`${o}/${_.id}`,component:f,style:{navigationStyle:"custom"}})}}return s}function q(){if(window.uni)return window.uni.showLoading({title:"加载中...",mask:!0}),()=>{window.uni.hideLoading()}}function y(e,t="",n="warning"){window.uni&&window.uni.showModal({title:t,content:e,showCancel:!1})}function K(e){y(e)}c.APP_LIFE_CYCLE=S,c.MANIFEST_JSON=A,c.PAGES_JSON=N,c.PAGE_LIFE_CYCLES_LIST=P,c.alert=K,c.createUniAppComponent=H,c.createUniRoutes=$,c.getFileId=L,c.getGobalStyle=U,c.getNavigationBar=T,c.injectUniCSS=B,c.injectUniConfig=C,c.injectUniFeatures=h,c.injectUniGlobal=w,c.injectUniRoutes=R,c.install=v,c.loading=q,c.mergeOptions=I,c.navigationBarMaps=E,c.notify=y,c.setupUniApp=x,c.toKebabCase=O,c.version=b,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@vtj/uni",
3
3
  "private": false,
4
- "version": "0.10.0",
4
+ "version": "0.10.1-alpha.1",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "dependencies": {
8
- "@vtj/core": "~0.10.0",
9
- "@vtj/icons": "~0.10.0",
10
- "@vtj/renderer": "~0.10.0",
11
- "@vtj/utils": "~0.10.0"
8
+ "@vtj/core": "~0.10.1-alpha.1",
9
+ "@vtj/icons": "~0.10.1-alpha.1",
10
+ "@vtj/renderer": "~0.10.1-alpha.1",
11
+ "@vtj/utils": "~0.10.1-alpha.1"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@dcloudio/uni-app": "3.0.0-4040520250104002",
@@ -5,6 +5,12 @@ declare const _default: {
5
5
  "navigationBarTitleText": "uni-app",
6
6
  "navigationBarBackgroundColor": "#F8F8F8",
7
7
  "backgroundColor": "#F8F8F8"
8
+ },
9
+ "easycom": {
10
+ "autoscan": true,
11
+ "custom": {
12
+ "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
13
+ }
8
14
  }
9
15
  }
10
16
  ;
@@ -3,4 +3,4 @@ import { Provider } from '@vtj/renderer';
3
3
  import { SetupUniAppOptions, UniRoute } from '../types';
4
4
  export declare function setupUniApp(options: SetupUniAppOptions): any;
5
5
  export declare function createUniAppComponent(uniConfig: UniConfig, parser: (script: JSFunction) => Function): Record<string, Function>;
6
- export declare function createUniRoutes(provider: Provider, createRenderer: any, includeBlock?: boolean): Promise<UniRoute[]>;
6
+ export declare function createUniRoutes(provider: Provider, createRenderer: any, includeBlock?: boolean, basePath?: string): Promise<UniRoute[]>;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/uni
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.9.22
5
+ * @version 0.10.1-alpha.0
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.9.22";
8
+ export declare const version = "0.10.1-alpha.0";