diff --git a/CustomButtons/test/menuEntry.json b/CustomButtons/test/menuEntry.json deleted file mode 100644 index b54a09dd..00000000 --- a/CustomButtons/test/menuEntry.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label": "VERY Fun Stuff", - "isSubmenu": true, - "icon": "core://resources/actionIcons/fun.png" -} diff --git a/CustomButtons/test/testingSkill/menuEntry.json b/CustomButtons/test/testingSkill/menuEntry.json deleted file mode 100644 index 0e54c713..00000000 --- a/CustomButtons/test/testingSkill/menuEntry.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "label": "AAAAA", - "icon": "core://resources/actionIcons/clock.png", - "colors": "blue", - "skillId": "@be/clock" -} diff --git a/README.md b/README.md index f6d4011b..61e2712c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # JiboOs + - - - + + # Release Version 3.3.0 InDev + + Chagelog..... + + you can make custom menu buttons! + diff --git a/V3.1/BuildUpdatePackage b/V3.1/BuildUpdatePackage deleted file mode 100755 index e69de29b..00000000 diff --git a/V3.1/build/etc/init.d/S02jibo-skills-logd b/V3.1/build/etc/init.d/S02jibo-skills-logd new file mode 100644 index 00000000..5ae8b069 --- /dev/null +++ b/V3.1/build/etc/init.d/S02jibo-skills-logd @@ -0,0 +1,99 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: jibo-skills-logd +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: UDP log daemon for Jibo Skills +### END INIT INFO + +# Install path on robot: +# /etc/init.d/jibo-skills-logd (this file) +# and ensure executable: chmod +x /etc/init.d/jibo-skills-logd +# Enable (varies by distro): +# update-rc.d jibo-skills-logd defaults +# or (BusyBox init): create symlink in /etc/rc.d/rcS.d/ or /etc/rc?.d/ + +PYTHON_BIN=${PYTHON_BIN:-/usr/bin/python} +DAEMON=${DAEMON:-/opt/jibo/Jibo/Skills/tools/robot/logd/jibo_logd.py} +PIDFILE=${PIDFILE:-/tmp/jibo-skills-logd.pid} +HOST=${JIBO_LOGD_HOST:-127.0.0.1} +PORT=${JIBO_LOGD_PORT:-15140} +LOGFILE=${JIBO_LOGD_FILE:-/tmp/jibo-skills.log} + +start() { + echo "Starting jibo-skills-logd" + if [ -f "$PIDFILE" ]; then + PID=$(cat "$PIDFILE" 2>/dev/null) + if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then + echo "Already running (pid $PID)" + return 0 + fi + fi + + # best effort: ensure logfile dir exists + mkdir -p "$(dirname "$LOGFILE")" 2>/dev/null + + "$PYTHON_BIN" "$DAEMON" --host "$HOST" --port "$PORT" --logfile "$LOGFILE" --daemonize --pidfile "$PIDFILE" + sleep 1 + if [ -f "$PIDFILE" ]; then + echo "Started (pid $(cat "$PIDFILE" 2>/dev/null))" + return 0 + fi + echo "Failed to start" + return 1 +} + +stop() { + echo "Stopping jibo-skills-logd" + if [ ! -f "$PIDFILE" ]; then + echo "Not running (no pidfile)" + return 0 + fi + PID=$(cat "$PIDFILE" 2>/dev/null) + if [ -z "$PID" ]; then + rm -f "$PIDFILE" + return 0 + fi + kill "$PID" 2>/dev/null + sleep 1 + kill -9 "$PID" 2>/dev/null + rm -f "$PIDFILE" + echo "Stopped" + return 0 +} + +status() { + if [ -f "$PIDFILE" ]; then + PID=$(cat "$PIDFILE" 2>/dev/null) + if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then + echo "Running (pid $PID)" + return 0 + fi + fi + echo "Not running" + return 3 +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + status) + status + ;; + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac + +exit $? diff --git a/V3.1/build/etc/init.d/S03jibo-skills-logpanel b/V3.1/build/etc/init.d/S03jibo-skills-logpanel new file mode 100644 index 00000000..34e87f3e --- /dev/null +++ b/V3.1/build/etc/init.d/S03jibo-skills-logpanel @@ -0,0 +1,90 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: jibo-skills-logpanel +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: HTTP panel for live Jibo Skills logs +### END INIT INFO + +PYTHON_BIN=${PYTHON_BIN:-/usr/bin/python} +DAEMON=${DAEMON:-/opt/jibo/Jibo/Skills/tools/robot/logpanel/jibo_logpanel.py} +PIDFILE=${PIDFILE:-/tmp/jibo-skills-logpanel.pid} +BIND=${JIBO_LOGPANEL_BIND:-0.0.0.0} +PORT=${JIBO_LOGPANEL_PORT:-15150} +LOGFILE=${JIBO_LOGD_FILE:-/tmp/jibo-skills.log} + +start() { + echo "Starting jibo-skills-logpanel" + if [ -f "$PIDFILE" ]; then + PID=$(cat "$PIDFILE" 2>/dev/null) + if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then + echo "Already running (pid $PID)" + return 0 + fi + fi + + "$PYTHON_BIN" "$DAEMON" --bind "$BIND" --port "$PORT" --logfile "$LOGFILE" >/tmp/jibo-skills-logpanel.log 2>&1 & + echo $! > "$PIDFILE" + sleep 1 + if [ -f "$PIDFILE" ]; then + echo "Started (pid $(cat "$PIDFILE" 2>/dev/null))" + return 0 + fi + echo "Failed to start" + return 1 +} + +stop() { + echo "Stopping jibo-skills-logpanel" + if [ ! -f "$PIDFILE" ]; then + echo "Not running (no pidfile)" + return 0 + fi + PID=$(cat "$PIDFILE" 2>/dev/null) + if [ -z "$PID" ]; then + rm -f "$PIDFILE" + return 0 + fi + kill "$PID" 2>/dev/null + sleep 1 + kill -9 "$PID" 2>/dev/null + rm -f "$PIDFILE" + echo "Stopped" + return 0 +} + +status() { + if [ -f "$PIDFILE" ]; then + PID=$(cat "$PIDFILE" 2>/dev/null) + if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then + echo "Running (pid $PID)" + return 0 + fi + fi + echo "Not running" + return 3 +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + status) + status + ;; + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac + +exit $? diff --git a/V3.1/build/etc/init.d/S21firewall b/V3.1/build/etc/init.d/S21firewall new file mode 100644 index 00000000..eeb503e7 --- /dev/null +++ b/V3.1/build/etc/init.d/S21firewall @@ -0,0 +1,127 @@ +#!/bin/sh +# +# Jibo Firewall init script +# + +set -e + +IPTABLES_CMDS="/usr/sbin/iptables /usr/sbin/ip6tables" + +flush_rules() { + for iptables in $IPTABLES_CMDS; do + $iptables -t filter -F + $iptables -t filter -P INPUT ACCEPT + $iptables -t filter -P FORWARD ACCEPT + $iptables -t filter -P OUTPUT ACCEPT + # add the DYNAMIC_ACCESS chain unconditionally + $iptables -t filter -X + $iptables -t filter -N DYNAMIC_ACCESS + done +} + +normal_rules() { + for iptables in $IPTABLES_CMDS; do + $iptables -t filter -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT + $iptables -t filter -A INPUT -p icmp -j ACCEPT + $iptables -t filter -A INPUT -i lo -j ACCEPT + + # --- Custom Allowed Ports --- + # Allow SSH + $iptables -t filter -A INPUT -p tcp --dport 22 -j ACCEPT + # Allow Jibo Skills Service panel at 8779 + $iptables -t filter -A INPUT -p tcp --dport 8779 -j ACCEPT + # Allow Custom Port 15150 for loggging + $iptables -t filter -A INPUT -p tcp --dport 15150 -j ACCEPT + # ---------------------------- + + # allow dynamic access rules from system-manager + $iptables -t filter -A INPUT -j DYNAMIC_ACCESS + + # Reject everything else + $iptables -t filter -A INPUT -j REJECT + $iptables -t filter -A FORWARD -j REJECT + done +} +developer_rules() { + for iptables in $IPTABLES_CMDS; do + # jibo-dev-shell + $iptables -t filter -A INPUT -p tcp --syn --dport 8686 -j ACCEPT + # jibo-skills-service + $iptables -t filter -A INPUT -p tcp --syn --dport 8779 -j ACCEPT + # jibo-sync + $iptables -t filter -A INPUT -p tcp --syn --dport 8989 -j ACCEPT + # jibo-debug-proxy + $iptables -t filter -A INPUT -p tcp --syn --dport 9191 -j ACCEPT + # avahi + $iptables -t filter -A INPUT -p udp --dport 5353 -j ACCEPT + done + normal_rules +} + +certification_rules() { + for iptables in $IPTABLES_CMDS; do + # jibo-certification-service + $iptables -t filter -A INPUT -p tcp --syn --dport 9292 -j ACCEPT + done + normal_rules +} + +service_rules() { + for iptables in $IPTABLES_CMDS; do + # jibo-certification-service + $iptables -t filter -A INPUT -p tcp --syn --dport 9292 -j ACCEPT + # jibo-service-center-service + $iptables -t filter -A INPUT -p tcp --syn --dport 9797 -j ACCEPT + # avahi + $iptables -t filter -A INPUT -p udp --dport 5353 -j ACCEPT + done + normal_rules +} + +start() { + echo -n "Configuring firewall: " + flush_rules + my_mode=$(/usr/bin/jibo-getmode) + if [ $? -ne 0 ]; then + echo "Unspecified mode. SKIP" + elif [ "$my_mode" == "identified" ]; then + echo "IDENTIFIED" + elif [ "$my_mode" == "int-developer" ]; then + echo "INT-DEVELOPER" + elif [ "$my_mode" == "developer" ]; then + developer_rules + test $? -eq 0 && echo "DEVELOPER" || echo "ERROR" + elif [ "$my_mode" == "certification" ]; then + certification_rules + test $? -eq 0 && echo "CERTIFICATION" || echo "ERROR" + elif [ "$my_mode" == "service" ]; then + service_rules + test $? -eq 0 && echo "SERVICE" || echo "ERROR" + else + normal_rules + test $? -eq 0 && echo "OK" || echo "ERROR" + fi +} + +stop() { + echo -n "Unconfiguring firewall: " + flush_rules + test $? -eq 0 && echo "OK" || echo "ERROR" +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|restart}" >&2 + exit 1 + ;; +esac diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/be/robot-logger.js b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/be/robot-logger.js new file mode 100644 index 00000000..f6bf7e39 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/be/robot-logger.js @@ -0,0 +1,60 @@ +"use strict"; + +// Minimal UDP logger client for old robot environments. +// Safe to require from any module; if logd is not running, it will just no-op. + +const dgram = require("dgram"); + +const DEFAULT_HOST = process.env.JIBO_LOGD_HOST || "127.0.0.1"; +const DEFAULT_PORT = parseInt(process.env.JIBO_LOGD_PORT || "15140", 10); + +let _socket = null; + +function getSocket() { + if (_socket) return _socket; + try { + _socket = dgram.createSocket("udp4"); + _socket.unref(); + return _socket; + } catch (e) { + return null; + } +} + +function send(obj) { + const sock = getSocket(); + if (!sock) return; + + let payload; + try { + payload = Buffer.from(JSON.stringify(obj)); + } catch (e) { + return; + } + + try { + sock.send(payload, 0, payload.length, DEFAULT_PORT, DEFAULT_HOST, function () { }); + } catch (e) { + // ignore + } +} + +function mk(tag, level, msg, data) { + const o = { tag: tag || "skill", level: level || "info", msg: String(msg || "") }; + if (typeof data !== "undefined") o.data = data; + return o; +} + +exports.info = function (tag, msg, data) { send(mk(tag, "info", msg, data)); }; +exports.warn = function (tag, msg, data) { send(mk(tag, "warn", msg, data)); }; +exports.error = function (tag, msg, data) { send(mk(tag, "error", msg, data)); }; +exports.debug = function (tag, msg, data) { send(mk(tag, "debug", msg, data)); }; + +exports.raw = function (line) { + const sock = getSocket(); + if (!sock) return; + const payload = Buffer.from(String(line || "")); + try { + sock.send(payload, 0, payload.length, DEFAULT_PORT, DEFAULT_HOST, function () { }); + } catch (e) { } +}; diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/PROVIDERS.md b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/PROVIDERS.md new file mode 100644 index 00000000..c27fefed --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/PROVIDERS.md @@ -0,0 +1,65 @@ +# Menu providers (drop-in menu customization) + +Providers let you add/override menu entries without editing the core menu patch. + +Default entries directory (on robot): +- `/opt/jibo/Jibo/Skills/@be/menu-entries.d/` + +Legacy fallback (yea ik its the same stop talking): +- `/opt/jibo/Jibo/Skills/@be/menu-providers.d/` + +## Provider file types + +### JSON provider (`*.json`) +Supported shapes: + +- An array of entries: `[ { ... }, { ... } ]` +- Or `{ "entries": [ ... ] }` + +Entry schema (same as `menuEntry.json` scan output): + +- `id` (string, required) +- `type` (`skill` or `submenu`) +- `title` +- `icon` +- `color` +- `description` +- `order` (number) +- `skillId` (for type `skill`) +- `submenuTitle` (for type `submenu`) +- `children` (array of skill entries, for type `submenu`) +- `childrenDir` (for type `submenu`, optional): + - Absolute path (starts with `/`) or relative to `skillsRoot` + - If provided and `children` is missing/empty, the patch will scan this directory for child skills (subfolders containing `menuEntry.json`). + +Example submenu that lists a directory: + +```json +[ + { + "id": "fun_stuff", + "type": "submenu", + "title": "Fun Stuff", + "icon": "resources/icons/fun-stuff.png", + "order": 20, + "childrenDir": "FunStuff" + } +] +``` + +### JS provider (`*.js`) +Exports one of: + +- `module.exports = function(ctx) { return [ ...entries... ]; }` +- `exports.getEntries = function(ctx) { return [ ...entries... ]; }` +- `exports.entries = [ ...entries... ]` + +`ctx` includes: +- `skillsRoot` +- `providersDir` +- `log` (function) + +## Conflict rules + +- If a provider entry has the same `id` as a scanned entry, the provider entry wins. +- Sorting: by `order` then by title. diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/README.md b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/README.md index b52ff79e..bc473348 100644 --- a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/README.md +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/README.md @@ -12,7 +12,7 @@ When Jibo boots up, the `main-menu-patch.js` module: ## Quick Start -### Adding a Simple Skill Button to the Menu +### Adding a Simple Skill Button to the Menu (you really should follow PROVIDERS.md at this point) 1. Create a folder in the `Skills` directory (e.g., `MySkill/`) 2. Add a `menuEntry.json` file inside: @@ -53,7 +53,7 @@ When Jibo boots up, the `main-menu-patch.js` module: 3. Inside that folder, create subfolders for each skill, each with their own `menuEntry.json` 4. A button will appear in the main menu that opens a submenu with those skills! -## Directory Structure Example +## Directory Structure Example (OLD) ``` /opt/jibo/Jibo/Skills/ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/main-menu-patch.js b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/main-menu-patch.js index 4fc6a626..4513accb 100644 --- a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/main-menu-patch.js +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/main-menu-patch.js @@ -10,11 +10,38 @@ const fs = require('fs'); const path = require('path'); -// Skills root directory -const SKILLS_ROOT = '/opt/jibo/Jibo/Skills'; +const menuEntries = require('./menu-entries'); +const skillsRootUtil = require('./skills-root'); + +function strStartsWith(s, prefix) { + return (typeof s === 'string') && (s.indexOf(prefix) === 0); +} + +function strEndsWith(s, suffix) { + if (typeof s !== 'string' || typeof suffix !== 'string') return false; + if (suffix.length > s.length) return false; + return s.indexOf(suffix, s.length - suffix.length) !== -1; +} + +function strIncludes(s, needle) { + return (typeof s === 'string') && (s.indexOf(needle) !== -1); +} + +// Optional UDP logger (Python logd). Safe fallback if unavailable. +let robotLogger = null; +try { + robotLogger = require('../be/robot-logger'); +} catch (e) { + robotLogger = null; +} + +// Skills root directory (configurable) +let SKILLS_ROOT = skillsRootUtil.resolveSkillsRoot(); // Cache for scanned skills let _cachedMenuEntries = null; +let _cachedSkillsRoot = null; +let _cachedProvidersDir = null; let _submenuConfigs = {}; let _dynamicSkillIds = new Set(); // Track dynamic skill IDs for routing let _beInstance = null; @@ -40,6 +67,11 @@ const LOG_FILE = '/tmp/menu-patch.log'; function log(msg, ...args) { const line = '[MENU-PATCH] ' + msg + ' ' + args.map(a => typeof a === 'object' ? JSON.stringify(a) : String(a)).join(' '); console.log(line); + try { + if (robotLogger && typeof robotLogger.raw === 'function') { + robotLogger.raw(line); + } + } catch (e) { } try { fs.appendFileSync(LOG_FILE, new Date().toISOString() + ' ' + line + '\n'); } catch (e) {} @@ -48,6 +80,11 @@ function log(msg, ...args) { function warn(msg, ...args) { const line = '[MENU-PATCH WARN] ' + msg + ' ' + args.map(a => typeof a === 'object' ? JSON.stringify(a) : String(a)).join(' '); console.warn(line); + try { + if (robotLogger && typeof robotLogger.raw === 'function') { + robotLogger.raw(line); + } + } catch (e) { } try { fs.appendFileSync(LOG_FILE, new Date().toISOString() + ' ' + line + '\n'); } catch (e) {} @@ -172,59 +209,37 @@ function scanSubmenuChildren(submenuDir) { * Scan the Skills root directory for all menu entries */ function scanAllMenuEntries() { - if (_cachedMenuEntries) { + if (_cachedMenuEntries && _cachedSkillsRoot === SKILLS_ROOT) { log('Returning cached entries:', _cachedMenuEntries.length); return _cachedMenuEntries; } - + log('Scanning Skills directory:', SKILLS_ROOT); - _dynamicSkillIds.clear(); - const entries = []; - let children; - - // Check if directory exists - if (!fs.existsSync(SKILLS_ROOT)) { - warn('Skills directory does not exist:', SKILLS_ROOT); - return entries; - } - + + const res = menuEntries.getMenuEntries({ + skillsRoot: SKILLS_ROOT, + log: function () { + try { log.apply(null, arguments); } catch (e) { } + } + }); + + _cachedMenuEntries = res.entries || []; + _cachedSkillsRoot = res.skillsRoot; + _cachedProvidersDir = res.providersDir; + + // update dynamic id set try { - children = fs.readdirSync(SKILLS_ROOT); - log('Found', children.length, 'items in Skills directory:', children.join(', ')); - } catch (e) { - warn('Failed to read skills directory:', SKILLS_ROOT, e.message); - return entries; + if (res.dynamicSkillIds && typeof res.dynamicSkillIds.forEach === 'function') { + res.dynamicSkillIds.forEach(function (id) { _dynamicSkillIds.add(id); }); + } + } catch (e) { } + + log('Total entries found:', _cachedMenuEntries.length); + if (_cachedProvidersDir) { + log('Providers dir:', _cachedProvidersDir); } - - children.forEach(name => { - if (name.startsWith('.') || name === '@be' || name === 'node_modules') { - log('Skipping:', name); - return; - } - - const skillDir = path.join(SKILLS_ROOT, name); - if (!isDirectory(skillDir)) { - log('Not a directory:', name); - return; - } - - const entry = scanSkillEntry(skillDir, name); - if (entry) { - entries.push(entry); - log('Added entry:', entry.title, '(type:', entry.type + ')'); - } - }); - - // Sort by order, then alphabetically - entries.sort((a, b) => { - if (a.order !== b.order) return a.order - b.order; - return a.title.localeCompare(b.title); - }); - - log('Total entries found:', entries.length); - _cachedMenuEntries = entries; - return entries; + return _cachedMenuEntries; } /** @@ -427,7 +442,7 @@ function patchMainMenuSkill(be) { } // Handle dynamic submenus - if (skill && skill.startsWith('dynamic-submenu-')) { + if (skill && strStartsWith(skill, 'dynamic-submenu-')) { log('Showing submenu:', skill); const submenuConfig = _submenuConfigs[skill]; if (submenuConfig && _jibo && _jibo.face && _jibo.face.views) { @@ -443,11 +458,15 @@ function patchMainMenuSkill(be) { if (result && result.on) { result.on('select', (selection) => { log('Submenu item selected:', selection); - if (selection && selection.action && selection.action.data) { - const destination = selection.action.data.utterance?.entities?.destination; - if (destination) { - this.redirectToSkill(destination); + try { + if (selection && selection.action && selection.action.data && selection.action.data.utterance && selection.action.data.utterance.entities) { + const destination = selection.action.data.utterance.entities.destination; + if (destination) { + this.redirectToSkill(destination); + } } + } catch (e) { + warn('Submenu selection handler error:', e && e.message ? e.message : e); } }); } @@ -459,7 +478,7 @@ function patchMainMenuSkill(be) { } // Handle dynamic skills (prefixed with 'dynamic:') - if (skill && skill.startsWith('dynamic:')) { + if (skill && strStartsWith(skill, 'dynamic:')) { const actualSkillId = skill.substring(8); // Remove 'dynamic:' prefix log('Launching dynamic skill:', actualSkillId); @@ -530,6 +549,14 @@ function applyPatch(be) { function patchLoader(jibo, skillsRoot) { log('patchLoader called'); _jibo = jibo; + + // Allow caller to override skills root. + if (skillsRoot && typeof skillsRoot === 'string') { + SKILLS_ROOT = skillsRoot; + } else { + SKILLS_ROOT = skillsRootUtil.resolveSkillsRoot(); + } + clearCache(); if (!jibo) { warn('jibo is null/undefined'); @@ -553,7 +580,7 @@ function patchLoader(jibo, skillsRoot) { log('>>> jibo.loader.load called with:', resourcePath); // Check if this is loading a dynamic submenu - if (resourcePath && resourcePath.startsWith('dynamic-submenu-')) { + if (resourcePath && strStartsWith(resourcePath, 'dynamic-submenu-')) { const submenuConfig = _submenuConfigs[resourcePath]; if (submenuConfig) { log('Loading dynamic submenu:', resourcePath); @@ -566,10 +593,10 @@ function patchLoader(jibo, skillsRoot) { // Check if this is the main menu - match various possible paths const isMainMenu = resourcePath && ( - resourcePath.includes('main-menu-verbal.json') || - resourcePath.includes('main-menu.json') || + strIncludes(resourcePath, 'main-menu-verbal.json') || + strIncludes(resourcePath, 'main-menu.json') || resourcePath === 'resources/views/main-menu-verbal.json' || - resourcePath.endsWith('main-menu-verbal.json') + strEndsWith(resourcePath, 'main-menu-verbal.json') ); if (isMainMenu) { @@ -584,12 +611,22 @@ function patchLoader(jibo, skillsRoot) { } log('Original menu config loaded successfully'); - log('Original button count:', config?.viewConfig?.list?.length || 0); + try { + const origCount = (config && config.viewConfig && config.viewConfig.list && config.viewConfig.list.length) ? config.viewConfig.list.length : 0; + log('Original button count:', origCount); + } catch (e) { + log('Original button count: (unknown)'); + } // Inject dynamic skills const patchedConfig = injectDynamicSkills(config); - log('Patched button count:', patchedConfig?.viewConfig?.list?.length || 0); + try { + const patchedCount = (patchedConfig && patchedConfig.viewConfig && patchedConfig.viewConfig.list && patchedConfig.viewConfig.list.length) ? patchedConfig.viewConfig.list.length : 0; + log('Patched button count:', patchedCount); + } catch (e) { + log('Patched button count: (unknown)'); + } if (callback) callback(null, patchedConfig); }); @@ -608,6 +645,8 @@ function patchLoader(jibo, skillsRoot) { */ function clearCache() { _cachedMenuEntries = null; + _cachedSkillsRoot = null; + _cachedProvidersDir = null; _submenuConfigs = {}; _dynamicSkillIds.clear(); } diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/menu-entries.js b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/menu-entries.js new file mode 100644 index 00000000..48c38d55 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/menu-entries.js @@ -0,0 +1,72 @@ +"use strict"; + +const fs = require("fs"); +const path = require("path"); + +const skillsRoot = require("./skills-root"); +const scanner = require("./menu-entry-scanner"); +const providers = require("./menu-providers"); + +function isDirectory(p) { + try { + return fs.statSync(p).isDirectory(); + } catch (e) { + return false; + } +} + +function expandSubmenuChildren(entries, root, opts) { + (entries || []).forEach(function (e) { + if (!e || e.type !== "submenu") return; + + if (e.children && e.children.length) return; + if (!e.childrenDir) return; + + let dir = e.childrenDir; + if (typeof dir !== "string" || dir.trim().length === 0) return; + dir = dir.trim(); + + const resolved = (dir.charAt(0) === "/") ? dir : path.join(root, dir); + if (!isDirectory(resolved)) { + if (opts && opts.log) opts.log("submenu childrenDir not a directory", e.id, resolved); + e.children = []; + return; + } + + if (opts && opts.log) opts.log("submenu childrenDir scan", e.id, resolved); + e.children = scanner.scanSubmenuChildren(resolved, { log: opts && opts.log, defaultIcon: opts && opts.defaultIcon, defaultColor: opts && opts.defaultColor, defaultOrder: opts && opts.defaultOrder }); + }); +} + +function getMenuEntries(opts) { + opts = opts || {}; + const root = skillsRoot.resolveSkillsRoot(opts.skillsRoot); + const providerDir = opts.providersDir || skillsRoot.providersDirForRoot(root); + + const scanned = scanner.scanAllMenuEntries(root, { + log: opts.log, + defaultIcon: opts.defaultIcon, + defaultColor: opts.defaultColor, + defaultOrder: opts.defaultOrder + }); + + const provided = providers.loadProviderEntries(providerDir, { log: opts.log, skillsRoot: root, providersDir: providerDir }); + const merged = providers.mergeById(scanned, provided); + + // Allow provider-defined submenus to be backed by an arbitrary directory. + // Example: { type: "submenu", id: "fun", childrenDir: "FunStuff" } + expandSubmenuChildren(merged, root, opts); + + const dynamicIds = scanner.collectDynamicSkillIds(merged); + + return { + skillsRoot: root, + providersDir: providerDir, + entries: merged, + dynamicSkillIds: dynamicIds + }; +} + +module.exports = { + getMenuEntries: getMenuEntries +}; diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/menu-entry-scanner.js b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/menu-entry-scanner.js new file mode 100644 index 00000000..6258c428 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/menu-entry-scanner.js @@ -0,0 +1,150 @@ +"use strict"; + +const fs = require("fs"); +const path = require("path"); + +function safeReadJson(filePath, logFn) { + try { + const txt = fs.readFileSync(filePath, "utf8"); + if (!txt || txt.trim().length === 0) return null; + return JSON.parse(txt); + } catch (e) { + if (logFn) logFn("safeReadJson failed", filePath, e && e.message ? e.message : e); + return null; + } +} + +function isDirectory(p) { + try { + return fs.statSync(p).isDirectory(); + } catch (e) { + return false; + } +} + +function scanSkillEntry(skillDir, folderName, opts) { + opts = opts || {}; + const menuJsonPath = path.join(skillDir, "menuEntry.json"); + const menuJson = safeReadJson(menuJsonPath, opts.log); + + if (!menuJson) return null; + if (menuJson.hidden === true) return null; + + const entry = { + id: folderName, + type: menuJson.type || "skill", + title: menuJson.title || menuJson.label || folderName, + icon: menuJson.icon || menuJson.iconSrc || (opts.defaultIcon || "resources/icons/settings.png"), + color: menuJson.color || menuJson.colors || (opts.defaultColor || "default"), + description: menuJson.description || "", + path: skillDir, + order: typeof menuJson.order === "number" ? menuJson.order : (typeof opts.defaultOrder === "number" ? opts.defaultOrder : 100), + skillId: menuJson.skillId || folderName, + submenuTitle: menuJson.submenuTitle || menuJson.title || folderName + }; + + if (entry.type === "submenu") { + entry.children = scanSubmenuChildren(skillDir, opts); + } + + // Legacy support + if (menuJson.isSubmenu === true && entry.type !== "submenu") { + entry.type = "submenu"; + entry.children = scanSubmenuChildren(skillDir, opts); + } + + return entry; +} + +function scanSubmenuChildren(submenuDir, opts) { + const children = []; + let items; + try { + items = fs.readdirSync(submenuDir); + } catch (e) { + return children; + } + + items.forEach(function (name) { + if (!name || name.charAt(0) === ".") return; + if (name === "@be" || name === "node_modules") return; + + const childPath = path.join(submenuDir, name); + if (!isDirectory(childPath)) return; + + const entry = scanSkillEntry(childPath, name, opts); + if (entry && entry.type === "skill") { + children.push(entry); + } + }); + + children.sort(function (a, b) { + if (a.order !== b.order) return a.order - b.order; + return String(a.title || "").localeCompare(String(b.title || "")); + }); + + return children; +} + +function scanAllMenuEntries(skillsRoot, opts) { + opts = opts || {}; + const entries = []; + + if (!skillsRoot || !fs.existsSync(skillsRoot)) { + if (opts.log) opts.log("skills root missing", skillsRoot); + return entries; + } + + let children; + try { + children = fs.readdirSync(skillsRoot); + } catch (e) { + if (opts.log) opts.log("failed to read skills root", skillsRoot, e && e.message ? e.message : e); + return entries; + } + + children.forEach(function (name) { + if (!name || name.charAt(0) === ".") return; + if (name === "@be" || name === "node_modules") return; + + const skillDir = path.join(skillsRoot, name); + if (!isDirectory(skillDir)) return; + + const entry = scanSkillEntry(skillDir, name, opts); + if (entry) entries.push(entry); + }); + + entries.sort(function (a, b) { + if (a.order !== b.order) return a.order - b.order; + return String(a.title || "").localeCompare(String(b.title || "")); + }); + + return entries; +} + +function collectDynamicSkillIds(entries) { + const ids = new Set(); + + (entries || []).forEach(function (e) { + if (!e) return; + if (e.type === "skill") { + if (e.skillId) ids.add(e.skillId); + if (e.id) ids.add(e.id); + } + if (e.type === "submenu" && e.children && e.children.length) { + e.children.forEach(function (c) { + if (!c) return; + if (c.skillId) ids.add(c.skillId); + if (c.id) ids.add(c.id); + }); + } + }); + + return ids; +} + +module.exports = { + scanAllMenuEntries: scanAllMenuEntries, + scanSubmenuChildren: scanSubmenuChildren, + collectDynamicSkillIds: collectDynamicSkillIds +}; diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/menu-providers.js b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/menu-providers.js new file mode 100644 index 00000000..d1057d0e --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/menu-providers.js @@ -0,0 +1,115 @@ +"use strict"; + +const fs = require("fs"); +const path = require("path"); + +function isDirectory(p) { + try { + return fs.statSync(p).isDirectory(); + } catch (e) { + return false; + } +} + +function safeReadJson(filePath, logFn) { + try { + const txt = fs.readFileSync(filePath, "utf8"); + if (!txt || txt.trim().length === 0) return null; + return JSON.parse(txt); + } catch (e) { + if (logFn) logFn("provider json read failed", filePath, e && e.message ? e.message : e); + return null; + } +} + +function loadFromJson(filePath, ctx) { + const obj = safeReadJson(filePath, ctx && ctx.log); + if (!obj) return []; + + if (Array.isArray(obj)) return obj; + if (obj && Array.isArray(obj.entries)) return obj.entries; + if (obj && Array.isArray(obj.buttons)) return obj.buttons; + return []; +} + +function loadFromJs(filePath, ctx) { + try { + // eslint-disable-next-line global-require, import/no-dynamic-require + const mod = require(filePath); + if (!mod) return []; + if (typeof mod === "function") return mod(ctx) || []; + if (typeof mod.getEntries === "function") return mod.getEntries(ctx) || []; + if (Array.isArray(mod.entries)) return mod.entries; + return []; + } catch (e) { + if (ctx && ctx.log) ctx.log("provider js load failed", filePath, e && e.message ? e.message : e); + return []; + } +} + +function loadProviderEntries(providersDir, ctx) { + const out = []; + + if (!providersDir || !fs.existsSync(providersDir) || !isDirectory(providersDir)) { + return out; + } + + let files; + try { + files = fs.readdirSync(providersDir); + } catch (e) { + return out; + } + + files.sort(); + + files.forEach(function (name) { + if (!name || name.charAt(0) === ".") return; + const full = path.join(providersDir, name); + if (isDirectory(full)) return; + + if (name.indexOf(".json", name.length - 5) !== -1) { + const entries = loadFromJson(full, ctx); + entries.forEach(function (e) { out.push(e); }); + return; + } + + if (name.indexOf(".js", name.length - 3) !== -1) { + const entries = loadFromJs(full, ctx); + entries.forEach(function (e) { out.push(e); }); + } + }); + + return out; +} + +// Merge provider entries into scanned entries by id. +// Provider entries win on conflicts. +function mergeById(scannedEntries, providerEntries) { + const byId = {}; + + (scannedEntries || []).forEach(function (e) { + if (!e || !e.id) return; + byId[e.id] = e; + }); + + (providerEntries || []).forEach(function (p) { + if (!p || !p.id) return; + byId[p.id] = p; + }); + + const merged = Object.keys(byId).map(function (k) { return byId[k]; }); + merged.sort(function (a, b) { + const ao = typeof a.order === "number" ? a.order : 100; + const bo = typeof b.order === "number" ? b.order : 100; + if (ao !== bo) return ao - bo; + return String(a.title || a.label || a.id).localeCompare(String(b.title || b.label || b.id)); + }); + + return merged; +} + +module.exports = { + loadProviderEntries: loadProviderEntries, + mergeById: mergeById +}; diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/skills-root.js b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/skills-root.js new file mode 100644 index 00000000..dd656a39 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/menu/skills-root.js @@ -0,0 +1,31 @@ +"use strict"; + +const path = require("path"); +const fs = require("fs"); + +const DEFAULT_ROOT = "/opt/jibo/Jibo/Skills"; + +function resolveSkillsRoot(overrideRoot) { + if (overrideRoot && typeof overrideRoot === "string") return overrideRoot; + if (process && process.env && process.env.JIBO_SKILLS_ROOT) return process.env.JIBO_SKILLS_ROOT; + return DEFAULT_ROOT; +} + +function providersDirForRoot(skillsRoot) { + // Keep providers inside Skills so they can be synced easily. + // Default: /opt/jibo/Jibo/Skills/@be/menu-entries.d + // Legacy fallback: /opt/jibo/Jibo/Skills/@be/menu-providers.d + const v2 = path.join(skillsRoot, "@be", "menu-entries.d"); + const v1 = path.join(skillsRoot, "@be", "menu-providers.d"); + try { + if (fs.existsSync(v2)) return v2; + if (fs.existsSync(v1)) return v1; + } catch (e) { /* ignore */ } + return v2; +} + +module.exports = { + DEFAULT_ROOT: DEFAULT_ROOT, + resolveSkillsRoot: resolveSkillsRoot, + providersDirForRoot: providersDirForRoot +}; diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/@be/radio/node_modules/jibo-radio/LocalRadioPlayer.js b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/@be/radio/node_modules/jibo-radio/LocalRadioPlayer.js new file mode 100644 index 00000000..22eab458 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/@be/radio/node_modules/jibo-radio/LocalRadioPlayer.js @@ -0,0 +1,78 @@ +const EventEmitter = require('events'); + +class LocalRadioPlayer extends EventEmitter { + constructor() { + super(); + // These are example streams. You will need to set up your own + // Icecast/HTTP streams and replace these URLs with your server's IP. + this._stations = { + 'Rock': 'http://192.168.1.100:8000/rock', + 'Pop': 'http://192.168.1.100:8000/pop', + 'Jazz': 'http://192.168.1.100:8000/jazz', + 'Classical': 'http://192.168.1.100:8000/classical', + 'Electronic': 'http://192.168.1.100:8000/electronic', + 'Hip-Hop': 'http://192.168.1.100:8000/hiphop' + }; + this._audio = null; + console.log("LocalRadioPlayer initialized"); + } + + getStations(options) { + console.log("LocalRadioPlayer: getStations called"); + const stationList = Object.keys(this._stations).map(genre => ({ + name: genre, + id: genre + })); + return Promise.resolve(stationList); + } + + play(stationData) { + console.log(`LocalRadioPlayer: play called with`, stationData); + if (this._audio) { + this._audio.pause(); + } + const streamUrl = this._stations[stationData.id]; + if (!streamUrl) { + const err = new Error(`Station ${stationData.id} not found.`); + console.error("LocalRadioPlayer Error:", err); + this.emit('error', err); + return; + } + + console.log(`LocalRadioPlayer: Playing stream from ${streamUrl}`); + this._audio = new Audio(streamUrl); + this._audio.addEventListener('error', (e) => { + console.error('LocalRadioPlayer Audio Error:', e); + this.emit('error', new Error('Audio playback failed.')); + }); + + this._audio.play() + .then(() => { + console.log("LocalRadioPlayer: Playback started."); + this.emit('song-data', { + title: `Streaming ${stationData.id}`, + artist: 'Local Radio', + albumArt: '' // No artwork for local streams + }); + }) + .catch(err => { + console.error("LocalRadioPlayer Playback Error:", err); + this.emit('error', err); + }); + } + + stop() { + console.log("LocalRadioPlayer: stop called"); + if (this._audio) { + this._audio.pause(); + this._audio = null; + } + } + + resizeArtwork(options) { + // Not applicable for local streaming + return Promise.resolve(''); + } +} + +module.exports = LocalRadioPlayer; diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/jibo-radio/LocalRadioPlayer.js b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/jibo-radio/LocalRadioPlayer.js new file mode 100644 index 00000000..993bedf1 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/jibo-radio/LocalRadioPlayer.js @@ -0,0 +1,73 @@ +const EventEmitter = require('events'); + +class LocalRadioPlayer extends EventEmitter { + constructor() { + super(); + // These are example streams. You will need to set up your own + // Icecast/HTTP streams and replace these URLs. + this._stations = { + 'My Station': 'http://192.168.1.5:6767/Ninja%20Tuna.mp3' + }; + this._audio = null; + console.log("LocalRadioPlayer initialized"); + } + + getStations(options) { + console.log("LocalRadioPlayer: getStations called"); + const stationList = Object.keys(this._stations).map(genre => ({ + name: genre, + id: genre + })); + return Promise.resolve(stationList); + } + + play(stationData) { + console.log(`LocalRadioPlayer: play called with`, stationData); + if (this._audio) { + this._audio.pause(); + } + const streamUrl = this._stations[stationData.id]; + if (!streamUrl) { + const err = new Error(`Station ${stationData.id} not found.`); + console.error("LocalRadioPlayer Error:", err); + this.emit('error', err); + return; + } + + console.log(`LocalRadioPlayer: Playing stream from ${streamUrl}`); + this._audio = new Audio(streamUrl); + this._audio.addEventListener('error', (e) => { + console.error('LocalRadioPlayer Audio Error:', e); + this.emit('error', new Error('Audio playback failed.')); + }); + + this._audio.play() + .then(() => { + console.log("LocalRadioPlayer: Playback started."); + this.emit('song-data', { + title: `Streaming ${stationData.id}`, + artist: 'Local Radio', + albumArt: '' // No artwork for local streams + }); + }) + .catch(err => { + console.error("LocalRadioPlayer Playback Error:", err); + this.emit('error', err); + }); + } + + stop() { + console.log("LocalRadioPlayer: stop called"); + if (this._audio) { + this._audio.pause(); + this._audio = null; + } + } + + resizeArtwork(options) { + // Not applicable for local streaming + return Promise.resolve(''); + } +} + +module.exports = LocalRadioPlayer; diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/jibo-radio/lib/jibo-radio.js b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/jibo-radio/lib/jibo-radio.js index e8903e08..6ac4f1e6 100644 --- a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/jibo-radio/lib/jibo-radio.js +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/node_modules/jibo-radio/lib/jibo-radio.js @@ -1,1029 +1,7 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jiboRadio = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o { - this._volume = HJ_VOLUME; - }; - this._listenFinished = () => { - if (!this._isCurrentlySpeaking) { - this._volume = this._volumePlugin.currentVolume; - } - }; - this._volumeChanged = (volume) => { - this._volume = volume; - }; - this._hlsMediaAttached = () => { - if (this._hls) { - this._hls.loadSource(this._hlsURI); - } - }; - this._hlsManifestParsed = (event, data) => { - if (this._hls) { - this._log.info(`Manifest loaded, found ${data.levels.length} quality levels`); - this._mode = Mode.HLS; - this._volume = this._volumePlugin.currentVolume; - this.resume(); - } - }; - this._hlsFragParsing = (event, fragment) => __awaiter(this, void 0, void 0, function* () { - this._log.debug(event, fragment); - if (fragment.frag.title) { - try { - this._emitSongData(this._processHLSMetadata(fragment.frag.title)); - } - catch (err) { - this._log.info('Problem parsing HLS stream metadata; trying sideband', err); - this._emitSongData(yield this._getSidebandData(), true); - } - } - }); - this._handleHLSErrors = (event, data) => { - if (!this._hls) { - return; - } - if (!data.fatal) { - this._log.info('HLS warning', data); - return; - } - switch (data.type) { - case HLS.ErrorTypes.MEDIA_ERROR: - if (!this._recoveringMedia) { - this._log.info('Trying to recover from media error', data); - this._recoveringMedia = - setTimeout(() => this._recoveringMedia = null, 2000); - this._hls.recoverMediaError(); - } - else if (!this._swappingAudioCodec) { - this._log.info('Swapping audio codec this time, then trying again to recover from media error', data); - clearTimeout(this._recoveringMedia); - this._recoveringMedia = null; - this._swappingAudioCodec = true; - setTimeout(() => this._swappingAudioCodec = false, 2000); - this._hls.swapAudioCodec(); - this._hls.recoverMediaError(); - } - else { - this._recoveringMedia = null; - this._swappingAudioCodec = false; - this._handleStreamError(data); - } - break; - default: - this._handleStreamError(data); - break; - } - }; - this._handleMediaPlaying = () => { - this._mediaTagPlayPromise = null; - this._streamStarted(); - this._resolveStreamPromise(); - }; - this._handleAudioError = () => { - if (!this._log) { - return; - } - if (this._audio) { - this._audio.removeEventListener('loadeddata', this._handleMediaPlaying); - this._audio.removeEventListener('stalled', this._handleAudioError); - this._audio.removeEventListener('error', this._handleAudioError); - } - this._mediaTagPlayPromise = null; - const code = this._audio && this._audio.error && this._audio.error.code; - if (code !== MediaError.MEDIA_ERR_ABORTED) { - const err = RadioPlayer._getMediaError(code); - if (this._mode === Mode.PLS) { - this._nextPLSStream(err); - } - else { - this._handleStreamError(err); - } - } - }; - this._handleVideoError = () => { - if (!this._log) { - return; - } - if (this._video) { - this._video.removeEventListener('loadeddata', this._handleMediaPlaying); - this._video.removeEventListener('error', this._handleAudioError); - } - this._mediaTagPlayPromise = null; - const code = this._video && this._video.error && this._video.error.code; - if (code !== MediaError.MEDIA_ERR_ABORTED) { - this._handleStreamError(RadioPlayer._getMediaError(code)); - } - }; - if (!HLS.isSupported()) { - throw new Error('Oh no! HTTP Live Streaming isn\'t supported!'); - } - } - static _hash(name) { - const shasum = crypto.createHash('sha256'); - shasum.update(`${DEVICE_ID_SALT}-${name}`); - return shasum.digest('hex'); - } - static _songDataDifferent(left, right) { - return !!left && !right - || !left && !!right - || left.mediaType !== right.mediaType - || left.artist !== right.artist - || left.title !== right.title; - } - static _promiseTimeout(promise, millis) { - return Promise.race([ - promise, - new Promise((_, reject) => setTimeout(() => reject(new Error('Timeout')), millis)), - ]); - } - init(serialNumber, releaseVersion, country, lat, lng, listenEvents, volumePlugin) { - return __awaiter(this, void 0, void 0, function* () { - this._deviceId = RadioPlayer._hash(serialNumber); - this._releaseVersion = releaseVersion; - this._country = country; - this._lat = lat; - this._lng = lng; - this._listenEvents = listenEvents; - this._listenEvents.hjHeard.on(this._hjHeard); - this._listenEvents.hjOnly.on(this._listenFinished); - this._listenEvents.noGlobalMatch.on(this._listenFinished); - this._listenEvents.nonInterruptingGlobal.on(this._listenFinished); - this._volumePlugin = volumePlugin; - this._volumePlugin.on('change', this._volumeChanged); - this._log = new jibo_log_1.Log('Jibo.Radio'); - }); - } - getCountry() { - return __awaiter(this, void 0, void 0, function* () { - return this._country; - }); - } - resizeArtwork(uri, width) { - return uri; - } - pause() { - return __awaiter(this, void 0, void 0, function* () { - if (this._mediaTagPlayPromise) { - try { - yield this._mediaTagPlayPromise; - } - catch (err) { - this._log.info('HTMLMediaElement#play rejected', err); - } - this._mediaTagPlayPromise = null; - } - if (this._audio) { - this._audio.pause(); - } - if (this._video) { - this._video.pause(); - } - }); - } - resume() { - return __awaiter(this, void 0, void 0, function* () { - if (this._mode === 'HLS' && !this._video - || this._mode !== 'HLS' && !this._audio) { - return; - } - try { - yield this.pause(); - } - catch (err) { - this._log.info('Error pausing stream', err); - } - this._mediaTagPlayPromise = this._promises.wrap(this._mode === Mode.HLS - ? this._video.play() - : this._audio.play()).catch(err => { - this._log.info('HTMLMediaElement#play rejected', err); - if (this._mode === Mode.HLS) { - this._handleVideoError(); - } - else { - this._handleAudioError(); - } - }); - }); - } - stop() { - return __awaiter(this, void 0, void 0, function* () { - this._lastSongData = undefined; - if (this._songDataSession) { - this._songDataSession.cancel(); - this._songDataSession = null; - } - this._songDataTimers.forEach(clearTimeout); - this._songDataTimers = []; - if (this._pollSongData) { - clearTimeout(this._pollSongData); - this._pollSongData = null; - } - this._icecastClient = null; - if (this._shoutcastServer) { - this._shoutcastServer.close(); - this._shoutcastServer = null; - } - if (this._hls) { - this._hls.off(HLS.Events.ERROR, this._handleHLSErrors); - this._hls.off(HLS.Events.FRAG_PARSING_METADATA, this._hlsFragParsing); - this._hls.off(HLS.Events.MANIFEST_PARSED, this._hlsManifestParsed); - this._hls.off(HLS.Events.MEDIA_ATTACHED, this._hlsMediaAttached); - this._hls.destroy(); - this._hls = null; - } - try { - yield this.pause(); - } - catch (err) { - this._log.info('Error during pause', err); - } - if (this._audio) { - this._audio.removeEventListener('loadeddata', this._handleMediaPlaying); - this._audio.removeEventListener('stalled', this._handleAudioError); - this._audio.removeEventListener('error', this._handleAudioError); - this._audio = null; - } - if (this._video) { - this._video.removeEventListener('loadeddata', this._handleMediaPlaying); - this._video.removeEventListener('error', this._handleVideoError); - this._video = null; - } - }); - } - destroy() { - this._listenEvents.hjHeard.off(this._hjHeard); - this._listenEvents.hjOnly.off(this._listenFinished); - this._listenEvents.noGlobalMatch.off(this._listenFinished); - this._listenEvents.nonInterruptingGlobal.off(this._listenFinished); - this._log = null; - this._playPromise = null; - this._playReject = null; - this._playResolve = null; - this._promises.cancel(); - this._promises = null; - this._volumePlugin.removeListener('change', this._volumeChanged); - } - stopAndDestroy() { - return __awaiter(this, void 0, void 0, function* () { - try { - yield this.stop(); - } - catch (err) { - this._log.warn('Error when stopping during cleanup', err); - } - this.destroy(); - }); - } - _handleStreamError(err) { - this._rejectOrEmit(err); - } - _streamHLS(uri, config = undefined, failover = false) { - return __awaiter(this, void 0, void 0, function* () { - this._log.debug('_streamHLS called', uri, config); - yield this.stop(); - this._mode = Mode.HLS; - this._hlsURI = uri; - this._hls = new HLS(Object.assign({}, config)); - this._hls.on(HLS.Events.MEDIA_ATTACHED, this._hlsMediaAttached); - this._hls.on(HLS.Events.MANIFEST_PARSED, this._hlsManifestParsed); - this._hls.on(HLS.Events.FRAG_PARSING_METADATA, this._hlsFragParsing); - this._hls.on(HLS.Events.ERROR, this._handleHLSErrors); - this._video = document.createElement('video'); - this._video.addEventListener('loadeddata', this._handleMediaPlaying); - this._video.addEventListener('error', this._handleVideoError); - if (failover) { - return this._hls.attachMedia(this._video); - } - return this._promises.wrap(RadioPlayer._promiseTimeout(this._setStreamPromiseHandlers(() => { - this._hls.attachMedia(this._video); - }), STREAM_TIMEOUT)); - }); - } - _fillMissingSongData(songData) { - return __awaiter(this, void 0, void 0, function* () { - songData = songData || {}; - if (!songData.mediaType || songData.mediaType === MediaType.Music) { - let artworkUrl = null; - if (songData.artworkUrl) { - try { - const response = yield axios_1.default.head(songData.artworkUrl); - if (response.status >= 200 && response.status < 300) { - artworkUrl = songData.artworkUrl; - } - } - catch (err) { - artworkUrl = null; - } - } - if (!songData.artist || !artworkUrl || !songData.title) { - this._log.info('Stream data was missing some fields; fetching from sideband'); - this._log.info('Stream data', songData); - const sidebandData = yield this._getSidebandData(); - if (sidebandData) { - this._log.info('Sideband data', sidebandData); - if (!artworkUrl && sidebandData.artworkUrl) { - songData.artworkUrl = sidebandData.artworkUrl; - } - if (!songData.artist && sidebandData.artist) { - songData.artist = sidebandData.artist; - } - if (!songData.title && sidebandData.artist) { - songData.title = sidebandData.title; - } - this._log.info('Combined data', songData); - } - } - else { - this._log.info('No sideband data found'); - } - } - return songData; - }); - } - _emitSongData(songData, fromSideband = false) { - return __awaiter(this, void 0, void 0, function* () { - const firstTime = this._lastSongData === undefined; - if (!this._log - || !songData && !this._lastSongData - || !firstTime && !RadioPlayer._songDataDifferent(songData, this._lastSongData)) { - return; - } - this._lastSongData = songData; - this._songDataSession = new jibo_cai_utils_1.CancelTokenSession(); - let filledSongData = songData; - if (!fromSideband) { - try { - filledSongData = yield this._songDataSession.wrap(this._fillMissingSongData(songData)); - } - catch (err) { - this._log.info('Failed to get sideband data', err); - } - } - if (this._mode === Mode.HLS && this._video && !firstTime) { - const end = this._video.buffered.length - ? this._video.buffered.end(this._video.buffered.length - 1) - : 0; - const current = this._video.currentTime; - const buffer = end - current; - const emitIn = end === 0 ? 0 : buffer + 5; - this._log.debug(`end: ${end}, current: ${current}, buffer: ${buffer}`); - this._log.debug(`Will emit songData in ${emitIn} seconds`, filledSongData); - const emitData = () => { - this.emit('song-data', filledSongData); - this._songDataTimers.shift(); - }; - this._songDataTimers.push(setTimeout(this._promises.wrapCallback(emitData), emitIn * 1000)); - } - else { - this.emit('song-data', filledSongData); - } - }); - } - _streamShoutcast(uri, failover = false) { - return __awaiter(this, void 0, void 0, function* () { - this._log.debug(`Streaming Shoutcast from ${uri}; failover ${failover}`); - yield this.stop(); - this._mode = Mode.Shoutcast; - try { - const hostname = url.parse(uri).hostname; - yield this._promises.wrap(RadioPlayer._promiseTimeout(promisify(cb => dns.resolve(hostname, cb)), DNS_TIMEOUT)); - } - catch (err) { - this._log.info('Shoutcast server hostname failed to resolve', err); - return failover - ? this._handleAudioError() - : this._setStreamPromiseHandlers(setImmediate(() => this._handleAudioError())); - } - this._icecastClient = yield this._promises.wrap(promisify(cb => icecast.get(uri, cb), false)); - this._icecastClient.on('metadata', (songData) => this._emitSongData(this._processShoutcastMetadata(icecast.parse(songData)))); - this._icecastClient.on('error', this._handleAudioError); - this._shoutcastServer = http.createServer((req, res) => { - res.setHeader('Cache-Control', 'no-cache, no-store'); - res.setHeader('Connection', 'close'); - res.setHeader('Content-Type', 'audio/aac'); - res.setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT'); - res.setHeader('Pragma', 'no-cache'); - this._icecastClient.pipe(res); - }); - this._shoutcastServer.listen(0, '127.0.0.1'); - yield promisify(cb => this._shoutcastServer.once('listening', cb)); - if (!this._shoutcastServer) { - return; - } - const port = this._shoutcastServer.address().port; - this._log.debug(`Shoutcast server listening on ${port}`); - this._audio = document.createElement('audio'); - this._audio.addEventListener('loadeddata', this._handleMediaPlaying); - this._audio.addEventListener('stalled', this._handleAudioError); - this._audio.addEventListener('error', this._handleAudioError); - this._audio.src = `http://127.0.0.1:${port}/`; - this._volume = this._volumePlugin.currentVolume; - if (failover) { - return this.resume(); - } - return this._promises.wrap(RadioPlayer._promiseTimeout(this._setStreamPromiseHandlers(() => this.resume()), STREAM_TIMEOUT)); - }); - } - _streamPLS(uri, failover = false) { - return __awaiter(this, void 0, void 0, function* () { - this._log.debug(`Streaming PLS from ${uri}`); - yield this.stop(); - this._mode = Mode.PLS; - try { - const plsContent = (yield this._promises.wrap(axios_1.default.get(uri))).data; - this._plsStreams = plsContent.split('\n') - .filter(url => url.startsWith('File')) - .map(url => url.split('=', 2)[1]); - this._plsStreamFirstIndex = this._plsStreamIndex = - Math.floor(Math.random() * this._plsStreams.length); - } - catch (err) { - return this._handleAudioError(); - } - this._audio = document.createElement('audio'); - this._audio.addEventListener('loadeddata', this._handleMediaPlaying); - this._audio.addEventListener('stalled', this._handleAudioError); - this._audio.addEventListener('error', this._handleAudioError); - this._volume = this._volumePlugin.currentVolume; - if (failover) { - return this.resume(); - } - return this._promises.wrap(RadioPlayer._promiseTimeout(this._setStreamPromiseHandlers(() => this._playPLSStream()), STREAM_TIMEOUT)); - }); - } - _streamStarted() { } - setCurrentlySpeaking(isCurrentlySpeaking) { - this._isCurrentlySpeaking = isCurrentlySpeaking; - this._volume = isCurrentlySpeaking ? HJ_VOLUME : this._volumePlugin.currentVolume; - } - get _volume() { - return this._audio ? this._audio.volume / VOLUME_NORMAL - : this._video ? this._video.volume / VOLUME_NORMAL - : 0; - } - set _volume(value) { - if (value < 1 || value > 10) { - throw new Error(`Value must be between 1 and 10, inclusive`); - } - const volume = value * VOLUME_NORMAL; - if (this._audio) { - this._audio.volume = volume; - } - if (this._video) { - this._video.volume = volume; - } - } - _playPLSStream() { - return __awaiter(this, void 0, void 0, function* () { - this._audio.src = this._plsStreams[this._plsStreamIndex]; - yield this.resume(); - const getAndEmitData = () => __awaiter(this, void 0, void 0, function* () { - const data = yield this._getSidebandData(); - yield this._emitSongData(data, true); - setTimeout(getAndEmitData, 1000); - }); - getAndEmitData(); - }); - } - _nextPLSStream(data) { - return __awaiter(this, void 0, void 0, function* () { - const oldIndex = this._plsStreamIndex; - if (!this._plsStreams) { - return this._handleStreamError(data); - } - if (++this._plsStreamIndex === this._plsStreams.length) { - this._plsStreamIndex = 0; - } - if (this._plsStreamIndex !== this._plsStreamFirstIndex) { - this._log.info(`PLS stream ${oldIndex} failed`); - yield this._playPLSStream(); - } - else { - this._handleStreamError(data); - } - }); - } - static _getMediaError(code) { - switch (code) { - case 1: return 'MEDIA_ERR_ABORTED'; - case 2: return 'MEDIA_ERR_NETWORK'; - case 3: return 'MEDIA_ERR_DECODE'; - case 4: return 'MEDIA_ERR_SRC_NOT_SUPPORTED'; - default: return 'UNKNOWN'; - } - } - _setStreamPromiseHandlers(startStream) { - if (this._playPromise) { - startStream(); - return this._playPromise; - } - return this._playPromise = this._promises.wrap(new Promise((resolve, reject) => { - this._playReject = reject; - this._playResolve = resolve; - startStream(); - })); - } - _resolveStreamPromise() { - if (this._playPromise) { - this._log.info('Resolving play promise'); - this._playResolve(); - this._playPromise = null; - this._playReject = null; - this._playResolve = null; - } - } - _rejectOrEmit(reason) { - if (this._playPromise) { - this._log.info('Rejecting play promise'); - this._playReject(reason); - this._playPromise = null; - this._playReject = null; - this._playResolve = null; - } - else { - this.emit('error', `Error while playing stream: ${reason}`); - } - } -} -exports.default = RadioPlayer; +const LocalRadioPlayer = require('../LocalRadioPlayer'); -},{"axios":undefined,"crypto":undefined,"dns":undefined,"events":undefined,"hls.js":undefined,"http":undefined,"icecast":undefined,"jibo-cai-utils":undefined,"jibo-log":undefined,"url":undefined}],2:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IHeartGenres = { - Alternative: 1, - ChristianAndGospel: 2, - ClassicRock: 3, - Classical: 4, - Country: 5, - HipHopAndRAndB: 6, - HipHop: 6, - Jazz: 7, - MixAndVariety: 8, - NewsAndTalk: 9, - Oldies: 10, - ReggaeAndIsland: 11, - Reggae: 11, - Rock: 12, - SoftRock: 13, - Spanish: 14, - Sports: 15, - Top40AndPop: 16, - Pop: 16, - World: 17, - EightiesAndNinetiesHits: 18, - Comedy: 19, - Dance: 77, - PublicRadio: 93, - NPR: 93, - HostsAndDJs: 95, - TrafficWeatherAndNews: 96, - Holiday: 97, - CollegeRadio: 98, - Mexico: 100, - Personalities: 101, - PopularArtists: 102, - EDM: 103, - RAndB: 104, - KidsAndFamily: 106, - Punk: 107, - Blues: 108, - International: 110, - Metal: 1191, - Latin: 1192, -}; - -},{}],3:[function(require,module,exports){ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const axios_1 = require("axios"); -const IHeartInterfaces_1 = require("./IHeartInterfaces"); -const RadioPlayer_1 = require("../RadioPlayer"); -const querystring = require("querystring"); -const CLIENT_VERSION = '1.0.0'; -const DEFAULT_NUM_STATIONS_PER_GENRE = 20; -const DEVICE_NAME = 'Jibo'; -const INITIAL_HOSTNAME = 'jibo.appliance'; -const INIT_ID = 8169; -const NATIONAL_DIGITAL = 575; -const PLAYER = 'iHeartRadioJibo'; -const GET_LOCATION_URI = `https://global.api.iheart.com/api/v3/locationConfig?hostname=${INITIAL_HOSTNAME}&version=1.0.0`; -const ENDPOINTS = Object.freeze({ - clientConfig: 'v1/bootstrap/getClientConfig', - countries: 'v2/content/countries', - login: 'v1/account/loginOrCreateOauthUser', - states: 'v2/content/states', - cities: 'v2/content/cities', - markets: 'v2/content/markets', - genres: 'v2/content/liveStationGenres', - liveStations: 'v2/content/liveStations', - metadata: 'v1/liveMetaData/getStationTrack', - reportStreamStarted: 'v1/liveRadio/reportStreamStarted', -}); -const DEFAULT_OPTIONS = Object.freeze({ - responseType: 'json', -}); -const HLS_CONFIG = Object.freeze({ - maxBufferLength: 10, - maxMaxBufferLength: 33, -}); -class IHeartPlayer extends RadioPlayer_1.default { - constructor() { - super(...arguments); - this._stationCache = {}; - this._getSidebandData = () => __awaiter(this, void 0, void 0, function* () { - if (!this._iHeartLog) { - return; - } - const result = yield this._promises.wrap(this._getSongData({ stationId: this._station.id })); - const metadata = result.trackRestLiteValues - && result.trackRestLiteValues.length - && result.trackRestLiteValues[0]; - if (!metadata) { - return null; - } - const fullLength = metadata.trackDuration || 0; - const minutes = Math.floor(fullLength / 60); - const seconds = fullLength - minutes * 60; - const artworkUrl = !metadata.imagePath || metadata.imagePath.includes('imscale') - ? null - : metadata.imagePath; - return { - artist: metadata.artistName, - title: metadata.title, - length: `${minutes}:${seconds < 10 ? `0${seconds}` : seconds}`, - artworkUrl, - }; - }); - } - static _getMediaType(fromIHeart) { - switch (fromIHeart) { - case 'M': return RadioPlayer_1.MediaType.Music; - case 'T': return RadioPlayer_1.MediaType.Talk; - case 'O': return RadioPlayer_1.MediaType.Other; - default: return null; - } - } - init(serialNumber, releaseVersion, country, lat, lng, listenEvents, volumePlugin) { - const _super = name => super[name]; - return __awaiter(this, void 0, void 0, function* () { - yield _super("init").call(this, serialNumber, releaseVersion, country, lat, lng, listenEvents, volumePlugin); - this._iHeartLog = this._log.createChild('iHeart'); - this._locationConfigPromise = this._promises.wrap(this._getLocation().catch(err => this._locationConfigError = err)); - this._initPromise = this._promises.wrap(this._init().catch(err => this._initError = err)); - }); - } - getCountry() { - return __awaiter(this, void 0, void 0, function* () { - yield this._locationConfigPromise; - if (this._locationConfigError) { - throw this._locationConfigError; - } - return this._countryCode; - }); - } - getStations(options = {}) { - return __awaiter(this, void 0, void 0, function* () { - yield this._initPromise; - if (this._initError) { - throw this._initError; - } - const limit = options.limit || DEFAULT_NUM_STATIONS_PER_GENRE; - const genreId = IHeartInterfaces_1.IHeartGenres[options.genreName]; - let stations = yield this._promises.wrap(this._getLiveStations(Object.assign({ genreId }, (options.locality === RadioPlayer_1.Locality.Local - ? { lat: this._lat, lng: this._lng } - : { marketId: NATIONAL_DIGITAL }), { limit }))); - stations = stations.sort((left, right) => { - if (!left.streams || !right.streams) { - return left.streams ? -1 : right.streams ? 1 : 0; - } - const leftScore = left.streams.hls_stream ? 2 : - left.streams.shoutcast_stream ? 1 : - 0; - const rightScore = right.streams.hls_stream ? 2 : - right.streams.shoutcast_stream ? 1 : - 0; - return rightScore - leftScore; - }); - if (options.preferredStation) { - const station = stations.find(station => station.callLetters === options.preferredStation); - if (station) { - stations = stations.sort((left, right) => { - const leftScore = left === station ? 1 : 0; - const rightScore = right === station ? 1 : 0; - return rightScore - leftScore; - }); - } - else { - const gottenStations = yield this._promises.wrap(this._getLiveStations({ - callLetters: options.preferredStation, - })); - if (gottenStations && gottenStations.length) { - stations = [gottenStations[0], ...stations.slice(0, limit - 1)]; - } - } - } - stations.forEach((station) => { - this._stationCache[station.callLetters] = station; - }); - return stations.map((station) => { - return { - band: station.band, - callLetters: station.callLetters, - description: station.description, - frequency: station.freq, - logoUrl: station.logo, - name: station.name, - website: station.website, - }; - }); - }); - } - play(callLetters) { - return __awaiter(this, void 0, void 0, function* () { - this._iHeartLog.info(`Playing ${callLetters}`); - yield this._initPromise; - if (this._initError) { - throw this._initError; - } - const station = this._stationCache[callLetters]; - if (station) { - this._station = station; - } - else { - const stations = yield this._promises.wrap(this._getLiveStations({ - callLetters, - limit: 1, - })); - if (!stations.length) { - throw new Error(`Station ${callLetters} not found`); - } - this._station = - this._stationCache[this._station.callLetters] = - stations[0]; - } - return this._promises.wrap(this._streamStation()); - }); - } - resizeArtwork(uri, width) { - const normalized = Math.min(width, 1920); - return `http://img.iheart.com/sca/imscale?w=${normalized}&img=${uri}`; - } - destroy() { - super.destroy(); - this._initError = null; - this._initPromise = null; - this._locationConfigError = null; - this._locationConfigPromise = null; - this._session = null; - this._station = null; - this._stationCache = null; - } - _processHLSMetadata(titleField) { - if (titleField.match(/comment=".*"/) - || titleField.match(/text=\\?"Spot Block\\?"/) - || titleField.match(/text=\\?"Spot Block End\\?"/)) { - return { mediaType: RadioPlayer_1.MediaType.Talk }; - } - const mediaTypeMatch = titleField.match(/song_spot=\\"([MTO])\\"/); - const mediaType = IHeartPlayer._getMediaType(mediaTypeMatch && mediaTypeMatch[1]); - const titleMatch = titleField.match(/title="(.*?)"/); - const title = titleMatch && titleMatch[1]; - const artistMatch = titleField.match(/artist="(.*?)"/); - const artistRaw = artistMatch && artistMatch[1]; - const artist = artistRaw ? artistRaw.split('|')[0].trim() : null; - const lengthMatch = titleField.match(/length=\\"([0-9:]+?)\\"/); - const length = lengthMatch && lengthMatch[1]; - const artworkUrlMatch = titleField.match(/amgArtworkURL=\\"(.*?)\\"/); - const artworkUrlRaw = artworkUrlMatch && artworkUrlMatch[1]; - const artworkUrl = !artworkUrlRaw || artworkUrlRaw.includes('imscale') - ? null - : artworkUrlRaw; - return { mediaType, artist, title, length, artworkUrl }; - } - _processShoutcastMetadata(metadata) { - this._iHeartLog.debug('Processing Shoutcast metadata', metadata); - if (!metadata.StreamTitle) { - return {}; - } - const [artist, rawTitle] = metadata.StreamTitle.split(' - '); - const title = rawTitle === 'text' ? '' : rawTitle; - return { artist, title }; - } - _handleStreamError(data) { - const streams = this._station.streams; - if (this._mode === RadioPlayer_1.Mode.HLS && streams.shoutcast_stream) { - this._iHeartLog.info('HLS stream failed; trying Shoutcast'); - this._streamShoutcast(streams.shoutcast_stream, true); - } - else if ((this._mode === RadioPlayer_1.Mode.HLS || this._mode === RadioPlayer_1.Mode.Shoutcast) - && streams.pls_stream) { - this._iHeartLog.info('HLS and Shoutcast failed; trying PLS'); - this._streamPLS(streams.pls_stream, true); - } - else { - this._iHeartLog.info('All streams failed; emitting error'); - super._handleStreamError(data); - } - } - _streamStarted() { - if (!this._session) { - this._iHeartLog.info('No active session when trying to report start of stream'); - return; - } - const params = new URLSearchParams(); - params.append('profileId', this._session.profileId.toString()); - params.append('sessionId', this._session.sessionId); - params.append('playedFrom', '300'); - params.append('host', this._iHeartHostname); - params.append('parentId', this._station.id.toString()); - try { - this._promises.wrap(axios_1.default.post(this._getURI(ENDPOINTS.reportStreamStarted), params)); - } - catch (err) { - this._iHeartLog.info('Error reporting start of stream', err); - } - } - _init() { - return __awaiter(this, void 0, void 0, function* () { - yield this._locationConfigPromise; - if (this._locationConfigError) { - throw this._locationConfigError; - } - yield this._promises.wrap(this._login()); - }); - } - _getLocation() { - return __awaiter(this, void 0, void 0, function* () { - const result = yield this._promises.wrap(axios_1.default.get(GET_LOCATION_URI)); - this._countryCode = result.data.countryCode.toLowerCase(); - this._iHeartBaseURI = result.data.config.apiUrl; - this._iHeartHostname = result.data.config.hostName; - this._iHeartTerminal = result.data.config.terminalId; - }); - } - _getURI(endpoint) { - return `${this._iHeartBaseURI}/api/${endpoint}`; - } - _login() { - return __awaiter(this, void 0, void 0, function* () { - const params = new URLSearchParams(); - params.append('accessToken', 'anon'); - params.append('accessTokenType', 'anon'); - params.append('deviceId', this._deviceId); - params.append('deviceName', `anon${this._deviceId}`); - params.append('host', this._iHeartHostname); - params.append('oauthUuid', this._deviceId); - params.append('oauthoverride', 'false'); - this._session = yield this._promises.wrap(this._post(ENDPOINTS.login, params)); - this._iHeartLog.debug('login completed', this._session); - }); - } - _get(endpoint, options = undefined) { - return __awaiter(this, void 0, void 0, function* () { - options = Object.assign({}, options); - options.headers = Object.assign({}, options.headers, { 'X-hostName': this._iHeartHostname }); - const result = yield axios_1.default.get(this._getURI(endpoint), Object.assign({}, DEFAULT_OPTIONS, options)); - return result.data; - }); - } - _getHits(endpoint, options = undefined) { - return __awaiter(this, void 0, void 0, function* () { - const result = yield this._promises.wrap(this._get(endpoint, options)); - return result.hits; - }); - } - _post(endpoint, data = undefined, options = undefined) { - return __awaiter(this, void 0, void 0, function* () { - options = Object.assign({}, options); - options.headers = Object.assign({}, options.headers, { 'X-hostName': this._iHeartHostname }); - const result = yield this._promises.wrap(axios_1.default.post(this._getURI(endpoint), data, Object.assign({}, DEFAULT_OPTIONS, options))); - return result.data; - }); - } - _getLiveStations(params) { - return this._promises.wrap(this._getHits(ENDPOINTS.liveStations, { params })); - } - _getSongData(params) { - return this._promises.wrap(this._get(ENDPOINTS.metadata, { params })); - } - _streamStation() { - return __awaiter(this, void 0, void 0, function* () { - const streams = this._station.streams; - if (streams.secure_hls_stream) { - return this._promises.wrap(this._iHeartStreamHLS(streams.secure_hls_stream)); - } - else if (streams.hls_stream) { - return this._promises.wrap(this._iHeartStreamHLS(streams.hls_stream)); - } - else if (streams.shoutcast_stream) { - return this._promises.wrap(this._streamShoutcast(streams.shoutcast_stream)); - } - else if (streams.pls_stream) { - return this._promises.wrap(this._streamPLS(streams.pls_stream)); - } - throw new Error('No compatible stream found'); - }); - } - _iHeartStreamHLS(stream) { - return __awaiter(this, void 0, void 0, function* () { - const qs = querystring.stringify({ - iheartradioversion: CLIENT_VERSION, - Deviceid: this._deviceId, - clienttype: DEVICE_NAME, - osVersion: this._releaseVersion, - devicename: DEVICE_NAME, - callLetters: this._station.callLetters, - Streamid: this._station.id, - terminalid: this._iHeartTerminal, - init_id: INIT_ID, - fb_broadcast: 0, - at: 0, - pname: DEVICE_NAME, - listenerId: this._deviceId, - amsparams: `playerid:${PLAYER};skey=${new Date().toISOString()}`, - }); - const uri = `${stream}?${qs}`; - return this._promises.wrap(this._streamHLS(uri, HLS_CONFIG)); - }); - } -} -exports.default = IHeartPlayer; - -},{"../RadioPlayer":1,"./IHeartInterfaces":2,"axios":undefined,"querystring":undefined}],4:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const IHeartPlayer_1 = require("./IHeartPlayer"); -exports.IHeartPlayer = IHeartPlayer_1.default; - -},{"./IHeartPlayer":3}],5:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const iHeart_1 = require("./iHeart"); -const RadioPlayer_1 = require("./RadioPlayer"); -exports.RadioPlayer = RadioPlayer_1.default; -exports.Locality = RadioPlayer_1.Locality; -exports.MediaType = RadioPlayer_1.MediaType; function createRadio() { - return new iHeart_1.IHeartPlayer(); + return new LocalRadioPlayer(); } -exports.createRadio = createRadio; - -},{"./RadioPlayer":1,"./iHeart":4}]},{},[5])(5) -}); - -//# sourceMappingURL=jibo-radio.js.map +module.exports = createRadio; diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/606C56A5-E96E-4D44-9456-A0A238554311.png b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/606C56A5-E96E-4D44-9456-A0A238554311.png new file mode 100644 index 00000000..ce7aceb9 Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/606C56A5-E96E-4D44-9456-A0A238554311.png differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/606C56A5-E96E-4D44-9456-A0A238554311.png~ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/606C56A5-E96E-4D44-9456-A0A238554311.png~ new file mode 100644 index 00000000..5c3247ff Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/606C56A5-E96E-4D44-9456-A0A238554311.png~ differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/ABD9DD9A-43C8-49C3-9A50-2B0E4F24B37F.png b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/ABD9DD9A-43C8-49C3-9A50-2B0E4F24B37F.png new file mode 100644 index 00000000..d4f6d949 Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/ABD9DD9A-43C8-49C3-9A50-2B0E4F24B37F.png differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/ABD9DD9A-43C8-49C3-9A50-2B0E4F24B37F.png~ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/ABD9DD9A-43C8-49C3-9A50-2B0E4F24B37F.png~ new file mode 100644 index 00000000..f0df23f3 Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/ABD9DD9A-43C8-49C3-9A50-2B0E4F24B37F.png~ differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.kra b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.kra new file mode 100644 index 00000000..e693c6e5 Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.kra differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.png b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.png index 5e79a723..efa28b2a 100644 Binary files a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.png and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.png differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.png~ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.png~ index 0d690359..5e79a723 100644 Binary files a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.png~ and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/JiboSplash.png~ differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/jibo_logo.png b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/jibo_logo.png new file mode 100644 index 00000000..ac68b426 Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/jibo_logo.png differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/jibo_logo.png~ b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/jibo_logo.png~ new file mode 100644 index 00000000..0243ffc7 Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/jibo_logo.png~ differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/jibo_logo1.png b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/jibo_logo1.png new file mode 100644 index 00000000..14dc1476 Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/@be/be/resources/jibo_logo1.png differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/menu-entries.d/.10-test.json.kate-swp b/V3.1/build/opt/jibo/Jibo/Skills/@be/menu-entries.d/.10-test.json.kate-swp new file mode 100644 index 00000000..7590021f Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/@be/menu-entries.d/.10-test.json.kate-swp differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/menu-entries.d/00-example.json b/V3.1/build/opt/jibo/Jibo/Skills/@be/menu-entries.d/00-example.json new file mode 100644 index 00000000..2cdad05b --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/menu-entries.d/00-example.json @@ -0,0 +1,13 @@ +[ + { + "id": "__example__", + "type": "submenu", + "title": "Example (Entry Dir)", + "submenuTitle": "Example Submenu", + "icon": "resources/icons/settings.png", + "color": "teal", + "description": "Example submenu from @be/menu-entries.d (scans childrenDir for menuEntry.json)", + "order": 5, + "childrenDir": "TestSubMenuA" + } +] diff --git a/V3.1/build/opt/jibo/Jibo/Skills/@be/menu-entries.d/10-test.json b/V3.1/build/opt/jibo/Jibo/Skills/@be/menu-entries.d/10-test.json new file mode 100644 index 00000000..aa4c10d5 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/@be/menu-entries.d/10-test.json @@ -0,0 +1,12 @@ +[ + { + "id": "__submenu_test__", + "type": "submenu", + "title": "Test Folder", + "submenuTitle": "Test Submenu", + "icon": "resources/icons/fun-stuff.png", + "color": "purple", + "order": 1, + "childrenDir": "FunStuffTest" + } +] diff --git a/V3.1/build/opt/jibo/Jibo/Skills/FunStuffTest/ClockOne/menuEntry.json b/V3.1/build/opt/jibo/Jibo/Skills/FunStuffTest/ClockOne/menuEntry.json new file mode 100644 index 00000000..398d2446 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/FunStuffTest/ClockOne/menuEntry.json @@ -0,0 +1,8 @@ +{ + "type": "skill", + "title": "Clock One (launch jibo-tbd)", + "icon": "resources/icons/clock.png", + "color": "blue", + "order": 20, + "skillId": "jibo-tbd" +} diff --git a/V3.1/build/opt/jibo/Jibo/Skills/FunStuffTest/FunOne/menuEntry.json b/V3.1/build/opt/jibo/Jibo/Skills/FunStuffTest/FunOne/menuEntry.json new file mode 100644 index 00000000..342db2fd --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/FunStuffTest/FunOne/menuEntry.json @@ -0,0 +1,8 @@ +{ + "type": "skill", + "title": "Fun One (launch jibo-tbd)", + "icon": "resources/icons/fun-stuff.png", + "color": "orange", + "order": 10, + "skillId": "jibo-tbd" +} diff --git a/V3.1/build/opt/jibo/Jibo/Skills/FunStuffTest/menuEntry.json b/V3.1/build/opt/jibo/Jibo/Skills/FunStuffTest/menuEntry.json new file mode 100644 index 00000000..51647f55 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/FunStuffTest/menuEntry.json @@ -0,0 +1,4 @@ +{ + "hidden": true, + "title": "FunStuffTest Root" +} diff --git a/V3.1/build/opt/jibo/Jibo/Skills/LOGGING.md b/V3.1/build/opt/jibo/Jibo/Skills/LOGGING.md new file mode 100644 index 00000000..d3fa4573 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/LOGGING.md @@ -0,0 +1,84 @@ +# Skills logging (robot) + +This modded version of the JiboOS includes a tiny “always works” logging stack for the robot’s old BusyBox + Python 2.7 environment: + +- **UDP log daemon**: receives log messages and appends to a file +- **Web log panel**: lets you watch the same logfile live in a browser +- **Node helper**: a tiny client so JS skills can log without pain + +Default logfile: +- `/tmp/jibo-skills.log` + +Default ports: +- log daemon UDP: `15140` +- web panel HTTP: `15150` + +## 1) Start services on the robot - if you used the installer they should be enabled automatically + +### Log daemon (required) +Init.d: +- `/etc/init.d/jibo-skills-logd start` +- `/etc/init.d/jibo-skills-logd status` + +### Web panel (optional) +Init.d: +- `/etc/init.d/jibo-skills-logpanel start` +- `/etc/init.d/jibo-skills-logpanel status` + +Open in a browser: +- `http://:15150/` + +## 2) Send logs from programs + +### Node.js (skills) +Use the helper: + +- `const rlog = require('/opt/jibo/Jibo/Skills/@be/be/be/robot-logger');` + +API: +- `rlog.info(tag, msg, data)` +- `rlog.warn(tag, msg, data)` +- `rlog.error(tag, msg, data)` +- `rlog.debug(tag, msg, data)` +- `rlog.raw(line)` (sends a plain text line) + +Examples: +- `rlog.info('menu', 'opened main menu')` +- `rlog.error('radio', 'failed to tune', { station: freq, err: String(e) })` + +One-liner test: +- `node -e "require('/opt/jibo/Jibo/Skills/@be/be/be/robot-logger').info('node-test','hello testajhdgjhasgjd',{x:1})"` + +### Python 2.7 +Send a JSON log packet via UDP: +- could be broken atm idk +- `python -c 'import socket, time; s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM); s.sendto("{\\\"tag\\\":\\\"py-test\\\",\\\"level\\\":\\\"info\\\",\\\"msg\\\":\\\"hello\\\",\\\"data\\\":{\\\"t\\\":%d}}"%int(time.time()),("127.0.0.1",15140))'` + +### Shell +This bypasses UDP and just appends to the logfile (still useful to verify the panel is tailing): + +- `echo "RAW $(date) hello" >> /tmp/jibo-skills.log` + +## 3) View logs + +- `tail -f /tmp/jibo-skills.log` + +## 4) Configuration (env vars) + +Log daemon: +- `JIBO_LOGD_HOST` (default `127.0.0.1`) +- `JIBO_LOGD_PORT` (default `15140`) +- `JIBO_LOGD_FILE` (default `/tmp/jibo-skills.log`) + +Web panel: +- `JIBO_LOGPANEL_BIND` (default `0.0.0.0`) +- `JIBO_LOGPANEL_PORT` (default `15150`) + +Node client: +- `JIBO_LOGD_HOST` / `JIBO_LOGD_PORT` + +## Notes + +- If the web panel shows `(polling)`, thats ok it means the browser doesn’t support SSE and it’s using `/tail` polling instead. +- If the panel is blank, confirm `/tail` works: + - `wget -qO- "http://127.0.0.1:15150/tail?pos=0&max=5000"` diff --git a/V3.1/build/opt/jibo/Jibo/Skills/MODULARITY_PLAN.md b/V3.1/build/opt/jibo/Jibo/Skills/MODULARITY_PLAN.md new file mode 100644 index 00000000..48947e46 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/MODULARITY_PLAN.md @@ -0,0 +1,80 @@ +# Modularity ground-work (Skills FS) + +Target: make the main menu + skill launching as modular as possible while staying compatible with the existing precompiled BE bundle. + +## What you have today (important choke points) + +### 1) BE is a big precompiled bundle +- The BE “brain” is shipped as [@be/be/index.js](@be/be/index.js) (UMD/browserify bundle). +- A number of runtime steps are already split into editable modules under [@be/be/be/](@be/be/be/): + - [@be/be/be/postinit.js](@be/be/be/postinit.js) is especially valuable because it runs after init and is easy to patch. + +### 2) Menu is already semi-modular (via patch) +- The menu injection is wired in here: [@be/be/be/postinit.js](@be/be/be/postinit.js) +- The injection logic is here: [@be/be/menu/main-menu-patch.js](@be/be/menu/main-menu-patch.js) +- There are two alternate menu implementations that aren’t currently the default path: + - [@be/be/menu/skills-scanner.js](@be/be/menu/skills-scanner.js) + - [@be/be/menu/menu-manager.js](@be/be/menu/menu-manager.js) + +### 3) Hard limit: “menu entry exists” ≠ “skill is loadable” +- BE loads skills listed in [@be/be/package.json](@be/be/package.json) → `jibo.skills[]`. +- So the current menu patch can *show* buttons for new skills, but launching them will fail unless BE can actually load them. + +## What “max modular menu” realistically means + +You can make the **menu definition** fully modular without touching the BE bundle. Making **skill loading** fully modular is harder because the bundle pre-bakes skill modules. + +## Step-by-step path (least risky first) + +### Phase A — Make menu config fully modular (low risk) +1. **Single source of truth for scanning** + - Stop duplicating scanner logic between `main-menu-patch.js` and `skills-scanner.js`. + - Export a stable `scanSkills(rootDir, options)` function that returns the exact menu schema expected by the main-menu skill. + +2. **Make Skills root configurable** + - Replace hard-coded `/opt/jibo/Jibo/Skills` with: + - env var `JIBO_SKILLS_ROOT`, else + - fallback `/opt/jibo/Jibo/Skills`. + +3. **Allow multiple menu providers (plugin style)** + - Add an entries directory, e.g. `/opt/jibo/Jibo/Skills/@be/menu-entries.d/`. + - Providers can be: + - `.js` files that export `getEntries()` + - `.json` static entries + - Patch merges provider entries + scanned `menuEntry.json` entries. + +4. **Move icon/color policy into config** + - Keep defaults, but load overrides from a JSON config file (ex: `@be/be/menu/menu-config.json`). + +### Phase B — Add Python-friendly menu generation (low/medium risk) +1. Implement a “generated menu file” contract: + - Python script writes a JSON file, e.g. `/tmp/jibo-menu.generated.json`. + - Menu patch reads it (if present) and merges into the menu. +2. This lets you write menu logic in Python 2.7 without fighting JS runtime quirks. + +### Phase C — Make skill launching modular (hard) +This is the real blocker for “true modularity”. Options: + +1. **Soft approach** (menu remains modular; launching only works for known skills) + - Accept that new entries are “shortcuts” to existing/registered skills. + +2. **Medium approach** (dynamic skill registry) + - Maintain a small registry mapping `skillId -> folder path` by scanning `/opt/jibo/Jibo/Skills`. + - On launch, route through a single “launcher” skill (registered in BE) that loads content/assets from disk. + +3. **Hard approach** (replace BE bundle / build chain) + - Rebuild BE so skills are not baked into the browserify bundle. + - This is the cleanest long-term solution but requires toolchain alignment and more invasive changes. + +## Logging groundwork (so you can debug all of the above) + +To make JS/Python logging painless on a BusyBox robot, the repo now includes a tiny UDP log daemon + init.d template: + +- tools/robot/logd/jibo_logd.py +- tools/robot/init.d/jibo-skills-logd + +This gives you a single log file you can tail on robot (default `/tmp/jibo-skills.log`) and a trivial Node client under: + +- @be/be/be/robot-logger.js + +Next step is to switch noisy modules (menu patch, loaders) to send logs to the daemon. diff --git a/V3.1/build/opt/jibo/Jibo/Skills/TestSubMenuA/menuEntry.json b/V3.1/build/opt/jibo/Jibo/Skills/TestSubMenuA/menuEntry.json deleted file mode 100644 index 0fa93acc..00000000 --- a/V3.1/build/opt/jibo/Jibo/Skills/TestSubMenuA/menuEntry.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "submenu", - "title": "Test Submenu", - "submenuTitle": "Test Skills", - "icon": "resources/icons/fun-stuff.png", - "color": "purple", - "description": "A submenu containing additional test skills", - "order": 20 -} \ No newline at end of file diff --git a/V3.1/build/opt/jibo/Jibo/Skills/TestSubMenuA/testSkillB/menuEntry.json b/V3.1/build/opt/jibo/Jibo/Skills/TestSubMenuA/testSkillB/menuEntry.json deleted file mode 100644 index bd54eacd..00000000 --- a/V3.1/build/opt/jibo/Jibo/Skills/TestSubMenuA/testSkillB/menuEntry.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "skill", - "title": "Test Skill B", - "icon": "resources/icons/surprise.png", - "color": "green", - "skillId": "testSkillB", - "description": "A skill inside a submenu", - "order": 1 -} \ No newline at end of file diff --git a/V3.1/build/opt/jibo/Jibo/Skills/jibo-tbd/LocalRadioPlayer.js b/V3.1/build/opt/jibo/Jibo/Skills/jibo-tbd/LocalRadioPlayer.js new file mode 100644 index 00000000..a4fffd0a --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/jibo-tbd/LocalRadioPlayer.js @@ -0,0 +1,61 @@ +const EventEmitter = require('events'); + +class LocalRadioPlayer extends EventEmitter { + constructor() { + super(); + this._stations = { + 'Rock': 'http://localhost:8000/rock', + 'Pop': 'http://localhost:8000/pop', + 'Jazz': 'http://localhost:8000/jazz', + 'Classical': 'http://localhost:8000/classical', + 'Electronic': 'http://localhost:8000/electronic', + 'Hip-Hop': 'http://localhost:8000/hiphop' + }; + this._audio = null; + } + + getStations(options) { + return Promise.resolve(Object.keys(this._stations).map(genre => ({ + name: genre, + id: genre + }))); + } + + play(stationData) { + if (this._audio) { + this._audio.pause(); + } + const streamUrl = this._stations[stationData.id]; + if (!streamUrl) { + this.emit('error', new Error(`Station ${stationData.id} not found.`)); + return; + } + + this._audio = new Audio(streamUrl); + this._audio.play() + .then(() => { + this.emit('song-data', { + title: `Streaming ${stationData.id}`, + artist: 'Local Radio', + albumArt: '' + }); + }) + .catch(err => { + this.emit('error', err); + }); + } + + stop() { + if (this._audio) { + this._audio.pause(); + this._audio = null; + } + } + + resizeArtwork(options) { + // Not applicable for local streaming without metadata + return Promise.resolve(''); + } +} + +module.exports = LocalRadioPlayer; diff --git a/V3.1/build/opt/jibo/Jibo/Skills/jibo-tbd/index.js b/V3.1/build/opt/jibo/Jibo/Skills/jibo-tbd/index.js index e2d4b8f4..cc2301a1 100644 --- a/V3.1/build/opt/jibo/Jibo/Skills/jibo-tbd/index.js +++ b/V3.1/build/opt/jibo/Jibo/Skills/jibo-tbd/index.js @@ -1,2 +1,11 @@ -let thisPackage = require('./package.json'); -module.exports = thisPackage.version; +const LocalRadioPlayer = require('./LocalRadioPlayer'); + +/** + * @returns {RadioPlayer} + * + * i tried to make the radio work as well, coldnt get it to work :( + */ +module.exports = function createRadio() { + return new LocalRadioPlayer(); +}; + diff --git a/V3.1/build/opt/jibo/Jibo/Skills/testSkillA/menuEntry.json b/V3.1/build/opt/jibo/Jibo/Skills/testSkillA/menuEntry.json deleted file mode 100644 index 1dfeeda1..00000000 --- a/V3.1/build/opt/jibo/Jibo/Skills/testSkillA/menuEntry.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "skill", - "title": "Test Skill A", - "icon": "resources/icons/settings.png", - "color": "blue", - "skillId": "testSkillA", - "description": "A test skill to demonstrate menu integration", - "order": 10 -} diff --git a/V3.1/build/opt/jibo/Jibo/Skills/testSkillC/menuEntry.json b/V3.1/build/opt/jibo/Jibo/Skills/testSkillC/menuEntry.json deleted file mode 100644 index a0041606..00000000 --- a/V3.1/build/opt/jibo/Jibo/Skills/testSkillC/menuEntry.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "skill", - "title": "AAAAAAAAA", - "icon": "resources/icons/gallery.png", - "color": "blue", - "skillId": "testSkillA", - "description": "A test skill to demonstrate menu integration", - "order": 11 - -} diff --git a/V3.1/build/opt/jibo/Jibo/Skills/tomove.md b/V3.1/build/opt/jibo/Jibo/Skills/tomove.md new file mode 100644 index 00000000..bc56a94a --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/tomove.md @@ -0,0 +1,5 @@ +^BG +/tools/robot/init.d/ -> /etc/init.d/ +/tools/robot/logd/ -> /opt/jibo/Jibo/Skills/tools/robot/logd/ +/tools/robot/logpanel/ -> /opt/jibo/Jibo/Skills/tools/robot/logpanel/ +^ND diff --git a/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logd/README.md b/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logd/README.md new file mode 100644 index 00000000..f93fc5d0 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logd/README.md @@ -0,0 +1,55 @@ +# jibo-skills-logd + +A tiny UDP logging daemon intended for **very old BusyBox + Python 2.7** robot environments. + +## What it gives you + +- A single place where all your scripts can log (JS, Python, shell) +- A single file you can `tail -f` on robot +- Minimal moving parts (no external deps) + +## Files + +- `tools/robot/logd/jibo_logd.py` — Python daemon (UDP → append to file) +- `tools/robot/init.d/jibo-skills-logd` — init.d service template + +## Quick test (on robot) + +Start the daemon in foreground: + +- `python /opt/jibo/Jibo/Skills/tools/robot/logd/jibo_logd.py --host 127.0.0.1 --port 15140 --logfile /tmp/jibo-skills.log` + +Send a message: + +- `echo '{"tag":"test","level":"info","msg":"hello"}' | nc -u -w1 127.0.0.1 15140` + +View: + +- `tail -f /tmp/jibo-skills.log` + +## Using from Node + +In your skill code: + +- `const rlog = require('@be/be/be/robot-logger');` +- `rlog.info('menu', 'injected entries', {count: 12});` + +Env vars (optional): + +- `JIBO_LOGD_HOST` (default `127.0.0.1`) +- `JIBO_LOGD_PORT` (default `15140`) + +## Live web panel (optional) + +There is also a tiny HTTP panel that streams the same logfile in real time (SSE). + +- Script: `tools/robot/logpanel/jibo_logpanel.py` +- Init script: `/init.d/jibo-skills-logpanel` + +Run (foreground): + +- `python /opt/jibo/Jibo/Skills/tools/robot/logpanel/jibo_logpanel.py --bind 0.0.0.0 --port 15150 --logfile /tmp/jibo-skills.log` + +Open in a browser: + +- `http://:15150/` diff --git a/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logd/jibo_logd.py b/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logd/jibo_logd.py new file mode 100644 index 00000000..4e1121c1 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logd/jibo_logd.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""jibo_logd.py + +Tiny logging daemon for old BusyBox environments. +- Python 2.7 compatible +- Listens on UDP (default 127.0.0.1:15140) +- Appends newline-delimited logs to a file (default /tmp/jibo-skills.log) +- Optional daemonize + pidfile + +Protocol: +- UDP payload may be plain text (written as-is) +- OR JSON object with optional fields: tag, level, msg, data + +Examples: + echo '{"tag":"menu","level":"info","msg":"hello"}' | nc -u -w1 127.0.0.1 15140 +""" + +from __future__ import print_function + +import argparse +import datetime +import errno +import json +import os +import signal +import socket +import sys +import time + +DEFAULT_HOST = '127.0.0.1' +DEFAULT_PORT = 15140 +DEFAULT_LOGFILE = '/tmp/jibo-skills.log' +DEFAULT_MAX_BYTES = 2 * 1024 * 1024 +DEFAULT_BACKUPS = 3 + + +class Logd(object): + def __init__(self, host, port, logfile, max_bytes, backups, flush_every): + self.host = host + self.port = port + self.logfile = logfile + self.max_bytes = max_bytes + self.backups = backups + self.flush_every = flush_every + + self._sock = None + self._stop = False + self._line_count = 0 + + def stop(self, *_args): + self._stop = True + + def _ensure_parent_dir(self): + parent = os.path.dirname(self.logfile) + if parent and not os.path.isdir(parent): + try: + os.makedirs(parent) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + def _rotate_if_needed(self): + if self.max_bytes <= 0: + return + try: + st = os.stat(self.logfile) + except OSError: + return + if st.st_size < self.max_bytes: + return + + # Rotate: logfile -> logfile.1 -> logfile.2 ... + for i in range(self.backups, 0, -1): + src = self.logfile + ('' if i == 0 else '.%d' % i) + dst = self.logfile + '.%d' % (i + 1) + if i == self.backups: + # drop oldest + try: + os.unlink(self.logfile + '.%d' % (i + 1)) + except OSError: + pass + try: + if os.path.exists(src): + os.rename(src, dst) + except OSError: + pass + + try: + os.rename(self.logfile, self.logfile + '.1') + except OSError: + pass + + def _format_line(self, payload, addr): + ts = datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%fZ') + src = '%s:%s' % (addr[0], addr[1]) + + txt = payload.strip() + if not txt: + return None + + if txt.startswith('{') and txt.endswith('}'): + try: + obj = json.loads(txt) + tag = obj.get('tag', 'skill') + level = obj.get('level', 'info') + msg = obj.get('msg', '') + data = obj.get('data', None) + if data is not None: + try: + data_txt = json.dumps(data, separators=(',', ':'), sort_keys=True) + except Exception: + data_txt = repr(data) + return '%s [%s] %s %s %s\n' % (ts, level, tag, msg, data_txt) + return '%s [%s] %s %s\n' % (ts, level, tag, msg) + except Exception: + # fall back to raw + pass + + return '%s [info] raw %s %s\n' % (ts, src, txt) + + def serve_forever(self): + self._ensure_parent_dir() + + self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + self._sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + self._sock.bind((self.host, self.port)) + self._sock.settimeout(0.5) + + f = None + try: + f = open(self.logfile, 'a') + while not self._stop: + try: + data, addr = self._sock.recvfrom(65535) + except socket.timeout: + continue + except socket.error: + continue + + try: + if isinstance(data, bytes): + try: + payload = data.decode('utf-8', 'replace') + except Exception: + payload = str(data) + else: + payload = str(data) + except Exception: + continue + + line = self._format_line(payload, addr) + if not line: + continue + + self._rotate_if_needed() + try: + f.write(line) + self._line_count += 1 + if self.flush_every > 0 and (self._line_count % self.flush_every) == 0: + try: + f.flush() + os.fsync(f.fileno()) + except Exception: + pass + except Exception: + # best effort: reopen file if it moved/rotated + try: + f.close() + except Exception: + pass + try: + f = open(self.logfile, 'a') + except Exception: + time.sleep(0.25) + finally: + try: + if f: + f.flush() + f.close() + except Exception: + pass + try: + if self._sock: + self._sock.close() + except Exception: + pass + + +def daemonize(pidfile): + # Double-fork daemonize (POSIX) + try: + pid = os.fork() + if pid > 0: + os._exit(0) + except OSError: + raise + + os.setsid() + + try: + pid = os.fork() + if pid > 0: + os._exit(0) + except OSError: + raise + + # Redirect stdio + sys.stdout.flush() + sys.stderr.flush() + si = open('/dev/null', 'r') + so = open('/dev/null', 'a+') + se = open('/dev/null', 'a+') + os.dup2(si.fileno(), sys.stdin.fileno()) + os.dup2(so.fileno(), sys.stdout.fileno()) + os.dup2(se.fileno(), sys.stderr.fileno()) + + if pidfile: + try: + with open(pidfile, 'w') as pf: + pf.write(str(os.getpid())) + except Exception: + pass + + +def main(argv): + ap = argparse.ArgumentParser(description='Jibo Skills UDP log daemon') + ap.add_argument('--host', default=os.environ.get('JIBO_LOGD_HOST', DEFAULT_HOST)) + ap.add_argument('--port', type=int, default=int(os.environ.get('JIBO_LOGD_PORT', str(DEFAULT_PORT)))) + ap.add_argument('--logfile', default=os.environ.get('JIBO_LOGD_FILE', DEFAULT_LOGFILE)) + ap.add_argument('--max-bytes', type=int, default=int(os.environ.get('JIBO_LOGD_MAX_BYTES', str(DEFAULT_MAX_BYTES)))) + ap.add_argument('--backups', type=int, default=int(os.environ.get('JIBO_LOGD_BACKUPS', str(DEFAULT_BACKUPS)))) + ap.add_argument('--flush-every', type=int, default=int(os.environ.get('JIBO_LOGD_FLUSH_EVERY', '1'))) + ap.add_argument('--daemonize', action='store_true') + ap.add_argument('--pidfile', default=os.environ.get('JIBO_LOGD_PIDFILE', '/tmp/jibo-skills-logd.pid')) + + args = ap.parse_args(argv) + + logd = Logd(args.host, args.port, args.logfile, args.max_bytes, args.backups, args.flush_every) + + signal.signal(signal.SIGTERM, logd.stop) + signal.signal(signal.SIGINT, logd.stop) + + if args.daemonize: + daemonize(args.pidfile) + + logd.serve_forever() + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logpanel/__pycache__/jibo_logpanel.cpython-313.pyc b/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logpanel/__pycache__/jibo_logpanel.cpython-313.pyc new file mode 100644 index 00000000..0af4d9e0 Binary files /dev/null and b/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logpanel/__pycache__/jibo_logpanel.cpython-313.pyc differ diff --git a/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logpanel/jibo_logpanel.py b/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logpanel/jibo_logpanel.py new file mode 100644 index 00000000..95147004 --- /dev/null +++ b/V3.1/build/opt/jibo/Jibo/Skills/tools/robot/logpanel/jibo_logpanel.py @@ -0,0 +1,503 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""jibo_logpanel.py + +Minimal HTTP log panel for old BusyBox + Python 2.7 environments. + +- Serves a tiny HTML page at `/` +- Streams log lines via Server-Sent Events (SSE) at `/events` +- Tails a logfile (default: /tmp/jibo-skills.log) + +This is intentionally dependency-free (stdlib only). +""" + +from __future__ import print_function + +import argparse +import os +import sys +import time + +try: + import json # stdlib +except Exception: + json = None + +try: + import urlparse # Py2 +except ImportError: + from urllib import parse as urlparse # Py3 + +try: + from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +except ImportError: + # Py3 fallback (dev hosts) + from http.server import HTTPServer, BaseHTTPRequestHandler + +try: + from SocketServer import ThreadingMixIn +except ImportError: + from socketserver import ThreadingMixIn + + +INDEX_HTML = """ + + + + + Jibo Skills Logs + + + +
+
Jibo Skills Logs (connecting)
+
+ + + + +
+
+
+ + + + +""" + + +def _tail_last_lines(path, max_lines): + if max_lines <= 0: + return [] + + try: + f = open(path, 'rb') + except Exception: + return [] + + try: + # naive but safe: read entire file if small, else chunk backwards + try: + size = os.path.getsize(path) + except Exception: + size = 0 + + if size <= 0: + return [] + + # read up to ~256KB from end + read_size = min(size, 256 * 1024) + f.seek(-read_size, os.SEEK_END) + data = f.read(read_size) + + try: + txt = data.decode('utf-8', 'replace') + except Exception: + try: + txt = data.decode('latin-1', 'replace') + except Exception: + txt = str(data) + + lines = txt.splitlines() + if len(lines) > max_lines: + lines = lines[-max_lines:] + return lines + finally: + try: + f.close() + except Exception: + pass + + +class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): + daemon_threads = True + + +class Handler(BaseHTTPRequestHandler): + server_version = "JiboLogPanel/0.1" + # Use HTTP/1.0 semantics to avoid needing chunked encoding. + protocol_version = "HTTP/1.0" + + try: + _text_type = unicode # Py2 + except NameError: + _text_type = str # Py3 + + def _send(self, code, content_type, body): + if isinstance(body, self._text_type): + body = body.encode('utf-8') + self.send_response(code) + self.send_header('Content-Type', content_type) + self.send_header('Content-Length', str(len(body))) + self.send_header('Cache-Control', 'no-cache') + self.end_headers() + self.wfile.write(body) + + def do_GET(self): + parsed = urlparse.urlparse(self.path) + path = parsed.path + qs = urlparse.parse_qs(parsed.query) + + if path == '/' or path == '/index.html': + return self._send(200, 'text/html; charset=utf-8', INDEX_HTML) + + if path == '/health': + return self._send(200, 'text/plain; charset=utf-8', 'ok') + + if path == '/events': + return self._handle_events(qs) + + if path == '/tail': + return self._handle_tail(qs) + + return self._send(404, 'text/plain; charset=utf-8', 'not found') + + def _handle_tail(self, qs): + logfile = getattr(self.server, 'logfile', '/tmp/jibo-skills.log') + try: + pos = int((qs.get('pos') or ['0'])[0]) + except Exception: + pos = 0 + try: + max_bytes = int((qs.get('max') or ['8192'])[0]) + except Exception: + max_bytes = 8192 + if max_bytes <= 0: + max_bytes = 8192 + if max_bytes > 65536: + max_bytes = 65536 + + out = { 'pos': 0, 'lines': [] } + + try: + st = os.stat(logfile) + size = st.st_size + if pos < 0 or pos > size: + pos = 0 + with open(logfile, 'rb') as f: + f.seek(pos) + data = f.read(max_bytes) + new_pos = f.tell() + except Exception: + out['pos'] = 0 + out['lines'] = [] + body = json.dumps(out) if json else '{"pos":0,"lines":[]}' + return self._send(200, 'application/json; charset=utf-8', body) + + try: + try: + txt = data.decode('utf-8', 'replace') + except Exception: + txt = data.decode('latin-1', 'replace') + # splitlines() drops trailing newline; that's fine for display + lines = txt.replace('\r', '').splitlines() + except Exception: + lines = [] + + out['pos'] = new_pos + out['lines'] = lines + body = json.dumps(out) if json else '{"pos":%d,"lines":[]}' % new_pos + return self._send(200, 'application/json; charset=utf-8', body) + + def _handle_events(self, qs): + logfile = getattr(self.server, 'logfile', '/tmp/jibo-skills.log') + try: + lines = int((qs.get('lines') or ['0'])[0]) + except Exception: + lines = 0 + + self.send_response(200) + self.send_header('Content-Type', 'text/event-stream; charset=utf-8') + self.send_header('Cache-Control', 'no-cache') + self.send_header('X-Accel-Buffering', 'no') + self.send_header('Access-Control-Allow-Origin', '*') + self.send_header('Connection', 'keep-alive') + self.end_headers() + + # Ensure the connection stays open. + try: + self.close_connection = False + except Exception: + pass + + def _b(s): + try: + if isinstance(s, bytes): + return s + except Exception: + pass + try: + if isinstance(s, self._text_type): + return s.encode('utf-8') + except Exception: + pass + try: + return str(s).encode('utf-8') + except Exception: + return b'' + + def _write(data_bytes): + if not data_bytes: + return + try: + self.wfile.write(data_bytes) + try: + self.wfile.flush() + except Exception: + pass + except Exception: + raise + + # Advise client to retry quickly. + try: + _write(_b('retry: 1000\n\n')) + except Exception: + return + + # initial payload: last N lines + try: + for line in _tail_last_lines(logfile, lines): + _write(_b('data: ' + line.replace('\r', '') + '\n\n')) + except Exception: + pass + + # follow + f = None + + last_inode = None + try: + try: + st = os.stat(logfile) + last_inode = st.st_ino + except Exception: + last_inode = None + + last_ping = time.time() + + def _try_open_follow(): + try: + fh = open(logfile, 'rb') + fh.seek(0, os.SEEK_END) + return fh + except Exception: + return None + + f = _try_open_follow() + + while True: + # handle rotation: reopen if inode changes + try: + st2 = os.stat(logfile) + if last_inode is not None and st2.st_ino != last_inode: + try: + if f: + f.close() + except Exception: + pass + try: + f = open(logfile, 'rb') + f.seek(0, os.SEEK_END) + last_inode = st2.st_ino + except Exception: + f = None + except Exception: + pass + + if not f: + # keep-alive heartbeat even if file missing + now = time.time() + if now - last_ping >= 5.0: + last_ping = now + try: + _write(_b(': ping\n\n')) + except Exception: + break + time.sleep(0.5) + continue + + pos = f.tell() + chunk = f.readline() + if not chunk: + f.seek(pos) + now = time.time() + if now - last_ping >= 5.0: + last_ping = now + try: + _write(_b(': ping\n\n')) + except Exception: + break + time.sleep(0.25) + continue + + try: + try: + line = chunk.decode('utf-8', 'replace') + except Exception: + line = chunk.decode('latin-1', 'replace') + line = line.rstrip('\n').rstrip('\r') + _write(_b('data: ' + line + '\n\n')) + except Exception: + # client disconnected + break + finally: + try: + if f: + f.close() + except Exception: + pass + + def log_message(self, fmt, *args): + # keep quiet (panel should not spam stdout) + return + + +def main(argv): + ap = argparse.ArgumentParser(description='Jibo Skills Log Panel (SSE)') + ap.add_argument('--bind', default=os.environ.get('JIBO_LOGPANEL_BIND', '0.0.0.0')) + ap.add_argument('--port', type=int, default=int(os.environ.get('JIBO_LOGPANEL_PORT', '15150'))) + ap.add_argument('--logfile', default=os.environ.get('JIBO_LOGD_FILE', '/tmp/jibo-skills.log')) + + args = ap.parse_args(argv) + + httpd = ThreadedHTTPServer((args.bind, args.port), Handler) + httpd.logfile = args.logfile + + print('logpanel listening on %s:%d, logfile=%s' % (args.bind, args.port, args.logfile)) + try: + httpd.serve_forever() + except KeyboardInterrupt: + pass + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/V3.1/filesystem.parts b/V3.1/filesystem.parts deleted file mode 100644 index e69de29b..00000000 diff --git a/docs.tar.gz b/docs.tar.gz deleted file mode 100644 index 7179bcd2..00000000 Binary files a/docs.tar.gz and /dev/null differ diff --git a/docs/Runtime.js b/docs/Runtime.js deleted file mode 100644 index 111adc8b..00000000 --- a/docs/Runtime.js +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Enum of RunMode types. - * - * ``` - * jibo.RunMode.SIMULATOR - * ``` - * - * @typedef module:jibo.Runtime#RunMode - * @prop {string} SIMULATOR Running in the simulator. - * @prop {string} REMOTELY Running in remote mode. - * @prop {string} ON_ROBOT Running on the robot. - * @prop {string} UNIT_TESTS Running in dev mode, no SSM. - */ - - /** Running in the simulator. */ - - /** Running in remote mode. */ - - /** Running on the robot. */ - - /** Running in dev mode, no SSM */ - -/** - * Internal object for an installed plugin - */ - -/** - * @prop {jibo.animdb} animdb The Jibo Animation Database. - * @prop {jibo.bt} bt SDK behaviors and decorators. - * @prop {jibo.context} context Context Service (on robot context provider for Cloud). - * @prop {jibo.embodied} embodied Jibo Embodied Dialog. - * @prop {jibo.emotion} emotion Jibo Emotion System. - * @prop {jibo.expression} expression Jibo's expression client. - * @prop {jibo.face} face API to jibo's face. - * @prop {jibo.flow} flow API for the Jibo Flow Editor. - * @prop {jibo.globalEvents} globalEvents Typed global events for events module. - * @prop {jibo.kb} kb Knowledge Base API - * @prop {jibo.loader} loader Load skill assets. - * @prop {jibo.lps} lps Jibo's Local Perceptual Space. - * @prop {jibo.media} media Jibo's Media API (camera and pictures). - * @prop {jibo.mim} mim Jibo's multimodal interaction manager. - * @prop {jibo.sound} sound Manage playback of audio media. - * @prop {jibo.system} system Non-motion related body services. - * @prop {jibo.timer} timer Jibo's main update loop. - * @prop {jibo.tts} tts Text-to-speech. - * @prop {jibo.utils} utils Utility methods for animation, audio, and pathing. - * @prop {jibo.versions} versions Versions for skills-service-manager, platform, and jibo. - * @module jibo - * @description The Jibo SDK singleton. - */ - - /** - * `true` if Jibo is currently being initialized. - * @name module:jibo.Runtime.isInitializing - * @type {Boolean} - * @readOnly - * @default false - */ - - /** - * `true` if Jibo has finished being initialized. - * @name module:jibo.Runtime.isInitialized - * @type {Boolean} - * @readOnly - * @default false - */ - - /** - * Runtime is running in Electron-based environment. - * @name module:jibo.Runtime.electron - * @type {Boolean} - * @readOnly - */ - - /** - * Collection of installed plugins. - * @name module:jibo.Runtime._plugins - * @type {Boolean} - * @readOnly - * @private - */ - - /** - * Singleton instance of jibo. - * @name module:jibo.Runtime._instance - * @type {jibo.Runtime} - * @readOnly - * @private - */ - - /** - * Current version of the Jibo Runtime. - * @name module:jibo.Runtime#version - * @type {String} - * @readOnly - */ - - /** - * Electron IPCRenderer context of the Jibo Runtime. - * @name module:jibo.Runtime#electronContext - * @type {Object} - * @readOnly - */ - - /** For the SDK tool */ - - /** - * @name module:jibo.Runtime#behaviorEmitter - * @type {BehaviorEmitter} - * @private - */ - - /** - * @name module:jibo.Runtime#session - * @type {SessionManager} - * @private - */ - - /** - * @name module:jibo.Runtime#systemManager - * @type {SystemManager} - * @private - */ - - /** - // * @name module:jibo.Runtime#visualize - // * @type {Object} - // * @private - // */ - - /** - * Initialization options - * @name module:jibo.Runtime#options - * @type {Object} - * @private - */ - - /** - * @description - * Initializes the jibo SDK. - * - * ``` - * let jibo = require('jibo'); - * jibo.init('face', (e) => { - * if (e) return console.error(e); - * // Setup! - * }); - * ``` - * @method module:jibo.Runtime#init - * @param {Object|Function|String|HTMLElement} [options] Either the options, canvas DOM ID or DOM Element for canvas or callback - * @param {DOMElement|String} [options.display] Either the canvas DOM or DOM ID - * @param {Function} [callback] Called when the SDK is finished initializing. - */ - - /** - * Register an external plugin with the jibo runtime. - * @method module:jibo.Runtime#registerPlugin - * @private - * @param {jibo.PluginConstructor} pluginClass The class definition. - * @param {String} id The identifier of the plugin. - * @param {Object} [options] Additional register options or the API name. - * @param {Boolean} [options.api=false] If the plugin is also an API on jibo. - * @param {String[]} [options.depends] The plugin dependencies. - * @param {Boolean} [options.electron=false] If the plugin is electron-only. - */ - - /** - * Stores which mode the current skill is running. It can be: `jibo.RunMode.SIMULATOR`, `jibo.RunMode.REMOTELY`, or `jibo.RunMode.ON_ROBOT`. - * - * ``` - * let jibo = require('jibo'); - * if( jibo.runMode === jibo.RunMode.SIMULATOR ){ - * // ... - * } - * ``` - * @name module:jibo.Runtime.runMode - * @type {RunMode} - * @readOnly - */ - - /** - * Setup plugins to create the jibo API. - * @method module:jibo.Runtime#_installPlugins - * @private - */ - - /** - * Setup plugins to create the jibo API. - * @method module:jibo.Runtime#_initPlugins - * @private - */ - - /** - * Gets singleton instance of Jibo. - * @name module:jibo.Runtime.instance - * @type {jibo} - * @private - * @readOnly - */ \ No newline at end of file diff --git a/docs/bt/BaseElement.js b/docs/bt/BaseElement.js deleted file mode 100644 index b5740e11..00000000 --- a/docs/bt/BaseElement.js +++ /dev/null @@ -1,135 +0,0 @@ -/** - * @class BaseElement - * @memberof jibo.bt - * @private - * @description Parent class for Behavior and Decorator. - * - * Subclasses: {@link jibo.bt.behaviors.Behavior|Behavior}, {@link jibo.bt.behaviors.ParentBehavior|ParentBehavior}, {@link jibo.bt.behaviors.Decorator|Decorator} - * - * @param {Object} [options] Options for the behavior - */ - - /** - * The list of options - * @name jibo.bt.Behavior#options - * @type {Object} - * @readOnly - */ - - /** - * The list of options - * @name jibo.bt.Decorator#options - * @type {Object} - * @readOnly - */ - - /** - * The current internal status of the element - * @name jibo.bt.BaseElement#_currentStatus - * @type {String} - * @private - */ - - /** - * Instance of the blackboard - * @name jibo.bt.Behavior#blackboard - * @type {jibo.bt.Blackboard} - * @readOnly - */ - - /** - * Instance of the blackboard - * @name jibo.bt.Decorator#blackboard - * @type {jibo.bt.Blackboard} - * @readOnly - */ - - /** - * Instance of the behavior emitter - * @name jibo.bt.Behavior#emitter - * @type {jibo.bt.BehaviorEmitter} - * @readOnly - */ - - /** - * Instance of the behavior emitter - * @name jibo.bt.Decorator#emitter - * @type {jibo.bt.BehaviorEmitter} - * @readOnly - */ - - /** - * Name of the asset pack - * @name jibo.bt.Behavior#assetPack - * @type {String} - * @readOnly - */ - - /** - * Name of the asset pack - * @name jibo.bt.Decorator#assetPack - * @type {String} - * @readOnly - */ - - /** - * Name of the behavior - * @name jibo.bt.Behavior#name - * @type {String} - * @readOnly - */ - - /** - * Name of the behavior - * @name jibo.bt.Decorator#name - * @type {String} - * @readOnly - */ - - /** - * Get the current status - * @name jibo.bt.Behavior#currentStatus - * @type {String} - * @readOnly - */ - - /** - * Get the current status - * @name jibo.bt.Decorator#currentStatus - * @type {String} - * @readOnly - */ - - /** - * Stops the behavior or decorator, must override - * @method jibo.bt.Behavior#stop - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - */ - - /** - * Stops the behavior or decorator, must override - * @method jibo.bt.Decorator#stop - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - */ - - /** - * Destroys the behavior, removes all references. - * @method jibo.bt.Behavior#destroy - */ - - /** - * Destroys the decorator, removes all references. - * @method jibo.bt.Decorator#destroy - */ - - /** - * Stops and Destroys the behavior or decorator - * @method jibo.bt.Behavior#stopAndDestroy - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - */ - - /** - * Stops and Destroys the behavior or decorator - * @method jibo.bt.Decorator#stopAndDestroy - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - */ \ No newline at end of file diff --git a/docs/bt/Behavior.js b/docs/bt/Behavior.js deleted file mode 100644 index d7a322f8..00000000 --- a/docs/bt/Behavior.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @class Behavior - * @memberof jibo.bt - * @description The baseclass to all behaviors. - * - * Subclasses: {@link jibo.bt.behaviors} - * @param {Object} [options] Options for the behavior - * @param {String} [options.name=''] Name of the behavior instance - * @param {Array} [options.decorators=[]] Decorators - * @param {jibo.bt.Blackboard} [options.blackboard=null] Blackboard instance - * @param {jibo.bt.BehaviorEmitter} [options.emitter=null] Emitter instance - * @param {String} [options.assetPack=''] Name of the asset pack - * @param {Object} [defaultOptions] Defaults for options - */ - - /** - * Reference to the composite parent behavior - * @name jibo.bt.Behavior#parent - * @type {jibo.bt.ParentBehavior} - * @readOnly - */ - - /** - * List of decorators to wait on start - * @name jibo.bt.Behavior#waitDecorators - * @type {Array} - * @private - */ - - /** - * Number of wait decorators - * @name jibo.bt.Behavior#waitDecoratorsLength - * @type {int} - * @private - */ - - /** - * Destroy this - */ - - /** - * Collection of decorators - * @name jibo.bt.Behavior#decorators - * @type {Array} - * @readOnly - */ - - /** - * Starts the behavior or decorator - * @method jibo.bt.Behavior#start - * @returns {Boolean} `true` if this element is started successfully. `false` otherwise. - */ - - /** - * Called every frame. Must be overridden in subclass. - * @method jibo.bt.Behavior#update - * @returns {jibo.bt.Status} The current status of this behavior. - */ - - /** - * Internal pause the behavior - * @method jibo.bt.Behavior#_pause - * @private - */ - - /** - * Internal unpause the behavior - * @method jibo.bt.Behavior#_unpause - * @private - */ - - /** - * Internal start the behavior - * @method jibo.bt.Behavior#_start - * @private - * @return {Boolean} Status result - */ - - /** - * Internal stop the behavior - * @method jibo.bt.Behavior#_stop - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - * @private - */ - - /** - * Internal update the behavior - * @method jibo.bt.Behavior#_update - * @private - * @return {jibo.bt.Status} Resulting status - */ \ No newline at end of file diff --git a/docs/bt/BehaviorEmitter.js b/docs/bt/BehaviorEmitter.js deleted file mode 100644 index d7888119..00000000 --- a/docs/bt/BehaviorEmitter.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @class BehaviorEmitter - * @extends EventEmitter - * @memberof jibo.bt - */ \ No newline at end of file diff --git a/docs/bt/BehaviorTree.js b/docs/bt/BehaviorTree.js deleted file mode 100644 index 6aad9a04..00000000 --- a/docs/bt/BehaviorTree.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @class BehaviorTree - * @extends EventEmitter - * @memberof jibo.bt - * @description Object for controlling the playback of the behavior tree. - * - * @param {jibo.bt.Behavior} root The root behavior of the tree. - * @param {jibo.bt.Blackboard} blackboard Reference to the global Blackboard instance. - * @param {Object} notepad Reference to a temporary object to use. - * @param {Object} result Reference to the tree's result. - * @param {jibo.bt.BehaviorEmitter} emitter Reference to the behavior's emitter. - */ - - /** - * Get the current status of the behavior tree - * @name jibo.bt.BehaviorTree#currentStatus - * @type {jibo.bt.Status} - * @readOnly - */ - - /** - * Start the behavior tree. - * @method jibo.bt.BehaviorTree#start - * @return {Boolean} Status result - */ - - /** - * When behavior tree starts - * @event jibo.bt.BehaviorTree#start - */ - - /** - * Stop the behavior tree. - * @method jibo.bt.BehaviorTree#stop - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - */ - - /** - * When behavior tree stops - * @event jibo.bt.BehaviorTree#stop - */ - - /** - * Pause the behavior tree. - * @private - * @method jibo.bt.BehaviorTree#pause - */ - - /** - * When behavior tree pauses - * @event jibo.bt.BehaviorTree#pause - */ - - /** - * Resume the behavior tree. - * @private - * @method jibo.bt.BehaviorTree#pause - */ - - /** - * When behavior tree resumes - * @event jibo.bt.BehaviorTree#unpause - */ - - /** - * Called every frame. - * @method jibo.bt.BehaviorTree#update - * @returns {jibo.bt.Status} The current status of this behavior. - */ - - /** - * Destroy and don't use after this - * @method jibo.bt.BehaviorTree#destroy - */ - - /** - * When behavior tree is destroyed - * @event jibo.bt.BehaviorTree#destroy - */ - - /** - * Stop and destroy, don't use after this - * @method jibo.bt.BehaviorTree#stopAndDestroy - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - */ \ No newline at end of file diff --git a/docs/bt/Blackboard.js b/docs/bt/Blackboard.js deleted file mode 100644 index 4ddb58e6..00000000 --- a/docs/bt/Blackboard.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * @class Blackboard - * @memberof jibo.bt - */ \ No newline at end of file diff --git a/docs/bt/Decorator.js b/docs/bt/Decorator.js deleted file mode 100644 index 93429123..00000000 --- a/docs/bt/Decorator.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @class Decorator - * @memberof jibo.bt - * @description Baseclass for all decorators. Decorators can force a behavior to succeed or fail. They can restart - * a behavior once it's failed or succeeded, and they can modify when a behavior starts. - * - * Subclasses: {@link jibo.bt.decorators} - * @param {Object} [options] Options for the decorator - * @param {String} [options.name=''] Name of the decorator instance - * @param {jibo.bt.Blackboard} [options.blackboard=null] Blackobard instance - * @param {jibo.bt.BehaviorEmitter} [options.emitter=null] Emitter instance - * @param {String} [options.assetPack=''] Name of the asset pack - * @param {Object} [defaultOptions] Defaults for options - */ - - /** - * The parent behavior - * @name jibo.bt.Decorator#behavior - * @type {Behavior} - * @readOnly - */ - - /** - * Starts the behavior or decorator - * @method jibo.bt.Decorator#start - * @returns {Boolean|Status.WAIT} `true` if this element is started successfully. `false` otherwise. `Status.WAIT` will be returned if the decorated behavior should not start yet. - */ - - /** - * Called every frame. Gives a chance for this decorator to change the status of a behavior. - * @method jibo.bt.Decorator#update - * @param result {jibo.bt.Status} The current status of the behavior this decorator is decorating. - * @returns {jibo.bt.Status} The modified status of the behavior this decorator is decorating. - */ - - /** - * Destroy this - */ - - /** - * Internal start from the behavior tree level - * @method jibo.bt.Decorator#_start - * @private - * @return {Boolean} Success - */ - - /** - * Internal stop from the behavior tree level - * @method jibo.bt.Decorator#_stop - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - * @private - */ - - /** - * Internal update from the behavior tree level - * @method jibo.bt.Decorator#_update - * @private - * @param {jibo.bt.Status} result - * @return {jibo.bt.Status} resulting status - */ \ No newline at end of file diff --git a/docs/bt/Factory.js b/docs/bt/Factory.js deleted file mode 100644 index f61f103a..00000000 --- a/docs/bt/Factory.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @class BehaviorConstructor - * @memberof jibo.bt - * @description Abstract type alias (needed by the Factory function) for the constructors of the behavior and decorator classes. - */ - -/** - * Utility methods for registering behaviors and creating behaviors trees. - * @namespace jibo.bt - */ - - /** - * Map of behaviors - * @name jibo.bt#_behaviors - * @type {Object} - * @private - */ - - /** - * The default blackboard - * @name jibo.bt#blackboard - * @type {jibo.bt.Blackboard} - * @private - */ - - /** - * Register a behavior or decorator globally - * @name jibo.bt#register - * @method - * @param {String} name The PascalCased name for the behavior - * @param {String} namespace This behavior's namespace. Pass in a globally unique name for this namesapce. - * @param {Module} classRef Class reference for the behavior or decorator - */ - - /** - * Add all behaviors - * @method jibo.bt#registerCore - * @private - */ - - /** - * Creates a runnable behavior tree from a bt file import. - * @method jibo.bt#create - * @param {String|Function} uri Relative or absolute path to a `.bt` file or module export of behavior tree. - * @param {Object} [overrides] Options for populating behavior tree globals. - * @param {jibo.bt.Blackboard} [overrides.blackboard] Override the default blackboard object for this behavior tree. - * @param {Object} [overrides.notepad] Provide your own notepad object instead of the default one. - * @param {String} [overrides.assetPack] The asset pack name to use for loading assets in this tree. - * @returns {jibo.bt.BehaviorTree} - */ - - /** - * Creates and runs a runnable behavior tree from a bt file import. - * ``` - * const jibo = require('jibo'); - * jibo.init('face', (err) => { - * jibo.bt.run('./behaviors/main', function(status){}); - * }); - * - * // Other supported APIs - * jibo.bt.run('./behaviors/main'); - * jibo.bt.run('./behaviors/main', (status) => {}); - * const overrides = {}; - * jibo.bt.run('./behaviors/main', overrides); - * jibo.bt.run('./behaviors/main', overrides, (status) => {}); - * ``` - * - * @method jibo.bt#run - * @param {String|Function} uri Relative or absolute path to a `.bt` file or module export of behavior tree. - * @param {Object} [overrides] Options for populating behavior tree globals. - * @param {jibo.bt.Blackboard} [overrides.blackboard] Override the default blackboard object for this behavior tree. - * @param {Object} [overrides.notepad] Provide your own notepad object instead of the default one. - * @param {String} [overrides.assetPack] The asset pack name to use for loading assets in this tree. - * @param {Function} onFinishedCallback The callback which gets called when the behavior tree has reached a status of FAILED, SUCCEEDED, or INTERRUPTED. - * @param {Status} status The status which the behavior tree finished with. - * @returns {jibo.bt.BehaviorTree} - */ - - /** - * Resolves the path in relation to a calleeDirname directory. If the supplied uri is an absolute path, the uri is - * returned unmodified - * @param {String} calleeDirname The directory name where the uri is relative to - * @param {String} uri The relative or absolute uri to a file in relation to the calleeDirname - * @returns {String} The result absolute path - * - */ \ No newline at end of file diff --git a/docs/bt/ParentBehavior.js b/docs/bt/ParentBehavior.js deleted file mode 100644 index a0c05728..00000000 --- a/docs/bt/ParentBehavior.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @class ParentBehavior - * @extends jibo.bt.Behavior - * @memberof jibo.bt - * @description The baseclass to all behaviors that contain a collection of child Behaviors. - * - * Subclasses: {@link jibo.bt.behaviors.Parallel|Parallel}, {@link jibo.bt.behaviors.Random|Random}, {@link jibo.bt.behaviors.Sequence|Sequence}, {@link jibo.bt.behaviors.Switch|Switch} - * - * @param {Object} [options] See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {Array} [options.children=[]] Child behaviors - * @param {Object} [defaultOptions] Defaults for options - */ - - /** - * Destroy this - */ - - /** - * Set the collection of children - * @name jibo.bt.ParentBehavior#children - * @type {Array} - */ - - /** - * Internal stop the behavior - * @method jibo.bt.ParentBehavior#_stop - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - * @private - */ \ No newline at end of file diff --git a/docs/bt/Status.js b/docs/bt/Status.js deleted file mode 100644 index 57528efc..00000000 --- a/docs/bt/Status.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Enumeration of behavior states - * @class Status - * @memberof jibo.bt - */ - - /** - * The behavior or flow succeeded. - * @name jibo.bt.Status.SUCCEEDED - * @type {String} - * @readOnly - * @default "SUCCEEDED" - */ - - /** - * The behavior or flow failed. - * @name jibo.bt.Status.FAILED - * @type {String} - * @readOnly - * @default "FAILED" - */ - - /** - * The behavior or flow was interrupted. - * @name jibo.bt.Status.INTERRUPTED - * @type {String} - * @readOnly - * @default "INTERRUPTED" - */ - - /** - * The behavior is in progress and hasn't returned. - * (Not returned for flows) - * @name jibo.bt.Status.IN_PROGRESS - * @type {String} - * @readOnly - * @default "IN_PROGRESS" - */ - - /** - * The behavior is in an invalid state. - * (Not returned for flows) - * @name jibo.bt.Status.INVALID - * @type {String} - * @readOnly - * @default "INVALID" - */ - - /** - * Don't update the state. - * (Not returned for flows) - * @name jibo.bt.Status.PAUSED - * @type {String} - * @readOnly - * @default "PAUSED" - */ - - /** - * Only used by decorators. - * @name jibo.bt.Status.WAIT - * @type {String} - * @readOnly - * @default "WAIT" - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Blink.js b/docs/bt/behaviors/Blink.js deleted file mode 100644 index b5fb60ba..00000000 --- a/docs/bt/behaviors/Blink.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @class Blink - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Plays a single blink animation. Succeeds immediately. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/ExecuteScript.js b/docs/bt/behaviors/ExecuteScript.js deleted file mode 100644 index 3550c86a..00000000 --- a/docs/bt/behaviors/ExecuteScript.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @class ExecuteScript - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description - * Executes arbitrary synchronous JavaScript. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {Function} options.exec Function to execute. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/ExecuteScriptAsync.js b/docs/bt/behaviors/ExecuteScriptAsync.js deleted file mode 100644 index 141ba399..00000000 --- a/docs/bt/behaviors/ExecuteScriptAsync.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @callback jibo.bt.behaviors.ExecuteScriptAsync~ExecuteFunction - * @description This behavior calls this function. ExecuteScriptAsync will succeed or fail only when one of the - * two callbacks are called. - * @param {Function} succeed Call this function when you want this behavior to succeed. - * @param {Function} fail Call this function when you want this behavior to fail. - */ - -/** - * @class ExecuteScriptAsync - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Asynchronously executes JavaScript. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {jibo.bt.behaviors.ExecuteScriptAsync~ExecuteFunction} options.exec Function to execute. Behavior will not stop unless one of the callbacks - * are called. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Listen.js b/docs/bt/behaviors/Listen.js deleted file mode 100644 index 2ba7a652..00000000 --- a/docs/bt/behaviors/Listen.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @typedef {Object} jibo.bt.behaviors.Listen~Options - * @property {boolean} heyJibo Listen for "Hey, Jibo" first. - * @property {boolean} detectEnd Listen for end of speech. - * @property {boolean} incremental Return incremental ASR results as they are streamed from the cloud. - * @property {String} authenticateSpeaker Authenticates against that person. - */ - -/** - * Function that returns the options object. - * @callback jibo.bt.behaviors.Listen~GetOptions - * @returns {jibo.bt.behaviors.Listen~Options} - */ - -/** - * Function that returns the options object. - * @callback jibo.bt.behaviors.Listen~OnResult - * @param {jibo.bt.ListenEmitter} listener Use this instance to listen for listen events. - */ - -/** - * @deprecated - * @class Listen - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Performs audio speech recognition and applies and parses the results according to a rules file. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {jibo.bt.behaviors.Listen~GetOptions} options.getOptions Returns the options object. - * @param {String} options.rule Path the to `.rule` file. This assumes the path starts at `${project}/rules`. - * @param {jibo.bt.behaviors.Listen~OnResult} options.onResult Called and passed a {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} object. Events are fired from the Listener - * at certain points in this behavior's lifecycle. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/ListenEmbedded.js b/docs/bt/behaviors/ListenEmbedded.js deleted file mode 100644 index 313c8137..00000000 --- a/docs/bt/behaviors/ListenEmbedded.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @typedef {Object} jibo.bt.behaviors.ListenEmbedded~Options - */ - -/** - * Called when the {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} is constructed. - * @callback jibo.bt.behaviors.ListenEmbedded~OnResult - * @param {jibo.bt.EmbeddedListenEmitter} listener Use this instance to listen for listen events. - */ - -/** - * @deprecated - * @class ListenEmbedded - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Succeeds when when the specified audio phrase is spotted. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {jibo.bt.behaviors.ListenEmbedded~Rules} options.rule The embedded rule to listen for. - * @param {jibo.bt.behaviors.ListenEmbedded~OnResult} options.onResult Called and passed a {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} object. Events are - * fired from the emitter at certain points in this behavior's lifecycle. - */ - - /** - * Enum for embedded listen rule types. - * @name jibo.bt.behaviors.ListenEmbedded#Rules - * @readOnly - * @type {enum} - * @prop {string} HEY_jibo Listed for "Hey Jibo". - */ \ No newline at end of file diff --git a/docs/bt/behaviors/ListenJs.js b/docs/bt/behaviors/ListenJs.js deleted file mode 100644 index 2f974a71..00000000 --- a/docs/bt/behaviors/ListenJs.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @typedef {Object} jibo.bt.behaviors.ListenJs~Options - * @property {boolean} heyJibo Listen for "Hey, Jibo" first. - * @property {boolean} detectEnd Listen for end of speech. - * @property {boolean} incremental Return incremental ASR results as they are streamed from the cloud. - * @property {String} authenticateSpeaker Authenticates against that person. - */ - -/** - * Function that returns the options object. - * @callback jibo.bt.behaviors.ListenJs~GetOptions - * @returns {jibo.bt.behaviors.ListenJs~Options} - */ - -/** - * Called when the {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} is constructed. - * @callback jibo.bt.behaviors.ListenJs~OnResult - * @param {jibo.bt.ListenEmitter} listener Use this instance to listen for listen events. - */ - -/** - * @deprecated - * @class ListenJs - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Performs audio speech recognition and applies and parses the results according to a rules file. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {jibo.bt.behaviors.ListenJs~GetOptions} options.getOptions Returns the options object. - * @param {Function} options.getRule This function returns a string representation of a rule. Use this behavior to dynamically generate rules files instead - * of loading a rule file from disk. - * @param {jibo.bt.behaviors.ListenJs~OnResult} options.onResult Called and passed a {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} object. Events are fired from the Listener - * at certain points in this behavior's lifecycle. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/LookAt.js b/docs/bt/behaviors/LookAt.js deleted file mode 100644 index c3c12fd1..00000000 --- a/docs/bt/behaviors/LookAt.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @class Point3D - * @memberof jibo.bt.behaviors.LookAt - * @description Defines a point in 3D space. - * @prop {number} x The forward-facing vector in Jibo's coordinate frame (meters). - * @prop {number} y The left-facing vector in Jibo's coordinate frame (meters). - * @prop {number} z The up-facing vector in Jibo's coordinate frame (meters). - */ - -/** - * @class LookAt - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Makes Jibo look at a 3D point in space. - * `LookAt` has two modes. In single-shot mode, this behavior makes Jibo look at the 3D point returned - * by `getTarget` and succeeds when Jibo reaches his this target. In continuous mode, `getTarget` is - * called every frame, and this behavior will remain in progress indefinitely until explicitly stopped by a - * parent bahevior or a decorator. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {Function} options.getTarget Returns a {@link jibo.bt.behaviors.LookAt.Point3D} object. - * @param {boolean} [options.isContinuous=false] `true` if this behavior is in continous-mode. `false` if in single-shot look-at. - * @param {Function} options.config Called and passed a {@link LookatBuilder} object for configuration purposes. Do not call {@link LookatBuilder#startLookat}. This is called automatically by the behavior. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Menu.js b/docs/bt/behaviors/Menu.js deleted file mode 100644 index 6d127b1e..00000000 --- a/docs/bt/behaviors/Menu.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Load or generate the menu configuration data. For the menu to function, the button actions must - * be an 'utterance' or 'press' event - no other button actions will be responded to. - * @callback jibo.bt.behaviors.Menu~GetConfig - * @param {Function} callback When config has been loaded or generated, pass it to this callback. - */ - -/** - * Called when a Menu times out or closes. Return value finds an exception handler within the flow. *Unhandled exceptions use the default behavior of returning to Jibo's idle state. - * @callback jibo.bt.behaviors.Menu~OnMenuClosed - * @param {boolean} timedOut `true` if the menu timed out, `false` if it was closed by the user. - * @param {jibo.face.views.MenuView} menu Created menu. Use to read menu position or any other information before the menu closes. - * @param {Function} overrideMenuTransition Override the transition out of the menu. Pass a [ChangeOptions]{@link jibo.face.views~ChangeOptions} to control the transition, or `remain` in order to leave the menu in place. - * @param {String} results.exception (Flow Only) Exception for the closed menu; either `~InteractionError.MenuTimeout` or `~InteractionError.MenuClosed`. - */ - -/** - * Called when an item has been chosen. - * @callback jibo.bt.behaviors.Menu~OnItemChosen - * @param {any} results Either the listen results or the button press event, depending on how the menu is configured. - * @param {jibo.face.views.MenuView} menu Created menu. Use to read menu position or any other information before the menu closes. - * @param {Function} overrideMenuTransition Call to override the transition out of the menu. Pass a [ChangeOptions]{@link jibo.face.views~ChangeOptions} to control the transition, or `remain` in order to leave the menu in place. - */ - -/** - * Called to confirm that a positional selection makes sense, allowing custom handling to select certain types of items, if desired. This is called when a user says something like 'open the one on the right', and is called before the onItemChosen callback. - * @callback jibo.bt.behaviors.Menu~OnPositionalSelect - * @param {jibo.mim.AsrResult} commandASR Data from NLU service. - * @param {Number} intendedIndex Index that the menu plans to use for selection. - * @param {jibo.face.views.MenuView} menu Created menu. Use to read button data, if you didn't keep track of it yourself. - * @returns {number} An item index to change what will be selected, or NaN to select nothing. Returning undefined will use the default behavior (selecting intendedIndex). - */ - -/** - * @class Menu - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description A single stage menu. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {jibo.bt.behaviors.Menu~GetConfig} options.getConfig Load or generate the menu config data. - * @param {jibo.bt.behaviors.Menu~OnMenuClosed} options.onMenuClosed Called if the menu times out or is closed. - * @param {jibo.bt.behaviors.Menu~OnItemChosen} options.onItemChosen Called when the user picks an item from the list. - * @param {jibo.bt.behaviors.Menu~OnPositionalSelect} options.onPositionalSelect Called when the user uses a positional selection voice command - */ - - /** - * Callback for button 'press' events from the menu. - * @method jibo.bt.Menu#onPressEvent - * @param {any} event Whatever the press event from the menu was, as defined in the view config. - * @private - */ - - /** - * Callback for when the list is closed for any reason. - * @method jibo.bt.Menu#onListClosed - * @private - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Mim.js b/docs/bt/behaviors/Mim.js deleted file mode 100644 index 0e604d1d..00000000 --- a/docs/bt/behaviors/Mim.js +++ /dev/null @@ -1,327 +0,0 @@ -/** - * @class ListenBundle - * @memberof jibo.mim - * @description Internal bundle of listen specific data. - * @private - */ - - /** - * Timeout duration in milliseconds. If NaN, do not timeout. - * @name jibo.mim.ListenBundle#timeout - * @type {Number} - */ - - /** - * Beginning of timeout in epoch time. Timeout is triggered when the difference between this - * time and current time is greater than timeout. - * @name jibo.mim.ListenBundle#startTime - * @type {Number} - */ - - /** - * Listener from jibo.mim#listenDelegate. - * @name jibo.mim.ListenBundle#listener - * @type {any} - */ - - /** - * If we had failed to get a listener previously. Skill will be exited on another failure. - * @name jibo.mim.ListenBundle#failedToGetListener - * @type {boolean} - */ - -/** - * @class MimStates - * @memberof jibo.mim - * @description Bundle all the Mim's state machine states, with strong typing. Each - * property of MimStates is a State from jibo-state-machine. All actions are performed - * by functions of the Mim class. - * @private - */ - -/** - * Return prompt data for MIM. Properties are used as variables - * for MIM condition evaluation and prompt text insertion. - * @callback jibo.bt.behaviors.Mim~GetPromptData - * @returns {any} - */ - -/** - * Called on listen complete during Optional Response or Question, before the MIM analyzes the - * result. Allows skills to implement their own check on the result to tell the MIM how to handle it. - * @callback jibo.bt.behaviors.Mim~CheckResult - * @param {jibo.jetstream.types.ListenResult} result Data from NLU service. - */ - -/** - * Called when an Optional Response or Question MIM completes successfully. - * Optional Response MIMs always complete; - * check `options.state.lastResultState` to see if user responded. - * @callback jibo.bt.behaviors.Mim~OnSuccess - * @param {any} results Bundles data from MIM. - * @param {jibo.jetstream.types.ListenResult} results.asrResults Data from NLU service. - * @param {jibo.mim.SpeakerIds} results.speakerIds If available, the ID of the speaker. - * @param {jibo.mim.MimState} results.state Current state of the MIM. - * @param {String} results.firstGrammarTag (Flow use only) The value of the first rule slot (results.asrResults.entities[results.asrResults.slotActions[0]]). The default transition from a MIM. If a listen has multiple potential slots, this value should not be considered reliable. - */ - -/** - * (Flow use only) Called when a Question MIM fails entirely. Either the user did not - * respond to Jibo or Jibo could not understand the user and has run out of error prompts. - * Return value finds an error handler within the flow. Unhandled - * errors use Jibo's standard MIM exception handling. - * @callback jibo.bt.behaviors.Mim~OnFailure - * @param {any} results Bundles data from MIM. - * @param {jibo.jetstream.types.ListenResult} results.asrResults Data from NLU service. - * @param {jibo.mim.SpeakerIds} results.speakerIds If available, the ID of the speaker. - * @param {jibo.mim.MimState} results.state Current state of the MIM. - * @param {String} results.exception Exception for this failure; either `~InteractionError.noMatch` or `~InteractionError.noInput`. - */ - -/** - * (Internal to Menu behavior only) Called to confirm that a positional selection makes sense, allowing custom handling to select certain types of items, if desired. - * @callback jibo.bt.behaviors.Mim~OnPositionalSelect - * @param {jibo.jetstream.types.ListenResult} commandASR Data from NLU service. - * @param {Number} intendedIndex Index that the menu plans to use for selection. - * @param {jibo.face.views.MenuView} menu Created menu. Use to read button data, if you didn't keep track of it yourself. - * @returns {number} Return an item index to change what will be selected, or null to select nothing. Returning undefined will use the default behavior (selecting intendedIndex). - * @private - */ - -/** - * @class Mim - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Perform a dialogue interaction. Can be an announcement, an - * announcement with optional user response, or a - * question and attempt to get answer from the user. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {String} options.mimPath Path to the MIM file to use. - * @param {jibo.bt.behaviors.Mim~GetPromptData} options.getPromptData Returns the prompt variable data. - * @param {jibo.bt.behaviors.Mim~CheckResult} options.checkResult Called and passed data about what the Mim is hearing when a listen is complete. Optional Response and Question MIMs only. - * @param {jibo.bt.behaviors.Mim~OnSuccess} options.onSuccess Called and passed data about what the Mim heard when it completes. Optional Response and Question MIMs only. - * @param {jibo.bt.behaviors.Mim~OnFailure} options.onFailure Called and passed data about what the Mim heard or did not hear when it completes. Question MIMs only. - */ - - /** - * Stops the MIM. The optional parameter here is considered private - this should be used - * like the stop() method it inherits from Behavior, with no parameters. - * @method jibo.bt.Mim#stop - * @param {boolean} [isMenuTap] If the stop() was due to tapping a menu button. - * @private - */ - - /** - * If this Mim has an active view, pops the top view from the list and destroys this Mim's - * active view. - * @method jibo.bt.Mim#removeView - * @private - * @param {string} intent Reason for removing the view - 'success', 'failure', or null if view should never be left blank. - */ - - /** - * Remove combinedRuleHandle and ruleHandle from NLU memory. - * @method jibo.bt.Mim#unloadRules - * @private - */ - - /** - * Cleans up global event listeners that the MIM added. - * @method jibo.bt.Mim#cleanUpEvents - * @private - */ - - /** - * Opens the MIM's GUI if it is not already open. - * @method jibo.bt.Mim#openGUI - * @private - */ - - /** - * Callback for events from `jibo.mim.openGUI`. Opens the GUI, if it is not already open. - * @method jibo.bt.Mim#onOpenGUIEvent - * @private - */ - - /** - * Callback for events from `jibo.mim.handleSpeech`. Stops active speech or listen to parse a - * spoofed utterance. - * @method jibo.bt.Mim#onSpeechEvent - * @param {string} utterance The spoofed utterance in need of parsing. - * @private - */ - - /** - * Callback for events from `jibo.mim.end`. Ends the MIM immediately. - * @method jibo.bt.Mim#onEndEvent - * @param {any} data Not currently used. In the future, data about how the MIM should end. - * @private - */ - - /** - * Callback for events from `jibo.mim.heyJibo`. Handles barge in via "Hey Jibo". - * @method jibo.bt.Mim#onHeyJiboHeard - * @private - */ - - /** - * State entry for states.loadConfig. Load .mim file(s) and then go to states.loadRule for OR/Q - * mims or states.choosePrompt for AN mims. - * @method jibo.bt.Mim#loadMim - * @private - */ - - /** - * State entry for states.loadRule. Load .mim file(s) and then go to states.loadRule for OR/Q - * mims or states.choosePrompt for AN mims. Sets up loading of rule for mim and unionizing it - * with mim global rule as a Promise. Immediately go to states.choosePrompt. - * @method jibo.bt.Mim#loadRule - * @private - */ - - /** - * State entry for states.choosePrompt. Choose prompt text to be played. Go to states.listen - * if no prompt or silent prompt chosen. Go to states.speak to speak the prompt. - * @method jibo.bt.Mim#choosePrompt - * @private - */ - - /** - * State entry for states.speak. Speaks the chosen prompt through the TTS system. When finished, - * goes to states.reportResults for an AN mim or states.listen for an OR/Q mim. - * @method jibo.bt.Mim#speak - * @private - */ - - /** - * State interuption for states.speak. Stops jibo.mim#speakDelegate playback. - * @method jibo.bt.Mim#stopSpeaking - * @private - */ - - /** - * State entry for states.listen. Starts a listener from jibo.mim#listenDelegate. - * If appropriate, starts timeout. If appropriate, displays the mim GUI. When listen completes, - * transitions to states.analyzeResults for mim results or states.analyzeMimGlobal for mim - * global commands. - * @method jibo.bt.Mim#startListen - * @private - */ - - /** - * Callback for screen interaction. Resets timeouts during listen. - * @method jibo.bt.Mim#resetTimeout - * @private - */ - - /** - * State interuption for states.listen. Stops listener and removes mim GUI if present. - * @method jibo.bt.Mim#stopListen - * @private - */ - - /** - * State exit for states.listen. Stops listener and removes screen touch listeners. - * @method jibo.bt.Mim#listenExit - * @private - */ - - /** - * State update for states.listen. Tracks timeout. If timeout triggered, change state to - * states.analyzeResults. - * @method jibo.bt.Mim#updateListen - * @private - */ - - /** - * State entry for states.analyzeMimGlobal. If global command is 'repeat', go to - * states.choosePrompt. Otherwise, redirect to states.analyzeResults. - * @method jibo.bt.Mim#analyzeMimGlobal - * @private - */ - - /** - * State entry for states.analyzeMenuGlobal. If global command is 'left' or right' and GUI is - * active, scroll list and return to states.listen. Otherwise, redirect to - * states.analyzeResults. - * @method jibo.bt.Mim#analyzeMenuGlobal - * @private - */ - - /** - * State entry for states.parseSpoof. Perform NLU parse on utterance text from GUI, followed * by going to states.reportResults. - * @method jibo.bt.Mim#parseSpoofedUtterance - * @private - */ - - /** - * State entry for states.analyzeResults. Analyze results to determine if result of listen is - * 'noMatch', 'noInput', or 'match'. If result is 'match' or mim has run out of error prompts, - * go to states.reportResults. Otherwise, go to states.choosePrompt. - * @method jibo.bt.Mim#analyzeResults - * @private - */ - - /** - * State entry for states.reportResults. If mim has failed due to noInput or noMatch errors, - * call onFailure to allow flow to handle exception. If exception not handled, go to - * states.handleException. If mim successful, call onSuccess and end Mim behavior. - * @method jibo.bt.Mim#reportResults - * @private - */ - - /** - * State entry for states.handleException. Begins global mim exception flow for either 'noInput' - * or 'noMatch' failures. - * @method jibo.bt.Mim#handleException - * @private - */ - - /** - * State update for states.handleException. Update exception flow. If flow is complete act upon - * flow result. If flow result is 'exit', exit skill and return to be/idle. If flow result is - * 'restart', go to states.choosePrompt. - * @method jibo.bt.Mim#updateException - * @private - */ - - /** - * State interuption for states.handleException. Stop and clean up exception flow. Remove any - * flow created view. - * @method jibo.bt.Mim#stopException - * @private - */ - - /** - * Display text that mim rules could not match. Provided to noMatch exception flow as a - * callback. - * @method jibo.bt.Mim#showInputText - * @param {string} notMatchedText Text from speech to text that NLU could not match. - * @private - */ - - /** - * Remove text display created during noMatch exception flow. - * @method jibo.bt.Mim#hideInputText - * @private - */ - - /** - * State entry for states.waitForHJEnd. Begins waiting for the Hey Jibo listen to end in a way - * that the MIM should recover from. - * @method jibo.bt.Mim#waitForHJEnd - * @private - */ - - /** - * Standard method to tell the waitForHJEnd state to go back to prompt selection. - * @method jibo.bt.Mim#recoverFromHJ - * @private - */ - - /** - * State interuption and exiting for states.waitForHJEnd. Removesevent listeners added in the - * state entry. - * @method jibo.bt.Mim#hjEnded - * @private - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Null.js b/docs/bt/behaviors/Null.js deleted file mode 100644 index bc496e68..00000000 --- a/docs/bt/behaviors/Null.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @class Null - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description `Null` has no behavior. It will remain in-progress until a decorator changes its state. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Parallel.js b/docs/bt/behaviors/Parallel.js deleted file mode 100644 index 9245beea..00000000 --- a/docs/bt/behaviors/Parallel.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @class Parallel - * @extends jibo.bt.ParentBehavior - * @memberof jibo.bt.behaviors - * @description Runs its child nodes in parallel. Returns with `Status.FAILED` if one of the children failed - * and `Status.SUCCEEDED` if all children succeeded. - * @param {Object} options See {@link jibo.bt.Behavior} for all options. - * @param {boolean} options.succeedOnOne If the Parallel should succeed when the first child succeeds. - * @param {Array} [options.children=[]] An array of the Parallel's child behaviors. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/PlayAnimation.js b/docs/bt/behaviors/PlayAnimation.js deleted file mode 100644 index b4d045ab..00000000 --- a/docs/bt/behaviors/PlayAnimation.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @class PlayAnimation - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Plays the animation specified by `animPath`, `animName` or `animQuery`. - * Succeeds when the animation is finished playing. Playing an - * animation consists of two phases: the transition phase and the play phase. The transition phase will - * transition Jibo from his current position to the start position of the specified animation. The play - * phase plays the animation with the current configuration. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {String} options.animPath The path to the `.keys` file. This behavior assumes `${project}/animations` is the root for - * all the animations. - * @param {Function} options.config Called and passed a {@link AnimationBuilder} object for configuration purposes. Do not call - * {@link AnimationBuilder#play}. This is done automatically by the behavior. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/PlayAudio.js b/docs/bt/behaviors/PlayAudio.js deleted file mode 100644 index 9ba9d16d..00000000 --- a/docs/bt/behaviors/PlayAudio.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @class PlayAudio - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Plays the audio specified by `audioPath`. Succeeds when the audio file is finished playing. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {String} options.audioPath The path to any audo file format supported by HTML5 Audio. This behaviuor assumes `${project}/audio` - * is the root for all the audio files. - * @param {Boolean} options.cache=true `true` to cache the audio. `false` to play once and destroy. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Random.js b/docs/bt/behaviors/Random.js deleted file mode 100644 index 21034de0..00000000 --- a/docs/bt/behaviors/Random.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @class Random - * @extends jibo.bt.ParentBehavior - * @memberof jibo.bt.behaviors - * @description On start, will choose a random node in its children and run that node. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {Array} [options.children=[]] An array of child behaviors. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/ReadBarcode.js b/docs/bt/behaviors/ReadBarcode.js deleted file mode 100644 index c9285c86..00000000 --- a/docs/bt/behaviors/ReadBarcode.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Function that returns the options object. - * @callback jibo.bt.behaviors.ReadBarcode~onBarcode - * @param {string|null} error `null` if no error. - * @param {Object} data The result of the barcode if one is found. - * @param {number} data.type The type of barcode found. The types are 0 (EAN8), 1 (UPCE), 2 (ISBN10), 3 (UPCA), 4 (EAN13), - * 5 (ISBN13), 6 (Interleaved 2 of 5), 7 (Code 39), 8 (PDF417), 9 (QR-Code), 10 (Code 128). - * @param {String} data.content The payload of the detected barcode. - */ - -/** - * @class ReadBarcode - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Makes Jibo take a photo and search for a barcode or QR code in that image. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {jibo.bt.behaviors.ReadBarcode~onBarcode} options.onBarcode Called after Jibo takes a picture. The results are passed to this function. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Sequence.js b/docs/bt/behaviors/Sequence.js deleted file mode 100644 index df418f55..00000000 --- a/docs/bt/behaviors/Sequence.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @class Sequence - * @extends jibo.bt.ParentBehavior - * @memberof jibo.bt.behaviors - * @description `Sequence` Runs its child nodes in sequence until one fails. Fails if one of the children fails - * and succeeds if all its children succeeded. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {Array} [options.children=[]] - An array of child behaviors. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Subtree.js b/docs/bt/behaviors/Subtree.js deleted file mode 100644 index 02494268..00000000 --- a/docs/bt/behaviors/Subtree.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @class Subtree - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Encapsulates an external subtree file (`.bt` file) into a single behavior. This behavior fails if the - * `.bt` tree fails, and succeeds if that tree succeeds. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {String} options.behaviorPath The path to the `.bt` file this behavior encapsulates. This assumes the root - * of all `.bt` files is in `${project}/behaviors`. - * @param {Function} options.getNotepad Returns an object that will become this referenced tree's notepad. Think of this as the - * arguments to this subtree. - * @param {Function} options.onResult Called when the external tree either fails or succeeds. A result object is passed as an argument. - * This result object is populated by the external tree. Think of this as the return value. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/SubtreeJs.js b/docs/bt/behaviors/SubtreeJs.js deleted file mode 100644 index 4417aab4..00000000 --- a/docs/bt/behaviors/SubtreeJs.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @class SubtreeJs - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Encapsulates an external subtree file (`.bt` file) into a single behavior. This behavior fails if the - * `.bt` tree fails and succeeds if that tree succeeds. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {Function} options.getFileName Returns the path to the `.bt` file this behavior encapsulates. This assumes the root - * of all `.bt` files is in `${project}/behaviors`. - * @param {Function} options.getNotepad Returns an object that will become this referenced tree's notepad. Think of this as the - * arguments to this subtree. - * @param {Function} options.onResult Called when the external tree either fails or succeeds. A result object is passed as an argument. - * This result object is populated by the external tree. Think of this as the return value. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/Switch.js b/docs/bt/behaviors/Switch.js deleted file mode 100644 index 542ffde3..00000000 --- a/docs/bt/behaviors/Switch.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @class Switch - * @extends jibo.bt.ParentBehavior - * @memberof jibo.bt.behaviors - * @description Runs its child nodes in sequence until one succeeds. Fails if all of the children failed - * and succeeds if one child succeeded. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {Array} [options.children=[]] - An array of the Switch's child behaviors. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/TakePhoto.js b/docs/bt/behaviors/TakePhoto.js deleted file mode 100644 index 300079ba..00000000 --- a/docs/bt/behaviors/TakePhoto.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Callback for when Jibo takes a photo. - * ``` - * let behavior = TakePhoto(2, 2, (url) => { - * let img = new Image(); - * img.src = url; - * }); - * ``` - * @callback jibo.bt.behaviors.TakePhoto~OnPhoto - * @param {String} url The image URL. - */ - -/** - * @class TakePhoto - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Makes Jibo take a photo and will return a URL to get the contents of that photo. - * @param {Object} options Options - * @param {number} options.resolution `1` for a 672x380 photo. `2` for 1280x720 photo. `3` for 1920x1080 photo. `4` for 2688x1520 photo. - * @param {jibo.bt.behaviors.TakePhoto~OnPhoto} options.onPhoto Called after Jibo takes a picture. The image URL is passed to this function. - * @param {boolean} [options.noDistortion=true] Removes camera distortion from photo. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/TextToSpeech.js b/docs/bt/behaviors/TextToSpeech.js deleted file mode 100644 index bb07dd8f..00000000 --- a/docs/bt/behaviors/TextToSpeech.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @class TextToSpeech - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Makes Jibo speak. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {String} options.words The words for Jibo to speak. - * @param {Function} options.onWord Called each time a word is spoken. The word that is spoken is passed as an argument. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/TextToSpeechJs.js b/docs/bt/behaviors/TextToSpeechJs.js deleted file mode 100644 index 0a9b952a..00000000 --- a/docs/bt/behaviors/TextToSpeechJs.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @class TextToSpeechJs - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description Makes Jibo speak. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {Function} options.getWords Function that returns a string of the words for Jibo to speak. - * @param {Function} options.onWord Called each time a word is spoken. The word that is spoken is passed as an argument. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/TimeoutJs.js b/docs/bt/behaviors/TimeoutJs.js deleted file mode 100644 index 13e86669..00000000 --- a/docs/bt/behaviors/TimeoutJs.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @callback jibo.bt.behaviors.TimeoutJs~GetTime - * @returns {number} Time in milliseconds until the behavior succeeds. - */ - -/** - * @class TimeoutJs - * @extends jibo.bt.Behavior - * @memberof jibo.bt.behaviors - * @description - * Succeeds only after the specified amount of time. - * @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options. - * @param {jibo.bt.behaviors.TimeoutJs~GetTime} options.getTime - Time in milliseconds until `TimeoutJs` succeeds. - */ \ No newline at end of file diff --git a/docs/bt/behaviors/index.js b/docs/bt/behaviors/index.js deleted file mode 100644 index a4dbb68f..00000000 --- a/docs/bt/behaviors/index.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Behavior Tree behavior classes. - * @namespace jibo.bt.behaviors - */ \ No newline at end of file diff --git a/docs/bt/decorators/Case.js b/docs/bt/decorators/Case.js deleted file mode 100644 index 467fb4f7..00000000 --- a/docs/bt/decorators/Case.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @callback jibo.bt.decorators.Case~CaseConditional - * @returns {boolean} Return `true` to succeed the decorated behavior. `false` otherwise. - */ - -/** - * @class Case - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description - * Performs a single check before the behavior it's decorating starts. If that check fails, `Case` fails the - * behavior. Useful for decorating behaviors under a {@link jibo.bt.behaviors.Switch|Switch} behavior. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {jibo.bt.decorators.Case~CaseConditional} options.conditional Function called every frame. - * Return `false` when you want component to fail. - */ \ No newline at end of file diff --git a/docs/bt/decorators/FailOnCondition.js b/docs/bt/decorators/FailOnCondition.js deleted file mode 100644 index 7493eb0f..00000000 --- a/docs/bt/decorators/FailOnCondition.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @callback jibo.bt.decorators.FailOnCondition~FailOnConditionConditional - * @extends jibo.bt.Behavior - * @returns {boolean} `true` when you want component to Fail. - */ - -/** - * @class FailOnCondition - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description Explicitly interrupts the behavior it's decorating and returns Status.FAILED if the - * conditional evaluates to `true`. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {Function} [options.init] Function called at the start of this behavior. Used to initialize any - * variables or data. - * @param {jibo.bt.decorators.FailOnCondition~FailOnConditionConditional} options.conditional Function called every frame. Return `true` - * when you want component to fail. - */ \ No newline at end of file diff --git a/docs/bt/decorators/StartOnAnimEvent.js b/docs/bt/decorators/StartOnAnimEvent.js deleted file mode 100644 index 171ce6d7..00000000 --- a/docs/bt/decorators/StartOnAnimEvent.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @callback jibo.bt.decorators.StartOnAnimEvent~StartOnEventOnReceived - * @argument {AnimationInstance} instance The animation instance the event was dispatched from. - * @argument {Object} payload A payload defined in the `.keys` file. - */ - -/** - * @class StartOnAnimEvent - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description - * `StartOnAnimEvent` will begin the execution of its behavior when an animation fires an event from its event layer. - * @param {String} options.eventName - Name of the event this behavior listens for. - * @param {jibo.bt.decorators.StartOnAnimEvent~StartOnEventOnReceived} options.onReceived - Callback for when `eventName` is dispatched. - */ \ No newline at end of file diff --git a/docs/bt/decorators/StartOnCondition.js b/docs/bt/decorators/StartOnCondition.js deleted file mode 100644 index 4bd37235..00000000 --- a/docs/bt/decorators/StartOnCondition.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @callback jibo.bt.decorators.StartOnCondition~StartOnConditionConditional - * @returns {Boolean} `true` when you want component to start. - */ - -/** - * @class StartOnCondition - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description - * Prevents the behavior it's decorating from starting until its conditional evaluates to - * true. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {Function} [options.init] Function called at the start of this behavior. Used to initialize any - * variables or data. - * @argument {jibo.bt.decorators.StartOnCondition~StartOnConditionConditional} options.conditional - The conditional to evaluate. - */ \ No newline at end of file diff --git a/docs/bt/decorators/StartOnEvent.js b/docs/bt/decorators/StartOnEvent.js deleted file mode 100644 index 0da66cc4..00000000 --- a/docs/bt/decorators/StartOnEvent.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @class StartOnEvent - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description - * Prevents the behavior it's decorating from starting until an event is emitter from a behavior tree's - * global `emitter`. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {String} options.eventName - The name of the event to listen for. - * @param {Function} options.onEvent - called when the event is fired. Any payload with the event is passed in. - */ \ No newline at end of file diff --git a/docs/bt/decorators/SucceedOnCondition.js b/docs/bt/decorators/SucceedOnCondition.js deleted file mode 100644 index ac864be8..00000000 --- a/docs/bt/decorators/SucceedOnCondition.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @callback jibo.bt.decorators.SucceedOnCondition~SucceedOnConditionConditional - * @returns {Boolean} `true` to succeed the decorated behavior. `false` otherwise. - */ - -/** - * @class SucceedOnCondition - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description - * Explicitly interrupts the behavior it's decorating and returns Status.SUCCEEDED if the - * conditional evaluates to `true`. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {Function} [options.init] Function called at the start of this behavior. Used to initialize any - * variables or data. - * @param {jibo.bt.decorators.SucceedOnCondition~SucceedOnConditionConditional} options.conditional Function called every frame. Return `true` - * to force behavior to succeed. - */ \ No newline at end of file diff --git a/docs/bt/decorators/SucceedOnEmbedded.js b/docs/bt/decorators/SucceedOnEmbedded.js deleted file mode 100644 index 98406c82..00000000 --- a/docs/bt/decorators/SucceedOnEmbedded.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @class EmbeddedListenEmitter - * @description Passed to the {@link jibo.bt.decorators.SucceedOnEmbedded~OnResult} function of the {@link jibo.bt.decorators.SucceedOnEmbedded|SucceedOnEmbedded} behavior. - * @extends EventEmitter - * @memberof jibo.bt - */ - -/** - * @typedef {Object} jibo.bt.decorators.SucceedOnEmbedded~Options - */ - -/** - * Called when the {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} is constructed. - * @callback jibo.bt.decorators.SucceedOnEmbedded~OnResult - * @param {jibo.bt.EmbeddedListenEmitter} listener Use this instance to listen for listen events. - */ - -/** - * @class SucceedOnEmbedded - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description Succeeds the behavior its decorating when the specified audio phrase is spotted. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {jibo.bt.decorators.SucceedOnEmbedded.Rules} options.rule The embedded rule to listen for. - * @param {jibo.bt.decorators.SucceedOnEmbedded~OnResult} options.onResult Called and passed a {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} object. Events are - * fired from the emitter at certain points in this behavior's lifecycle. - */ - - /** - * Embedded listen rule types. - * @name jibo.bt.decorators.SucceedOnEmbedded.Rules - * @property {String} HEY_jibo Listen for "Hey, Jibo" - * @static - * @enum {String} - */ - - /** Listen for "Hey Jibo" */ - - /** - * Fired when the phrase is spotted. - * @event jibo.bt.EmbeddedListenEmitter#hey-jibo - * @param {Object} result Reference to the behavior's result. - * @param {Array} speakers Text independent speaker ID results. - */ \ No newline at end of file diff --git a/docs/bt/decorators/SucceedOnEvent.js b/docs/bt/decorators/SucceedOnEvent.js deleted file mode 100644 index 54aaa6bb..00000000 --- a/docs/bt/decorators/SucceedOnEvent.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @class SucceedOnEvent - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description - * Succeeds the behavior it's decorating when an event is emitter from a behavior tree's - * global `emitter`. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {String} options.eventName - The name of the event to listen for. - * @param {Function} options.onEvent - Called when the event is fired. Any payload with the event is passed in. - */ \ No newline at end of file diff --git a/docs/bt/decorators/SucceedOnListen.js b/docs/bt/decorators/SucceedOnListen.js deleted file mode 100644 index 81ae4d6f..00000000 --- a/docs/bt/decorators/SucceedOnListen.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @typedef {Object} jibo.bt.decorators.SucceedOnListen~Options - * @property {boolean} heyJibo Listen for "Hey, Jibo" first. - * @property {boolean} detectEnd Listen for end of speech. - * @property {boolean} incremental Return incremental ASR results as they are streamed from the cloud. - * @property {String} authenticateSpeaker Authenticates against that person. - */ - -/** - * Function that returns the options object. - * @callback jibo.bt.decorators.SucceedOnListen~GetOptions - * @returns {jibo.bt.decorators.SucceedOnListen~Options} - */ - -/** - * Called when the {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} is constructed. - * @callback jibo.bt.decorators.SucceedOnListen~OnResult - * @param {jibo.bt.ListenEmitter} listener Use this instance to listen for listen events. - */ - -/** - * @class SucceedOnListen - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description Performs audio speech recognition and applies and parses the results according to a rules file. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {jibo.bt.decorators.SucceedOnListen~GetOptions} options.getOptions Returns the options object. - * @param {String} options.rule Path the to `.rule` file. This assumes the path starts at `${project}/rules`. - * @param {jibo.bt.decorators.SucceedOnListen~OnResult} options.onResult Called and passed a {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} object. Events are fired from the Listener - * at certain points in this behavior's lifecycle. - */ \ No newline at end of file diff --git a/docs/bt/decorators/SucceedOnListenJs.js b/docs/bt/decorators/SucceedOnListenJs.js deleted file mode 100644 index 0800f125..00000000 --- a/docs/bt/decorators/SucceedOnListenJs.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @class ListenEmitter - * @description Used to listen for cloud events. - * @extends EventEmitter - * @memberof jibo.bt - */ - -/** - * @typedef {Object} jibo.bt.decorators.SucceedOnListenJs~Options - * @property {boolean} heyJibo Listen for "Hey, Jibo" first. - * @property {boolean} detectEnd Listen for end of speech. - * @property {boolean} incremental Return incremental ASR results as they are streamed from the cloud. - * @property {String} authenticateSpeaker Authenticates against that person. - */ - -/** - * Function that returns the options object. - * @callback jibo.bt.decorators.SucceedOnListenJs~GetOptions - * @returns {jibo.bt.decorators.SucceedOnListenJs~Options} - */ - -/** - * Called when the {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} is constructed. - * @callback jibo.bt.decorators.SucceedOnListenJs~OnResult - * @param {jibo.bt.ListenEmitter} listener Use this instance to listen for listen events. - */ - -/** - * @class SucceedOnListenJs - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description Performs audio speech recognition and applies and parses the results according to a rules file. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {jibo.bt.decorators.SucceedOnListenJs~GetOptions} options.getOptions Returns the options object. - * @param {Function} options.getRule This function returns a string representation of a rule. Use this decorator to dynamically generate rules files instead - * of loading a rule file from disk. - * @param {jibo.bt.decorators.SucceedOnListenJs~OnResult} options.onResult Called and passed a {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} object. Events are fired from the Listener - * at certain points in this behavior's lifecycle. - */ - -/** - * Definition of the reusable dialog listen behavior class - */ - - /** - * Only gets called when stopped from Behavior tree - */ \ No newline at end of file diff --git a/docs/bt/decorators/TimeoutFail.js b/docs/bt/decorators/TimeoutFail.js deleted file mode 100644 index 5ab8a688..00000000 --- a/docs/bt/decorators/TimeoutFail.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @class TimeoutFail - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description Forces the behavior it's decorating to fail after the specified amount of time. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {number} options.timeout - Time in milliseconds until `TimeoutFail` forces the behavior it's decorarting to fail. - */ \ No newline at end of file diff --git a/docs/bt/decorators/TimeoutSucceed.js b/docs/bt/decorators/TimeoutSucceed.js deleted file mode 100644 index 1b35cadc..00000000 --- a/docs/bt/decorators/TimeoutSucceed.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @class TimeoutSucceed - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description - * Forces the behavior it's decorating to succeed after the specified amount of time. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {number} options.timeout - Time in milliseconds until `TimeoutSucceed` forces the behavior it's decorating to succeed. - */ \ No newline at end of file diff --git a/docs/bt/decorators/TimeoutSucceedJs.js b/docs/bt/decorators/TimeoutSucceedJs.js deleted file mode 100644 index faec3d8f..00000000 --- a/docs/bt/decorators/TimeoutSucceedJs.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @callback jibo.bt.decorators.TimeoutSucceedJs~GetTime - * @returns {number} Time in milliseconds. - */ - -/** - * @class TimeoutSucceedJs - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description - * `TimeoutSucceedJs` forces the behavior it's decorating to succeed after the specified amount of time. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {jibo.bt.decorators.TimeoutSucceedJs~GetTime} options.getTime - Time in milliseconds until `TimeoutJs` forces the behavior it's decorating to succeed. - */ \ No newline at end of file diff --git a/docs/bt/decorators/WhileCondition.js b/docs/bt/decorators/WhileCondition.js deleted file mode 100644 index 8d0ee7df..00000000 --- a/docs/bt/decorators/WhileCondition.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @callback jibo.bt.decorators.WhileCondition~Conditional - * @returns {boolean} `true` when you want component to restart. - */ - -/** - * @class WhileCondition - * @extends jibo.bt.Decorator - * @memberof jibo.bt.decorators - * @description When `WhileCondition`'s component succeeds, `WhileCondition` - * will evaluate its conditional. If it evaluates to `true`, `WhileCondition` will - * start its component again. If the conditional evaluates to `false`, `WhileCondition` - * returns the status of its component. - * @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options. - * @param {Function} [options.init] - Initialization function. - * @param {jibo.bt.decorators.WhileCondition~Conditional} options.conditional - The conditional to evaluate. - */ \ No newline at end of file diff --git a/docs/bt/decorators/index.js b/docs/bt/decorators/index.js deleted file mode 100644 index d5f643bc..00000000 --- a/docs/bt/decorators/index.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Behavior Tree decorator classes. - * @namespace jibo.bt.decorators - */ \ No newline at end of file diff --git a/docs/bt/mim/AsrMetadata.js b/docs/bt/mim/AsrMetadata.js deleted file mode 100644 index e188ab1d..00000000 --- a/docs/bt/mim/AsrMetadata.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @interface jibo.bt.behaviors.Mim~AsrMetadata - * @private - * @description Type of metadata supplied to ASR about MIM listens. Not exposed outside the library. - * @prop {String} interactionId - UUID for that instance of a MIM. - * @prop {String} mimId - ID for the MIM file being used. - * @prop {String} mimType - The type of MIM. - * @prop {String} skill - The name of the skill in use. - * @prop {String} mimState - The state of the MIM. - * @prop {Number} noMatches - The number of no match errors that the MIM has had. - * @prop {Number} noInput - The number of no input errors that the MIM has had. - * @prop {String} lastPromptId - The ID of the last MIM prompt to play. - * @prop {String} [activityName] - Flow only: The name of the MIM activity in the flow. - * @prop {String} [activityId] - Flow only: The uuid of the MIM activity in the flow. - * @prop {String} [flowFile] - Flow only: The flow file that the MIM activity is in. - */ \ No newline at end of file diff --git a/docs/bt/mim/MimConfig.js b/docs/bt/mim/MimConfig.js deleted file mode 100644 index 8251cc05..00000000 --- a/docs/bt/mim/MimConfig.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * MIM configuration data generated from the .mim files. - * @class MimConfig - * @memberof jibo.mim - * @private - */ - - /** - * Promised loading of a single .mim file. - * @method jibo.mim.MimConfig~load - * @param {string} filePath Path to the .mim file. - * @returns {Promise} Promise to load a new MimConfig instance. - * @static - */ - - /** - * If the Mim has a gui available, either as sampleUtterances or guiConfig. - * @name jibo.mim.MimConfig~hasGui - * @type {Boolean} - * @readOnly - */ - - /** - * Find a prompt by id and get the original prompt text for it. - * @method jibo.mim.MimConfig#getOriginalPromptText - * @param {string} id Prompt id to get the text for. - * @return {String} The original prompt text string. - */ - - /** - * Pick a prompt and get the text for it. - * @method jibo.mim.MimConfig~getPromptText - * @param {jibo.mim.MimState} mimState State of the active MIM. - * @param {any} promptData Dictionary of variables to use for condition evaluation and text replacement. - * @param {jibo.kb.Node} [rotationNode] Node used to store data - * @return {Object} An object with 'text', 'id', and 'autoRuleOverride' properties. - */ - - /** - * Generate a view config object for the MIM GUI, using the javascript code from the .mim file. - * @method jibo.mim.MimConfig~getJavascriptGUI - * @param {any} promptData Prompt data for the MIM - * @return {any} The generated view config object - */ - - /** - * See if MimConfig has error prompts of the corresponding type and index. - * @method jibo.mim.MimConfig~hasErrorPrompt - * @param {String} error The error type - * @param {Number} index The prompt index - * @return {Boolean} - */ - - /** - * See if MimConfig has at least one verbose prompt. - * @method jibo.mim.MimConfig~hasVerbosePrompt - * @return {Boolean} - */ - - /** - * See if MimConfig has at least one truncated prompt. - * @method jibo.mim.MimConfig~hasTruncatedPrompt - * @return {Boolean} - */ - - /** - * See if MimConfig has at least one thanks prompt. - * @method jibo.mim.MimConfig~hasThanksPrompt - * @return {Boolean} - */ \ No newline at end of file diff --git a/docs/bt/mim/MimManager.js b/docs/bt/mim/MimManager.js deleted file mode 100644 index 8b74a452..00000000 --- a/docs/bt/mim/MimManager.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Singleton for hooking into the MIM system. - * @namespace jibo.mim - */ - - /** - * The default listen delegate class, for extending to make more advanced delegates. - * @name jibo.mim~GlobalListenDelegate - * @type {jibo.mim.GlobalListener} - * @private - */ - - /** - * In the currently active MIM, respond to a 'hey jibo' happening. MIMs could listen to - * GlobalListen directly, but getting events through here allows us to limit the event to - * the currently active MIM, in case a MIM is running another MIM. - * @name jibo.mim#heyJibo - * @type {Event} - * @private - */ - - /** - * In the currently active MIM, respond to the completion of a HJ event in which the MIM should - * continue. This includes HJ Only, HJ No Match, and Non Interrupting Global events. - * @name jibo.mim#heyJiboComplete - * @type {Event} - * @private - */ - - /** - * If a Hey Jibo event currently active. Used by MIMs to determine when they started during an - * active HJ event. - * @name jibo.mim#isHeyJiboActive - * @type {boolean} - * @private - */ - - /** - * If `true`, Question MIMs time out after the specfied `timeout` when run in the simulator. - * If `false` (default), time out when `enter` key is pressed. - * @name jibo.mim~timeoutIgnoresSimulator - * @type {Boolean} - */ - - /** - * MimRepeatManager instance with loaded MIM data. - * @name jibo.mim~repeat - * @type {jibo.mim.MimRepeatManager} - * @private - */ - - /** - * Promise to load MIM data used by all MIMs as global prompts. - * @name jibo.mim~globalMimLoad - * @type {Promise} - * @private - */ - - /** - * MIM data used by potentially all MIMs as response to the 'thanks' MIM global. - * @name jibo.mim~thanksResponse - * @type {jibo.mim.MimConfig} - * @private - */ - - /** - * Listen delegate to be used by all MIMs to handle listening. - * @name jibo.mim~listenDelegate - * @type {ListenDelegate} - * @private - */ - - /** - * Speaking delegate to be used by all MIMs to handle speech. - * @name jibo.mim~speakDelegate - * @type {SpeakDelegate} - * @private - */ - - /** - * Root node of the KB model used to store prompt rotation info for MIMs within the `jibo` - * module. - * @name jibo.mim~jiboRotationNode - * @type {jibo.kb.Node} - * @private - */ - - /** - * KB Models for each skill. These are kept in memory, because it isn't that much memory, and - * gives us slightly faster access when we use multiple MIMs from one skill. Also, right now - * everything lives in one process that never shuts down, and it won't matter when we have - * each skill in a separate process. - * @name jibo.mim~kbModels - * @type {Object.} - * @private - */ - - /** - * Loads the root node of a KB slice specific to an asset pack, so that data about prompt - * rotation can be persisted. - * @method jibo.mim~loadMimKB - * @param {string} assetPack The name of the skill/asset pack that the MIM is loaded from. - * @return {Promise} The root node for that asset pack. - * @private - */ - - /** - * Start loading any assets the Mims need. Called on creation of the first Mim. Mim does not - * wait for asset load to complete before continuing. - * @method jibo.mim~loadMimAssets - * @private - */ - - /** - * Attach listeners for HJ and HJ ending events - * @method jibo.mim~attachHJListeners - * @private - */ - - /** - * Callback for Hey Jibo events from the listening service. - * @method jibo.mim~onHeyJiboHeard - * @private - */ - - /** - * Listener for Hey Jibo Only events, for recovering from the MIM's waitForHJEnd state. - * @method jibo.mim#onHJOnly - * @private - */ - - /** - * Listener for Hey Jibo No Match events, for recovering from the MIM's waitForHJEnd state. - * @method jibo.mim#onHJNoMatch - * @private - */ - - /** - * Listener for Non Interrupting Global events, for recovering from the MIM's waitForHJEnd state. - * @method jibo.mim#onShortGlobal - * @private - */ - - /** - * Listener for the end of HJ listens that don't allow a MIM to continue - skill relaunches, - * interrupting globals, etc. - * @method jibo.mim#onHJEnd - * @private - */ \ No newline at end of file diff --git a/docs/bt/mim/MimPrompt.js b/docs/bt/mim/MimPrompt.js deleted file mode 100644 index 2c638024..00000000 --- a/docs/bt/mim/MimPrompt.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Individual prompt within a MIM. Generated by MimConfig from the .mim file. - * @class MimPrompt - * @memberof jibo.mim - * @private - */ - - /** - * Get prompt data. Returns the prompt property. - * @method jibo.mim.MimPrompt~getPromptText - * @returns {String} The prompt - */ \ No newline at end of file diff --git a/docs/bt/mim/MimRepeatManager.js b/docs/bt/mim/MimRepeatManager.js deleted file mode 100644 index 2f51c038..00000000 --- a/docs/bt/mim/MimRepeatManager.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Define how an individual repeat request should be handled. - * @class MimRepeat - * @memberof jibo.mim - * @private - */ - - /** - * Prepend prompt to whatever Jibo repeats. Play alone if it's the last repeat allowed. - * @name jibo.mim.MimRepeat#result - * @type {String} - * @readOnly - */ - - /** - * Take specified action after prompt is played. If 'cached', use exact prompt played when Mim - * was entered. If 'verbose', play verbose prompt or fall back to cached prompt. If 'exit', do - * not play a prompt & quit skill. - * @name jibo.mim.MimRepeat#result - * @type {String} - * @readOnly - */ - -/** - * Manage how Mim repeat requests are handled. - * Instantiate this class to start loading the Announcement Mims to use when Jibo is asked to repeat - * himself. - * @class MimRepeatManager - * @memberof jibo.mim - * @private - */ - - /** - * Maximum number of repeats allowed before before skill should exit. - * @name jibo.mim.MimRepeatManager#maxRepeat - * @type {Number} - * @readOnly - */ - - /** - * Starts loading the default list SFX, for use by lists and Mim GUIs. - * @method jibo.mim.MimRepeatManager~getRepeat - * @param {String} mimType The type of the current Mim (question, announcement, optional-response). - * @param {Number} repeatCount The number of times that the user has requested a repeat (starting at 1 for the first time). - * @returns {jibo.mim.MimRepeat} Information on how to handle the repeat request. - */ \ No newline at end of file diff --git a/docs/bt/mim/MimState.js b/docs/bt/mim/MimState.js deleted file mode 100644 index 3e8f0dd9..00000000 --- a/docs/bt/mim/MimState.js +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Enum of the different states that a MIM could be in. This controls what prompt is played. - * @typedef jibo.mim~States - * @prop ENTRY {string} 'entry' - * @prop MATCH {string} 'match' - * @prop NO_MATCH {string} 'noMatch' - * @prop NO_INPUT {string} 'noInput' - * @prop REPEAT {string} 'repeat' - * @prop THANKS {string} 'thanks' - * @prop HOLD_RETURN {string} 'holdReturn' - * @prop VERBOSE {string} 'verbose' - * @prop TRUNCATED {string} 'truncated' - * @prop MENU_CLOSED {string} 'MenuClosed' - Only used as an exit state, when the MIM GUI is closed. - */ - -/** - * Keep track of the state of the active MIM. Returned by MIM callbacks. - * @class MimState - * @memberof jibo.mim - */ - - /** - * Number of no-input errors that have happened. - * @name jibo.mim.MimState~noInputCount - * @type {Number} - */ - - /** - * Number of no-match errors that have happened. - * @name jibo.mim.MimState~noMatchCount - * @type {Number} - */ - - /** - * Type of the MIM result. - * @name jibo.mim.MimState~lastResultState - * @type {jibo.mim~States} - */ - - /** - * `true` if the MIM has succeeded. - * @name jibo.mim.MimState~success - * @type {Boolean} - */ - - /** - * `true` if the MIM has failed (too many no inputs or no matches). - * @name jibo.mim.MimState~failure - * @type {Boolean} - */ - - /** - * The last used prompt text. - * @name jibo.mim.MimState~promptText - * @type {String} - * @private - */ - - /** - * The auto rule override settings of the last used prompt. - * @name jibo.mim.MimState~promptAutoRules - * @type {String} - * @private - */ - - /** - * Reset the MimState so that a mim can be restarted. - * @method jibo.mim.MimState~reset - * @private - */ - - /** - * If the MIM is complete, due to success or failure. - * @name jibo.mim.MimState~done - * @type {Boolean} - */ - - /** - * Total number of (no input, no match) errors that has happened during this MIM. - * @name jibo.mim.MimState~errors - * @type {Number} - */ - - /** - * Increase the number of misses due to no-input errors that this MIM has had. - * Also inform the MimManager that an error happened. - * @method jibo.mim.MimState~incrementNoInputCount - * @private - */ - - /** - * Increase the number of misses due to no-match errors that this MIM has had. - * Also inform the MimManager that an error happened. - * @method jibo.mim.MimState~incrementNoMatchCount - * @private - */ - - /** - * Compare the MIM state to the config file to see if a GUI should be shown. - * @method jibo.mim.MimState~shouldShowGUI - * @param {jibo.mim.MimConfig} config The config for the active MIM. - * @return {Boolean} `true` if the MIM's GUI should be shown. - * @private - */ \ No newline at end of file diff --git a/docs/bt/mim/WeightedRotation.js b/docs/bt/mim/WeightedRotation.js deleted file mode 100644 index f9d8dba8..00000000 --- a/docs/bt/mim/WeightedRotation.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Items for weighted rotation require an id and a weight. - * @private - */ - -/** - * Because we need to modify weights, these will be created for each weighted item during - * selection. Not exposed outside WeightedRotation.ts - * @private - */ - -/** - * Selects an item from a list, using weighting and enforced rotation. - * @param {WeightedItem[]} itemList The list of items to choose from. - * @param {Function} validCheck Function to see if an individual item is valid. - * @param {Object} [usedDict] Dictionary of used items, passed in by reference. If null, enforced - * rotation is not used. - * @private - */ - -/** - * Selects an item from a list, using weighting and enforced rotation (if usedDict is passed in). - * Is not exposed otuside of WeightedRotation.ts - * @param {WeightedItem[]} items The list of items to choose from. - * @param {WeightedItem[]} usedItems List of already used items, to add to if needed - * @param {Object} [usedDict] Dictionary of used items, passed in by reference. If null, enforced - * rotation is not used. - * @private - */ \ No newline at end of file diff --git a/docs/bt/mim/analytics/Analytics.js b/docs/bt/mim/analytics/Analytics.js deleted file mode 100644 index b829eabc..00000000 --- a/docs/bt/mim/analytics/Analytics.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * An interface for analytics objects for MIM usage. - * @memberof jibo.mim.analytics - * @private - */ - -/** - * A default analytics object that does nothing. This is to be replaced by Be, which knows about - * the correct way to handle the analytics events. - * @class EmptyAnalytics - * @memberof jibo.mim.analytics - * @private - */ \ No newline at end of file diff --git a/docs/bt/mim/analytics/MimAnalytics.js b/docs/bt/mim/analytics/MimAnalytics.js deleted file mode 100644 index af64e24a..00000000 --- a/docs/bt/mim/analytics/MimAnalytics.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Interface describing data that is attached to each MIM analytics event. - * @private - */ - -/** - * Enum for different ways that MIMs can exit - * @private - */ - -/** - * Enum for states in which the MIM could be interrupted (that we care about) - * @private - */ - -/** - * Enum for different methods of input for MIMs - * @private - */ - -/** - * Value for properties where they are not relevant or there is no data available. - * @private - */ - -/** - * Sends analytics event for the end of a MIM - * @private - */ - -/** - * Sends analytics event for the beginning of a MIM - * @private - */ - -/** - * Sends analytics event for a user response that does not end the MIM (like thanks/repeat) - * @private - */ - -/** - * Sends analytics event for a user response that wouldn't end the MIM, but it isn't being handled for some reason - * @private - */ - -/** - * Sends analytics event for a No Match error - * @private - */ - -/** - * Sends analytics event for a No Input error - * @private - */ \ No newline at end of file diff --git a/docs/bt/mim/delegates/BasicSpeakDelegate.js b/docs/bt/mim/delegates/BasicSpeakDelegate.js deleted file mode 100644 index c18068a1..00000000 --- a/docs/bt/mim/delegates/BasicSpeakDelegate.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Delegate for speaking using the standard TTS system. - * @class BasicSpeakDelegate - * @memberof jibo.mim - * @private - */ - - /** - * Speak text, passing the options directly to the TTS system. - * @method jibo.mim.BasicSpeakDelegate#stop - * @param {any} options Speech options, including text. - * @return {Promise} - */ - - /** - * Stop the TTS. - * @method jibo.mim.BasicSpeakDelegate#stop - */ \ No newline at end of file diff --git a/docs/bt/mim/delegates/GlobalListenDelegate.js b/docs/bt/mim/delegates/GlobalListenDelegate.js deleted file mode 100644 index 0ab8fb4c..00000000 --- a/docs/bt/mim/delegates/GlobalListenDelegate.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Delegate for MimManager to use global listening for all listening. - * @class GlobalListener - * @memberof jibo.mim - * @private - */ - - /** - * Sets the ambient listen mode. - * @method jibo.mim.GlobalListener#setAmbientMode - * @param {string} mode Option from {jibo.embodied.listen#AmbientListenMode} to set the mode to. - * @static - */ - - /** - * Sets the active listen mode. - * @method jibo.mim.GlobalListener#enterActiveMode - * @param {string} mode Option from {jibo.embodied.listen#ActiveListenMode} to set the active mode to. - * @param {jibo.embodied.listen.ActiveModeOptions} [options] - Configuration Options consumed by the different Active Modes - * @returns {Promise} Resolves once Embodied Listen is in - * requested Active Mode or interrupted by another Active Mode request. - * @static - */ - - /** - * Sets the active listen mode. - * @method jibo.mim.GlobalListener#exitActiveMode - * @returns {Promise} Resolves when Embodied Listen returns to Idle - * @static - */ - - /** - * Create a GlobalListener instance to use. - * @method jibo.mim.GlobalListener#create - * @param {jibo.jetstream.types.LocalTurnOptions} options The listening options. - * @returns {GlobalListener} The GlobalListener instance. - * @static - */ - - /** - * Stop listening. - * @method jibo.mim.GlobalListener#stop - * @param {boolean} [cancelTurn=true] Whether we should cancel Jetstream Turn. - */ \ No newline at end of file diff --git a/docs/deprecation.js b/docs/deprecation.js deleted file mode 100644 index 3ce84dca..00000000 --- a/docs/deprecation.js +++ /dev/null @@ -1,573 +0,0 @@ - /** - * @class - * @name SerialTimer - * @memberof jibo.utils - * @see jibo.utils.perf.SerialTimer - * @deprecated since version 2.1.0 - * @private - */ - - /** - * @class - * @name ParallelTimer - * @memberof jibo.utils - * @see jibo.utils.perf.ParallelTimer - * @deprecated since version 2.1.0 - * @private - */ - - /** - * @name jibo.bodySettings - * @deprecated since 1.1.0 - * @see jibo.settings - */ - - /** - * @name jibo.body - * @deprecated since 4.2.6 - * @see jibo.settings - */ - - /** - * @name jibo.audio - * @deprecated since 4.2.6 - * @see jibo.settings - */ - - /** - * Gets the base directory and the name of the project. - * @method jibo.utils.PathUtils~getBaseDirectory - * @deprecated since 3.1.0 - * @see jibo.utils.PathUtils#findRoot - */ - - /** - * Gets the project root running jibo. - * @method jibo.utils.PathUtils~getProjectRoot - * @deprecated since 3.1.0 - * @see jibo.utils.PathUtils#findRoot - */ - - /** Load a list of nodes by id. All KBs in this Model will be - * searched, in order, for each id in the array. An empty array is - * returned (via callback) if none of the ids are found. If - * callback is omitted a promise is returned instead. - * - * @method jibo.kb.Model#loadList - * @memberof jibo.kb - * @see jibo.kb.Model#load - * @deprecated since version 6.0.0 - */ - - /** Fetch a list of nodes by id from cache synchronously. Use on - * models created with `begin()` and preloaded with nodes. - * - * @method jibo.kb.Model#fetchList - * @memberof jibo.kb - * @see jibo.kb.Model#fetch - * @deprecated since version 6.0.0 - */ - - /** - * @name jibo.bt.factory - * @deprecated since 1.1.0 - * @see jibo.bt - */ - - /** - * Current status of the behavior tree. - * @type {String} - * @name jibo.bt.BehaviorTree~status - * @deprecated since 4.0.0 - * @see jibo.bt.BehaviorTree#currentStatus - */ - - /** - * Same constant as `ViewManager.TRANS_UP`, made accessible via `jibo.face.views` for convenience - * @method jibo.rendering.gui.ViewManager#UP - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.UP - */ - - /** - * Same constant as `ViewManager.TRANS_DOWN`, made accessible via `jibo.face.views` for convenience - * @method jibo.rendering.gui.ViewManager#DOWN - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.DOWN - */ - - /** - * Same constant as `ViewManager.TRANS_RIGHT`, made accessible via `jibo.face.views` for convenience - * @method jibo.rendering.gui.ViewManager#RIGHT - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.RIGHT - */ - - /** - * Same constant as `ViewManager.TRANS_LEFT`, made accessible via `jibo.face.views` for convenience - * @method jibo.rendering.gui.ViewManager#LEFT - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.LEFT - */ - - /** - * Same constant as `ViewManager.TRANS_IN`, made accessible via `jibo.face.views` for convenience - * @method jibo.rendering.gui.ViewManager#IN - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.IN - */ - - /** - * Same constant as `ViewManager.TRANS_OUT`, made accessible via `jibo.face.views` for convenience - * @method jibo.rendering.gui.ViewManager#OUT - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.OUT - */ - - /** - * Same constant as `ViewManager.TRANS_NONE`, made accessible via `jibo.face.views` for convenience - * @method jibo.rendering.gui.ViewManager#NONE - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.NONE - */ - - /** - * Transition type for view components to move upwards. - * @method jibo.rendering.gui.ViewManager~TRANS_UP - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.UP - */ - - /** - * Transition type for view components to move downwards. - * @method jibo.rendering.gui.ViewManager~TRANS_DOWN - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.DOWN - */ - - /** - * Transition type for view to move right. - * @method jibo.rendering.gui.ViewManager~TRANS_RIGHT - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.RIGHT - */ - - /** - * Transition type for view to move left. - * @method jibo.rendering.gui.ViewManager~TRANS_LEFT - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.LEFT - */ - - /** - * Transition type for view to fade and scale in from center of screen. - * @method jibo.rendering.gui.ViewManager~TRANS_IN - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.IN - */ - - /** - * Transition type for view to or from eye. - * Use in conjunction with custom View transitions. - * @method jibo.rendering.gui.ViewManager~TRANS_EYE - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.EYE - */ - - /** - * Transition type for view to fade and scale out from center of screens. - * @method jibo.rendering.gui.ViewManager~TRANS_OUT - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.OUT - */ - - /** - * Transition type for no transition. - * @method jibo.rendering.gui.ViewManager~TRANS_NONE - * @deprecated since 7.8.4 - * @see jibo.face.views.TRANSITION.NONE - */ - - /** - * Transition type for no transition. - * @method jibo.rendering.gui.ViewManager~NONE - * @deprecated since 4.1.0 - * @see jibo.face.views#NONE - */ - - /** - * View status triggered once view's init method has been called. - * The same constant is statically accessible via `STATE.INITIALIZED`. - * @name jibo.face.views#INITIALIZED - * @deprecated since 8.1.0 - * @see jibo.face.views.STATE.INITIALIZED - */ - - /** - * View status triggered once initial data has been loaded and configurations set. - * The same constant is statically accessible via `STATE.DATA_LOADED`. - * @name jibo.face.views#DATA_LOADED - * @deprecated since 8.1.0 - * @see jibo.face.views.STATE.DATA_LOADED - */ - - /** - * View status triggered once initial assets have been loaded. - * The same constant is statically accessible via `STATE.ASSETS_LOADED`. - * @name jibo.face.views#ASSETS_LOADED - * @deprecated since 8.1.0 - * @see jibo.face.views.STATE.ASSETS_LOADED - */ - - /** - * View status triggered once loading is complete, at point of dispatch View should be ready for use. - * The same constant is statically accessible via `STATE.LOADED`. - * @name jibo.face.views#LOADED - * @deprecated since 8.1.0 - * @see jibo.face.views.STATE.LOADED - */ - - /** - * View status triggered once View has completed its opening transition. - * The same constant is statically accessible via `STATE.OPENED`. - * @name jibo.face.views#OPENED - * @deprecated since 8.1.0 - * @see jibo.face.views.STATE.OPENED - */ - - /** - * View status triggered once View has completed its closing transition. - * The same constant is statically accessible via `STATE.CLOSED`. - * @name jibo.face.views#CLOSED - * @deprecated since 8.1.0 - * @see jibo.face.views.STATE.CLOSED - */ - - /** - * Category for views that contain an interactive user interface. - * The same constant is statically accessible via `CATEGORY.GUI`. - * @name jibo.face.views#CATEGORY_GUI - * @deprecated since 8.1.0 - * @see jibo.face.views.CATEGORY.GUI - */ - - /** - * Category for views that are primarily used for display and not for interaction. - * The same constant is statically accessible via `CATEGORY.DISPLAY`. - * @name jibo.face.views#CATEGORY_DISPLAY - * @deprecated since 8.1.0 - * @see jibo.face.views.CATEGORY.DISPLAY - */ - - /** - * Category for EyeView type views. - * The same constant is statically accessible via `CATEGORY.EYE`. - * @name jibo.face.views#CATEGORY_EYE - * @deprecated since 8.1.0 - * @see jibo.face.views.CATEGORY.EYE - */ - - /** - * Tap gesture type. - * The same constant is statically accessible via `GESTURE.TAP`. - * @name jibo.face.views.TAP - * @deprecated since 8.1.0 - * @see jibo.face.views.GESTURE.TAP - */ - - /** - * Swipe down gesture type. - * Swipes currently only works for Views. - * The same constant is statically accessible via `GESTURE.SWIPE_DOWN`. - * @name jibo.face.views.SWIPE - * @deprecated since 8.1.0 - * @see jibo.face.views.GESTURE.SWIPE_DOWN - */ - - /** - * Option for setting custom transitions. - * Use with `View.setTransitions` to define custom transitions for adding a View to the view stack. - * @type {number} - * @name jibo.face.views.STACK_ADD - * @deprecated since 8.1.0 - * @see jibo.face.views~STACK_DIRECTION - */ - - /** - * Option for setting custom transitions. - * Use with `View.addTransition` to define custom transitions for removing a View from the view stack - * @type {number} - * @name jibo.face.views.STACK_REMOVE - * @deprecated since 8.1.0 - * @see jibo.face.views~STACK_DIRECTION - */ - - /** - * Option for setting custom transitions. - * Use with `View.addTransition` to define custom transitions where views are swapped, - * this would be when the currentvIew is removed and a new one is added so that the view stack length remians unchanged. - * @type {number} - * @name jibo.face.views.STACK_SWAP - * @deprecated since 8.1.0 - * @see jibo.face.views~STACK_DIRECTION - */ - - /** - * Close all currently active views and open the 'root' view (EyeView). - * @method jibo.face.views#closeAll - * @deprecated 4.1.0 - * @see jibo.face.views#removeAll - */ - - /** - * Close all currently active views up to the root, then add View. - * @method jibo.face.views#closeAllThenAdd - * @deprecated since 4.1.0 - * @see jibo.face.views#removeAllThenAdd - */ - - /** - * Close all currently active views up to the root view but do not open the root view, instead leave an empty screen. - * @method jibo.face.views#closeAllLeaveEmpty - * @deprecated since 4.1.0 - * @see jibo.face.views#removeAllLeaveEmpty - */ - - /** - * Remove the currently displayed View, but do not open the view beneath so that the display is left empty. - * Use when you don't know what the next view will be (i.e. switching skills). - * If current view paused the previous view, proceed as if removeView has been called - * @method jibo.face.views#removeViewLeaveEmpty - * @deprecated since 5.0.0 - * @see jibo.face.views#changeView - */ - - /** - * Close all currently active views up to the root, then add {@link jibo.face.views.View}. - * The newly added view will be one above the root once opened.ed - * @method jibo.face.views#removeAllThenAdd - * @deprecated since 5.0.0 - * @see jibo.face.views#changeView - */ - - /** - * Close all currently active views up to root view. Do not open root; leave screen empty. - * Use when next view is unknown, i.e.switching between skills. - * @method jibo.face.views#removeAllLeaveEmpty - * @deprecated since 5.0.0 - * @see jibo.face.views#changeView - */ - - /** - * Close all currently active views and open the 'root' view ({@link jibo.face.views.EyeView}). - * @method jibo.face.views#removeAll - * @deprecated since 5.0.0 - * @see jibo.face.views#changeView - */ - - /** - * Tap gesture type. - * @name jibo.face.views.TouchManager.TAP - * @deprecated since 8.1.0 - * @see jibo.face.views.GESTURE.TAP - */ - - /** - * Swipe down gesture type. - * @name jibo.face.views.TouchManager.SWIPE - * @deprecated since 8.1.0 - * @see jibo.face.views.GESTURE.SWIPE_DOWN - */ - - /** - * Pan horizontal gesture type. - * @name jibo.face.views.TouchManager.PAN - * @deprecated since 8.1.0 - * @see jibo.face.views.GESTURE.PAN - */ - - /** - * Setup View to trigger its actions list when the hitArea ia clicked. - * @method jibo.face.views#setupScreenClick - * @deprecated since 5.5.2 - * @see jibo.face.views.View#setupScreenClick - */ - - /** - * Intialize the data. - * @method jibo.face.views.View~INITIALIZED - * @deprecated since 8.1.0 - * @see jibo.face.views~STATE.INITIALIZED - */ - - /** - * State set and emitted once initial data has been loaded and configurations set. - * @method jibo.face.views.View~DATA_LOADED - * @deprecated since 8.1.0 - * @see jibo.face.views~STATE.DATA_LOADED - */ - - /** - * State set and emitted once initial assets have been loaded. - * @method jibo.face.views.View~ASSETS_LOADED - * @deprecated since 8.1.0 - * @see jibo.face.views~STATE.ASSETS_LOADED - */ - - /** - * State set and emitted once loading is complete, at point of dispatch View should be ready for use. - * @method jibo.face.views.View~LOADED - * @deprecated since 8.1.0 - * @see jibo.face.views~STATE.LOADED - */ - - /** - * State set and emitted once View has completed its opening transition. - * @method jibo.face.views.View~OPENED - * @deprecated since 8.1.0 - * @see jibo.face.views~STATE.OPENED - */ - - /** - * State set and emitted once View has completed its closing transition. - * @method jibo.face.views.View~CLOSED - * @deprecated since 8.1.0 - * @see jibo.face.views~STATE.CLOSED - */ - - /** - * State set and emitted View has been destroyed. - * @method jibo.face.views.View~DESTROYED - * @deprecated since 8.1.0 - * @see jibo.face.views~STATE.DESTROYED - */ - - /** - * Event emitted if there is a load error. - * @method jibo.face.views.View~LOAD_ERROR - * @deprecated since 8.1.0 - * @see jibo.face.views~STATE.LOAD_ERROR - */ - - /** - * Category for views that contain an interactive user interface. - * @name jibo.face.views.View.CATEGORY_GUI - * @deprecated since 8.1.0 - * @see jibo.face.views~CATEGORY.GUI - */ - - /** - * Category for views that are primarily used for display and not for interfacing. - * @name jibo.face.views.View.CATEGORY_DISPLAY - * @deprecated since 8.1.0 - * @see jibo.face.views~CATEGORY.DISPLAY - */ - - /** - * Category for EyeView type views. - * @name jibo.face.views.View.CATEGORY_EYE - * @deprecated since 8.1.0 - * @see jibo.face.views~CATEGORY.EYE - */ - - /** - * @method - * @name jibo.bt~addBehavior - * @deprecated since 0.10.0 - * @see jibo.bt#register - */ - - /** - * Creates a behavior. - * @method - * @name jibo.bt~createBehavior - * @see jibo.bt#register - * @deprecated since 0.10.0 - */ - - /** - * Creates a decorator. - * @method - * @name jibo.bt~createDecorator - * @see jibo.bt#register - * @deprecated since 0.10.0 - */ - - /** - * @method - * @name jibo.bt~registerBehavior - * @deprecated since 1.1.0 - * @see jibo.bt#register - */ - - /** - * @method - * @name jibo.bt~registerDecorator - * @deprecated since 1.1.0 - * @see jibo.bt#register - */ - - /** - * Creates a behavior. - * @method - * @name jibo.bt.Behavior~setDecorators - * @deprecated since 1.1.0 - * @see jibo.bt.Behavior#decorators - */ - - /** - * Creates a behavior. - * @method - * @name jibo.bt.Behavior~getName - * @deprecated since 1.1.0 - * @see jibo.bt.Behavior#name - */ - - /** - * Creates a behavior. - * @method - * @name jibo.bt.ParentBehavior~setChildren - * @deprecated since 1.1.0 - * @see jibo.bt.ParentBehavior#children - */ - - /** - * @class - * @name AudioUtils - * @memberof jibo.utils - * @deprecated Since 3.0.0 - */ - - /** - * Creates and returns correct full audio path from given file; takes into account asset packs, etc. - * @method jibo.utils.AudioUtils~getPath - * @deprecated Since 3.0.0 - */ - - /** - * Creates a new "Audio" stream based on given audio path and project uri; returns the audio object. - * @method jibo.utils.AudioUtils~startAudio - * @deprecated Since 3.0.0 - */ - - /** - * @method jibo.media~getUrlById - * @deprecated Since 5.8.2 - * @see jibo.media#getUrl - */ - - /** - * - * Stop jibo using voice commands. - * @name jibo.globalEvents#stop - * @deprecated since 6.0.4 - * @see jibo.globalEvents#voiceStop - */ - - /** - * - * Stop jibo using touch commands - * @name jibo.globalEvents#touchOn - * @deprecated since 6.0.4 - * @see jibo.globalEvents#touchStop - */ \ No newline at end of file diff --git a/docs/flow/ActivityImplementation.js b/docs/flow/ActivityImplementation.js deleted file mode 100644 index 25aaa309..00000000 --- a/docs/flow/ActivityImplementation.js +++ /dev/null @@ -1,37 +0,0 @@ - /** - * Perform whatever pre-update setup is required. - * Return true for success, false for failure. - * If a failure, update will not be called. - * @method jibo.flow.ActivityImplementation#start - * @param {jibo.flow.Context} context The executor's context - * @returns {boolean} - */ - - /** - * Perform the activity's normal update action. This will continue to be - * called on every update tick until it returns SUCCEEDED or FAILED. - * @method jibo.flow.ActivityImplementation#update - * @param {jibo.flow.Context} context The executor's context - * @returns {jibo.bt.Status} - */ - - /** - * Stop any ongoing activity (called during the processing of Flow.Interrupt and general exceptions). - * This is provided so that an asynchronous activity can be stopped and its resources released. - * @method jibo.flow.ActivityImplementation#stop - * @param {jibo.flow.Context} context The executor's context - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - */ - - /** - * Destroy the activity, doing a full cleanup of any resources that need releasing. - * @method jibo.flow.ActivityImplementation#destroy - */ - - /** - * If the Flow has a transition or Flow.Catch in scope capable of handling the given JS exception, turn it into - * a Flow ~Exception.* and process it internally, otherwise stop Flow execution and throw the JS exception. - * @method jibo.flow.ActivityImplementation#formOrThrowException - * @param jsexception {Exception} Javascript Exception object to throw as a JS exception or convert to a Flow exception - * @returns {string} the name of the Flow Exception to be thrown - */ \ No newline at end of file diff --git a/docs/flow/ActivityImplementationFactory.js b/docs/flow/ActivityImplementationFactory.js deleted file mode 100644 index cfb2ce35..00000000 --- a/docs/flow/ActivityImplementationFactory.js +++ /dev/null @@ -1,48 +0,0 @@ - /** - * Given a Flow activity and the current Flow Executor, create the runtime implementation of the activity. - * @method jibo.flow.ActivityImplementationFactory#getImplementationOfActivity - * @param {jibo.flow.Activity} activity - The activity we wish to get the implementation of. - * @param {jibo.flow.FlowExecutor} flowExecutor - The current FlowExecutor. - * @param {any} optionCodeThis - object containing only an '.in' property, whose value is the 'this.out' from the previous activity executed. - * @returns {jibo.flow.ActivityImplementation} an ActivityImplementation for the given activity. - */ - - /** - * Given a Flow activity, return either a Flow-Activity or Behavior constructor for it. - * @method jibo.flow.ActivityImplementationFactory#getActivityOrBehaviorConstructor - * @param {jibo.flow.Activity} activity - The activity to find the constructor for. - * @returns {any} Object with an ActivityImplementation constructor or a Behavior constructor. - */ - - /** - * Return the JS Class name for the given activity. This is simply a permutation of the activity's Flow Type. - * (e.g. it converts Flow.Eval-Async to FlowEvalAsync) - * @param {jibo.flow.Activity} activity - The activity to find the constructor for. - * @returns {string} - The JS Class name of the activity's implementation. - */ - - /** - * Given a BehaviorConstructor, return the Flow implementation of a Behavior (really a Flow Class instance that wraps a Behavior Class instance). - * @method jibo.flow.ActivityImplementationFactory#getBehaviorClassInstance - * @param {jibo.bt.BehaviorConstructor} behaviorConstructor - The Behavior constructor for the Behavior or Decorator being wrapped by this Flow Activity. - * @param {jibo.flow.Activity} activity - The current Behavior-type Flow activity. - * @param {jibo.flow.FlowExecutor} flowExecutor - The current FlowExecutor. - * @param {any} optionCodeThis - The object being used for the "this" object in the option code. - * @returns {jibo.flow.FlowBehavior} - a FlowBehavior instance that wraps the instantiated Behavior. - */ - - /** - * Given an activity constructor, return the constructed activity. - * @param {any} activityConstructor - The ActivityImplementation constructor. - * @param {jibo.flow.Activity} activity - The current Flow activity. - * @param {jibo.flow.FlowExecutor} flowExecutor - The current FlowExecutor. - * @param {any} optionCodeThis - The object being used for the "this" object in the option code. - * @returns {jibo.flow.ActivityImplementation} an ActivityImplementation for the given activity. - */ - - /** - * Log the start of execution of every activity. - * @method jibo.flow.ActivityImplementationFactory#log - * @param {jibo.flow.Activity} activity - The Activity to log a record of. - * @param {jibo.flow.FlowExecutor} flowExecutor - The current FlowExecutor. - */ \ No newline at end of file diff --git a/docs/flow/Context.js b/docs/flow/Context.js deleted file mode 100644 index c7380ac8..00000000 --- a/docs/flow/Context.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * A Notepad object stores each procedure's "local" variables. - * @class Notepad - * @memberof jibo.flow - * @param {jibo.flow.Context} context The context that is referencing the notepad. - * @param {any} params The input parameters to the procedure, available as 'notepad.params' in the procedure. - * @param {jibo.flow.Environment} environment The global environment of the executing flow. - */ - - /** - * A hook so that non-Flow activities (i.e. Behaviors) can set the activity's output transition. - * Available as 'notepad.setTransition'. - * @param {string} transition - */ - -/** - * A Result object is provided during procedure execution to - * hold any outputs the procedure needs to return to the caller. - * It can be filled in as needed by the procedure (e.g. "result.foo = 42"). - * The Result object is made available to the caller throw the invoking Flow.Subflow activity - * (via the "subflow_result_object" parameter of the "getTransition" parameter). - * A procedure's Flow.End activity will always set result.transition. - * @class Result - * @memberof jibo.flow - */ - -/** - * A snapshot of all the relevant info in an exception. This is available as `notepad.FlowEnv.lastException` after an exception occurs. - * @class FlowExceptionInfo - * @property {string} name - The name of the exception, e.g. "~InteractionError.noMatch" - * @property {jibo.flow.ActivityImplementation} activity - The activity in which the exception occurred. Equivalent to `stackTrace[0].activity`. - * @property {jibo.flow.Procedure} procedure - The procedure in which the exception occurred. Equivalent to `stackTrace[0].procedure`. - * @property {Array} stackTrace - An array of objects corresponding to the stack at the time the exception occurred, each having a procedure and activity property. The first element in the array is the inner most frame (ie. where the exception occurred). - * @property {any} payload - An object containing further information about the exception. This may be provided by a `Flow.Throw` activity, or in the case of JS exceptions, is the information passed via the parameter to a JS `catch()` statement. - * @memberof jibo.flow - */ \ No newline at end of file diff --git a/docs/flow/FlowExecutor.js b/docs/flow/FlowExecutor.js deleted file mode 100644 index 7c66f3db..00000000 --- a/docs/flow/FlowExecutor.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Interface specifying what Overrides may be provided during FlowExecutor creation. - * @param {Blackboard} [blackboard] Override the default blackboard object for this flow. - * @param {Object} [notepad] Provide your own notepad object instead of the default one. - * @param {Object} [params] Provide parameters to the Flow code. - * @param {EventEmitter} [emitter] Provide your own emitter object instead of the default one shared with behavior trees. - * @param {jibo.flow.FlowExecutor} [flowExecutor] Provide your own Class for the FlowExecutor (primarly used with DebugFlowExecutor). - * @param {Boolean} [enableLogging] Turn on detailed logging as the flow executes. - * @param {Environment} [environment] Provide a pre-populated FlowEnvironment (normally an empty one is created automatically). - * @param {String} [assetPack] The asset pack name to use for loading assets in this tree. - */ - -/** - * Class representing a FlowExecutor. - * The FlowExecutor runs a FlowRoot. - * @class FlowExecutor - * @memberof jibo.flow - */ - - /** - * Step the primary flow and all parallel flows. - * @method jibo.flow.FlowExecutor#update - * @returns {boolean} - */ - - /** - * Step the flow engine. - * This is overridden by the DebugFlowExecutor so - * that it may intervene in the execution process. - */ - - /** - * Start the Flow Executor. - * This is effectively a nop since all the work is done through update(). - * @method jibo.flow.FlowExecutor#start - */ - - /** - * When FlowExecutor starts - * @event jibo.flow.FlowExecutor#start - */ - - /** - * Called to stop the Flow Executor. - * - * 1) Stop the current activity. - * 2) Emit `stop` to stop update ticks. - * @method jibo.flow.FlowExecutor#stop - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - */ - - /** - * When FlowExecutor stops. - * @event jibo.flow.FlowExecutor#stop - */ - - /** - * Called when the Flow executor has finished naturally (not via stop or exception). - * We simply emit events indicating that. - */ - - /** - * Send `stop` to the current activity of the Flow Executor in the primary thread. - * @method jibo.flow.FlowExecutor#stopCurrentActivity - */ - - /** - * Send `stop` to the current activity of the Flow Executor in the primary thread of the given context. - * @method jibo.flow.FlowExecutor#stopCurrentActivityInContext - */ - - /** - * Destroy the FlowExecutor. - * Stop the primary thread and destroy all parallel flows within its scope. - * The flow is no longer runnable. - * @method jibo.flow.FlowExecutor#destroy - */ - - /** - * Stop all the parallel flows. - * @method jibo.flow.FlowExecutor#destroyAsyncFlows - * @param {array} contexts the list of stack frames containing async flows to be destroyed - */ - - /** - * Stop and Destroy this flow. - * The flow is no longer runnable. - * @method jibo.flow.FlowExecutor#stopAndDestroy - * @return {Promise} A promise that resolves after any asynchronous cleanup has been performed. - */ \ No newline at end of file diff --git a/docs/flow/FlowExecutorFactory.js b/docs/flow/FlowExecutorFactory.js deleted file mode 100644 index 4a43cdc1..00000000 --- a/docs/flow/FlowExecutorFactory.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Utility methods for registering activities and creating flows. - * @class FlowExecutorFactory - * @namespace jibo.flow - */ - - /** - * Register an activity globally - * @method jibo.flow#register - * @param {String} name The PascalCased name for the behavior. - * @param {String} namespace This behavior's namespace. Pass in a globally unique name for this namesapce. - * @param {Module} classRef Class reference for the behavior or decorator. - */ - - /** - * Add all activities - * @method jibo.flow#registerCore - * @private - */ - - /** - * Give the Flow Executor access to the Activity constructors. - * @param {string} className - Final Class name (e.g. `FlowEvalAsync`) - * @param {string} [namespace] - Namespace of activity -- `core` if unsupplied. - * @returns {jibo.flow.ActivityImplementation} - Constructor of the activity or undefined if not found. - */ - - /** - * Create a runnable flow executor from a flow file import. - * @method jibo.flow#create - * @param {String|Function} uri Relative or absolute path to a `.flow` file or module export of flow. - * @param {FlowExecutorOverrides} [overrides] Options for populating flow globals. - * @returns {jibo.flow.FlowExecutor} - */ - - /** - * Create and run a runnable flow from a flow file import. - * ``` - * const jibo = require('jibo'); - * jibo.init('face', (err) => { - * jibo.flow.run('./flows/main', function(status){}); - * }); - * - * // Other supported APIs - * jibo.flow.run('./flows/main'); - * jibo.flow.run('./flows/main', (status) => {}); - * const overrides = {}; - * jibo.flow.run('./flows/main', overrides); - * jibo.flow.run('./flows/main', overrides, (status) => {}); - * ``` - * - * @method jibo.flow#run - * @param {String|Function} uri Relative or absolute path to a `.flow` file or module export of flow. - * @param {Object} [overrides] Used for supplying optional flow globals and setting FlowExecutor options. - * @param {jibo.bt.Blackboard} [overrides.blackboard] Override the default blackboard object for this flow. - * @param {Object} [overrides.notepad] Provide your own notepad object instead of the default one. - * @param {Object} [overrides.blackboard] Provide your own blackboard object instead of the default one shared with behavior trees. - * @param {Object} [overrides.emitter] Provide your own emitter object instead of the default one shared with behavior trees. - * @param {String} [overrides.assetPack] The asset pack name to use for loading assets in this tree. - * @param {boolean} [overrides.stopOnException] Set to true to cause the FlowExecutor to stop in the debugger with an explorable stacktrace. - * @param {boolean} [overrides.enableLogging] Set to true to cause the FlowExecutor to log an activity trace to the console as it executes. - * @param {function} onFinishedCallback The callback which gets called when the flow has reached a status of FAILED, SUCCEEDED, or INTERRUPTED. - * @returns {jibo.flow.FlowExecutor} - */ - - /** - * Resolve the path in relation to a calleeDirname directory. If the supplied uri is an absolute path, the uri is - * returned unmodified. - * @param {String} calleeDirname The directory name where the uri is relative to. - * @param {String} uri The relative or absolute uri to a file in relation to the calleeDirname. - * @returns {String} The result absolute path. - * @private - */ \ No newline at end of file diff --git a/docs/plugins/ActionPlugin.js b/docs/plugins/ActionPlugin.js deleted file mode 100644 index be4e43ae..00000000 --- a/docs/plugins/ActionPlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Installs the Action API, which can be found in the "jibo-action-system" module - * @class ActionPlugin - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/AnimDBPlugin.js b/docs/plugins/AnimDBPlugin.js deleted file mode 100644 index 2769cfc5..00000000 --- a/docs/plugins/AnimDBPlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Installs the AnimDB API, which can be found in the "jibo-anim-db" module - * @class AnimDBPlugin - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/AutobotPlugin.js b/docs/plugins/AutobotPlugin.js deleted file mode 100644 index a08c583f..00000000 --- a/docs/plugins/AutobotPlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Installs the Autobot API - * @class AutobotPlugin - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/DevShellPlugin.js b/docs/plugins/DevShellPlugin.js deleted file mode 100644 index bdfcdec3..00000000 --- a/docs/plugins/DevShellPlugin.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Jibo plugin designed to communicate with the DevShell service, if it's running - * in int-developer or developer mode - * @class DevShell - * @extends EventEmitter - * @implements Plugin - * @private - */ - - /** - * Called from skills manager - * @param command - */ \ No newline at end of file diff --git a/docs/plugins/EmbodiedPlugin.js b/docs/plugins/EmbodiedPlugin.js deleted file mode 100644 index 1f1b7ef4..00000000 --- a/docs/plugins/EmbodiedPlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Installs the Embodied API, which can be found in the "jibo-embodied-dialog" module - * @class EmbodiedPlugin - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/EmotionPlugin.js b/docs/plugins/EmotionPlugin.js deleted file mode 100644 index 08d3bdc7..00000000 --- a/docs/plugins/EmotionPlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Installs the Emotion API, which can be found in the "jibo-emotion-system" module - * @class Emotion - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/ExpressionPlugin.js b/docs/plugins/ExpressionPlugin.js deleted file mode 100644 index 85ec50cd..00000000 --- a/docs/plugins/ExpressionPlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Installs the DOF Arbiter API, which can be found in the "jibo-dof-arbiter" module - * @class DOFArbiterPlugin - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/FontsPlugin.js b/docs/plugins/FontsPlugin.js deleted file mode 100644 index 3cb87cca..00000000 --- a/docs/plugins/FontsPlugin.js +++ /dev/null @@ -1,3 +0,0 @@ -/** - * Preload the fonts needed for GUI - */ \ No newline at end of file diff --git a/docs/plugins/InteractionMemoryPlugin.js b/docs/plugins/InteractionMemoryPlugin.js deleted file mode 100644 index 3834b1c4..00000000 --- a/docs/plugins/InteractionMemoryPlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Installs the interaction memory API, which can be found in the "jibo-interaction-memory" module - * @class InteractionMemoryPlugin - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/Lifecycle.js b/docs/plugins/Lifecycle.js deleted file mode 100644 index 09219852..00000000 --- a/docs/plugins/Lifecycle.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Jibo plugin designed to communicate with Skills Service Manager - * mainly to dispatch events when shutting down, initializing or showing - * the current jibo skill. Available on `jibo.lifecycle` - * @class LifeCycle - * @extends EventEmitter - * @implements Plugin - * @private - */ - - /** - * Call when skill is done and wants to exit - */ - - /** - * Called from skills manager - * @param command - */ \ No newline at end of file diff --git a/docs/plugins/LocationPlugin.js b/docs/plugins/LocationPlugin.js deleted file mode 100644 index 17e849d6..00000000 --- a/docs/plugins/LocationPlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Initializes Jibo's location data - * @class LocationPlugin - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/MediaPlugin.js b/docs/plugins/MediaPlugin.js deleted file mode 100644 index eafddcd4..00000000 --- a/docs/plugins/MediaPlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Installs the Media API - * @class MediaPlugin - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/RegistryPlugin.js b/docs/plugins/RegistryPlugin.js deleted file mode 100644 index 83458e56..00000000 --- a/docs/plugins/RegistryPlugin.js +++ /dev/null @@ -1,3 +0,0 @@ -/** - * Fetch the registry host from the IPC host - */ \ No newline at end of file diff --git a/docs/plugins/RenderingPlugin.js b/docs/plugins/RenderingPlugin.js deleted file mode 100644 index 27f1cc62..00000000 --- a/docs/plugins/RenderingPlugin.js +++ /dev/null @@ -1,3 +0,0 @@ -/** - * Registers tasks with the loader related to rendering - */ \ No newline at end of file diff --git a/docs/plugins/ServiceRecordsPlugin.js b/docs/plugins/ServiceRecordsPlugin.js deleted file mode 100644 index 11ec958d..00000000 --- a/docs/plugins/ServiceRecordsPlugin.js +++ /dev/null @@ -1,3 +0,0 @@ -/** - * Fetch the list of services from the registry - */ \ No newline at end of file diff --git a/docs/plugins/ServicesPlugin.js b/docs/plugins/ServicesPlugin.js deleted file mode 100644 index a50be39c..00000000 --- a/docs/plugins/ServicesPlugin.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Init all the clients on the `jibo` object for the running services - * as listed in the services registry. - */ - - /** - * The map of service calls to init. The key must match the - * name of the service as found in the registry. If the - * service isn't currently running (and thus not listed in the - * registry), then the client will not be inited. - */ \ No newline at end of file diff --git a/docs/plugins/VersionsPlugin.js b/docs/plugins/VersionsPlugin.js deleted file mode 100644 index 19470232..00000000 --- a/docs/plugins/VersionsPlugin.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Versions for ssm, platform, jibo. - * @namespace jibo.versions - */ - - /** - * The current version of the jibo API. - * @name jibo.versions#jibo - * @type {String} - */ - - /** - * The current version of skills-service-manager. - * @name jibo.versions#ssm - * @type {String} - */ - - /** - * The content of the current jibo's package.json. - * @name jibo.versions#platform - * @type {String} - */ - - /** - * The full-stack release number of this Jibo's software - * @name jibo.versions#release - * @type {String} - */ - - /** - * The current version of platform. - * @name jibo.versions#_packageInfo - * @type {Object} - * @private - */ - - /** - * Initializes the versions API. - * @private - * @param {Function} done Callback when completed. - */ - - /** - * Check to see if the current version is supported on this platform. - * @method jibo.versions#supported - * @param {String} currentPlatformVersion The current platform version. - * @return {Boolean} `true` if this `jibo` supports the current platform version. - */ - - /** - * The Semver on the platform needed to run this `jibo`. - * @name jibo.versions#requiresPlatform - * @type {String} - */ - - /** - * The content of the current jibo's `package.json`. - * @name jibo.versions#packageInfo - * @type {Object} - */ - - /** - * Internally get the SSM version. - * @method jibo.versions#_getSSMVersion - * @private - * @param {Object} service Current service object for skils. - * @param {Function} done Callback when complete. - */ \ No newline at end of file diff --git a/docs/plugins/VolumePlugin.js b/docs/plugins/VolumePlugin.js deleted file mode 100644 index da902256..00000000 --- a/docs/plugins/VolumePlugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @class VolumePlugin - * @extends EventEmitter - * @implements Plugin - * @private - */ \ No newline at end of file diff --git a/docs/plugins/context/ContextPlugin.js b/docs/plugins/context/ContextPlugin.js deleted file mode 100644 index 356e0dca..00000000 --- a/docs/plugins/context/ContextPlugin.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Installs the Context Service API, which can be found in services/context - * @class ContextPlugin - * @implements Plugin - * @memberof jibo - * @private - */ \ No newline at end of file diff --git a/docs/plugins/context/ContextProvider.js b/docs/plugins/context/ContextProvider.js deleted file mode 100644 index 37bfd231..00000000 --- a/docs/plugins/context/ContextProvider.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @description - * Context Service for providing on-robot context for cloud and related components. - * - * @namespace jibo.context - */ - - /** - * Updates the Skill portion of the Context with CloudSkill data from The Hub - * @param {jibo.context.SkillData} skill - SkillData provided from the CloudSkill - */ - - /** - * Resets the Skill portion of the Context back to default empty state. - */ - - /** - * Compile on-robot and active cloud skill (if any) context - * @param {jibo.jetstream.types.HubSpeakerRecogResults} [speakers] - List of speakers we've confidently ID'd. - * @param {boolean} [omitLoop=false] - `true` if you would like users/Jibo omitted from the LoopContext - * @returns {Promise} - */ - - /** - * Retrieves all relevant Loop member information. - * @returns {Promise} - * @private - */ \ No newline at end of file diff --git a/docs/plugins/context/api.js b/docs/plugins/context/api.js deleted file mode 100644 index f3a79199..00000000 --- a/docs/plugins/context/api.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Enum of Jibo's colors. - * @typedef jibo.context.JiboColor - * @prop BLACK {string} 'BLACK' - * @prop WHITE {string} 'WHITE' - */ - -/** - * Data provided about a given Loop member. - * @memberof jibo.context - * @interface LooperInfo - * @property {string} firstName - Loop member's first name. - * @property {string} lastName - Loop member's last name. - * @property {string} phoneticName - Loop member's phonetic name. - * @property {string} gender - Loop member's gender. - * @property {number} birthdate - Unix epoch timestamp. - * @property {string} id - Loop member's id in loop. - * @property {string} accountId - Loop member's account id (across loops). - */ - -/** - * Data provided about Jibo himself. - * @memberof jibo.context - * @interface JiboInfo - * @property {jibo.context.JiboColor} color - Jibo's color. - * @property {number} birthdate - Unix epoch timestamp. - * @property {string} id - Loop member's id in loop. - */ - -/** - * Data provided about the Loop and members of it. - * @memberof jibo.context - * @interface LoopContext - * @property {jibo.context.LooperInfo[]} users - Information about every Loop member (except Jibo). - * @property {jibo.context.JiboInfo} jibo - Information about Jibo himself. - * @property {string} owner - Loop owner's id in loop. - * @property {string} loopId - ID of loop. - */ - -/** - * Data provided about Jibo's current emotional state. - * @memberof jibo.context - * @interface EmotionContext - * @property {string} name - Current nearest emotion. - * @property {number} valence - Current valence. - * @property {number} confidence - Current confidence. - */ - -/** - * Data provided about Jibo's current character state. - * @memberof jibo.context - * @interface CharacterContext - * @property {jibo.context.EmotionContext} emotion - Current emotion context. - * @property {jibo.context.MotivationContext} motivation - Current motivation context. - */ - -/** - * Data provided about Jibo's current motivational state. - * @memberof jibo.context - * @interface MotivationContext - * @property {number} social - Current social drive state. - * @property {number} playful - Current playful drive state. - */ - -/** - * Data provided about Jibo's current perceptual information. - * @memberof jibo.context - * @interface PerceptionContext - * @property {string} speaker - ID of the currently active speaker. - * @property {jibo.lps.identity#Person[]} peoplePresent - Data about currently detected present people. - */ - -/** - * Data provided about Jibo's current location. - * @memberof jibo.context - * @interface LocationContext - * @property {string} city - Jibo's current city (or nearest). - * @property {string} state - Jibo's current state. - * @property {string} stateAbbr - ISO 3166 1 alpha 2 spec compliant state (or political equivalent) abbreviation of Jibo's current location. - * @property {string} country - Jibo's current country. - * @property {string} countryCode - ISO 3166 1 alpha 2 spec compliant country code of Jibo's current country. - * @property {number} lat - Jibo's current latitude. - * @property {number} lng - Jibo's current longitude. - * @property {string} iso - ISO 8601 compliant string representing Jibo's current time/timezone. - */ - -/** - * Data derived from last turn of dialog with jibo. - * @memberof jibo.context - * @interface DialogContext - * @property {string} [referent] - ID of a loop member that was referred to in utterance. - */ - -/** - * On-robot context data - * @memberof jibo.context - * @interface RuntimeContext - * @property {jibo.context.EmotionContext} character - Information about Jibo's character state. - * @property {jibo.context.LocationContext} location - Information about Jibo's current location. - * @property {jibo.context.LoopContext} loop - Information about Jibo's loop. - * @property {jibo.context.PerceptionContext} perception - Information about Jibo's perception state. - * @property {jibo.context.DialogContext} dialog - Information about the current turn of Dialog. - */ - -/** - * Cloud skill session data - * @memberof jibo.context - * @interface SkillData - * @property {string} id - Cloud Skill ID. - * @property {Object} [session] - Session data for the currently active Cloud Skill. - */ - -/** - * Combination of on-robot and active cloud skill session data - * @memberof jibo.context - * @interface Context - * @property {jibo.context.RuntimeContext} runtime - On-robot context data. - * @property {jibo.context.SkillData} skill - Cloud skill session data. - */ - -/** - * Retreive the merge of the on-robot context and any active cloud skill session context - * @method jibo.context#getContext - * @param {jibo.jetstream.types.HubSpeakerRecogResults} [speakers] - List of speakers we've confidently ID'd. - * @param {boolean} [omitLoop=false] - `true` if you would like users/Jibo omitted from the LoopContext. - * @returns {Promise} - */ - -/** - * Updates the Skill portion of the Context with active Cloud Skill session data from The Hub - * @method jibo.context#updateSkillContext - * @param {jibo.context.SkillData} data - Skill session data provided from the CloudSkill - */ - -/** - * Resets the Skill portion of the Context back to default empty state - * @method jibo.context#resetSkillContext - */ \ No newline at end of file diff --git a/docs/rendering/FaceRenderer.js b/docs/rendering/FaceRenderer.js deleted file mode 100644 index d50e4132..00000000 --- a/docs/rendering/FaceRenderer.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @description - * Controls the rendering of the eye, overlay, and background. - * ``` - * let jibo = require('jibo'); - * jibo.init('face', () => { - * // Setup complete! - * }); - * ``` - * @namespace jibo.face - */ - - /** - * Entire width of Jibo's face. - * @name jibo.face.WIDTH - * @type {int} - * @default 1280 - * @readOnly - */ - - /** - * Entire height of Jibo's face. - * @name jibo.face.HEIGHT - * @type {int} - * @default 720 - * @readOnly - */ - - /** - * Stage container for all PIXI display objects. - * @name jibo.face#stage - * @type {PIXI.Container} - */ - - /** - * If the display is updating. - * @name jibo.face#_paused - * @type {Boolean} - * @private - */ - - /** - * Instance of the update timer for handling events. - * @name jibo.face#_timer - * @type {jibo.timer} - * @private - */ - - /** - * Instance to the GUI/View Manager. - * @private - * @name jibo.face#_views - * @type {jibo.face.views} - */ - - /** - * Instance to the GestureManager for input gestures. - * @private - * @name jibo.face#_gestures - * @type {jibo.face.GestureManager} - */ - - /** - * Instance to the Eye display. - * @private - * @name jibo.face#_eye - * @type {jibo.face.EyeContainer} - */ - - /** - * Creates the canvas for the renderer. - * @private - * @method jibo.face.createView - */ - - /** - * Adds a face animation to play. - * @private - * @method jibo.face#init - * @param {HTMLElement} element HTML element which will contain the view - * @param {boolean} [prepWorkers=true] If Crunch texture loading workers should be prepared. Should be left as the default of true, unless in the SDK. - */ - - /** - * Manage the views on Jibo's face. - * @name jibo.face#views - * @type {jibo.face.views} - */ - - /** - * Create and manage the input gestures. - * @name jibo.face#gestures - * @type {jibo.face.GestureManager} - */ - - /** - * Tweens manager. - * @name jibo.face#tween - * @type {jibo.face.TweenManager} - */ - - /** - * Representation of the eye itself. - * @name jibo.face#eye - * @type {jibo.face.EyeContainer} - */ - - /** - * Update/render the stage. - * @method jibo.face#update - * @private - * @param {int} elapsed Time in milliseconds since the last update - */ - - /** - * If `true`, pauses the face renderer completely. - * @name jibo.face#paused - * @type {boolean} - */ \ No newline at end of file diff --git a/docs/rendering/animation/KeysAnimation.js b/docs/rendering/animation/KeysAnimation.js deleted file mode 100644 index 7ad36d58..00000000 --- a/docs/rendering/animation/KeysAnimation.js +++ /dev/null @@ -1,232 +0,0 @@ -/** - * An abstract Layer for the eye. - * @class Layer - * @memberof jibo.rendering.animation - * @private - */ - -/** - * A layer that represents the Eye. - * @class EyeLayer - * @memberof jibo.rendering.animation - * @private - */ - -/** - * A layer of the KeysAnimation class that represents a timeline animation. - * @class TimelineLayer - * @memberof jibo.rendering.animation - * @private - * @param {Number} index The depth index. - * @param {String} name Name of the timeline. - * @param {jibo.rendering.animation.Timeline} timeline - * @param {Number} startTime The starting time of this animation in seconds. - * @param {Boolean} attach `true` if Timeline should be attached to the eye's position. - * @param {String} offset The frame offset to start playing the animation at - */ - - /** - * Update the position of the animation. - * @method jibo.rendering.animation.TimelineLayer#update - * @param {Number} time Global time of the animation in seconds. - */ - - /** - * Destroy and don't use after this. - * @method jibo.rendering.animation.TimelineLayer#destroy - */ - -/** - * Class used by Animation Utilities to provide playback - * of keys files. - * @class KeysAnimation - * @memberof jibo.rendering.animation - * @extends EventEmitter - * @param {String} id The name of the keys file. - */ - - /** - * The default framerate. - * @name jibo.rendering.animation.KeysAnimation.FRAMERATE - * @type {String} - * @default 30 - */ - - /** - * Event name when animation starts. - * @name jibo.rendering.animation.KeysAnimation.STARTED - * @type {String} - */ - - /** - * Event name when animation stops. - * @name jibo.rendering.animation.KeysAnimation.STOPPED - * @type {String} - */ - - /** - * Event name when builder event is fired. - * @name jibo.rendering.animation.KeysAnimation.EVENT - * @type {String} - */ - - /** - * Event name when animation is cancelled. - * @name jibo.rendering.animation.KeysAnimation.CANCELLED - * @type {String} - */ - - /** - * Event name when audio is played. - * @name jibo.rendering.animation.KeysAnimation.PLAY_AUDIO - * @type {String} - */ - - /** - * Event name when timeline is played. - * @name jibo.rendering.animation.KeysAnimation.PLAY_TIMELINE - * @type {String} - */ - - /** - * Event name when timeline needs to be reordered. - * @name jibo.rendering.animation.KeysAnimation.REORDER - * @type {String} - */ - - /** - * Event when the timeline is updated. - * @name jibo.rendering.animation.KeysAnimation.UPDATE - * @type {String} - * @param {Number} time The current time in seconds from the start of animation. - * @param {Object} dofValues Collection of DOF values for the current frame. - */ - - /** - * Asset Pack name. - * @name jibo.rendering.animation.KeysAnimation#assetPack - * @type {String} - */ - - /** - * Resource root for animation (defaults to root of skill). - * @name jibo.rendering.animation.KeysAnimation#root - * @type {String} - */ - - /** - * Id of the keys file in the cache. - * @name jibo.rendering.animation.KeysAnimation#id - * @type {String} - */ - - /** - * Name of the keys file. - * @name jibo.rendering.animation.KeysAnimation#name - * @type {String} - */ - - /** - * The collection of layers for the animation. - * @name jibo.rendering.animation.KeysAnimation#layers - * @type {Array} - */ - - /** - * Token of an asset load for our keys data, so it doesn't get unloaded under us. - * @private - */ - - /** - * Map of Timeline objects. - * @name jibo.rendering.animation.KeysAnimation#timelines - * @type {Object} - */ - - /** - * Map of PIXI.Texture objects. - * @name jibo.rendering.animation.KeysAnimation#textures - * @type {Object} - */ - - /** - * Map of Sound objects. - * @name jibo.rendering.animation.KeysAnimation#sounds - * @type {Object} - */ - - /** - * The animation options. - * @name jibo.rendering.animation.KeysAnimation#options - * @type {AnimationOptions} - * @private - */ - - /** - * The animation instance. - * @name jibo.rendering.animation.KeysAnimation#instance - * @type {AnimationInstance} - * @private - */ - - /** - * Update the timelines. - * @method jibo.rendering.animation.KeysAnimation#update - * @param {Number} time Current time of this animation - */ - - /** - * Set the keys animation data. - * @name jibo.rendering.animation.KeysAnimation#data - * @type {Object} - * @private - */ - - /** - * Sync a movieclip to the playback of the animation. - * @method jibo.rendering.animation.KeysAnimation#playSync - * @param {animate.MovieClip} instance The clip to play. - * @param {String|Function} [event] The name of the event label or callback function. - * @param {Function} [callback] Callback when play is complete. - */ - - /** - * Destroy the keys animation completely, after the Expression Service has told us that it has finished playing. - * @method jibo.rendering.animation.KeysAnimation#destroyWhenComplete - */ - - /** - * Destroy the keys animation completely. - * @method jibo.rendering.animation.KeysAnimation#destroy - */ - - /** - * Handle animation custom events. - * @method jibo.rendering.animation.KeysAnimation#onEvent - * @private - */ - - /** - * Handle playing audio within the animation. - * @method jibo.rendering.animation.KeysAnimation#onPlayAudio - * @private - * @param {Object} payload - * @param {string} payload.file - */ - - /** - * Reorder the layers of the animation. - * @method jibo.rendering.animation.KeysAnimation#reorder - * @private - */ - - /** - * Handle the playing of a timeline event. - * @method jibo.rendering.animation.KeysAnimation#onPlayTimeline - * @private - * @param {object} payload - * @param {string} payload.file - * @param {number} payload.layerNum - * @param {boolean} payload.attach - * @param {string} payload.offset - */ \ No newline at end of file diff --git a/docs/rendering/animation/KeysData.js b/docs/rendering/animation/KeysData.js deleted file mode 100644 index 23269a02..00000000 --- a/docs/rendering/animation/KeysData.js +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Class used by Animation Utilities to provide playback - * of keys files. - * @class KeysData - * @memberof jibo.rendering.animation - * @extends EventEmitter - * @param {String} id The name of the keys file. - * @param {String} src The absolute path of the keys file. - * @param {String} cache The name of the cache the data was originally loaded into. - */ - - /** - * Asset Pack name. - * @name jibo.rendering.animation.KeysData#assetPack - * @type {String} - */ - - /** - * Resource root for animation (defaults to root of skill). - * @name jibo.rendering.animation.KeysData#root - * @type {String} - */ - - /** - * Source path of animation data - * @name jibo.rendering.animation.KeysData#src - * @type {String} - */ - - /** - * Source path of corresponding `.anim`, if present/valid. - * @name jibo.rendering.animation.KeysData#dotAnimSrc - * @type {String} - */ - - /** - * Name of the initial cache this data was loaded into. Used when determining animation options. - * @name jibo.rendering.animation.KeysData#cache - * @type {String} - */ - - /** - * Map of Timeline objects. - * @name jibo.rendering.animation.KeysData#timelines - * @type {Object} - */ - - /** - * Map of PIXI.Texture objects. - * @name jibo.rendering.animation.KeysData#textures - * @type {Object} - */ - - /** - * Map of Sound objects. - * @name jibo.rendering.animation.KeysData#sounds - * @type {Object} - */ - - /** - * Name of the keys file. - * @name jibo.rendering.animation.KeysData#id - * @type {String} - */ - - /** - * The keys animation data. - * @name jibo.rendering.animation.KeysData#data - * @type {Object} - * @private - */ - - /** - * Add a sound to the animation for playing. - * @method jibo.rendering.animation.KeysData#addSound - * @param {String} id The ID of the sound - * @param {jibo.sound.Sound} sound Instance of sound. - */ - - /** - * Add a timeline to the animation for playing. - * @method jibo.rendering.animation.KeysData#addTimeline - * @param {String} id The ID of the timeline - * @param {jibo.rendering.animation.Timeline} timeline Instance of timeline. - */ - - /** - * Add a PIXI texture to the animation for playback. - * @method jibo.rendering.animation.KeysData#addTexture - * @param {String} id The ID of the texture - * @param {PIXI.Texture} texture Instance of texture. - */ - - /** - * Create a shallow clean copy of this KeysAnimation object resetting all state. - * This should be used when retrieving a keys animation object from cache - * Note: Any clean copy should always be destroyed after use - * @param {CloneOptions} options Options for animation instantiation/playback. - * @method jibo.rendering.animation.KeysData#getCleanCopy - * @return {Promise} - */ - - /** - * Create and immediately play a KeysAnimation from this KeysData. - * Event handlers for `stopped`, `cancelled`, `rejected`, and other animation events must be registered to the - * animation instance immediately (in-stack) upon promise resolution, or else they may be missed. - * @param {CloneOptions} [options] Options for animation instantiation/playback. - * @param {string} [requestor] The system making the animation playback request. - * @method jibo.rendering.animation.KeysData#getAndPlayAnim - * @return {Promise} - */ - - /** - * Destroy the keys data completely. - * @method jibo.rendering.animation.KeysData#destroy - */ - - /** - * Create an animation options from keyframes data or a keyframes file. - * In the case of keyframes data, DOF values are computed and passed to the expression service. - * In the case of a keyframes file, the path to a file of DOF values computed from the keyframes file is passed - * to the expression service. - * @method jibo.rendering.animation.KeysData#createAnimOptions - * @return {AnimationOptions} - * @private - */ \ No newline at end of file diff --git a/docs/rendering/animation/KeysLoader.js b/docs/rendering/animation/KeysLoader.js deleted file mode 100644 index 426d0a1a..00000000 --- a/docs/rendering/animation/KeysLoader.js +++ /dev/null @@ -1,129 +0,0 @@ - /** - * Nested Keys File Loading. - * - * Given a keys file url, load the file and then recursively - * composite into it any keys files it points to (somewhat like macro expansion). - * @return {String} The result of the compositing operation with all reference layers removed. - * @name jibo.rendering.animation.KeysLoader#innerNestedLoad - * @param {String} url Path nanme of the keys file to be loaded - * @param {Callback} complete Callback to call when the load is completed. - * @param {String} [parentId] The layer ID of the referencing frame. - * @param {String} [refBase] The directory that the asset references are with respect to. - * @private - */ - - /** - * Convert keyframes referencing texture, pixi and audio information into assetpack style references if necessary. - * - * The motivation: - * Consider a reference layer in a skill's animation that references an animDB keys file. - * Compositing will pull in the layers from the animDB keys file, but any asset references (textures, audio, pixi) - * in those layers will be relative to the animDB root. If the paths to those assets are not converted to - * asset-pack style references (while we know their provenance) we will not be able to distinguish later on - * whether those references are relative to the animDB or to the local skill. - * - * @param {Keyframes} frames the keyframes object whose asset references will be modified. - * @param {string} assetPack the assetPack that the containing file is in. - */ - - /** - * Convert a non-asset pack reference into an asset-pack one. - * @param assetPack - * @param filepath - * @returns {string} - */ - - /** - * Find all references in a keys file, returning them in reverse-order. - * @name jibo.rendering.animation.KeysLoader#getKeyFileReferences - * @param {Keyframes} frames A keyframes structure containing reference layers. - * @param {String} refBase The directory containing the file from whence the given keyframes were loaded. - * @returns {Array} An array of objects describing references to other keys files, - * each object has these properties: - * `url`: the url of the file being referenced, - * `parentId`: the layerID of the parent, - * `holdFinalPose`: whether the final frame of the referenced layer is held until the next reference (or end), - * `containerDuration`: the duration of the file that contains this reference. - * `layerNumber`: the ordinal layer number of the reference, - * `atEnd`: a boolean that is true if this is the last reference in the layer. - * `nextRefStart`: where the next reference frame is, or Infinity if there are no further references. - * `timeOffset`: the timepoint at which it is to be inserted in the referencing layer. - * @private - */ - - /** - * Place num in a leading-zero-padded field of the given size - * @param {number} num Number to pad - * @param {number} size Size of final field - * @returns {string} - */ - - /** - * Return a full URL for the referenced keys file based on - * the reference mode (by name or by file). - * @param {any} keyframe the keyframe containing the reference. - * @param {string} refBase directory of the file in which the reference is occurring. - * @returns {object} object.url containing the fully resolved path to referenced file and - * object.refBase containing the parent directory of the referencer. - * @method jibo.rendering.animation.KeysLoader#getReferencedUrl - * @private - */ - - /** - * Find any "HOLD_SAFE" events in referenced layers and remove them (by renaming them). - * @name jibo.rendering.animation.KeysLoader#removeHoldSafesInReferences - * @param {Keyframes} frames keyframes to be cleaned. - * @private - */ - - /** - * Strip out any reference-type layers from the keyframes. - * @name jibo.rendering.animation.KeysLoader#removeReferenceLayers - * @param {Keyframes} keyframes keyframes structure containing reference layers. - * @private - */ - - /** - * Shift the layer's validFrom, validUpto and validHoldAfter properties and - * shift the timepoint of all the keyframes within each of the given layers by the given time offset ("validFrom"). - * The validFrom and validUpto parameters are in "referencing" layer coordinates. - * @name jibo.rendering.animation.KeysLoader#timeshift - * @param {Keyframes} frames the layers containing the keyframes to be shifted. - * @param {number} validFrom the beginning of the valid region. - * @param {number} validUpto the ending of valid region, or Infinity for unlimited. - * @param {number} holdAfter the timepoint after which the pose does not change (i.e. it remains fixed at that timepoint). - * @private - */ - - /** - * Insert all the layers of toBeInsertedKeyframes into existingKeyframes at the given layer number. - * Insert them last-first in order to preserve their original ordering at the designated layer. - * @name jibo.rendering.animation.KeysLoader#composite - * @param {Number} layerNumber the layer number in which the keyframes are to be inserted. - * @param {Keyframes} existingKeyframes the existing keyframes into which the layers will be inserted. - * @param {Keyframes} toBeInsertedKeyframes the source of the keyframes to be inserted. - * @private - */ - - /** - * Modifies the layer ids to prefixed by the referencing layer's id (delimited by "-") - * and suffixed with the layer number (delimited by '.'). - * @name jibo.rendering.animation.KeysLoader#fixLayerIds - * @param {Keyframes} frames the set of layers to be modified. - * @param {string} prefix the string with which to prefix each layer id. - * @private - */ - - /** - * Was this layer produced from a keyframes reference? - * @name jibo.rendering.animation.KeysLoader#isReferencedLayer - * @param {any} layer the layer to be checked - * @returns {boolean} - * @private - */ - - /** - // * Return true if frame being referenced already exists in hierarchy. - // * @param frames - // * @param prefix - // */ \ No newline at end of file diff --git a/docs/rendering/animation/Shapes.js b/docs/rendering/animation/Shapes.js deleted file mode 100644 index 3aaaf12f..00000000 --- a/docs/rendering/animation/Shapes.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * The object returned by the ShapesTask. - * @class Shapes - * @memberof jibo.rendering.animation - * @param {String} id ID for the shapes. - * @param {Array} shapes Collection of shapes. - */ - - /** - * Destroys shapes object. - * @method jibo.rendering.animation.Shapes#destroy - */ \ No newline at end of file diff --git a/docs/rendering/animation/Spritesheet.js b/docs/rendering/animation/Spritesheet.js deleted file mode 100644 index 509ce312..00000000 --- a/docs/rendering/animation/Spritesheet.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * The object returned by the SpritesheetTask. - * @class Spritesheet - * @memberof jibo.rendering.animation - * @param {PIXI.BaseTexture} baseTexture - * @param {Object} frames The frames map - * @param {Number} resolution The amount of scale - */ - - /** - * The collection of textures by name. - * @name jibo.rendering.animation.Spritesheet#frames - * @type {Object} - */ - - /** - * Destroys all the textures/frames of spritesheet. - * @method jibo.rendering.animation.Spritesheet#destroy - */ \ No newline at end of file diff --git a/docs/rendering/animation/Timeline.js b/docs/rendering/animation/Timeline.js deleted file mode 100644 index c5a39255..00000000 --- a/docs/rendering/animation/Timeline.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * The object returned by the TimelineTask. Represents a PIXI animation. - * @class Timeline - * @private - * @memberof jibo.rendering.animation - */ - - /** - * Adds a texture for the Timeline. - * @method jibo.rendering.animation.Timeline#addTexture - * @private - * @param {PIXI.Texture} texture Texture reference. - * @param {String} id The id name of texture in cache. - */ - - /** - * Gets a texture/frame that was loaded for this Timeline - * @method jibo.rendering.animation.Timeline#getTexture - * @private - * @param {String} id The id name of texture in cache. - * @returns {PIXI.Texture} Texture reference. - */ - - /** - * Adds shapes to the Timeline. - * @method jibo.rendering.animation.Timeline#addShapes - * @private - * @param {jibo.rendering.animation.Shapes} shapes Texture reference. - */ - - /** - * Adds spritesheet to the Timeline. - * @method jibo.rendering.animation.Timeline#addSpritesheet - * @private - * @param {jibo.rendering.animation.Spritesheet} spritesheet Spritesheet reference. - */ - - /** - * Uploads all the textures to the GPU. - * @method jibo.rendering.animation.Timeline#upload - * @param {PIXI.WebGLRenderer} renderer Reference to face renderer. - * @param {Function} callback Callback when complete. - */ - - /** - * Destroys Timeline object. - * @method jibo.rendering.animation.Timeline#destroy - */ \ No newline at end of file diff --git a/docs/rendering/eye/AbstractEye.js b/docs/rendering/eye/AbstractEye.js deleted file mode 100644 index 2382b655..00000000 --- a/docs/rendering/eye/AbstractEye.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Abstract class for eye overlay and eye classes. - * @class AbstractEye - * @extends jibo.face.AbstractLayer - * @memberof jibo.face - * @param {Boolean} cache `true` to cache textures. - */ - - /** - * The eye mesh. - * @name jibo.face.AbstractEye#eyeMesh - * @type {jibo.face.EyeMesh} - */ - - /** - * Default eye texture when nothing is set. - * @method jibo.face.AbstractEye#init - * @param {PIXI.Texture} texture The default texture to use - */ - - /** - * Destroy and don't use after this. - * @method jibo.face.AbstractEye#destroy - */ - - /** - * Set current eye texture. - * @method jibo.face.AbstractEye#setTexture - * @protected - * @param {PIXI.Texture} texture Texture to set - */ \ No newline at end of file diff --git a/docs/rendering/eye/AbstractLayer.js b/docs/rendering/eye/AbstractLayer.js deleted file mode 100644 index 209fa8f1..00000000 --- a/docs/rendering/eye/AbstractLayer.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Abstract class for background, eye overlay and eye classes. - * @class AbstractLayer - * @extends PIXI.Container - * @memberof jibo.face - * @param {Boolean} cache `true` to cache textures. - */ - - /** - * If should update according to DOFValues. - * @name jibo.face.AbstractLayer#connected - * @type {String} - */ - - /** - * `true` if layer has been initialized. - * @name jibo.face.AbstractLayer#initialized - * @type {String} - * @protected - */ - - /** - * Current cached timestamp. - * @name jibo.face.AbstractLayer#timestamp - * @type {Number[]} - * @protected - */ - - /** - * Current cached dofValues. - * @name jibo.face.AbstractLayer#dofValues - * @type {Number[]} - * @protected - */ - - /** - * Empty placeholder texture. - * @name jibo.face.AbstractLayer#_defaultTexture - * @type {PIXI.Texture} - * @private - */ - - /** - * Reference to the current texture. - * @name jibo.face.AbstractLayer#_texture - * @type {PIXI.Texture} - * @private - */ - - /** - * Current path of the texture loaded/loading. - * @name jibo.face.AbstractLayer#_texturePath - * @type {String} - * @private - */ - - /** - * The current asset loading - * @name jibo.face.AbstractLayer#_load - * @type {jibo.loader.AssetLoad} - * @private - */ - - /** - * The cache key of the texture currently in use. - * @name jibo.face.AbstractLayer#_textureCacheKey - * @type {jibo.loader.AssetToken} - * @private - */ - - /** - * Default eye texture when nothing is set. - * @method jibo.face.AbstractLayer#reset - * @param {Boolean} [resetPath=true] `false` to ignore resetting default path - */ - - /** - * Default eye texture when nothing is set. - * @method jibo.face.AbstractLayer#init - * @param {PIXI.Texture} texture The default texture to use - */ - - /** - * Display of DOFValues. - * @method jibo.face.AbstractLayer#display - * @param {Array} timestamp Timestamp when update is called. - * @param {jibo.face.DOFValues} dofValues Update display according to these values. - * @return {Boolean} `true` proceeds with update. - */ - - /** - * Full path to the texture to use. - * @name jibo.face.AbstractLayer#texturePath - * @type {String} - */ - - /** - * Destroy and don't use after this. - * @method jibo.face.AbstractLayer#destroy - */ - - /** - * Set current eye texture. - * @method jibo.face.AbstractLayer#setTexture - * @param {PIXI.Texture} texture Texture to set. - * @override - */ - - /** - * Value to tint. - * @method jibo.face.AbstractLayer#rgb2hex - * @protected - * @param {Number} red Red value from 0 to 1 - * @param {Number} green Green value from 0 to 1 - * @param {Number} blue Blue value from 0 to 1 - * @return {int} The resulting uint color - */ - - /** - * Check to see a path matches the default texture. - * @method jibo.face.AbstractLayer#_isDefaultTexture - * @param {PIXI.Texture} texture The default texture. - * @param {String} value Full path to test. - * @return {Boolean} `true` if the value is the default texture. - * @private - */ - - /** - * If there's a current load happen, stop it. - * @method jibo.face.AbstractLayer#_cancelLoad - * @private - */ - - /** - * Set the current texture path. - * @method jibo.face.AbstractLayer#_applyTexture - * @param {String} value Path to the texture - * @private - */ - - /** - * Set the current texture path. - * @method jibo.face.AbstractLayer#_loadTexture - * @param {String} value Path to the texture - * @private - */ \ No newline at end of file diff --git a/docs/rendering/eye/Background.js b/docs/rendering/eye/Background.js deleted file mode 100644 index ee798946..00000000 --- a/docs/rendering/eye/Background.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Represents a background. - * @class Background - * @extends jibo.face.AbstractLayer - * @memberof jibo.face - * @param {Boolean} cache Cache the texture. - */ - - /** - * The base sprite for holding the texture. - * @name jibo.face.Background#sprite - * @type {PIXI.Sprite} - */ - - /** - * Default eye texture when nothing is set. - * @method jibo.face.Background#init - * @param {PIXI.Texture} texture The default texture to use - */ - - /** - * Update of DOFValues. - * @method jibo.face.Background#display - * @param {Array} timestamp Timestamp when update is called. - * @param {jibo.face.DOFValues} dofValues Update display according to these values. - */ - - /** - * Override destroy - * @method jibo.face.Background#destroy - * @override - */ - - /** - * Set current eye texture. - * @method jibo.face.Background#setTexture - * @protected - * @param {PIXI.Texture} texture Texture to set - */ \ No newline at end of file diff --git a/docs/rendering/eye/Eye.js b/docs/rendering/eye/Eye.js deleted file mode 100644 index dee34df4..00000000 --- a/docs/rendering/eye/Eye.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Represents an eye. - * @class Eye - * @extends jibo.face.AbstractEye - * @memberof jibo.face - */ - - /** - * Update of DOFValues. - * @method jibo.face.Eye#display - * @param {Array} timestamp Timestamp when update is called. - * @param {jibo.face.DOFValues} dofValues Update display according to these values. - * @return {Boolean} `true` proceeds with update. - */ \ No newline at end of file diff --git a/docs/rendering/eye/EyeContainer.js b/docs/rendering/eye/EyeContainer.js deleted file mode 100644 index f12b4d3f..00000000 --- a/docs/rendering/eye/EyeContainer.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * The representation of the eye. - * @class EyeContainer - * @memberof jibo.face - * @extends PIXI.Container - */ - - /** - * Eye display. - * @name jibo.face.EyeContainer#eye - * @type {jibo.face.Eye} - */ - - /** - * Eye overlay display. - * @name jibo.face.EyeContainer#eyeOverlay - * @type {jibo.face.EyeOverlay} - */ - - /** - * The background border for debugging. - * @name jibo.face.EyeContainer#backgroundBorder - * @type {PIXI.Graphics} - */ - - /** - * The background of eye. - * @name jibo.face.EyeContainer#background - * @type {jibo.face.Background} - */ - - /** - * `true` if the eye is connected to the DOF values. - * @name jibo.face.EyeContainer#connected - * @type {Boolean} - */ - - /** - * Glow Filter for eye display. - * Must enable with `jibo.face.eye.glow.enabled = true` - * @name jibo.face.EyeContainer#glow - * @type {jibo.face.GlowFilter} - */ - - /** - * Lighting Filter for eye display. - * Must enable with `jibo.face.eye.lighting.enabled = true` - * @name jibo.face.EyeContainer#lighting - * @type {jibo.face.LightFilter} - */ - - /** - * Adds a face animation to play. - * @method jibo.face#addAnimation - * @param {jibo.rendering.animation.KeysAnimation} anim The animation to play. - */ - - /** - * Removes a face animation. It will be destroyed in the future (but soon) to avoid flickering - * between animations. - * @method jibo.face#removeAnimation - * @param {jibo.rendering.animation.KeysAnimation} anim The animation to remove - this should a playing animation. - */ - - /** - * Holds the current face animation if it is scheduled for removal. It will be removed the next - * time that an animation is set. - * @method jibo.face#holdCurrentAnim - */ - - /** - * Get a texture from the current loaded animation. - * @method jibo.face#getTexture - * @param {String} value Full path to the file to use. - * @return {PIXI.Texture} Texture from the animation. - */ - - /** - * If the eye is active. - * @method jibo.face#active - * @type {boolean} - */ - - /** - * Update the DOFValues for display. - * @private - * @method jibo.face.EyeContainer#display - * @param {Array} timestamp Global timestamps in seconds and milliseconds. - * @param {jibo.face.DOFValues} dofValues Collection of animation values. - * @param {Object} [meta] Optional object for timeline timestamps. - */ - - /** - * Changes the zoom level. Default is 1 = 100%. - * @method jibo.face.eyeContainer#zoom - * @type {number} - * @private - */ - - /** - * Make a border around the screen. - * @method jibo.face.EyeContainer#makeBorder - * @param {Array} timestamp Timestamp when update is called. - * @param {String} dofValues Update display according to these values. - * @param {Object} meta - * @private - */ - - /** - * Cleans up the renderer. - * @method jibo.face.EyeContainer#destroy - * @private - */ - - /** - * Get the default texture names. - * @method jibo.face.EyeContainer#_getDefaultTextures - * @private - */ - - /** - * Handle when the timeline needs to be reordered. - * @method jibo.face.EyeContainer#onAnimationReorder - * @private - */ - - /** - * Handle when the animation stops. - * @method jibo.face.EyeContainer#onAnimationStopped - * @private - */ - - /** - * Queues a face animation for removal. - * @method jibo.face#queueAnimRemoval - * @private - */ - - /** - * Removes the current face animation, and sets up the pending one. - * @method jibo.face#swapLastAnimForPending - * @private - */ - - /** - * Removes the current face animation, destroying it. - * @method jibo.face#removeLastAnim - * @private - */ - - /** - * Removes the current face animation, destroying it and resetting the eye. - * @method jibo.face#removeLastAnimAndReset - * @private - */ \ No newline at end of file diff --git a/docs/rendering/eye/EyeMesh.js b/docs/rendering/eye/EyeMesh.js deleted file mode 100644 index 27d08129..00000000 --- a/docs/rendering/eye/EyeMesh.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The mesh of the eye. - * @class EyeMesh - * @extends PIXI.mesh.Mesh - * @memberof jibo.face - * @param {PIXI.Texture} texture - */ - - /** - * The points for DOF transforms. - * @name jibo.face.EyeMesh#points - * @type {Array} - */ \ No newline at end of file diff --git a/docs/rendering/eye/EyeOverlay.js b/docs/rendering/eye/EyeOverlay.js deleted file mode 100644 index 79ca13a5..00000000 --- a/docs/rendering/eye/EyeOverlay.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Represents an eye overlay. - * @class EyeOverlay - * @extends jibo.face.AbstractEye - * @memberof jibo.face - */ - - /** - * Update of DOFValues. - * @method jibo.face.EyeOverlay#display - * @param {Array} timestamp Timestamp when update is called. - * @param {jibo.face.DOFValues} dofValues Update display according to these values. - * @return {Boolean} `true` proceeds with update. - */ \ No newline at end of file diff --git a/docs/rendering/eye/filters/glow/GlowFilter.js b/docs/rendering/eye/filters/glow/GlowFilter.js deleted file mode 100644 index 2bfa32ad..00000000 --- a/docs/rendering/eye/filters/glow/GlowFilter.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Apply a glow and halo effect to a Display Object. - * - * @class GlowFilter - * @extends PIXI.Filter - * @memberof jibo.face - */ - - /** - * Render the glow over the displayObject. - * Can use Add (recommended), or Screen. - * @name jibo.face.GlowFilter#blendMode - * @type {Number} - */ - - /** - * Target that the glow centers on. - * @name jibo.face.GlowFilter#target - * @type {DisplayObject} - */ - - /** - * Set the blur amount of the glow (increases size of glow). - * - * @name jibo.face.GlowFilter#blur - * @type {Number} - * @default 15 - */ - - /** - * Set the quality of the blur. High quality (10) will degrade performance. - * Low quality (1) will sacrifice quality for performance. - * - * @name jibo.face.GlowFilter#blurQuality - * @type {Number} - * @default 7 - */ - - /** - * Speed (in pixels per frame) halo moves outward at each update. - * Use negative values to animate in reverse. - * @name jibo.face.GlowFilter#haloSpeed - * @type {Number} - * @default 0 - */ - - /** - * Maximum distance (in pixels) that the halo can be away from the edges. - * @name jibo.face.GlowFilter#haloMaxDistance - * @type {Number} - * @default 80 - */ - - /** - * Set the distance of the halo from the glow from 0 to 1. 0 makes the halo touch the glow. - * 1 puts the halo haloMaxDistance from the edge of the glow. - * @name jibo.face.GlowFilter#halo - * @type {Number} - * @default 0 - */ - - /** - * Filter amount from 0 to 1. - * 0 to apply no lighting effect. 1 to make lighting effect fully visible. - * @name jibo.face.GlowFilter#amount - * @type {Number} - * @default 1.0 - */ - - /** - * Color of the glow in hexadecimal. - * eg 0xFF0000 - * @type {Hexadecimal} - * @name jibo.face.GlowFilter#color - */ - - /** - * Conversion utility to convert hex into alpha - * @method jibo.face.GlowFilter#hex2rgba - */ - - /** - * Update of DOFValues. - * @method jibo.face.Eye#update - * @param {Array} timestamp Timestamp when update is called. - * @param {String} dofValues Update display according to these values. - */ - - /** - * Update the halo animation. - * @private - * @method jibo.face.Eye#animate - */ \ No newline at end of file diff --git a/docs/rendering/eye/filters/light/LightFilter.js b/docs/rendering/eye/filters/light/LightFilter.js deleted file mode 100644 index 38bf5049..00000000 --- a/docs/rendering/eye/filters/light/LightFilter.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Apply a light effect to a displayObject. - * Create a gradient scaled to match the dimensions of the object. - * Automatically adjust gradient position based on location of light effect. - * - * @class LightFilter - * @extends PIXI.Filter - * @memberof jibo.face - */ - - /** - * Move the gradient center this distance in relation to the light source. - * The higher the value, the greater the effect of the light movement. - * @name jibo.face.LightFilter#radius - * @type {Number} - * @default 250 - */ - - /** - * Distance the gradient center will move based on the distance from the light source. - * The higher the values the greater the effect of the light movement. - * @name jibo.face.LightFilter#distanceMagnification - * @type {PIXI.Point} - */ - - /** - * Position of the light source. For the best effect this should be set to be the center of the screen - * @name jibo.face.LightFilter#lightPosition - * @type {PIXI.Point} - */ - - /** - * Target that the glow centers on. - * @name jibo.face.LightFilter#target - * @type {DisplayObject} - */ - - /** - * Darkest (furthest) color of the light effect in hexadecimal numbers. - * i.e. 0xFF0000 - * @type {Number} - * @default 0x5a5552 - * @name jibo.face.LightFilter#dark - */ - - /** - * Mid-color of the light effect in hexadecimal numbers. - * i.e. 0xFF0000 - * @default 0xc0bab6 - * @type {Number} - * @name jibo.face.LightFilter#mid - */ - - /** - * Lightest (closest) color of the light effect in hexadecimal numbers. - * i.e. 0xFF0000 - * @default 0xffffff - * @type {Number} - * @name jibo.face.LightFilter#light - */ - - /** - * Amount of the light between 0 and 1 to (creates speaking light effect). - * Apply to darkest areas first. 0 = no extra brightness. 1 = full white. - * @default 1 - * @type {Number} - * @name jibo.face.LightFilter#amount - */ - - /** - * Brightness of the filter between 0 and 1. - * 0 = no lighting effect. 1 = full light effect visible. - * @default 1 - * @type {Number} - * @name jibo.face.LightFilter#brightness - */ - - /** - * Ratio of the midpoint of the gradient between 0 and 1. - * Lower value = mid color gradient sits closer to center of light gradient. - * Higher value = mid color gradient sits closer to outer dark part of gradient. - * @default 0.5 - * @type {Number} - * @name jibo.face.LightFilter#gradientRatio - */ - - /** - * Conversion utility to convert hex into alpha. - * @method jibo.face.LightFilter#hex2rgba - */ - - /** - * Update the DOFValues for display. - * @private - * @method jibo.face.LightFilter#update - * @param {Array} timestamp The timestamps. - * @param {jibo.face.DOFValues} dofValues - */ - - /** - // * Convert R, G and B values to Uint - // * @method jibo.face.LightFilter#rgbToUint - // * @private - // * @param {Number} r Red value - // * @param {Number} g Green value - // * @param {Number} b Blue value - // * @return {Number} Uint of color. - // */ \ No newline at end of file diff --git a/docs/rendering/gui/Component.js b/docs/rendering/gui/Component.js deleted file mode 100644 index 0f8a35bf..00000000 --- a/docs/rendering/gui/Component.js +++ /dev/null @@ -1,291 +0,0 @@ -/** - * @interface jibo.face.views.Component~ComponentOptions - * @description Interface - Configuration values for creating a Component. - * @prop {String} [id] - Identifier for component. - * @prop {String} [type] - Type of component. - * @prop {jibo.face.views~AssetDescriptor[]} [assets] - List of required asset descriptors. - * @prop {jibo.face.views~ActionDescriptor} [action] - Action triggered when user interacts with the component. - * @prop {jibo.face.views~ActionDescriptor[]} [actions] - List of possible actions for the interactions with the component. - */ - -/** - * Base component class for GUI elements. - * @class Component - * @extends EventEmitter - * @memberof jibo.face.views - * @abstract - */ - - /** - * String used for identification, each Component within a - * ComponentGroup should have a unique id to help with retrieval. - * @name jibo.face.views.Component#id - * @type {String} - */ - - /** - * Reference to the parent group of this Component. - * @name jibo.face.views.Component#parentGroup - * @type {jibo.face.views.ComponentGroup} - */ - - /** - * Reference to the top most parent group of this Component, which is a View. - * @name jibo.face.views.Component#_parentView - * @type {jibo.face.views.View} - * @private - */ - - /** - * Subcomponent to handles interactive aspects of Component. - * Manages actions and their gesture association. - * @name jibo.face.views.Component#_touchInteractivity - * @type {jibo.face.views.TouchInteractive} - * @private - */ - - /** - * Set to `true` class has changed its - * state in a way that needs to be recorded between Views (e.g when a - * list moves from one page to another). - * @name jibo.face.views.Component#stateChanged - * @type {Boolean} - * @default false - * @readOnly - */ - - /** - * The Component type. Should equal the Class name. - * In some case, `type` may not be equal to Class name if you're using variants. - * Variants allow for different behavior within the class without having to extend it. - * @name jibo.face.views.Component#type - * @type {String} - * @readOnly - */ - - /** - * Holds Subcomponents. - * @name jibo.face.views.Component#_subcomponents - * @type {{jibo.face.views.Subcomponent}} - * @private - */ - - /** - * Flag determining whether to respond to input. - * @name jibo.face.views.Component#inputLocked - * @type {Boolean} - */ - - /** - * Return array of objects that describe assets to be loaded. - * Refer to {@link jibo.loader} for documentation. - * @name jibo.face.views.Component#assetDescriptors - * @type {jibo.face.views~AssetDescriptor[]} - * @readOnly - */ - - /** - * Get the View the Component is ultimately parented to. - * @name jibo.face.views.Component#parentView - * @type {jibo.face.views.View} - * @readOnly - */ - - /** - * Add a Subcomponent. - * @method jibo.face.views.Component#addSubcomponent - * @param {jibo.face.views.Subcomponent} subcomponent - Subcomponent to add. - * @returns {jibo.face.views.Subcomponent} Subcomponent added. - */ - - /** - * Retrieve a Subcomponent. - * @method jibo.face.views.Component#getSubcomponent - * @param {string} type - Type of SubComponent, can access type statically from class like Subcomponent.TYPE. - * @returns {jibo.face.views.Subcomponent} Subcomponent matching given type, otherwise null. - */ - - /** - * Applies data contained within the given `configData` object (generally derived - * from JSON) to the class. Override this method to configure further. - * data and/or make manual additions to the class's variables. - * @method jibo.face.views.Component#assignConfig - * @param {Object} configData The configuration object for the Component. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Takes initial config Object that was provided to define class and updates it - * with any necessary values regarding any new `state` of the component. - * Returns the updated Object, though it shouldn't be necessary to reassign - * the returned Object, since generally the updated values are assigned through `Object.assign` - * to merge new values into original. - * @method jibo.face.views.Component#updateConfig - * @param {Object} configObject The configuration Object for the Component. - * @abstract - */ - - /** - * To be overridden, should create DisplayObjects from given assets and add the - * to stage via the given container. - * @method jibo.face.views.Component#createDisplay - * @param {PIXI.Container} container Parent container, which all DisplayObject - * created within this Component should be added to. - * @param {Object} [assets] Object passed back from loader namespace load method. - * Refer to {@link jibo.loader} for details. - * @abstract - */ - - /** - * Register with the parent group to enter the update loop. - * If `true` registers for update, if `false` unregisters for update. - * @method jibo.face.views.Component#registerUpdate - * @param {Boolean} bool Flag to register or unregister with update. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Frame enter loop update. - * @method jibo.face.views.Component#update - * @param {number} elapsed Time in milliseconds since the last frame update. - * @abstract - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Cleanup method to assist with garbage collection. - * @method jibo.face.views.Component#destroy - */ - - /** - * Called by parent ComponentGroup once parent has finished its loading and setup. - * Allows opportunity to do additional setup that may depend on other components. - * - * ATTENTION : This should not be called directly, the parent View {@link jibo.face.views.View} - * will call this, which will recurse through Component tree. - * @method jibo.face.views.Component#ready - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Method for `open` transition, override to custom how Component opens. - * Method is responsible for calling the callback in all situations as - * the parent ComponentGroup is waiting for all children to trigger the callback in oder to complete. - * - * ATTENTION : This should not be called directly, {@link jibo.face.views} - * will manage when Components should close during the view process. - * @method jibo.face.views.Component#open - * @param {Function} callback Function to be called once open is complete. - * @param {String} transitionType String used to determine way Component opens. - * Refer to {@link jibo.face.views} for constants used - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Method for `close` transition, override to custom how Component opens. - * Method is responsible for calling the callback in all situations as - * the parent ComponentGroup is waiting for all children to trigger the callback in oder to comple - * - * ATTENTION : This should not be called directly, {@link jibo.face.views} - * will manage when Components should close during the view process. - * @method jibo.face.views.Component#close - * @param {Function} callback Function to be called once open is complete. - * @param {String} [transitionType] String used to determine way Component closes. - * Refer to {@link jibo.face.views} for constants used. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - */ - - /** - * Manually add an asset descriptor via parameters. - * Refer to {@link jibo.loader} for documentation. - * @method jibo.face.views.Component#addAssetDescriptor - * @param {String} id The id for the asset, ids must be unique, otherwise they will override each other. - * @param {String} src The source path of the asset to be loaded - * @param {String} type The type of asset to load. Refer to {@link jibo.loader} for valid types. - * @param {Boolean} [upload = false] Flag determining if asset should be loaded to the CPU as part of the load process. - * @param {String} [cache] - Cache asset is associated with. Will use the loader's current cache unless otherwise specified. - * @returns {Object} Asset descriptor added - */ - - /** - * Manually add an asset descriptor object. Refer to {@link jibo.loader} for documentation on format. - * @method jibo.face.views.Component#addAssetDescriptorObject - * @param {jibo.face.views~AssetDescriptor} assetDescriptor See {@link jibo.loader} for asset format. - * @returns {Object} Asset descriptor object added. - */ - - /** - * Component has interactivity. - * NOTE: Possible that interactivity is not active, will still return `true` in this case. - * @name jibo.face.views.Component#hasTouchInteractive - * @type {Boolean} - * @readOnly - */ - - /** - * Whether Component has interactivity and it is active. - * @name jibo.face.views.Component#isTouchInteractive - * @type {Boolean} - * @readOnly - */ - - /** - * Add a {@link jibo.face.views.ActionData} and associate it with given gesture. - * Generally these actions are triggered on a screen press (if a screen press is set up). - * Adding an action adds interactivity to the Component. - * @method jibo.face.views.Component#addAction - * @param {jibo.face.views.ActionData | string} action - The action to be triggered on click, - * can pass the ActionData or provide the action type - * @param {any} [data] - The data Object for the action, generally used if passing the action type. - * @param {boolean} [clearPrevious = false] Flag to determine if we should clear out the existing actions. - * @param {boolean} [toFront = false] If `true` adds action to front of actions list, causing it to be called first when actions are triggered. - * @param {jibo.face.views.GESTURE} [gesture = tap] - Type of gesture the actions are associated with. - * @returns {jibo.face.views.ActionData} The ActionData added. - */ - - /** - * Clear all actions associated with given gesture type. - * @method jibo.face.views.Component#clearActions - * @param {jibo.face.views.GESTURE} [gesture = tap] - Type of gesture the actions ae associated with. - */ - - /** - * Remove all actions of given type associated with given gesture. - * @method jibo.face.views.Component#removeActionsByType - * @param {string} actionType - Type of ActionData to remove. - * @param {jibo.face.views.GESTURE} [gesture = tap] - Type of gesture the actions are associated with. - */ - - /** - * Trigger actions associated with given gesture type. - * Calls Component or the Component parent's actionHandler for each action. - * @method jibo.face.views.Component#triggerActions - * @param {jibo.face.views.GESTURE} [gesture = tap] - Type of gesture the actions are associated with. - * @return {boolean} `true` if at least one action was triggered. - */ - - /** - * Get actions associated with given gesture type. - * @method jibo.face.views.Component#getActions - * @param {jibo.face.views.GESTURE} [gesture = tap] - Type of gesture the actions ae associated with. - * @return {jibo.face.views.ActionData[]} Array of actions. - */ - - /** - * Returns `true` if there are actions associated with given gesture type. - * @method jibo.face.views.Component#hasActions - * @param {jibo.face.views.GESTURE} [gesture = tap] - Gesture actions related to. - * @return {boolean} `true` if actions found for given gesture type. - */ - - /** - * Turn interactivity on and off. - * @method jibo.face.views.Component#lockInput - * @param {Boolean} flag - Flag to turn interactivity on or off. - */ \ No newline at end of file diff --git a/docs/rendering/gui/ComponentCreator.js b/docs/rendering/gui/ComponentCreator.js deleted file mode 100644 index 0d0dcf4b..00000000 --- a/docs/rendering/gui/ComponentCreator.js +++ /dev/null @@ -1,94 +0,0 @@ - /** - * Instance used for singleton. - * @name jibo.face.views.ComponentCreator._instance - * @type {jibo.face.views.ComponentCreator} - * @private - */ - - /** - * Hash table for registered classes. - * To be able to create Classes dynamically must first keep reference to them - * that can later be retrieved by key value pairing. - * @name jibo.face.views.ComponentCreator#_classRegistry - * @type {any} - * @private - */ - - /** - * Default view to create if none is specified in creation methods. - * @name jibo.face.views.ComponentCreator.DEFAULT_VIEW - * @type {String} - * @default 'View' - * @readonly - * @private - */ - - /** - * Create a View from its class and configuration data. - * @method jibo.face.views.ComponentCreator#createView - * @param {any} [viewClass] Can be the class Object or the string name of the class (name must match class names in registry). - * @param {any} [config] Can config as an Object or a string of the path the JSON config file. - * @returns {jibo.face.views.View} The View created. - */ - - /** - * Creates a view from a config. - * @method jibo.face.views.ComponentCreator#createViewFromConfigObject - * @param {Object} config The configuration Object for the Component. - * @returns {jibo.face.views.View} The View created. - */ - - /** - * Create a View from its configuration path. - * This process requires a load, the {@link jibo.face.views.View} will be returned within the given callback - * @method jibo.face.views.ComponentCreator#createViewFromConfigPath - * @param {String} configPath Path to the configuration file defining the View to create. - * @param {jibo.face.views~ViewCallback} complete Callback called once when View is created. - * @param {Function} [failure] Callback called if View fails to be created. - */ - - /** - * Creates a {@link jibo.face.views.ViewState} that represent a {@link jibo.face.views.View}. - * ComponentCreator keeps a registry of known View classes, which allows the classes to be constructed. - * @method jibo.face.views.ComponentCreator#createViewState - * @param {Object|String} viewClass Can be View class or string name of View class. - * @param {Object|String} [config] Can be configuration Object or the path to JSON config file. - * @returns {jibo.face.views.ViewState} The created ViewState. - */ - - /** - * Create a {@link jibo.face.views.View} from a {@link jibo.face.views.ViewState}. - * @method jibo.face.views.ComponentCreator#createViewFromState - * @param {jibo.face.views.ViewState} viewState The ViewState associated with the View to create. - * @returns {jibo.face.views.View} The created View. - */ - - /** - * Create a {@link jibo.face.views.Component} from configuration data. - * @method jibo.face.views.ComponentCreator#createComponentFromConfig - * @param {Object} componentConfig Configuration Object for the Component, generally derived from JSON. - * @returns {jibo.face.views.Component} The Component defined by the configuration Object. - */ - - /** - * Register class so it can be referenced later for dynamic creation. - * A `key` must be provided to retrieve the class, if none is provided - * then the method looks for a `DEFAULT_TYPE` property on the class. - * When creating a custom class it is helpful to define `DEFAULT_TYPE`. - * This `key` is also used within the JSON configuration to specify the component Class. - * @method jibo.face.views.ComponentCreator#registerClass - * @param {any} componentClass The Class to register. Class must be or extend {@link jibo.face.views.View}. - * @param {String} [classType] If specified the given string will be used as the registry key, - * otherwise registry key is derived from the Class's name. - * classNameOverride allows for multiple registries for the same Class, - * which can be used for type variation within the same Class. - * @example - * static public static get DEFAULT_TYPE():string {return 'YourClassName';} - */ - - /** - * Unregister a class from the class registry. - * Pass the 'key' used to register the class. - * @method jibo.face.views.ComponentCreator#unregisterClass - * @param {String} [classType] The string used to identify the class, often this is defined by the class via DEFAULT_TYPE - */ \ No newline at end of file diff --git a/docs/rendering/gui/ComponentGroup.js b/docs/rendering/gui/ComponentGroup.js deleted file mode 100644 index 48b17cce..00000000 --- a/docs/rendering/gui/ComponentGroup.js +++ /dev/null @@ -1,265 +0,0 @@ - /** - * DO NOT ADD TO DIRECTLY - * - * Object serving as hash table for child Components using the Component's id variable as a key. - * To add components use [addComponent()]{@link jibo.face.views.ComponentGroup#addComponent} - * @name jibo.face.views.ComponentGroup#componentLibrary - * @type {Object} - * @protected - */ - - /** - * DO NOT ADD TO DIRECTLY - * - * Array of child Components. - * To add components use [addComponent()]{@link jibo.face.views.ComponentGroup#addComponent} - * @name jibo.face.views.ComponentGroup#componentList - * @type {jibo.face.views.Component[]} - * @protected - */ - - /** - * DO NOT WRITE DIRECTLY - * - * Array of config Objects (generally derived from JSON). - * Gets defined within various creation methods. - * @name jibo.face.views.ComponentGroup#componentConfigs - * @type {any[]} - * @protected - */ - - /** - * Container for displays, is set within [createDisplay()]{@link jibo.face.views.Component#createDisplay} - * which receives the container as a parameter. - * @name jibo.face.views.ComponentGroup#container - * @type {PIXI.Container} - * @protected - */ - - /** - * List of Components that have registered to be updated. - * @name jibo.face.views.ComponentGroup#_updateRegistry - * @type {jibo.face.views.Component[]} - * @private - */ - - /** - * Get the number of child components. - * @name jibo.face.views.ComponentGroup#componentsTotal - * @type {number} - * @readOnly - */ - - /** - * List of assets required by the ComponentGroup and its Component children. - * Compiles list of all assets on each call. - * @name jibo.face.views.ComponentGroup#assetDescriptors - * @type {jibo.face.views~AssetDescriptor[]} - * @readOnly - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Compiles together required assets for the ComponentGroup and its children. - * @name jibo.face.views.ComponentGroup#groupAssetDescriptors - * @type {jibo.face.views~AssetDescriptor[]} - * @readonly - * @protected - */ - - /** - * Turn the interactivity of the child components off or on. - * @method jibo.face.views.ComponentGroup#lockInput - * @param {boolean} flag - Flag to turn interactivity on or off. - */ - - /** - * Turn the interactivity of the child components off or on. - * @method jibo.face.views.ComponentGroup#lockChildInput - * @param {boolean} flag - Flag to turn interactivity on or off. - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Update configuration Object to reflect the current configuration state. - * This ensures that when the Component is recreated from its configuration it reflects its last state. - * @method jibo.face.views.ComponentGroup#updateConfig - * @param {Object} configObject Configuration Object to update. - * @returns {any} The given configuration Object with any required values updates applied. - */ - - /** - * Add component to this ComponentGroup, allows parent and child to reference to each other. - * @method jibo.face.views.ComponentGroup#addComponent - * @param {jibo.face.views.Component} component The Component to add this group's component list and library. - * @param {String} [componentId] The id to assign to the Component, if specified will overwrite existing id, - * if none is specified an id will be automatically generated and assigned. - * @returns {jibo.face.views.Component} The given Component. - */ - - /** - * Get index of Component within the ComponentGroup's component list. - * @method jibo.face.views.ComponentGroup#getIndexOfComponent - * @param {jibo.face.views.Component} component - Component to check for index. - * @returns {number} Index of the Component in the component list - */ - - /** - * Remove ComponentGroup's reference to a Component. - * This does not destroy the Component or remove its assets from the manifest. - * It only removes it from the ComponentGroup array and hash that reference it. - * @method jibo.face.views.ComponentGroup#removeComponent - * @param {jibo.face.views.Component|Number|String} componentDeterminer Provide Component, index of component, or id of component to remove. - * @returns {jibo.face.views.Component} The Component being removed. - */ - - /** - * Retrieve a child Component by its id. - * @method jibo.face.views.ComponentGroup#getComponentById - * @param {String} componentId The ID of the component to retrieve. - * @returns {jibo.face.views.Component} The retrieved component. - */ - - /** - * Retrieve a child Component by its index. - * @method jibo.face.views.ComponentGroup#getComponentByIndex - * @param {number} index The index of the component to retrieve. - * @returns {jibo.face.views.Component} The retrieved component. - */ - - /** - * Returns first component found in Component tree that returns `true` for given test. - * Iterates downward, breadth-first search, starting from this ComponentGroup. - * @method jibo.face.views.ComponentGroup#findComponent - * @param {Function} testFunction - Function must take a Component parameter and return a boolean, - * passing an additional Object to test against is optional. - * @param {any} [against] - Object to test against. - * @return {jibo.face.views.Component} First Component found that the testFunction return `true` for. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Frame enter loop update. - * Calls update method of any child that has registered for updates. - * @method jibo.face.views.ComponentGroup#update - * @param {number} elapsed Time in milliseconds since the last frame update. - */ - - /** - * Register for the given component's update method to be called. - * @method jibo.face.views.ComponentGroup#registerComponentUpdate - * @param {jibo.face.views.Component} component The component to update. - */ - - /** - * Stop the given component's update method from getting called. - * @method jibo.face.views.ComponentGroup#unregisterComponentUpdate - * @param {jibo.face.views.Component} component The Component to stop providing updates to. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Create this Component's display as well as calling createDisplay on all child Components. - * This method should should 'visualize' the component, creating DisplayObjects and adding them the container. - * @method jibo.face.views.ComponentGroup#createDisplay - * @param {PIXI.Container} container Is ultimately a child of the stage. - * @param {any} assets Object passed back from loader namespace load method, - * refer to loader namespace within jibo for details. - */ - - /** - * Called by parent ComponentGroup once parent has finished its loading and setup, - * calls ready on all child Components. - * Allows opportunity to do additional setup that may depend on other components. - * - * ATTENTION: This should not be called directly; the top level [View]{@link jibo.face.views.View} - * will call this, which will recurse through Component tree. - * @method jibo.face.views.ComponentGroup#ready - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Method for `open` transition. - * Iterates through components and calls their open method. - * Method is responsible for calling the callback in all situations. - * - * ATTENTION : This should not be called directly; {@link jibo.face.views} - * will manage when Components should open during the view process. - * @method jibo.face.views.ComponentGroup#open - * @param {Function} callback Function to be called once open is complete. - * @param {String} transitionType String used to determine way Component opens, - * refer to ViewManager for constants used - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Method for `close` transition. - * Iterates through components and calls their close method. - * Method is responsible for calling the callback in all situations. - * - * ATTENTION : This should not be called directly; {@link jibo.face.views} - * will manage when Components should close during the view process. - * @method jibo.face.views.ComponentGroup#close - * @param {Function} callback Function to be called once close is complete. - * @param {String} [transitionType] String used to determine way Component closes, - * refer to ViewManager for constants used. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - */ - - /** - * Call open method on all component children. - * Iterates through components and calls their open method, passing given transitionType. - * Method is responsible for calling the callback in all situations. - * @method jibo.face.views.ComponentGroup#openChildren - * @param {Function} callback Function called once all component children have completed their open. - * @param {String} transitionType Transition type passed to all component children. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @protected - */ - - /** - * Call close method on all component children. - * Iterates through components and calls their close method. - * Method is responsible for calling the callback in all situations. - * @method jibo.face.views.ComponentGroup#closeChildren - * @param {Function} callback Function called once all component children have completed their close. - * @param {String} transitionType Transition type passed to all component children. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @protected - */ - - /** - * Method to bubble actions up from Components. - * Actions pass through this method up to next ComponentGroup parent, ultimately reaching the ViewManager. - * Passing action up through parents allows each to augment or block the action if desired. - * @method jibo.face.views.ComponentGroup#actionHandler - * @param {jibo.face.views.ActionData} action Contains string for type of action and data Object - * with any pertinent data dependent on action type. - * @param {jibo.face.views.Component} [fromComponent] The component that triggered the action (if applicable). - */ - - /** - * Method to pass actions downward to Components. - * Passing actions through parent chain allows parents to interrupt and augment actions. - * @method jibo.face.views.ComponentGroup#actionEnactor - * @param {jibo.face.views.ActionData} action Contains string for type of action and data Object - * with any pertinent data dependent on action type. - * @return {boolean} `true` if action is acted on by this ComponentGroup or any of its ComponentGroup children. - */ - - /** - * Handler for when transitions are all complete. - * @method jibo.face.views.ComponentGroup#transitionComplete - * @param {Function} callback The callback triggered once all components have completed their transitions. - * @param {Error} [err] Error returns if there is an issue with the asynchronous method. - * @param {any[]} [results] Results returned from asynchronous method, will be empty. - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/DisplayUtils.js b/docs/rendering/gui/DisplayUtils.js deleted file mode 100644 index fd6cc1c1..00000000 --- a/docs/rendering/gui/DisplayUtils.js +++ /dev/null @@ -1,24 +0,0 @@ - /** - * Get the uniform scale required for DisplayObject to fit given dimensions. - * @method jibo.face.DisplayUtils#getScaleByWidthHeight - * @param {PIXI.DisplayObject} displayObject - DisplayObject to get the scale for. - * @param {number} width - Target width. - * @param {number} height - Target height. - * @returns {number} Uniform scale to apply to given DisplayObject for it to fit given dimension. - */ - - /** - * Check whether display if contained by another display. - * @method jibo.face.DisplayUtils#isContained - * @param {PIXI.DisplayObject} display - DisplayObject checking for containment. - * @param {PIXI.Container} container - Container to check if display is contained within. - * @returns {boolean} `true` if display is contained within container. - */ - - /** - * Takes position value provided for the element and makes sure that it is positioned properly + processes LEFT/RIGHT/CENTER/TOP/BOTTOM alignment options - * Remember, that RIGHT/BOTTOM alignment does not include actual element bounds, this should be handled separately - * @method jibo.face.DisplayUtils#getElementPosition - * @param {Object} position - Position data for the element - * @returns {PIXI.Point} Contains proper point value of the element on the screen - */ \ No newline at end of file diff --git a/docs/rendering/gui/TouchManager.js b/docs/rendering/gui/TouchManager.js deleted file mode 100644 index 93883143..00000000 --- a/docs/rendering/gui/TouchManager.js +++ /dev/null @@ -1,282 +0,0 @@ -/** - * @typedef jibo.face.views~GESTURE - * @description Static class with static members that describe possible types of gestures - * @prop TAP Gesture type for a single tap - * @prop SWIPE_DOWN Gesture type for a swipe down - * @prop SWIPE Old name for SWIPE_DOWN - * @prop SWIPE_UP Gesture type for a swipe up - * @prop PAN Gesture type for a pan. - */ - - /** - * Gets singleton instance of TouchManager. - * @name jibo.face.views.TouchManager#instance - * @type {jibo.face.views.TouchManager} - * @readonly - */ - - /** - * Instance used for singleton. - * @name jibo.face.views.TouchManager._instance - * @type {jibo.face.views.TouchManager} - * @private - */ - - /** - * Threshold of movemnent between gesture types. - * @type {number} - * @name jibo.face.views.TouchManager.THRESHOLD - * @readOnly - * @private - */ - - /** - * Pixi interaction manager reference. - * @type {PIXI.interation.TouchManager} - * @name jibo.face.views.TouchManager#_interactionManager - * @private - */ - - /** - * Reference to canvas element. - * @type {Object} - * @name jibo.face.views.TouchManager#_canvas - * @private - */ - - /** - * Reference to GestureManager instance. - * @type {jibo.face.GestureManager} - * @name jibo.face.views.TouchManager#_gestureManager - * @private - */ - - /** - * Reference to ViewManager instance. - * @type {jibo.face.views} - * @name jibo.face.views.TouchManager#_viewManager - * @private - */ - - /** - * Reference to the tap gesture. - * @name jibo.face.views.TouchManager#_tapGesture - * @type {HammerJS.Tap} - * @private - */ - - /** - * Reference to the swipe down gesture. - * @name jibo.face.views.TouchManager#_swipeDownGesture - * @type {HammerJS.Swipe} - * @private - */ - - /** - * Reference to the swipe up gesture. - * @name jibo.face.views.TouchManager#_swipeUpGesture - * @type {HammerJS.Swipe} - * @private - */ - - /** - * Reference to the pan horizontal gesture. - * @name jibo.face.views.TouchManager#_panHorizontalGesture - * @type {HammerJS.Pan} - * @private - */ - - /** - * Object (PIXI.interaction.InteractionEvent) used to pass input position for PIXI hit testing. - * @name jibo.face.views.TouchManager#_interactionEvent - * @type {any} - * @private - */ - - /** - * Holds reference to element most recently hit. - * @name jibo.face.views.TouchManager#_elementHit - * @type {jibo.face.views.Element} - * @private - */ - - /** - * Flag for whether in simulator or not. - * @name jibo.face.views.TouchManager#_isSim - * @type {boolean} - * @private - */ - - /** - * Value holding the latest X coordinate when emulating panning. - * @name jibo.face.views.TouchManager#_prevX - * @type {Number} - * @private - */ - - /** - * Value holding the latest Y coordinate when emulating panning. - * @name jibo.face.views.TouchManager#_prevY - * @type {Number} - * @private - */ - - /** - * Flag indicating current state of pan emulation. - * @name jibo.face.views.TouchManager#_isEmulatingPan - * @type {boolean} - * @private - */ - - /** - * Flag indicating whether user has his finger on the screen - * This flag is set only on real Jibo and only by core event listener - * @name jibo.face.views.TouchManager#_isMouseDown - * @type {boolean} - * @private - */ - - /** - * Remove gesture by type. - * @method jibo.face.views.TouchManager#addGesture - * @param {jibo.face.views.GESTURE} [gesture = 'tap'] - type of gesture to remove. - * @param {Function} [gestureEventCallback] - For use with Pan gesture, handler called on each pan event. - */ - - /** - * Remove gesture by type. - * @method jibo.face.views.TouchManager#removeGesture - * @param {jibo.face.views.GESTURE} [gesture = 'tap'] - type of gesture to remove. - */ - - /** - * Remove all possible TouchManager gestures. - * @method jibo.face.views.TouchManager#removeAllGestures - */ - - /** - * Create gestures required by Component tree. - * NOTE :: Does not create pan gesture, must be created by Component that requires it. - * @method jibo.face.views.TouchManager#createRequiredGestures - * @param view {jibo.face.views.View} View to create gestures for. - */ - - /** - * Destroy. - * @method jibo.face.views.TouchManager#destroy - */ - - /** - * Add listener for input exiting viewport. - * @method jibo.face.views.TouchManager#addViewportOut - * @private - */ - - /** - * Remove listener for input exiting viewport. - * @method jibo.face.views.TouchManager#removeViewportOut - * @private - */ - - /** - * Create listener for input exiting viewport. - * @method jibo.face.views.TouchManager#createViewportOut - * @private - */ - - /** - * Add listeners that will track core mouse events. - * We need them to emulate panning in those cases when user started panning outside of the touch screen. - * @method jibo.face.views.TouchManager#addCoreTouchEvents - * @private - */ - - /** - * Remove listeners for core mouse events. - * @method jibo.face.views.TouchManager#removeCoreTouchEvents - * @private - */ - - /** - * Listener of mouse core events that we might need to determine if user - * has started panning outside of the screen - * @method jibo.face.views.TouchManager#onCoreTouchEvent - * @private - */ - - /** - * Set the input coordinates and clear the target. - * @method jibo.face.views.TouchManager#resetInput - * @param {Number} x - x poisition - * @param {Number} y - y position - * @private - */ - - /** - * Create a gesture for tap. - * Refer to HammerJS documentation for Tap values {@link http://hammerjs.github.io/recognizer-tap} - * @method jibo.face.views.TouchManager#createTapGesture - * @returns {boolean} `true` if a new gesture was created. - * @private - */ - - /** - * Handler for tap complete event. - * @method jibo.face.views.TouchManager#tapHandler - * @param gestureEvent {any} - * @private - */ - - /** - * Find Element within View whose display was tapped. - * @param {jibo.face.views.View} currentView - View to check. - * @returns {boolean} - * @private - */ - - /** - * Function required by PIXI processInteractive method, create method to speed up process - * @method jibo.face.views.TouchManager#checkElementHit - * @param {any} event - PIXI.interactive.InteractionEvent passed from Pixi's hit test - * @param {PIXI.DisplayObject} displayObject - dis - * @param {boolean} hit - Flag for hit test against display object - * @private - */ - - /** - * Create a gesture for swipe down. - * @method jibo.face.views.TouchManager#createSwipeDownGesture - * @returns {boolean} `true` if a new gesture was created. - * @private - */ - - /** - * Handler for swipe down complete event. - * Currently only activates for Views. - * @method jibo.face.views.TouchManager#swipeDownHandler - * @param gestureEvent {any} - * @private - */ - - /** - * Create a gesture for swipe up. - * @method jibo.face.views.TouchManager#createSwipeUpGesture - * @returns {boolean} `true` if a new gesture was created. - * @private - */ - - /** - * Handler for swipe up complete event. - * Currently only activates for Views. - * @method jibo.face.views.TouchManager#swipeUpHandler - * @param gestureEvent {any} - * @private - */ - - /** - * Create a gesture for horizontal pan. - * @method jibo.face.views.TouchManager#createPanHorizontalGesture - * @param {Object} gestureEventCallback - * @returns {boolean} `true` if a new gesture was created. - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/ViewGlobalEvents.js b/docs/rendering/gui/ViewGlobalEvents.js deleted file mode 100644 index ee679651..00000000 --- a/docs/rendering/gui/ViewGlobalEvents.js +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @class ViewGlobalEvents - * @description Typed global view events for ViewManager (`jibo.face.views.events`) - * @example - * jibo.face.views.events.process.on(onProcess); - * - * onProcess = (result:ViewProcessResult) => { - * // act accordingly - * } - * - * // When finished with event listening - * jibo.face.views.events.process.removeListener(onProcess); - * - * @memberof jibo.face.views - */ - - /** - * Emits results from view change process. - * @name jibo.face.views.ViewGlobalEvents#process - * @type {Event} - */ - - /** - * Emits results from View emitted events. - * @name jibo.face.views.ViewGlobalEvents#view - * @type {Event} - */ - -/** - * @class ViewProcessResult - * @description Result from change in view change process. - * @memberof jibo.face.views - */ - - /** - * Current state of view process. - * Refer to {@link jibo.face.views.ViewProcess} for status values. - * @name jibo.face.views.ViewProcessResult#status - * @type {String} - * @readOnly - */ - - /** - * Id of current view in process. - * @name jibo.face.views.ViewProcessResult#currentId - * @type {String} - * @readOnly - */ - - /** - * Id of closing view in process. - * @name jibo.face.views.ViewProcessResult#closingId - * @type {String} - * @readOnly - */ - - /** - * Serialized change options of process. - * @name jibo.face.views.ViewProcessResult#changeOptions - * @type {jibo.face.views~ChangeOptions} - * @readOnly - */ - -/** - * @class ViewResult - * @description Results from events emitted by View. - * @memberof jibo.face.views - */ - - /** - * Event emitted from view. - * @name jibo.face.views.ViewResult#event - * @type {String} - * @readOnly - */ - - /** - * Id of view emitting the event. - * @name jibo.face.views.ViewResult#id - * @type {String} - * @readOnly - */ - - /** - * Type of view emitting the event. - * @name jibo.face.views.ViewResult#type - * @type {String} - * @readOnly - */ - - /** - * Statis of view emitting the event. - * Refer to {@link jibo.face.views.View} for status values. - * @name jibo.face.views.ViewResult#status - * @type {String} - * @readOnly - */ - - /** - * Any additional data that may be passed with the event. - * @name jibo.face.views.ViewResult#data - * @type {any} - * @readOnly - */ \ No newline at end of file diff --git a/docs/rendering/gui/ViewManager.js b/docs/rendering/gui/ViewManager.js deleted file mode 100644 index cfb3473a..00000000 --- a/docs/rendering/gui/ViewManager.js +++ /dev/null @@ -1,633 +0,0 @@ -/** - * Callback given to view process methods, called once process completes successfully. - * @callback jibo.face.views~ViewCallback - * @param [view] {jibo.face.views.View} View associated with view process, not all view processes return a View. - * @param [done] {Function} ONLY used for the onLoaded callback within [changeView()]{@link jibo.face.views#changeView}. - * Not specifying this parameter on the onLoaded callback makes it synchronous. - * Specifying makes the callback asynchronous and requires that `done()` be called at some point within the method. - */ - -/** - * @interface jibo.face.views~ChangeOptions - * @description Interface for changing view process options. - * @prop {Boolean} [remove] - `true` to remove current element. - * This is exclusive from the other `remove*` methods, with the order of override: `removeAll > removeTo > removeToInclude > remove` - * @prop {Boolean} [removeAll] - `true` to remove all views down to root. - * This is exclusive from the other `remove*` methods, with the order of override: `removeAll > removeTo > removeToInclude > remove` - * @prop {String} [options.removeTo] - Id of a view within the stack, all views above it will be removed. - * This is exclusive from the other `remove*` methods, with the order of override: `removeAll > removeTo > removeToInclude > remove` - * @prop {String} [options.removeToInclude] - Id of a view within the stack, that view and all views above it will be removed. - * This is exclusive from the other `remove*` methods, with the order of override: `removeAll > removeTo > removeToInclude > remove` - * @prop {Boolean} [leaveEmpty] - `true` to prevent next view in stack from opening and leaving the display empty. - * Setting to `true` overrides `addView`. - * @prop {String|jibo.face.views.View|any} [addView] - Add view, can specify a path to config file, instantiated View, or view config Object. - * @prop {jibo.face.views.PauseOverlay#PauseOptions} [pause] - If when adding the next view the current view should be paused. If so, how. - * @prop {String} [transitionClose] - Type of transition the current View should use to close. - * @prop {String} [transitionOpen] - Type of transition the next View should use to open. - */ - -/** - * @interface jibo.face.views~AssetDescriptor - * @description Interface for asset description objects, used in conjunction with [loader]{@link jibo.loader}. - * @prop {String} id - Id of asset, should be unique within cache. - * @prop {String} type - Type of asset, for valid types refer to [loader]{@link jibo.loader}. - * @prop {String} src - URI of asset. - * @prop {Boolean} [upload] - If `true` will also load to GPU. - * @prop {String} [cache] - Cache asset is associated with. Will use the loader's currently default cache unless otherwise specified. - */ - -/** - * @typedef jibo.face.views~STACK_DIRECTION - * @description Enum - For use with `View.addTransition` & `View.applyTransitions` - * to define transitions by the way the view stack will change. - * @prop 1 ADD - * @prop 2 REMOVE - * @prop 3 SWAP - */ - -/** - * @typedef jibo.face.views~TRANSITION - * @description Static class with static members that describe possible transitions for views. - * @prop UP Transition type for view to move up. - * @prop DOWN Transition type for view to move down. - * @prop LEFT Transition type for view to move left. - * @prop RIGHT Transition type for view to move right. - * @prop IN Transition type for view to fade and scale in from center of screen. - * @prop OUT Transition type for view to fade and scale out from center of screens. - * @prop EYE Transition type for view to or from eye. - * @prop NONE Transition type for no transition. - */ - -/** - * @class ViewManager - * @description Everything in this class is now accessible as part of {@link jibo.face.views}. - * Please update your code to use the `face.views` namespace instead of the `ViewManager` class. - * @memberof jibo.face.views - * @deprecated Since 7.4.1 - * @see jibo.face.views - */ - -/** - * Manages the creation and transition of the GUI. - * @namespace jibo.face.views - */ - - /** - * Default duration, in milliseconds, of open and close view transitions. - * @type {number} - * @private - */ - - /** - * Top level container. - * @name jibo.face.views#stage - * @type {PIXI.Container} - */ - - /** - * If the view manager is disabled, in which case all view changes will fail immediately. - * This will only be used when the WebGL context is lost. - * @name jibo.face.views#disabled - * @type {boolean} - * @private - */ - - /** - * If movement should be disabled due to screen taps - don't want to move around once the GUI - * has begun to be used. - * @name jibo.face.views#_disableMovement - * @type {boolean} - * @private - */ - - /** - * Array of ViewStates in order of the view hierarchy. - * @name jibo.face.views#_viewStates - * @type {Array} - * @private - */ - - /** - * Class to assist in creation of Views and Components. - * @name jibo.face.views#_creator - * @type {jibo.face.views.ComponentCreator} - * @private - */ - - /** - * Class to manage interactions. - * @name jibo.face.views#_interactionManager - * @type {jibo.face.views.TouchManager} - * @private - */ - - /** - * Handle to the Menu attention mode pushed with a GUI view. - * @name jibo.face.views#_menuMode - * @type {jibo.attention.AttentionModeHandle} - * @private - */ - - /** - * Event dispatched when the View is going to close because of a 'back' command. - * Currently closing a View and going back to the previous view is triggered by a swipe down. - * The same constant is statically accessible via `View.BACK`, but duplicated here for convenience. - * @type {string} - * @name jibo.face.views#BACK - * @constant - * @readOnly - */ - - /** - * Option for setting custom transitions. - * Use with `View.addTransition` for transitions to be used when opening from or closing to an empty screen. - * The same constant is statically accessible via `View.EMPTY`, but duplicated here for convenience. - * @type {string} - * @name jibo.face.views.EMPTY - * @readOnly - */ - - /** - * Option for setting custom transitions. - * Use with `View.addTransition` for transitions to be used when opening over a paused view or closing while being paused. - * The same constant is statically accessible via `View.PAUSED`, but duplicated here for convenience. - * @type {string} - * @name jibo.face.views.PAUSED - * @readOnly - */ - - /** - * Current top-level view. - * @name jibo.face.views#currentView - * @type {jibo.face.views.View} - * @readOnly - */ - - /** - * Class to assist in creation of Views and Components. - * @name jibo.face.views#creator - * @type {jibo.face.views.ComponentCreator} - * @readOnly - */ - - /** - * Maintains view processes. - * @name jibo.face.views#_viewProcess - * @type {jibo.face.views.ViewProcess} - * @private - */ - - /** - * Source for global events related to GUI processes. - * @name jibo.face.views#_events - * @type {jibo.face.views.ViewGlobalEvents} - * @private - */ - - /** - * Black gradient border at edge of screen, layered above ViewManager stage. - * @name jibo.face.views#_border - * @type {PIXI.Container} - * @private - */ - - /** - * Image that exist above all displays and the border, there can only be one watermark at a time. - * Use for things like remote mode indication. - * @name jibo.face.views#_waterMark - * @type {PIXI.Container} - * @private - */ - - /** - * Flag to keep track of visibility of border. - * @name jibo.face.views#_borderVisibility - * @type {Boolean} - * @private - */ - - /** - * Visibility of border. - * @name jibo.face.views#borderVisible - * @param {Boolean} visible Determines border's visibility - */ - - /** - * Will return the total number of views in the view stack. - * @name jibo.face.views#viewStackLength - * @type {number} - * @readOnly - */ - - /** - * Determines if views are currently in process. - * @name jibo.face.views#viewsInProcess - * @type {boolean} - * @readOnly - */ - - /** - * Create a View by specifying the class and the configuration. - * @method jibo.face.views#createView - * @param {Object|String} [viewDeterminer] Can be the Class or name of Class of the the view to create. - * @param {Object} [config] Config can be an Object or a string of the path to the JSON file for the config. - * @param {Boolean} [open=false] If true continue process of adding and opening the view. - * @param {jibo.face.views~ViewCallback} [onOpenComplete] Callback for when View has finished opening, will only be used if the open flag is set to true. - * @param {String} [openTransition=TRANSITION.UP] Type of transition to open view. - * @param {String} [closeTransition=TRANSITION.UP] Type of transition to close view. - * @return {jibo.face.views.View} The View created. - */ - - /** - * Create a View from only the View's configuration path. - * Unlike the the createView method, this method does not require the view class to be specified, - * instead the view class is derived from the configuration file. - * This method does not return the View directly, but rather through the provided callback. - * If the open flag is set to true the callback will be fire when the View is created, and opened, - * if not the callback is fire as soon as the View class is created. - * @method jibo.face.views#createViewFromConfigPath - * @param {String} configPath Path to the configuration for the view. - * @param {Boolean} [open=false] If true continue process of adding and opening the view, callback will be fired after View finishes opening. - * @param {jibo.face.views~ViewCallback} callback Callback that returns the View - * @param {String} [openTransition=TRANSITION.UP] Type of transition to open view. - * @param {String} [closeTransition=TRANSITION.UP] Type of transition to close view. - */ - - /** - * Add the view that is at the top of the stack. - * This is generally used when there is no current view present - * (i.e. to create the first eye view, or when a view was removed to empty) - * @method jibo.face.views#addViewNextInStack - * @param {jibo.face.views~ViewCallback} callback Callback that returns the View - * @param {String} [openTransition=TRANSITION.UP] Type of transition to open view. - * @param {String} [closeTransition=TRANSITION.UP] Type of transition to close view. - * @param {Function} [onFailure] Callback for if process does not complete - */ - - /** - * Passes {@link jibo.face.views.ActionData} to the current {@link jibo.face.views.View} and its children. - * @method jibo.face.views#actionEnactor - * @param {jibo.face.views.ActionData} action - The action to be passed. - * @return {boolean} `true` if action is acted on by the current View or any of its ComponentGroup children. - */ - - /** - * Process for changing views, takes a config that defines process particulars. - * @example - * Option examples - * - * 'Example of closing all views and leave display empty' - * { - * removeAll: true, - * leaveEmpty: true, - * } - * - * 'Example of opening view lower in the view stack and having it fade in' - * { - * removeTo: 'myView', - * transitionOpen: "trans_in" - * } - * - * 'Example of closing current view and leaving display empty' - * { - * remove: true, - * leaveEmpty: true - * } - * - * 'Example of opening a new view while pausing the view beneath it but fully hiding it using standard overlay tween' - * { - * addView: "resources/views/myViewConfig.json", - * pause:{ - * "alpha": 1, - * } - * } - * - * 'Example of removing all views above a particular view in the stack and then opening that view, using view's id' - * { - * removeTo: "myView" - * } - * - * 'Example of removing a particular view and all views above it in the stack, then adding a new view.' - * { - * removeToInclude: "myView", - * addView: "resources/views/myViewConfig.json" - * } - * - * @method jibo.face.views#changeView - * @param {jibo.face.views~ChangeOptions} options - Options for view change process. - * @param {jibo.face.views~ViewCallback} [onComplete] Callback when process completes, gives the current view as a parameter. - * @param {Function} [onFailure] Callback for if process does not complete. - * @param {jibo.face.views~ViewCallback} [onLoaded] Callback when next view has loaded, use to augment view prior to it opening. - */ - - /** - * Add a new {@link jibo.face.views.View} to the hierarchy. - * Adding process involves disposing of or pausing current view and storing its state. - * @method jibo.face.views#addView - * @param {jibo.face.views.View | string} view - Info for the view to load, can pass the View class directly, - * or pass a string that is the path to the config file defining the View. - * @param {jibo.face.views~ViewCallback} [onAdded] Callback when process completes, gives the current view as a parameter. - * @param {String} [openTransition = TRANSITION.UP] Type of transition the next View should use to open. - * @param {String} [closeTransition = TRANSITION.UP] Type of transition the current View should use to close. - * @param {Function} [onFailure] Callback for if process does not complete. - */ - - /** - * Remove current {@link jibo.face.views.View} and open the View beneath it in the stack. - * Removal process involves disposing of current view and recreating prior View using its stored ViewState. - * If top most view was pausing the previous view then we don't need to recreate it, only un-pause it. - * @method jibo.face.views#removeView - * @param {jibo.face.views~ViewCallback} [onRemoved] Callback when process completes, gives the current view as a parameter. - * @param {String} [openTransition = TRANSITION.DOWN] Type of transition the next View should use to open. - * @param {String} [closeTransition = TRANSITION.DOWN] Type of transition the current View should use to close. - * @param {Function} [onFailure] Callback for if process does not complete. - */ - - /** - * Force open the eye view and clear the view stack. - * @method jibo.face.views#forceEyeView - * @param {jibo.face.views~ViewCallback} [onOpenCallback] called once eyeView is opened or if it is already open, returns the EyeView as a parameter. - * @param {Function} [onPressCallback] handler for when EyeView is pressed, if nothing is specified will remove any existing callbacks. - * @param {String} [openTransition=TRANSITION.IN] Type of transition to open view. - * @param {String} [closeTransition=TRANSITION.UP] Type of transition to close view. - * @param {Function} [onFailure] Callback for if process does not complete. - */ - - /** - * If there is an active process attempting to make the EyeView the current view we want to try not to interrupt that process as it has the same purpose as forceEyeView. - * We determine if that is the state of the process if a closing view is defined (so we know that the EyeView is not what the process may be closing) - * AND the current view (which is an EyeView) has a status indicating it is going to open, basically that it is loaded but not yet open. - */ - - /** - * Clear the view stack, if current view is of category EYE leave the eye as the current view, - * if any other category remove call views and leave the current view empty. - * @method jibo.face.views#viewStackCleanup - * @param {jibo.face.views~TRANSITION} [closeTransition=TRANSITION.DOWN] Type of transition to close the current view. - * @returns {Promise} - */ - - /** - * Check if a view exists with a given ID, and can be used as `removeTo` or `removeToInclude` - * in [changeView]{@link jibo.face.views#changeView}. - * @method jibo.face.views#hasView - * @param {String} id View ID to look for. - * @returns {Boolean} `true` if a View exists with the given ID. - */ - - /** - * Resets the TRANS_TIME to default, or transTime if specified - * @method jibo.face.views#resetTransTime - * @param {number} [transTime] Optional time in milliseconds to set the TRANS_TIME to - */ - - /** - * Handles process failure or interruption. - * Cleans up current process. and queue stack. - * If queue has members, start process for top most member and clean up any below it. - * @method jibo.face.views#viewProcessFailure - * @param {jibo.face.views.ViewProcess} process Active view process - * @private - */ - - /** - * This allows us to more logically recover from an interruption in the case where the interrupting process will remove the current view. - * Interrupting a process normally destroys the current view involved immediately, which would skip it's close transition. - * In the case where the interrupting process will attempt to remove the current view, - * we want to allow it to do so, so we prevent the process fail from destroying the current view so that the next process can close and destroy it naturally. - */ - - /** - * Add a new {@link jibo.face.views.View} to the view hierarchy and display. - * Adding process involves disposing of or pausing current view and storing its state. - * @method jibo.face.views#add - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} nextView - View to add and make current. - * @param {jibo.face.views.PauseOverlay#PauseOptions} [pauseOptions] - Pause options, defined within change view options.ß - * @param {String} [openTransition = TRANSITION.UP] Type of transition the next View should use to open. - * @param {String} [closeTransition = TRANSITION.UP] Type of transition the current View should use to close. - * @private - */ - - /** - * Remove current {@link jibo.face.views.View} from the hierarchy and display. - * @method jibo.face.views#remove - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} [nextView] - View to add after current view is closed. - * @param {boolean} leaveEmpty - If next view in stack should be opened after current view closes, if 'true' display is left empty. - * @param {String} [openTransition = TRANSITION.UP] Type of transition the next View should use to open. - * @param {String} [closeTransition = TRANSITION.UP] Type of transition the current View should use to close. - * @returns {Promise} - * @private - */ - - /** - * Close all currently active views and open the 'root' view ({@link jibo.face.views.EyeView}). - * @method jibo.face.views#removeToRoot - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} [nextView] - View to add above root view after current views and stack have been cleared. - * @param {boolean} leaveEmpty - If root View should be opened after close completes, if 'true' display is left empty. - * @param {String} [closeTransition = TRANSITION.DOWN] Type of transition the current View should use to close. - * @param {String} [openTransition = TRANSITION.DOWN] Type of transition the next View should use to open. - * @returns {Promise} - * @private - */ - - /** - * Close all currently active views and open the 'root' view ({@link jibo.face.views.EyeView}). - * @method jibo.face.views#removeToRoot - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} [nextView] - View to add above root view after current views and stack have been cleared. - * @param {boolean} leaveEmpty - If root View should be opened after close completes, if 'true' display is left empty. - * @param {String} [closeTransition = TRANSITION.DOWN] Type of transition the current View should use to close. - * @param {String} [openTransition = TRANSITION.DOWN] Type of transition the next View should use to open. - * @returns {Promise} - * @private - */ - - /** - * Load and open View. - * @param {jibo.face.views.ViewProcess} process Active view process. - * @method jibo.face.views#openView - * @param {jibo.face.views.View}view - View to open. - * @param {string} openTransition - Type of transition view will open with. - * @returns {Promise} - * @private - */ - - /** - * Close and destroy View. - * Does not take into account any paused Views that may be associated with the given view. - * @method jibo.face.views#closeView - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} view - View to close. - * @param {string} [closeTransition] - Type of transition view will close with. - * @param {boolean} [addToStack = false] - if 'true' closed views are added to the view stack. - * @param {boolean} [destroyViews = true] - if 'true' views will be destroyed. - * @param {boolean} [toPaused = false] - if view is closing over a paused if 'true' views will be destroyed. - * @returns {Promise} - * @private - */ - - /** - * Close and open separate views. - * Supports async behavior, making sure the view being opened has been fully loaded and prepped before opening. - * @method jibo.face.views#closeAndOpenViews - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} nextView - View to open. - * @param {jibo.face.views.View} closeView - View to close. - * @param {string} [openTransition] - Type of transition next view will open with. - * @param {string} [closeTransition] - Type of transition closing view will close with. - * @param {boolean} [addToStack = false] - if 'true' closed views are added to the view stack. - * @returns {Promise} - * @private - */ - - /** - * Close and destroy given view and all paused views beneath it, and open next view. - * Supports async behavior, making sure the view being opened has been fully loaded and prepped before opening. - * method jibo.face.views#closeWithPausedAndOpenViews - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} nextView - View to open. - * @param {jibo.face.views.View} closeView - View to close. - * @param {string} [openTransition] - Type of transition next view will open with. - * @param {string} [closeTransition] - Type of transition closing view will close with. - * @param {boolean} [addToStack = false] - if 'true' closed views are added to the view stack. - * @param {jibo.face.views~STACK_DIRECTION} [stackDirection] - Specifies the stack direction associated with the transition, if undefined does not take stack direction into account - * STACK_DIRECTION.UP indicates view is being added to stack. - * STACK_DIRECTION.DOWN indicates view is being removed. - * STACK_DIRECTION.SWAP indicates the views are being swapped and there is no change to the stack size. - * @returns {Promise} - * @private - */ - - /** - * Close and destroy given view's paused views. - * method jibo.face.views#closePaused - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} view - View whose paused views to close. - * @param {string} [closeTransition] - Type of transition Views will open with. - * @param {boolean} [addToStack = false] - if 'true' closed views are added to the view stack. - * @param {boolean} [destroyViews = true] - if 'true' views will be destroyed. - * @returns {Promise} - * @private - */ - - /** - * Close and destroy given view and all paused views beneath it. - * method jibo.face.views#closeViewWithPaused - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} view - View to close. - * @param {string} [closeTransition] - Type of transition Views will open with. - * @param {boolean} [addToStack = false] - if 'true' closed views are added to the view stack. - * @param {boolean} [destroyViews = true] - if 'true' views will be destroyed. - * @returns {Promise} - * @private - */ - - /** - * Close a list of views. - * Generally used to close a view and the pause chain beneath it. - * @method jibo.face.views#closeGroup - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View[]} closingViews - Array of Views to close in order of stack, with lowest at 0. - * @param {string} [closeTransition] - Type of transition Views will open with. - * @param {boolean} [addToStack = false] - if 'true' closed views are added to the view stack. - * @param {boolean} [destroyViews = true] - if 'true' views will be destroyed. - * @returns {Promise} - * @private - */ - - /** - * Pause current view and open next above it. - * method jibo.face.views#pauseThenOpen - * @param {jibo.face.views.ViewProcess} process Active view process. - * @param {jibo.face.views.View} nextView - View to open. - * @param {jibo.face.views.View} pausingView - View to pause. - * @param {jibo.face.views.PauseOverlay#PauseOptions} [pauseOptions] - Specific pause options, if undefined falls back to nextView.pauseOptions. - * @param {string} [openTransition] - Type of transition nextView will open with. - * @returns {Promise} - * @private - */ - - /** - * Helper to sets transitions for opening and closing views. - * @param {jibo.face.views.views.View} nextView - View that will be opening - * @param {jibo.face.views.views.View} closingView - View that will be closing. - * @param {jibo.face.views~STACK_DIRECTION} [stackDirection] - Specifies the stack direction associated with the transition, if undefined does not take stack direction into account - * STACK_DIRECTION.UP indicates view is being added to stack. - * STACK_DIRECTION.DOWN indicates view is being removed. - * STACK_DIRECTION.SWAP indicates the views are being swapped and there is no change to the stack size. - */ - - /** - * Returns the View from the top of the stack of ViewStates. - * @method jibo.face.views#popViewFromStack - * @return {jibo.face.views.View} - * @private - */ - - /** - * Converts given View to ViewState and adds to top of the stack of ViewStates. - * Given View must be in acceptable state to be converted to ViewState, otherwise it will not be added to stack. - * @method jibo.face.views#pushViewToStack} - * @private - */ - - /** - * Converts given View and its paused View chain to ViewStates and adds them to the stack of ViewStates in the right order. - * Views must be in acceptable state to be converted to ViewState, otherwise they will not be added to stack. - * @method jibo.face.views#pushViewWithPausedToStack - * @private - */ - - /** - * Clear view stack so only root ViewState remains. - * If the currentView given is an EyeView remove all view states, - * otherwise leave EyeView ViewState as the only view state in view stack. - * @method jibo.face.views#clearViewStack - * @param {jibo.face.views.View} [currentView] - The view that is or will be the current view. - * @private - */ - - /** - * Update the attention mode, ensuring that it is a Menu mode when a GUI view is active, and - * deactivating our Menu mode if it is no longer a GUI. - * @method jibo.face.views#updateAttentionMode - * @param {jibo.face.views.View} [view] - The view that is or will be the current view. - * @private - */ - - /** - * Set PIXI's texture garbage collection to auto garbage collect or manually collect. only run when an Eye view is active. - * @method jibo.face.views#setTextureGC - * @param {boolean} [autoOn] - If `true` texture garbage collection is set to auto, if 'false' it is set to manual - * @private - */ - - /** - * Using supplied assets creates a border around the screen. - * Placed above ViewManager.stage so that everything created within ViewManager will be beneath it. - * @method jibo.face.views#createBorder - * @param {PIXI.Texture} cornerTexture - asset for corner - * @param {PIXI.Texture} edgeTexture - asset for edge - * @private - */ - - /** - * Register default GUI classes. - * @method jibo.face.views#registerDefaults - * @private - */ - - /** - * Check if given views are in a valid state (e.g. not destroyed) - * @method jibo.face.views#checkViewsValid - * @private - */ - - /** - * Log view process and view status events, useful for debugging. - * @method jibo.face.views#logEvents - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/ViewProcess.js b/docs/rendering/gui/ViewProcess.js deleted file mode 100644 index 41a608b2..00000000 --- a/docs/rendering/gui/ViewProcess.js +++ /dev/null @@ -1,194 +0,0 @@ - /** - * Process is currently in the queue. - * @type {string} - * @name jibo.face.views.ViewProcess#QUEUED - * @readOnly - */ - - /** - * Process has been started. - * @type {string} - * @name jibo.face.views.ViewProcess#STARTED - * @readOnly - */ - - /** - * Process has successfully completed. - * @type {string} - * @name jibo.face.views.ViewProcess#COMPLETED - * @readOnly - */ - - /** - * Process was interrupted by another process. - * @type {string} - * @name jibo.face.views.ViewProcess#INTERRUPTED - * @readOnly - */ - - /** - * Process failed. - * @type {string} - * @name jibo.face.views.ViewProcess#FAILED - * @readOnly - */ - - /** - * Get flag to determine if views currently in process. - * If a new process is requested while active the active process will be interrupted.applied. - * @name jibo.face.views.ViewProcess#active - * @type {Boolean} - * @readOnly - */ - - /** - * Options for current view change. - * @name jibo.face.views.ViewProcess#changeOptions - * @type {jibo.face.views~ChangeOptions} - */ - - /** - * Callback for process completes. - * @name jibo.face.views.ViewProcess#_onComplete - * @type {jibo.face.views~ViewCallback} - */ - - /** - * Callback for process fails, due to error or interruption. - * @name jibo.face.views.ViewProcess#onFailure - * @type {Function} - */ - - /** - * Callback for when next view in process has loaded. - * Use to access view prior to it being added to display and opened. - * @name jibo.face.views.ViewProcess#onLoaded - * @type {jibo.face.views~ViewCallback} - */ - - /** - * Queue of view change processes. - * @name jibo.face.views.ViewProcess#processQueue - * @type {jibo.face.views.ViewProcess[]} - */ - - /** - * Current state of process. - * @name jibo.face.views.ViewProcess#status - * @type {String} - */ - - /** - * Flag to determine if views currently in process. - * If a new process is requested while active the active process will be interrupted. - * @name jibo.face.views.ViewProcess#_active - * @type {Function} - * @private - */ - - /** - * Array of Views involved in the current process. - * A reference is kept so that views can be destroyed if process is interrupted. - * @name jibo.face.views.ViewProcess#_activeViews - * @type {Array} - * @private - */ - - /** - * Currently active view in display. - * @name jibo.face.views.ViewProcess#_currentView - * @type {jibo.face.views.View} - * @private - */ - - /** - * Currently active view in display. - * @name jibo.face.views.ViewProcess#currentView - * @type {jibo.face.views.View} - */ - - /** - * View that was previously current but is now in process of closing. - * @name jibo.face.views.ViewProcess#_closingView - * @type {jibo.face.views.View} - * @private - */ - - /** - * View that was previously current but is now in process of closing. - * @name jibo.face.views.ViewProcess#closingView - * @type {jibo.face.views.View} - */ - - /** - * Flag for process interruption, if 'true' process has been interrupted. - * @name jibo.face.views.ViewProcess#_interrupted - * @type {boolean} - * @private - */ - - /** - * Flag for process interruption, if 'true' process has been interrupted. - * @name jibo.face.views.ViewProcess#interrupted - * @type {boolean} - * @readOnly - */ - - /** - * Prepare change options for logging - * @method jibo.face.views.ViewProcess#serializeOptions - * @param {jibo.face.views~ChangeOptions} changeOptions - Options for the change view process being queued. - * @public - */ - - /** - * Start the view process. - * Before starting a process should check for interrupt. - * @method jibo.face.views.ViewProcess#start - * @param {jibo.face.views~ViewCallback} onComplete Callback for process completes. - * @param {Function} onFailure Callback for process fails, due to error or interruption. - * @param {jibo.face.views~ViewCallback} onLoaded - Callback for when next view in process has loaded. - * @param {jibo.face.views~ChangeOptions} changeOptions - Options for the change view process being queued. - */ - - /** - * Adds View to Array of Views involved in the current process. - * A reference is kept so that views can be destroyed if process is interrupted. - * @method jibo.face.views.ViewProcess#storeView - * @param {jibo.face.views.View} view View to keep reference to for current process. - */ - - /** - * Call to complete process. - * Completion callbacks are triggered and process is cleared. - * @method jibo.face.views.ViewProcess#complete - * @param {jibo.face.views.View} [view] View established by process, not all processes will return a view. - */ - - /** - * Fail current process, call appropriate callbacks and clean up. - * @method jibo.face.views.ViewProcess#fail - * @param {Boolean} retainCurrent - if `true` prevents currentView from being destroyed. - */ - - /** - * Check for active process, if active sets the interrupted flag to `true`. - * @method jibo.face.views.ViewProcess#interrupt - * @param {jibo.face.views~ChangeOptions} changeOptions - Options for the process being queued. Identifier for interrupting process, useful in debugging. - * @returns {boolean} `true` if a process is interrupted. - */ - - /** - * Add a change view process to the queue. - * @method jibo.face.views.ViewProcess#addProcessToQueue - * @param {jibo.face.views~ChangeOptions} changeOptions - Options for the process being queued. - * @param {jibo.face.views~ViewCallback} [onComplete] - Callback if process completes, returns current view as param. - * @param {Function} [onFailure] - Callback if queued process fails, gets interrupted, or does not get to execute. - * @param {jibo.face.views~ViewCallback} [onLoaded] Called when next view has loaded, can be used to augment View prior to it being displayed. - */ - - /** - * Clear the view process references. - * @method jibo.face.views.ViewProcess#clear - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/ViewState.js b/docs/rendering/gui/ViewState.js deleted file mode 100644 index fe70a155..00000000 --- a/docs/rendering/gui/ViewState.js +++ /dev/null @@ -1,60 +0,0 @@ - /** - * Identifier, same as id of View that ViewState represents. - * @name jibo.face.views.ViewState#id - * @type {String} - */ - - /** - * URI to the configuration JSON file for the corresponding view. - * @name jibo.face.views.ViewState#configPath - * @type {String} - */ - - /** - * Class name of the corresponding view. - * @name jibo.face.views.ViewState#viewClassName - * @type {String} - */ - - /** - * Configuration Objects, generally derived from JSON, - * that defines corresponding view. - * @name jibo.face.views.ViewState#viewConfig - */ - - /** - * Array of configuration Objects, generally derived from JSON, - * that define corresponding view's components. - * @name jibo.face.views.ViewState#componentConfigs - * @type {Object[]} - */ - - /** - * Flag to determine whether, when corresponding view is opened, - * it should pause the view below it. - * @name jibo.face.views.ViewState#pauseParent - * @type {boolean} - * @default false - */ - - /** - * Flag to determine if corresponding view should enact close on swipe down. - * @name jibo.face.views.ViewState#ignoreSwipeDown - * @type {boolean} - * @default false - */ - - /** - * Can pass in the name of the corresponding ViewState class and config if available at construction. - * @param {String} [viewClassName = 'View'] - Class name of View the ViewState represents. - * @param {Object} [config] - Configuration Object for the corresponding View, generally derived from JSON. - * Contains both view and components configurations. - */ - - /** - * Derives separate references to view configuration, component configurations, - * and View type from the given configuration. - * @method jibo.face.views.ViewState#applyConfig - * @param {Object} config Configuration Object for the corresponding View, generally derived from JSON. - * Contains both view and components configurations. - */ \ No newline at end of file diff --git a/docs/rendering/gui/actions/ActionData.js b/docs/rendering/gui/actions/ActionData.js deleted file mode 100644 index 2df9ad54..00000000 --- a/docs/rendering/gui/actions/ActionData.js +++ /dev/null @@ -1,414 +0,0 @@ -/** - * @interface jibo.face.views.ActionData~ActionDescriptor - * @description Interface for an Object to be turned into instance of an ActionData class. - * @prop {String} type - The type of the action. - * @prop {any} [data] - Additional data for action, requited data depends on type. - */ - -/** - * Use to pass actions across the view architecture. - * @class ActionData - * @memberof jibo.face.views - */ - - /** - * The type of the action. - * Supported types are this class's constants. - * @name jibo.face.views.ActionData#type - * @type {String} - */ - - /** - * The data Object that is passed with the action. - * Not all action types require data. - * Refer to this class's constants for action type requirements. - * @name jibo.face.views.ActionData#data - * @type {Object} - */ - - /** - * Change view by specifying view change options. - * Data requirements include [ChangeOptions]{@link jibo.face.views~ChangeOptions} - * @example - * JSON format - * "action": { - * "type": "changeView", - * "data": { - * "options": { - * "removeAll": true, - * "leaveEmpty": true - * } - * } - * } - * @constant jibo.face.views.ActionData.CHANGE_VIEW - * @type {String} - */ - - /** - * Add a view. - * Data requirements include a path to view configuration to be opened. - * @example - * JSON format - * "action": { - * "type": "openView", - * "data": { - * "configPath": "resources/menus/myMenu.json" - * } - * } - * @constant jibo.face.views.ActionData.OPEN_VIEW - * @type {String} - * @readOnly - */ - - /** - * Remove the current view. - * This action has no data requirements. - * @example - * JSON format - * "action": { - * "type": "closeView", - * } - * @constant jibo.face.views.ActionData.CLOSE_VIEW - * @type {String} - * @readOnly - */ - - /** - * Remove the current view and not open the next view in the hierarchy. - * Will leave the display empty and the current view equal to null. - * This action has no data requirements. - * @example - * JSON format - * "action": { - * "type": "closeViewEmpty", - * } - * @constant jibo.face.views.ActionData.CLOSE_VIEW_EMPTY - * @type {String} - * @readOnly - */ - - /** - * Remove all the views up to, but not including, the root view. - * @example - * JSON format - * "action": { - * "type": "closeAll" - * } - * @constant jibo.face.views.ActionData.CLOSE_ALL - * @type {String} - * @readOnly - */ - - /** - * Remove all the views and clear hierarchy up to but not including root, then add view. - * Added view will be one above the root view. - * Data requirements include a path to view configuration to be opened. - * @example - * JSON format - * "action": { - * "type": "closeAllOpen", - * "data": { - * "configPath": "resources/menus/myMenu.json" - * } - * } - * @constant jibo.face.views.ActionData.CLOSE_ALL_OPEN - * @type {String} - * @readOnly - */ - - /** - * Close all the views and clear hierarchy up to but not including root, - * but do not add the root view to the display. - * Added view will be one above the root view. - * Data requirements include a path to view configuration to be opened. - * @example - * JSON format - * "action": { - * "type": "closeAllEmpty" - * } - * @constant jibo.face.views.ActionData.CLOSE_ALL_EMPTY - * @type {String} - * @readOnly - */ - - /** - * Emulate a swipe right gesture. - * @example - * JSON format - * "action": { - * "type": "swipeRight" - * } - * @constant jibo.face.views.ActionData.SWIPE_RIGHT - * @type {String} - * @readOnly - */ - - /** - * Emulate a swipe left gesture. - * @example - * JSON format - * "action": { - * "type": "swipeLeft" - * } - * @constant jibo.face.views.ActionData.SWIPE_LEFT - * @type {String} - * @readOnly - */ - - /** - * Emulate a swipe down. - * @example - * JSON format - * "action": { - * "type": "swipeDown" - * } - * @constant jibo.face.views.ActionData.SWIPE_DOWN - * @type {String} - * @readOnly - */ - - /** - * Emulate a swipe up. - * @example - * JSON format - * "action": { - * "type": "swipeUp" - * } - * @constant jibo.face.views.ActionData.SWIPE_UP - * @type {String} - * @readOnly - */ - - /** - * Go to first page of a list. - * Enact action on [List]{@link jibo.face.views.List} to take effect. - * @example - * JSON format - * "action": { - * "type": "goToBeginning" - * } - * @constant jibo.face.views.ActionData.GO_TO_BEGINNING - * @type {String} - * @readOnly - */ - - /** - * Go to last page of a list. - * Enact action on [List]{@link jibo.face.views.List} to take effect. - * @example - * JSON format - * "action": { - * "type": "goToEnd" - * } - * @constant jibo.face.views.ActionData.GO_TO_END - * @type {String} - * @readOnly - */ - - /** - * Emit an event from the owning View when triggered. - * Required data is an event string. - * - * @example - * JSON format - * "action": { - * "type": "event", - * "data": { - * "event": "danceParty" - * } - * } - * - * @example - * To listen for these events just add a listener to - * the View that contains the action. - * - * myView.on('danceParty', getDown); - * - * @example - * You must specify the event string for the event to fire, - * but can include as much additional data as needed. - * The entire data Object is returned when the event is fired. - * Here we add another value to the data Object in JSON: - * - * "action": { - * "type": "event", - * "data": { - * "event": "danceParty" - * "dance": "funkyChicken" - * } - * } - * - * @example - * Then in your code you can listen for the event, - * which will pass back the data Object: - * - * myView.on('danceParty', (eventData) => { - * if(eventData.dance === 'funkyChicken'){ - * console.log('Booo'); - * } - * }); - * - * @constant jibo.face.views.ActionData.EVENT - * @type {String} - * @readOnly - */ - - /** - * Play a sound. - * Within data, provide either the type of sound or the URI for the sound file. - * @example - * - * JSON format. Playing a preloaded or gloabl sound by giving the the ID. - * "action": { - * "type": "sound", - * "data": { - * "id": "button" - * } - * } - * @example - * JSON format. Playing sound by just giving src of sound asset. - * "action": { - * "type": "sound", - * "data": { - * "src": "resources/sfx/button_sfx.m4a" - * } - * } - * @example - * JSON format. Loading a sound and giving it an ID for repeat usage. - * "action": { - * "type": "sound", - * "data": { - * "id": "unique_sound" - * "src": "resources/sfx/button_sfx.m4a" - * } - * } - * - * @name jibo.face.views.ActionData#SOUND - * @type {String} - * @readOnly - */ - - /** - * Spoof an utterance that will be used as the result of the current MIM listen. Strings are - * handled as the result intent, otherwise a properly formatted NLU result must be provided - * @example - * JSON format with string - * "action": { - * "type": "utterance", - * "data": { - * "utterance": "whatIsWeather" - * } - * } - * @example - * JSON format with full result - * "action": { - * "type": "utterance", - * "data": { - * "utterance": { - * "intent": "whatIsWeather", - * "entities": { - * "time": "tomorrow" - * } - * } - * } - * @constant jibo.face.views.ActionData.UTTERANCE - * @type {String} - * @readOnly - */ - - /** - * Results passed from the MIM systems. - * @example - * JSON format for select elements on a page - * "action": { - * "type": "verbalCommand", - * "data": { - * "intent": "selectItem", - * "entities": { - * "itemPosition": "first" - * } - * } - * } - * - * JSON format tp control pages - * "action": { - * "type": "verbalCommand", - * "data": { - * "intent": "right", - * } - * } - * - * - * @constant jibo.face.views.ActionData.VERBAL_COMMAND - * @type {String} - * @readOnly - */ - - /** - * Immediately end the currently active MIM. - * @example - * JSON format for ending a MIM - * "action": { - * "type": "mimEnd" - * } - * - * @constant jibo.face.views.ActionData.MIM_END - * @type {String} - * @readOnly - */ - - /** - * Immediately show the available GUI for the currently active MIM. - * @example - * JSON format for showing a MIM's GUI - * "action": { - * "type": "mimShowGUI" - * } - * - * @constant jibo.face.views.ActionData.MIM_SHOW_GUI - * @type {String} - * @readOnly - */ - - /** - * Call a method when action is triggered. - * Not something easily defined via JSON; more likely to be defined in code. - * @example - * Creating in code - * new ActionData( ActionData.CALLBACK, { - * callback: this.foo.bind(this) - * }); - * Adding to a Component - * component.addAction(ActionData.CALLBACK, {callback: this.foo.bind(this)}); - * @constant jibo.face.views.ActionData.CALLBACK - * @type {String} - * @readOnly - */ - - /** - * Create an ActionData object from a configuration Object. - * Generally derived from JSON. - * @method jibo.face.views.ActionData.createFromConfig - * @example - * JSON format - * { - * "type": "openView", - * "data": { - * "configPath": "assets/menu/myMenu.json" - * } - * } - * @param {jibo.face.views.ActionData~ActionDescriptor} configData Object defining the action. - * @returns {jibo.face.views.ActionData} A new ActionData with values specified by given configuration. - */ - - /** - * Constructor for ActionData. - * @param {String} [type] The type of action. - * @param {Object} [data] The data Object with action values. - */ - - /** - * Apply the configuration Object's values to this ActionData class. - * @method jibo.face.views.ActionData#applyConfig - * @param {jibo.face.views.ActionData~ActionDescriptor} configData Object defining the action. - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/Button.js b/docs/rendering/gui/components/Button.js deleted file mode 100644 index 626da9e4..00000000 --- a/docs/rendering/gui/components/Button.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Button element. - * Can be assigned {@link jibo.face.views.ActionData}, which are triggered on button click. - * - * @class Button - * @extends jibo.face.views.Element - * @memberof jibo.face.views - */ - - /** - * `PIXI.animate.MovieClip` containing button states. - * Buttons do not require MovieClips, so if a `PIXI.animate.Timeline` - * is not given as the base asset this remains undefined. - * @name jibo.face.views.Button#timeline - * @type {PIXI.animate.MovieClip} - */ - - /** - * FOR OVERRIDE ONLY. DO NOT ALTER. - * - * The Class name as a string. - * @name jibo.face.views.Button#_type - * @type {String} - * @protected - */ - - /** - * Flag used to keep track if button is down. - * Is set within button state methods e.g. over, down, up, etc. - * @name jibo.face.views.Button#isDown - * @type {Boolean} - * @protected - */ - - /** - * Create a Button from a configuration Object derived from JSON. - * @method jibo.face.views.Button.createFromConfig - * @param {Object} configData Object derived from JSON, must be a specific format refer to examples. - * @returns {jibo.face.views.Button} The Button created from the given configuration. - */ - - /** - * Create a Button object by passing the DisplayObject and specifying the {@link jibo.face.views.ActionData}. - * This allows for a more direct way to create Buttons that is not reliant on the configuration data. - * @method jibo.face.views.Button.createFromDisplayObject - * @param {PIXI.DisplayObject} displayObject The DisplayObject with the button assets. - * @param {jibo.face.views.ActionData} [actionData] The action to be triggered on button click. - * @param {PIXI.Container} container Display container for the button. - * @returns {jibo.face.views.Button} The created Button. - */ - - /** - * Set up the display. - * Assign assets, set timelines, etc. - * @method jibo.face.views.Button#setupDisplay - * @param {Object} [assets] - Object passed back from loader namespace load method, - * refer to {@link jibo.loader} for details. - */ - - /** - * TO BE CALLED INTERNALLY ONLY. - * - * Define the interactive hit area of the display. - * The `DisplayObject.hitArea` is what Pixi uses to define the interactive area. - * Should be called within `setupDisplay()`. - * @method jibo.face.views.Button#setupHitArea - * @param {PIXI.Rectangle} [bounds] Optionally specify the bounds for the hit area. - * If not defined, defaults to using the display's bounds. - * @protected - */ - - /** - * Lock or unlock input, lock value is applied to the display's interactive variable. - * @method jibo.face.views.Button#lockInput - * @param {Boolean} flag - Determines if input is locked. - */ - - /** - * Manually force a click. - * @method jibo.face.views.Button#click - * @param {any} mouseData Returned from Pixi. - * @protected - */ - - /** - * Handler for out touch input. - * @method jibo.face.views.Button#out - * @param {any} mouseData Returned from Pixi. - * @protected - */ - - /** - * Handler for down touch input. - * @method jibo.face.views.Button#down - * @param {any} mouseData Returned from Pixi. - * @protected - */ - - /** - * Handler for up touch input. - * @method jibo.face.views.Button#up - * @param {any} mouseData Returned from Pixi. - * @protected - */ - - /** - * Activate the button, used for non-touch input. - * @method jibo.face.views.Button#activate - * @public - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/Clip.js b/docs/rendering/gui/components/Clip.js deleted file mode 100644 index 834f874a..00000000 --- a/docs/rendering/gui/components/Clip.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Clip to manage timelines and images. - * - * @class Clip - * @extends jibo.face.views.Element - * @memberof jibo.face.views - */ - - /** - * Timeline for the display content. - * @name jibo.face.views.Clip#timeline - * @type {Timeline} - */ - - /** - * MovieClip for the display content, the instance of the Timeline. - * @name jibo.face.views.Clip#movieClip - * @type {PIXI.animate.MovieClip} - */ - - /** - * Create a Clip from a configuration Object derived from JSON. - * @method jibo.face.views.Clip#createFromConfig - * @param configData Object derived from JSON, must be a specific format refer to examples. - * @returns {jibo.face.views.Clip} The created Clip. - */ - - /** - * Create a Clip object by passing the DisplayObject. - * This allows for a more direct way to create Clips that is not reliant on the configuration data. - * @method jibo.face.views.Clip#createFromDisplayObject - * @param {PIXI.DisplayObject} displayObject The DisplayObject with the button assets. - * @param {PIXI.Container} [container] Display container for the button. - * @returns {jibo.face.views.Clip} The created Clip. - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/ContactButton.js b/docs/rendering/gui/components/ContactButton.js deleted file mode 100644 index bb83312e..00000000 --- a/docs/rendering/gui/components/ContactButton.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Contact button, extends MenuButton to handle specifics required for contacts - * - * @class ContactButton - * @extends jibo.face.views.MenuButton - * @memberof jibo.face.views - */ - - /** - * The default class identifier. - * MenuButton uses variants, so this should be defined specifically at - * Generally used to register the class. - * @name jibo.face.views.ContactButton.DEFAULT_TYPE - * @type {String} - * @readOnly - */ - - /** - * Loop member associated with button. - * @method jibo.face.views.ContactButton#looper - * @returns {jibo.kb.loop.UserNode} Loop member associated with button. - * @readOnly - */ - - /** - * Looper member associated with button. - * @name jibo.face.views.ContactButton#_looper - * @type {jibo.kb.loop.UserNode} - * @private - */ - - /** - * Create a ContactButton from a configuration Object derived from JSON. - * @method jibo.face.views.ContactButton#createFromConfig - * @param {Object} configData Object derived from JSON, must be a specific format refer to examples. - * @returns {jibo.face.views.ContactButton} The ContactButton created from the given configuration. - */ - - /** - * Create and add a button asset descriptor that corresponds with the type value. - * If `type` is provided as a parameter, it is applied to the internal type variable. - * Add an asset descriptor for the looper's photo, if defined. - * @method jibo.face.views.ContactButton#applyButtonType - * @param {String} [type] If definfed, applied to [MenuButton#_type]{@link jibo.face.views.MenuButton#_type}, - * which is then used to determine which timeline assets to use for the button. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Destroy. - * @method jibo.face.views.ContactButton#destroy - */ - - /** - * Keep reference to looper Object and use to define variables. - * @method jibo.face.views.ContactButton#assignLooper - * @param {jibo.kb.loop.UserNode} looper Reference to Looper. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Set up the timeline asset associated with the button. - * @method jibo.face.views.ContactButton#setupTimeline - * @param assets {any} Assets associated with the button. - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Handler for toggleDown-transition executed in {@link jibo.face.views.StandardButton#down} - * @method jibo.face.views.ContactButton#toggleDownTransition - * @protected - */ - - /** - * Handler for click touch input. - * If `willToggle` is `true`, toggle the check mark on each click. - * @method jibo.face.views.ContactButton#click - * @protected - */ - - /** - * Show or hide the button's checkmark according to its state. - * @method jibo.face.views.ContactButton#animateToggleState - * @param {Boolean} [isToggled = false] State the button needs to be animated into - * @param {Boolean} [shouldAnimate = true] Flag determining if check mark should animate. - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/ContentButton.js b/docs/rendering/gui/components/ContentButton.js deleted file mode 100644 index 655e1655..00000000 --- a/docs/rendering/gui/components/ContentButton.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @interface jibo.face.views.ContentButton~ContentButtonOptions - * @extends jibo.face.views.MenuButton~MenuButtonOptions - * @description Interface describing data provided in the config. - * @prop {Boolean} [isVideo] - Flag indicating if the content in the button is video. - * @prop {jibo.face.views.ContentButton.AlbumInfo} [albumInfo] - Information about album shown in the button. - */ - -/** - * @interface jibo.face.views.ContentButton~ContentButtonOptions - * @extends jibo.face.views.MenuButton~MenuButtonOptions - * @description Interface describing data provided in the config. - * @prop {Boolean} [isVideo] - Flag indicating if the content in the button is video. - * @prop {jibo.face.views.ContentButton.AlbumInfo} [albumInfo] - Information about album shown in the button. - */ - -/** - * Information about album displayed on the button. - * @class AlbumInfo - * @memberof jibo.face.views.ContentButton - */ - - /** - * Album title. - * @name jibo.face.views.ContentButton.AlbumInfo#title - * @type {String} - */ - - /** - * Number of items in the album. - * @name jibo.face.views.ContentButton.AlbumInfo#length - * @type {Number} - */ - -/** - * Content button, extends MenuButton to handle specifics required for displaying photo, video, or - * album thumbnails. - * @class ContentButton - * @extends jibo.face.views.MenuButton - * @memberof jibo.face.views - */ - - /** - * The default class identifier. - * Generally used to register the class. - * @name jibo.face.views.ContentButton#DEFAULT_TYPE - * @type {String} - * @private - * @readOnly - */ - - /** - * Create a ContentButton from a configuration Object derived from JSON. - * @method jibo.face.views.ContentButton#createFromConfig - * @param {Object} configData Object derived from JSON, must be a specific format refer to examples. - * @returns {jibo.face.views.ContentButton} ContentButton created from the given configuration. - */ - - /** - * Assign configuration. - * @method jibo.face.views.ContentButton#assignConfig - * @param {Object} configData - Configuration to apply - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Destroy. - * @method jibo.face.views.ContentButton#destroy - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Set up the timeline asset associated with the button. - * @method jibo.face.views.ContentButton#setupTimeline - * @protected - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/Element.js b/docs/rendering/gui/components/Element.js deleted file mode 100644 index 469bd04e..00000000 --- a/docs/rendering/gui/components/Element.js +++ /dev/null @@ -1,223 +0,0 @@ -/** - * @description Interface describing some point in space with 'x' and 'y' properties. - * @interface jibo.face.views.Element~PointData - * @property {Number|String} [x] X value for the point - * @property {Number|String} [y] Y value for the point - */ - -/** - * @description Interface for describing position of the element on the screen. - * @interface jibo.face.views.Element~PositionData - * @extends jibo.face.views.Element~PointData - * @property {Number|String} [x] X value for the position. May take numbers and such values as LEFT/CENTER/RIGHT. - * @property {Number|String} [y] Y value for the position. May take numbers and such values as TOP/CENTER/BOTTOM. - * @property {Number|jibo.face.views.Element~PointData} [margin] Sets the margin value for position specified. May be a number or {jibo.face.views.Element~PointData} structure. - */ - -/** - * @description Interface for basic transformations. - * @interface jibo.face.views.Element~TransformData - * @property {Number} [scaleX] From 0 to N. - * @property {Number} [scaleY] From 0 to N. - * @property {Number} [rotate] In degrees. Positive value to rotate object clockwise. Negative value to rotate object counterclockwise. - * @property {Number} [pivotX] From 0 to 1. - * @property {Number} [pivotY] From 0 to 1. - */ - -/** - * @description Interface for describing hit area of the element. - * @interface jibo.face.views.Element~HitAreaData - * @extends jibo.face.views.Element~PointData - * @property {Number} [x] X value of the hit area. - * @property {Number} [y] Y value of the hit area. - * @property {Number} [width] Width value of the hit area. - * @property {Number} [height] Height value of the hit area. - */ - -/** - * @description Interface for width and height. - * @interface jibo.face.views.Element~DimensionData - * @property {Number} width Width value of the hit area - * @property {Number} height Height value of the hit area - */ - -/** - * @description Interface - Configuration values for creating an Element. - * @interface jibo.face.views.Element~ElementOptions - * @extends jibo.face.views.Component~ComponentOptions - * @prop {jibo.face.views.Element~PositionData} [position] - Position of the element on the screen. - * @prop {jibo.face.views.Element~TransformData} [transform] - Transformation values to be applied to the element. - * @prop {jibo.face.views.Element~HitAreaData} [hitArea] - Structure desribing hit are a for the element. - * @prop {Boolean} [interactable] - Flag that indicates if user can interact with the element. - */ - -/** - * Base class for components elements (non-groups) that appear in component - * groups (buttons, labels, .etc) Has base methods that deal with display - * and positioning. - * - * @class Element - * @extends jibo.face.views.Component - * @memberof jibo.face.views - */ - - /** - * Flag determines if Element can be interactive. - * If `false` prevents locking and unlocking input from effecting the display's interactivity. - * @name jibo.face.views.Element#interactable - * @default false - * @type {boolean} - */ - - /** - * Display container for the Element. - * @name jibo.face.views.Element#display - * @type {PIXI.Container} - */ - - /** - * The target position. - * Can be specified prior to the creation of the display, when the display is created this position is applied. - * @name jibo.face.views.Element#targetPosition - * @type {PIXI.Point} - */ - - /** - * The transformation data. - * @method jibo.face.views.Element#transformData - * @return {jibo.face.views.Element~TransformData} - */ - - /** - * Set transformData for Element. - * @name jibo.face.views.Element#setTransformData - * @type {jibo.face.views.Element~TransformData} - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Assign data passed via Object to class. - * Method can be overridden to allow for manual definition of values, assets, etc. - * @method jibo.face.views.Element#assignConfig - * @param {any} configData - Object derived from JSON containing values specific to Element. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Update data representation of element with any `state` changes - * (anything that should persist between views). - * @method jibo.face.views.Element#updateConfig - * @param configData {any} - Object derived from JSON containing values specific to Element. - * @returns {any} Updated element. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Frame enter loop update, should be overridden. - * @method jibo.face.views.Element#update - * @param {number} elapsed Time in milliseconds since the last frame update. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Create Element's display and add to container. - * @method jibo.face.views.Element#createDisplay - * @param {PIXI.Container} container Parent Container which all DisplayObject - * created within this Component should be added to. - * @param {Object} assets Object passed back from loader namespace load method, - * refer to {@link jibo.loader} for detail - */ - - /** - * Set up the display. - * Assign assets, set timelines, etc. - * @method jibo.face.views.Element#setupDisplay - * @param {Object} [assets] Object passed back from loader namespace load method, - * refer to {@link jibo.loader} for detail - */ - - /** - * Destroy display's children - * Clean up all processes using display's children - * (i.e. tweens). - * @method jibo.face.views.Element#emptyDisplay - */ - - /** - * Stop all tweens whose targets are children of Element's display. - * Option to stop tweens on Element's display as well. - * @param {boolean} [includeDisplay = false] If `true` will stop tween on display. - * @method jibo.face.views.Element#stopChildTweens - */ - - /** - * Called by parent ComponentGroup once parent has finished its loading and setup. - * Allows opportunity to do additional setup that may depend on other components. - * - * ATTENTION: This should not be called directly, the parent View {@link jibo.face.views.View} - * will call this, which will recurse through Component tree. - * @method jibo.face.views.Element#ready - */ - - /** - * Used to define the position for the display before it is created. - * @method jibo.face.views.Element#setTargetPosition - * @param {Number} [x = 0] The x position target. - * @param {Number} [y = 0] The y position target. - * @param {Boolean} [applyNow = false] Flag determining if given target position should be applied to display within this method. - * (Display must be defined for this to take effect.) - */ - - /** - * Apply position that was defined in config to display's actual position. - * @method jibo.face.views.Element#applyPosition - * @public - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Open transition, defaults to vertical tween upward from below viewport. - * @method jibo.face.views.Element#open - * @param {Function} callback Function to be called once open is complete. - * @param {String} transitionType String used to determine Element's open transition, - * refer to ViewManager for constants used - * @param {number} [duration = ViewManager.TRANS_TIME] Duration in milliseconds of the transition. - * @param {String} [tweenType = 'backOut'] Type of tween used. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Close transition, defaults to vertical tween upward out of viewport. - * @method jibo.face.views.Element#close - * @param {Function} callback Function to be called once open is complete. - * @param {String} [transitionType] String used to determine way Element's close transition, - * refer to ViewManager for constants used. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration in milliseconds of the transition. - * @param {String} [tweenType = 'backIn'] Type of tween used. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Destroy, stops any tweens that may be active on the Elements' display. - * @method jibo.face.views.Element#destroy - */ - - /** - * Lock or unlock input. - * If display is defined and interactable is `true` sets display's interactivity. - * @method jibo.face.views.Element#lockInput - * @param {Boolean} flag Determines if input is locked. - */ - - /** - * Center the pivot of the display. - * Overwrite in inheriting classes - * @method jibo.face.views.Element#centerPivot - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/ElementGroup.js b/docs/rendering/gui/components/ElementGroup.js deleted file mode 100644 index 82f7dc02..00000000 --- a/docs/rendering/gui/components/ElementGroup.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @description Interface describing some point in space with 'x' and 'y' properties. - * @interface jibo.face.views.ElementGroup~PointData - * @property {Number|String} [x] X value for the point - * @property {Number|String} [y] Y value for the point - */ - -/** - * @description Interface - Configuration values for creating an ElementGroup. - * @interface jibo.face.views.ElementGroup~ElementOptions - * @extends jibo.face.views.Component~ComponentOptions - * @prop {Boolean} [interactable] - Flag that indicates if user can interact with the element. - */ - -/** - * Base class for element groups that extend component - * groups. Has base methods that deal with display - * and positioning. - * - * @class ElementGroup - * @extends jibo.face.views.ComponentGroup - * @implements jibo.face.views.IElement - * @memberof jibo.face.views - */ - - /** - * The default class identifier. - * Generally used to register the class. - * @name jibo.face.views.ElementGroup.DEFAULT_TYPE - * @type {String} - * @readOnly - */ - - /** - * Flag determines if ElementGroup can be interactive. - * If `false` prevents locking and unlocking input from effecting the display's interactivity. - * @name jibo.face.views.ElementGroup#interactable - * @default false - * @type {boolean} - */ - - /** - * Display container for the ElementGroup. - * @name jibo.face.views.ElementGroup#display - * @type {PIXI.Container} - */ - - /** - * The target position. - * Can be specified prior to the creation of the display, when the display is created this position is applied. - * @name jibo.face.views.ElementGroup#targetPosition - * @type {PIXI.Point} - */ - - /** - * Create ElementGroup from configuration. - * @method jibo.face.views.ElementGroup#createFromConfig - * @param {Object} configData Configuration to create list from. - * @returns {jibo.face.views.ElementGroup} - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Assign data passed via Object to class. - * Method can be overridden to allow for manual definition of values, assets, etc. - * @method jibo.face.views.ElementGroup#assignConfig - * @param {any} configData - Object derived from JSON containing values specific to ElementGroup. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Create ElementGroup's display and add to container. - * @method jibo.face.views.ElementGroup#createDisplay - * @param {PIXI.Container} container Parent Container which all DisplayObject - * created within this ElementGroup should be added to. - * @param {Object} assets Object passed back from loader namespace load method, - * refer to {@link jibo.loader} for detail - */ - - /** - * Set up the display. - * Assign assets, set timelines, etc. - * @method jibo.face.views.ElementGroup#setupDisplay - * @param {Object} [assets] Object passed back from loader namespace load method, - * refer to {@link jibo.loader} for detail - */ - - /** - * Destroy display's children - * Clean up all processes using display's children - * (i.e. tweens). - * @method jibo.face.views.ElementGroup#emptyDisplay - */ - - /** - * Stop all tweens whose targets are children of ElementGroup's display. - * Option to stop tweens on ElementGroup's display as well. - * @param {boolean} [includeDisplay = false] If `true` will stop tween on display. - * @method jibo.face.views.ElementGroup#stopChildTweens - */ - - /** - * Used to define the position for the display before it is created. - * @method jibo.face.views.ElementGroup#setTargetPosition - * @param {Number} [x = 0] The x position target. - * @param {Number} [y = 0] The y position target. - * @param {Boolean} [applyNow = false] Flag determining if given target position should be applied to display within this method. - * (Display must be defined for this to take effect.) - */ - - /** - * Apply position that was defined in config to display's actual position. - * @method jibo.face.views.ElementGroup#applyPosition - * @public - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Open transition, defaults to vertical tween upward from below viewport. - * @method jibo.face.views.ElementGroup#open - * @param {Function} callback Function to be called once open is complete. - * @param {String} transitionType String used to determine ElementGroup's open transition, - * refer to ViewManager for constants used - * @param {number} [duration = ViewManager.TRANS_TIME] Duration in milliseconds of the transition. - * @param {String} [tweenType = 'backOut'] Type of tween used. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Close transition, defaults to vertical tween upward out of viewport. - * @method jibo.face.views.ElementGroup#close - * @param {Function} callback Function to be called once open is complete. - * @param {String} [transitionType] String used to determine way ElementGroup's close transition, - * refer to ViewManager for constants used. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration in milliseconds of the transition. - * @param {String} [tweenType = 'backIn'] Type of tween used. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Destroy, stops any tweens that may be active on the ElementGroup's display. - * @method jibo.face.views.ElementGroup#destroy - */ - - /** - * Lock or unlock input. - * If display is defined and interactable is `true` sets display's interactivity. - * @method jibo.face.views.ElementGroup#lockInput - * @param {Boolean} flag Determines if input is locked. - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/IElement.js b/docs/rendering/gui/components/IElement.js deleted file mode 100644 index 65fc4e8a..00000000 --- a/docs/rendering/gui/components/IElement.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Interface for elements and element groups that appear in component - * groups (buttons, labels, .etc) Has base methods that deal with display - * and positioning. - * - * @interface IElement - * @extends jibo.face.views.Component - * @memberof jibo.face.views - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/Label.js b/docs/rendering/gui/components/Label.js deleted file mode 100644 index 42da5b15..00000000 --- a/docs/rendering/gui/components/Label.js +++ /dev/null @@ -1,181 +0,0 @@ -/** - * @interface jibo.face.views.Label~LabelOptions - * @extends jibo.face.views.Element~ElementOptions - * @description Interface describing data provided in the config for label initialization. - * @prop {PIXI.TextStyle} [style] - Structure that describes text style. - * @prop {String} [text] - Text value shown in the label. - * @prop {jibo.face.views.Element~PointData} [targetAnchor] - Anchor point for the label. - * @prop {jibo.face.views.Element~DimensionData} [bounds] - Bounds for text. When specified font will be decreased to fit. - */ - -/** - * Wraps text label in Pixi. - * - * @class Label - * @extends jibo.face.views.Element - * @memberof jibo.face.views - */ - - /** - * Default value for the text style if one's missing. - * @name jibo.face.views.Label.DEFAULT_STYLE - * @type {PIXI.TextStyle} - * @readOnly - * @private - */ - - /** - * The default class identifier. - * Generally used to register the class. - * @name jibo.face.views.Label.DEFAULT_TYPE - * @type {String} - * @readOnly - */ - - /** - * Object describing the font specification used by `PIXI.Text`. - * ``` - * fontSize: 100, - * fontFamily: 'Proxima Nova Soft', - * fill: '#FFFFFF', - * fontStyle: 'bold' - * wordWrap: true, - * wordWrapWidth: 100, - * align: 'center' - * ``` - * @name jibo.face.views.Label#style - * @type {PIXI.TextStyle} - */ - - /** - * Reference to the PIXI.Text object. - * @name jibo.face.views.Label#textDisplay - * @type {PIXI.Text} - */ - - /** - * Bounds of the label component - * @name jibo.face.views.Label#_bounds - * @type {jibo.face.views.Element~DimensionData} - * @private - */ - - /** - * Dimensional boundaries of the label that text display cannot exceed. - * If defined, {@link jibo.face.views.Label#style}`.fontSize` will be scaled to fit. - * Does not increase `fontSize` if text will fit provided boundaries. - * @example - * x: 300, // width - * y: 100 // height - * @name jibo.face.views.Label#bounds - * @type {jibo.face.views.Element~DimensionData} - */ - - /** - * Anchor values for display, values range from 0 to 1 - * and represent a percentage of the total width or height. - * If defined anchor values will be applied to display on its creation. - * @name jibo.face.views.Label#_targetAnchor - * @type {PIXI.Point} - * @private - */ - - /** - * Text message to display. - * @name jibo.face.views.Label#_text - * @type {String} - * @private - */ - - /** - * Keeps reference to original font size specified by style. - * A reference is necessary as the font size can be adjusted to fit the bounds. - * @name jibo.face.views.Label#_originalFontSize - * @type {String} - * @private - */ - - /** - * Text to display. - * If display exists updating the text value will also update the display. - * @name jibo.face.views.Label#text - * @type {String} - */ - - /** - * Helper method to create font style Objects for use with `PIXI.Text`. - * @method jibo.face.views.Label.createFontStyle - * @param {Number|String} size The size of the font. - * @param {String} family The font family/name. - * @param {String} color The font color. - * @param {String} [style] The font style (e.g. bold, italic) - * @param {String} [align] The font alignment (e.g. left, center, right) - * @returns {PIXI.TextStyle} [style] Object in format required by Pixi to define text style. - */ - - /** - * Create Label from config Object. - * @method jibo.face.views.Label.createFromConfig - * @param configData {any} Configuration object to create label for. - * @returns {jibo.face.views.Label} Label created. - */ - - /** - * Get the width and height of `PIXI.Text` based on current text and style. - * If text has not been defined method will use given `sampleText`, if that is not given uses an internal default. - * @method jibo.face.views.Label#getTextDimensions - * @param {String} [sampleText] Used only if {@link jibo.face.views.Label#text} is undefined. - * @returns {jibo.face.views.Element~DimensionData} Dimensions of text. - */ - - /** - * Predefine the anchor point for your text. These anchors are applied when `applyTransition` is called. - * This is useful for defining anchor of the label before the display is created. - * @method jibo.face.views.Label#setTargetAnchor - * @param {int} [x = 0] - Value between 0 and 1, percentage of width where the anchor should be placed. - * @param {int} [y = 0] - Value between 0 and 1, percentage of height where the anchor should be placed. - * @param {Boolean} [applyNow = false] If `true` will apply anchor position to Text within method, - * as long as Text has been defined. - */ - - /** - * Apply target position and anchors if they were defined and if display and text have been created. - * @method jibo.face.views.Label#applyPosition - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Open transition, defaults to fading alpha in from zero. - * @method jibo.face.views.Label#open - * @param {Function} [callback] Function to be called once open is complete. - * @param {String} transitionType String used to determine way Component opens, - * refer to ViewManager for constants used - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @param {String} [tweenType = sineOut] Type of tween used. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Open transition, defaults to fading alpha out to zero. - * @method jibo.face.views.Label#close - * @param {Function} [callback] Function to be called once open is complete. - * @param {String} [transitionType] String used to determine way Component closes, - * refer to ViewManager for constants used. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @param {String} [tweenType = sineIn] Type of tween used. - */ - - /** - * Adjust text font size to fit within bounds. - * Applies autofit if bounds were specified and display and text are defined. - * @method jibo.face.views.Label#applyTextBounds - */ - - /** - * Extract font size from a text style and return as a number. - * @method jibo.face.views.Label#getFontSize - * @return {number} - Font size as a number - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/List.js b/docs/rendering/gui/components/List.js deleted file mode 100644 index 8fe037a4..00000000 --- a/docs/rendering/gui/components/List.js +++ /dev/null @@ -1,661 +0,0 @@ -/** - * @interface jibo.face.views.List~ListOptions - * @extends jibo.face.views.Element~ElementOptions - * @description Interface - Configuration values for creating a List. - * @prop {String} [axis] - Orientation of the list. Can be either `horizontal` or `vertical`. - * @prop {jibo.face.views.Element~ElementOptions[]} [componentConfigs] - Object containing list of element configurations contain within list. - * @prop {Boolean} [noPan = false] - If `true` disables gesture for panning left and right on list. - * @prop {Number} [elementsPerPage] - Number of elements that will appear fully on screen at a time. - * @prop {Number} [pageIndex] - Index of active page of list. - * @prop {Number} [indexOfAction] - Index of the element within list that last triggered an action. - * @prop {jibo.face.views.Element~DimensionData} [elementDimensions] - Width and height of the elements. - * @prop {Number} [elementBuffer] - Minimum space between the elements in the list. - * @prop {jibo.face.views.Element~ElementOptions} [defaultElement] - Default configuration for the elements in the list. - * @prop {Boolean} [dynamic = false] - If `true`, list elements will load as needed. If `false`, all elements assets are loaded with view. - * @prop {Boolean} [dynamicPreload = true] - Use only when `dynamic` is `true`. - * If `true` will load the assets for active elements prior to open, if `false` assets for active elements start laod after open is called. - * @prop {Number} [dynamicBuffer] - Use only when `dynamic` is `true`. Number of pages on either side of current page that will be loaded. - */ - -/** - * Format for methods that will handle destroy transitioning for an Element - * @callback jibo.face.views.List~ElementTransition - * @param {jibo.face.views.Element} element - Element to transition. - * @param {Function} done - Called once transition is complete. - */ - -/** - * Manage lists of elements using pagination. - * - * @class List - * @extends jibo.face.views.ComponentGroup - * @memberof jibo.face.views - */ - - /** - * The default class identifier. - * Generally used to register the class. - * @name jibo.face.views.List.DEFAULT_TYPE - * @type {String} - * @readOnly - */ - - /** - * Action type triggered when page changes. - * @name jibo.face.views.List.PAN - * @type {String} - * @readOnly - */ - - /** - * Action type triggered/Event string dispatched when page changes. - * @name jibo.face.views.List.PAGED - * @type {String} - * @readOnly - */ - - /** - * Event dispatched when page forward attempt is made from end of list. - * @name jibo.face.views.List.AT_END - * @type {String} - * @readOnly - */ - - /** - * Event dispatched when page backward attempt is made from front of list. - * @name jibo.face.views.List.AT_FRONT - * @type {String} - * @readOnly - */ - - /** - * Number of elements that will appear fully on screen at a time. - * @name jibo.face.views.List#elementsPerPage - * @type {number} - */ - - /** - * Number of elements permitted to remain active at - * the edge of the 'page' in addition to the elements per page, - * a value of 1 will allow the elements on either end to remain visible and active. - * @name jibo.face.views.List#numElementsAtEdge - * @type {number} - * @default 1 - */ - - /** - * The width and height of the elements. - * @name jibo.face.views.List#elementDimensions - * @type {jibo.face.views.Element~DimensionData} - */ - - /** - * Minimum space between the elements in the list. - * Buffer is calculated during List creation to guarantee appropriate page positioning, - * and uses this value as the minimum allowable spacing between elements. - * @name jibo.face.views.List#elementBuffer - * @type {number} - * @default 20 - */ - - /** - * Default configuration for the elements within the list. - * Properties of `defaultElementData` are merged into the element configs on List creation, - * filling in any unspecified values. - * @name jibo.face.views.List#defaultElementData - * @type {Object} - */ - - /** - * Position of list axis. - * Only horizontal lists are currently supported. - * @name jibo.face.views.List#axisPosition - * @type {number} - */ - - /** - * In case of dynamic element lists, the number of pages on either side of current page that will be loaded. - * @name jibo.face.views.List#dynamicLoadBuffer - * @type {number} - * @default 1 - */ - - /** - * Flag to disable gestures for panning left and right on list. - * Set value before List's `createDisplay` is called to take effect. - * @name jibo.face.views.List#noPan - * @type {boolean} - * @default false - */ - - /** - * Flag to determine if all the list elements will be created dynamically. - * Dynamic elements within the list are not supported yet, so this should remain false. - * The use case for dynmic creation be for a list with a large or unknown number of elements. - * @name jibo.face.views.List#dynamicElements - * @type {boolean} - * @default false - */ - - /** - * Flag to include assets for elements that are in initial load range as part of the assets included in the View setup. - * This guarantees that the initially visible elements will have their required assets when the View is opened. - * @name jibo.face.views.List#dynamicPreload - * @type {boolean} - * @default false - */ - - /** - * `true` to allow automatic recalculation of elementsPerPage to fit as many elements on page as possible, `false` to respect elementsPerPage - * @name jibo.face.views.List#autoFitElements - * @type {Boolean} - * @default true - */ - - /** - * `true` to display portion of elements from next pages at edge of screen, `false` to disable it - * @name jibo.face.views.List#pageHinting - * @type {Boolean} - * @default true - */ - - /** - * Get the standard distance between element positions, calculated from element dimensions and buffer. - * @name jibo.face.views.List#elementSpacing - * @type {number} - */ - - /** - * Whether the list requires a pan or not, determine at ready. - * @name jibo.face.views.List#_requiresPan - * @type {Boolean} - * @private - */ - - /** - * In case of list with multiple pages, amount element for next page appears on screen. - * Determines amount element shows to indicate there are more elements in that direction. - * @name jibo.face.views.List#EDGE_HINT - * @type {Number} - * @constant - * @private - */ - - /** - * The max distance of buffer 'spread' when scrolling. - * @name jibo.face.views.List#BUFFER_SPREAD - * @type {number} - * @constant - * @private - */ - - /** - * Minimum amount of pan distance required for page change. - * @name jibo.face.views.List#PAN_THRESHOLD - * @type {int} - * @constant - * @private - */ - - /** - * The max distance of buffer 'spread' when panning. - * @name jibo.face.views.List#PAN_SPREAD - * @type {number} - * @constant - * @private - */ - - /** - * Constant springs value used for spring movement. - * @name jibo.face.views.List#SPRING - * @type {number} - * @constant - * @private - */ - - /** - * Constant friction value applied to spring movement. - * @name jibo.face.views.List#FRICTION - * @type {int} - * @type {number} - * @constant - * @private - */ - - /** - * The threshold the velocity must surpass in order to start the 'spread' between elements. - * Assume a velocity of 0 if the velocity gets below or equal to this threshold. - * @name jibo.face.views.List#REST_THRESHOLD - * @type {number} - * @constant - * @private - */ - - /** - * The x delta that all list elements must be below in order to unlock inputs during a swipe. - * @name jibo.face.views.List#SWIPE_THRESHOLD - * @type {number} - * @constant - * @private - */ - - /** - * The axis of the list, only supports horizontal for now. - * @name jibo.face.views.List#_axis - * @type {String} - * @default 'horizontal' - * @private - */ - - /** - * List of Elements currently awaiting assets to load. - * @name jibo.face.views.List#_loadingElements - * @type {jibo.face.views.Element[]} - * @private - */ - - /** - * left page bound - * @name jibo.face.views.List#_leftPageBound - * @type {number} - * @private - */ - - /** - * right page bound - * @name jibo.face.views.List#_leftPageBound - * @type {number} - * @private - */ - - /** - * Current page the list is on, 0 being the first page. - * @name jibo.face.views.List#_pageIndex - * @type {int} - * @private - */ - - /** - * The current element offset of the pages. - * @name jibo.face.views.List#_pageElementOffset - * @type {int} - * @private - */ - - /** - * The list index of the element that last triggered an action. - * @name jibo.face.views.List#_indexOfAction - * @type {number} - * @private - */ - - /** - * The current page the list is on, 0 being the first page. - * @name jibo.face.views.List#pageIndex - * @type {number} - * @readOnly - */ - - /** - * Maximum buffer distance, this is the standard buffer plus the max distance of buffer 'spread' when scrolling - * @name jibo.face.views.List#_bufferMax - * @type {int} - * @private - */ - - /** - * Current type of movement, refer to Movement enum for values. - * @name jibo.face.views.List#_currentMovement - * @type {int} - * @private - */ - - /** - * Total distance of the list has mpved from when pan began. - * This is reset to zeroed once the pan stops. - * @name jibo.face.views.List#_panTotalDelta - * @type {number} - * @private - */ - - /** - * Holds index range for active elements. - * For use in dynamic lists where we don't want to keep calculating the active range. - * @name jibo.face.views.List#_dynamicActiveIndexRange - * @type {number[]} - * @private - */ - - /** - * Create List from configuration. - * @method jibo.face.views.List#createFromConfig - * @param {Object} configData Configuration to create list from. - * @returns {jibo.face.views.List} - */ - - /** - * Add Element to the List. - * Assigns the Element's index within the list to the Element.index variable. - * @method jibo.face.views.List#addComponent - * @param {jibo.face.views.Element} element The Element to add this group's component list and library. - * @param {String} [elementId] The id to assign to the Element, if specified will overwrite existing id, - * if none is specified an id will be automatically generated and assigned. - * @returns {jibo.face.views.Element} Returns the given Element. - */ - - /** - * Remove Element from list, ultimately destroying the Element. - * @method jibo.face.views.List#removeComponent - * @param {jibo.face.views.Component|Number|String} componentDeterminer - Provide Component, index of component, or id of component to remove. - * @param {Function} [done] - Callback for when element has been fully removed. - * @param {jibo.face.views.List~ElementTransition} [transition] - Optional method to transition element prior to destruction, if not defined uses default. - * @returns {jibo.face.views.Component} - */ - - /** - * Compiles together Objects that describe the assets to load from this Component and its children. - * If list is dynamic, only loads an asset to display loading, the element asset are then loaded on the fly. - * @name jibo.face.views.List#assetDescriptors - * @type {jibo.face.views~AssetDescriptor[]} - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Updates the indexes, so list can remember which page it was on when it closed and what element closed it. - * @method jibo.face.views.List#updateConfig - * @param {Object} [configData] Object defining configuration. - * @returns {Object} - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Create the display, sets up touch controls. - * @method jibo.face.views.List#createDisplay - * @param {PIXI.Container} container Parent Container which all DisplayObject - * created within this Component should be added to. - * @param {Object} [assets] Object passed back from loader namespace load method, - * refer to loader namespace within jibo for details. - */ - - /** - * Called by parent ComponentGroup once parent has finished its loading and setup. - * Allows opportunity to do additional setup that may depend on other components. - * Register for update if multiple pages are required. Also register for panning if its not disabled. - * - * ATTENTION: This should not be called directly, the top level View {@link jibo.face.views.View} - * will call this, which will recurse through Component tree. - * @method jibo.face.views.List#ready - */ - - /** - * Destroy, unregister for update, remove gestures. - * Should not be called directly, is called through the owning ComponentGroup - * @method jibo.face.views.List#destroy - */ - - /** - * Lock input for List and all child Components, - * and activate or deactivate gestures. - * @method jibo.face.views.List#lockInput - * @param {Boolean} [flag = true] - Flag for pausing or un-pausing the Component. - */ - - /** - * Turn the interactivity of the child components off or on. - * @method jibo.face.views.List#lockChildInput - * @param {boolean} flag - flag to turn interactivity on or off. - * @protected - */ - - /** - * Open the list, has unique implementation for vertical transitions (TRANS_UP, TRANS_DOWN, & TRANS_EYE). - * Once open is complete start registering for pans if criteria are met. - * Should not be called directly, is called through the owning ComponentGroup - * @method jibo.face.views.List#open - * @param {Function} callback Function to be called once open is complete. - * @param {String} transitionType String used to determine way Component opens, - * refer to ViewManager for constants used - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @param {String} [tweenType = 'backOut'] Type of tween used. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Close the list, has unique implementation for vertical transitions (TRANS_UP, TRANS_DOWN, & TRANS_EYE). - * Should not be called directly, is called through the owning ComponentGroup. - * @method jibo.face.views.List#close - * @param {Function} callback Function to be called once open is complete. - * @param {String} [transitionType] String used to determine way Component closes, - * refer to ViewManager for constants used. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @param {String} [tweenType = 'backIn'] Type of tween used. - */ - - /** - * Bubble up action to parent, keep a reference to the index of the element that triggered action for later use with transitions. - * @method jibo.face.views.List#actionHandler - * @param {jibo.face.views.ActionData} action Contains string for type of action and Object with any pertinent data required for that action type. - * @param {jibo.face.views.Component} [fromComponent] Component that triggered action. - */ - - /** - * Blocks actions from reaching child Elements. - * Listens for actions that will effect the page to change, - * namely ActionData.SWIPE_RIGHT, ActionData.SWIPE_LEFT - * @method jibo.face.views.List#actionEnactor - * @param {jibo.face.views.ActionData} action Contains string for type of action and data Object with any pertinent data dependent on action type. - * @return {boolean} Returns true if given action is acted on. - */ - - /** - * Move forward or backward one page. - * @method jibo.face.views.List#changePage - * @param {Boolean} [pageForward = true] - If `true` moves forward through the list, if `false` moves backwards. - * @return {Boolean} `true` if list was able to change pages - */ - - /** - * Move to start or end of list. - * @method jibo.face.views.List#pageToEnd - * @param {Boolean} [pageToFront = false] - If `true` moves to the beginning of the list, if `false` moves to end of the list. - * @return {Boolean} `true` if list was able to change pages - */ - - /** - * Get the start index of the element for the given page index. - * Make sure page index is set before using as it to guarantees offsets is correct. - * The offset guarantees that pages will always show the max elements per page, - * leaving no 'empty' slots when the page displays. - * @method jibo.face.views.List#getStartIndexByPage - * @param {number} pageIndex The index of the page. - * @return {number} The adjusted start index for the page, so that the page is always 'full'. - * @public - */ - - /** - * Set the active page index. - * Updates variables that keep track of element offset and range for dynamic elements. - * @method jibo.face.views.List#setActivePage - * @param {number} index - index of page - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL FROM EXTERNAL CLASS. - * - * Custom list open for opening vertically. - * Should not be called directly, but from within List.open() - * @method jibo.face.views.List#openVertical - * @param {Function} callback Function to be called once open is complete. - * @param {String} [transitionType] String used to determine way Component closes, - * refer to ViewManager for constants used. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @param {String} [tweenType = 'backIn'] Type of tween used. - * @private - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL FROM EXTERNAL CLASS. - * - * Custom list close for closing vertically. - * Should not be called directly, but from within List.close() - * @method jibo.face.views.List#closeVertical - * @param {Function} callback Function to be called once open is complete. - * @param {String} [transitionType] String used to determine way Component closes, - * refer to ViewManager for constants used. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @param {String} [tweenType = 'backIn'] Type of tween used. - * @private - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL FROM EXTERNAL CLASS. - * - * Custom list open for opening from an EyeView. - * Should not be called directly, but from within List.open() - * @method jibo.face.views.List#openFromEye - * @param {Function} callback Function to be called once open is complete. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @private - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL FROM EXTERNAL CLASS. - * - * Custom list close for closing an EyeView. - * Should not be called directly, but from within List.close() - * @method jibo.face.views.List#closeToEye - * @param {Function} callback Function to be called once open is complete. - * @param {number} [duration = ViewManager.TRANS_TIME] Duration of the transition. - * @private - */ - - /** - * Load and destroy elements dynamically based on page index. - * @method jibo.face.views.List#dynamicElementsPageChange - * @param {number} pageIndex - Page index to reference for dynamic loading, generally the current page. - * @private - */ - - /** - * Enables recursive iteration through each asset descriptor in given object, loading each individually. - * This is to reduce the impact of one bad asset corrupting a load batch. - * @method jibo.face.views.List#iterativeLoad - * @param {any} assetsToLoad Object containing AssetDescriptors using their id as key - * @private - */ - - /** - * Run through list of loading components and check to see if their required assets have been loaded. - * If assets are available update display. - * @method jibo.face.views.List#assignElementAssets - * @private - */ - - /** - * Remove loader display and create Element's display now that assets are available. - * @method jibo.face.views.List#updateElementDisplay - * @param {jibo.face.views.Element} element - Element to update. - * @private - */ - - /** - * Remove loader stand-in and create Element's display now that assets are available. - * @method jibo.face.views.List#emptyElementDisplay - * @param {jibo.face.views.Element} element - Element to empty display. - * @private - */ - - /** - * Set the list element targets based on page index. - * This is used in conjunction with changePage(). - * @method jibo.face.views.List#setTargetsByPage - * @param {number} pageIndex - we can expect that the pageIndex is possible - * @private - */ - - /** - * Set the list element targets based on touch input. - * This is used when panning the list. - * @method jibo.face.views.List#setTargetsByInput - * @param {number} panState The t of the pan, refer to Pan Case enum for valid states - * @param {number} velocity The velocity of the pan, equal to the delta of the mouse x position since last update - * @param {number} inputX - Position x of input. - * @private - */ - - /** - * Updates the position of the list elements by springing them toward their targets. - * @method jibo.face.views.List#springUpdate - * @private - */ - - /** - * Setup panning, determining the pan state and setting spring strength. - * The parameters are supplied by the GestureManager. - * @method jibo.face.views.List#pan - * @param {number} inputX - Position x of input. - * @param {number} velocity - Distance input has moved since last GestureManager dispatch. - * @private - */ - - /** - * Stop panning. - * @method jibo.face.views.List#panStop - * @private - */ - - /** - * Handler for events sent from pan gesture. - * @method jibo.face.views.List#onPanEvent - * @param {Object} event - Event object sent from HammerJS's Pan gesture. - * @private - */ - - /** - * Check the input events received from the gesture manager. - * @method jibo.face.views.List#checkGestureInput - * @param {Boolean} active - Flag determining if pan is active. - * @param {Number} [inputX = 0] - Current x position of pan input. - * @param {Number} [deltaX = 0] - Difference between start position on current position of pan input. - * @private - */ - - /** - * Default transition for removing a list element. - * @method jibo.face.views.List#elementRemovalTransition - * @param {jibo.face.views.Element} element - Element from list to destroy - * @param {Function} done - Callback when transition is complete - * @private - */ - - /** - * Destroy a single element, removal of element form the list is handle in List. - * Removes assets associated with Element, while checking for asset conflicts. - * @method jibo.face.views.List#destroyElement - * @param {jibo.face.views.Element} element - Element from list to destroy - * @param {Function} [done] - Callback when destruction of element is complete - * @private - */ - - /** - * Merge Component configurations together. - * @method jibo.face.views.List#mergeConfigs - * @param {Object} data - Object that defaultData is merging into and that will be returned. - * @param Object} defaultData - Object to merge into data - * @param {Boolean} [mergeArrays = true] - if `true` will merge Arrays together, if 'false' arrays will overwrite each other. - * @returns {Object} - resulting object from merge. - * @private - */ - - /** - * Returns page index that has been tested against the number of elements in list. - * Does not adjust the original parameter. - * @method jibo.face.views.List#normalizePageIndex - * @param {Number} pageIndex The index of the page - * @return {Number} the normalized page index - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/ListProgress.js b/docs/rendering/gui/components/ListProgress.js deleted file mode 100644 index 5025d971..00000000 --- a/docs/rendering/gui/components/ListProgress.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @typedef jibo.face.views.ListProgress~ListProgressOptions - * @description Interface - Configuration values for creating a ListProgress. - * @prop {number} [width] - Value for the desired width of the component. - * @prop {number} [height] - Value for the desired height of the component. - * @prop {number} [backgroundColor] - Background color value. - * @prop {number} [progressColor] - Progress color value. - * @prop {Object} [position] - An object with 'x' and 'y' properties. - */ - -/** - * Indicate current position (page) while navigating in MenuView. - * - * @class ListProgress - * @extends jibo.face.views.Element - * @memberof jibo.face.views - */ - - /** - * Default value for WIDTH of the component. - * @name jibo.face.views.ListProgress.DEFAULT_WIDTH - * @type {number} - * @readOnly - * @private - */ - - /** - * Default value for HEIGHT of the component. - * @name jibo.face.views.ListProgress.DEFAULT_HEIGHT - * @type {number} - * @readOnly - * @private - */ - - /** - * Default value for backgroundColor of the component. - * @name jibo.face.views.ListProgress.BACKGROUND_COLOR - * @type {number} - * @readOnly - * @private - */ - - /** - * Default value for progressColor of the component. - * @name jibo.face.views.ListProgress.PROGRESS_COLOR - * @type {number} - * @readOnly - * @private - */ - - /** - * Set of options which are used to specify position, size and look of progress bar - * @name jibo.face.views.ListProgress#_listProgressOptions - * @type {jibo.face.views.ListProgress~ListProgressOptions} - * @private - */ - - /** - * Graphics instance that represents progress bar - * @name jibo.face.views.ListProgress#_progressDisplay - * @type {PIXI.Graphics} - * @private - */ - - /** - * Graphics instance that represents background - * @name jibo.face.views.ListProgress#_backgroundDisplay - * @type {PIXI.Graphics} - * @private - */ - - /** - * Last passed-in page index from MenuView - * @name jibo.face.views.ListProgress#_pageIndex - * @type {number} - * @private - */ - - /** - * Last passed-in pages count from MenuView - * @name jibo.face.views.ListProgress#_pagesCount - * @type {number} - * @private - */ - - /** - * The radius of the round corner to be drawn on the left and right of the progress bar - * @name jibo.face.views.ListProgress#_cornerRadius - * @type {number} - * @private - */ - - /** - * Set up the display. - * Assign assets, set timelines, etc. - * @method jibo.face.views.ListProgress#setupDisplay - * @param {Object} [assets] Object passed back from loader namespace load method, - * refer to {@link jibo.loader} for detail - */ - - /** - * Updates progress position based on provided current page and pages quantity available in the MenuView - * @method jibo.face.views.ListProgress#updatePage - * @param {number} [pageIndex = -1] Index of the current page - * @param {number} [pagesCount = -1] Number of pages available in MenuView - */ - - /** - * Retrieves the actual height of the component. - * @method jibo.face.views.ListProgress#getHeight - * @type {Number} - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/MenuButton.js b/docs/rendering/gui/components/MenuButton.js deleted file mode 100644 index c080fa61..00000000 --- a/docs/rendering/gui/components/MenuButton.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * @interface jibo.face.views.MenuButton~MenuButtonOptions - * @extends jibo.face.views.StandardButton~StandardButtonOptions - * @description Interface describing data provided in the config. - * @prop {Number[]|String} [colors] - Array with colors that can be used for button filling. - * @prop {String} [label] - Value for the text label to be shown for the button. - * @prop {String} [iconSrc] - Path to the icon placed inside of the button. - */ - -/** - * @interface jibo.face.views.MenuButton~ButtonData - * @description Interface for required data for MenuButton types. - * @prop {String} assetPath - Path to button timeline source. - * @prop {jibo.face.views.Element~DimensionData} dimensions - Width and height of button. - * @prop {String} [cache] - Optionally define cache. - */ - -/** - * Menu button. - * - * @class MenuButton - * @extends jibo.face.views.StandardButton - * @memberof jibo.face.views - */ - - /** - * The default class identifier. - * Generally used to register the class. - * @name jibo.face.views.MenuButton.DEFAULT_TYPE - * @type {String} - * @readOnly - */ - - /** - * Text to appear below the MenuButton - * @name jibo.face.views.MenuButton#label - * @type {String} - */ - - /** - * MovieClip that may be placed inside of the MenuButton instead of a static image - * @name jibo.face.views.MenuButton#iconMovieClip - * @type {PIXI.animate.MovieClip} - */ - - /** - * Array of 2 colors to be applied to button base. - * @name jibo.face.views.MenuButton#_colors - * @type {number[]} - * @private - */ - - /** - * Mapping for button-specific data. - * @name jibo.face.views.MenuButton#_buttonURIs - * @type {Object} - * @private - */ - - /** - * String identifier for skill button. - * @name jibo.face.views.MenuButton.SKILL - * @type {string} - * @readOnly - */ - - /** - * String identifier for action button. - * @name jibo.face.views.MenuButton.ACTION - * @type {string} - * @readOnly - */ - - /** - * String identifier for large action button. - * @name jibo.face.views.MenuButton.ACTION_BIG - * @type {string} - * @readOnly - */ - - /** - * The predefined dimensions of the button. - * This only returns the dimensions that have been explicitly set; - * it does not return the dimensions of the display itself. - * @name jibo.face.views.MenuButton#dimensions - * @type {jibo.face.views.Element~DimensionData} - * @readOnly - */ - - /** - * Array of 2 colors to be applied to button base. If set to a value of `default`, `confirm`, - * or `cancel` uses the global color for that button type. - * @name jibo.face.views.MenuButton#colors - * @type {number[]} - */ - - /** - * Get button data object. - * @method jibo.face.views.MenuButton.getButtonData - * @param {string} type - Type of button. - * @returns {jibo.face.views.MenuButton~ButtonData} ButtonData for the object. - * @protected - */ - - /** - * Add button data object. - * @method jibo.face.views.MenuButton.addButtonData - * @param {string} type - Type of button. - * @param {string} assetPath - Path to button timeline src. - * @param {jibo.face.views.Element~DimensionData} dimensions - Width and height of button. - * @param {string} [cache] - Optionally define cache. - * @returns {jibo.face.views.MenuButton~ButtonData} ButtonData for the object. - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Set up the display. - * Assign assets, set timelines, etc. - * @method jibo.face.views.MenuButton#setupDisplay - * @param {Object} [assets] Object passed back from loader namespace load method, - * refer to {@link jibo.loader} for detail. - */ - - /** - * Set new icon for MenuButton. - * @method jibo.face.views.MenuButton#setIcon - * @param {PIXI.DisplayObject} icon DisplayObject instance to use as new icon. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL EXTERNALLY. - * Define the interactive hit area of the display. - * The DisplayObject.hitArea is what Pixi uses to define the interactive area. - * @method jibo.face.views.MenuButton#setupHitArea - * @param {PIXI.Rectangle} [bounds] Optionally specify the bounds for the hit area. - * If not defined, defaults to using the display's bounds. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Destroy. - * @method jibo.face.views.MenuButton#destroy - */ - - /** - * Assign colors to display, works for 'Menu' style buttons. - * @method jibo.face.views.MenuButton#applyColors - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/StandardButton.js b/docs/rendering/gui/components/StandardButton.js deleted file mode 100644 index ef1ce4dd..00000000 --- a/docs/rendering/gui/components/StandardButton.js +++ /dev/null @@ -1,246 +0,0 @@ -/** - * Animates view according to its toggled state - * @callback jibo.face.views.StandardButton~ToggleAnimate - * @param {Boolean} toggleOn Value to assign to flag holding button's current toggle state - * @param {Boolean} [shouldAnimate = false] `true` to animate state change. - */ - -/** - * @interface jibo.face.views.StandardButton~StandardButtonOptions - * @extends jibo.face.views.Element~ElementOptions - * @description Interface describing data provided in the config. - * @prop {Boolean} [willToggle] - Flag that indicates whether button will be toggleable or not. - * @prop {Boolean} [toggledOn] - Value indicating current state of the button - * @prop {jibo.face.views.StandardButton~ToggleAnimate} [toggleAnimate] - Function that performs animation for the changes of the toggling state - */ - -/** - * StandardButton element. - * Describes general behavior for buttons when graphical asset responses to basic touch events. - * - * @class StandardButton - * @extends jibo.face.views.Button - * @memberof jibo.face.views - */ - - /** - * The default class identifier. - * Generally used to register the class. - * @name jibo.face.views.StandardButton#DEFAULT_TYPE - * @type {String} - * @private - * @readOnly - */ - - /** - * FOR OVERRIDE ONLY. DO NOT ALTER. - * - * The Class name as a string. - * @name jibo.face.views.StandardButton#_type - * @type {String} - * @protected - */ - - /** - * Scale value for down state of button. - * @name jibo.face.views.StandardButton#downScale - * @type {number} - */ - - /** - * Scale value for activate state of button. - * @name jibo.face.views.StandardButton#activateScale - * @type {number} - */ - - /** - * Duration of tweens for button state changes. - * @name jibo.face.views.StandardButton#tweenTime - * @type {number} - */ - - /** - * Flag that indicates whether button will be toggleable or not. - * @name jibo.face.views.StandardButton#willToggle - * @type {Boolean} - * @default false - */ - - /** - * Flag that indicates whether button will do default down-state transitions - * @name jibo.face.views.StandardButton#disableStateAnimations - * @type {Boolean} - * @default false - */ - - /** - * Flag determining current toggle state of the button - * @name jibo.face.views.StandardButton#_toggledOn - * @type {Boolean} - * @default false - * @private - */ - - /** - * Create a StandardButton from a configuration Object derived from JSON. - * @method jibo.face.views.StandardButton.createFromConfig - * @param {Object} configData Object derived from JSON, must be a specific format refer to examples. - * @returns {jibo.face.views.StandardButton} The StandardButton created from the given configuration. - */ - - /** - * Create a StandardButton object by passing the DisplayObject and specifying the {@link jibo.face.views.ActionData}. - * This allows for a more direct way to create Buttons that is not reliant on the configuration data. - * @method jibo.face.views.StandardButton.createFromDisplayObject - * @param {PIXI.DisplayObject} displayObject The DisplayObject with the button assets. - * @param {jibo.face.views.ActionData} [actionData] The action to be triggered on button click. - * @param {PIXI.Container} container Display container for the button. - * @returns {jibo.face.views.StandardButton} The created StandardButton. - */ - - /** - * Optional function that implements animation switching of toggle state - * @name jibo.face.views.StandardButton#toggleAnimate - * @type {jibo.face.views.StandardButton~ToggleAnimate} - */ - - /** - * Returns button's current toggle state value - * @method jibo.face.views.StandardButton#toggledOn - * @returns {Boolean} `true` if the button is currently toggled - * @readOnly - */ - - /** - * The display containing the button assets. - * Additionaly this is the DisplayObject that transforms are applied to for button states. - * @name jibo.face.views.StandardButton#buttonDisplay - * @type {PIXI.Container} - * @readOnly - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Assign data passed via Object to class. - * Method can be overridden to allow for manual definition of values, assets, etc. - * @method jibo.face.views.StandardButton#assignConfig - * @param {any} configData - Object derived from JSON containing values specific to StandardButton. - */ - - /** - * Destroy display's children and stop tweens on content. - * @method jibo.face.views.StandardButton#emptyDisplay - */ - - /** - * Set up the display. - * Assign assets, set timelines, etc. - * @method jibo.face.views.StandardButton#setupDisplay - * @param {Object} [assets] - Object passed back from loader namespace load method, - * refer to {@link jibo.loader} for details. - */ - - /** - * - * Add asset to content container of button, content is effected by state change transitions (e.g. down, out, up) - * If the given asset is a PIXI.Sprite a center registration is applied, - * in all other cases it is expected that the assets has been given appropriate registration. - * @method jibo.face.views.StandardButton#addToContent - * @param {PIXI.DisplayObject} asset DisplayObject instance to be placed within content container. - * @param {PIXI.Container} [container] If not specified will uses default content container. - * @param {boolean} [emptyContent = false] If `true` will empty content of all children - */ - - /** - * Method to change the state of the button and trigger visual change of the state - * @method jibo.face.views.StandardButton#toggle - * @param {Boolean} toggleOn Value to assign to flag holding button's current toggle state - * @param {Boolean} [animate = true] `true` to animate state change. - */ - - /** - * Activate the button. Used for non-touch input. - * @method jibo.face.views.StandardButton#activate - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Handler for out-transition executed in {@link jibo.face.views.StandardButton#out} - * @method jibo.face.views.StandardButton#outTransition - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Handler for toggleOut-transition executed in {@link jibo.face.views.StandardButton#out} - * @method jibo.face.views.StandardButton#toggleOutTransition - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Handler for down-transition executed in {@link jibo.face.views.StandardButton#down} - * @method jibo.face.views.StandardButton#downTransition - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Handler for toggleDown-transition executed in {@link jibo.face.views.StandardButton#down} - * @method jibo.face.views.StandardButton#toggleDownTransition - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Handler for up-transition executed in {@link jibo.face.views.StandardButton#up} - * @method jibo.face.views.StandardButton#upTransition - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Handler for toggleUp-transition executed in {@link jibo.face.views.StandardButton#up} - * @method jibo.face.views.StandardButton#toggleUpTransition - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Animation for simple button behavior when it's pressed down - * @method jibo.face.views.StandardButton#animateDown - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Animation for simple button behavior when touch event is released - * @method jibo.face.views.StandardButton#animateUp - * @protected - */ - - /** - * This method takes array of functions and starts them asynchronously - * @method jibo.face.views.StandardButton#executeAsyncTransitions - * @param {any[]} [transitionArray] Array of transition functions to be executed in parallel - * @param {Function} [callback] Function to execute once execution is done - * @private - */ - - /** - // * Handler for when transitions are all complete. - // * @method jibo.face.views.StandardButton#transitionComplete - // * @param {Function} callback The callback triggered once transitions are completed - // * @param {Error} [err] Error returns if there is an issue with the asynchronous method. - // * @param {any[]} [results] Results returned from asynchronous method, will be empty. - // * @private - // */ \ No newline at end of file diff --git a/docs/rendering/gui/components/subcomponents/ListMember.js b/docs/rendering/gui/components/subcomponents/ListMember.js deleted file mode 100644 index e5fcd2ec..00000000 --- a/docs/rendering/gui/components/subcomponents/ListMember.js +++ /dev/null @@ -1,31 +0,0 @@ - /** - * Subcomponent identifier. - * @name jibo.face.views.ListMember.ID - * @type {String} - * @default 'ListMember' - * @readOnly - */ - - /** - * Target position of list member. - * @name jibo.face.views.ListMember.targetPosition - * @type {PIXI.Point} - */ - - /** - * Velocity of list member. - * @name jibo.face.views.ListMember.velocity - * @type {PIXI.Point} - */ - - /** - * Offset from target. - * @name jibo.face.views.ListMember.targetOffset - * @type {Number} - */ - - /** - * If assets are loaded for owning Component. - * @name jibo.face.views.ListMember.loaded - * @type {Boolean} - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/subcomponents/Subcomponent.js b/docs/rendering/gui/components/subcomponents/Subcomponent.js deleted file mode 100644 index 7cf36ad0..00000000 --- a/docs/rendering/gui/components/subcomponents/Subcomponent.js +++ /dev/null @@ -1,39 +0,0 @@ - /** - * Subcomponent identifier. - * @name jibo.face.views.Subcomponent.TYPE - * @type {String} - * @default 'TouchInteractive' - * @readOnly - */ - - /** - * Type of Subcomponnet, used for identification - * @name jibo.face.views.Subcomponent#type - * @type {String} - * @readOnly - */ - - /** - * Owning Component. - * @name jibo.face.views.Subcomponent.component - * @type {Boolean} - * @protected - */ - - /** - * Type of Subcomponent, used for mapping storage and retrieval. - * @name jibo.face.views.Subcomponent._type - * @type {String} - * @private - */ - - /** - * Initialize Subcomponent. - * @method jibo.face.views.Subcomponent#init - * @param {jibo.face.views.Component} component - Component this Subcomponent is being added to. - */ - - /** - * Destroy. - * @method jibo.face.views.Subcomponent#destroy - */ \ No newline at end of file diff --git a/docs/rendering/gui/components/subcomponents/TouchInteractive.js b/docs/rendering/gui/components/subcomponents/TouchInteractive.js deleted file mode 100644 index 27111f3b..00000000 --- a/docs/rendering/gui/components/subcomponents/TouchInteractive.js +++ /dev/null @@ -1,64 +0,0 @@ - /** - * Subcomponent identifier. - * @name jibo.face.views.TouchInteractive.TYPE - * @type {String} - * @default 'TouchInteractive' - * @readOnly - */ - - /** - * Whether interactivity is active or not. - * @name jibo.face.views.TouchInteractive.isActive - * @type {Boolean} - */ - - /** - * Object of array of actions, with gesture type as key. - * @name jibo.face.views.TouchInteractive._gestureActions - * @type {Object.} - * @private - */ - - /** - * Destroy - * @method jibo.face.views.TouchInteractive#destroy - */ - - /** - * Add a {@link jibo.face.views.ActionData}. All actions with will be triggered on triggerActions. - * Generally these actions are triggered on a screen press (if a screen press is set up). - * @method jibo.face.views.TouchInteractive#addAction - * @param {jibo.face.views.ActionData} actionData - The action to be triggered on tap. - * @param {boolean} [clearPrevious = false] Flag to determine if we should clear out the existing actions. - * @param {boolean} [toFront = false] If `true` adds action to front of actions list, causing it to be called first when actions are triggered. - * @param {jibo.face.views.GESTURE} [gesture = 'tap'] Gesture actions are related to. - * @returns {jibo.face.views.ActionData} The ActionData added. - */ - - /** - * Returns `true` if there are actions associated with given gesture type. - * @method jibo.face.views.TouchInteractive#hasActions - * @param {jibo.face.views.GESTURE} [gesture = 'tap'] Gesture actions are related to. - * @returns {boolean} `true` if there are actions associated with given gesture type. - */ - - /** - * Get actions associated with given gesture type. - * @method jibo.face.views.TouchInteractive#getActions - * @param {jibo.face.views.GESTURE} [gesture = 'tap'] Gesture actions are related to. - * @return {jibo.face.views.ActionData[]} Actions associated with the given gesture type. - */ - - /** - * Clear all actions associated with given gesture type. - * @method jibo.face.views.TouchInteractive#clearActions - * @param {jibo.face.views.GESTURE} [gesture = 'tap'] Gesture actions are related to. - */ - - /** - * Trigger actions associated with given gesture type. - * Calls Component or the Component parent's actionHandler for each action. - * @method jibo.face.views.TouchInteractive#triggerActions - * @param {jibo.face.views.GESTURE} [gesture = 'tap'] Gesture actions are related to. - * @return {boolean} `true` if at least one action was triggered. - */ \ No newline at end of file diff --git a/docs/rendering/gui/views/ContactsView.js b/docs/rendering/gui/views/ContactsView.js deleted file mode 100644 index b05ce179..00000000 --- a/docs/rendering/gui/views/ContactsView.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Sort the list of Loop members. - * @callback jibo.face.views.ContactsView~LoopListSort - * @param loopList {jibo.kb.loop.UserNode[]} List of Loop members to sort. - */ - -/** - * Check to see if a Loop member is in the list. - * @callback jibo.face.views.ContactsView~LooperCheck - * @param looper {jibo.kb.loop.UserNode} Loop member to check the list for. - * @return {Boolean} `true` if the Looper exists in the list. - */ - -/** - * Menu display for a list of Contacts. - * - * @class ContactsView - * @extends jibo.face.views.MenuView - * @memberof jibo.face.views - */ - - /** - * Optional function used to edit the looper list. - * Should determine what ContactButtons are created and in what order. - * Need to take and return an array of Loop members. - * If not explicitly defined will be set to a default when createListComponents is called. - * @name jibo.face.views.ContactsView#sortLoopList - * @type {jibo.face.views.ContactsView~LoopListSort} - */ - - /** - * Optional function used to determine if a ContactButton's checkmark should be displayed. - * Requires a Looper and return a boolean. - * If true is returned, a checkmark on the Loop member's ContactButton will be displayed. - * @name jibo.face.views.ContactsView#determineCheck - * @type {jibo.face.views.ContactsView~LooperCheck} - */ - - /** - * Optional parameters indicating whether show the "Not a Loop Member" button. - * @name jibo.face.views.ContactsView#showNotALoopMemberButton - * @type {Boolean} - */ - - /** - * @name jibo.face.views.ContactsView#_loopMembers - * @type {jibo.kb.loop.UserNode[]} - * @private - */ - - /** - * Destroy. - * @method jibo.face.views.ContactsView#destroy - */ - - /** - * Default LoopListSort used to edit list of Loop members. - * @method jibo.face.views.ContactsView#removeInvalidLoopers - * @param {jibo.kb.loop.UserNode[]} loopList List of Loop members objects - * @returns {jibo.kb.loop.UserNode[]} The edited list of Loop members objects - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/views/EyeView.js b/docs/rendering/gui/views/EyeView.js deleted file mode 100644 index 91186797..00000000 --- a/docs/rendering/gui/views/EyeView.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * View class that serves as a container for the Eye. - * - * @class EyeView - * @extends jibo.face.views.View - * @memberof jibo.face.views - */ - - /** - * Construct View - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Adjust provided transition before calling inherited method. - * @method jibo.face.views.EyeView#open - * @param {Function} [callback] - Callback fired when close is complete, can also listen for View.OPENED event. - * @param {String} [transitionType] - This will be ignored as EyeView defines its own transition types. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * We want to override the close transition type for EyeView - * @method jibo.face.views.EyeView#close - * @param {Function} [callback] - Callback fired when close is complete, can also listen for View.CLOSED event. - * @param {String} [transitionType] - This will be ignored as EyeView defines its own transition types. - */ \ No newline at end of file diff --git a/docs/rendering/gui/views/ImageView.js b/docs/rendering/gui/views/ImageView.js deleted file mode 100644 index 883b5589..00000000 --- a/docs/rendering/gui/views/ImageView.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @description Interface - Configuration values for creating a ImageView. - * @interface jibo.face.views.ImageView~ImageViewOptions - * @extends jibo.face.views.View~ViewOptions - * @prop {AssetDescriptor} [image] - Relative source path to the resource. - */ - -/** - * View designed to display standard Clips. - * - * Takes a simplified JSON configuration. Example: - * ```json - * { - * "viewConfig": { - * "type": "ImageView", - * "id": "my_image_view", - * "image": { - * "id": "clipTest", - * "src": "resources/images/my-image.png", - * "type": "texture" - * }, - * "scaleToFit": true - * } - * } - * ``` - * @class ImageView - * @extends jibo.face.views.View - * @memberof jibo.face.views - */ - - /** - * The default class identifier. - * Generally used to register the class. - * @name jibo.face.views.ImageView.DEFAULT_TYPE - * @type {String} - * @readOnly - */ - - /** - * If clip is smaller than screen determine if it should be stretched to fit - * @name jibo.face.views.ImageView#scaleToFit - * @type {boolean} - * @public - */ - - /** - * AssetDescriptor for the ImageView's Clip - * @name jibo.face.views.ImageView.imageDescriptor - * @type {jibo.face.views~AssetDescriptor} - * @public - */ - - /** - * Clip for the ImageView. - * @name jibo.face.views.MenuView#clip - * @public - * @readOnly - * @type {jibo.face.views.Clip} - */ - - /** - * Construct ImageView - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL EXTERNALLY. - * - * Determine x and y positions for the clip element, and its scaling relative to the screen. - * @method jibo.face.views.ImageView#positionComponents - */ \ No newline at end of file diff --git a/docs/rendering/gui/views/MenuView.js b/docs/rendering/gui/views/MenuView.js deleted file mode 100644 index 8fbb6bd3..00000000 --- a/docs/rendering/gui/views/MenuView.js +++ /dev/null @@ -1,208 +0,0 @@ -/** - * @description Interface for describing default values of the list elements that will be shown in the MenuView. - * @interface jibo.face.views.MenuView~ListDefaultData - * @extends jibo.face.views.MenuButton~MenuButtonOptions - * @property {String} [menuButtonType] The name of the MenuButton type that will be generated in the list. - */ - -/** - * @description Interface - Configuration values for creating a MenuView. - * @interface jibo.face.views.MenuView~MenuViewOptions - * @extends jibo.face.views.View~ViewOptions - * @prop {String} [title] - Position of the element on the screen. - * @prop {jibo.face.views.MenuView~ListDefaultData} [listDefault] - Default values that will be applied to list elements upon creation. - * @prop {jibo.face.views.MenuButton~MenuButtonOptions[]} [list] - Structure specifying the contents of the list. Its values override those given in {~listDefault}. - * @prop {Boolean} [useEyeTransitions] - Flag indicating whether eyeTransitions should be used. - */ - -/** - * View designed to display standard list menus. - * - * Takes a simplified JSON configuration. Example: - * ```json - * { - * "viewConfig": { - * "type": "MenuView", - * "id": "my_menu", - * "title": "Menu Title", - * "progress": { //setting to true will use default values, setting to false prevent creation - * "width" : 500, - * "height": 20, - * "backgroundColor": "0xff892f", - * "progressColor": "0x1E90FF", - * "position": { - * "x": "390", - * "y": "170", - * "margin" : { - * "x": 100|LEFT|CENTER|RIGHT, - * "y": 100|TOP|CENTER|BOTTOM - * } - * } - * }, - * "listDefault": { - * "menuButtonType": "SkillButton" - * }, - * "list": [ - * { - * "id": "mySkill", - * "label": "My SKill", - * "colors": ["0xff892f", "0xaf4123"], - * "iconSrc": "resources/icons/mySkill.png", - * "action": { - * "type": "event", - * "data": { - * "event": "openSkill" - * "skill": "mySkill" - * } - * } - * } - * ] - * } - * } - * ``` - * @class MenuView - * @extends jibo.face.views.View - * @memberof jibo.face.views - */ - - /** - * Default value for X padding of the listProgress. - * @name jibo.face.views.MenuView.LISTPROGRESS_LEFT_MARGIN - * @type {number} - * @readOnly - * @private - */ - - /** - * Default value for Y padding of the listProgress. - * @name jibo.face.views.MenuView.LISTPROGRESS_BOTTOM_MARGIN - * @type {number} - * @readOnly - * @private - */ - - /** - * Margin value for X padding on either side of title to edge of screen. - * @name jibo.face.views.MenuView.TITLE_MARGIN - * @type {number} - * @readOnly - * @private - */ - - /** - * Buffer value for Y padding beween bottom of title and top of list buttons. - * @name jibo.face.views.MenuView.TITLE_BUFFER - * @type {number} - * @readOnly - * @private - */ - - /** - * Maximum height of title text. - * @name jibo.face.views.MenuView.TITLE_HEIGHT - * @type {number} - * @readOnly - * @private - */ - - /** - * Maximum height of button label text. - * @name jibo.face.views.MenuView.LABEL_HEIGHT - * @type {number} - * @readOnly - * @private - */ - - /** - * A constant specified by design - * @name jibo.face.views.MenuView#MENU_LABEL_BUFFER - * @private - * @type {number} - * @readOnly - */ - - /** - * The default class identifier. - * Generally used to register the class. - * @name jibo.face.views.MenuView.DEFAULT_TYPE - * @type {String} - * @readOnly - */ - - /** - * List for the MenuView. - * @name jibo.face.views.MenuView#list - * @public - * @readOnly - * @type {jibo.face.views.List} - */ - - /** - * Title for the MenuView, only created if specified. - * @name jibo.face.views.MenuView#titleLabel - * @public - * @readOnly - * @type {jibo.face.views.Label} - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Create and add components for List. - * @method jibo.face.views.MenuView#createListComponents - * @param {jibo.face.views.List} list The List components components will be added to. - * @protected - */ - - /** - * Add eye specific transitions for use when this instance of MenuView opens from or closes to an EyeView. - * Call on instance of MenuView prior to starting a change view process. - * @method jibo.face.views.MenuView#addEyeTransitions - */ - - /** - * Apply List config update values (pageIndex, indexOfAction) directly to view config. - * This occurs because MenuView does not use a standard component configuration, - * instead storing List related data directly to its viewConfig. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL EXTERNALLY. - * - * Determine y positions for the menu elements, as they are relative to each other. - * @method jibo.face.views.MenuView#positionComponents - * @param {number} [overrideTitleHeight] Override the calculated title height (or if there is no title but you want more spacing). - */ - - /** - * Positions button labels according to list start position to match buttons location on the screen - * @method jibo.face.views.MenuView#positionButtonLabels - * @protected - */ - - /** - * Update the button labels to match the list elements. - * Enacts the Label close and open transitions by default. - * @method jibo.face.views.MenuView#updateButtonLabels - * @param {Boolean} [labelRemovalNeeded = false] Flag indicating that we need to remove label component - * and reposition labels - * @param {Boolean} [playTransition = true] Flag determining if close and open transitions will be used, - * if false updates the text without any transitions. - * @param {number} [duration = 200] Duration of the transition. - * @protected - */ - - /** - * Calls the close transition on all of the button labels. - * @method jibo.face.views.MenuView#fadeOutButtonLabels - * @param {number} [duration = 100] Duration of the transition. - * @private - */ - - /** - * Manages eye tween aspect of the close to eye transition. - * @method jibo.face.views.MenuView#eyeOpenTransition - * @param {Function} callback - Callback fired when eye completes tween. - * @param {number} duration - Duration of the transition. - * @private - */ \ No newline at end of file diff --git a/docs/rendering/gui/views/PauseOverlay.js b/docs/rendering/gui/views/PauseOverlay.js deleted file mode 100644 index a74f9cc3..00000000 --- a/docs/rendering/gui/views/PauseOverlay.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @interface jibo.face.views.PauseOverlay~PauseOptions - * @description Interface for pause options. - * @prop {number} [alpha] - Alpha value for overlay when opened. Supports values between `0` and `1`. - * @prop {number} [duration] - Duration in milliseconds of tween, if `0` no tween is used. - * @prop {String} [type] - Type of tween applied to alpha transition when opening and closing. - */ - - /** - * Level of opacity for overlay. - * Supports values between `0` and `1`. - * @name jibo.face.views.PauseOverlay#alpha - * @default .7 - * @type {number} - */ - - /** - * Duration in milliseconds of tween. - * If `0` no tween is used. - * @name jibo.face.views.PauseOverlay#duration - * @default 550 - * @type {number} - */ - - /** - * Type of tween applied to alpha transition when opening and closing. - * @name jibo.face.views.PauseOverlay#type - * @default 'sineOut' - * @type {string} - */ - - /** - * Graphic for display overlay. - * @name jibo.face.views.PauseOverlay#_overlay - * @type {PIXI.Graphics} - * @private - */ - - /** - * Flag set to `true` after open is called, reset to `false` on close. - * @name jibo.face.views.PauseOverlay#_isOpen - * @type {boolean} - * @private - */ - - /** - * Apply values from options. - * @method jibo.face.views.PauseOverlay#applyOptions - * @example - * { - * "alpha": ".7", - * "duration": 550, - * "type": "sineOut", - * } - * @param {jibo.face.views.PauseOverlay~PauseOptions} options - Options for pause. - * @param {number} [options.alpha] - Level of opacity for overlay. - * @param {number} [options.duration] - Duration in milliseconds of tween. - * @param {String} [options.type] - Type of tween applied to alpha transition. - */ - - /** - * Apply default values. - * @method jibo.face.views.PauseOverlay#applyDefaults - */ - - /** - * Open the overlay. - * Creates PIXI.Graphic and adds to stage. - * @method jibo.face.views.PauseOverlay#open - * @param {PIXI.Container} container - Container for the overlay, should be View's stage. - */ - - /** - * Close the overlay, once closed remove overlay from display. - * @method jibo.face.views.PauseOverlay#close - */ - - /** - * Destroy - * @method jibo.face.views.PauseOverlay#destroy - */ \ No newline at end of file diff --git a/docs/rendering/gui/views/TextView.js b/docs/rendering/gui/views/TextView.js deleted file mode 100644 index adeb4575..00000000 --- a/docs/rendering/gui/views/TextView.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @description Interface - Configuration values for creating a TextView. - * @interface jibo.face.views.TextView~TextViewOptions - * @extends jibo.face.views.View~ViewOptions - * @prop {string} [text] - Text to show. - * @prop {PIXI.TextStyle} [style] - Style of the text. - * @prop {jibo.face.views.Element~DimensionData} [margins] - Margins between edge of screen and text bounds. - */ - -/** - * View designed to display standard text. - * - * Takes a simplified JSON configuration. - * @example - * { - * "viewConfig": { - * "type": "TextView"," - * "id": "text_view_id", - * "text":"This is a text" - * } - * } - * @class TextView - * @extends jibo.face.views.View - * @memberof jibo.face.views - */ - - /** - * Default value for the text style if one's missing. - * @name jibo.face.views.Label.DEFAULT_STYLE - * @type {PIXI.TextStyle} - * @readOnly - * @private - */ - - /** - * Margin value for X padding on either side of text to edge of screen. - * @name jibo.face.views.TextView.TEXT_MARGIN_X - * @type {number} - * @readOnly - * @private - */ - - /** - * Margin value for Y padding on either side of text to edge of screen. - * @name jibo.face.views.TextView.TEXT_MARGIN_Y - * @type {number} - * @readOnly - * @private - */ - - /** - * Object describing the font specification used by `PIXI.Text`. - * Will be applied to the text on - * ``` - * fontSize: 100, - * fontFamily: 'Proxima Nova Soft', - * fill: '#FFFFFF', - * fontStyle: 'bold' - * wordWrap: true, - * wordWrapWidth: 100, - * align: 'center' - * ``` - * @name jibo.face.views.Label#style - * @type {PIXI.TextStyle} - */ - - /** - * Margins between text and edge of screen. - * If not specified will use the defaults. - * @name jibo.face.views.Label#margins - * @type {DimensionData} - */ - - /** - * Text of TextView label. - * @name jibo.face.views.TextView#text - * @public - * @readOnly - * @type {String} - */ - - /** - * Text of TextView label. - * @name jibo.face.views.TextView#text - * @public - * @type {String} - */ - - /** - * Label of the TextView. - * @name jibo.face.views.TextView#label - * @public - * @readOnly - * @type {jibo.face.views.Label} - */ - - /** - * Construct View - */ \ No newline at end of file diff --git a/docs/rendering/gui/views/View.js b/docs/rendering/gui/views/View.js deleted file mode 100644 index d22a9c72..00000000 --- a/docs/rendering/gui/views/View.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * @interface jibo.face.views.View~ViewOptions - * @extends jibo.face.views.Component~ComponentOptions - * @description Interface - Configuration values for creating a View. - * @prop {String} [category] - Category of view. - * @prop {String} [soundSet] - Set of sounds for view sfx. - * @prop {Boolean} [ignoreSwipeDown] - Flag to block or enable swipe down gesture. - * @prop {Boolean} [transitionStageOnly] - If 'true' view transition apply to View's stage only, - * if 'false' possible for transition to be acted out by individual Components where applicable. - * @prop {Boolean | jibo.face.views.PauseOverlay#PauseOptions} [pause] - Determine if view will pause the view it is opening over. - * If 'true' will use default pause options, pass PauseOptions for custom values. - * @prop {Boolean} [pauseParent] - Deprecated. - * @prop {jibo.face.views.PauseOverlay#PauseOptions} [pauseOptions] - Deprecated. - * @prop {Boolean} [border] - Flag to turn screen border visibility true or false. - */ - -/** - * Handler for custom View transitions. - * @callback jibo.face.views.View~TransitionHandler - * @param {Function} done - Must call when transition is complete. - * @param {jibo.face.views.View} [view] View to apply the transition to. - */ - -/** - * @typedef jibo.face.views~STATE - * @description Static class with static members that describe possible states of the views. - * @prop INITIALIZED Intialize the data. - * @prop DATA_LOADED State set and emitted once initial data has been loaded and configurations set. - * @prop ASSETS_LOADED State set and emitted once initial assets have been loaded. - * @prop LOADED State set and emitted once loading is complete, at point of dispatch View should be ready for use. - * @prop OPENED State set and emitted once View has completed its opening transition. - * @prop CLOSED State set and emitted once View has completed its closing transition. - * @prop DESTROYED State set and emitted once View has been destroyed. - * @prop LOAD_ERROR Event emitted if there is a load error. - */ - -/** - * @typedef jibo.face.views~CATEGORY - * @description Static class with static members that describe possible categories of the views. - * @prop GUI Category for views that contain an interactive user interface. - * @prop DISPLAY Category for views that are primarily used for display and not for interfacing. - * @prop EYE Category for EyeView type views. - */ - -/** - * Base class for groupings of GUI elements on screen at once. - * Views are the unit which {@link jibo.face.views} acts upon. - * - * @class View - * @extends jibo.face.views.ComponentGroup - * @memberof jibo.face.views - */ - - /** - * The default class identifier. - * Generally used to register the class. - * @name jibo.face.views.View.DEFAULT_TYPE - * @type {String} - * @readOnly - */ - - /** - * Event dispatched when the View is going to close because of a 'back' command. - * Currently closing a View and going back to the previous view is triggered by a swipe down. - * @type {string} - * @name jibo.face.views.View#BACK - * @readOnly - */ - - /** - * Option for setting custom transitions. - * Use with `View.defineTransitions` for transitions to be used when opening from or closing to an empty screen. - * @type {string} - * @name jibo.face.views.View.EMPTY - * @readOnly - */ - - /** - * Option for setting custom transitions. - * Use with `View.defineTransitions` for transitions to be used when opening over a paused view or closing while being paused. - * @type {string} - * @name jibo.face.views.View.PAUSED - * @readOnly - */ - - /** - * Reference to the paused View below this View. - * @name jibo.face.views.View#pausedParent - * @type {jibo.face.views.View} - */ - - /** - * Overlay used when view is paused. - * @name jibo.face.views.View#pauseOverlay - * @type {jibo.face.views.PauseOverlay} - */ - - /** - * Flag, if `true` the closure of the View on swipe down behavior will be setup. - * @name jibo.face.views.View#closeOnSwipeDown - * @type {boolean} - * @default true - */ - - /** - * Flag that when `true` will pause, instead of closing and destroying, the current View when this View opens above it. - * Once this View finishes opening the previous View, which is now paused, is referenced here {@link jibo.face.views.View#pausedParent} - * @name jibo.face.views.View#willPauseParent - * @type {boolean} - * @default false - */ - - /** - * Options applied to parent view when pausing. - * @name jibo.face.views.View#pauseOptions - * @type {jibo.face.views.PauseOverlay#PauseOptions} - */ - - /** - * Set of sounds to use when triggering sfx connected to menu button clicks, view open transition, and view close transition. - * - * The global sound sets include: - * - `main` - Used for the eye view and the main menu. - * - `skill` - Default sound set for standard views. - * - `action` - Use for confirmation view overlays. - * - * The soundSet value is combined with the sound type to determine which sound to play. - * For example clicking a menu button will trigger a 'button' sfx, this is combined with the soundSet value to determine the sound id. - * So a clicking a button in a view with a soundSet of `skill` will play the sound with id `skill_button`. - * - * Example for Setting a view's soundSet value via the config: - * ``` - * "viewConfig": { - * "type": "MenuView", - * "id": "confirmation_view", - * "soundSet": "action", - * ``` - * @name jibo.face.views.View#soundSet - * @type {string} - * @default `skill` - */ - - /** - * Flag to transition using only stage. - * If `true` prevents components from handling open and close individually. - * @name jibo.face.views.View#transitionStageOnly - * @type {boolean} - * @default false - */ - - /** - * Flag, if `true` the screen border is made visible just before opening view. - * Must set before view opens to take effect. - * @name jibo.face.views.View#borderNeeded - * @type {boolean} - * @default true - */ - - /** - * Specify a custom transition for either close or open, whichever is happening next. - * Can be set to a Function, in which case that Function will be used instead of the `open` or `close` methods, - * or set to a string, in which case that string will become the transition type checked by the `open` or `close` methods. - * @name jibo.face.views.View#transitionHandler - * @type {jibo.face.views.View~TransitionHandler | string} - */ - - /** - * View category, helps determine behavior and function expected from view. - * Category is not directly bound to `View.type`. - * @name jibo.face.views.View#_category - * @type {string} - */ - - /** - * Reference to ViewState the View was created from. - * A View will may not always have a ViewState defined, - * reference to ViewState is made within applyState. - * @name jibo.face.views.View#_viewState - * @type {jibo.face.views.ViewState} - * @private - */ - - /** - * Reference to loadAsset created by loader, kept for cleanup. - * @name jibo.face.views.View#_assetLoad - * @type {jibo.loader.AssetLoad} - * @private - */ - - /** - * Tokens of assets loaded and cached by this loader. - * @name jibo.face.views.View#_loadedAssets - * @type {jibo.loader.AssetToken[]} - * @private - */ - - /** - * Queue for assets that require loading. - * When _assetLoad completes a single load task queued asset are added to _assetLoad's load list. - * @name jibo.face.views.View#_assetLoadQueue - * @type {jibo.face.views~AssetDescriptor[]} - * @private - */ - - /** - * List of pending asset load requests. - * When _assetLoad completes asset load requests are checked, - * if requested assets have been loaded executes callback. - * @name jibo.face.views.View#_assetLoadRequests - * @type {any[]} - * @private - */ - - /** - * Object used to store custom transitions, uses a specific structure to manage nested choices. - * @type {any} - * @private - */ - - /** - * Get top most PIXI.Container of this View. - * @name jibo.face.views.View#stage - * @type {PIXI.Container} - * @readOnly - */ - - /** - * The assets loaded by the View, these are returned from the loader as an Object using the asset id as keys. - * Assets available after the view has completed its load methods. - * @name jibo.face.views.View#assets - * @type {Object} - * @readOnly - */ - - /** - * Type is equal to Class name. - * @name jibo.face.views.View#type - * @type {string} - * @readOnly - */ - - /** - * The current state of view. - * Refer to documentation for valid states e.g. LOADED, OPENED, CLOSED - * @name jibo.face.views.View#state - * @return {String} Refer to the View static constants or ViewManager for valid values. - */ - - /** - * View category, helps determine behavior and function expected from view. - * Category is not directly bound to `View.type`. - * @name jibo.face.views.View#category - * @type {string} - * @readOnly - */ - - /** - * Construct View - */ - - /** - * Method to acquire the source of data needed to setup the View. - * Once the data source is available calls internal methods to assign the data to the class appropriately. - * By default this method handles the loading of a configuration file, but could also be extended to get data from the KB, servers, or web services. - * @method jibo.face.views.View#loadData - * @param {Boolean} [loadAssetsOnComplete = true] - If `true` will call loadAssets() once data finishes loading. - * @protected - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Loads view configuration if a configPath has been defined, but the viewConfig is undefined. - * @method jibo.face.views.View#loadConfig - * @returns {Promise} Promise with View it was called from. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Apply data once all required data has finished loading. - * Custom View classes can overrdie this class to manually create custom Components. - * @method jibo.face.views.View#applyData - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * All data and assets have finished loading, create the display and update the status. - * For classes that override View this is where a lot of the setup logic will go. - * @method jibo.face.views.View#loaded - * @protected - */ - - /** - * Called when loaded process is completed and View is ready to become current. - * Calls ready on all child Components, which allows opportunity to do additional setup - * that may depend on other components or parent Components. - * @method jibo.face.views.View#ready - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Pause the View and its Components. - * Pausing locks/unlocks the input and applies/removes a black overly to the stage. - * @method jibo.face.views.View#pause - * @param {Boolean} [flag = true] - Flag for pausing or un-pausing this View. - * @param {jibo.face.views.PauseOverlay#PauseOptions} [pauseOptions] - Options defining how the pause executes. - */ - - /** - * FOR OVERRIDE ONLY. DO NOT CALL. - * - * Destroy the view, calls destroy on all child components first. - * @method jibo.face.views.View#destroy - */ - - /** - * Load given asset descriptions. - * Callback executes once requested assets are available within the `View.assets`. - * @method jibo.face.views.View#addAssets - * @param {jibo.face.views~AssetDescriptor|jibo.face.views~AssetDescriptor[]|Object} assets - * The assets to load. - * @param {Function} [callback] - Called when requested asset are available in `View.assets`. - * If there is an error while loading callback is called with err - */ - - /** - * Adds custom `open` and `close` transitions. - * Custom transitions to use when opening or closing from specific view types - * or certain states, such as an empty screen (`View.EMPTY`) or a paused view (`View.PAUSED`). - * @method jibo.face.views.View#addTransition - * @param {string} viewType - Type of view or state. Accepted states include `View.EMPTY` and `View.PAUSED`. - * @param {boolean} openFrom - If `true`, transitions will be used when opening from the given viewType. If `false`, when closing from that type. - * @param {jibo.face.views.View~TransitionHandler | string} [myTransition] - Handler for executing transition or transition type on owning view. - * A Function will be used instead of the `open` or `close` methods, and a string will be the transition type used by the View's `open` or `close` methods. - * @param {jibo.face.views.View~TransitionHandler | string} [theirTransition] - Handler or transition type used by matching view for their transition. - * If the owning view is closing then this will be set as the opening view's transition. - * @param {jibo.face.views~STACK_DIRECTION} [stackDirection] - Specifies the stack direction associated with the transition, - * if undefined does not take stack direction into account - * STACK_DIRECTION.ADD indicates view is being added to stack. - * STACK_DIRECTION.REMOVE indicates view is being removed. - * STACK_DIRECTION.SWAP indicates the views are being swapped and there is no change to the stack size. - */ - - /** - * Method to bubble actions up from Components. - * Actions pass through this method up to the ViewManager. - * By passing actions through the View the View can augment the action, supply additional parameters, etc. - * @method jibo.face.views.View#actionHandler - * @param {jibo.face.views.ActionData} action The action called. Contains string for type of action and data Object - * with any pertinent data dependent on action type. - * @param {jibo.face.views.Component} fromComponent The component that triggered the action (if applicable). - */ - - /** - * Method to pass actions downward to Components. - * Passing actions through parent chain allows parents to interrupt and augment actions. - * @method jibo.face.views.View#actionEnactor - * @param {jibo.face.ActionData} action Contains string for type of action and data Object - * with any pertinent data dependent on action type. - * @return {boolean} Returns true if action is acted on by this View or any of its children. - */ - - /** - * Set up swipe down to close current view, if no other swipe actions were defined. - * This is a standard UX specification for Menus, but may want to be excluded in certain use cases. - * @method jibo.face.views.View#setupSwipeDownToClose - * @protected - */ - - /** - * Apply default values for use by loader. - * @method jibo.face.views.View#setAssetDescriptorDefaults - * @param {jibo.face.views~AssetDescriptor} asset Description of asset. - * @return {jibo.face.views~AssetDescriptor} Description of asset. - * @private - */ - - /** - * Adds asset to load queue if not already loaded or loading. - * @method jibo.face.views.View#addAssetToQueue - * @param {jibo.face.views~AssetDescriptor} asset - Asset to add to queue. - * @returns {boolean} `true` if asset was added to queue. - * @private - */ - - /** - * Remove asset from manifest and `View.assets` and unload from cache. - * NOTE: Use carefully; removing shared assets can have adverse effects. - * @method jibo.face.views.View#removeAsset - * @param {jibo.face.views~AssetDescriptor} asset - Asset to remove. - * @private - */ - - /** - * Remove asset from manifest and `View.assets` and unload from cache. - * NOTE: Use carefully; removing shared assets can have adverse effects. - * @method jibo.face.views.View#removeFromManifest - * @param {jibo.face.views~AssetDescriptor} asset - Asset descriptordescribing asset to remove - * @private - */ - - /** - * Check if given assets exist in `View.assets`. - * @method jibo.face.views.View#checkForAssets - * @param {jibo.face.views~AssetDescriptor|jibo.face.views~AssetDescriptor[]|Object} assets - * The assets to check. - * @returns {boolean} `true` if all assets were found in `View.assets`. - * @private - */ - - /** - * Remove assets from manifest and unload tokens if they do not exist in `View.assets`. - * @method jibo.face.views.View#removeMissingAssets - * @param {jibo.face.views~AssetDescriptor|jibo.face.views~AssetDescriptor[]|Object} assets - * The assets to check. - * @private - */ - - /** - * Play sound, considering the View's sound set. - * @method jibo.face.views.View#playSound - * @param {string} soundType - Kind of sound to use ('button', 'enter', 'exit'). - * Combined with with View's soundSet to create sound id, for example the skill button sound id is 'skill_button'. - * @private - */ \ No newline at end of file diff --git a/docs/rendering/input/GestureManager.js b/docs/rendering/input/GestureManager.js deleted file mode 100644 index ab79b51a..00000000 --- a/docs/rendering/input/GestureManager.js +++ /dev/null @@ -1,194 +0,0 @@ -/** - * @description - * A wrapper around HammerJS to register gesture input events with the PIXI DOM Element. - * @class GestureManager - * @memberof jibo.face - */ - - /** - * Pan gesture event string. - * @type {string} - * @name jibo.face.GestureManager.PAN - * @readOnly - */ - - /** - * Panstart gesture event string. - * @type {string} - * @name jibo.face.GestureManager.PANSTART - * @readOnly - */ - - /** - * Panmove gesture event string. - * @type {string} - * @name jibo.face.GestureManager.PANMOVE - * @readOnly - */ - - /** - * Panend gesture event string. - * @type {string} - * @name jibo.face.GestureManager.PANEND - * @readOnly - */ - - /** - * Pancancel gesture event string. - * @type {string} - * @name jibo.face.GestureManager.PANCANCEL - * @readOnly - */ - - /** - * Panleft gesture event string. - * @type {string} - * @name jibo.face.GestureManager.PANLEFT - * @readOnly - */ - - /** - * Panright gesture event string. - * @type {string} - * @name jibo.face.GestureManager.PANRIGHT - * @readOnly - */ - - /** - * Panup gesture event string. - * @type {string} - * @name jibo.face.GestureManager.PANUP - * @readOnly - */ - - /** - * Pandown gesture event string. - * @type {string} - * @name jibo.face.GestureManager.PANDOWN - * @readOnly - */ - - /** - * Swipe gesture event string. - * @type {string} - * @name jibo.face.GestureManager.SWIPE - * @readOnly - */ - - /** - * Swipeleft gesture event string. - * @type {string} - * @name jibo.face.GestureManager.SWIPELEFT - * @readOnly - */ - - /** - * Swiperight gesture event string. - * @type {string} - * @name jibo.face.GestureManager.SWIPERIGHT - * @readOnly - */ - - /** - * Swipeup gesture event string. - * @type {string} - * @name jibo.face.GestureManager.SWIPEUP - * @readOnly - */ - - /** - * Swipedown gesture event string. - * @type {string} - * @name jibo.face.GestureManager.SWIPEDOWN - * @readOnly - */ - - /** - * Tap gesture event string. - * @type {string} - * @name jibo.face.GestureManager.TAP - * @readOnly - */ - - /** - * Pixi gesture. - * Instance of HammerJS.Manager - * @type {*} - * @name jibo.face.GestureManager#_hammerManager - * @private - */ - - /** - * Create the singleton instance of the GestureManager. - * @method jibo.face.GestureManager.init - * @return {jibo.face.GestureManager} - */ - - /** - * Instantiate a HammerJS Manager object with the PIXI renderer. - * This should be called before a call to addStageGesture. - * @method jibo.face.GestureManager#init - * @param {PIXI.WebGLRenderer} renderer - The pixi renderer object. - */ - - /** - * Get a reference to HammerJS, - * @method jibo.face.GestureManager#hammer - * @return {Object} The HammerJS object. See [hammer's documentation](http://hammerjs.github.io/getting-started/) - * for information on what objects are accessible through this module. - * @readOnly - */ - - /** - * Stop all recognizers. - * @method jibo.face.GestureManager#stop - */ - - /** - * Add a gesture recognized by the PIXI renderer stage DOM element. - * See [hammer's documentation](http://hammerjs.github.io/getting-started/) for specifics on gesture options and hammer api objects. - * @method jibo.face.GestureManager#addStageGesture - * @param {Object} hammerType - This can be retrieved from the jibo.face.gestures.hammer reference. This is the hammer object type to be instantiated to create the gesture. - * eg. ```jibo.face.gestures.hammer.Pan``` - * @param {Object} gestureOptions - This varies between each gesture. This must include an event field (which is of type string, some of which are specified as constants in this class). - * eg. ```event { GestureManager.SWIPE }``` - * @param {Function(Object)} gestureCallback - Upon successful gesture recognition against the supplied displayobject, this callback will be triggered. - * It will have the event parameter supplied from the HammerJS event callback. - * @return {Object | null} The hammer object which was successfully created, or null if it was not successfully created. - * An example in calling this would be: - * ``` - * GestureManager.addStageGesture(pixiDisplayObject, - * jibo.face.gestures.hammer.Swipe, - * { event: blackboard.GestureManager.SWIPELEFT}, - * function(gestureEvent){ - * // Got event! - * }); - * ``` - */ - - /** - * Removes a gesture for Hammer Manager. - * @method jibo.face.GestureManager#removeStateGesture - * @param {any} gestureRecognizer - The gesture to remove. - */ - - /** - * Allows a gesture event to be 'spoofed', useful for testing. - * @method jibo.face.GestureManager#spoofGesture - * @param {String} [gestureEvent = tap] - Type of gesture event to spoof. Defaults to event for a tap. - * @param {Number} [xPos = 0] - The x position of input. - * @param {Number} [yPos = 0] - The y position of input. - */ - - /** - * Allows a gesture event to be 'spoofed' with options provided. - * @method jibo.face.GestureManager#spoofGestureWithOptions - * @param {String} [gestureEvent = tap] - Type of gesture event to spoof. Defaults to event for a tap. - * @param {any} options - Options that HammerJs uses to fire correct event. - */ - - /** - * Spoofs left/right pan gesture on the screen that will trigger list page swiping - * @method jibo.face.GestureManager#spoofFullPanGesture - * @param {Boolean} [panLeft = true] - Type of pan event to spoof. Defaults to left pan. - */ \ No newline at end of file diff --git a/docs/rendering/tasks/ColorAlphaTask.js b/docs/rendering/tasks/ColorAlphaTask.js deleted file mode 100644 index 47ad6ec1..00000000 --- a/docs/rendering/tasks/ColorAlphaTask.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Internal class for loading an image that has been split into an alpha channel image and a - * RGB only color image. - * @class ColorAlphaTask - * @extends jibo.loader.Task - * @memberof jibo.loader - * @private - * @param {Object} asset The data properties. - * @param {String} asset.src The source path to the color image. - * @param {String} asset.alpha The source path to the alpha image. - * @param {Boolean} [asset.cache=false] `true` to cache the result. - * @param {String} [asset.id] ID of asset. - * @param {Function} [asset.complete] The event to call when done. - * @param {Object} [asset.sizes=null] Define if certain sizes are not supported. - */ - - /** - * Tests if task should be run. - * @method jibo.loader.ColorAlphaTask.test - * @static - * @param {Object} asset The asset to check. - * @return {Boolean} `true` if the asset is compatible with this task. - */ - - /** - * Pulled from EaselJS's SpriteSheetUtils. - * Merges the rgb channels of one image with the alpha channel of another. This can be used to - * combine a compressed JPEG image containing color data with a PNG32 monochromatic image - * containing alpha data. With certain types of images (those with detail that lend itself to - * JPEG compression) this can provide significant file size savings versus a single RGBA PNG32. - * This method is very fast (generally on the order of 1-2 ms to run). - * @method jibo.loader.ColorAlphaTask.mergeAlpha - * @static - * @param {Image} rbgImage The image (or canvas) containing the RGB channels to use. - * @param {Image} alphaImage The image (or canvas) containing the alpha channel to use. - * @param {Canvas} [canvas] If specified, this canvas will be used and returned. If not, a new - * canvas will be created. - * @return {Canvas} A canvas with the combined image data. This can be used as a source for a - * texture. - */ - - /** - * The atlas color source path. - * @type {String} - * @name jibo.loader.ColorAlphaTask#src - */ - - /** - * The atlas alpha source path. - * @type {String} - * @name jibo.loader.ColorAlphaTask#alpha - */ - - /** - * Starts the task. - * @method jibo.loader.ColorAlphaTask#start - * @param {jibo.loader.Task~completeCallback} callback Callback when finished. - */ \ No newline at end of file diff --git a/docs/rendering/tasks/CompressedImageTask.js b/docs/rendering/tasks/CompressedImageTask.js deleted file mode 100644 index bbf1e18d..00000000 --- a/docs/rendering/tasks/CompressedImageTask.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Loads an image and sets it up for Pixi to use as a PIXI.Texture. - * @class CompressedImageTask - * @memberof jibo.loader - * @private - * @param {String} asset.src The texture image path. Must end in .dds or .crn - * @param {Boolean} [asset.remote=false] `true` to force a remote download over XMLHttpRequest. - * @param {Number} [asset.timeout=0] Number of milliseconds for remote load to timeout. - * @param {Boolean|String} [asset.cache=false] `true` to cache the result. String to add to a specific cache. - * @param {String} [asset.id] The ID of the task. - * @param {Function} [asset.complete] The callback to call when the load is completed. - */ - - /** - * Tests if an asset should be loaded. - * @method jibo.loader.CompressedImageTask.test - * @static - * @param {Object} asset The asset to test. - * @return {Boolean} `true` if the asset qualifies for this task. - */ - - /** - * The atlas source path. - * @name jibo.loader.CompressedImageTask#src - * @type {String} - */ - - /** - * Starts the load. - * @method jibo.loader.CompressedImageTask#start - * @param {jibo.loader.Task~completeCallback} callback Callback to call when the load is done - */ \ No newline at end of file diff --git a/docs/rendering/tasks/KeysDataTask.js b/docs/rendering/tasks/KeysDataTask.js deleted file mode 100644 index 48b3fc70..00000000 --- a/docs/rendering/tasks/KeysDataTask.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Loads an animation timeline with PixiAnimate. - * @class AnimDataTask - * @memberof jibo.loader - * @private - * @param priority {number} - * @param src {string} - * @param data {any} - * @param root {string} - */ \ No newline at end of file diff --git a/docs/rendering/tasks/KeysTask.js b/docs/rendering/tasks/KeysTask.js deleted file mode 100644 index 37a370c4..00000000 --- a/docs/rendering/tasks/KeysTask.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Loads an animation timeline with PixiAnimate. - * @class KeysTask - * @memberof jibo.loader - * @private - * @param {String} asset.type Must be set to "keys". - * @param {String} [asset.src] The keys file path. - * @param {String} [asset.data] The keys file object. - * @param {String} [assets.root] The root directory of stored keys file. - * @param {Boolean} [asset.cache=false] `true` to cache the result. - * @param {String} [asset.id] The ID of the task. - * @param {Function} [asset.complete] The callback to call when the load is completed. - */ - - /** - * Tests if an asset should be loaded. - * @method jibo.loader.KeysTask.test - * @static - * @param {Object} asset The asset to test. - * @return {Boolean} `true` if the asset qualifies for this task. - */ - - /** - * The timeline source path. - * @name jibo.loader.KeysTask#src - * @type {String} - */ - - /** - * The timeline object. - * @name jibo.loader.KeysTask#data - * @type {String} - */ - - /** - * The root for the project. - * @name jibo.loader.KeysTask#root - * @type {String} - */ - - /** - * Load texture immediate to the GPU. - * @name jibo.loader.KeysTask#upload - * @type {Boolean} - */ - - /** - * Starts the load. - * @method jibo.loader.KeysTask#start - * @param {jibo.loader.Task~completeCallback} callback Callback to call when the load is done - */ \ No newline at end of file diff --git a/docs/rendering/tasks/ShapesTask.js b/docs/rendering/tasks/ShapesTask.js deleted file mode 100644 index 4d0cc915..00000000 --- a/docs/rendering/tasks/ShapesTask.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Loads a shapes manifest file and sets it up for PixiAnimate. - * @class ShapesTask - * @memberof jibo.loader - * @private - * @param {String} asset.type Must be "shapes" to signify that this asset should be parsed - * specifically for PixiAnimate. - * @param {String} [asset.src] The texture image path. - * @param {Boolean} [asset.cache=false] `true` to cache the result. - * @param {String} [asset.id] The ID of the task. - * @param {Function} [asset.complete] The callback to call when the load is completed. - */ - - /** - * Tests if an asset should be loaded. - * @method jibo.loader.ShapesTask.test - * @static - * @param {Object} asset The asset to test. - * @return {Boolean} `true` if the asset qualifies for this task. - */ - - /** - * The atlas source path. - * @name jibo.loader.ShapesTask#src - * @type {String} - */ - - /** - * Starts the load. - * @method jibo.loader.ShapesTask#start - * @param {jibo.loader.Task~completeCallback} callback Callback to call when the load is done. - */ \ No newline at end of file diff --git a/docs/rendering/tasks/SpritesheetTask.js b/docs/rendering/tasks/SpritesheetTask.js deleted file mode 100644 index e1564f8e..00000000 --- a/docs/rendering/tasks/SpritesheetTask.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Loads an JSON atlas and sets it up for Pixi to use as a collectino of PIXI.Texture objects. - * @class SpritesheetTask - * @memberof jibo.loader - * @private - * @param {String} asset.type Must be "spritesheet" to signify that this asset should be parsed - * specifically for Pixi.js. - * @param {String} [asset.src] The JSON atlas path. - * @param {Boolean} [asset.upload=false] `true` to upload the GPU immediate after loading. - * @param {Boolean} [asset.cache=false] `true` to cache the result. - * @param {Number} [asset.timeout=0] Number of milliseconds for remote timeout. - * @param {Boolean} [asset.remote=false] `true` for force remote load. - * @param {String} [asset.id] The ID of the task. - * @param {Function} [asset.complete] The callback to call when the load is completed. - */ - - /** - * Tests if an asset should be loaded. - * @method jibo.loader.SpritesheetTask.test - * @static - * @param {Object} asset The asset to test. - * @return {Boolean} `true` if the asset qualifies for this task. - */ - - /** - * The atlas source path. - * @name jibo.loader.SpritesheetTask#src - * @type {String} - */ - - /** - * `true` if the texture should be uploaded to the GPU immediately. - * @name jibo.loader.SpritesheetTask#upload - * @type {Boolean} - */ - - /** - * Starts the load. - * @method jibo.loader.SpritesheetTask#start - * @param {jibo.loader.Task~completeCallback} callback Callback to call when the load is done - */ \ No newline at end of file diff --git a/docs/rendering/tasks/TextureTask.js b/docs/rendering/tasks/TextureTask.js deleted file mode 100644 index 0c8849e3..00000000 --- a/docs/rendering/tasks/TextureTask.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Loads an image and sets it up for Pixi to use as a PIXI.Texture. - * @class TextureTask - * @memberof jibo.loader - * @private - * @param {String} asset.type Must be "texture" to signify that this asset should be parsed - * specifically for Pixi.js. - * @param {String} [asset.src] The texture image path. - * @param {Boolean} [asset.upload=false] `true` to upload the GPU immediate after loading. - * @param {Boolean} [asset.remote=false] `true` to force a remote download over XMLHttpRequest. - * @param {Number} [asset.timeout=0] Number of milliseconds for remote load to timeout. - * @param {Boolean|String} [asset.cache=false] `true` to cache the result. String to add to a specific cache. - * @param {String} [asset.alpha] The alpha image path, if not using image property. - * @param {String} [asset.id] The ID of the task. - * @param {Function} [asset.complete] The callback to call when the load is completed. - */ - - /** - * Tests if an asset should be loaded. - * @method jibo.loader.TextureTask.test - * @static - * @param {Object} asset The asset to test. - * @return {Boolean} `true` if the asset qualifies for this task. - */ - - /** - * The atlas source path. - * @name jibo.loader.TextureTask#src - * @type {String} - */ - - /** - * The atlas alpha source path. - * @name jibo.loader.TextureTask#alpha - * @type {String} - */ - - /** - * `true` if the texture should be uploaded to the GPU immediately. - * @name jibo.loader.TextureTask#upload - * @type {Boolean} - */ - - /** - * Starts the load. - * @method jibo.loader.TextureTask#start - * @param {jibo.loader.Task~completeCallback} callback Callback to call when the load is done - */ \ No newline at end of file diff --git a/docs/rendering/tasks/TimelineTask.js b/docs/rendering/tasks/TimelineTask.js deleted file mode 100644 index 78da3899..00000000 --- a/docs/rendering/tasks/TimelineTask.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Loads an animation timeline with PixiAnimate. - * @class TimelineTask - * @memberof jibo.loader - * @private - * @param {String} asset.type Must be "texture" to signify that this asset should be parsed - * specifically for Pixi.js. - * @param {String} [asset.src] The texture image path. - * @param {Boolean} [asset.upload=false] Upload the GPU immediate after loading. - * @param {String} [asset.alpha] The alpha image path, if not using image property. - * @param {Boolean} [asset.cache=false] `true` to cache the result. - * @param {String} [asset.id] The ID of the task. - * @param {Function} [asset.complete] The callback to call when the load is completed. - */ - - /** - * Tests if an asset should be loaded. - * @method jibo.loader.TimelineTask.test - * @static - * @param {Object} asset The asset to test. - * @return {Boolean} `true` if the asset qualifies for this task. - */ - - /** - * The timeline source path. - * @name jibo.loader.TimelineTask#src - * @type {String} - */ - - /** - * Texture are uploaded to the GPU immediately. - * @name jibo.loader.TimelineTask#upload - * @type {Boolean} - */ - - /** - * Cause timeline to add an instance on load. - * @name jibo.loader.TimelineTask#instance - * @type {Boolean} - */ - - /** - * Starts the load. - * @method jibo.loader.TimelineTask#start - * @param {jibo.loader.Task~completeCallback} callback Callback to call when the load is done - */ \ No newline at end of file diff --git a/docs/rendering/tween/Tween.js b/docs/rendering/tween/Tween.js deleted file mode 100644 index 435fa9ad..00000000 --- a/docs/rendering/tween/Tween.js +++ /dev/null @@ -1,212 +0,0 @@ -/** - * Abstract Tween base object. - * Uses `ease npm` for all ease functions. - * For ease types, refer to [ease APIs]{@link https://www.npmjs.com/package/eases}. - * @class Tween - * @memberof jibo.face - */ - - /** - * `true` if the tween is to be paused. - * @name jibo.face.Tween#paused - * @type {Boolean} - */ - - /** - * The local lerp value for just this tween. - * @name jibo.face.Tween#_time - * @type {Number} - * @protected - */ - - /** - * Duration in milliseconds. - * @name jibo.face.Tween#_duration - * @type {Number} - * @protected - */ - - /** - * Finished callback - * @name jibo.face.Tween#_complete - * @type {Function} - * @private - */ - - /** - * Flag used to block tween from being manually stopped. - * @name jibo.face.Tween#_inProcess - * @type {Boolean} - * @private - */ - - /** - * the number of milliseconds to delay this tween from playing from the time it was added to the TweenMgr - * @name jibo.face.Tween#_delay - * @type {Number} - * @private - */ - - /** - * Elapsed time in milliseconds - * @name jibo.face.Tween#_elapsed - * @type {Number} - * @private - */ - - /** - * Starting value - * @name jibo.face.Tween#_start - * @type {Object} - * @private - */ - - /** - * Ending value - * @name jibo.face.Tween#_end - * @type {Object} - * @private - */ - - /** - * Ease callback. - * @name jibo.face.Tween#_ease - * @type {Function} - * @private - */ - - /** - * Target for tweening. - * @name jibo.face.Tween#_target - * @type {Object} - * @private - */ - - /** - * Initial the tween. - * @method jibo.face.Tween#init - * @param {*} [target] The thing to tween. - * @param {Object} options Options for tweening. - * @param {Object} [options.to] The values to tween the object to. - * @param {Object} [options.from] The initial values to set the object to. - * @param {String} [options.ease='linear'] The ease function to use. - * @param {int} [options.delay=0] The delay to start. - * @param {int} [options.duration=500] Length of tween, in millseconds. - * @param {Function} [complete] Callback function, if any. - */ - - /** - * Update the tween value. - * @method jibo.face.Tween#reset - * @param {Number} v0 start number - * @param {Number} v1 end number - * @param {Number} t Time - * @private - */ - - /** - * The delay of start of tween in milliseconds. - * @name jibo.face.Tween#delay - * @type {Number} - */ - - /** - * The duration of this tween. - * @name jibo.face.Tween#duration - * @type {Number} - * @readOnly - */ - - /** - * The current time from 0 to 1. - * @name jibo.face.Tween#time - * @type {Number} - * @readOnly - */ - - /** - * The target to tween. - * @name jibo.face.Tween#target - * @type {any} - * @readOnly - */ - - /** - * Flag indicating if tween is in a process that should not be manually stopped. - * @name jibo.face.Tween#inProcess - * @type {Boolean} - * @readOnly - */ - - /** - * Call the finished callback. - * @method jibo.face.Tween#completed - */ - - /** - * Event when tween is completed. - * @event jibo.face.Tween#complete - * @param {*} target The target of tween. - */ - - /** - * Update the tween value. - * @method jibo.face.Tween#update - * @param {Number} elapsed Milliseconds since the last update. - */ - - /** - * Event when tween value has changed. - * @event jibo.face.Tween#change - * @param {*} value The value or values set. - * @param {*} target The target of tween. - */ - - /** - * Assign a collection of properties. - * @method jibo.face.Tween#assign - * @param {Object} values Map of properties to set - * @private - */ - - /** - * Assign a specific property and value to the target. - * @method jibo.face.Tween#assignValue - * @param {String} prop Property name. - * @param {Number|String} value Value to set. - * @private - */ - - /** - * Update the tween value. - * @method jibo.face.Tween#lerp - * @param {Number} v0 start number - * @param {Number} v1 end number - * @param {Number} t Time - * @private - */ - - /** - * Auto-generate the start key values. - * @method jibo.face.Tween#startDefaults - * @param {Object} to end keys - * @private - * @return {Object} Default start keys - */ - - /** - * Auto-generate the end key values. - * @method jibo.face.Tween#endDefaults - * @param {Object} from start keys - * @private - * @return {Object} Default end keys - */ - - /** - * Check that both objects have the same keys. - * @method jibo.face.Tween#validate - * @private - * @param {Object|Number} obj1 Object 1 to compare - * @param {Object|Number} obj2 Object 2 to compare - * @return {Boolean} `true` if both have the same keys. - */ \ No newline at end of file diff --git a/docs/rendering/tween/TweenManager.js b/docs/rendering/tween/TweenManager.js deleted file mode 100644 index 23c34a8b..00000000 --- a/docs/rendering/tween/TweenManager.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Manage the tweens. - * Uses `ease npm` for all ease functions. - * For ease types, refer to [ease APIs]{@link https://www.npmjs.com/package/eases}. - * @class TweenManager - * @memberof jibo.face - */ - - /** - * Collection of tweens. - * @private - * @name jibo.face.TweenManager._tweens - * @type {Array} - */ - - /** - * Collection of tweens to pool (recycle). - * @private - * @name jibo.face.TweenManager._tweens - * @type {Array} - */ - - /** - * Add a tween to play. - * @method jibo.face.TweenManager.play - * @param {Object} target The object to tween. - * @param {Object} options Options for tweening. - * @param {Object} options.to The values to tween the object to. - * @param {Object} [options.from] The initial values to set the object to. - * @param {String} [options.ease='linear'] The ease function to use. - * @param {int} [options.delay=0] The delay to start. - * @param {int} [options.duration=500] Length of tween, in millseconds. - * @param {Function} [complete] Function callback wehen completed - * @return {jibo.face.Tween} Instance of new tween. - */ - - /** - * Play a set of tweens. - * @method jibo.face.TweenManager.playSet - * @param {Array} targets The list of items to tween. - * @param {Object} options Options for tweening. - * @param {Number} options.to The value to tween to. - * @param {Number} [options.from=0] The initial value to tween. - * @param {String} [options.ease='linear'] The ease function to use. - * @param {int} [options.delay=0] The delay to start. - * @param {int} [options.duration=500] Length of tween, in millseconds. - * @param {Object|Function} [setOptions] Either the set options for complete function - * @param {Number} [setOptions.focus=0] Index to lead with if `setOptions.delay` is set. - * @param {Boolean} [setOptions.focusIsLast=false] `true` if `setOptions.focus` is first in. - * @param {Number} [setOptions.delay=0] Milliseconds delay between items. - * @param {Function} [setOptions.complete] Function callback wehen completed - * @param {Boolean} [setOptions.completeOnFirst=false] If 'true' fires callback after first tween completes, if `false` fires after all tween complete - */ - - /** - * Stop a tween by target or stop all tweens. - * @method jibo.face.TweenManager.stop - * @param {Object} [target] The tween target, if non is specified, all tweens removed. - * @return {Boolean} If the tween was deleted. - */ - - /** - * Stop all tweens whose targets return true against provided method. - * @method jibo.face.TweenManager.stopCheck - * @param {Function} check - Function must take a tween target and return a boolean, - * passing an additional Object to test against is optional. - * @param {any} [against] - Object to test against in check method. - */ - - /** - * Pause or resume all tweens. - * @name jibo.face.TweenManager.paused - * @type {Boolean} - */ - - /** - * Update the tweens. - * @method jibo.face.TweenManager.update - * @param {int} elapsed Time elapsed in Milliseconds since the last update. - */ - - /** - * Recycle the tween. - * @method jibo.face.TweenManager._pool - * @private - * @param {jibo.face.Tween} tween Tween to re-pool - */ - - /** - * Recycle the tween. - * @method jibo.face.TweenManager._create - * @private - * @return {jibo.face.Tween} Tween to use - */ \ No newline at end of file diff --git a/docs/services/SessionManager.js b/docs/services/SessionManager.js deleted file mode 100644 index 076a3fa8..00000000 --- a/docs/services/SessionManager.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @class SessionManager - * @memberof jibo.services - * @private - */ \ No newline at end of file diff --git a/docs/services/events/GlobalEvent.js b/docs/services/events/GlobalEvent.js deleted file mode 100644 index c1da1ad9..00000000 --- a/docs/services/events/GlobalEvent.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @description Interface for an event handler function - * @interface jibo.globalEvents.GlobalEvent~Handler - * @prop [data] Type - */ - -/** - * @class GlobalEvent - * @description Typed global event for globalEvents module (`jibo.globalEvents`). - * In addition to subscribing to events, allows a special meta-subscribe - * event which fires whenever a listener is added and when the last listener - * is removed. - * ``` - * event = new GlobalEvent('name'); - * function handler = (data) => { - * // data is of type asrResult - * // the ASR service has finished listening a cloud result - * // and all subscribed listeners will be removed - * } - * event.on(handler); - * // special meta-events like... - * event.onNoListeners( () => { - * // no listeners are subscribed to this event - * }); - * // When finished with event listening - * event.removeLastListener(); - * ``` - * @memberof jibo.globalEvents - */ - - /** - * Subscribes a handler for once no other listeners are subscribed. - * @method jibo.globalEvents.GlobalEvent#onNoListeners - * @return {jibo.globalEvents.GlobalEvent} This - */ - - /** - * Emit that we have no subscribed listeners to all handlers. - * @method jibo.globalEvents.GlobalEvent#emitNoListeners - */ - - /** - * Subscribes a handler for every time another listener subscribes. - * @method jibo.globalEvents.GlobalEvent#onAddedListener - * @return {jibo.globalEvents.GlobalEvent} This. - */ - - /** - * Emit that we added a subscriber to the typed event. - * @method jibo.globalEvents.GlobalEvent#emitAddListener - */ - - /** - * Subscribes a handler function to this event (same as `addListener`) - * @method jibo.globalEvents.GlobalEvent#on - * @return {jibo.globalEvents.GlobalEvent} This. - */ - - /** - * Subscribes a handler function to only the next event - * @method jibo.globalEvents.GlobalEvent#once - * @return {jibo.globalEvents.GlobalEvent} This. - */ - - /** - * Subscribes a handler function to this event (same as `on`) - * @method jibo.globalEvents.GlobalEvent#addListener - * @return {jibo.globalEvents.GlobalEvent} This. - */ - - /** - * Unsubscribes a handler function from this event - * @method jibo.globalEvents.GlobalEvent#removeListener - * @param {jibo.globalEvents.GlobalEvent~Handler} handler Handler to unsubscribe. - * @return {jibo.globalEvents.GlobalEvent} This. - */ - - /** - * Unsubscribes a handler function from this event (alias removeListener) - * @method jibo.globalEvents.GlobalEvent#off - * @param {jibo.globalEvents.GlobalEvent~Handler} handler Handler to unsubscribe. - * @return {jibo.globalEvents.GlobalEvent} This. - */ - - /** - * Unsubscribes all handler functions from this event - * @method jibo.globalEvents.GlobalEvent#removeAllListeners - * @return {jibo.globalEvents.GlobalEvent} This. - */ - - /** - * Unsubscribes oldest added subscriber - * @method jibo.globalEvents.GlobalEvent#removeFirstListener - * @return {jibo.globalEvents.GlobalEvent} This. - */ - - /** - * Unsubscribes most recently added subscriber - * @method jibo.globalEvents.GlobalEvent#removeLastListener - * @return {jibo.globalEvents.GlobalEvent} This. - */ \ No newline at end of file diff --git a/docs/services/events/GlobalEvents.js b/docs/services/events/GlobalEvents.js deleted file mode 100644 index f3cf2d32..00000000 --- a/docs/services/events/GlobalEvents.js +++ /dev/null @@ -1,129 +0,0 @@ - /** - * Set of names of all events that globalEvents currently has - * subscribed handlers for - * @name jibo.globalEvents#eventsWithHandlers - * @type {Set} - */ - - /** - * Received any global event - * @name jibo.globalEvents#global - * @type {TypedEvent} - */ - - /** - * Global voice stop command received - * @name jibo.globalEvents#voiceStop - * @type {jibo.globalEvents.GlobalEvent} - */ - - /** - * Received global help command - * @name jibo.globalEvents#help - * @type {jibo.globalEvents.GlobalEvent} - */ - - /** - * Received global sleep command - * @name jibo.globalEvents#sleep - * @type {jibo.globalEvents.GlobalEvent} - */ - - /** - * Received global pause command - * @name jibo.globalEvents#pause - * @type {jibo.globalEvents.GlobalEvent} - */ - - /** - * Received global volume command - * @name jibo.globalEvents#volume - * @type {jibo.globalEvents.GlobalEvent} - */ - - /** - * Received global whatCanIDo - * @name jibo.globalEvents#whatCanIDo - * @type {jibo.globalEvents.GlobalEvent} - */ - - /** - * Received global holdOn - * @name jibo.globalEvents#holdOn - * @type {jibo.globalEvents.GlobalEvent} - */ - - /** - * Received global overHere - * @name jibo.globalEvents#overHere - * @type {jibo.globalEvents.GlobalEvent} - */ - - /** - * Received global skill launch - * @name jibo.globalEvents#skillLaunch - * @type {Event} - */ - - /** - * Received global skill relaunch - * @name jibo.globalEvents#skillRelaunch - * @type {Event} - */ - - /** - * Received global touchStop event. - * WARNING: this refers to the global `touchStop` event, which is - * otherwise used to stop Jibo. If you want to listen for the - * touch event but NOT clobber the stop behavior, please - * refer to {@link jibo.system.SystemEvents#touchOn}. - * @name jibo.globalEvents#touchStop - * @type {jibo.globalEvents.GlobalEvent} - */ - - /** - * Global events that are shared - anyone can listen and not interfere with other listeners. - * @name jibo.globalEvents#shared - * @type {jibo.globalEvents.shared} - */ - - /** - * Announce to the skills service manager (SSM) if we can handle a specific global command. - * @param {string} action Global action for the SSM to recognize. - * @param {boolean} canHandle `true` if the `jibo` module can handle the global comand. - * @method jibo.globalEvents#announceGlobalHandler - */ - - /** - * We got a message from WS - * @param {any} data Data from websocket message. - * @method jibo.globalEvents~onMessage - * @private - */ - - /** - * We got a message from WS - * @param {WSResponse} data Data from websocket message. - * @method jibo.globalEvents~onGlobal - * @private - */ - - /** - * Called when ws with message 'skill-relaunch' is received. - * @param {any} data JSON Data received from websocket. - * @method jibo.globalEvents#onSkillRelaunch - * @private - */ - - /** - * Called when ws with message 'skill-launch' is received. - * @param {any} data JSON Data received from websocket. - * @method jibo.globalEvents#onSkillRelaunch - * @private - */ - - /** - * Initialize the touch listener. - * @method jibo.globalEvents~_initializeTouchListener - * @private - */ \ No newline at end of file diff --git a/docs/services/events/SharedGlobalEvents.js b/docs/services/events/SharedGlobalEvents.js deleted file mode 100644 index 48e4934e..00000000 --- a/docs/services/events/SharedGlobalEvents.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Namespace for global events that are shared so that - * anyone can listen and not interfere with other listeners. - * @namespace jibo.globalEvents.shared - */ - - /** - * Received only a `hey jibo` - * @name jibo.globalEvents.shared#hjOnly - * @type {TypedEvent} - */ - - /** - * Parsed against global grammar and no result. - * @name jibo.globalEvents.shared#noGlobalMatch - * @type {TypedEvent} - */ - - /** - * A non-interrupting global command (like volume setting) was heard and handled. This should - * be emitted by global handlers after something like changing the volume, or answering "No" to - * a question of "Are you sure you want to quit" - * @name jibo.globalEvents.shared#nonInterruptingGlobal - * @type {TypedEvent} - */ - - /** - * Received whenever the touch manger registers a screen gesture - * @name jibo.globalEvents.shared#screenGesture - * @type {TypedEvent} - */ - - /** - * @private - */ \ No newline at end of file diff --git a/docs/services/events/index.js b/docs/services/events/index.js deleted file mode 100644 index 4b04b8c9..00000000 --- a/docs/services/events/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @description Typed global events for events module (`jibo.globalEvents`). - * Only emits event to LAST subscriber. - * Also emits when a subscriber is added to a particular event AND - * when all subscribers have been removed from particular event (no handlers - * are registered for that event). - * ``` - * function handler = (data) => { - * // data is of type asrResult - * // the ASR service has finished listening a cloud result - * // and all subscribed listeners will be removed - * } - * jibo.globalEvents.touchOn.on(handler); - * // When finished with event listening - * jibo.globalEvents.touchOn.removeLastListener(); - * // or - * jibo.globalEvents.touchOn.removeListener(handler); - * ``` - * @namespace jibo.globalEvents - */ \ No newline at end of file diff --git a/docs/services/index.js b/docs/services/index.js deleted file mode 100644 index 2dfa046d..00000000 --- a/docs/services/index.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * List of robot services for speech, language processing, etc. - * @namespace jibo.services - * @private - */ \ No newline at end of file diff --git a/docs/services/media/Media.js b/docs/services/media/Media.js deleted file mode 100644 index 31a589e5..00000000 --- a/docs/services/media/Media.js +++ /dev/null @@ -1,198 +0,0 @@ -/** - * @typedef jibo.media#ThumbnailType - * @description Enum of thumbnail types - * @property thumb {any} Mobile - * @property thumb_robot {any} Robot - */ - -/** Callback for {@link jibo.media#takePhoto}. - * - * ``` - * jibo.media.takePhoto((err, data) => { - * if(!err) { - * let img = new Image(); - * img.src = data.url; - * } - * else { - * console.error(err); - * } - * }); - * ``` - * - * @callback jibo.media~TakePhotoCallback - * @param [error] {Error|null} An error object if there was an error, or `null`. - * @param data {object} Data about the photo. - * @param data.id {string} Content ID of temporary in-memory preview photo. - * @param data.url {string} URL to retreive temporary in-memory preview photo. - */ - -/** Callback for {@link jibo.media#storePhoto}. - * - * @callback jibo.media~StorePhotoCallback - * @param [error] {Error} error `null` if there is no error. - * @param [result] {object} The object's keys correspond to the - * thumbnail keys provided in the `thumbnails` argument of - * `storePhoto`. Values are the photo id as assigned by the media - * service. Use `getPhoto` to retrieve the PIXI.Texture that - * corresponds to this photo, or `getUrl` to get the url as served by - * the media service. - */ - -/** Media API - jibo.media - * - * ``` - * let params = {camera: jibo.media.CameraID.LEFT}; - * jibo.media.takePhoto(params, (err, data) => { - * jibo.loader.load({src: data.url, format: 'binary'}, (error, buffer) => { - * jibo.media.storePhoto( - * buffer, - * (error, result) => { - * let thumbnailId = result.thumbnails[jibo.media.ThumbnailType.thumb_robot]; - * jibo.media.getPhoto(thumbnailId, (err, pixiTexture) => { - * const s = new PIXI.Sprite(); - * s.texture = pixiTexture; - * jibo.face.stage.addChild(s); - * }) - * }); - * }); - * }); - * - * ``` - * You can use Promises instead of callbacks by simply omitting the callback. - * ``` - * let params = {photoType: jibo.media.CameraID.PREVIEW}; - * jibo.media.takePhoto(params) - * .then( (data) => { - * return jibo.media.storePhoto(data.id); - * }) - * .then( (result) => { - * let thumbnailId = result.thumbnails[jibo.media.ThumbnailType.thumb_robot]; - * return jibo.media.getPhoto(thumbnailId); - * .then( (pixiTexture) => { - * const s = new PIXI.Sprite(); - * s.texture = pixiTexture; - * jibo.face.stage.addChild(s); - * }); - * }); - * ``` - * - * @namespace jibo.media - */ - - /** Take a photo. Returns data about photo including the content - * id and url to the temporary in-memory copy of the photo. - * - * @method jibo.media#takePhoto - * @param [params] {object} Optional parameters object. - * @param [params.camera=jibo.media.CameraID.RIGHT] {jibo.media#CameraID} - * Which camera to use, left or right. - * @param [params.photoType=jibo.media.PhotoType.FULL] {jibo.media#PhotoType} - * Size/type of photo to take. - * @param [params.undistort=true] {boolean} Undistort (flatten) - * the photo. If `false` image will have fish-eye distortion. - * @param [params.flip=true] {boolean} Flip (mirror) the photo. - * If `false` image will not be flipped. - * @param [params.colorCorrection=true] {boolean} Apply a default - * set of filters to the photo (brightness, contrast, vibrance, - * hue, saturation and RGB curve) to give it a more natural - * appearence. - * @param [params.filters] {jibo.media~Filter[]} List of filters - * to apply to the image in order. Embedding in an array is - * optional if only one filter is specified. - * @param [callback] {jibo.media~TakePhotoCallback} Called with an - * error, or with data about the photo including the content ID - * (`data.id`). If callback is omitted a promise is returned - * instead. - * @returns {Promise} A promise that resolves when the operation is - * finished. - */ - - /** Save a temporary in-memory photo via the content id returned - * from `takePhoto`, or via a buffer object. Photo will be saved - * locally to disk and in the cloud. Default thumbnails (`thumb` - * for mobile, and `thumb_robot` for Jibo) will be generated and - * also saved. The KB media list `jibo.kb.media` will also be - * updated. Data including the content id and url is provided. - * - * @method jibo.media#storePhoto - * @param [id] {string} Content id of in-memory recently taken - * photo to be stored. Can also be specified via `params.id`. - * @param [buffer] {Buffer} Instead of providing an id, an image - * in a buffer object to store. Can also be specified via - * `params.buffer`. - * @param [params] {object} Optional parameters object. - * @param [params.id] {string} Content id of in-memory recently taken photo to be stored. - * @param [params.buffer] {Buffer} An image in a buffer object to be stored. - * @param [callback] {jibo.media~StorePhotoCallback} Called when - * photos are stored. If callback is omitted a promise is returned - * instead. - * @returns {Promise} A promise that resolves when the operation is - * finished. - */ - - /** Delete a photo from the local image store and from the cloud. - * - * @method jibo.media#deletePhoto - * @param id {string} Content ID of photo to delete. - * @param [callback] {function} Called with err object if there - * was an error. If callback is omitted a promise is returned instead. - * @returns {Promise} A promise that resolves when the operation is - * finished. - */ - - /** Retrieve the PIXI.Texture that corresponds to the specified photo. - * - * @method jibo.media#getPhoto - * @param id {string} The photo ID to retrieve the texture for. - * @param [callback] {function} Node style callback that returns a - * `PIXI.Texture`. If callback is omitted a promise is returned - * instead. - * @returns {Promise} A promise that resolves when the operation - * is finished. - */ - - /** Get a URL given a photo ID. - * - * @method jibo.media#getUrl - * @param id {string} Content ID of the photo. - * @returns {string} URL to the photo. - */ - - /** Get the preview URL of a recently taken - * in-memory photo that hasn't been stored yet. - * - * @method jibo.media#getPreviewUrl - * @param id {string} Content ID of the photo. - * @returns {string} URL to the photo. - */ - - /** Set up a viewfinder in a window with camera preview positioned - * at a given location on-screen. - * - * @method jibo.media#setViewfinder - * @param [enable=false] {boolean} Show (enable) or hide - * viewfinder. Can also be specified via `params.enable`. - * @param [params] {object} Optional parameters object. - * @param [params.enable=false] {boolean} Show (enable) or hide - * viewfinder. - * @param [params.width=1280] {number} Width of the viewfinder in pixels. - * @param [params.height=720] {number} Height of the viewfinder in pixels. - * @param [params.x=0] {number} X-coordinate for placing the viewfinder. In pixels. - * @param [params.y=0] {number} Y-coordinate for placing the viewfinder. In pixels. - * @param [params.camera=1] {number} Camera to use. 0=Left, 1=Right. - * @param [callback] {function} Callback for the method. If callback - * is omitted a promise is returned instead. - * @returns {Promise} A promise that resolves when the - * operation is finished. - */ - - /** Get the current state of the viewfinder preview window. - * - * @method jibo.media#getViewfinder - * @param [callback] {function} Callback for the function that - * returns an error, or if request is successful returns object - * with timestamp, enable, and window. If callback is omitted a - * promise is returned instead. - * @returns {Promise} A promise that resolves when the - * operation is finished. - */ \ No newline at end of file diff --git a/docs/services/media/MediaModel.js b/docs/services/media/MediaModel.js deleted file mode 100644 index 8cfaa8f4..00000000 --- a/docs/services/media/MediaModel.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * KB Media APIs - * @namespace jibo.kb.media - */ - -/** MediaModel Class. The Media Model subclass - * - * @example - * jibo.kb.media#loadMedia( (err, media) => console.log(media) ); - * @class MediaModel - * @extends jibo.kb.Model - * @memberof jibo.kb.media - */ - - /** Create an Error with a good message from an AxiosError object - * - * @method jibo.kb.media.MediaModel#_processError - * @param {AxiosError} err Axios error object. - * @returns {Error} Error object. - * @private - */ - - /** Load media nodes in the media list. Deleted media nodes are - * excluded. If callback is omitted a promise is returned instead. - * - * @method jibo.kb.media.MediaModel#loadMedia - * @param {Function} [callback] Called with (err, media). If callback - * is omitted a promise that resolves to `media` is returned - * instead. - * @returns {Promise} A promise that resolves with the list of - * media nodes if the callback is omitted. - */ - - /** Load all media nodes, including deleted ones. - * - * @method jibo.kb.media.MediaModel#loadMediaAll - * @param {Function} [callback] Called with (err, media). If callback - * is omitted a promise that resolves to `media` is returned - * instead. - * @returns {Promise} A promise that resolves with the list of - * media nodes if the callback is omitted. - */ - - /** Load the node for the thumbnail for a given media item node. - * @method jibo.kb.media.MediaModel#loadThumbnail - * @param {jibo.kb.media.MediaNode} mediaNode The media node you want the thumbnail to. - * @param {jibo.media#ThumbnailType} [type=thumb_robot] Type of thumbnail. - * @param {function} callback Called with the media node for the - * thumbnail, or `undefined` if there is no thumbnail of that - * type. - */ - - /** Get the url for the thumbnail for a given media item node. - * @method jibo.kb.media.MediaModel#getThumbnailUrl - * @param {jibo.kb.media.MediaNode} mediaNode The media node you want the thumbnail to. - * @param {jibo.media#ThumbnailType} [type=thumb_robot] Type of thumbnail. - * @returns {string} Url for the thumbnail of that type, if any, - * `undefined` otherwise. - */ - - /** Download a list of thumbnails to the local image store. - * - * @method jibo.kb.media.MediaModel#downloadThumbnails - * @param {string[]} ids Array of thumnails Content IDs to download. - * @param {Function} [callback] Called with err object if there - * was an error. If callback is omitted a promise is returned instead. - * @returns {Promise} A promise that resolves when the operation is - * finished. - * @private - */ - - /** Download a photo to the local image store. - * - * @method jibo.kb.media.MediaModel#downloadPhoto - * @param {string} id Content ID of photo to download. - * @param {Function} [callback] Called with err object if there - * was an error. If callback is omitted a promise is returned instead. - * @returns {Promise} A promise that resolves when the operation is - * finished. - * @private - */ - - /** Filter out media items that have been deleted. - * - * @method jibo.kb.media.MediaModel#_onlyNotDeleted - * @param {jibo.kb.media.MediaNode[]} media Media nodes to filter. - * @returns {jibo.kb.media.MediaNode[]} Media nodes where `isDeleted` is - * `false`. - * @private - */ \ No newline at end of file diff --git a/docs/services/media/MediaModelEvents.js b/docs/services/media/MediaModelEvents.js deleted file mode 100644 index 4447b4ed..00000000 --- a/docs/services/media/MediaModelEvents.js +++ /dev/null @@ -1,6 +0,0 @@ - /** - * Event emitted whenever the media list has been updated (including on - * mobile devices) - * @name jibo.kb.media.MediaModelEvents#mediaListChanged - * @type {Event} - */ \ No newline at end of file diff --git a/docs/services/media/MediaNode.js b/docs/services/media/MediaNode.js deleted file mode 100644 index b782dde4..00000000 --- a/docs/services/media/MediaNode.js +++ /dev/null @@ -1,32 +0,0 @@ -/** Specific type of node for media. All nodes returned by {@link jibo.kb.media.MediaModel} - * will be MediaNodes. - * - * @class MediaNode - * @extends jibo.kb.Node - * @memberof jibo.kb.media - */ - - /** UUID of the media. - * - * @name jibo.kb.media.MediaNode#id - * @type {String} - */ - - /** The loopId this media belongs to. - * - * @name jibo.kb.media.MediaNode#loopId - * @type {String} - */ - - /** The url that points to the actual media content. - * - * @name jibo.kb.media.MediaNode#url - * @type {String} - */ - - /** Get the content ID of the thumbnail for this media item. - * @method jibo.kb.media.MediaNode#getThumbnailId - * @param {jibo.media#ThumbnailType} [type=thumb_robot] Type of thumbnail. - * @returns {string} Content ID of the thumbnail, if any, - * `undefined` otherwise. - */ \ No newline at end of file diff --git a/docs/services/remote/RemoteService.js b/docs/services/remote/RemoteService.js deleted file mode 100644 index b9017736..00000000 --- a/docs/services/remote/RemoteService.js +++ /dev/null @@ -1,42 +0,0 @@ - /** - * Initialize websocket to remote service in ssm - * @param {Service} service - * @param {Function} any - */ - - /** - * Request a command library connector - * @return {CommandConnector} connector used to communicate with command library - */ - - /** - * Call to when remote connection user is ready for session to start - * In the case of remote skill ready will be called once remote intro MIM completes - */ - - /** - * Force disconnect of remote connection from command library - * @param {JIBO.v1.DisconnectCodes.DisconnectCodeType} [code = DisconnectCode.RobotError] - */ - - /** - * Send video message to remote socket - * @param {string} assetUrl - * @param {string} videoType - */ - - /** - * Send photo message to remote socket - * @param {string} assetUrl - * @param {string} photoUrl - */ - - /** - * Send message to remote socket to cancel asset - * @param assetUrl - */ - - /** - * Handler for messages received from remote web socket - * @param {string} message - */ \ No newline at end of file diff --git a/docs/sound/ChainBuilder.js b/docs/sound/ChainBuilder.js deleted file mode 100644 index d0f1476b..00000000 --- a/docs/sound/ChainBuilder.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @class ChainBuilder - * @private - * @param {AudioContext} audioContext The audio context. - */ - - /** - * Cleans up. - * @method ChainBuilder#destroy - */ - - /** - * Gets the nodes. - * @method ChainBuilder#nodes - * @return {Object} - */ - - /** - * Gets the first node. - * @method ChainBuilder#first - * @return {Object} - */ - - /** - * Gets the last node. - * @method ChainBuilder#last - * @return {Object} - */ - - /** - * Adds a node to the chain. - * @method ChainBuilder#_addNode - * @private - * @param {*} node - * @param {*} properties - */ - - /** - * Clones the bufferSource. Used just before playing a sound. - * @method ChainBuilder#cloneBufferSource - * @returns {AudioBufferSourceNode} The clone AudioBufferSourceNode. - */ - - /** - * Adds a bufferSource. - * @method ChainBuilder#bufferSrouce - * @param {Object} [properties] Properties to set in the created node. - */ - - /** - * Adds a createMediaStreamSource. - * @method ChainBuilder#mediaStreamSource - * @param {Object} [properties] Properties to set in the created node. - */ - - /** - * Adds a createMediaElementSource. - * @method ChainBuilder#mediaElementSource - * @param {HTMLElement} element The element to add. - * @param {Object} [properties] Properties to set in the created node. - */ - - /** - * Adds a panner. - * @method ChainBuilder#panner - * @param {Object} [properties] Properties to set in the created node. - */ - - /** - * Adds an analyser. - * @method ChainBuilder#analyser - * @param {Object} [properties] Properties to set in the created node. - */ - - /** - * Adds a gainNode. - * @method ChainBuilder#gainNode - * @param {Object} [properties] Properties to set in the created node. - */ \ No newline at end of file diff --git a/docs/sound/Sound.js b/docs/sound/Sound.js deleted file mode 100644 index 97eeaf24..00000000 --- a/docs/sound/Sound.js +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Callback when sound is loaded. - * @callback jibo.sound.Sound~loadedCallback - * @param {Error} err The callback error. - * @param {jibo.sound.Sound} sound The instance of new sound. - */ - -/** - * Callback when sound is completed. - * @callback jibo.sound.Sound~completeCallback - * @param {jibo.sound.Sound} sound The instance of sound. - */ - -/** - * Represents a single sound element. Can be used to play, pause, etc. sound instances. - * - * @class Sound - * @memberof jibo.sound - * @param {jibo.sound.SoundContext} [context] The context. - * @param {ArrayBuffer|String|Object} options Either the path or url to the source file. - * or the object of options to use. - * @param {ArrayBuffer|String} [options.src] If `options` is an object, the source of file. - * @param {Boolean} [options.autoPlay=false] true to play after loading. - * @param {Boolean} [options.preload=false] true to immediately start preloading. - * @param {Boolean} [options.block=false] true to only play one instance of the sound at a time. - * @param {Number} [options.volume=1] The amount of volume 1 = 100%. - * @param {Boolean} [options.useXHR=false] true to use XMLHttpRequest to load the sound. Default is false, loaded with NodeJS's `fs` module. - * @param {Number} [options.panning=0] The panning amount from -1 (left) to 1 (right). - * @param {jibo.sound.Sound~completeCallback} [options.complete=null] Global complete callback when play is finished. - * @param {jibo.sound.Sound~loadedCallback} [options.loaded=null] Call when finished loading. - * @param {Boolean} [options.loop=false] true to loop the audio playback. - */ - - /** - * Reference to the sound context. - * @name jibo.sound.Sound#_context - * @type {SoundContext} - * @private - */ - - /** - * Reference to the WebAudio API AudioContext. - * @name jibo.sound.Sound#_ctx - * @type {AudioContext} - * @private - */ - - /** - * Instance of the chain builder. - * @name jibo.sound.Sound#_chain - * @type {ChainBuilder} - * @private - */ - - /** - * `true` if the buffer is loaded. - * @name jibo.sound.Sound#isLoaded - * @type {Boolean} - * @default false - */ - - /** - * `true` if the sound is currently being played. - * @name jibo.sound.Sound#isPlaying - * @type {Boolean} - * @default false - * @readOnly - */ - - /** - * true to start playing immediate after load. - * @name jibo.sound.Sound#autoPlay - * @type {Boolean} - * @private - * @default false - * @readOnly - */ - - /** - * `true` to block successive plays. - * @name jibo.sound.Sound#block - * @type {Boolean} - * @default false - */ - - /** - * `true` to immediately start preloading. - * @name jibo.sound.Sound#preload - * @type {Boolean} - * @default false - * @readOnly - */ - - /** - * Callback when finished playing. - * @name jibo.sound.Sound#complete - * @type {jibo.sound.Sound~completeCallback} - * @default false - */ - - /** - * Callback when load is finished. - * @type {jibo.sound.Sound~loadedCallback} - * @name jibo.sound.Sound#loaded - * @readOnly - */ - - /** - * The file source to load. - * @name jibo.sound.Sound#src - * @type {String} - * @readOnly - */ - - /** - * The file buffer to load. - * @name jibo.sound.Sound#srcBuffer - * @type {ArrayBuffer} - * @readOnly - */ - - /** - * `true` to use XMLHttpRequest object to load. - * Default is to use NodeJS's fs module to read the sound. - * @name jibo.sound.Sound#useXHR - * @type {Boolean} - * @default false - */ - - /** - * The collection of instances being played. - * @name jibo.sound.Sound#_instances - * @type {Array} - * @private - */ - - /** - * Starts the preloading of sound. - * @method jibo.sound.Sound#_beginPreload - * @private - */ - - /** - * Destructor, safer to use `SoundPlugin.remove(alias)` to remove this sound. - * @private - * @method jibo.sound.Sound#destroy - */ - - /** - * Getter of the chain nodes. - * @name jibo.sound.Sound#nodes - * @type {Object} - * @private - * @readOnly - */ - - /** - * Gets and sets the volume. - * @name jibo.sound.Sound#volume - * @type {Number} - */ - - /** - * Gets and sets the looping. - * @name jibo.sound.Sound#loop - * @type {Boolean} - */ - - /** - * Gets and sets the buffer. - * @name jibo.sound.Sound#buffer - * @type {AudioBuffer} - */ - - /** - * Gets and sets the panning -1 (full left pan) and 1 (full right pan). - * @name jibo.sound.Sound#panning - * @type {Number} - * @default 0 - */ - - /** - * Gets the list of instances that are currently being played of this sound. - * @name jibo.sound.Sound#instances - * @type {Array} - * @readOnly - */ - - /** - * Plays the sound. - * @method jibo.sound.Sound#play - * @param {jibo.sound.Sound~completeCallback|object} options Either completed function or play options. - * @param {Number} [options.offset=0] time when to play the sound. - * @param {jibo.sound.Sound~completeCallback} [options.complete] Callback when complete. - * @param {jibo.sound.Sound~loadedCallback} [options.loaded] If the sound isn't already preloaded, callback when - * the audio has completely finished loading and decoded. - * @return {SoundInstance} Current playing instance. - */ - - /** - * Sound instance completed. - * @method jibo.sound.Sound#_onComplete - * @private - * @param {jibo.sound.SoundInstance} instance - */ - - /** - * Stops all the instances of this sound from playing. - * @method jibo.sound.Sound#stop - * @return {jibo.sound.Sound} Instance of this sound. - */ - - /** - * Stops all the instances of this sound from playing. - * @method jibo.sound.Sound#pause - * @return {jibo.sound.Sound} Instance of this sound. - */ - - /** - * Stops all the instances of this sound from playing - * @method jibo.sound.Sound#stop - * @return {jibo.sound.Sound} Instance of this sound. - */ - - /** - * Removes all instances. - * @method jibo.sound.Sound#_removeInstances - * @private - */ - - /** - * Loads a sound using XHMLHttpRequest object. - * @method jibo.sound.Sound#loadUrl - * @private - */ - - /** - * Loads using the file system (NodeJS's fs module). - * @method jibo.sound.Sound#loadPath - * @private - */ - - /** - * Decodes the array buffer. - * @method jibo.sound.Sound#decode - * @param {ArrayBuffer} arrayBuffer From load. - * @private - */ \ No newline at end of file diff --git a/docs/sound/SoundContext.js b/docs/sound/SoundContext.js deleted file mode 100644 index 47341b66..00000000 --- a/docs/sound/SoundContext.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @description Main class to handle webkit audio. - * - * @class SoundContext - * @memberof jibo.sound - */ - - /** - * The instance of the AudioContext for WebAudio API. - * @private - * @property {AudioContext} _ctx - */ - - /** - * The WebAudio API AudioContext object. - * @property {AudioContext} context - * @private - * @name SoundContext#context - * @type {AudioContext} - */ - - /** - * Sets the muted state. - * @type {Boolean} - * @name SoundContext#muted - * @default false - */ - - /** - * Sets the volume from 0 to 1. - * @type {Number} - * @name SoundContext#volume - * @default 1 - */ - - /** - * Pauses all sounds. - * @type {Boolean} - * @name SoundContext#paused - * @default false - */ - - /** - * Returns the entry node in the master node chains. - * @private - */ - - /** - * Toggles the muted state. - * @method SoundContext#toggleMute - * @return {Boolean} The current muted state. - */ \ No newline at end of file diff --git a/docs/sound/SoundInstance.js b/docs/sound/SoundInstance.js deleted file mode 100644 index 924bc222..00000000 --- a/docs/sound/SoundInstance.js +++ /dev/null @@ -1,83 +0,0 @@ - /** - * Recycle instance, because they will be created many times. - * @type {Array} - * @name jibo.sound.SoundInstance._pool - * @static - * @private - */ - - /** - * Recycle instance, because they will be created many times. - * @method jibo.sound.SoundInstance.create - * @static - * @private - */ - - /** - * The source node chain. - * @type {ChainBuilder} - * @name jibo.sound.SoundInstance#_chain - * @private - */ - - /** - * The starting time. - * @type {int} - * @name jibo.sound.SoundInstance#_startTime - * @private - */ - - /** - * true if paused. - * @type {Boolean} - * @name jibo.sound.SoundInstance#_paused - * @private - */ - - /** - * The time in milliseconds to wait. - * @type {int} - * @name jibo.sound.SoundInstance#_currentPosition - * @private - */ - - /** - * Initializes the instance. - * @method jibo.sound.SoundInstance#init - * @private - */ - - /** - * Stops the instance. - * @method jibo.sound.SoundInstance#stop - */ - - /** - * Plays the sound. - * @method jibo.sound.SoundInstance#play - * @param {Number} [offset=0] Number of seconds to offset playing. - */ - - /** - * Pauses the sound. - * @type {Boolean} - * @name jibo.sound.SoundInstance#paused - */ - - /** - * Callback when completed. - * @method jibo.sound.SoundInstance#_onComplete - * @private - */ - - /** - * Don't use after this. - * @method jibo.sound.SoundInstance#destroy - */ - - /** - * To string method for instance. - * @method SoundInstance#toString - * @return {String} The string representation of instance. - * @private - */ \ No newline at end of file diff --git a/docs/sound/SoundPlugin.js b/docs/sound/SoundPlugin.js deleted file mode 100644 index 79e4c183..00000000 --- a/docs/sound/SoundPlugin.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @description Manages the playback of sounds. - * @class SoundLibrary - * @memberof jibo.sound - */ - - /** - * Sets the base path to prepend to all relative sound paths. - * @name jibo.sound#basePath - * @type {String} - */ - - /** - * Sets the base URL to prepend to all remote sound paths. - * @name jibo.sound#baseUrl - * @type {String} - */ - - /** - * The global context to use. - * @name jibo.sound#_context - * @type {jibo.sound.SoundContext} - * @private - */ - - /** - * The map of all sounds by alias. - * @name jibo.sound#_sounds - * @type {Object} - * @private - */ - - /** - * The global context to use. - * @name jibo.sound#context - * @readOnly - * @type {jibo.sound.SoundContext} - * @private - */ - - /** - * Adds a new sound by alias. - * @method jibo.sound#add - * @param {String} alias The sound alias reference. - * @param {ArrayBuffer|String|Object} options Either the path or url to the source file. - * or the object of options to use. - * @param {ArrayBuffer|String} [options.src] If `options` is an object, the source of file. - * @param {Boolean} [options.autoPlay=false] true to play after loading. - * @param {Boolean} [options.preload=false] true to immediately start preloading. - * @param {Boolean} [options.block=false] true to only play one instance of the sound at a time. - * @param {Number} [options.volume=1] The amount of volume 1 = 100%. - * @param {Boolean} [options.useXHR=false] true to use XMLHttpRequest to load the sound. Default is false, loaded with NodeJS's `fs` module. - * @param {Number} [options.panning=0] The panning amount from -1 (left) to 1 (right). - * @param {jibo.sound.Sound~completeCallback} [options.complete=null] Global complete callback when play is finished. - * @param {jibo.sound.Sound~loadedCallback} [options.loaded=null] Call when finished loading. - * @return {jibo.sound.Sound} Instance to the Sound object. - */ - - /** - * Adds multiple sounds. - * @method jibo.sound#addMap - * @param {Object} alias Map of sounds to add, the key is the alias, the value is the - * string, ArrayBuffer or the list of options (see `add` method for options). - * @param {Object|String|ArrayBuffer} globalOptions The default options for all sounds. - * if a property is defined, it will use the local property instead. - * @return {jibo.sound.Sound} Instance to the Sound object. - */ - - /** - * Removes a sound by alias. - * @method jibo.sound#remove - * @param {String} alias The sound alias reference. - * @return {jibo.sound} Instance for chaining. - */ - - /** - * Pauses any playing sounds. - * @method jibo.sound#pauseAll - * @return {jibo.sound} Instance for chaining. - */ - - /** - * Resumes any sounds. - * @method jibo.sound#resumeAll - * @return {jibo.sound} Instance for chaining. - */ - - /** - * Mutes all playing sounds. - * @method jibo.sound#muteAll - * @return {jibo.sound} Instance for chaining. - */ - - /** - * Unmutes all playing sounds. - * @method jibo.sound#unmuteAll - * @return {jibo.sound} Instance for chaining. - */ - - /** - * Stops and removes all sounds. They cannot be used after this. - * @method jibo.sound#removeAll - * @return {jibo.sound} Instance for chaining. - */ - - /** - * Stops all sounds. - * @method jibo.sound#stopAll - * @return {jibo.sound} Instance for chaining. - */ - - /** - * Checks if a sound by alias exists. - * @method jibo.sound#exists - * @param {String} alias Check for alias. - * @return {Boolean} true if the sound exists. - */ - - /** - * Gets a sound. - * @method jibo.sound#sound - * @param {String} alias The sound alias reference. - * @return {jibo.sound.Sound|null} Sound object or `null` if it doew not exist. - */ - - /** - * Plays a sound. - * @method jibo.sound#play - * @param {String} alias The sound alias reference. - * @param {Object|Function} options The options or callback when done. - * @param {Function} [options.complete] When completed. - * @param {Function} [options.loaded] If not already preloaded, callback when finishes load. - * @param {Number} [options.offset=0] Start time offset. - * @return {jibo.sound.SoundInstance|null} The sound instance, this cannot be reused - * after it is done playing. Returns `null` if the sound has not yet loaded. - */ - - /** - * Stops a sound. - * @method jibo.sound#stop - * @param {String} alias The sound alias reference. - * @return {jibo.sound.Sound|null} Sound object or `null` if it does not exist. - */ - - /** - * Pauses a sound. - * @method jibo.sound#pause - * @param {String} alias The sound alias reference. - * @return {jibo.sound.Sound|null} Sound object or `null` if it does not exist. - */ - - /** - * Resumes a sound. - * @method jibo.sound#resume - * @param {String} alias The sound alias reference. - * @return {jibo.sound.Sound|null} Instance for chaining or `null` if it does not exist. - */ - - /** - * Destroys the sound module. - * @method jibo.sound#destroy - * @private - */ \ No newline at end of file diff --git a/docs/sound/SoundUtils.js b/docs/sound/SoundUtils.js deleted file mode 100644 index 45bfa196..00000000 --- a/docs/sound/SoundUtils.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Utilities that work with sounds. - * @class SoundUtils - * @memberof jibo.sound - */ - - /** - * Create a new sound for a sine wave-based tone. - * @method jibo.sound.SoundUtils.sineTone - * @param {jibo.sound.SoundContext} soundContext - * @param {Number} hertz Frequency of sound. - * @param {Number} seconds Duration of sound in seconds. - * @return {jibo.sound.Sound} New sound. - */ - - /** - * Create a new "Audio" stream based on given audio path and project uri; returns the audio object. - * @method jibo.sound.SoundUtils.playOnce - * @static - * @param {String} fileName Full path of the file to play. - * @param {Function} callback Callback when complete. - * @return {string} New audio element alias. - */ - - /** - * Setup sounds to play automatically when hitting a frame label. For instance, a frame label of "playAudio-pop" - * will play the sound alias "pop" and "playAudio-breeze-1" will play the sound alias "breeze". - * @method jibo.sound.SoundUtils.addClipSounds - * @static - * @param {PIXI.animate.MovieClip} clip MovieClip to add sounds. - * @param {String} [labelPrefix=playAudio] Label name should start with this. - * @param {String} [separator=-] The separater between the labelPrefix, sound alias and the unique id (for playing multiple times) - * @return {PIXI.animate.MovieClip} MoveClip - */ \ No newline at end of file diff --git a/docs/sound/index.js b/docs/sound/index.js deleted file mode 100644 index a7f8605e..00000000 --- a/docs/sound/index.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Playing sound files with WebAudio API - * @namespace jibo.sound - */ \ No newline at end of file diff --git a/docs/sound/tasks/SoundTask.js b/docs/sound/tasks/SoundTask.js deleted file mode 100644 index 5e723853..00000000 --- a/docs/sound/tasks/SoundTask.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Internal class for dealing with async load assets through Loader. - * @class SoundTask - * @extends jibo.loader.Task - * @memberof jibo.loader - * @constructor - * @private - * @param {Object} asset The data properties. - * @param {String} asset.src The source. - * @param {Boolean} [asset.cache=false] true to cache the result. - * @param {String} [asset.id] ID of asset. - */ - - /** - * Tests if tasks should be run. - * @method jibo.loader.SoundTask.test - * @static - * @param {Object} asset The asset to check. - * @return {Boolean} true if the asset is compatible with this asset. - */ - - /** - * The source URL to load. - * @type {String} - * @name jibo.loader.SoundTask#src - */ - - /** - * true to block the audio from being played more than once at a time. - * @type {Boolean} - * @name jibo.loader.SoundTask#block - */ - - /** - * The initial volume of the sound (0 to 1). - * @type {Number} - * @name jibo.loader.SoundTask#volume - */ - - /** - * The panning from -1 (left) to 1 (right). Default is 0 (center). - * @type {Number} - * @name jibo.loader.SoundTask#panning - */ - - /** - * true if the sound should play. - * @type {Boolean} - * @name jibo.loader.SoundTask#loop - */ - - /** - * true to start playing the sound immediately after loading. - * @type {Boolean} - * @name jibo.loader.SoundTask#autoPlay - */ - - /** - * true to use XMLHttpRequest to download file. - * @type {Boolean} - * @name jibo.loader.SoundTask#useXHR - */ - - /** - * Starts the task. - * @method jibo.loader.SoundTask#start - * @param {jibo.loader.Task~completeCallback} callback Callback when finished. - */ \ No newline at end of file diff --git a/docs/utils/AnimationUtils.js b/docs/utils/AnimationUtils.js deleted file mode 100644 index 5e12a18f..00000000 --- a/docs/utils/AnimationUtils.js +++ /dev/null @@ -1,45 +0,0 @@ - /** -// * we want to wrap the loading of animations into our own runtime file resolution -// * and format conversion -// * @private -// */ - - /** -// * provided for backwards compatibility -// * @deprecated -// * @private -// */ - - /** -// * Creates an animation builder from a .keys file. -// * @function jibo.animate#createAnimationBuilderFromKeysPath -// * @param {String} uri Path to the .keys file. -// * @param {String} root Base path from which texture files are located. -// * @param {jibo.animate~AnimationBuilderCreatedCallback} cb Callback function that takes an {@link AnimationBuilder} as an argument. -// * @deprecated since 3.1.0 -// * @see jibo.loader#load -// */ - - /** -// * provided for backwards compatibility -// * @deprecated -// * @private -// */ - - /** -// * Shared three.js module reference. -// * @member jibo.animate.THREE -// */ - - /** -// * Wrapping this call because we already have a reference to robot info -// * and the timeline. -// * @private -// */ - - /** -// * Creates a face renderer bound to the given DOM element. -// * @function jibo.visualize#createFaceRenderer -// * @param {HTMLElement} element The element to draw the eye to. -// * @returns {FaceRenderer} -// */ \ No newline at end of file diff --git a/docs/utils/DelayedCall.js b/docs/utils/DelayedCall.js deleted file mode 100644 index e829f4ff..00000000 --- a/docs/utils/DelayedCall.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * A class for delaying a call through the application, instead of relying on `setInterval()` or - * `setTimeout()`. - * - * @class DelayedCall - * @memberof jibo.timer - * @param {function} callback The function to call when the delay has completed. - * @param {int} delay The time to delay the call, in milliseconds (or optionally frames). - * @param {Object|Boolean} [options=false] The options to use or repeat value. - * @param {Boolean} [options.repeat=false] `true` if the DelayedCall should automatically repeat itself when - * completed. - * @param {Boolean} [options.autoDestroy=true] `true` if the DelayedCall should clean itself up when completed. - * @param {Boolean} [options.useFrames=false] `true` if the DelayedCall should use frames instead of - * milliseconds for the delay. - */ - - /** - * The root timer. - * @private - * @type {Timer} - * @name jibo.timer.DelayedCall#parent - */ - - /** - * The function to call when the delay is completed. - * @private - * @type {function} - * @name jibo.timer.DelayedCall#_callback - */ - - /** - * The delay time, in milliseconds. - * @private - * @type {int} - * @name jibo.timer.DelayedCall#_delay - */ - - /** - * The timer counting down from _delay, in milliseconds. - * @private - * @type {int} - * @name jibo.timer.DelayedCall#_timer - */ - - /** - * `true` if the DelayedCall should repeat itself automatically. - * @private - * @type {Boolean} - * @name jibo.timer.DelayedCall#_repeat - * @default false - */ - - /** - * `true` if the DelayedCall should destroy itself after completing - * @private - * @type {Boolean} - * @name jibo.timer.DelayedCall#_autoDestroy - * @default true - */ - - /** - * `true` if the DelayedCall should use frames instead of milliseconds for the delay. - * @private - * @type {Boolean} - * @name jibo.timer.DelayedCall#_useFrames - * @default false - */ - - /** - * `true` if the DelayedCall is currently paused (not stopped). - * @private - * @type {Boolean} - * @name jibo.timer.DelayedCall#_paused - */ - - /** - * The callback supplied to the Application for an update each frame. - * @private - * @method jibo.timer.DelayedCall#update - * @param {int} elapsed The time elapsed since the previous frame. - */ - - /** - * Restart the DelayedCall, whether it is running or not. - * @method jibo.timer.DelayedCall#restart - */ - - /** - * Stop the DelayedCall without destroying it. - * @method jibo.timer.DelayedCall#stop - */ - - /** - * `true` if enabled for updates, `false` otherwise. - * @private - * @type {Boolean} - * @name jibo.timer.DelayedCall#enabled - */ - - /** - * `true` if the DelayedCall is paused, `false` otherwise. - * @type {Boolean} - * @name jibo.timer.DelayedCall#paused - */ - - /** - * Stop and clean up the DelayedCall. Do not use after calling. - * destroy(). - * @method jibo.timer.DelayedCall#destroy - */ \ No newline at end of file diff --git a/docs/utils/Timer.js b/docs/utils/Timer.js deleted file mode 100644 index 1b501390..00000000 --- a/docs/utils/Timer.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @description - * Handle the update loop and timing events. - * ``` - * let jibo = require('jibo'); - * jibo.timer.on('update', (elapsed) => { - * // do update - * }); - * ``` - * @namespace jibo.timer - */ - - /** - * Fire when timer pause state changes. - * @event jibo.timer#pause - * @param {boolean} pause `true` if currently paused, `false` if resumed from stop. - */ - - /** - * Fire when sound is resumed. - * @event jibo.timer#resumed - */ - - /** - * Fire when sound is paused. - * @event jibo.timer#paused - */ - - /** - * Fire every `requestAnimationFrame`. Should be considered - * the main update "loop." All skills should use this for frame updates. - * @event jibo.timer#update - * @param {int} elapse The time in milliseconds since the last frame update. - */ - - /** - * Start the update loop. - * @method jibo.timer#start - */ - - /** - * Stop the update loop. - * @method jibo.timer#stop - */ - - /** - * Update loop callback. - * @method jibo.timer#update - * @private - */ - - /** - * Pause loop callback. - * @name jibo.timer#paused - * @type {Boolean} - * @readOnly - */ - - /** - * Works just like `window.setTimeout` but respects the pause. - * State of `jibo.timer`. - * @method jibo.timer#setTimeout - * @param {Function} callback Pass one argument, which is the `DelayedCall` instance. - * @param {int} delay The time in milliseconds or the number of frames (useFrames must be true). - * @param {Boolean} [useFrames=false] If the delay is frames (`true`) or milliseconds (`false`). - * @param {Boolean} [autoDestroy=true] If the DelayedCall object should be destroyed after completing. - * @return {jibo.timer.DelayedCall} The object for pausing, restarting, destroying etc. - */ - - /** - * Drop-in replacement for `window.clearTimeout`. Works with `jibo.timer.setTimeout` - * @method jibo.timer#clearTimeout - * @param {jibo.timer.DelayedCall} call The call to remove. - */ - - /** - * Works just like `window.setInterval` but respects the pause. - * State of jibo.timer. - * @method jibo.timer#setInterval - * @param {Function} callback Pass one argument, which is the DelayedCall instance. - * @param {int} delay The time in milliseconds or the number of frames ( if useFrames is `true`). - * @param {Boolean} [useFrames=false] If the delay is frames (`true`) or milliseconds (`false`). - * @return {jibo.timer.DelayedCall} The object for pausing, restarting, destroying etc. - */ - - /** - * Calls the provided callback function on the next timer frame. - * State of `jibo.timer`. - * @method jibo.timer#nextTick - * @param {Function} callback Pass one argument, which is the `DelayedCall` instance. - * @param {Boolean} [autoDestroy=true] If the `DelayedCall` object should be destroyed after completing. - * @return {jibo.timer.DelayedCall} The object for pausing, restarting, destroying etc. - */ - - /** - * Drop-in replacement for `window.clearInterval`, works with `jibo.timer.setInterval` - * @method jibo.timer#clearInterval - * @param {jibo.timer.DelayedCall} call The call to remove. - */ - - /** - * Destroy the timer object. - * @method jibo.timer#destroy - * @private - */ \ No newline at end of file diff --git a/docs/utils/decorators.js b/docs/utils/decorators.js deleted file mode 100644 index ed531eb7..00000000 --- a/docs/utils/decorators.js +++ /dev/null @@ -1,35 +0,0 @@ -/** @isInitialized method decorator - * - * Enforces that `this.isInitialized` is true or calls the callback with an error. - * Assumes the last argument is the callback. Must appear after @promisfy decorator, if any. - * @internal - */ - -/** @promisify method decorator - * - * Assumes the last argument is suppose to be a callback. If the last - * argument isn't a function, then assume the callback was left off on - * purpose and wrap the method call in a promise and return the - * promise. - * - * Note: only works with callbacks that return one result (or less) in - * addition to the err argument. e.g. callback(err), or callback(err, res), - * but not callback(err, res, res2) (because of the way promises work) - * @internal - */ - -/** @promisify_n method decorator - * Takes one argument, the argument number of the callback. If that - * argument isn't a function, then assume the callback was left off on - * purpose and wrap the method call in a promise and return the - * promise. The argument number is one-based: the first argument - * number is 1 (not zero), the second argument is 2, etc. - * - * The decorator takes the argument just like a function: - * @promisify_n(2) // if the second argument is the callback - * - * Note: only works with callbacks that return one result (or less) in - * addition to the err argument. e.g. callback(err), or callback(err, res), - * but not callback(err, res, res2) (because of the way promises work) - * @internal - */ \ No newline at end of file diff --git a/docs/utils/index.js b/docs/utils/index.js deleted file mode 100644 index 9c1912f8..00000000 --- a/docs/utils/index.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Utility methods for animation, audio, and pathing. - * @namespace jibo.utils - */ \ No newline at end of file diff --git a/docs/utils/location/HomeLocation.js b/docs/utils/location/HomeLocation.js deleted file mode 100644 index de42dbcd..00000000 --- a/docs/utils/location/HomeLocation.js +++ /dev/null @@ -1,3 +0,0 @@ -/** - * @private - */ \ No newline at end of file diff --git a/docs/utils/perf/GlobalPerfTimer.js b/docs/utils/perf/GlobalPerfTimer.js deleted file mode 100644 index 606b1f8d..00000000 --- a/docs/utils/perf/GlobalPerfTimer.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Global performance timer. - * @class GlobalPerfTimer - * @memberof jibo.utils.perf - * @private - */ \ No newline at end of file diff --git a/docs/utils/perf/ParallelTimer.js b/docs/utils/perf/ParallelTimer.js deleted file mode 100644 index bb6eb024..00000000 --- a/docs/utils/perf/ParallelTimer.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Parallel Timer - * @class ParallelTimer - * @extends PerformanceTimer - * @memberof jibo.utils.perf - * @private - */ \ No newline at end of file diff --git a/docs/utils/perf/PerformanceTimer.js b/docs/utils/perf/PerformanceTimer.js deleted file mode 100644 index 2100bc38..00000000 --- a/docs/utils/perf/PerformanceTimer.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Base Timer for measuring performance. - * @class PerformanceTimer - * @memberof jibo.utils.perf - * @private - */ \ No newline at end of file diff --git a/docs/utils/perf/SerialTimer.js b/docs/utils/perf/SerialTimer.js deleted file mode 100644 index efb0c540..00000000 --- a/docs/utils/perf/SerialTimer.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Serial Timer - * @class SerialTimer - * @extends PerformanceTimer - * @memberof jibo.utils.perf - * @private - */ \ No newline at end of file