@media-quest/builder 0.0.30 → 0.0.32

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.
@@ -1,4 +1,4 @@
1
- import { Condition, PageQueRules, SchemaDto } from '@media-quest/engine';
1
+ import { Condition, PageQueRules, SchemaDto, DStyle } from '@media-quest/engine';
2
2
 
3
3
  /**
4
4
  * Builder objects are complex objects that are embedded inside
@@ -595,6 +595,179 @@ declare class BuilderTag extends BuilderObject<"builder-tag", BuilderTagDto> {
595
595
  toJson(): BuilderTagDto;
596
596
  }
597
597
 
598
+ interface ThemeCompiler<ThemeSchema> {
599
+ currentTheme: ThemeSchema;
600
+ allThemes: ThemeSchema[];
601
+ setTheme(theme: ThemeSchema): void;
602
+ compile(schema: BuilderSchemaDto): SchemaDto;
603
+ }
604
+
605
+ interface CssTheme<S extends Partial<DStyle> = Partial<DStyle>> {
606
+ css: S;
607
+ cssEnabled: Partial<DStyle>;
608
+ cssDisabled: Partial<DStyle>;
609
+ }
610
+
611
+ type PStyle = Partial<DStyle>;
612
+ interface IDefaultTheme {
613
+ name: string;
614
+ schemaBackgroundColor: string;
615
+ dimensions: {
616
+ baseHeight: number;
617
+ baseWidth: number;
618
+ };
619
+ pageBackGroundImage?: {
620
+ url: string;
621
+ style: PStyle;
622
+ };
623
+ pageBackGround?: {
624
+ style: PStyle;
625
+ };
626
+ backGroundArea1?: {
627
+ style: PStyle;
628
+ };
629
+ backGroundArea2?: {
630
+ style: PStyle;
631
+ };
632
+ backGroundArea3?: {
633
+ style: PStyle;
634
+ };
635
+ progressBar?: {
636
+ width: number;
637
+ height: number;
638
+ bottom: number;
639
+ left: number;
640
+ backgroundStyles: PStyle;
641
+ progressStyles: PStyle;
642
+ text?: {
643
+ style: PStyle;
644
+ textType: "percent" | "page-progress";
645
+ };
646
+ };
647
+ image: {
648
+ style: PStyle;
649
+ };
650
+ videoPlayer: {
651
+ playButton: {
652
+ iconUrl: string;
653
+ css: PStyle;
654
+ cssDisabled: PStyle;
655
+ cssEnabled: PStyle;
656
+ text?: {
657
+ text: string;
658
+ css: PStyle;
659
+ };
660
+ };
661
+ buttonBar?: PStyle;
662
+ pauseButton: {
663
+ iconUrl: string;
664
+ css: PStyle;
665
+ cssDisabled: PStyle;
666
+ cssEnabled: PStyle;
667
+ text?: {
668
+ text: string;
669
+ css: PStyle;
670
+ };
671
+ };
672
+ replayButton?: {
673
+ iconUrl: string;
674
+ css: PStyle;
675
+ cssDisabled: PStyle;
676
+ cssEnabled: PStyle;
677
+ text?: {
678
+ text: string;
679
+ css: PStyle;
680
+ };
681
+ };
682
+ muteButton?: {
683
+ iconUrl: string;
684
+ css: PStyle;
685
+ text?: {
686
+ text: string;
687
+ css: PStyle;
688
+ };
689
+ };
690
+ unMuteButton?: {
691
+ iconUrl: string;
692
+ css: PStyle;
693
+ text?: {
694
+ text: string;
695
+ css: PStyle;
696
+ };
697
+ };
698
+ videoElement: {
699
+ css: PStyle;
700
+ };
701
+ };
702
+ mainText: {
703
+ base: {
704
+ text: PStyle;
705
+ audio: {
706
+ css: PStyle;
707
+ cssDisabled: PStyle;
708
+ cssEnabled: PStyle;
709
+ iconUrl: string;
710
+ };
711
+ };
712
+ notMediaNotAudio: {
713
+ text: PStyle;
714
+ };
715
+ hasMediaNotAudio: {
716
+ text: PStyle;
717
+ };
718
+ hasMediaHasAudio: {
719
+ text: PStyle;
720
+ audio: PStyle;
721
+ };
722
+ notMediaHasAudio: {
723
+ text: PStyle;
724
+ audio: PStyle;
725
+ };
726
+ };
727
+ buttonBar: {
728
+ vibrateMs: number | false;
729
+ container: {
730
+ base: PStyle;
731
+ whenSingle: PStyle;
732
+ whenMany: PStyle;
733
+ };
734
+ responseButtons: BuilderOptionTheme;
735
+ nextButtonTheme: BuilderOptionTheme;
736
+ };
737
+ }
738
+ interface ButtonTheme {
739
+ btn: CssTheme;
740
+ divider: PStyle;
741
+ text1: PStyle;
742
+ text2: PStyle;
743
+ }
744
+ interface BuilderOptionTheme {
745
+ name: string;
746
+ normal: ButtonTheme;
747
+ dontKnow: ButtonTheme;
748
+ }
749
+
750
+ declare class DefaultThemeCompiler implements ThemeCompiler<IDefaultTheme> {
751
+ readonly name = "Ispe default theme.";
752
+ readonly defaultTheme: IDefaultTheme;
753
+ readonly theme2: IDefaultTheme;
754
+ currentTheme: IDefaultTheme;
755
+ allThemes: IDefaultTheme[];
756
+ private readonly TAG;
757
+ setTheme(theme: IDefaultTheme): void;
758
+ constructor();
759
+ private compileRules;
760
+ compile(source: BuilderSchemaDto): SchemaDto;
761
+ private compilePage;
762
+ private compileImage;
763
+ private compileMainText;
764
+ private compileMainTextAudio;
765
+ private compileVideo;
766
+ private compileQuestion;
767
+ private compileButtonBar;
768
+ private compileButton;
769
+ }
770
+
598
771
  interface SumScoreVariableDto {
599
772
  id: SumScoreVariableID;
600
773
  name: string;
@@ -708,6 +881,7 @@ declare class BuilderSchema {
708
881
  readonly id: SchemaID;
709
882
  name: string;
710
883
  readonly prefix: SchemaPrefix;
884
+ readonly compiler: DefaultThemeCompiler;
711
885
  baseHeight: number;
712
886
  baseWidth: number;
713
887
  backgroundColor: string;
@@ -820,4 +994,6 @@ declare class TagCollection implements Iterable<BuilderTag> {
820
994
  deleteAll(tags: Iterable<BuilderTag>): void;
821
995
  }
822
996
 
823
- export { type AudioFile, BuilderCondition, type BuilderConditionDto, BuilderConditionGroup, type BuilderConditionGroupDto, type BuilderMainImageDto, BuilderMainText, type BuilderMainTextDto, type BuilderMainVideoDto, BuilderOperator, BuilderOption, type BuilderOptionDto, BuilderPage, type BuilderPageDto, type BuilderPageType, BuilderQuestion, type BuilderQuestionDto, type BuilderQuestionType, BuilderRule, type BuilderRuleDto, BuilderSchema, type BuilderSchemaDto, BuilderTag, type BuilderTagDto, BuilderText, type BuilderTextDto, CodeBook, type CodeBookQuestionVariable, type Codebook, type CodebookPredefinedVariable, type CompilerOption, type CompilerOutput, ConditionGroupType, type ExcludeByPageAction, ExcludeByPageIdSelectItem, type ExcludeByTagAction, ExcludeByTagSelectItem, type ID, type ImageFile, JumpToActionManager, type JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, OptionID, PageActionManager, PageID, PagePrefix, type PagePrefixValue, QuestionID, RuleCustomVariable, RuleInput, RuleOptionSelectItem, RuleQuestionVariable, type RuleVariable, RuleVariableOption, RuleVariableSelectItem, SchemaConfig, SchemaID, SchemaPrefix, type SchemaPrefixValue, SingleSelectItem, SumScore, type SumScoreAnswer, SumScoreVariable, type SumScoreVariableDto, SumScoreVariableID, TagActionManager, TagCollection, TagID, TextID, VarID, type VideoFile, _CodeBook, createTypedIdSingleton };
997
+ declare const DefaultTheme: IDefaultTheme;
998
+
999
+ export { type AudioFile, BuilderCondition, type BuilderConditionDto, BuilderConditionGroup, type BuilderConditionGroupDto, type BuilderMainImageDto, BuilderMainText, type BuilderMainTextDto, type BuilderMainVideoDto, BuilderOperator, BuilderOption, type BuilderOptionDto, BuilderPage, type BuilderPageDto, type BuilderPageType, BuilderQuestion, type BuilderQuestionDto, type BuilderQuestionType, BuilderRule, type BuilderRuleDto, BuilderSchema, type BuilderSchemaDto, BuilderTag, type BuilderTagDto, BuilderText, type BuilderTextDto, CodeBook, type CodeBookQuestionVariable, type Codebook, type CodebookPredefinedVariable, type CompilerOption, type CompilerOutput, ConditionGroupType, DefaultTheme, type ExcludeByPageAction, ExcludeByPageIdSelectItem, type ExcludeByTagAction, ExcludeByTagSelectItem, type ID, type ImageFile, JumpToActionManager, type JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, OptionID, PageActionManager, PageID, PagePrefix, type PagePrefixValue, QuestionID, RuleCustomVariable, RuleInput, RuleOptionSelectItem, RuleQuestionVariable, type RuleVariable, RuleVariableOption, RuleVariableSelectItem, SchemaConfig, SchemaID, SchemaPrefix, type SchemaPrefixValue, SingleSelectItem, SumScore, type SumScoreAnswer, SumScoreVariable, type SumScoreVariableDto, SumScoreVariableID, TagActionManager, TagCollection, TagID, TextID, VarID, type VideoFile, _CodeBook, createTypedIdSingleton };