@uni-helper/vite-plugin-uni-pages 0.1.4 → 0.1.5

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/index.d.ts +35 -8
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ interface EasyCom {
9
9
  }
10
10
 
11
11
  type HEXColor = `#${string}`;
12
+ type ThemeColor = `@${string}`;
12
13
 
13
14
  interface AppPlus {
14
15
  /**
@@ -123,7 +124,7 @@ interface GlobalStyle {
123
124
  * @default "#F7F7F7"
124
125
  * @desc APP与H5为#F7F7F7,小程序平台请参考相应小程序文档
125
126
  */
126
- navigationBarBackgroundColor?: HEXColor;
127
+ navigationBarBackgroundColor?: HEXColor | ThemeColor;
127
128
  /**
128
129
  * 导航栏标题颜色及状态栏前景颜色,仅支持 black/white
129
130
  * @default "white"
@@ -146,7 +147,7 @@ interface GlobalStyle {
146
147
  * @default "#ffffff"
147
148
  * @desc 微信小程序
148
149
  */
149
- backgroundColor?: HEXColor;
150
+ backgroundColor?: HEXColor | ThemeColor;
150
151
  /**
151
152
  * 下拉 loading 的样式,仅支持 dark / light
152
153
  * @default "dark"
@@ -170,13 +171,13 @@ interface GlobalStyle {
170
171
  * @default "#ffffff"
171
172
  * @desc 仅 iOS 平台
172
173
  */
173
- backgroundColorTop?: HEXColor;
174
+ backgroundColorTop?: HEXColor | ThemeColor;
174
175
  /**
175
176
  * 底部窗口的背景色(bounce回弹区域)
176
177
  * @default "#ffffff"
177
178
  * @desc 仅 iOS 平台
178
179
  */
179
- backgroundColorBottom?: HEXColor;
180
+ backgroundColorBottom?: HEXColor | ThemeColor;
180
181
  /**
181
182
  * 导航栏图片地址(替换当前文字标题),支付宝小程序内必须使用https的图片链接地址
182
183
  * @desc 支付宝小程序、H5、APP
@@ -513,6 +514,22 @@ interface PreloadRule {
513
514
  */
514
515
  network?: string;
515
516
  }
517
+ interface UniIdRouter {
518
+ /**
519
+ * 登录页面路径
520
+ */
521
+ loginPage: string;
522
+ /**
523
+ * 需要登录才可以访问的页面列表,可以使用正则语法
524
+ */
525
+ needLogin: string[];
526
+ /**
527
+ * 是否自动解析云对象及 clientDB 的错误码,如果是客户端 token 不正确或 token 过期则自动跳转配置的登录页面
528
+ *
529
+ * @default true
530
+ */
531
+ resToLogin?: boolean;
532
+ }
516
533
  interface SubPackage {
517
534
  /**
518
535
  * 子包的根目录
@@ -577,7 +594,9 @@ interface PagesConfig {
577
594
  * 分包预下载规则
578
595
  * @desc 微信小程序
579
596
  */
580
- preloadRule?: PreloadRule;
597
+ preloadRule?: {
598
+ [path: string]: PreloadRule;
599
+ };
581
600
  /**
582
601
  * `Worker` 代码放置的目录
583
602
  * @desc 微信小程序
@@ -599,9 +618,13 @@ interface PagesConfig {
599
618
  */
600
619
  rightWindow?: TheWindow;
601
620
  /**
602
- * 自动跳转相关配置,新增于HBuilderX 3.5.0
621
+ * 自动跳转相关配置,新增于 HBuilderX 3.5.0
603
622
  */
604
- uniIdRouter?: any;
623
+ uniIdRouter?: UniIdRouter;
624
+ /**
625
+ * 默认启动首页,新增于 HBuilderX 3.7.0
626
+ */
627
+ entryPagePath?: string;
605
628
  [x: string]: any;
606
629
  }
607
630
  interface UserPagesConfig extends PagesConfig {
@@ -698,6 +721,10 @@ interface PageMetaDatum {
698
721
  * 配置页面窗口表现,配置项参考下方 pageStyle
699
722
  */
700
723
  style?: GlobalStyle;
724
+ /**
725
+ * 当前页面是否需要登录才可以访问,此配置优先级高于 uniIdRouter 下的 needLogin
726
+ */
727
+ needLogin?: boolean;
701
728
  [x: string]: any;
702
729
  }
703
730
 
@@ -744,4 +771,4 @@ declare function getRouteBlock(path: string, options: ResolvedOptions): Promise<
744
771
 
745
772
  declare const VitePluginUniPages: (userOptions?: UserOptions) => Plugin;
746
773
 
747
- export { Condition, ConditionItem, CustomBlock, EasyCom, FILE_EXTENSIONS, GlobalStyle, IconFont, MODULE_ID_VIRTUAL, MidButton, OUTPUT_NAME, Options, PageContext, PageMetaDatum, PagePath, PagesConfig, PreloadRule, RESOLVED_MODULE_ID_VIRTUAL, ResolvedOptions, SubPackage, TabBar, TabBarItem, TheWindow, UserOptions, UserPagesConfig, VitePluginUniPages, checkPagesJsonFile, debug, VitePluginUniPages as default, defineUniPages, extsToGlob, getPageFiles, getPagesConfigSourcePaths, getRouteBlock, invalidatePagesModule, isConfigFile, isTargetFile, mergePageMetaDataArray, parseCustomBlock, parseSFC, resolveOptions, resolvePageDirs, writeFileSync };
774
+ export { Condition, ConditionItem, CustomBlock, EasyCom, FILE_EXTENSIONS, GlobalStyle, IconFont, MODULE_ID_VIRTUAL, MidButton, OUTPUT_NAME, Options, PageContext, PageMetaDatum, PagePath, PagesConfig, PreloadRule, RESOLVED_MODULE_ID_VIRTUAL, ResolvedOptions, SubPackage, TabBar, TabBarItem, TheWindow, UniIdRouter, UserOptions, UserPagesConfig, VitePluginUniPages, checkPagesJsonFile, debug, VitePluginUniPages as default, defineUniPages, extsToGlob, getPageFiles, getPagesConfigSourcePaths, getRouteBlock, invalidatePagesModule, isConfigFile, isTargetFile, mergePageMetaDataArray, parseCustomBlock, parseSFC, resolveOptions, resolvePageDirs, writeFileSync };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uni-helper/vite-plugin-uni-pages",
3
3
  "type": "module",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "packageManager": "pnpm@7.16.1",
6
6
  "description": "File system based routing for uni-app applications using Vite",
7
7
  "author": "KeJun",