@choiceform/os-client-core 3.4.6 → 3.4.10

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/index.d.ts CHANGED
@@ -237,16 +237,14 @@ interface CFEnvUi {
237
237
  initNodeTemplate?(
238
238
  template: CFNodeTemplate,
239
239
  state: CFSurveyState,
240
- loop: ICFLoop
241
240
  ): Promise<CFNodeTemplate>;
242
241
  /**
243
- * 加载当前问卷所有使用到的额UI动态插件的方法
242
+ * 预加载当前问卷所有使用到的额UI动态插件的方法
244
243
  * 只有实现了动态模板机制的答题端需要配置这个方法
245
244
  * 如果不配置则什么都不做
246
- * @param theme 主题
247
245
  * @param templates 模板列表
248
246
  */
249
- loadUiTemplates?(theme: CFTheme, templates: string[]): Promise<void>;
247
+ loadUiEntryTemplates?(templates: string[]): Promise<void>;
250
248
  }
251
249
 
252
250
  /**
@@ -742,6 +740,12 @@ interface CFSetupOptions {
742
740
  * @param message 错误内容
743
741
  */
744
742
  error(message: string): void;
743
+ /**
744
+ * 上传日志的方法,核心包运行时会生成一些有利于追踪已知错误的日志,希望能通过这个方法上传。
745
+ * 如果不设置则不会上传错误。而是在控制台打印出来
746
+ * @param message
747
+ */
748
+ uploadLog?(message: string, level?: 'log' | 'error'):void;
745
749
  /**
746
750
  * 如果在单页模式中有很多题目,进行作答后点击下一题,其中某道题目的答案不满足要求,
747
751
  * 这时候可能这道题目不再滚动条所在的可见范围内,
@@ -802,9 +806,9 @@ interface CFSetupOptions {
802
806
  * 自定义中断回调方法
803
807
  * 当核心包中运行发生异常,或者需要去往外部程序时,会中断答题流程,同时触发调用这个方法
804
808
  * 客户端中可以配置该方法来在此时机做一些自定义的事情。
805
- * 默认行为:什么也不做
809
+ * 默认行为:总是会在方法被调用的一秒内压制系统消息
806
810
  */
807
- customAbort?(relax?: boolean): void;
811
+ customAbort?(): void;
808
812
  /**
809
813
  * 自定义的去往开始页面方法,只有使用web核心包是需要关注这个方法
810
814
  *
@@ -1056,19 +1060,19 @@ interface CFCore extends CFSetupOptions {
1056
1060
  * 多次调用,只有第一次会发送请求
1057
1061
  * 请求的数据会放到缓存中,后面几次获得的都是返回的缓存数据
1058
1062
  */
1059
- fetchStartState(): Promise<CFStartState>;
1063
+ fetchStartState(): Promise<CFStartState | null>;
1060
1064
  /**
1061
1065
  * 获取答题也数据的方法
1062
1066
  * 多次调用,只有第一次会发送请求
1063
1067
  * 请求的数据会放到缓存中,后面几次获得的都是返回的缓存数据
1064
1068
  */
1065
- fetchSurveyState(): Promise<CFSurveyState>;
1069
+ fetchSurveyState(): Promise<CFSurveyState | null>;
1066
1070
  /**
1067
1071
  * 获取奖励页面数据的方法
1068
1072
  * 多次调用,只有第一次会发送请求
1069
1073
  * 请求的数据会放到缓存中,后面几次获得的都是返回的缓存数据
1070
1074
  */
1071
- fetchRewardState(): Promise<CFRewardState>;
1075
+ fetchRewardState(): Promise<CFRewardState | null>;
1072
1076
  /**
1073
1077
  * 获取主题
1074
1078
  */
@@ -2852,6 +2856,10 @@ interface ICFSmallPayload {
2852
2856
  * 测试用例数据
2853
2857
  */
2854
2858
  readonly testCases: ICFTestCase[];
2859
+ /**
2860
+ * 最后发布时间
2861
+ */
2862
+ readonly publishedAt: string;
2855
2863
  }
2856
2864
 
2857
2865
 
@@ -3147,12 +3155,7 @@ type ShouldSetDefault<T> = Required<Pick<T, OptionalKeys<T>>>;
3147
3155
  * 动态UI组件类型
3148
3156
  */
3149
3157
  interface CFUiComponent {
3150
- /**
3151
- * 样式对象
3152
- */
3153
- style: {
3154
- toString(): string;
3155
- };
3158
+
3156
3159
  }
3157
3160
 
3158
3161
  /**
@@ -6900,6 +6903,7 @@ interface ICFIntroMeta {
6900
6903
  readonly payload_digest: string;
6901
6904
  readonly diagram_url: string;
6902
6905
  readonly langs: ICFRemoteLang[];
6906
+ readonly published_at:string;
6903
6907
  }
6904
6908
 
6905
6909
  /**
@@ -6921,11 +6925,11 @@ interface ICFParsedSmallPayload {
6921
6925
  readonly varStyles: CFVarStyleGroup;
6922
6926
  readonly langs: ICFLang[];
6923
6927
  readonly language: string;
6924
- readonly langStore: any;
6925
6928
  readonly langTable: CFLangTableItem[];
6926
6929
  readonly langResume: boolean;
6927
6930
  readonly testCases: ICFTestCase[];
6928
6931
  readonly disabledLangs: string[];
6932
+ readonly publishedAt: string;
6929
6933
  }
6930
6934
 
6931
6935
  /**
@@ -7679,6 +7683,10 @@ interface ICFStartMiniState extends ICFCustomLogo {
7679
7683
  * 挂载的自动提示数据
7680
7684
  */
7681
7685
  readonly autoCpltGroups: ICFAutoCpltGroup[];
7686
+ /**
7687
+ * 自带的多语言翻译包,可以不需要请求大翻译包就实现开始页面的语言切换。
7688
+ */
7689
+ readonly i18n?: any;
7682
7690
  /**
7683
7691
  * @ignore
7684
7692
  * 自定义logo的图片内容
@@ -7825,6 +7833,10 @@ interface CFStartState extends ICFTranMiniState, ICFStartMiniIntro, CFStateBase,
7825
7833
  * 是否正在加载,当该属性为true时,UI需要选人加载中的状态
7826
7834
  */
7827
7835
  readonly nextLoading: boolean;
7836
+ /**
7837
+ * 最后发布地址
7838
+ */
7839
+ readonly publishedAt: string;
7828
7840
  }
7829
7841
 
7830
7842
 
@@ -8008,10 +8020,6 @@ interface CFSurveyState
8008
8020
  * @ignore
8009
8021
  */
8010
8022
  readonly refreshing: boolean;
8011
- /**
8012
- * @ignore
8013
- */
8014
- readonly needRegions: boolean;
8015
8023
  /**
8016
8024
  * @ignore
8017
8025
  */
@@ -9830,6 +9838,10 @@ interface ICFVarRaw {
9830
9838
  readonly name?: string;
9831
9839
  readonly uuid: string;
9832
9840
  readonly request?: ICFRequest;
9841
+ /**
9842
+ * 自带的语言包,为开始页面使用的时候可以自行翻译,而无需去加载翻译大包
9843
+ */
9844
+ readonly i18n?:any;
9833
9845
  }
9834
9846
 
9835
9847
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@choiceform/os-client-core",
3
- "version": "3.4.6",
3
+ "version": "3.4.10",
4
4
  "description": "choiceform survey client core",
5
5
  "main": "./dist/core.js",
6
6
  "repository": "https://github.com/choice-form/os-client-core",
@@ -46,7 +46,7 @@
46
46
  "@typescript-eslint/eslint-plugin": "^4.31.0",
47
47
  "@typescript-eslint/parser": "^4.31.0",
48
48
  "babel-loader": "^8.1.0",
49
- "cf-auto": "^1.94.0",
49
+ "cf-auto": "^1.96.0",
50
50
  "chokidar": "^3.0.2",
51
51
  "clean-webpack-plugin": "^3.0.0",
52
52
  "copy-webpack-plugin": "^6.0.3",