@choiceform/os-client-core 3.4.3 → 3.4.7

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
  /**
@@ -382,6 +380,13 @@ interface CFEnvNetWork {
382
380
  * 默认行为:什么也不做
383
381
  */
384
382
  closeSocket?(): void;
383
+ /**
384
+ * 推动socket消息的方法
385
+ * 默认行为:什么也不做
386
+ * @param message 消息名
387
+ * @param payload 附带的数据
388
+ */
389
+ pushSocket?(message:string, payload: object): void;
385
390
  }
386
391
  /**
387
392
  * 授权相关的配置,不同的运行平台有不同的账户系统,所以授权方式也不一样。
@@ -603,10 +608,6 @@ interface CFEnvOptions {
603
608
  * 服务配置信息
604
609
  */
605
610
  interface CFHostConfig {
606
- /**
607
- * 错误统计服务key
608
- */
609
- readonly sentryKey: string;
610
611
  /**
611
612
  * 操作记录接口地址
612
613
  */
@@ -3144,12 +3145,7 @@ type ShouldSetDefault<T> = Required<Pick<T, OptionalKeys<T>>>;
3144
3145
  * 动态UI组件类型
3145
3146
  */
3146
3147
  interface CFUiComponent {
3147
- /**
3148
- * 样式对象
3149
- */
3150
- style: {
3151
- toString(): string;
3152
- };
3148
+
3153
3149
  }
3154
3150
 
3155
3151
  /**
@@ -5802,10 +5798,6 @@ interface CFQuestion extends ICFNode, ICFTypeInfo {
5802
5798
  * 前一道题
5803
5799
  */
5804
5800
  readonly prev: CFQuestion;
5805
- /**
5806
- * 后一道题
5807
- */
5808
- readonly next: CFQuestion;
5809
5801
  /**
5810
5802
  * 编号,该题的唯一代号
5811
5803
  * 如果有该属性,UI要渲染
@@ -6854,17 +6846,6 @@ interface ICFRandomHub extends ICFRandomNode, CFQuestion {
6854
6846
  readonly origin: ICFRandomNode;
6855
6847
  }
6856
6848
 
6857
- /**
6858
- * 虚拟奖励问题
6859
- * @ignore
6860
- */
6861
- interface ICFGiftHub extends ICFGiftNode, CFQuestion {
6862
- /**
6863
- * 是否获取短信失败
6864
- */
6865
- readonly messageGetFailed: boolean;
6866
- }
6867
-
6868
6849
  /**
6869
6850
  * @ignore
6870
6851
  * 虚拟逻辑题
@@ -6933,7 +6914,6 @@ interface ICFParsedSmallPayload {
6933
6914
  readonly varStyles: CFVarStyleGroup;
6934
6915
  readonly langs: ICFLang[];
6935
6916
  readonly language: string;
6936
- readonly langStore: any;
6937
6917
  readonly langTable: CFLangTableItem[];
6938
6918
  readonly langResume: boolean;
6939
6919
  readonly testCases: ICFTestCase[];
@@ -7571,6 +7551,7 @@ interface ICFRewardInfo extends ICFGiftNode, ICFLotteryResult, ICFCustomLogo {
7571
7551
  * 渲染奖励信息
7572
7552
  */
7573
7553
  interface CFRewardState extends ICFRewardInfo, CFStateBase {
7554
+ readonly renderId: string;
7574
7555
  /**
7575
7556
  * 奖励类型,包含以下两种类型
7576
7557
  * 需要根据该类型渲染不同的内容.
@@ -7629,6 +7610,10 @@ interface CFRewardState extends ICFRewardInfo, CFStateBase {
7629
7610
  * @ignore 该属性只在此核心项目中编程时使用,不会包含到发布后的包中
7630
7611
  */
7631
7612
  readonly language: string;
7613
+ /**
7614
+ * 是否获取短信失败
7615
+ */
7616
+ readonly messageGetFailed?: boolean;
7632
7617
  }
7633
7618
 
7634
7619
 
@@ -7686,6 +7671,10 @@ interface ICFStartMiniState extends ICFCustomLogo {
7686
7671
  * 挂载的自动提示数据
7687
7672
  */
7688
7673
  readonly autoCpltGroups: ICFAutoCpltGroup[];
7674
+ /**
7675
+ * 自带的多语言翻译包,可以不需要请求大翻译包就实现开始页面的语言切换。
7676
+ */
7677
+ readonly i18n?: any;
7689
7678
  /**
7690
7679
  * @ignore
7691
7680
  * 自定义logo的图片内容
@@ -7734,6 +7723,14 @@ interface ICFStartMiniState extends ICFCustomLogo {
7734
7723
  */
7735
7724
  interface CFStartState extends ICFTranMiniState, ICFStartMiniIntro, CFStateBase, ICFCustomLogo {
7736
7725
  readonly core?: CFCore;
7726
+ /**
7727
+ * 开始节点的类型
7728
+ */
7729
+ readonly type: NODE_TYPE;
7730
+ /**
7731
+ * 开始节点的名称
7732
+ */
7733
+ readonly nodeName:string;
7737
7734
  /**
7738
7735
  * 开始节点的布局设置
7739
7736
  */
@@ -8007,10 +8004,6 @@ interface CFSurveyState
8007
8004
  * @ignore
8008
8005
  */
8009
8006
  readonly refreshing: boolean;
8010
- /**
8011
- * @ignore
8012
- */
8013
- readonly needRegions: boolean;
8014
8007
  /**
8015
8008
  * @ignore
8016
8009
  */
@@ -9387,9 +9380,10 @@ interface CFUIEventHandler {
9387
9380
  /**
9388
9381
  * 获取验证码按钮点击回调,适用题目,验证节点,奖励节点
9389
9382
  * 回调中逻辑层会去获取短信验证码或者图片验证码
9390
- * @param question 所在题目
9383
+ * 当发送成功会返回Promise<true>,否则返回Promise<false>
9384
+ * @param target 使用短信的对象
9391
9385
  */
9392
- handleGetCodeClick?(question: CFQuestion): Promise<void>;
9386
+ handleGetCodeClick?(target: CFVerifyQuestion | CFRewardState): Promise<boolean>;
9393
9387
 
9394
9388
  /**
9395
9389
  * 选项输入回调函数:适用题目填空题,打分题,数值分配题,连续评价题,上传题,输入方式排序或挑选方式排序的排序题以及有其他选项需要输入的题型
@@ -9828,6 +9822,10 @@ interface ICFVarRaw {
9828
9822
  readonly name?: string;
9829
9823
  readonly uuid: string;
9830
9824
  readonly request?: ICFRequest;
9825
+ /**
9826
+ * 自带的语言包,为开始页面使用的时候可以自行翻译,而无需去加载翻译大包
9827
+ */
9828
+ readonly i18n?:any;
9831
9829
  }
9832
9830
 
9833
9831
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@choiceform/os-client-core",
3
- "version": "3.4.3",
4
- "description": "choice form survey client core",
3
+ "version": "3.4.7",
4
+ "description": "choiceform survey client core",
5
5
  "main": "./dist/core.js",
6
6
  "repository": "https://github.com/choice-form/os-client-core",
7
7
  "author": "fenyiwudian <laiq@cform.io>",
@@ -42,10 +42,11 @@
42
42
  "@babel/preset-env": "^7.10.4",
43
43
  "@babel/runtime": "^7.12.1",
44
44
  "@types/node-fetch": "^2.5.8",
45
+ "@types/phoenix": "^1.5.3",
45
46
  "@typescript-eslint/eslint-plugin": "^4.31.0",
46
47
  "@typescript-eslint/parser": "^4.31.0",
47
48
  "babel-loader": "^8.1.0",
48
- "cf-auto": "^1.94.0",
49
+ "cf-auto": "^1.96.0",
49
50
  "chokidar": "^3.0.2",
50
51
  "clean-webpack-plugin": "^3.0.0",
51
52
  "copy-webpack-plugin": "^6.0.3",
@@ -60,7 +61,7 @@
60
61
  "messageformat": "^2.3.0",
61
62
  "node-fetch": "^2.6.1",
62
63
  "pako": "^1.0.10",
63
- "phoenix": "^1.5.3",
64
+ "phoenix": "^1.6.2",
64
65
  "prettier": "^2.3.2",
65
66
  "typedoc": "^0.15.0",
66
67
  "ua-parser-js": "^0.7.20"
@@ -72,4 +73,4 @@
72
73
  "webpack-cli": "^4.8.0",
73
74
  "webpack-dev-server": "^4.1.1"
74
75
  }
75
- }
76
+ }