@choiceform/os-client-core 3.4.40 → 3.4.41

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
@@ -227,6 +227,12 @@ interface CFEnvUi {
227
227
  * @param templates 模板列表
228
228
  */
229
229
  loadUiEntryTemplates?(templates: string[]): Promise<void>;
230
+ /**
231
+ * 插入预设富文本样式表
232
+ * @param style 样式:css字符形式
233
+ * @param styleGroup 样式信息:JSON形式
234
+ */
235
+ setPresetStyle?(style: string, rawStyles: CFPDPresetRichStyle[]): void;
230
236
  }
231
237
 
232
238
  /**
@@ -1882,6 +1888,10 @@ interface ICFSurveyPayload {
1882
1888
  * 测试用例数据
1883
1889
  */
1884
1890
  testCases: ICFTestCase[];
1891
+ /**
1892
+ * 预设样式
1893
+ */
1894
+ presetRichStyles?: CFPDPresetRichStyle[];
1885
1895
  }
1886
1896
 
1887
1897
 
@@ -5952,6 +5962,7 @@ interface ICFSurveyMeta {
5952
5962
 
5953
5963
  /**
5954
5964
  * @ignore
5965
+ * todo 这里面只要包含一个cfpd对象就可以,不要把cfpd的每个属性都解开重新放到这里
5955
5966
  */
5956
5967
  interface ICFParsedSurveyMeta {
5957
5968
  imageList: ICFImage[];
@@ -5974,6 +5985,7 @@ interface ICFParsedSurveyMeta {
5974
5985
  testCases: ICFTestCase[];
5975
5986
  disabledLangs: string[];
5976
5987
  publishedAt: string;
5988
+ presetRichStyles: CFPDPresetRichStyle[];
5977
5989
  }
5978
5990
 
5979
5991
  /**
@@ -6369,6 +6381,7 @@ interface ICFRealtimeContent {
6369
6381
  prevBtnText: string;
6370
6382
  varStyles: CFVarStyleGroup;
6371
6383
  embedApis: ICFEmbedApi[];
6384
+ presetRichStyles: CFPDPresetRichStyle[];
6372
6385
  };
6373
6386
  regionList: ECProvince[];
6374
6387
  }
@@ -10529,10 +10542,72 @@ declare const enum OPTION_POSITION {
10529
10542
 
10530
10543
  // -------------- node_modules/@choiceform/os-cfpd/types/index.d.ts ---------------
10531
10544
 
10545
+
10546
+ /**
10547
+ * 问卷数据专有基础卫星,只有完整问卷,部分问卷共用该数据结构
10548
+ * 问卷模块的数据结构中关键的几个属性是有后台控制的,命名风格不一致,另外定义了。
10549
+ */
10550
+ interface CFPDSurveyUniqueBase {
10551
+ /**
10552
+ * 内置接口列表
10553
+ */
10554
+ embedApis: CFPDEmbedApi[];
10555
+ /**
10556
+ * 使用的节点组列表
10557
+ */
10558
+ nodeGroups: CFPDNodeGroup[];
10559
+ /**
10560
+ * 媒体库
10561
+ */
10562
+ mediaLibrary: {
10563
+ /**
10564
+ * 图片列表
10565
+ */
10566
+ imageList: CFPDImage[];
10567
+ /**
10568
+ * 视频列表
10569
+ */
10570
+ videoList: CFPDVideo[];
10571
+ };
10572
+ }
10573
+
10574
+
10575
+ /**
10576
+ * 问卷数据通用基础,完整问卷,部分问卷,问卷模块都共用该结构
10577
+ */
10578
+ interface CFPDSurveyCommonBase {
10579
+ /**
10580
+ * 导出时装载的主语言
10581
+ */
10582
+ currentLang?: LANG_TYPE;
10583
+ /**
10584
+ * 多语言包数据,是多语言的一种存在方式,
10585
+ * 1. 常规情况下,问卷保存和加载时,该属性不存在,因为这种情况下是靠后台分离保存了多语言,
10586
+ * 这样可以减少主cfpd的大小,答题端后面使用多语言的时候按需加载,避免初始加载所有的语言。
10587
+ * 2. 导入/导出cfpd文件、使用/保存问卷模板等情况下,后台是没法负责保存多语言的,所以只能打包到cfpd中,
10588
+ * 正好这些情况下,无需为答题端优化。
10589
+ */
10590
+ langPack?: any;
10591
+ /**
10592
+ * 节点列表
10593
+ */
10594
+ nodes: CFPDNode[];
10595
+ /**
10596
+ * 变量列表
10597
+ */
10598
+ variables: CFPDVar[];
10599
+
10600
+ /**
10601
+ * 预设样式选项列表
10602
+ */
10603
+ presetRichStyles?: CFPDPresetRichStyle[]
10604
+ }
10605
+
10606
+
10532
10607
  /**
10533
10608
  * 全问卷的JSON表现形式的数据规范
10534
10609
  */
10535
- interface CFPDFullSurvey {
10610
+ interface CFPDFullSurvey extends CFPDSurveyCommonBase, CFPDSurveyUniqueBase {
10536
10611
  /**
10537
10612
  * 是否包含错误,
10538
10613
  * 高级版编辑器有复杂的错误处理程序来检测问卷是否包含错误,
@@ -10592,10 +10667,7 @@ interface CFPDFullSurvey {
10592
10667
  * 被禁用语言列表
10593
10668
  */
10594
10669
  disabledLangs: LANG_TYPE[];
10595
- /**
10596
- * 内置接口列表
10597
- */
10598
- embedApis: CFPDEmbedApi[];
10670
+
10599
10671
  /**
10600
10672
  * 测试用例列表
10601
10673
  */
@@ -10612,10 +10684,6 @@ interface CFPDFullSurvey {
10612
10684
  * 是否正在请求升级为V3
10613
10685
  */
10614
10686
  v3Requesting?: boolean;
10615
- /**
10616
- * 问卷当前语言,
10617
- */
10618
- currentLang: LANG_TYPE;
10619
10687
  /**
10620
10688
  * 是否包含变量
10621
10689
  */
@@ -10624,47 +10692,22 @@ interface CFPDFullSurvey {
10624
10692
  * 节点总数量
10625
10693
  */
10626
10694
  nodeCount: number;
10627
- /**
10628
- * 多语言包数据,是多语言的一种存在方式,
10629
- * 1. 常规情况下,问卷保存和加载时,该属性不存在,因为这种情况下是靠后台分离保存了多语言,
10630
- * 这样可以减少主cfpd的大小,答题端后面使用多语言的时候按需加载,避免初始加载所有的语言。
10631
- * 2. 导入/导出cfpd文件、使用/保存问卷模板等情况下,后台是没法负责保存多语言的,所以只能打包到cfpd中,
10632
- * 正好这些情况下,无需为答题端优化。
10633
- */
10634
- langPack?: any;
10695
+
10635
10696
  /**
10636
10697
  * 总体最多可能出现的题目数
10637
10698
  */
10638
10699
  longestCount: number;
10639
- /**
10640
- * 媒体库
10641
- */
10642
- mediaLibrary: {
10643
- /**
10644
- * 图片列表
10645
- */
10646
- imageList: CFPDImage[];
10647
- /**
10648
- * 视频列表
10649
- */
10650
- videoList: CFPDVideo[];
10651
- };
10700
+
10652
10701
  /**
10653
10702
  * 是新建问卷,新建问卷时使用,其他时候无需。
10654
10703
  */
10655
10704
  new?: boolean;
10656
- /**
10657
- * 使用的节点组列表
10658
- */
10659
- nodeGroups: CFPDNodeGroup[];
10705
+
10660
10706
  /**
10661
10707
  * 问卷使用的主题信息
10662
10708
  */
10663
10709
  theme: CFPDTheme;
10664
- /**
10665
- * 变量列表
10666
- */
10667
- variables: CFPDVar[];
10710
+
10668
10711
  /**
10669
10712
  * 变量样式配置
10670
10713
  */
@@ -10677,65 +10720,22 @@ interface CFPDFullSurvey {
10677
10720
  * 保存时的问卷缩放率
10678
10721
  */
10679
10722
  zoom: number;
10680
- /**
10681
- * 节点列表
10682
- */
10683
- nodes: CFPDNode[]
10684
10723
  }
10685
10724
 
10686
10725
 
10687
10726
  /**
10688
10727
  * 部分导入导出的问卷片段数据结构
10689
10728
  */
10690
- interface CFPDPartialSurvey {
10729
+ interface CFPDPartialSurvey extends Partial<CFPDSurveyCommonBase>, Partial<CFPDSurveyUniqueBase> {
10691
10730
  /**
10692
10731
  * 自动提示配置
10693
10732
  */
10694
- auto_complete_groups?: CFPDCpltGroup[];
10695
- /**
10696
- * 导出时装载的主语言
10697
- */
10698
- currentLang?: LANG_TYPE;
10699
- /**
10700
- * 内置接口
10701
- */
10702
- embed_apis?: CFPDEmbedApi[];
10703
-
10704
- /**
10705
- * 节点组列表
10706
- */
10707
- groups?: CFPDNodeGroup[];
10708
- /**
10709
- * 导出的多语言语言包
10710
- * @todo 需要规范
10711
- */
10712
- langPack?: any;
10713
- /**
10714
- * 媒体资源
10715
- */
10716
- media?: {
10717
- /**
10718
- * 图片列表
10719
- */
10720
- imageList: CFPDImage[];
10721
- /**
10722
- * 视频列表
10723
- */
10724
- videoList: CFPDVideo[];
10725
- };
10726
- /**
10727
- * 节点JSON数据列表
10728
- */
10729
- nodes?: CFPDNode[];
10733
+ autoCpltGroups?: CFPDCpltGroup[];
10730
10734
  /**
10731
10735
  * 导入替换时需要豁免的id列表,这些id在导入时不会被替换,
10732
10736
  * 只有在复制黏贴的时候才会出现。
10733
10737
  */
10734
10738
  replaceExemptIds?: string[];
10735
- /**
10736
- * 变量JSON数据列表
10737
- */
10738
- variables?: CFPDVar[];
10739
10739
  }
10740
10740
 
10741
10741
  // -------------- node_modules/@choiceform/os-cfpd/types/logic/config.d.ts ---------------
@@ -13820,6 +13820,33 @@ interface CFPDWeightOption extends CFPDOption, CFPDMPositionOption {
13820
13820
  maxMark: string;
13821
13821
  }
13822
13822
 
13823
+ // -------------- node_modules/@choiceform/os-cfpd/types/style/preset-style.d.ts ---------------
13824
+
13825
+ /**
13826
+ * 新增的预设样式配置项数据
13827
+ */
13828
+ interface CFPDPresetRichStyle {
13829
+ /**
13830
+ * 唯一id,
13831
+ * 可按规则自动生成,如8位短id的方式。
13832
+ * 将该配置应用到标签上时,就在标签上加入一个
13833
+ * `preset-rich-style-`拼接该id的类名,全局中也动态包含着该类名的样式
13834
+ */
13835
+ id: string;
13836
+ /**
13837
+ * 配置名,用于管理界面中展示
13838
+ */
13839
+ name: string;
13840
+ /**
13841
+ * 具体的样式内容
13842
+ */
13843
+ value: CFPDRichTextStyle;
13844
+ /**
13845
+ * 是否已经被使用了,需要系统动态监测,具体检测方案后续会新开主题讲述
13846
+ */
13847
+ used: boolean;
13848
+ }
13849
+
13823
13850
  // -------------- node_modules/@choiceform/os-cfpd/types/style/rich-text.d.ts ---------------
13824
13851
 
13825
13852
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@choiceform/os-client-core",
3
- "version": "3.4.40",
3
+ "version": "3.4.41",
4
4
  "description": "choiceform survey client core",
5
5
  "main": "./dist/core.js",
6
6
  "repository": "https://github.com/choice-form/os-client-core",