UNPKG

@gmetrixr/rjson

Version:
305 lines (304 loc) 12.5 kB
"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 = { [RuleAction.do_nothing]: "", [RuleAction.viewer_state_updated]: "", [RuleAction.autostart]: "", [RuleAction.rendered]: "", [RuleAction.show]: "appear", [RuleAction.hide]: "disappear", [RuleAction.toggle_showhide]: "toggle visibility", [RuleAction.play_resume]: "play/resume", [RuleAction.play_seek]: "play from", [RuleAction.seek_to_timer]: "seek to timer", [RuleAction.seek_to_end]: "seek to end", [RuleAction.seek_to_input]: "capture and seek to", [RuleAction.pause]: "pause", [RuleAction.start]: "start", [RuleAction.timer_seek]: "seek to", [RuleAction.reset]: "reset", [RuleAction.volume]: "set volume to", [RuleAction.mute]: "mute", [RuleAction.unmute]: "unmute", [RuleAction.change_scene]: "change to scene", [RuleAction.reset_all_vars]: "reset all variables", [RuleAction.open_url]: "open URL", [RuleAction.open_deployment]: "open deployment", [RuleAction.call_api]: "make API call", [RuleAction.award_score]: "award", [RuleAction.move_to]: "move to the position of", [RuleAction.rotate_by]: "rotate by", [RuleAction.gyro_lock]: "lock camera", [RuleAction.gyro_unlock]: "unlock camera", [RuleAction.attach]: "attach to camera", [RuleAction.detach]: "detach from camera", [RuleAction.effect_start]: "start effect", [RuleAction.effect_stop]: "stop effect", [RuleAction.gltf_preset_start]: "start animation", [RuleAction.gltf_preset_stop]: "stop animation", [RuleAction.gltf_preset_start_all]: "start all animations", [RuleAction.gltf_preset_stop_all]: "stop all animations", [RuleAction.point_to]: "point to", [RuleAction.listen]: "start listening", [RuleAction.scan]: "open scanner", [RuleAction.toggle_state]: "toggle state of", [RuleAction.take_screenshot]: "take screenshot", [RuleAction.show_product_card]: "show sku", [RuleAction.var_reset]: "reset to default value", [RuleAction.set_to_input]: "capture data", [RuleAction.set_true]: "set to true", [RuleAction.set_false]: "set to false", [RuleAction.set_to_number]: "set to number", [RuleAction.set_to_formula]: "set to formula", [RuleAction.add_input]: "add captured value", [RuleAction.add_number]: "add number", [RuleAction.set_to_string]: "set to string", [RuleAction.find_replace]: "find and replace", [RuleAction.append_input]: "append capture data", [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.set_scorm_score_min]: "set scorm min score", [RuleAction.set_scorm_score_max]: "set scorm max score", [RuleAction.set_scorm_score]: "set scorm score", [RuleAction.set_scorm_passed]: "set scorm status as passed", [RuleAction.set_scorm_failed]: "set scorm status as failed", [RuleAction.set_scorm_completed]: "set scorm status as complete", [RuleAction.show_product]: "show product", [RuleAction.show_item]: "show button", [RuleAction.hide_item]: "hide button", [RuleAction.replace_screen_reader_text]: "replace screen reader text", [RuleAction.teleport]: "teleport to", [RuleAction.wave]: "wave", [RuleAction.clap]: "clap", [RuleAction.talk]: "talk for x seconds", [RuleAction.speak]: "speak", };