@m2c2kit/core 0.3.22 → 0.3.24
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/index.d.ts +23 -3
- package/dist/index.js +301 -286
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +3 -3
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -220,10 +220,12 @@ type JsonSchemaDataTypeScriptTypes = string | number | object | boolean | null |
|
|
|
220
220
|
* All the data created by an activity.
|
|
221
221
|
*/
|
|
222
222
|
interface ActivityResults {
|
|
223
|
-
/** All the data created by the activity. */
|
|
223
|
+
/** All the data of the specified data type created thus far by the activity. */
|
|
224
224
|
data: ActivityKeyValueData;
|
|
225
225
|
/** JSON schema describing the structure of the data. */
|
|
226
226
|
dataSchema: JsonSchema;
|
|
227
|
+
/** Type of data. */
|
|
228
|
+
dataType: "Trial" | "Scoring" | "Survey";
|
|
227
229
|
/** Parameters under which the activity was run. */
|
|
228
230
|
activityConfiguration: unknown;
|
|
229
231
|
/** JSON schema describing the activity parameters. */
|
|
@@ -733,7 +735,8 @@ interface SoundAsset {
|
|
|
733
735
|
* `OK_BUTTON` uses the game's default font for all locales. Because hi-IN
|
|
734
736
|
* specified a font name, the `overrideFontName` property with a value of
|
|
735
737
|
* `default` is used to specify that the game's default font should be used
|
|
736
|
-
* instead of the locale's font, devanagari.
|
|
738
|
+
* instead of the locale's font, devanagari. In addition, hi-IN specifies a
|
|
739
|
+
* different font size for the `OK_BUTTON` text.
|
|
737
740
|
*
|
|
738
741
|
* `BYE` uses interpolation. `{{name}}` is a placeholder that will be replaced,
|
|
739
742
|
* at runtime, with the value of the `name` key in the `options` object passed
|
|
@@ -784,6 +787,7 @@ interface SoundAsset {
|
|
|
784
787
|
* },
|
|
785
788
|
* "OK_BUTTON": {
|
|
786
789
|
* text: "OK",
|
|
790
|
+
* fontSize: 12,
|
|
787
791
|
* overrideFontName: "default"
|
|
788
792
|
* },
|
|
789
793
|
* "BYE": "अलविदा {{name}}."
|
|
@@ -843,6 +847,8 @@ type LocaleTranslationMap = {
|
|
|
843
847
|
interface TextWithFontCustomization {
|
|
844
848
|
/** The translated string. */
|
|
845
849
|
text: string;
|
|
850
|
+
/** Font size to use when displaying the text. */
|
|
851
|
+
fontSize?: number;
|
|
846
852
|
/** Font name(s) to _add to_ the locale's font name(s) when displaying text. */
|
|
847
853
|
additionalFontName?: string | Array<string>;
|
|
848
854
|
/** Font name(s) to use _in place of_ the locale's font name(s) when
|
|
@@ -853,6 +859,8 @@ interface TextWithFontCustomization {
|
|
|
853
859
|
interface TextAndFont {
|
|
854
860
|
/** The translated string. */
|
|
855
861
|
text?: string;
|
|
862
|
+
/** Font size to use when displaying the text. */
|
|
863
|
+
fontSize?: number;
|
|
856
864
|
/** Font name to use when displaying the text. */
|
|
857
865
|
fontName?: string;
|
|
858
866
|
/** Font names to use when displaying the text. */
|
|
@@ -2200,6 +2208,7 @@ interface TranslationOptions {
|
|
|
2200
2208
|
}
|
|
2201
2209
|
interface TextLocalizationResult {
|
|
2202
2210
|
text: string;
|
|
2211
|
+
fontSize?: number;
|
|
2203
2212
|
fontName?: string;
|
|
2204
2213
|
fontNames?: string[];
|
|
2205
2214
|
isFallbackOrMissingTranslation: boolean;
|
|
@@ -4158,6 +4167,7 @@ declare class Label extends M2Node implements IDrawable, IText, LabelOptions {
|
|
|
4158
4167
|
private builder?;
|
|
4159
4168
|
private _fontPaint?;
|
|
4160
4169
|
private _backgroundPaint?;
|
|
4170
|
+
private localizedFontSize;
|
|
4161
4171
|
private localizedFontName;
|
|
4162
4172
|
private localizedFontNames;
|
|
4163
4173
|
/**
|
|
@@ -4440,6 +4450,15 @@ declare class RandomDraws {
|
|
|
4440
4450
|
}>;
|
|
4441
4451
|
}
|
|
4442
4452
|
|
|
4453
|
+
/**
|
|
4454
|
+
* ScoringSchema defines the data that are generated by the scoring code. They
|
|
4455
|
+
* are key-value pairs in which the key is the variable name, and the value is
|
|
4456
|
+
* JSON Schema that defines the type of the variable.
|
|
4457
|
+
*/
|
|
4458
|
+
interface ScoringSchema {
|
|
4459
|
+
[key: string]: JsonSchema;
|
|
4460
|
+
}
|
|
4461
|
+
|
|
4443
4462
|
declare enum ShapeType {
|
|
4444
4463
|
Undefined = "Undefined",
|
|
4445
4464
|
Rectangle = "Rectangle",
|
|
@@ -4828,6 +4847,7 @@ declare class TextLine extends M2Node implements IDrawable, IText, TextLineOptio
|
|
|
4828
4847
|
private tryMissingTranslationPaint;
|
|
4829
4848
|
private textForDraw;
|
|
4830
4849
|
private fontForDraw?;
|
|
4850
|
+
private localizedFontSize;
|
|
4831
4851
|
private localizedFontName;
|
|
4832
4852
|
private localizedFontNames;
|
|
4833
4853
|
/**
|
|
@@ -5192,4 +5212,4 @@ declare class WebGlInfo {
|
|
|
5192
5212
|
static dispose(): void;
|
|
5193
5213
|
}
|
|
5194
5214
|
|
|
5195
|
-
export { Action, type Activity, type ActivityCallbacks, type ActivityEvent, type ActivityEventListener, type ActivityKeyValueData, type ActivityLifecycleEvent, type ActivityResultsEvent, ActivityType, type BrowserImage, type BrowserImageDataReadyEvent, type CallbackOptions, CanvasKitHelpers, ColorfulMutablePath, Composite, type CompositeEvent, type CompositeOptions, Constants, ConstraintType, type Constraints, CustomAction, type CustomActionOptions, type DefaultParameter, Dimensions, type DomPointerDownEvent, type DrawableOptions, type EasingFunction, Easings, Equal, Equals, EventStore, EventStoreMode, FadeAlphaAction, type FadeAlphaActionOptions, type FontAsset, type FontData, FontManager, Game, type GameData, type GameEvent, type GameOptions, type GameParameters, type GlobalVariables, GroupAction, I18n, type I18nDataReadyEvent, type IDataStore, type IDrawable, type IText, ImageManager, Label, LabelHorizontalAlignmentMode, type LabelOptions, type Layout, LayoutConstraint, LegacyTimer, type LocaleSvg, type M2ColorfulPath, type M2DragEvent, type M2Event, type M2EventListener, M2EventType, type M2Image, M2ImageStatus, M2Node, type M2NodeAddChildEvent, type M2NodeConstructor, type M2NodeEvent, type M2NodeEventListener, M2NodeFactory, type M2NodeNewEvent, type M2NodeOptions, type M2NodePropertyChangeEvent, type M2NodeRemoveChildEvent, M2NodeType, type M2Path, type M2PointerEvent, type M2Sound, M2SoundStatus, M2c2KitHelpers, MoveAction, type MoveActionOptions, MutablePath, NoneTransition, PlayAction, type PlayActionOptions, type Plugin, type PluginEvent, type Point, RandomDraws, type RectOptions, RepeatAction, RepeatForeverAction, type RgbaColor, RotateAction, ScaleAction, type ScaleActionOptions, Scene, type SceneOptions, type ScenePresentEvent, SceneTransition, SequenceAction, Shape, type ShapeOptions, ShapeType, type Size, SlideTransition, type SlideTransitionOptions, type SoundAsset, SoundManager, SoundPlayer, type SoundPlayerOptions, SoundRecorder, type SoundRecorderOptions, type SoundRecorderResults, Sprite, type SpriteOptions, Story, type StoryOptions, type StringInterpolationMap, type TapEvent, type TextAndFont, TextLine, type TextLineOptions, type TextLocalizationResult, type TextOptions, type TextWithFontCustomization, Timer, Transition, TransitionDirection, TransitionType, type Translation, type TranslationConfiguration, type TranslationOptions, type TrialData, type TrialSchema, Uuid, WaitAction, type WaitActionOptions, WebColors, WebGlInfo, handleInterfaceOptions };
|
|
5215
|
+
export { Action, type Activity, type ActivityCallbacks, type ActivityEvent, type ActivityEventListener, type ActivityKeyValueData, type ActivityLifecycleEvent, type ActivityResultsEvent, ActivityType, type BrowserImage, type BrowserImageDataReadyEvent, type CallbackOptions, CanvasKitHelpers, ColorfulMutablePath, Composite, type CompositeEvent, type CompositeOptions, Constants, ConstraintType, type Constraints, CustomAction, type CustomActionOptions, type DefaultParameter, Dimensions, type DomPointerDownEvent, type DrawableOptions, type EasingFunction, Easings, Equal, Equals, EventStore, EventStoreMode, FadeAlphaAction, type FadeAlphaActionOptions, type FontAsset, type FontData, FontManager, Game, type GameData, type GameEvent, type GameOptions, type GameParameters, type GlobalVariables, GroupAction, I18n, type I18nDataReadyEvent, type IDataStore, type IDrawable, type IText, ImageManager, Label, LabelHorizontalAlignmentMode, type LabelOptions, type Layout, LayoutConstraint, LegacyTimer, type LocaleSvg, type M2ColorfulPath, type M2DragEvent, type M2Event, type M2EventListener, M2EventType, type M2Image, M2ImageStatus, M2Node, type M2NodeAddChildEvent, type M2NodeConstructor, type M2NodeEvent, type M2NodeEventListener, M2NodeFactory, type M2NodeNewEvent, type M2NodeOptions, type M2NodePropertyChangeEvent, type M2NodeRemoveChildEvent, M2NodeType, type M2Path, type M2PointerEvent, type M2Sound, M2SoundStatus, M2c2KitHelpers, MoveAction, type MoveActionOptions, MutablePath, NoneTransition, PlayAction, type PlayActionOptions, type Plugin, type PluginEvent, type Point, RandomDraws, type RectOptions, RepeatAction, RepeatForeverAction, type RgbaColor, RotateAction, ScaleAction, type ScaleActionOptions, Scene, type SceneOptions, type ScenePresentEvent, SceneTransition, type ScoringSchema, SequenceAction, Shape, type ShapeOptions, ShapeType, type Size, SlideTransition, type SlideTransitionOptions, type SoundAsset, SoundManager, SoundPlayer, type SoundPlayerOptions, SoundRecorder, type SoundRecorderOptions, type SoundRecorderResults, Sprite, type SpriteOptions, Story, type StoryOptions, type StringInterpolationMap, type TapEvent, type TextAndFont, TextLine, type TextLineOptions, type TextLocalizationResult, type TextOptions, type TextWithFontCustomization, Timer, Transition, TransitionDirection, TransitionType, type Translation, type TranslationConfiguration, type TranslationOptions, type TrialData, type TrialSchema, Uuid, WaitAction, type WaitActionOptions, WebColors, WebGlInfo, handleInterfaceOptions };
|