@media-quest/builder 0.0.10 → 0.0.11
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/dist/public-api.d.mts +29 -26
- package/dist/public-api.d.ts +29 -26
- package/dist/public-api.js +42 -38
- package/dist/public-api.mjs +40 -36
- package/package.json +2 -2
- package/src/Builder-page.spec.ts +2 -1
- package/src/Builder-page.ts +3 -1
- package/src/Builder-schema.spec.ts +3 -2
- package/src/Builder-schema.ts +10 -19
- package/src/primitives/page-prefix.ts +58 -0
- package/src/primitives/prefix.ts +0 -0
- package/src/primitives/schema-prefix.ts +52 -0
- package/src/primitives/varID.ts +11 -0
- package/src/public-api.ts +4 -1
- package/src/rulebuilder/Builder-rule.spec.ts +3 -1
- package/src/rulebuilder/Builder-rule.ts +2 -2
- package/src/rulebuilder/RuleAction.ts +82 -1
- package/src/rulebuilder/RuleBuilder-test-utils.ts +3 -1
- package/src/rulebuilder/RuleVariable.ts +3 -1
- package/src/rulebuilder/condition/Builder-condition.spec.ts +2 -1
- package/src/rulebuilder/multi-select-item.ts +0 -5
- package/src/rulebuilder/page-action-manager.ts +2 -1
- package/src/prefix.ts +0 -107
- /package/src/{prefix.spec.ts → primitives/prefix.spec.ts} +0 -0
package/dist/public-api.d.mts
CHANGED
|
@@ -167,15 +167,27 @@ declare class BuilderMainText extends BuilderObject<"builder-main-text", Builder
|
|
|
167
167
|
set audioFile(audioFile: AudioFile | false);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
type SchemaPrefixValue = string & {
|
|
171
|
-
__SCHEMA_PREFIX__: true;
|
|
172
|
-
};
|
|
173
170
|
type PagePrefixValue = string & {
|
|
174
171
|
__PAGE_PREFIX__: true;
|
|
175
172
|
};
|
|
176
|
-
|
|
177
|
-
declare
|
|
178
|
-
|
|
173
|
+
declare const createRandomPrefix: <const P extends string>(length: number) => P;
|
|
174
|
+
declare class PagePrefix {
|
|
175
|
+
private _value;
|
|
176
|
+
static readonly MIN_LENGTH = 1;
|
|
177
|
+
private static randomLen;
|
|
178
|
+
static readonly MAX_LENGTH = 16;
|
|
179
|
+
static create: () => PagePrefix;
|
|
180
|
+
static fromString: (value: string) => PagePrefix | false;
|
|
181
|
+
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
182
|
+
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
183
|
+
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
184
|
+
get value(): PagePrefixValue;
|
|
185
|
+
set value(value: string);
|
|
186
|
+
private constructor();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
type SchemaPrefixValue = string & {
|
|
190
|
+
__SCHEMA_PREFIX__: true;
|
|
179
191
|
};
|
|
180
192
|
declare class SchemaPrefix {
|
|
181
193
|
private _value;
|
|
@@ -187,25 +199,17 @@ declare class SchemaPrefix {
|
|
|
187
199
|
static fromString: (value: string) => SchemaPrefix | false;
|
|
188
200
|
static castOrCreateRandom: (value: string) => SchemaPrefix;
|
|
189
201
|
static isValid: (prefix: string | 999) => prefix is SchemaPrefixValue;
|
|
202
|
+
toJSON(): void;
|
|
190
203
|
get value(): SchemaPrefixValue;
|
|
204
|
+
get isValid(): boolean;
|
|
191
205
|
set value(value: string);
|
|
192
206
|
private constructor();
|
|
193
207
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
static fromValue: (value: PagePrefixValue) => PagePrefix;
|
|
200
|
-
static create: () => PagePrefix;
|
|
201
|
-
static fromString: (value: string) => PagePrefix | false;
|
|
202
|
-
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
203
|
-
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
204
|
-
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
205
|
-
get value(): PagePrefixValue;
|
|
206
|
-
set value(value: string);
|
|
207
|
-
private constructor();
|
|
208
|
-
}
|
|
208
|
+
|
|
209
|
+
type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
|
|
210
|
+
declare const VarID: {
|
|
211
|
+
create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
|
|
212
|
+
};
|
|
209
213
|
|
|
210
214
|
declare const BuilderVariableType: {
|
|
211
215
|
readonly numericWithOptions: true;
|
|
@@ -567,7 +571,7 @@ interface BuilderRuleDto {
|
|
|
567
571
|
readonly name: string;
|
|
568
572
|
readonly conditions: ReadonlyArray<BuilderConditionDto | BuilderConditionGroupDto>;
|
|
569
573
|
readonly excludeTags: ReadonlyArray<string>;
|
|
570
|
-
readonly excludePages: ReadonlyArray<
|
|
574
|
+
readonly excludePages: ReadonlyArray<PageID>;
|
|
571
575
|
readonly jumpToPage: string | false;
|
|
572
576
|
}
|
|
573
577
|
declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto> {
|
|
@@ -602,7 +606,7 @@ declare class PageActionManager {
|
|
|
602
606
|
private readonly _initialSelection;
|
|
603
607
|
readonly selectItems: ReadonlyArray<ExcludeByPageIdSelectItem>;
|
|
604
608
|
constructor(validOptions: RuleInput["_pageIdActions"], initialSelection: ReadonlyArray<string>);
|
|
605
|
-
getCurrentSelection(): ReadonlyArray<
|
|
609
|
+
getCurrentSelection(): ReadonlyArray<PageID>;
|
|
606
610
|
getEngineAction(): ReadonlyArray<ExcludeByPageAction>;
|
|
607
611
|
}
|
|
608
612
|
|
|
@@ -636,7 +640,7 @@ interface SchemaBuildOutput {
|
|
|
636
640
|
declare class BuilderSchema {
|
|
637
641
|
readonly id: SchemaID;
|
|
638
642
|
name: string;
|
|
639
|
-
|
|
643
|
+
readonly prefix: SchemaPrefix;
|
|
640
644
|
baseHeight: number;
|
|
641
645
|
baseWidth: number;
|
|
642
646
|
backgroundColor: string;
|
|
@@ -644,7 +648,6 @@ declare class BuilderSchema {
|
|
|
644
648
|
mainImage: ImageFile | false;
|
|
645
649
|
private _rules;
|
|
646
650
|
get rules(): ReadonlyArray<BuilderRule>;
|
|
647
|
-
get prefix(): SchemaPrefixValue;
|
|
648
651
|
private readonly _tagCollection;
|
|
649
652
|
get tags(): ReadonlyArray<BuilderTag>;
|
|
650
653
|
static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
|
|
@@ -684,4 +687,4 @@ declare class BuilderText extends BuilderObject<'builder-text', BuilderTextDto>
|
|
|
684
687
|
toJson(): BuilderTextDto;
|
|
685
688
|
}
|
|
686
689
|
|
|
687
|
-
export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem,
|
|
690
|
+
export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SingleSelectItem, TagActionManager, TagCollection, VarID, VideoFile, createRandomPrefix };
|
package/dist/public-api.d.ts
CHANGED
|
@@ -167,15 +167,27 @@ declare class BuilderMainText extends BuilderObject<"builder-main-text", Builder
|
|
|
167
167
|
set audioFile(audioFile: AudioFile | false);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
type SchemaPrefixValue = string & {
|
|
171
|
-
__SCHEMA_PREFIX__: true;
|
|
172
|
-
};
|
|
173
170
|
type PagePrefixValue = string & {
|
|
174
171
|
__PAGE_PREFIX__: true;
|
|
175
172
|
};
|
|
176
|
-
|
|
177
|
-
declare
|
|
178
|
-
|
|
173
|
+
declare const createRandomPrefix: <const P extends string>(length: number) => P;
|
|
174
|
+
declare class PagePrefix {
|
|
175
|
+
private _value;
|
|
176
|
+
static readonly MIN_LENGTH = 1;
|
|
177
|
+
private static randomLen;
|
|
178
|
+
static readonly MAX_LENGTH = 16;
|
|
179
|
+
static create: () => PagePrefix;
|
|
180
|
+
static fromString: (value: string) => PagePrefix | false;
|
|
181
|
+
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
182
|
+
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
183
|
+
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
184
|
+
get value(): PagePrefixValue;
|
|
185
|
+
set value(value: string);
|
|
186
|
+
private constructor();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
type SchemaPrefixValue = string & {
|
|
190
|
+
__SCHEMA_PREFIX__: true;
|
|
179
191
|
};
|
|
180
192
|
declare class SchemaPrefix {
|
|
181
193
|
private _value;
|
|
@@ -187,25 +199,17 @@ declare class SchemaPrefix {
|
|
|
187
199
|
static fromString: (value: string) => SchemaPrefix | false;
|
|
188
200
|
static castOrCreateRandom: (value: string) => SchemaPrefix;
|
|
189
201
|
static isValid: (prefix: string | 999) => prefix is SchemaPrefixValue;
|
|
202
|
+
toJSON(): void;
|
|
190
203
|
get value(): SchemaPrefixValue;
|
|
204
|
+
get isValid(): boolean;
|
|
191
205
|
set value(value: string);
|
|
192
206
|
private constructor();
|
|
193
207
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
static fromValue: (value: PagePrefixValue) => PagePrefix;
|
|
200
|
-
static create: () => PagePrefix;
|
|
201
|
-
static fromString: (value: string) => PagePrefix | false;
|
|
202
|
-
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
203
|
-
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
204
|
-
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
205
|
-
get value(): PagePrefixValue;
|
|
206
|
-
set value(value: string);
|
|
207
|
-
private constructor();
|
|
208
|
-
}
|
|
208
|
+
|
|
209
|
+
type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
|
|
210
|
+
declare const VarID: {
|
|
211
|
+
create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
|
|
212
|
+
};
|
|
209
213
|
|
|
210
214
|
declare const BuilderVariableType: {
|
|
211
215
|
readonly numericWithOptions: true;
|
|
@@ -567,7 +571,7 @@ interface BuilderRuleDto {
|
|
|
567
571
|
readonly name: string;
|
|
568
572
|
readonly conditions: ReadonlyArray<BuilderConditionDto | BuilderConditionGroupDto>;
|
|
569
573
|
readonly excludeTags: ReadonlyArray<string>;
|
|
570
|
-
readonly excludePages: ReadonlyArray<
|
|
574
|
+
readonly excludePages: ReadonlyArray<PageID>;
|
|
571
575
|
readonly jumpToPage: string | false;
|
|
572
576
|
}
|
|
573
577
|
declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto> {
|
|
@@ -602,7 +606,7 @@ declare class PageActionManager {
|
|
|
602
606
|
private readonly _initialSelection;
|
|
603
607
|
readonly selectItems: ReadonlyArray<ExcludeByPageIdSelectItem>;
|
|
604
608
|
constructor(validOptions: RuleInput["_pageIdActions"], initialSelection: ReadonlyArray<string>);
|
|
605
|
-
getCurrentSelection(): ReadonlyArray<
|
|
609
|
+
getCurrentSelection(): ReadonlyArray<PageID>;
|
|
606
610
|
getEngineAction(): ReadonlyArray<ExcludeByPageAction>;
|
|
607
611
|
}
|
|
608
612
|
|
|
@@ -636,7 +640,7 @@ interface SchemaBuildOutput {
|
|
|
636
640
|
declare class BuilderSchema {
|
|
637
641
|
readonly id: SchemaID;
|
|
638
642
|
name: string;
|
|
639
|
-
|
|
643
|
+
readonly prefix: SchemaPrefix;
|
|
640
644
|
baseHeight: number;
|
|
641
645
|
baseWidth: number;
|
|
642
646
|
backgroundColor: string;
|
|
@@ -644,7 +648,6 @@ declare class BuilderSchema {
|
|
|
644
648
|
mainImage: ImageFile | false;
|
|
645
649
|
private _rules;
|
|
646
650
|
get rules(): ReadonlyArray<BuilderRule>;
|
|
647
|
-
get prefix(): SchemaPrefixValue;
|
|
648
651
|
private readonly _tagCollection;
|
|
649
652
|
get tags(): ReadonlyArray<BuilderTag>;
|
|
650
653
|
static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
|
|
@@ -684,4 +687,4 @@ declare class BuilderText extends BuilderObject<'builder-text', BuilderTextDto>
|
|
|
684
687
|
toJson(): BuilderTextDto;
|
|
685
688
|
}
|
|
686
689
|
|
|
687
|
-
export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem,
|
|
690
|
+
export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SingleSelectItem, TagActionManager, TagCollection, VarID, VideoFile, createRandomPrefix };
|