@gmetrixr/rjson
Version:
(R)ecursive Json
202 lines (201 loc) • 7.83 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rEventDisplayName = exports.rEventPropertyDefaults = exports.rEventProperties = exports.WhenEventProperty = exports.RuleEvent = void 0;
var RuleEvent;
(function (RuleEvent) {
RuleEvent["on_preload"] = "on_preload";
RuleEvent["on_load"] = "on_load";
/** Used to communicate from the element / scene / experience if it is ready to start or not */
RuleEvent["on_ready"] = "on_ready";
RuleEvent["on_click"] = "on_click";
RuleEvent["on_been_clicked"] = "on_been_clicked";
RuleEvent["on_press"] = "on_press";
RuleEvent["on_release"] = "on_release";
RuleEvent["on_select"] = "on_select";
RuleEvent["on_end"] = "on_end";
RuleEvent["on_timermatch"] = "on_timermatch";
RuleEvent["on_swipeup"] = "on_swipeup";
RuleEvent["on_swipedown"] = "on_swipedown";
RuleEvent["on_swipeleft"] = "on_swipeleft";
RuleEvent["on_swiperight"] = "on_swiperight";
/**
* The reason on_phrase_match is used instead of on_match, is because the text displaed in whenEvent is different in both cases
* on_match: "Matches data"
* on_phrase_match: "matches phrase"
*/
RuleEvent["on_phrase_match"] = "on_phrase_match";
RuleEvent["on_phrase_nomatch"] = "on_phrase_nomatch";
RuleEvent["on_click_item"] = "on_click_item";
//variables
RuleEvent["on_var_change"] = "on_var_change";
RuleEvent["on_set_eq"] = "on_set_eq";
RuleEvent["on_set_not_eq"] = "on_set_not_eq";
//variable_boolean
RuleEvent["on_set_true"] = "on_set_true";
RuleEvent["on_set_false"] = "on_set_false";
//variable_number
RuleEvent["on_set_gt"] = "on_set_gt";
RuleEvent["on_set_gte"] = "on_set_gte";
RuleEvent["on_set_lt"] = "on_set_lt";
RuleEvent["on_set_lte"] = "on_set_lte";
//variable string
RuleEvent["on_set_between"] = "on_set_between";
// capture text, speech match
RuleEvent["on_capture_input"] = "on_capture_input";
RuleEvent["on_hover"] = "on_hover";
RuleEvent["on_match"] = "on_match";
RuleEvent["on_nomatch"] = "on_nomatch";
//is in list
RuleEvent["on_is_in_list"] = "on_is_in_list";
RuleEvent["on_is_not_in_list"] = "on_is_not_in_list";
// for ProductCard
RuleEvent["on_product_card_cta1_click"] = "on_product_card_cta1_click";
// for EmbedScorm
RuleEvent["on_scorm_set_score"] = "on_scorm_set_score";
RuleEvent["on_scorm_initialize"] = "on_scorm_initialize";
RuleEvent["on_scorm_finish"] = "on_scorm_finish";
// for MediaUpload
RuleEvent["on_successful_upload"] = "on_successful_upload";
//embed-html and popup
RuleEvent["on_close"] = "on_close";
// video duration match
RuleEvent["on_duration_match"] = "on_duration_match";
// viewer element
// When Viewer enters zone <zone1>
// When Viewer leaves zone <zone1>
RuleEvent["on_enter"] = "on_enter";
RuleEvent["on_leave"] = "on_leave";
})(RuleEvent = exports.RuleEvent || (exports.RuleEvent = {}));
var WhenEventProperty;
(function (WhenEventProperty) {
WhenEventProperty["index"] = "index";
WhenEventProperty["timer_value"] = "timer_value";
WhenEventProperty["phrase"] = "phrase";
WhenEventProperty["id"] = "id";
WhenEventProperty["value"] = "value";
WhenEventProperty["number_value"] = "number_value";
WhenEventProperty["number_value_lower"] = "number_value_lower";
WhenEventProperty["number_value_greater"] = "number_value_greater";
WhenEventProperty["duration"] = "duration";
WhenEventProperty["match_strings"] = "match_strings";
WhenEventProperty["list_value"] = "list_value";
WhenEventProperty["score"] = "score";
WhenEventProperty["duration_value"] = "duration_value";
})(WhenEventProperty = exports.WhenEventProperty || (exports.WhenEventProperty = {}));
exports.rEventProperties = {
on_ready: [],
on_preload: [],
on_load: [],
on_click: [],
on_been_clicked: [],
on_press: [],
on_release: [],
on_select: [WhenEventProperty.index],
on_swipeup: [],
on_swipedown: [],
on_swipeleft: [],
on_swiperight: [],
on_end: [],
on_timermatch: [WhenEventProperty.timer_value],
on_phrase_match: [WhenEventProperty.phrase],
on_phrase_nomatch: [],
on_click_item: [WhenEventProperty.id],
on_var_change: [],
on_set_eq: [WhenEventProperty.value],
on_set_not_eq: [WhenEventProperty.value],
on_set_true: [],
on_set_false: [],
on_set_gt: [WhenEventProperty.number_value],
on_set_gte: [WhenEventProperty.number_value],
on_set_lt: [WhenEventProperty.number_value],
on_set_lte: [WhenEventProperty.number_value],
on_set_between: [WhenEventProperty.number_value_lower, WhenEventProperty.number_value_greater],
on_capture_input: [],
on_hover: [WhenEventProperty.duration],
on_match: [WhenEventProperty.match_strings],
on_nomatch: [],
// for MediaUpload
on_successful_upload: [],
// ProductCard
on_product_card_cta1_click: [],
//is in list
on_is_in_list: [WhenEventProperty.list_value],
on_is_not_in_list: [WhenEventProperty.list_value],
// for EmbedScorm
on_scorm_set_score: [WhenEventProperty.score],
on_scorm_initialize: [],
on_scorm_finish: [],
//for popup and embedhtml
on_close: [],
// video duration match
on_duration_match: [WhenEventProperty.duration_value],
// viewer
on_enter: [],
on_leave: []
};
exports.rEventPropertyDefaults = {
index: 0,
timer_value: 0,
phrase: "",
id: 0,
value: 0,
number_value: 0,
number_value_lower: 0,
number_value_greater: 0,
duration: 0,
match_strings: null,
list_value: [],
score: 0,
duration_value: 0
};
exports.rEventDisplayName = {
[]: "preloads",
[]: "loads",
[]: "",
[]: "is clicked",
[]: "has been clicked",
[]: "is pressed (controller only)",
[]: "is released (controller only)",
[]: "item is selected",
[]: "is swiped up",
[]: "is swiped down",
[]: "is swiped left",
[]: "is swiped right",
[]: "ends",
[]: "matches value",
[]: "matches phrase",
[]: "matches no phrase",
[]: "gets clicked",
//variables
[]: "changes",
[]: "is =",
[]: "is not =",
[]: "is in list",
[]: "is not in list",
//variable_boolean
[]: "is TRUE",
[]: "is FALSE",
//variable_number
[]: "is >",
[]: "is > OR =",
[]: "is <",
[]: "is < OR =",
[]: "is between",
[]: "collects data",
[]: "is hovered",
[]: "matches",
[]: "matches no data",
// for MediaUpload
[]: "collects media",
[]: "button is clicked",
//for EmbedScorm
[]: "sets score",
[]: "is initialized",
[]: "is completed",
//for popup and embedhtml
[]: "is closed",
[]: "matches duration",
// viewer
[]: "enters",
[]: "leaves"
};