@gmetrixr/rjson
Version:
(R)ecursive Json
305 lines (304 loc) • 12.5 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rActionDisplayName = exports.rActionPropertyDefaults = exports.rActionProperties = exports.ThenActionProperty = exports.RuleAction = void 0;
var RuleAction;
(function (RuleAction) {
RuleAction["do_nothing"] = "do_nothing";
RuleAction["autostart"] = "autostart";
RuleAction["rendered"] = "rendered";
RuleAction["show"] = "show";
RuleAction["hide"] = "hide";
RuleAction["toggle_showhide"] = "toggle_showhide";
RuleAction["play_resume"] = "play_resume";
RuleAction["play_seek"] = "play_seek";
RuleAction["seek_to_timer"] = "seek_to_timer";
RuleAction["seek_to_end"] = "seek_to_end";
RuleAction["seek_to_input"] = "seek_to_input";
RuleAction["pause"] = "pause";
RuleAction["start"] = "start";
RuleAction["timer_seek"] = "timer_seek";
RuleAction["reset"] = "reset";
RuleAction["volume"] = "volume";
RuleAction["mute"] = "mute";
RuleAction["unmute"] = "unmute";
RuleAction["reset_all_vars"] = "reset_all_vars";
RuleAction["change_scene"] = "change_scene";
RuleAction["open_url"] = "open_url";
RuleAction["open_deployment"] = "open_deployment";
RuleAction["call_api"] = "call_api";
RuleAction["award_score"] = "award_score";
RuleAction["move_to"] = "move_to";
RuleAction["rotate_by"] = "rotate_by";
RuleAction["gyro_lock"] = "gyro_lock";
RuleAction["gyro_unlock"] = "gyro_unlock";
RuleAction["attach"] = "attach";
RuleAction["detach"] = "detach";
//drop_to = "drop_to", //additional property element_id (probably a positionElement)
RuleAction["effect_start"] = "effect_start";
RuleAction["effect_stop"] = "effect_stop";
RuleAction["gltf_preset_start"] = "gltf_preset_start";
RuleAction["gltf_preset_stop"] = "gltf_preset_stop";
RuleAction["gltf_preset_start_all"] = "gltf_preset_start_all";
RuleAction["gltf_preset_stop_all"] = "gltf_preset_stop_all";
RuleAction["point_to"] = "point_to";
RuleAction["listen"] = "listen";
RuleAction["scan"] = "scan";
RuleAction["toggle_state"] = "toggle_state";
RuleAction["take_screenshot"] = "take_screenshot";
RuleAction["show_product_card"] = "show_product_card";
//For variables:
/**
* The reason we use var_reset and not var for variables is because the text displayed in then action is different
* reset: should reset. var_reset: should reset to default value.
*/
RuleAction["var_reset"] = "var_reset";
RuleAction["set_to_input"] = "set_to_input";
//boolean:
RuleAction["set_true"] = "set_true";
RuleAction["set_false"] = "set_false";
//toggle_state (already defined)
//number:
RuleAction["set_to_number"] = "set_to_number";
RuleAction["set_to_formula"] = "set_to_formula";
RuleAction["add_input"] = "add_input";
RuleAction["add_number"] = "add_number";
//string:
RuleAction["set_to_string"] = "set_to_string";
RuleAction["find_replace"] = "find_replace";
RuleAction["append_input"] = "append_input";
RuleAction["viewer_state_updated"] = "viewer_state_updated";
RuleAction["toggle_play_pause"] = "toggle_play_pause";
RuleAction["reset_session"] = "reset_session";
RuleAction["end_experience"] = "end_experience";
RuleAction["copy_to_clipboard"] = "copy_to_clipboard";
RuleAction["load_project"] = "load_project";
RuleAction["show_product"] = "show_product";
RuleAction["set_scorm_score_min"] = "set_scorm_score_min";
RuleAction["set_scorm_score_max"] = "set_scorm_score_max";
RuleAction["set_scorm_score"] = "set_scorm_score";
RuleAction["set_scorm_passed"] = "set_scorm_passed";
RuleAction["set_scorm_failed"] = "set_scorm_failed";
RuleAction["set_scorm_completed"] = "set_scorm_completed";
RuleAction["show_item"] = "show_item";
RuleAction["hide_item"] = "hide_item";
RuleAction["replace_screen_reader_text"] = "replace_screen_reader_text";
// viewer element
// When image1 is clicked, then Viewer should teleport to zone1
RuleAction["teleport"] = "teleport";
// character element
RuleAction["wave"] = "wave";
RuleAction["clap"] = "clap";
RuleAction["talk"] = "talk";
RuleAction["speak"] = "speak";
})(RuleAction = exports.RuleAction || (exports.RuleAction = {}));
var ThenActionProperty;
(function (ThenActionProperty) {
ThenActionProperty["seek_to"] = "seek_to";
ThenActionProperty["element_id"] = "element_id";
ThenActionProperty["time"] = "time";
ThenActionProperty["volume"] = "volume";
ThenActionProperty["scene_no"] = "scene_no";
ThenActionProperty["uri"] = "uri";
ThenActionProperty["target"] = "target";
ThenActionProperty["number_value"] = "number_value";
ThenActionProperty["string_value"] = "string_value";
ThenActionProperty["score"] = "score";
ThenActionProperty["position"] = "position";
ThenActionProperty["angle"] = "angle";
ThenActionProperty["speed"] = "speed";
ThenActionProperty["effect_choice"] = "effect_choice";
ThenActionProperty["gltf_preset_choice"] = "gltf_preset_choice";
ThenActionProperty["loop"] = "loop";
ThenActionProperty["actionbar_element_id"] = "actionbar_element_id";
ThenActionProperty["sku"] = "sku";
ThenActionProperty["url"] = "url";
ThenActionProperty["product_sku"] = "product_sku";
ThenActionProperty["item_id"] = "item_id";
ThenActionProperty["old"] = "old";
ThenActionProperty["new"] = "new";
ThenActionProperty["var_id"] = "var_id";
ThenActionProperty["duration"] = "duration";
})(ThenActionProperty = exports.ThenActionProperty || (exports.ThenActionProperty = {}));
exports.rActionProperties = {
autostart: [],
rendered: [],
viewer_state_updated: [],
do_nothing: [],
show: [],
hide: [],
toggle_showhide: [],
play_resume: [],
play_seek: [ThenActionProperty.seek_to],
seek_to_timer: [ThenActionProperty.element_id],
seek_to_end: [],
seek_to_input: [],
pause: [],
start: [],
timer_seek: [ThenActionProperty.time],
reset: [],
// audio
volume: [ThenActionProperty.volume],
mute: [],
unmute: [],
// scene
change_scene: [ThenActionProperty.scene_no],
reset_all_vars: [],
open_url: [ThenActionProperty.uri, ThenActionProperty.target],
open_deployment: [ThenActionProperty.string_value],
call_api: [ThenActionProperty.uri],
award_score: [ThenActionProperty.score],
// deprecated
move_to: [ThenActionProperty.position, ThenActionProperty.speed],
// deprecated
rotate_by: [ThenActionProperty.angle, ThenActionProperty.speed],
gyro_lock: [],
gyro_unlock: [],
attach: [],
detach: [],
effect_start: [ThenActionProperty.effect_choice, ThenActionProperty.speed],
effect_stop: [ThenActionProperty.effect_choice],
gltf_preset_start: [ThenActionProperty.gltf_preset_choice, ThenActionProperty.loop],
gltf_preset_stop: [ThenActionProperty.gltf_preset_choice],
gltf_preset_start_all: [ThenActionProperty.loop],
gltf_preset_stop_all: [],
point_to: [ThenActionProperty.element_id],
listen: [],
scan: [],
toggle_state: [ThenActionProperty.actionbar_element_id],
take_screenshot: [],
show_product_card: [ThenActionProperty.sku],
var_reset: [],
set_to_input: [],
set_true: [],
set_false: [],
set_to_number: [ThenActionProperty.number_value],
set_to_formula: [ThenActionProperty.string_value],
add_input: [],
add_number: [ThenActionProperty.number_value],
set_to_string: [ThenActionProperty.string_value],
find_replace: [ThenActionProperty.old, ThenActionProperty.new, ThenActionProperty.var_id],
append_input: [],
toggle_play_pause: [],
reset_session: [],
end_experience: [],
copy_to_clipboard: [ThenActionProperty.string_value],
load_project: [ThenActionProperty.url],
set_scorm_score_min: [ThenActionProperty.score],
set_scorm_score_max: [ThenActionProperty.score],
set_scorm_score: [ThenActionProperty.score],
set_scorm_passed: [],
set_scorm_failed: [],
set_scorm_completed: [],
show_product: [ThenActionProperty.product_sku],
show_item: [ThenActionProperty.item_id],
hide_item: [ThenActionProperty.item_id],
replace_screen_reader_text: [ThenActionProperty.string_value],
teleport: [ThenActionProperty.element_id],
wave: [],
clap: [],
talk: [ThenActionProperty.duration],
speak: [ThenActionProperty.string_value]
};
exports.rActionPropertyDefaults = {
seek_to: 0,
element_id: 0,
time: 0,
volume: 0,
scene_no: 0,
uri: "",
target: "same_page",
number_value: 0,
string_value: "",
score: 0,
position: null,
angle: null,
speed: null,
effect_choice: null,
gltf_preset_choice: null,
loop: null,
actionbar_element_id: 0,
sku: null,
url: "",
product_sku: null,
item_id: null,
old: "",
new: "",
var_id: 0,
duration: 0,
};
exports.rActionDisplayName = {
[]: "",
[]: "",
[]: "",
[]: "",
[]: "appear",
[]: "disappear",
[]: "toggle visibility",
[]: "play/resume",
[]: "play from",
[]: "seek to timer",
[]: "seek to end",
[]: "capture and seek to",
[]: "pause",
[]: "start",
[]: "seek to",
[]: "reset",
[]: "set volume to",
[]: "mute",
[]: "unmute",
[]: "change to scene",
[]: "reset all variables",
[]: "open URL",
[]: "open deployment",
[]: "make API call",
[]: "award",
[]: "move to the position of",
[]: "rotate by",
[]: "lock camera",
[]: "unlock camera",
[]: "attach to camera",
[]: "detach from camera",
[]: "start effect",
[]: "stop effect",
[]: "start animation",
[]: "stop animation",
[]: "start all animations",
[]: "stop all animations",
[]: "point to",
[]: "start listening",
[]: "open scanner",
[]: "toggle state of",
[]: "take screenshot",
[]: "show sku",
[]: "reset to default value",
[]: "capture data",
[]: "set to true",
[]: "set to false",
[]: "set to number",
[]: "set to formula",
[]: "add captured value",
[]: "add number",
[]: "set to string",
[]: "find and replace",
[]: "append capture data",
[]: "toggle play/pause",
[]: "reset session",
[]: "end experience",
[]: "copy to clipboard",
[]: "load project",
[]: "set scorm min score",
[]: "set scorm max score",
[]: "set scorm score",
[]: "set scorm status as passed",
[]: "set scorm status as failed",
[]: "set scorm status as complete",
[]: "show product",
[]: "show button",
[]: "hide button",
[]: "replace screen reader text",
[]: "teleport to",
[]: "wave",
[]: "clap",
[]: "talk for x seconds",
[]: "speak",
};