@choiceform/os-client-core 3.4.57 → 3.5.1-ssr-beta

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
@@ -904,6 +904,32 @@ interface CFUtil {
904
904
  * @param question 题目
905
905
  */
906
906
  getAnswer(question: CFQuestion): ICFAnswer;
907
+ /**
908
+ * 初始化变量依赖信息
909
+ * @param depends
910
+ */
911
+ initVarDepends(depends: IVarRelatedDependency): void;
912
+ /**
913
+ * 为开始状态中添加动态内容
914
+ */
915
+ addStartStateDynamics(state: CFStartState): void;
916
+ /**
917
+ * 为问卷状态中的添加态内容
918
+ */
919
+ addSurveyStateDynamics(state: CFSurveyState): void;
920
+ /**
921
+ * 为题目状态添加动态内容
922
+ */
923
+ addNodeDynamics(node: CFQuestion): void;
924
+ /**
925
+ * 为选项状态添加动态内容
926
+ */
927
+ addOptionDynamics(option: CFOption): void;
928
+ /**
929
+ * 为图片列表粘附变量解析能力
930
+ * @param imageList
931
+ */
932
+ extendImageListGetter(imageList: ICFImage[]): void;
907
933
  }
908
934
 
909
935
  /**
@@ -6315,8 +6341,7 @@ interface ICFSurveyMeta {
6315
6341
  * @ignore
6316
6342
  * todo 这里面只要包含一个cfpd对象就可以,不要把cfpd的每个属性都解开重新放到这里
6317
6343
  */
6318
- interface ICFParsedStartMeta {
6319
- imageList: ICFImage[];
6344
+ interface ICFParsedStartMeta extends IVarRelatedDependency {
6320
6345
  videoList: CFVideo[];
6321
6346
  nodeList: ICFNode[];
6322
6347
  /**
@@ -6324,11 +6349,9 @@ interface ICFParsedStartMeta {
6324
6349
  */
6325
6350
  surveyId: string;
6326
6351
  theme: ICFThemeConfig;
6327
- variables: ICFVarRaw[];
6328
6352
  surveyMeta: ICFSurveyMeta;
6329
6353
  nodeGroups: CFPDNodeGroup[];
6330
6354
  embedApis: ICFEmbedApi[];
6331
- varStyles: CFVarStyleGroup;
6332
6355
  langs: ICFLang[];
6333
6356
  language: string;
6334
6357
  langTable: CFLangTableItem[];
@@ -6722,6 +6745,7 @@ interface ICFRealtimeGlobalSetting extends CFPDCustomLogo {
6722
6745
  varStyles: CFVarStyleGroup;
6723
6746
  embedApis: ICFEmbedApi[];
6724
6747
  presetRichStyles: CFPDPresetRichStyle[];
6748
+ nodeGroups: ICFNodeGroup[];
6725
6749
  }
6726
6750
 
6727
6751
  /**
@@ -6753,7 +6777,7 @@ interface CFRealtime {
6753
6777
  * + 当[[CFRealtimeState.isGift]]为true,就可以当成[[CFRewardState]]来渲染奖励页面
6754
6778
  * + 否则,就当成[[CFSurveyState]]来渲染答题页面
6755
6779
  */
6756
- interface CFRealtimeState extends CFSurveyState, CFStartState {
6780
+ interface CFRealtimeState extends CFSurveyState, CFStartState, IVarRelatedDependency {
6757
6781
  /**
6758
6782
  * 奖励类型,预览奖励页面时才存在
6759
6783
  */
@@ -7100,7 +7124,8 @@ interface ICFStartMiniState extends ICFCustomLogo {
7100
7124
  * 以及一个开始答题的开始按钮.
7101
7125
  * 开始按钮点击后应该调用[[CFUIEventHandler.handleNextClick]]方法
7102
7126
  */
7103
- interface CFStartState extends ICFTranMiniState, ICFMiniState, CFStateBase, ICFCustomLogo {
7127
+ interface CFStartState extends ICFTranMiniState, ICFMiniState, CFStateBase, ICFCustomLogo, IVarRelatedDependency {
7128
+ nodeGroups: ICFNodeGroup[];
7104
7129
  core?: CFCore;
7105
7130
  /**
7106
7131
  * 开始节点的类型
@@ -7237,12 +7262,28 @@ interface ICFContext {
7237
7262
  question?: CFQuestion;
7238
7263
  }
7239
7264
 
7265
+ interface IVarRelatedDependency {
7266
+ /**
7267
+ * 样式组__
7268
+ */
7269
+ varStyles: CFVarStyleGroup;
7270
+ /**
7271
+ * 图片列表__
7272
+ */
7273
+ imageList: ICFImage[];
7274
+ /**
7275
+ * 选项列表__
7276
+ */
7277
+ variables: ICFVarRaw[];
7278
+ }
7279
+
7240
7280
  /**
7241
7281
  * 答题总状态
7242
7282
  * 答题页面数据
7243
7283
  * 使用[[CFSurveyState.nodes]]来渲染当前需要渲染的题目
7244
7284
  */
7245
- interface CFSurveyState extends ICFTranMiniState, ICFStartMiniState, ICFMiniState, CFStateBase {
7285
+ interface CFSurveyState extends ICFTranMiniState, ICFStartMiniState, ICFMiniState, CFStateBase, IVarRelatedDependency {
7286
+ nodeGroups: ICFNodeGroup[];
7246
7287
  /**
7247
7288
  * 进入问卷的模式
7248
7289
  */
@@ -8969,16 +9010,6 @@ interface CFImageInNode extends CFPDNodeImage {
8969
9010
  */
8970
9011
  // type?: IMG_REF_TYPE;
8971
9012
  }
8972
-
8973
- /**
8974
- * @todo 确认一下这个类型真的正确??? 怎么感觉好像已经不对了
8975
- */
8976
- declare const enum IMG_REF_TYPE {
8977
- /**
8978
- * 新增媒体这个类型
8979
- */
8980
- MEDIA = 'media',
8981
- }
8982
9013
  /**
8983
9014
  * 图片信息
8984
9015
  * @ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@choiceform/os-client-core",
3
- "version": "3.4.57",
3
+ "version": "3.5.1-ssr-beta",
4
4
  "description": "choiceform survey client core",
5
5
  "main": "./dist/core.js",
6
6
  "repository": "https://github.com/choice-form/os-client-core",
@@ -9,6 +9,7 @@
9
9
  "scripts": {
10
10
  "test": "node_modules/.bin/cf-auto --watch",
11
11
  "start": "webpack-dev-server --env NODE_ENV=local --mode=development",
12
+ "start-node": "webpack-dev-server --config ./ssr.webpack.config.js --env NODE_ENV=local --mode=development",
12
13
  "prod": "webpack --env NODE_ENV=prod --mode=production",
13
14
  "staging": "webpack --env NODE_ENV=staging --mode=production",
14
15
  "local": "webpack --env NODE_ENV=local --mode=development",