diff --git a/client/modules/IDE/components/Editor/codemirror.js b/client/modules/IDE/components/Editor/codemirror.js index e95f4ab6bf..a90ebce6a2 100644 --- a/client/modules/IDE/components/Editor/codemirror.js +++ b/client/modules/IDE/components/Editor/codemirror.js @@ -1,6 +1,6 @@ import { useRef, useEffect } from 'react'; import { EditorView, lineNumbers as lineNumbersExt } from '@codemirror/view'; -import { closeBrackets } from '@codemirror/autocomplete'; +import { autocompletion, closeBrackets } from '@codemirror/autocomplete'; // TODO: Check what the v6 variants of these addons are. // import 'codemirror/addon/search/searchcursor'; @@ -13,7 +13,8 @@ import { debounce } from 'lodash'; import { getFileMode, createNewFileState, - updateFileStates + updateFileStates, + AUTOCOMPLETE_OPTIONS } from './stateUtils'; import { useEffectWithComparison } from '../../hooks/custom-hooks'; import tidyCodeWithPrettier from './tidier'; @@ -141,6 +142,18 @@ export default function useCodeMirror({ reconfigureEffect }); }, [autocloseBracketsQuotes]); + useEffect(() => { + const reconfigureEffect = (fileState) => + fileState.autocompleteCpt.reconfigure( + autocompleteHinter ? autocompletion(AUTOCOMPLETE_OPTIONS) : [] + ); + updateFileStates({ + fileStates: fileStates.current, + cmView: cmView.current, + file, + reconfigureEffect + }); + }, [autocompleteHinter]); // Initializes the files as CodeMirror states. function initializeDocuments() { @@ -160,6 +173,7 @@ export default function useCodeMirror({ linewrap, lineNumbers, autocloseBracketsQuotes, + autocomplete: autocompleteHinter, onUpdateLinting, onViewUpdate } diff --git a/client/modules/IDE/components/Editor/p5JavaScript.js b/client/modules/IDE/components/Editor/p5JavaScript.js new file mode 100644 index 0000000000..4d8b27b7e6 --- /dev/null +++ b/client/modules/IDE/components/Editor/p5JavaScript.js @@ -0,0 +1,54 @@ +import { LanguageSupport } from '@codemirror/language'; +import { javascript } from '@codemirror/lang-javascript'; +import { p5Hinter } from '../../../../utils/p5-hinter'; + +function testCompletions(context) { + const word = context.matchBefore(/\w*/); + if (word.from === word.to && !context.explicit) return null; + + function addDomNodeInfo(item) { + const itemCopy = { ...item }; + + if (item.p5DocPath) { + // TODO: Use the option below to add the p5 link for *all* hints. + // https://codemirror.net/docs/ref/#autocomplete.autocompletion^config.addToOptions + itemCopy.info = () => { + const domNode = document.createElement('a'); + domNode.href = `https://p5js.org/reference/p5/${item.p5DocPath}`; + domNode.role = 'link'; + domNode.target = '_blank'; + domNode.onclick = (event) => event.stopPropagation(); + domNode.innerHTML = ` + open ${item.label} reference + + `; + return { + dom: domNode, + destroy: () => { + // Cleanup logic if needed + domNode.remove(); + } + }; + }; + } + + return itemCopy; + } + + const hinterWithDomNodes = p5Hinter.map(addDomNodeInfo); + + return { + from: word.from, + options: hinterWithDomNodes + }; +} + +export default function p5JavaScript() { + const jsLang = javascript(); + return new LanguageSupport(jsLang.language, [ + jsLang.extension, + jsLang.language.data.of({ + autocomplete: testCompletions + }) + ]); +} diff --git a/client/modules/IDE/components/Editor/stateUtils.js b/client/modules/IDE/components/Editor/stateUtils.js index 193a766e8c..376c31f190 100644 --- a/client/modules/IDE/components/Editor/stateUtils.js +++ b/client/modules/IDE/components/Editor/stateUtils.js @@ -21,7 +21,11 @@ import { defaultHighlightStyle } from '@codemirror/language'; import { highlightSelectionMatches } from '@codemirror/search'; -import { closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete'; +import { + autocompletion, + closeBrackets, + closeBracketsKeymap +} from '@codemirror/autocomplete'; import { defaultKeymap, history, @@ -36,7 +40,6 @@ import { abbreviationTracker } from '@emmetio/codemirror6-plugin'; -import { javascript } from '@codemirror/lang-javascript'; import { css } from '@codemirror/lang-css'; import { html } from '@codemirror/lang-html'; import { json } from '@codemirror/lang-json'; @@ -47,6 +50,7 @@ import { HTMLHint } from 'htmlhint'; import { CSSLint } from 'csslint'; import { emmetConfig } from '@emmetio/codemirror6-plugin'; +import p5JavaScript from './p5JavaScript'; import tidyCodeWithPrettier from './tidier'; // ----- TODOS ----- @@ -83,7 +87,7 @@ function getFileLanguage(fileName) { switch (fileMode) { case 'javascript': - return javascript; + return p5JavaScript; case 'css': return css; case 'html': @@ -255,6 +259,12 @@ function getFileEmmetConfig(fileName) { const extraKeymaps = [{ key: 'Tab', run: insertTab, shift: indentLess }]; const emmetKeymaps = [{ key: 'Tab', run: expandAbbreviation }]; +export const AUTOCOMPLETE_OPTIONS = { + tooltipClass: () => 'CodeMirror-hints', + optionClass: () => 'CodeMirror-hint', + closeOnBlur: false +}; + /** * Creates a new CodeMirror editor state with configurations, * extensions, and keymaps tailored to the file type and settings. @@ -265,6 +275,7 @@ export function createNewFileState(filename, document, settings) { const { linewrap, lineNumbers, + autocomplete, autocloseBracketsQuotes, onUpdateLinting, onViewUpdate @@ -272,6 +283,7 @@ export function createNewFileState(filename, document, settings) { const lineNumbersCpt = new Compartment(); const lineWrappingCpt = new Compartment(); const closeBracketsCpt = new Compartment(); + const autocompleteCpt = new Compartment(); // Depending on the file mode, we have a different tidier function. const mode = getFileMode(filename); @@ -294,6 +306,9 @@ export function createNewFileState(filename, document, settings) { lineNumbersCpt.of(lineNumbers ? lineNumbersExt() : []), lineWrappingCpt.of(linewrap ? EditorView.lineWrapping : []), closeBracketsCpt.of(autocloseBracketsQuotes ? closeBrackets() : []), + autocompleteCpt.of( + autocomplete ? autocompletion(AUTOCOMPLETE_OPTIONS) : [] + ), // Everything below here should always be on. history(), @@ -352,7 +367,13 @@ export function createNewFileState(filename, document, settings) { } const cmState = EditorState.create(stateOptions); - return { cmState, lineNumbersCpt, lineWrappingCpt, closeBracketsCpt }; + return { + cmState, + lineNumbersCpt, + lineWrappingCpt, + closeBracketsCpt, + autocompleteCpt + }; } /** diff --git a/client/modules/IDE/components/show-hint.js b/client/modules/IDE/components/show-hint.js deleted file mode 100644 index 99f7552006..0000000000 --- a/client/modules/IDE/components/show-hint.js +++ /dev/null @@ -1,787 +0,0 @@ -/* eslint-disable */ - -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: https://codemirror.net/LICENSE - -// Modified for p5.js-web-editor - -// declare global: DOMRect - -(function (mod) { - if (typeof exports == 'object' && typeof module == 'object') - // CommonJS - mod(require('codemirror')); - else if (typeof define == 'function' && define.amd) - // AMD - define(['codemirror'], mod); - // Plain browser env - else mod(CodeMirror); -})(function (CodeMirror) { - 'use strict'; - - var HINT_ELEMENT_CLASS = 'CodeMirror-hint'; - var ACTIVE_HINT_ELEMENT_CLASS = 'CodeMirror-hint-active'; - - // This is the old interface, kept around for now to stay - // backwards-compatible. - CodeMirror.showHint = function (cm, getHints, options) { - if (!getHints) return cm.showHint(options); - if (options && options.async) getHints.async = true; - var newOpts = { hint: getHints }; - if (options) for (var prop in options) newOpts[prop] = options[prop]; - return cm.showHint(newOpts); - }; - - CodeMirror.defineExtension('showHint', function (options) { - options = parseOptions(this, this.getCursor('start'), options); - var selections = this.listSelections(); - if (selections.length > 1) return; - // By default, don't allow completion when something is selected. - // A hint function can have a `supportsSelection` property to - // indicate that it can handle selections. - if (this.somethingSelected()) { - if (!options.hint.supportsSelection) return; - // Don't try with cross-line selections - for (var i = 0; i < selections.length; i++) - if (selections[i].head.line != selections[i].anchor.line) return; - } - - if (this.state.completionActive) this.state.completionActive.close(); - var completion = (this.state.completionActive = new Completion( - this, - options - )); - if (!completion.options.hint) return; - - CodeMirror.signal(this, 'startCompletion', this); - completion.update(true); - }); - - CodeMirror.defineExtension('closeHint', function () { - if (this.state.completionActive) this.state.completionActive.close(); - }); - - function Completion(cm, options) { - this.cm = cm; - this.options = options; - this.widget = null; - this.debounce = 0; - this.tick = 0; - this.startPos = this.cm.getCursor('start'); - this.startLen = - this.cm.getLine(this.startPos.line).length - - this.cm.getSelection().length; - - if (this.options.updateOnCursorActivity) { - var self = this; - cm.on( - 'cursorActivity', - (this.activityFunc = function () { - self.cursorActivity(); - }) - ); - } - } - - var requestAnimationFrame = - window.requestAnimationFrame || - function (fn) { - return setTimeout(fn, 1000 / 60); - }; - var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; - - Completion.prototype = { - close: function () { - if (!this.active()) return; - this.cm.state.completionActive = null; - this.tick = null; - if (this.options.updateOnCursorActivity) { - this.cm.off('cursorActivity', this.activityFunc); - } - - if (this.widget && this.data) CodeMirror.signal(this.data, 'close'); - if (this.widget) this.widget.close(); - CodeMirror.signal(this.cm, 'endCompletion', this.cm); - }, - - active: function () { - return this.cm.state.completionActive == this; - }, - - pick: function (data, i) { - var completion = data.list[i], - self = this; - this.cm.operation(function () { - if (completion.hint) completion.hint(self.cm, data, completion); - else - self.cm.replaceRange( - getText(completion), - completion.from || data.from, - completion.to || data.to, - 'complete' - ); - CodeMirror.signal(data, 'pick', completion); - self.cm.scrollIntoView(); - }); - if (this.options.closeOnPick) { - this.close(); - } - }, - - cursorActivity: function () { - if (this.debounce) { - cancelAnimationFrame(this.debounce); - this.debounce = 0; - } - - var identStart = this.startPos; - if (this.data) { - identStart = this.data.from; - } - - var pos = this.cm.getCursor(), - line = this.cm.getLine(pos.line); - if ( - pos.line != this.startPos.line || - line.length - pos.ch != this.startLen - this.startPos.ch || - pos.ch < identStart.ch || - this.cm.somethingSelected() || - !pos.ch || - this.options.closeCharacters.test(line.charAt(pos.ch - 1)) - ) { - this.close(); - } else { - var self = this; - this.debounce = requestAnimationFrame(function () { - self.update(); - }); - if (this.widget) this.widget.disable(); - } - }, - - update: function (first) { - if (this.tick == null) return; - var self = this, - myTick = ++this.tick; - fetchHints(this.options.hint, this.cm, this.options, function (data) { - if (self.tick == myTick) self.finishUpdate(data, first); - }); - }, - - finishUpdate: function (data, first) { - if (this.data) CodeMirror.signal(this.data, 'update'); - - var picked = - (this.widget && this.widget.picked) || - (first && this.options.completeSingle); - if (this.widget) this.widget.close(); - - this.data = data; - - if (data && data.list.length) { - if (picked && data.list.length == 1) { - this.pick(data, 0); - } else { - this.widget = new Widget(this, data); - CodeMirror.signal(data, 'shown'); - } - } - } - }; - - function parseOptions(cm, pos, options) { - var editor = cm.options.hintOptions; - var out = {}; - for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; - if (editor) - for (var prop in editor) - if (editor[prop] !== undefined) out[prop] = editor[prop]; - if (options) - for (var prop in options) - if (options[prop] !== undefined) out[prop] = options[prop]; - if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos); - return out; - } - - function getText(completion) { - if (typeof completion === 'string') return completion; - else return completion.item.text; - } - - function buildKeyMap(completion, handle) { - var baseMap = { - Up: function () { - handle.moveFocus(-1); - }, - Down: function () { - handle.moveFocus(1); - }, - PageUp: function () { - handle.moveFocus(-handle.menuSize() + 1, true); - }, - PageDown: function () { - handle.moveFocus(handle.menuSize() - 1, true); - }, - Home: function () { - handle.setFocus(0); - }, - End: function () { - handle.setFocus(handle.length - 1); - }, - Enter: handle.pick, - Tab: handle.pick, - Esc: handle.close - }; - - var mac = /Mac/.test(navigator.platform); - - if (mac) { - baseMap['Ctrl-P'] = function () { - handle.moveFocus(-1); - }; - baseMap['Ctrl-N'] = function () { - handle.moveFocus(1); - }; - } - - var custom = completion.options.customKeys; - var ourMap = custom ? {} : baseMap; - function addBinding(key, val) { - var bound; - if (typeof val != 'string') - bound = function (cm) { - return val(cm, handle); - }; - // This mechanism is deprecated - else if (baseMap.hasOwnProperty(val)) bound = baseMap[val]; - else bound = val; - ourMap[key] = bound; - } - if (custom) - for (var key in custom) - if (custom.hasOwnProperty(key)) addBinding(key, custom[key]); - var extra = completion.options.extraKeys; - if (extra) - for (var key in extra) - if (extra.hasOwnProperty(key)) addBinding(key, extra[key]); - return ourMap; - } - - function getHintElement(hintsElement, el) { - while (el && el != hintsElement) { - if (el.nodeName.toUpperCase() === 'LI' && el.parentNode == hintsElement) - return el; - el = el.parentNode; - } - } - - function displayHint(name, type, p5) { - return `
\ -${name}\ -, \ -${type}\ -, \ -${ - p5 - ? `\ -open ${name} reference\ -` - : `no reference for ${name}` -}
`; - } - - function getInlineHintSuggestion(focus, tokenLength) { - const suggestionItem = focus.item; - const baseCompletion = `${suggestionItem.text.slice( - tokenLength - )}`; - if (suggestionItem.type !== 'fun') return baseCompletion; - - // for functions - return ( - baseCompletion + - '(' + - (suggestionItem.params && suggestionItem.params.length - ? suggestionItem.params.map(({ p, o }) => (o ? `[${p}]` : p)).join(', ') - : '') + - ')' - ); - } - - function removeInlineHint(cm) { - if (cm.state.inlineHint) { - cm.state.inlineHint.clear(); - cm.state.inlineHint = null; - } - } - - function changeInlineHint(cm, focus) { - // Copilot-style inline suggestion for autocomplete feature - removeInlineHint(cm); - - const cursor = cm.getCursor(); - const token = cm.getTokenAt(cursor); - - if (token && focus.item) { - const suggestionHTML = getInlineHintSuggestion( - focus, - token.string.length - ); - - const widgetElement = document.createElement('span'); - widgetElement.className = 'autocomplete-inline-hinter'; - widgetElement.innerHTML = suggestionHTML; - - const widget = cm.setBookmark(cursor, { widget: widgetElement }); - cm.state.inlineHint = widget; - - cm.setCursor(cursor); - } - } - - function Widget(completion, data) { - this.id = 'cm-complete-' + Math.floor(Math.random(1e6)); - this.completion = completion; - this.data = data; - this.picked = false; - var widget = this, - cm = completion.cm; - var ownerDocument = cm.getInputField().ownerDocument; - var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow; - - var fontSize = completion.options._fontSize; - - var hints = (this.hints = ownerDocument.createElement('ul')); - hints.setAttribute('role', 'listbox'); - hints.setAttribute('aria-expanded', 'true'); - hints.id = this.id; - var theme = completion.cm.options.theme; - hints.className = 'CodeMirror-hints ' + theme; - this.selectedHint = data.selectedHint || 0; - - // Show inline hint - changeInlineHint(cm, data.list[this.selectedHint]); - - var completions = data.list; - - for (var i = 0; i < completions.length; ++i) { - var elt = hints.appendChild(ownerDocument.createElement('li')), - cur = completions[i]; - var className = - HINT_ELEMENT_CLASS + - (i != this.selectedHint ? '' : ' ' + ACTIVE_HINT_ELEMENT_CLASS); - if (cur.className != null) className = cur.className + ' ' + className; - elt.className = className; - if (i == this.selectedHint) elt.setAttribute('aria-selected', 'true'); - elt.id = this.id + '-' + i; - elt.setAttribute('role', 'option'); - if (cur.render) cur.render(elt, data, cur); - else { - const e = ownerDocument.createElement('p'); - const name = getText(cur); - - if (cur.item && cur.item.type) { - cur.displayText = displayHint(name, cur.item.type, cur.item.p5); - } - - elt.appendChild(e); - e.outerHTML = - cur.displayText || `${name}`; - } - elt.hintId = i; - } - - var container = completion.options.container || ownerDocument.body; - var pos = cm.cursorCoords( - completion.options.alignWithWord ? data.from : null - ); - var left = pos.left, - top = pos.bottom, - below = true; - var offsetLeft = 0, - offsetTop = 0; - if (container !== ownerDocument.body) { - // We offset the cursor position because left and top are relative to the offsetParent's top left corner. - var isContainerPositioned = - ['absolute', 'relative', 'fixed'].indexOf( - parentWindow.getComputedStyle(container).position - ) !== -1; - var offsetParent = isContainerPositioned - ? container - : container.offsetParent; - var offsetParentPosition = offsetParent.getBoundingClientRect(); - var bodyPosition = ownerDocument.body.getBoundingClientRect(); - offsetLeft = - offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft; - offsetTop = - offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop; - } - hints.style.left = left - offsetLeft + 'px'; - hints.style.top = top - offsetTop + 'px'; - - // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. - var winW = - parentWindow.innerWidth || - Math.max( - ownerDocument.body.offsetWidth, - ownerDocument.documentElement.offsetWidth - ); - var winH = - parentWindow.innerHeight || - Math.max( - ownerDocument.body.offsetHeight, - ownerDocument.documentElement.offsetHeight - ); - container.appendChild(hints); - cm.getInputField().setAttribute('aria-autocomplete', 'list'); - cm.getInputField().setAttribute('aria-owns', this.id); - cm.getInputField().setAttribute( - 'aria-activedescendant', - this.id + '-' + this.selectedHint - ); - - var box = completion.options.moveOnOverlap - ? hints.getBoundingClientRect() - : new DOMRect(); - var scrolls = completion.options.paddingForScrollbar - ? hints.scrollHeight > hints.clientHeight + 1 - : false; - - // Compute in the timeout to avoid reflow on init - var startScroll; - setTimeout(function () { - startScroll = cm.getScrollInfo(); - }); - - var overlapY = box.bottom - winH; - if (overlapY > 0) { - var height = box.bottom - box.top, - curTop = pos.top - (pos.bottom - box.top); - if (curTop - height > 0) { - // Fits above cursor - hints.style.top = (top = pos.top - height - offsetTop) + 'px'; - below = false; - } else if (height > winH) { - hints.style.height = winH - 5 + 'px'; - hints.style.top = (top = pos.bottom - box.top - offsetTop) + 'px'; - var cursor = cm.getCursor(); - if (data.from.ch != cursor.ch) { - pos = cm.cursorCoords(cursor); - hints.style.left = (left = pos.left - offsetLeft) + 'px'; - box = hints.getBoundingClientRect(); - } - } - } - var overlapX = box.right - winW; - if (scrolls) overlapX += cm.display.nativeBarWidth; - if (overlapX > 0) { - if (box.right - box.left > winW) { - hints.style.width = winW - 5 + 'px'; - overlapX -= box.right - box.left - winW; - } - hints.style.left = (left = pos.left - overlapX - offsetLeft) + 'px'; - } - // if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling) - // node.style.paddingRight = cm.display.nativeBarWidth + "px" - - cm.addKeyMap( - (this.keyMap = buildKeyMap(completion, { - moveFocus: function (n, avoidWrap) { - return widget.changeActive(widget.selectedHint + n, avoidWrap); - }, - setFocus: function (n) { - return widget.changeActive(n); - }, - menuSize: function () { - return widget.screenAmount(); - }, - length: completions.length, - close: function () { - completion.close(); - }, - pick: function () { - widget.pick(); - }, - data: data - })) - ); - - if (completion.options.closeOnUnfocus) { - var closingOnBlur; - cm.on( - 'blur', - (this.onBlur = function () { - closingOnBlur = setTimeout(function () { - completion.close(); - }, 100); - }) - ); - cm.on( - 'focus', - (this.onFocus = function () { - clearTimeout(closingOnBlur); - }) - ); - } - - cm.on( - 'scroll', - (this.onScroll = function () { - var curScroll = cm.getScrollInfo(), - editor = cm.getWrapperElement().getBoundingClientRect(); - if (!startScroll) startScroll = cm.getScrollInfo(); - var newTop = top + startScroll.top - curScroll.top; - var point = - newTop - - (parentWindow.pageYOffset || - (ownerDocument.documentElement || ownerDocument.body).scrollTop); - if (!below) point += hints.offsetHeight; - if (point <= editor.top || point >= editor.bottom) - return completion.close(); - hints.style.top = newTop + 'px'; - hints.style.left = left + startScroll.left - curScroll.left + 'px'; - }) - ); - - CodeMirror.on(hints, 'dblclick', function (e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) { - widget.changeActive(t.hintId); - widget.pick(); - } - }); - - CodeMirror.on(hints, 'click', function (e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) { - widget.changeActive(t.hintId); - if (completion.options.completeOnSingleClick) widget.pick(); - } - }); - - CodeMirror.on(hints, 'mousedown', function () { - setTimeout(function () { - cm.focus(); - }, 20); - }); - - // The first hint doesn't need to be scrolled to on init - var selectedHintRange = this.getSelectedHintRange(); - if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) { - this.scrollToActive(); - } - - CodeMirror.signal( - data, - 'select', - completions[this.selectedHint], - hints.childNodes[this.selectedHint] - ); - return true; - } - - Widget.prototype = { - close: function () { - if (this.completion.widget != this) return; - this.completion.widget = null; - if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints); - this.completion.cm.removeKeyMap(this.keyMap); - var input = this.completion.cm.getInputField(); - input.removeAttribute('aria-activedescendant'); - input.removeAttribute('aria-owns'); - - var cm = this.completion.cm; - if (this.completion.options.closeOnUnfocus) { - cm.off('blur', this.onBlur); - cm.off('focus', this.onFocus); - } - cm.off('scroll', this.onScroll); - - removeInlineHint(cm); - }, - - disable: function () { - this.completion.cm.removeKeyMap(this.keyMap); - var widget = this; - this.keyMap = { - Enter: function () { - widget.picked = true; - } - }; - this.completion.cm.addKeyMap(this.keyMap); - }, - - pick: function () { - this.completion.pick(this.data, this.selectedHint); - }, - - changeActive: function (i, avoidWrap) { - if (i >= this.data.list.length) - i = avoidWrap ? this.data.list.length - 1 : 0; - else if (i < 0) i = avoidWrap ? 0 : this.data.list.length - 1; - - if (this.selectedHint == i) { - changeInlineHint(this.completion.cm, this.data.list[this.selectedHint]); - return this.data.list[this.selectedHint]; - } - - var node = this.hints.childNodes[this.selectedHint]; - if (node) { - node.className = node.className.replace( - ' ' + ACTIVE_HINT_ELEMENT_CLASS, - '' - ); - node.removeAttribute('aria-selected'); - } - node = this.hints.childNodes[(this.selectedHint = i)]; - node.className += ' ' + ACTIVE_HINT_ELEMENT_CLASS; - node.setAttribute('aria-selected', 'true'); - this.completion.cm - .getInputField() - .setAttribute('aria-activedescendant', node.id); - this.scrollToActive(); - CodeMirror.signal( - this.data, - 'select', - this.data.list[this.selectedHint], - node - ); - - changeInlineHint(this.completion.cm, this.data.list[this.selectedHint]); - return this.data.list[this.selectedHint]; - }, - - scrollToActive: function () { - var selectedHintRange = this.getSelectedHintRange(); - var node1 = this.hints.childNodes[selectedHintRange.from]; - var node2 = this.hints.childNodes[selectedHintRange.to]; - var firstNode = this.hints.firstChild; - if (node1.offsetTop < this.hints.scrollTop) - this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop; - else if ( - node2.offsetTop + node2.offsetHeight > - this.hints.scrollTop + this.hints.clientHeight - ) - this.hints.scrollTop = - node2.offsetTop + - node2.offsetHeight - - this.hints.clientHeight + - firstNode.offsetTop; - }, - - screenAmount: function () { - return ( - Math.floor( - this.hints.clientHeight / this.hints.firstChild.offsetHeight - ) || 1 - ); - }, - - getSelectedHintRange: function () { - var margin = this.completion.options.scrollMargin || 0; - return { - from: Math.max(0, this.selectedHint - margin), - to: Math.min(this.data.list.length - 1, this.selectedHint + margin) - }; - } - }; - - function applicableHelpers(cm, helpers) { - if (!cm.somethingSelected()) return helpers; - var result = []; - for (var i = 0; i < helpers.length; i++) - if (helpers[i].supportsSelection) result.push(helpers[i]); - return result; - } - - function fetchHints(hint, cm, options, callback) { - if (hint.async) { - hint(cm, callback, options); - } else { - var result = hint(cm, options); - if (result && result.then) result.then(callback); - else callback(result); - } - } - - function resolveAutoHints(cm, pos) { - var helpers = cm.getHelpers(pos, 'hint'), - words; - if (helpers.length) { - var resolved = function (cm, callback, options) { - var app = applicableHelpers(cm, helpers); - function run(i) { - if (i == app.length) return callback(null); - fetchHints(app[i], cm, options, function (result) { - if (result && result.list.length > 0) callback(result); - else run(i + 1); - }); - } - run(0); - }; - resolved.async = true; - resolved.supportsSelection = true; - return resolved; - } else if ((words = cm.getHelper(cm.getCursor(), 'hintWords'))) { - return function (cm) { - return CodeMirror.hint.fromList(cm, { words: words }); - }; - } else if (CodeMirror.hint.anyword) { - return function (cm, options) { - return CodeMirror.hint.anyword(cm, options); - }; - } else { - return function () {}; - } - } - - CodeMirror.registerHelper('hint', 'auto', { - resolve: resolveAutoHints - }); - - CodeMirror.registerHelper('hint', 'fromList', function (cm, options) { - var cur = cm.getCursor(), - token = cm.getTokenAt(cur); - var term, - from = CodeMirror.Pos(cur.line, token.start), - to = cur; - if ( - token.start < cur.ch && - /\w/.test(token.string.charAt(cur.ch - token.start - 1)) - ) { - term = token.string.substr(0, cur.ch - token.start); - } else { - term = ''; - from = cur; - } - var found = []; - for (var i = 0; i < options.words.length; i++) { - var word = options.words[i]; - if (word.slice(0, term.length) == term) found.push(word); - } - - if (found.length) return { list: found, from: from, to: to }; - }); - - CodeMirror.commands.autocomplete = CodeMirror.showHint; - - var defaultOptions = { - hint: CodeMirror.hint.auto, - completeSingle: true, - alignWithWord: true, - closeCharacters: /[\s()\[\]{};:>,]/, - closeOnPick: true, - closeOnUnfocus: true, - updateOnCursorActivity: true, - completeOnSingleClick: true, - container: null, - customKeys: null, - extraKeys: null, - paddingForScrollbar: true, - moveOnOverlap: true - }; - - CodeMirror.defineOption('hintOptions', null); -}); diff --git a/client/styles/components/_hints.scss b/client/styles/components/_hints.scss index 6c01abb721..4a0a991584 100644 --- a/client/styles/components/_hints.scss +++ b/client/styles/components/_hints.scss @@ -1,58 +1,22 @@ @use "sass:math"; -.CodeMirror-hints { - position: absolute; - z-index: 10; - overflow: hidden; - list-style: none; - - margin: 0; - padding: 0; - +.cm-tooltip-autocomplete.CodeMirror-hints { box-shadow: 0 0 #{math.div(18, $base-font-size)}rem 0 rgba(0, 0, 0, 0.16); border: #{math.div(1, $base-font-size)}rem solid #A6A6A6; - - font-size: 100%; font-family: Inconsolata, monospace; - - width: 18rem; - max-height: 20rem; - overflow-y: auto; - - transform-origin: top left; - - @include themify() { - background: getThemifyVariable('hint-background-color'); - - .CodeMirror-hint { - color: getThemifyVariable('hint-text-color'); - border-bottom: #{math.div(1, $base-font-size)}rem solid getThemifyVariable('hint-item-border-bottom-color'); - } - - .hint-name { - height: 100%; - } - - .fun-name, .obj-name { - color: getThemifyVariable('hint-fun-text-color'); - } - - .var-name, .boolean-name { - color: getThemifyVariable('hint-var-text-color'); - } - - .keyword-name { - color: getThemifyVariable('hint-keyword-text-color'); - } - .hint-type { - color: getThemifyVariable('hint-type-text-color'); - margin-right: #{math.div(10, $base-font-size)}rem; - } - - a { - color: getThemifyVariable('hint-arrow-color'); + @include themify() { + .cm-completionInfo { background: getThemifyVariable('hint-arrow-background-color'); + height: 1.2em; + left: auto; + right: 0px; + padding: 0 6px; + white-space: nowrap; + + a { + color: getThemifyVariable('hint-arrow-color'); + } &:hover, &:active, &.focused-hint-link { background: getThemifyVariable('hint-arrow-background-active-color'); @@ -64,142 +28,9 @@ } } - .no-link-placeholder { - background: getThemifyVariable('hint-no-link-background-color'); - pointer-events: none; - } - - li.CodeMirror-hint-active:not(.unfocused) { - background: getThemifyVariable('hint-item-active-background-color'); - outline: getThemifyVariable('hint-item-active-outline'); - outline-offset: getThemifyVariable('hint-item-active-outline-offset'); - - // .fun-item { - // border-bottom: #{2 / $base-font-size}rem solid getThemifyVariable('hint-fun-active-border-bottom-color'); - // } - - // .var-item { - // border-bottom: #{2 / $base-font-size}rem solid getThemifyVariable('hint-var-active-border-bottom-color'); - // } - - .hint-name { - color: getThemifyVariable('hint-item-active-text-color'); - } - - .fun-name, .obj-name { - background-color: getThemifyVariable('hint-fun-text-color'); - } - - .var-name, .boolean-name { - background-color: getThemifyVariable('hint-var-text-color'); - } - - .keyword-name { - background-color: getThemifyVariable('hint-keyword-text-color'); - } - - .hint-type, .plain-hint-item { - color: getThemifyVariable('hint-item-active-type-text-color'); - } - } - - .CodeMirror-hint:hover:not(.CodeMirror-hint-active) { - background: getThemifyVariable('hint-item-hover-background-color'); - } - } - - .CodeMirror-hint { - display: flex; - align-items: center; - justify-content: space-between; - - position: relative; - margin: 0; - padding: 0; - height: 2rem; - white-space: pre; - cursor: pointer; - - &:has(.focused-hint-link) { - z-index: 999; - } - - &:only-child, &:last-child { - border-bottom: none !important; - } - - p { - display: flex; - width: 100%; - height: 100%; - } - - .hint-name, .plain-hint-item { - display: flex; - align-items: center; - padding: 0 0.5rem; - width: min-content; - font-size: 1.2rem; - line-height: 100%; - font-weight: bold; - } - - .hint-type { - margin: 0.5rem 2.4rem 0.5rem auto; - font-size: 1rem; - line-height: 100%; - font-weight: normal; - } - .hint-hidden { @extend %hidden-element; - } - - a, .no-link-placeholder { - position: absolute; - top: 0; - right: 0; - height: 100%; - width: calc(2rem - #{math.div(1, $base-font-size)}rem); - margin: 0; - padding-top: 0.4rem; - font-size: 1.2rem; - line-height: 100%; - text-align: center; - outline: none; - z-index: 1; - } - - a:focus, a:active { - outline: 0; - } - } -} - -// Inline hinter -.CodeMirror-widget { - line-height: inherit; - - @include themify() { - .autocomplete-inline-hinter { - // make the border left look like a cursor and animate like a cursor - // border-left: #{1.2 / $base-font-size}rem solid getThemifyVariable(hint-inline-text-color); - // animation: inline-hint-caret-blink 1s step-end infinite; - pointer-events: none; - - .inline-hinter-suggestion { - color: getThemifyVariable(hint-inline-text-color); - font-style: italic; - } - - .inline-hinter-suggestion-light { - color: getThemifyVariable(hint-inline-text-color-light); - font-style: italic; - } + display: none; } } } - -@keyframes inline-hint-caret-blink { - 50% { border-color: transparent; } -} diff --git a/client/utils/p5-hinter.js b/client/utils/p5-hinter.js index 7f20031df5..a9c8c38c75 100644 --- a/client/utils/p5-hinter.js +++ b/client/utils/p5-hinter.js @@ -1,3 +1,3 @@ /* eslint-disable */ /* generated: do not edit! helper file for hinter. generated by update-p5-hinter script */ -exports.p5Hinter = [{"text":"describe","type":"fun","params":[{"p":"text","o":false},{"p":"display","o":true}],"p5":true},{"text":"describeElement","type":"fun","params":[{"p":"name","o":false},{"p":"text","o":false},{"p":"display","o":true}],"p5":true},{"text":"textOutput","type":"fun","params":[{"p":"display","o":true}],"p5":true},{"text":"gridOutput","type":"fun","params":[{"p":"display","o":true}],"p5":true},{"text":"alpha","type":"fun","params":[{"p":"color","o":false}],"p5":true},{"text":"blue","type":"fun","params":[{"p":"color","o":false}],"p5":true},{"text":"brightness","type":"fun","params":[{"p":"color","o":false}],"p5":true},{"text":"color","type":"fun","p5":true},{"text":"green","type":"fun","params":[{"p":"color","o":false}],"p5":true},{"text":"hue","type":"fun","params":[{"p":"color","o":false}],"p5":true},{"text":"lerpColor","type":"fun","params":[{"p":"c1","o":false},{"p":"c2","o":false},{"p":"amt","o":false}],"p5":true},{"text":"lightness","type":"fun","params":[{"p":"color","o":false}],"p5":true},{"text":"red","type":"fun","params":[{"p":"color","o":false}],"p5":true},{"text":"saturation","type":"fun","params":[{"p":"color","o":false}],"p5":true},{"text":"beginClip","type":"fun","params":[{"p":"options","o":true}],"p5":true},{"text":"endClip","type":"fun","p5":true},{"text":"clip","type":"fun","params":[{"p":"callback","o":false},{"p":"options","o":true}],"p5":true},{"text":"background","type":"fun","p5":true},{"text":"clear","type":"fun","params":[{"p":"r","o":true},{"p":"g","o":true},{"p":"b","o":true},{"p":"a","o":true}],"p5":true},{"text":"colorMode","type":"fun","p5":true},{"text":"fill","type":"fun","p5":true},{"text":"noFill","type":"fun","p5":true},{"text":"noStroke","type":"fun","p5":true},{"text":"stroke","type":"fun","p5":true},{"text":"erase","type":"fun","params":[{"p":"strengthFill","o":true},{"p":"strengthStroke","o":true}],"p5":true},{"text":"noErase","type":"fun","p5":true},{"text":"arc","type":"fun","params":[{"p":"x","o":false},{"p":"y","o":false},{"p":"w","o":false},{"p":"h","o":false},{"p":"start","o":false},{"p":"stop","o":false},{"p":"mode","o":true},{"p":"detail","o":true}],"p5":true},{"text":"ellipse","type":"fun","p5":true},{"text":"circle","type":"fun","params":[{"p":"x","o":false},{"p":"y","o":false},{"p":"d","o":false}],"p5":true},{"text":"line","type":"fun","p5":true},{"text":"point","type":"fun","p5":true},{"text":"quad","type":"fun","p5":true},{"text":"rect","type":"fun","p5":true},{"text":"square","type":"fun","params":[{"p":"x","o":false},{"p":"y","o":false},{"p":"s","o":false},{"p":"tl","o":true},{"p":"tr","o":true},{"p":"br","o":true},{"p":"bl","o":true}],"p5":true},{"text":"triangle","type":"fun","params":[{"p":"x1","o":false},{"p":"y1","o":false},{"p":"x2","o":false},{"p":"y2","o":false},{"p":"x3","o":false},{"p":"y3","o":false}],"p5":true},{"text":"ellipseMode","type":"fun","params":[{"p":"mode","o":false}],"p5":true},{"text":"noSmooth","type":"fun","p5":true},{"text":"rectMode","type":"fun","params":[{"p":"mode","o":false}],"p5":true},{"text":"smooth","type":"fun","p5":true},{"text":"strokeCap","type":"fun","params":[{"p":"cap","o":false}],"p5":true},{"text":"strokeJoin","type":"fun","params":[{"p":"join","o":false}],"p5":true},{"text":"strokeWeight","type":"fun","params":[{"p":"weight","o":false}],"p5":true},{"text":"bezier","type":"fun","p5":true},{"text":"bezierDetail","type":"fun","params":[{"p":"detail","o":false}],"p5":true},{"text":"bezierPoint","type":"fun","params":[{"p":"a","o":false},{"p":"b","o":false},{"p":"c","o":false},{"p":"d","o":false},{"p":"t","o":false}],"p5":true},{"text":"bezierTangent","type":"fun","params":[{"p":"a","o":false},{"p":"b","o":false},{"p":"c","o":false},{"p":"d","o":false},{"p":"t","o":false}],"p5":true},{"text":"curve","type":"fun","p5":true},{"text":"curveDetail","type":"fun","params":[{"p":"resolution","o":false}],"p5":true},{"text":"curveTightness","type":"fun","params":[{"p":"amount","o":false}],"p5":true},{"text":"curvePoint","type":"fun","params":[{"p":"a","o":false},{"p":"b","o":false},{"p":"c","o":false},{"p":"d","o":false},{"p":"t","o":false}],"p5":true},{"text":"curveTangent","type":"fun","params":[{"p":"a","o":false},{"p":"b","o":false},{"p":"c","o":false},{"p":"d","o":false},{"p":"t","o":false}],"p5":true},{"text":"beginContour","type":"fun","p5":true},{"text":"beginShape","type":"fun","params":[{"p":"kind","o":true}],"p5":true},{"text":"bezierVertex","type":"fun","p5":true},{"text":"curveVertex","type":"fun","p5":true},{"text":"endContour","type":"fun","p5":true},{"text":"endShape","type":"fun","params":[{"p":"mode","o":true},{"p":"count","o":true}],"p5":true},{"text":"quadraticVertex","type":"fun","p5":true},{"text":"vertex","type":"fun","p5":true},{"text":"normal","type":"fun","p5":true},{"text":"VERSION","type":"var","params":[],"p5":true},{"text":"P2D","type":"var","params":[],"p5":true},{"text":"WEBGL","type":"var","params":[],"p5":true},{"text":"WEBGL2","type":"var","params":[],"p5":true},{"text":"ARROW","type":"var","params":[],"p5":true},{"text":"CROSS","type":"var","params":[],"p5":true},{"text":"HAND","type":"var","params":[],"p5":true},{"text":"MOVE","type":"var","params":[],"p5":true},{"text":"TEXT","type":"var","params":[],"p5":true},{"text":"WAIT","type":"var","params":[],"p5":true},{"text":"HALF_PI","type":"var","params":[],"p5":true},{"text":"PI","type":"var","params":[],"p5":true},{"text":"QUARTER_PI","type":"var","params":[],"p5":true},{"text":"TAU","type":"var","params":[],"p5":true},{"text":"TWO_PI","type":"var","params":[],"p5":true},{"text":"DEGREES","type":"var","params":[],"p5":true},{"text":"RADIANS","type":"var","params":[],"p5":true},{"text":"CORNER","type":"var","params":[],"p5":true},{"text":"CORNERS","type":"var","params":[],"p5":true},{"text":"RADIUS","type":"var","params":[],"p5":true},{"text":"RIGHT","type":"var","params":[],"p5":true},{"text":"LEFT","type":"var","params":[],"p5":true},{"text":"CENTER","type":"var","params":[],"p5":true},{"text":"TOP","type":"var","params":[],"p5":true},{"text":"BOTTOM","type":"var","params":[],"p5":true},{"text":"BASELINE","type":"var","params":[],"p5":true},{"text":"POINTS","type":"var","params":[],"p5":true},{"text":"LINES","type":"var","params":[],"p5":true},{"text":"LINE_STRIP","type":"var","params":[],"p5":true},{"text":"LINE_LOOP","type":"var","params":[],"p5":true},{"text":"TRIANGLES","type":"var","params":[],"p5":true},{"text":"TRIANGLE_FAN","type":"var","params":[],"p5":true},{"text":"TRIANGLE_STRIP","type":"var","params":[],"p5":true},{"text":"QUADS","type":"var","params":[],"p5":true},{"text":"QUAD_STRIP","type":"var","params":[],"p5":true},{"text":"TESS","type":"var","params":[],"p5":true},{"text":"CLOSE","type":"var","params":[],"p5":true},{"text":"OPEN","type":"var","params":[],"p5":true},{"text":"CHORD","type":"var","params":[],"p5":true},{"text":"PIE","type":"var","params":[],"p5":true},{"text":"PROJECT","type":"var","params":[],"p5":true},{"text":"SQUARE","type":"var","params":[],"p5":true},{"text":"ROUND","type":"var","params":[],"p5":true},{"text":"BEVEL","type":"var","params":[],"p5":true},{"text":"MITER","type":"var","params":[],"p5":true},{"text":"RGB","type":"var","params":[],"p5":true},{"text":"HSB","type":"var","params":[],"p5":true},{"text":"HSL","type":"var","params":[],"p5":true},{"text":"AUTO","type":"var","params":[],"p5":true},{"text":"ALT","type":"var","params":[],"p5":true},{"text":"BACKSPACE","type":"var","params":[],"p5":true},{"text":"CONTROL","type":"var","params":[],"p5":true},{"text":"DELETE","type":"var","params":[],"p5":true},{"text":"DOWN_ARROW","type":"var","params":[],"p5":true},{"text":"ENTER","type":"var","params":[],"p5":true},{"text":"ESCAPE","type":"var","params":[],"p5":true},{"text":"LEFT_ARROW","type":"var","params":[],"p5":true},{"text":"OPTION","type":"var","params":[],"p5":true},{"text":"RETURN","type":"var","params":[],"p5":true},{"text":"RIGHT_ARROW","type":"var","params":[],"p5":true},{"text":"SHIFT","type":"var","params":[],"p5":true},{"text":"TAB","type":"var","params":[],"p5":true},{"text":"UP_ARROW","type":"var","params":[],"p5":true},{"text":"BLEND","type":"var","params":[],"p5":true},{"text":"REMOVE","type":"var","params":[],"p5":true},{"text":"ADD","type":"var","params":[],"p5":true},{"text":"DARKEST","type":"var","params":[],"p5":true},{"text":"LIGHTEST","type":"var","params":[],"p5":true},{"text":"DIFFERENCE","type":"var","params":[],"p5":true},{"text":"SUBTRACT","type":"var","params":[],"p5":true},{"text":"EXCLUSION","type":"var","params":[],"p5":true},{"text":"MULTIPLY","type":"var","params":[],"p5":true},{"text":"SCREEN","type":"var","params":[],"p5":true},{"text":"REPLACE","type":"var","params":[],"p5":true},{"text":"OVERLAY","type":"var","params":[],"p5":true},{"text":"HARD_LIGHT","type":"var","params":[],"p5":true},{"text":"SOFT_LIGHT","type":"var","params":[],"p5":true},{"text":"DODGE","type":"var","params":[],"p5":true},{"text":"BURN","type":"var","params":[],"p5":true},{"text":"THRESHOLD","type":"var","params":[],"p5":true},{"text":"GRAY","type":"var","params":[],"p5":true},{"text":"OPAQUE","type":"var","params":[],"p5":true},{"text":"INVERT","type":"var","params":[],"p5":true},{"text":"POSTERIZE","type":"var","params":[],"p5":true},{"text":"DILATE","type":"var","params":[],"p5":true},{"text":"ERODE","type":"var","params":[],"p5":true},{"text":"BLUR","type":"var","params":[],"p5":true},{"text":"NORMAL","type":"var","params":[],"p5":true},{"text":"ITALIC","type":"var","params":[],"p5":true},{"text":"BOLD","type":"var","params":[],"p5":true},{"text":"BOLDITALIC","type":"var","params":[],"p5":true},{"text":"CHAR","type":"var","params":[],"p5":true},{"text":"WORD","type":"var","params":[],"p5":true},{"text":"LINEAR","type":"var","params":[],"p5":true},{"text":"QUADRATIC","type":"var","params":[],"p5":true},{"text":"BEZIER","type":"var","params":[],"p5":true},{"text":"CURVE","type":"var","params":[],"p5":true},{"text":"STROKE","type":"var","params":[],"p5":true},{"text":"FILL","type":"var","params":[],"p5":true},{"text":"TEXTURE","type":"var","params":[],"p5":true},{"text":"IMMEDIATE","type":"var","params":[],"p5":true},{"text":"IMAGE","type":"var","params":[],"p5":true},{"text":"NEAREST","type":"var","params":[],"p5":true},{"text":"REPEAT","type":"var","params":[],"p5":true},{"text":"CLAMP","type":"var","params":[],"p5":true},{"text":"MIRROR","type":"var","params":[],"p5":true},{"text":"FLAT","type":"var","params":[],"p5":true},{"text":"SMOOTH","type":"var","params":[],"p5":true},{"text":"LANDSCAPE","type":"var","params":[],"p5":true},{"text":"PORTRAIT","type":"var","params":[],"p5":true},{"text":"GRID","type":"var","params":[],"p5":true},{"text":"AXES","type":"var","params":[],"p5":true},{"text":"LABEL","type":"var","params":[],"p5":true},{"text":"FALLBACK","type":"var","params":[],"p5":true},{"text":"CONTAIN","type":"var","params":[],"p5":true},{"text":"COVER","type":"var","params":[],"p5":true},{"text":"UNSIGNED_BYTE","type":"var","params":[],"p5":true},{"text":"UNSIGNED_INT","type":"var","params":[],"p5":true},{"text":"FLOAT","type":"var","params":[],"p5":true},{"text":"HALF_FLOAT","type":"var","params":[],"p5":true},{"text":"RGBA","type":"var","params":[],"p5":true},{"text":"print","type":"fun","params":[{"p":"contents","o":false}],"p5":true},{"text":"frameCount","type":"var","params":[],"p5":true},{"text":"deltaTime","type":"var","params":[],"p5":true},{"text":"focused","type":"var","params":[],"p5":true},{"text":"cursor","type":"fun","params":[{"p":"type","o":false},{"p":"x","o":true},{"p":"y","o":true}],"p5":true},{"text":"frameRate","type":"fun","p5":true},{"text":"getTargetFrameRate","type":"fun","p5":true},{"text":"noCursor","type":"fun","p5":true},{"text":"webglVersion","type":"var","params":[],"p5":true},{"text":"displayWidth","type":"var","params":[],"p5":true},{"text":"displayHeight","type":"var","params":[],"p5":true},{"text":"windowWidth","type":"var","params":[],"p5":true},{"text":"windowHeight","type":"var","params":[],"p5":true},{"text":"windowResized","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"width","type":"var","params":[],"p5":true},{"text":"height","type":"var","params":[],"p5":true},{"text":"fullscreen","type":"fun","params":[{"p":"val","o":true}],"p5":true},{"text":"pixelDensity","type":"fun","p5":true},{"text":"displayDensity","type":"fun","p5":true},{"text":"getURL","type":"fun","p5":true},{"text":"getURLPath","type":"fun","p5":true},{"text":"getURLParams","type":"fun","p5":true},{"text":"preload","type":"fun","p5":true},{"text":"setup","type":"fun","p5":true},{"text":"draw","type":"fun","p5":true},{"text":"remove","type":"fun","p5":true},{"text":"disableFriendlyErrors","type":"var","params":[],"p5":true},{"text":"createCanvas","type":"fun","p5":true},{"text":"resizeCanvas","type":"fun","params":[{"p":"width","o":false},{"p":"height","o":false},{"p":"noRedraw","o":true}],"p5":true},{"text":"noCanvas","type":"fun","p5":true},{"text":"createGraphics","type":"fun","p5":true},{"text":"createFramebuffer","type":"fun","params":[{"p":"options","o":true}],"p5":true},{"text":"clearDepth","type":"fun","params":[{"p":"depth","o":true}],"p5":true},{"text":"blendMode","type":"fun","params":[{"p":"mode","o":false}],"p5":true},{"text":"drawingContext","type":"var","params":[],"p5":true},{"text":"noLoop","type":"fun","p5":true},{"text":"loop","type":"fun","p5":true},{"text":"isLooping","type":"fun","p5":true},{"text":"push","type":"fun","p5":true},{"text":"pop","type":"fun","p5":true},{"text":"redraw","type":"fun","params":[{"p":"n","o":true}],"p5":true},{"text":"p5","type":"fun","params":[{"p":"sketch","o":false},{"p":"node","o":false}],"p5":true},{"text":"applyMatrix","type":"fun","p5":true},{"text":"resetMatrix","type":"fun","p5":true},{"text":"rotate","type":"fun","params":[{"p":"angle","o":false},{"p":"axis","o":true}],"p5":true},{"text":"rotateX","type":"fun","params":[{"p":"angle","o":false}],"p5":true},{"text":"rotateY","type":"fun","params":[{"p":"angle","o":false}],"p5":true},{"text":"rotateZ","type":"fun","params":[{"p":"angle","o":false}],"p5":true},{"text":"scale","type":"fun","p5":true},{"text":"shearX","type":"fun","params":[{"p":"angle","o":false}],"p5":true},{"text":"shearY","type":"fun","params":[{"p":"angle","o":false}],"p5":true},{"text":"translate","type":"fun","p5":true},{"text":"storeItem","type":"fun","params":[{"p":"key","o":false},{"p":"value","o":false}],"p5":true},{"text":"getItem","type":"fun","params":[{"p":"key","o":false}],"p5":true},{"text":"clearStorage","type":"fun","p5":true},{"text":"removeItem","type":"fun","params":[{"p":"key","o":false}],"p5":true},{"text":"createStringDict","type":"fun","p5":true},{"text":"createNumberDict","type":"fun","p5":true},{"text":"select","type":"fun","params":[{"p":"selectors","o":false},{"p":"container","o":true}],"p5":true},{"text":"selectAll","type":"fun","params":[{"p":"selectors","o":false},{"p":"container","o":true}],"p5":true},{"text":"removeElements","type":"fun","p5":true},{"text":"changed","type":"fun","params":[{"p":"fxn","o":false}],"p5":true},{"text":"input","type":"fun","params":[{"p":"fxn","o":false}],"p5":true},{"text":"createDiv","type":"fun","params":[{"p":"html","o":true}],"p5":true},{"text":"createP","type":"fun","params":[{"p":"html","o":true}],"p5":true},{"text":"createSpan","type":"fun","params":[{"p":"html","o":true}],"p5":true},{"text":"createImg","type":"fun","p5":true},{"text":"createA","type":"fun","params":[{"p":"href","o":false},{"p":"html","o":false},{"p":"target","o":true}],"p5":true},{"text":"createSlider","type":"fun","params":[{"p":"min","o":false},{"p":"max","o":false},{"p":"value","o":true},{"p":"step","o":true}],"p5":true},{"text":"createButton","type":"fun","params":[{"p":"label","o":false},{"p":"value","o":true}],"p5":true},{"text":"createCheckbox","type":"fun","params":[{"p":"label","o":true},{"p":"value","o":true}],"p5":true},{"text":"createSelect","type":"fun","p5":true},{"text":"createRadio","type":"fun","p5":true},{"text":"createColorPicker","type":"fun","params":[{"p":"value","o":true}],"p5":true},{"text":"createInput","type":"fun","p5":true},{"text":"createFileInput","type":"fun","params":[{"p":"callback","o":false},{"p":"multiple","o":true}],"p5":true},{"text":"createVideo","type":"fun","params":[{"p":"src","o":false},{"p":"callback","o":true}],"p5":true},{"text":"createAudio","type":"fun","params":[{"p":"src","o":true},{"p":"callback","o":true}],"p5":true},{"text":"createCapture","type":"fun","params":[{"p":"type","o":true},{"p":"flipped","o":true},{"p":"callback","o":true}],"p5":true},{"text":"createElement","type":"fun","params":[{"p":"tag","o":false},{"p":"content","o":true}],"p5":true},{"text":"deviceOrientation","type":"var","params":[],"p5":true},{"text":"accelerationX","type":"var","params":[],"p5":true},{"text":"accelerationY","type":"var","params":[],"p5":true},{"text":"accelerationZ","type":"var","params":[],"p5":true},{"text":"pAccelerationX","type":"var","params":[],"p5":true},{"text":"pAccelerationY","type":"var","params":[],"p5":true},{"text":"pAccelerationZ","type":"var","params":[],"p5":true},{"text":"rotationX","type":"var","params":[],"p5":true},{"text":"rotationY","type":"var","params":[],"p5":true},{"text":"rotationZ","type":"var","params":[],"p5":true},{"text":"pRotationX","type":"var","params":[],"p5":true},{"text":"pRotationY","type":"var","params":[],"p5":true},{"text":"pRotationZ","type":"var","params":[],"p5":true},{"text":"turnAxis","type":"var","params":[],"p5":true},{"text":"setMoveThreshold","type":"fun","params":[{"p":"value","o":false}],"p5":true},{"text":"setShakeThreshold","type":"fun","params":[{"p":"value","o":false}],"p5":true},{"text":"deviceMoved","type":"fun","p5":true},{"text":"deviceTurned","type":"fun","p5":true},{"text":"deviceShaken","type":"fun","p5":true},{"text":"keyIsPressed","type":"var","params":[],"p5":true},{"text":"key","type":"var","params":[],"p5":true},{"text":"keyCode","type":"var","params":[],"p5":true},{"text":"keyPressed","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"keyReleased","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"keyTyped","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"keyIsDown","type":"fun","params":[{"p":"code","o":false}],"p5":true},{"text":"movedX","type":"var","params":[],"p5":true},{"text":"movedY","type":"var","params":[],"p5":true},{"text":"mouseX","type":"var","params":[],"p5":true},{"text":"mouseY","type":"var","params":[],"p5":true},{"text":"pmouseX","type":"var","params":[],"p5":true},{"text":"pmouseY","type":"var","params":[],"p5":true},{"text":"winMouseX","type":"var","params":[],"p5":true},{"text":"winMouseY","type":"var","params":[],"p5":true},{"text":"pwinMouseX","type":"var","params":[],"p5":true},{"text":"pwinMouseY","type":"var","params":[],"p5":true},{"text":"mouseButton","type":"var","params":[],"p5":true},{"text":"mouseIsPressed","type":"var","params":[],"p5":true},{"text":"mouseMoved","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"mouseDragged","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"mousePressed","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"mouseReleased","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"mouseClicked","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"doubleClicked","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"mouseWheel","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"requestPointerLock","type":"fun","p5":true},{"text":"exitPointerLock","type":"fun","p5":true},{"text":"touches","type":"var","params":[],"p5":true},{"text":"touchStarted","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"touchMoved","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"touchEnded","type":"fun","params":[{"p":"event","o":true}],"p5":true},{"text":"createImage","type":"fun","params":[{"p":"width","o":false},{"p":"height","o":false}],"p5":true},{"text":"saveCanvas","type":"fun","p5":true},{"text":"saveFrames","type":"fun","params":[{"p":"filename","o":false},{"p":"extension","o":false},{"p":"duration","o":false},{"p":"framerate","o":false},{"p":"callback","o":true}],"p5":true},{"text":"loadImage","type":"fun","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"failureCallback","o":true}],"p5":true},{"text":"saveGif","type":"fun","params":[{"p":"filename","o":false},{"p":"duration","o":false},{"p":"options","o":true}],"p5":true},{"text":"image","type":"fun","p5":true},{"text":"tint","type":"fun","p5":true},{"text":"noTint","type":"fun","p5":true},{"text":"imageMode","type":"fun","params":[{"p":"mode","o":false}],"p5":true},{"text":"pixels","type":"var","params":[],"p5":true},{"text":"blend","type":"fun","p5":true},{"text":"copy","type":"fun","p5":true},{"text":"filter","type":"fun","p5":true},{"text":"get","type":"fun","p5":true},{"text":"loadPixels","type":"fun","p5":true},{"text":"set","type":"fun","params":[{"p":"x","o":false},{"p":"y","o":false},{"p":"c","o":false}],"p5":true},{"text":"updatePixels","type":"fun","params":[{"p":"x","o":true},{"p":"y","o":true},{"p":"w","o":true},{"p":"h","o":true}],"p5":true},{"text":"loadJSON","type":"fun","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"errorCallback","o":true}],"p5":true},{"text":"loadStrings","type":"fun","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"errorCallback","o":true}],"p5":true},{"text":"loadTable","type":"fun","params":[{"p":"filename","o":false},{"p":"extension","o":true},{"p":"header","o":true},{"p":"callback","o":true},{"p":"errorCallback","o":true}],"p5":true},{"text":"loadXML","type":"fun","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"errorCallback","o":true}],"p5":true},{"text":"loadBytes","type":"fun","params":[{"p":"file","o":false},{"p":"callback","o":true},{"p":"errorCallback","o":true}],"p5":true},{"text":"httpGet","type":"fun","p5":true},{"text":"httpPost","type":"fun","p5":true},{"text":"httpDo","type":"fun","p5":true},{"text":"createWriter","type":"fun","params":[{"p":"name","o":false},{"p":"extension","o":true}],"p5":true},{"text":"save","type":"fun","params":[{"p":"objectOrFilename","o":true},{"p":"filename","o":true},{"p":"options","o":true}],"p5":true},{"text":"saveJSON","type":"fun","params":[{"p":"json","o":false},{"p":"filename","o":false},{"p":"optimize","o":true}],"p5":true},{"text":"saveStrings","type":"fun","params":[{"p":"list","o":false},{"p":"filename","o":false},{"p":"extension","o":true},{"p":"isCRLF","o":true}],"p5":true},{"text":"saveTable","type":"fun","params":[{"p":"Table","o":false},{"p":"filename","o":false},{"p":"options","o":true}],"p5":true},{"text":"abs","type":"fun","params":[{"p":"n","o":false}],"p5":true},{"text":"ceil","type":"fun","params":[{"p":"n","o":false}],"p5":true},{"text":"constrain","type":"fun","params":[{"p":"n","o":false},{"p":"low","o":false},{"p":"high","o":false}],"p5":true},{"text":"dist","type":"fun","p5":true},{"text":"exp","type":"fun","params":[{"p":"n","o":false}],"p5":true},{"text":"floor","type":"fun","params":[{"p":"n","o":false}],"p5":true},{"text":"lerp","type":"fun","params":[{"p":"start","o":false},{"p":"stop","o":false},{"p":"amt","o":false}],"p5":true},{"text":"log","type":"fun","params":[{"p":"n","o":false}],"p5":true},{"text":"mag","type":"fun","params":[{"p":"x","o":false},{"p":"y","o":false}],"p5":true},{"text":"map","type":"fun","params":[{"p":"value","o":false},{"p":"start1","o":false},{"p":"stop1","o":false},{"p":"start2","o":false},{"p":"stop2","o":false},{"p":"withinBounds","o":true}],"p5":true},{"text":"max","type":"fun","p5":true},{"text":"min","type":"fun","p5":true},{"text":"norm","type":"fun","params":[{"p":"value","o":false},{"p":"start","o":false},{"p":"stop","o":false}],"p5":true},{"text":"pow","type":"fun","params":[{"p":"n","o":false},{"p":"e","o":false}],"p5":true},{"text":"round","type":"fun","params":[{"p":"n","o":false},{"p":"decimals","o":true}],"p5":true},{"text":"sq","type":"fun","params":[{"p":"n","o":false}],"p5":true},{"text":"sqrt","type":"fun","params":[{"p":"n","o":false}],"p5":true},{"text":"fract","type":"fun","params":[{"p":"n","o":false}],"p5":true},{"text":"createVector","type":"fun","params":[{"p":"x","o":true},{"p":"y","o":true},{"p":"z","o":true}],"p5":true},{"text":"noise","type":"fun","params":[{"p":"x","o":false},{"p":"y","o":true},{"p":"z","o":true}],"p5":true},{"text":"noiseDetail","type":"fun","params":[{"p":"lod","o":false},{"p":"falloff","o":false}],"p5":true},{"text":"noiseSeed","type":"fun","params":[{"p":"seed","o":false}],"p5":true},{"text":"randomSeed","type":"fun","params":[{"p":"seed","o":false}],"p5":true},{"text":"random","type":"fun","p5":true},{"text":"randomGaussian","type":"fun","params":[{"p":"mean","o":true},{"p":"sd","o":true}],"p5":true},{"text":"acos","type":"fun","params":[{"p":"value","o":false}],"p5":true},{"text":"asin","type":"fun","params":[{"p":"value","o":false}],"p5":true},{"text":"atan","type":"fun","params":[{"p":"value","o":false}],"p5":true},{"text":"atan2","type":"fun","params":[{"p":"y","o":false},{"p":"x","o":false}],"p5":true},{"text":"cos","type":"fun","params":[{"p":"angle","o":false}],"p5":true},{"text":"sin","type":"fun","params":[{"p":"angle","o":false}],"p5":true},{"text":"tan","type":"fun","params":[{"p":"angle","o":false}],"p5":true},{"text":"degrees","type":"fun","params":[{"p":"radians","o":false}],"p5":true},{"text":"radians","type":"fun","params":[{"p":"degrees","o":false}],"p5":true},{"text":"angleMode","type":"fun","p5":true},{"text":"textAlign","type":"fun","p5":true},{"text":"textLeading","type":"fun","p5":true},{"text":"textSize","type":"fun","p5":true},{"text":"textStyle","type":"fun","p5":true},{"text":"textWidth","type":"fun","params":[{"p":"str","o":false}],"p5":true},{"text":"textAscent","type":"fun","p5":true},{"text":"textDescent","type":"fun","p5":true},{"text":"textWrap","type":"fun","params":[{"p":"style","o":false}],"p5":true},{"text":"loadFont","type":"fun","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"failureCallback","o":true}],"p5":true},{"text":"text","type":"fun","params":[{"p":"str","o":false},{"p":"x","o":false},{"p":"y","o":false},{"p":"maxWidth","o":true},{"p":"maxHeight","o":true}],"p5":true},{"text":"textFont","type":"fun","p5":true},{"text":"append","type":"fun","params":[{"p":"array","o":false},{"p":"value","o":false}],"p5":true},{"text":"arrayCopy","type":"fun","p5":true},{"text":"concat","type":"fun","params":[{"p":"a","o":false},{"p":"b","o":false}],"p5":true},{"text":"reverse","type":"fun","params":[{"p":"list","o":false}],"p5":true},{"text":"shorten","type":"fun","params":[{"p":"list","o":false}],"p5":true},{"text":"shuffle","type":"fun","params":[{"p":"array","o":false},{"p":"bool","o":true}],"p5":true},{"text":"sort","type":"fun","params":[{"p":"list","o":false},{"p":"count","o":true}],"p5":true},{"text":"splice","type":"fun","params":[{"p":"list","o":false},{"p":"value","o":false},{"p":"position","o":false}],"p5":true},{"text":"subset","type":"fun","params":[{"p":"list","o":false},{"p":"start","o":false},{"p":"count","o":true}],"p5":true},{"text":"float","type":"fun","p5":true},{"text":"int","type":"fun","p5":true},{"text":"str","type":"fun","params":[{"p":"n","o":false}],"p5":true},{"text":"boolean","type":"fun","p5":true},{"text":"byte","type":"fun","p5":true},{"text":"char","type":"fun","p5":true},{"text":"unchar","type":"fun","p5":true},{"text":"hex","type":"fun","p5":true},{"text":"unhex","type":"fun","p5":true},{"text":"join","type":"fun","params":[{"p":"list","o":false},{"p":"separator","o":false}],"p5":true},{"text":"match","type":"fun","params":[{"p":"str","o":false},{"p":"regexp","o":false}],"p5":true},{"text":"matchAll","type":"fun","params":[{"p":"str","o":false},{"p":"regexp","o":false}],"p5":true},{"text":"nf","type":"fun","p5":true},{"text":"nfc","type":"fun","p5":true},{"text":"nfp","type":"fun","p5":true},{"text":"nfs","type":"fun","p5":true},{"text":"split","type":"fun","params":[{"p":"value","o":false},{"p":"delim","o":false}],"p5":true},{"text":"splitTokens","type":"fun","params":[{"p":"value","o":false},{"p":"delim","o":true}],"p5":true},{"text":"trim","type":"fun","p5":true},{"text":"day","type":"fun","p5":true},{"text":"hour","type":"fun","p5":true},{"text":"minute","type":"fun","p5":true},{"text":"millis","type":"fun","p5":true},{"text":"month","type":"fun","p5":true},{"text":"second","type":"fun","p5":true},{"text":"year","type":"fun","p5":true},{"text":"beginGeometry","type":"fun","p5":true},{"text":"endGeometry","type":"fun","p5":true},{"text":"buildGeometry","type":"fun","params":[{"p":"callback","o":false}],"p5":true},{"text":"freeGeometry","type":"fun","params":[{"p":"geometry","o":false}],"p5":true},{"text":"plane","type":"fun","params":[{"p":"width","o":true},{"p":"height","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5":true},{"text":"box","type":"fun","params":[{"p":"width","o":true},{"p":"height","o":true},{"p":"depth","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5":true},{"text":"sphere","type":"fun","params":[{"p":"radius","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5":true},{"text":"cylinder","type":"fun","params":[{"p":"radius","o":true},{"p":"height","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true},{"p":"bottomCap","o":true},{"p":"topCap","o":true}],"p5":true},{"text":"cone","type":"fun","params":[{"p":"radius","o":true},{"p":"height","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true},{"p":"cap","o":true}],"p5":true},{"text":"ellipsoid","type":"fun","params":[{"p":"radiusX","o":true},{"p":"radiusY","o":true},{"p":"radiusZ","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5":true},{"text":"torus","type":"fun","params":[{"p":"radius","o":true},{"p":"tubeRadius","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5":true},{"text":"orbitControl","type":"fun","params":[{"p":"sensitivityX","o":true},{"p":"sensitivityY","o":true},{"p":"sensitivityZ","o":true},{"p":"options","o":true}],"p5":true},{"text":"debugMode","type":"fun","p5":true},{"text":"noDebugMode","type":"fun","p5":true},{"text":"ambientLight","type":"fun","p5":true},{"text":"specularColor","type":"fun","p5":true},{"text":"directionalLight","type":"fun","p5":true},{"text":"pointLight","type":"fun","p5":true},{"text":"imageLight","type":"fun","params":[{"p":"img","o":false}],"p5":true},{"text":"panorama","type":"fun","params":[{"p":"img","o":false}],"p5":true},{"text":"lights","type":"fun","p5":true},{"text":"lightFalloff","type":"fun","params":[{"p":"constant","o":false},{"p":"linear","o":false},{"p":"quadratic","o":false}],"p5":true},{"text":"spotLight","type":"fun","p5":true},{"text":"noLights","type":"fun","p5":true},{"text":"loadModel","type":"fun","p5":true},{"text":"model","type":"fun","params":[{"p":"model","o":false}],"p5":true},{"text":"loadShader","type":"fun","params":[{"p":"vertFilename","o":false},{"p":"fragFilename","o":false},{"p":"successCallback","o":true},{"p":"failureCallback","o":true}],"p5":true},{"text":"createShader","type":"fun","params":[{"p":"vertSrc","o":false},{"p":"fragSrc","o":false}],"p5":true},{"text":"createFilterShader","type":"fun","params":[{"p":"fragSrc","o":false}],"p5":true},{"text":"shader","type":"fun","params":[{"p":"s","o":false}],"p5":true},{"text":"resetShader","type":"fun","p5":true},{"text":"texture","type":"fun","params":[{"p":"tex","o":false}],"p5":true},{"text":"textureMode","type":"fun","params":[{"p":"mode","o":false}],"p5":true},{"text":"textureWrap","type":"fun","params":[{"p":"wrapX","o":false},{"p":"wrapY","o":true}],"p5":true},{"text":"normalMaterial","type":"fun","p5":true},{"text":"ambientMaterial","type":"fun","p5":true},{"text":"emissiveMaterial","type":"fun","p5":true},{"text":"specularMaterial","type":"fun","p5":true},{"text":"shininess","type":"fun","params":[{"p":"shine","o":false}],"p5":true},{"text":"metalness","type":"fun","params":[{"p":"metallic","o":false}],"p5":true},{"text":"camera","type":"fun","params":[{"p":"x","o":true},{"p":"y","o":true},{"p":"z","o":true},{"p":"centerX","o":true},{"p":"centerY","o":true},{"p":"centerZ","o":true},{"p":"upX","o":true},{"p":"upY","o":true},{"p":"upZ","o":true}],"p5":true},{"text":"perspective","type":"fun","params":[{"p":"fovy","o":true},{"p":"aspect","o":true},{"p":"near","o":true},{"p":"far","o":true}],"p5":true},{"text":"linePerspective","type":"fun","p5":true},{"text":"ortho","type":"fun","params":[{"p":"left","o":true},{"p":"right","o":true},{"p":"bottom","o":true},{"p":"top","o":true},{"p":"near","o":true},{"p":"far","o":true}],"p5":true},{"text":"frustum","type":"fun","params":[{"p":"left","o":true},{"p":"right","o":true},{"p":"bottom","o":true},{"p":"top","o":true},{"p":"near","o":true},{"p":"far","o":true}],"p5":true},{"text":"createCamera","type":"fun","p5":true},{"text":"setCamera","type":"fun","params":[{"p":"cam","o":false}],"p5":true},{"text":"setAttributes","type":"fun","p5":true},{"text":"getAudioContext","type":"fun","p5":true},{"text":"userStartAudio","type":"fun","params":[{"p":"elements","o":true},{"p":"callback","o":true}],"p5":true},{"text":"getOutputVolume","type":"fun","p5":true},{"text":"outputVolume","type":"fun","params":[{"p":"volume","o":false},{"p":"rampTime","o":true},{"p":"timeFromNow","o":true}],"p5":true},{"text":"soundOut","type":"var","params":[],"p5":true},{"text":"sampleRate","type":"fun","p5":true},{"text":"freqToMidi","type":"fun","params":[{"p":"frequency","o":false}],"p5":true},{"text":"midiToFreq","type":"fun","params":[{"p":"midiNote","o":false}],"p5":true},{"text":"soundFormats","type":"fun","params":[{"p":"formats","o":true}],"p5":true},{"text":"saveSound","type":"fun","params":[{"p":"soundFile","o":false},{"p":"fileName","o":false}],"p5":true},{"text":"loadSound","type":"fun","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"errorCallback","o":true},{"p":"whileLoading","o":true}],"p5":true},{"text":"createConvolver","type":"fun","params":[{"p":"path","o":false},{"p":"callback","o":true},{"p":"errorCallback","o":true}],"p5":true},{"text":"setBPM","type":"fun","params":[{"p":"BPM","o":false},{"p":"rampTime","o":false}],"p5":true},{"text":"true","type":"boolean","p5":"boolean"},{"text":"false","type":"boolean","p5":"boolean"},{"text":"await","type":"keyword","p5":false},{"text":"break","type":"keyword","p5":false},{"text":"case","type":"keyword","p5":false},{"text":"catch","type":"keyword","p5":false},{"text":"class","type":"keyword","p5":"class"},{"text":"const","type":"keyword","p5":"const"},{"text":"continue","type":"keyword","p5":false},{"text":"debugger","type":"keyword","p5":false},{"text":"default","type":"keyword","p5":false},{"text":"delete","type":"keyword","p5":false},{"text":"do","type":"keyword","p5":false},{"text":"else","type":"keyword","p5":"if-else"},{"text":"export","type":"keyword","p5":false},{"text":"extends","type":"keyword","p5":false},{"text":"finally","type":"keyword","p5":false},{"text":"for","type":"keyword","p5":"for"},{"text":"function","type":"keyword","p5":"function"},{"text":"if","type":"keyword","p5":"if-else"},{"text":"import","type":"keyword","p5":false},{"text":"in","type":"keyword","p5":false},{"text":"instanceof","type":"keyword","p5":false},{"text":"new","type":"keyword","p5":false},{"text":"return","type":"keyword","p5":"return"},{"text":"super","type":"keyword","p5":false},{"text":"switch","type":"keyword","p5":false},{"text":"this","type":"keyword","p5":false},{"text":"throw","type":"keyword","p5":false},{"text":"try","type":"keyword","p5":false},{"text":"typeof","type":"keyword","p5":false},{"text":"var","type":"keyword","p5":false},{"text":"void","type":"keyword","p5":false},{"text":"while","type":"keyword","p5":"while"},{"text":"with","type":"keyword","p5":false},{"text":"yield","type":"keyword","p5":false},{"text":"let","type":"keyword","p5":"let"},{"text":"Array","type":"obj","p5":false},{"text":"Boolean","type":"obj","p5":false},{"text":"Date","type":"obj","p5":false},{"text":"Error","type":"obj","p5":false},{"text":"Function","type":"obj","p5":false},{"text":"JSON","type":"obj","p5":"JSON"},{"text":"Math","type":"obj","p5":false},{"text":"Number","type":"obj","p5":false},{"text":"Object","type":"obj","p5":false},{"text":"RegExp","type":"obj","p5":false},{"text":"String","type":"obj","p5":false},{"text":"Promise","type":"obj","p5":false},{"text":"Set","type":"obj","p5":false},{"text":"Map","type":"obj","p5":false},{"text":"Symbol","type":"obj","p5":false},{"text":"WeakMap","type":"obj","p5":false},{"text":"WeakSet","type":"obj","p5":false},{"text":"ArrayBuffer","type":"obj","p5":false},{"text":"DataView","type":"obj","p5":false},{"text":"Int32Array","type":"obj","p5":false},{"text":"Uint32Array","type":"obj","p5":false},{"text":"Float32Array","type":"obj","p5":false},{"text":"window","type":"obj","p5":false},{"text":"document","type":"obj","p5":false},{"text":"navigator","type":"obj","p5":false},{"text":"console","type":"obj","p5":"console"},{"text":"localStorage","type":"obj","p5":false},{"text":"sessionStorage","type":"obj","p5":false},{"text":"history","type":"obj","p5":false},{"text":"location","type":"obj","p5":false}]; +exports.p5Hinter = [{"label":"describe","type":"method","params":[{"p":"text","o":false},{"p":"display","o":true}],"p5DocPath":"describe"},{"label":"describeElement","type":"method","params":[{"p":"name","o":false},{"p":"text","o":false},{"p":"display","o":true}],"p5DocPath":"describeElement"},{"label":"textOutput","type":"method","params":[{"p":"display","o":true}],"p5DocPath":"textOutput"},{"label":"gridOutput","type":"method","params":[{"p":"display","o":true}],"p5DocPath":"gridOutput"},{"label":"alpha","type":"method","params":[{"p":"color","o":false}],"p5DocPath":"alpha"},{"label":"blue","type":"method","params":[{"p":"color","o":false}],"p5DocPath":"blue"},{"label":"brightness","type":"method","params":[{"p":"color","o":false}],"p5DocPath":"brightness"},{"label":"color","type":"method","p5DocPath":"color"},{"label":"green","type":"method","params":[{"p":"color","o":false}],"p5DocPath":"green"},{"label":"hue","type":"method","params":[{"p":"color","o":false}],"p5DocPath":"hue"},{"label":"lerpColor","type":"method","params":[{"p":"c1","o":false},{"p":"c2","o":false},{"p":"amt","o":false}],"p5DocPath":"lerpColor"},{"label":"paletteLerp","type":"method","params":[{"p":"colors_stops","o":false},{"p":"amt","o":false}],"p5DocPath":"paletteLerp"},{"label":"lightness","type":"method","params":[{"p":"color","o":false}],"p5DocPath":"lightness"},{"label":"red","type":"method","params":[{"p":"color","o":false}],"p5DocPath":"red"},{"label":"saturation","type":"method","params":[{"p":"color","o":false}],"p5DocPath":"saturation"},{"label":"beginClip","type":"method","params":[{"p":"options","o":true}],"p5DocPath":"beginClip"},{"label":"endClip","type":"method","p5DocPath":"endClip"},{"label":"clip","type":"method","params":[{"p":"callback","o":false},{"p":"options","o":true}],"p5DocPath":"clip"},{"label":"background","type":"method","p5DocPath":"background"},{"label":"clear","type":"method","params":[{"p":"r","o":true},{"p":"g","o":true},{"p":"b","o":true},{"p":"a","o":true}],"p5DocPath":"clear"},{"label":"colorMode","type":"method","p5DocPath":"colorMode"},{"label":"fill","type":"method","p5DocPath":"fill"},{"label":"noFill","type":"method","p5DocPath":"noFill"},{"label":"noStroke","type":"method","p5DocPath":"noStroke"},{"label":"stroke","type":"method","p5DocPath":"stroke"},{"label":"erase","type":"method","params":[{"p":"strengthFill","o":true},{"p":"strengthStroke","o":true}],"p5DocPath":"erase"},{"label":"noErase","type":"method","p5DocPath":"noErase"},{"label":"arc","type":"method","params":[{"p":"x","o":false},{"p":"y","o":false},{"p":"w","o":false},{"p":"h","o":false},{"p":"start","o":false},{"p":"stop","o":false},{"p":"mode","o":true},{"p":"detail","o":true}],"p5DocPath":"arc"},{"label":"ellipse","type":"method","p5DocPath":"ellipse"},{"label":"circle","type":"method","params":[{"p":"x","o":false},{"p":"y","o":false},{"p":"d","o":false}],"p5DocPath":"circle"},{"label":"line","type":"method","p5DocPath":"line"},{"label":"point","type":"method","p5DocPath":"point"},{"label":"quad","type":"method","p5DocPath":"quad"},{"label":"rect","type":"method","p5DocPath":"rect"},{"label":"square","type":"method","params":[{"p":"x","o":false},{"p":"y","o":false},{"p":"s","o":false},{"p":"tl","o":true},{"p":"tr","o":true},{"p":"br","o":true},{"p":"bl","o":true}],"p5DocPath":"square"},{"label":"triangle","type":"method","params":[{"p":"x1","o":false},{"p":"y1","o":false},{"p":"x2","o":false},{"p":"y2","o":false},{"p":"x3","o":false},{"p":"y3","o":false}],"p5DocPath":"triangle"},{"label":"ellipseMode","type":"method","params":[{"p":"mode","o":false}],"p5DocPath":"ellipseMode"},{"label":"noSmooth","type":"method","p5DocPath":"noSmooth"},{"label":"rectMode","type":"method","params":[{"p":"mode","o":false}],"p5DocPath":"rectMode"},{"label":"smooth","type":"method","p5DocPath":"smooth"},{"label":"strokeCap","type":"method","params":[{"p":"cap","o":false}],"p5DocPath":"strokeCap"},{"label":"strokeJoin","type":"method","params":[{"p":"join","o":false}],"p5DocPath":"strokeJoin"},{"label":"strokeWeight","type":"method","params":[{"p":"weight","o":false}],"p5DocPath":"strokeWeight"},{"label":"bezier","type":"method","p5DocPath":"bezier"},{"label":"bezierDetail","type":"method","params":[{"p":"detail","o":false}],"p5DocPath":"bezierDetail"},{"label":"bezierPoint","type":"method","params":[{"p":"a","o":false},{"p":"b","o":false},{"p":"c","o":false},{"p":"d","o":false},{"p":"t","o":false}],"p5DocPath":"bezierPoint"},{"label":"bezierTangent","type":"method","params":[{"p":"a","o":false},{"p":"b","o":false},{"p":"c","o":false},{"p":"d","o":false},{"p":"t","o":false}],"p5DocPath":"bezierTangent"},{"label":"curve","type":"method","p5DocPath":"curve"},{"label":"curveDetail","type":"method","params":[{"p":"resolution","o":false}],"p5DocPath":"curveDetail"},{"label":"curveTightness","type":"method","params":[{"p":"amount","o":false}],"p5DocPath":"curveTightness"},{"label":"curvePoint","type":"method","params":[{"p":"a","o":false},{"p":"b","o":false},{"p":"c","o":false},{"p":"d","o":false},{"p":"t","o":false}],"p5DocPath":"curvePoint"},{"label":"curveTangent","type":"method","params":[{"p":"a","o":false},{"p":"b","o":false},{"p":"c","o":false},{"p":"d","o":false},{"p":"t","o":false}],"p5DocPath":"curveTangent"},{"label":"beginContour","type":"method","p5DocPath":"beginContour"},{"label":"beginShape","type":"method","params":[{"p":"kind","o":true}],"p5DocPath":"beginShape"},{"label":"bezierVertex","type":"method","p5DocPath":"bezierVertex"},{"label":"curveVertex","type":"method","p5DocPath":"curveVertex"},{"label":"endContour","type":"method","p5DocPath":"endContour"},{"label":"endShape","type":"method","params":[{"p":"mode","o":true},{"p":"count","o":true}],"p5DocPath":"endShape"},{"label":"quadraticVertex","type":"method","p5DocPath":"quadraticVertex"},{"label":"vertex","type":"method","p5DocPath":"vertex"},{"label":"normal","type":"method","p5DocPath":"normal"},{"label":"VERSION","type":"constant","params":[],"p5DocPath":"VERSION"},{"label":"P2D","type":"constant","params":[],"p5DocPath":"P2D"},{"label":"WEBGL","type":"constant","params":[],"p5DocPath":"WEBGL"},{"label":"WEBGL2","type":"constant","params":[],"p5DocPath":"WEBGL2"},{"label":"ARROW","type":"constant","params":[],"p5DocPath":"ARROW"},{"label":"CROSS","type":"constant","params":[],"p5DocPath":"CROSS"},{"label":"HAND","type":"constant","params":[],"p5DocPath":"HAND"},{"label":"MOVE","type":"constant","params":[],"p5DocPath":"MOVE"},{"label":"TEXT","type":"constant","params":[],"p5DocPath":"TEXT"},{"label":"WAIT","type":"constant","params":[],"p5DocPath":"WAIT"},{"label":"HALF_PI","type":"constant","params":[],"p5DocPath":"HALF_PI"},{"label":"PI","type":"constant","params":[],"p5DocPath":"PI"},{"label":"QUARTER_PI","type":"constant","params":[],"p5DocPath":"QUARTER_PI"},{"label":"TAU","type":"constant","params":[],"p5DocPath":"TAU"},{"label":"TWO_PI","type":"constant","params":[],"p5DocPath":"TWO_PI"},{"label":"DEGREES","type":"constant","params":[],"p5DocPath":"DEGREES"},{"label":"RADIANS","type":"constant","params":[],"p5DocPath":"RADIANS"},{"label":"CORNER","type":"constant","params":[],"p5DocPath":"CORNER"},{"label":"CORNERS","type":"constant","params":[],"p5DocPath":"CORNERS"},{"label":"RADIUS","type":"constant","params":[],"p5DocPath":"RADIUS"},{"label":"RIGHT","type":"constant","params":[],"p5DocPath":"RIGHT"},{"label":"LEFT","type":"constant","params":[],"p5DocPath":"LEFT"},{"label":"CENTER","type":"constant","params":[],"p5DocPath":"CENTER"},{"label":"TOP","type":"constant","params":[],"p5DocPath":"TOP"},{"label":"BOTTOM","type":"constant","params":[],"p5DocPath":"BOTTOM"},{"label":"BASELINE","type":"constant","params":[],"p5DocPath":"BASELINE"},{"label":"POINTS","type":"constant","params":[],"p5DocPath":"POINTS"},{"label":"LINES","type":"constant","params":[],"p5DocPath":"LINES"},{"label":"LINE_STRIP","type":"constant","params":[],"p5DocPath":"LINE_STRIP"},{"label":"LINE_LOOP","type":"constant","params":[],"p5DocPath":"LINE_LOOP"},{"label":"TRIANGLES","type":"constant","params":[],"p5DocPath":"TRIANGLES"},{"label":"TRIANGLE_FAN","type":"constant","params":[],"p5DocPath":"TRIANGLE_FAN"},{"label":"TRIANGLE_STRIP","type":"constant","params":[],"p5DocPath":"TRIANGLE_STRIP"},{"label":"QUADS","type":"constant","params":[],"p5DocPath":"QUADS"},{"label":"QUAD_STRIP","type":"constant","params":[],"p5DocPath":"QUAD_STRIP"},{"label":"TESS","type":"constant","params":[],"p5DocPath":"TESS"},{"label":"CLOSE","type":"constant","params":[],"p5DocPath":"CLOSE"},{"label":"OPEN","type":"constant","params":[],"p5DocPath":"OPEN"},{"label":"CHORD","type":"constant","params":[],"p5DocPath":"CHORD"},{"label":"PIE","type":"constant","params":[],"p5DocPath":"PIE"},{"label":"PROJECT","type":"constant","params":[],"p5DocPath":"PROJECT"},{"label":"SQUARE","type":"constant","params":[],"p5DocPath":"SQUARE"},{"label":"ROUND","type":"constant","params":[],"p5DocPath":"ROUND"},{"label":"BEVEL","type":"constant","params":[],"p5DocPath":"BEVEL"},{"label":"MITER","type":"constant","params":[],"p5DocPath":"MITER"},{"label":"RGB","type":"constant","params":[],"p5DocPath":"RGB"},{"label":"HSB","type":"constant","params":[],"p5DocPath":"HSB"},{"label":"HSL","type":"constant","params":[],"p5DocPath":"HSL"},{"label":"AUTO","type":"constant","params":[],"p5DocPath":"AUTO"},{"label":"ALT","type":"constant","params":[],"p5DocPath":"ALT"},{"label":"BACKSPACE","type":"constant","params":[],"p5DocPath":"BACKSPACE"},{"label":"CONTROL","type":"constant","params":[],"p5DocPath":"CONTROL"},{"label":"DELETE","type":"constant","params":[],"p5DocPath":"DELETE"},{"label":"DOWN_ARROW","type":"constant","params":[],"p5DocPath":"DOWN_ARROW"},{"label":"ENTER","type":"constant","params":[],"p5DocPath":"ENTER"},{"label":"ESCAPE","type":"constant","params":[],"p5DocPath":"ESCAPE"},{"label":"LEFT_ARROW","type":"constant","params":[],"p5DocPath":"LEFT_ARROW"},{"label":"OPTION","type":"constant","params":[],"p5DocPath":"OPTION"},{"label":"RETURN","type":"constant","params":[],"p5DocPath":"RETURN"},{"label":"RIGHT_ARROW","type":"constant","params":[],"p5DocPath":"RIGHT_ARROW"},{"label":"SHIFT","type":"constant","params":[],"p5DocPath":"SHIFT"},{"label":"TAB","type":"constant","params":[],"p5DocPath":"TAB"},{"label":"UP_ARROW","type":"constant","params":[],"p5DocPath":"UP_ARROW"},{"label":"BLEND","type":"constant","params":[],"p5DocPath":"BLEND"},{"label":"REMOVE","type":"constant","params":[],"p5DocPath":"REMOVE"},{"label":"ADD","type":"constant","params":[],"p5DocPath":"ADD"},{"label":"DARKEST","type":"constant","params":[],"p5DocPath":"DARKEST"},{"label":"LIGHTEST","type":"constant","params":[],"p5DocPath":"LIGHTEST"},{"label":"DIFFERENCE","type":"constant","params":[],"p5DocPath":"DIFFERENCE"},{"label":"SUBTRACT","type":"constant","params":[],"p5DocPath":"SUBTRACT"},{"label":"EXCLUSION","type":"constant","params":[],"p5DocPath":"EXCLUSION"},{"label":"MULTIPLY","type":"constant","params":[],"p5DocPath":"MULTIPLY"},{"label":"SCREEN","type":"constant","params":[],"p5DocPath":"SCREEN"},{"label":"REPLACE","type":"constant","params":[],"p5DocPath":"REPLACE"},{"label":"OVERLAY","type":"constant","params":[],"p5DocPath":"OVERLAY"},{"label":"HARD_LIGHT","type":"constant","params":[],"p5DocPath":"HARD_LIGHT"},{"label":"SOFT_LIGHT","type":"constant","params":[],"p5DocPath":"SOFT_LIGHT"},{"label":"DODGE","type":"constant","params":[],"p5DocPath":"DODGE"},{"label":"BURN","type":"constant","params":[],"p5DocPath":"BURN"},{"label":"THRESHOLD","type":"constant","params":[],"p5DocPath":"THRESHOLD"},{"label":"GRAY","type":"constant","params":[],"p5DocPath":"GRAY"},{"label":"OPAQUE","type":"constant","params":[],"p5DocPath":"OPAQUE"},{"label":"INVERT","type":"constant","params":[],"p5DocPath":"INVERT"},{"label":"POSTERIZE","type":"constant","params":[],"p5DocPath":"POSTERIZE"},{"label":"DILATE","type":"constant","params":[],"p5DocPath":"DILATE"},{"label":"ERODE","type":"constant","params":[],"p5DocPath":"ERODE"},{"label":"BLUR","type":"constant","params":[],"p5DocPath":"BLUR"},{"label":"NORMAL","type":"constant","params":[],"p5DocPath":"NORMAL"},{"label":"ITALIC","type":"constant","params":[],"p5DocPath":"ITALIC"},{"label":"BOLD","type":"constant","params":[],"p5DocPath":"BOLD"},{"label":"BOLDITALIC","type":"constant","params":[],"p5DocPath":"BOLDITALIC"},{"label":"CHAR","type":"constant","params":[],"p5DocPath":"CHAR"},{"label":"WORD","type":"constant","params":[],"p5DocPath":"WORD"},{"label":"LINEAR","type":"constant","params":[],"p5DocPath":"LINEAR"},{"label":"QUADRATIC","type":"constant","params":[],"p5DocPath":"QUADRATIC"},{"label":"BEZIER","type":"constant","params":[],"p5DocPath":"BEZIER"},{"label":"CURVE","type":"constant","params":[],"p5DocPath":"CURVE"},{"label":"STROKE","type":"constant","params":[],"p5DocPath":"STROKE"},{"label":"FILL","type":"constant","params":[],"p5DocPath":"FILL"},{"label":"TEXTURE","type":"constant","params":[],"p5DocPath":"TEXTURE"},{"label":"IMMEDIATE","type":"constant","params":[],"p5DocPath":"IMMEDIATE"},{"label":"IMAGE","type":"constant","params":[],"p5DocPath":"IMAGE"},{"label":"NEAREST","type":"constant","params":[],"p5DocPath":"NEAREST"},{"label":"REPEAT","type":"constant","params":[],"p5DocPath":"REPEAT"},{"label":"CLAMP","type":"constant","params":[],"p5DocPath":"CLAMP"},{"label":"MIRROR","type":"constant","params":[],"p5DocPath":"MIRROR"},{"label":"FLAT","type":"constant","params":[],"p5DocPath":"FLAT"},{"label":"SMOOTH","type":"constant","params":[],"p5DocPath":"SMOOTH"},{"label":"LANDSCAPE","type":"constant","params":[],"p5DocPath":"LANDSCAPE"},{"label":"PORTRAIT","type":"constant","params":[],"p5DocPath":"PORTRAIT"},{"label":"GRID","type":"constant","params":[],"p5DocPath":"GRID"},{"label":"AXES","type":"constant","params":[],"p5DocPath":"AXES"},{"label":"LABEL","type":"constant","params":[],"p5DocPath":"LABEL"},{"label":"FALLBACK","type":"constant","params":[],"p5DocPath":"FALLBACK"},{"label":"CONTAIN","type":"constant","params":[],"p5DocPath":"CONTAIN"},{"label":"COVER","type":"constant","params":[],"p5DocPath":"COVER"},{"label":"UNSIGNED_BYTE","type":"constant","params":[],"p5DocPath":"UNSIGNED_BYTE"},{"label":"UNSIGNED_INT","type":"constant","params":[],"p5DocPath":"UNSIGNED_INT"},{"label":"FLOAT","type":"constant","params":[],"p5DocPath":"FLOAT"},{"label":"HALF_FLOAT","type":"constant","params":[],"p5DocPath":"HALF_FLOAT"},{"label":"RGBA","type":"constant","params":[],"p5DocPath":"RGBA"},{"label":"print","type":"method","params":[{"p":"contents","o":false}],"p5DocPath":"print"},{"label":"frameCount","type":"variable","params":[],"p5DocPath":"frameCount"},{"label":"deltaTime","type":"variable","params":[],"p5DocPath":"deltaTime"},{"label":"focused","type":"variable","params":[],"p5DocPath":"focused"},{"label":"cursor","type":"method","params":[{"p":"type","o":false},{"p":"x","o":true},{"p":"y","o":true}],"p5DocPath":"cursor"},{"label":"frameRate","type":"method","p5DocPath":"frameRate"},{"label":"getTargetFrameRate","type":"method","p5DocPath":"getTargetFrameRate"},{"label":"noCursor","type":"method","p5DocPath":"noCursor"},{"label":"webglVersion","type":"variable","params":[],"p5DocPath":"webglVersion"},{"label":"displayWidth","type":"variable","params":[],"p5DocPath":"displayWidth"},{"label":"displayHeight","type":"variable","params":[],"p5DocPath":"displayHeight"},{"label":"windowWidth","type":"variable","params":[],"p5DocPath":"windowWidth"},{"label":"windowHeight","type":"variable","params":[],"p5DocPath":"windowHeight"},{"label":"windowResized","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"windowResized"},{"label":"width","type":"variable","params":[],"p5DocPath":"width"},{"label":"height","type":"variable","params":[],"p5DocPath":"height"},{"label":"fullscreen","type":"method","params":[{"p":"val","o":true}],"p5DocPath":"fullscreen"},{"label":"pixelDensity","type":"method","p5DocPath":"pixelDensity"},{"label":"displayDensity","type":"method","p5DocPath":"displayDensity"},{"label":"getURL","type":"method","p5DocPath":"getURL"},{"label":"getURLPath","type":"method","p5DocPath":"getURLPath"},{"label":"getURLParams","type":"method","p5DocPath":"getURLParams"},{"label":"preload","type":"method","p5DocPath":"preload"},{"label":"setup","type":"method","p5DocPath":"setup"},{"label":"draw","type":"method","p5DocPath":"draw"},{"label":"remove","type":"method","p5DocPath":"remove"},{"label":"disableFriendlyErrors","type":"variable","params":[],"p5DocPath":"disableFriendlyErrors"},{"label":"createCanvas","type":"method","p5DocPath":"createCanvas"},{"label":"resizeCanvas","type":"method","params":[{"p":"width","o":false},{"p":"height","o":false},{"p":"noRedraw","o":true}],"p5DocPath":"resizeCanvas"},{"label":"noCanvas","type":"method","p5DocPath":"noCanvas"},{"label":"createGraphics","type":"method","p5DocPath":"createGraphics"},{"label":"createFramebuffer","type":"method","params":[{"p":"options","o":true}],"p5DocPath":"createFramebuffer"},{"label":"clearDepth","type":"method","params":[{"p":"depth","o":true}],"p5DocPath":"clearDepth"},{"label":"blendMode","type":"method","params":[{"p":"mode","o":false}],"p5DocPath":"blendMode"},{"label":"drawingContext","type":"variable","params":[],"p5DocPath":"drawingContext"},{"label":"noLoop","type":"method","p5DocPath":"noLoop"},{"label":"loop","type":"method","p5DocPath":"loop"},{"label":"isLooping","type":"method","p5DocPath":"isLooping"},{"label":"push","type":"method","p5DocPath":"push"},{"label":"pop","type":"method","p5DocPath":"pop"},{"label":"redraw","type":"method","params":[{"p":"n","o":true}],"p5DocPath":"redraw"},{"label":"p5","type":"method","params":[{"p":"sketch","o":false},{"p":"node","o":false}],"p5DocPath":"p5"},{"label":"applyMatrix","type":"method","p5DocPath":"applyMatrix"},{"label":"resetMatrix","type":"method","p5DocPath":"resetMatrix"},{"label":"rotate","type":"method","params":[{"p":"angle","o":false},{"p":"axis","o":true}],"p5DocPath":"rotate"},{"label":"rotateX","type":"method","params":[{"p":"angle","o":false}],"p5DocPath":"rotateX"},{"label":"rotateY","type":"method","params":[{"p":"angle","o":false}],"p5DocPath":"rotateY"},{"label":"rotateZ","type":"method","params":[{"p":"angle","o":false}],"p5DocPath":"rotateZ"},{"label":"scale","type":"method","p5DocPath":"scale"},{"label":"shearX","type":"method","params":[{"p":"angle","o":false}],"p5DocPath":"shearX"},{"label":"shearY","type":"method","params":[{"p":"angle","o":false}],"p5DocPath":"shearY"},{"label":"translate","type":"method","p5DocPath":"translate"},{"label":"storeItem","type":"method","params":[{"p":"key","o":false},{"p":"value","o":false}],"p5DocPath":"storeItem"},{"label":"getItem","type":"method","params":[{"p":"key","o":false}],"p5DocPath":"getItem"},{"label":"clearStorage","type":"method","p5DocPath":"clearStorage"},{"label":"removeItem","type":"method","params":[{"p":"key","o":false}],"p5DocPath":"removeItem"},{"label":"createStringDict","type":"method","p5DocPath":"createStringDict"},{"label":"createNumberDict","type":"method","p5DocPath":"createNumberDict"},{"label":"select","type":"method","params":[{"p":"selectors","o":false},{"p":"container","o":true}],"p5DocPath":"select"},{"label":"selectAll","type":"method","params":[{"p":"selectors","o":false},{"p":"container","o":true}],"p5DocPath":"selectAll"},{"label":"removeElements","type":"method","p5DocPath":"removeElements"},{"label":"changed","type":"method","params":[{"p":"fxn","o":false}],"p5DocPath":"changed"},{"label":"input","type":"method","params":[{"p":"fxn","o":false}],"p5DocPath":"input"},{"label":"createDiv","type":"method","params":[{"p":"html","o":true}],"p5DocPath":"createDiv"},{"label":"createP","type":"method","params":[{"p":"html","o":true}],"p5DocPath":"createP"},{"label":"createSpan","type":"method","params":[{"p":"html","o":true}],"p5DocPath":"createSpan"},{"label":"createImg","type":"method","p5DocPath":"createImg"},{"label":"createA","type":"method","params":[{"p":"href","o":false},{"p":"html","o":false},{"p":"target","o":true}],"p5DocPath":"createA"},{"label":"createSlider","type":"method","params":[{"p":"min","o":false},{"p":"max","o":false},{"p":"value","o":true},{"p":"step","o":true}],"p5DocPath":"createSlider"},{"label":"createButton","type":"method","params":[{"p":"label","o":false},{"p":"value","o":true}],"p5DocPath":"createButton"},{"label":"createCheckbox","type":"method","params":[{"p":"label","o":true},{"p":"value","o":true}],"p5DocPath":"createCheckbox"},{"label":"createSelect","type":"method","p5DocPath":"createSelect"},{"label":"createRadio","type":"method","p5DocPath":"createRadio"},{"label":"createColorPicker","type":"method","params":[{"p":"value","o":true}],"p5DocPath":"createColorPicker"},{"label":"createInput","type":"method","p5DocPath":"createInput"},{"label":"createFileInput","type":"method","params":[{"p":"callback","o":false},{"p":"multiple","o":true}],"p5DocPath":"createFileInput"},{"label":"createVideo","type":"method","params":[{"p":"src","o":false},{"p":"callback","o":true}],"p5DocPath":"createVideo"},{"label":"createAudio","type":"method","params":[{"p":"src","o":true},{"p":"callback","o":true}],"p5DocPath":"createAudio"},{"label":"createCapture","type":"method","params":[{"p":"type","o":true},{"p":"flipped","o":true},{"p":"callback","o":true}],"p5DocPath":"createCapture"},{"label":"createElement","type":"method","params":[{"p":"tag","o":false},{"p":"content","o":true}],"p5DocPath":"createElement"},{"label":"deviceOrientation","type":"variable","params":[],"p5DocPath":"deviceOrientation"},{"label":"accelerationX","type":"variable","params":[],"p5DocPath":"accelerationX"},{"label":"accelerationY","type":"variable","params":[],"p5DocPath":"accelerationY"},{"label":"accelerationZ","type":"variable","params":[],"p5DocPath":"accelerationZ"},{"label":"pAccelerationX","type":"variable","params":[],"p5DocPath":"pAccelerationX"},{"label":"pAccelerationY","type":"variable","params":[],"p5DocPath":"pAccelerationY"},{"label":"pAccelerationZ","type":"variable","params":[],"p5DocPath":"pAccelerationZ"},{"label":"rotationX","type":"variable","params":[],"p5DocPath":"rotationX"},{"label":"rotationY","type":"variable","params":[],"p5DocPath":"rotationY"},{"label":"rotationZ","type":"variable","params":[],"p5DocPath":"rotationZ"},{"label":"pRotationX","type":"variable","params":[],"p5DocPath":"pRotationX"},{"label":"pRotationY","type":"variable","params":[],"p5DocPath":"pRotationY"},{"label":"pRotationZ","type":"variable","params":[],"p5DocPath":"pRotationZ"},{"label":"turnAxis","type":"variable","params":[],"p5DocPath":"turnAxis"},{"label":"setMoveThreshold","type":"method","params":[{"p":"value","o":false}],"p5DocPath":"setMoveThreshold"},{"label":"setShakeThreshold","type":"method","params":[{"p":"value","o":false}],"p5DocPath":"setShakeThreshold"},{"label":"deviceMoved","type":"method","p5DocPath":"deviceMoved"},{"label":"deviceTurned","type":"method","p5DocPath":"deviceTurned"},{"label":"deviceShaken","type":"method","p5DocPath":"deviceShaken"},{"label":"keyIsPressed","type":"variable","params":[],"p5DocPath":"keyIsPressed"},{"label":"key","type":"variable","params":[],"p5DocPath":"key"},{"label":"keyCode","type":"variable","params":[],"p5DocPath":"keyCode"},{"label":"keyPressed","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"keyPressed"},{"label":"keyReleased","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"keyReleased"},{"label":"keyTyped","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"keyTyped"},{"label":"keyIsDown","type":"method","params":[{"p":"code","o":false}],"p5DocPath":"keyIsDown"},{"label":"movedX","type":"variable","params":[],"p5DocPath":"movedX"},{"label":"movedY","type":"variable","params":[],"p5DocPath":"movedY"},{"label":"mouseX","type":"variable","params":[],"p5DocPath":"mouseX"},{"label":"mouseY","type":"variable","params":[],"p5DocPath":"mouseY"},{"label":"pmouseX","type":"variable","params":[],"p5DocPath":"pmouseX"},{"label":"pmouseY","type":"variable","params":[],"p5DocPath":"pmouseY"},{"label":"winMouseX","type":"variable","params":[],"p5DocPath":"winMouseX"},{"label":"winMouseY","type":"variable","params":[],"p5DocPath":"winMouseY"},{"label":"pwinMouseX","type":"variable","params":[],"p5DocPath":"pwinMouseX"},{"label":"pwinMouseY","type":"variable","params":[],"p5DocPath":"pwinMouseY"},{"label":"mouseButton","type":"variable","params":[],"p5DocPath":"mouseButton"},{"label":"mouseIsPressed","type":"variable","params":[],"p5DocPath":"mouseIsPressed"},{"label":"mouseMoved","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"mouseMoved"},{"label":"mouseDragged","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"mouseDragged"},{"label":"mousePressed","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"mousePressed"},{"label":"mouseReleased","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"mouseReleased"},{"label":"mouseClicked","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"mouseClicked"},{"label":"doubleClicked","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"doubleClicked"},{"label":"mouseWheel","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"mouseWheel"},{"label":"requestPointerLock","type":"method","p5DocPath":"requestPointerLock"},{"label":"exitPointerLock","type":"method","p5DocPath":"exitPointerLock"},{"label":"touches","type":"variable","params":[],"p5DocPath":"touches"},{"label":"touchStarted","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"touchStarted"},{"label":"touchMoved","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"touchMoved"},{"label":"touchEnded","type":"method","params":[{"p":"event","o":true}],"p5DocPath":"touchEnded"},{"label":"createImage","type":"method","params":[{"p":"width","o":false},{"p":"height","o":false}],"p5DocPath":"createImage"},{"label":"saveCanvas","type":"method","p5DocPath":"saveCanvas"},{"label":"saveFrames","type":"method","params":[{"p":"filename","o":false},{"p":"extension","o":false},{"p":"duration","o":false},{"p":"framerate","o":false},{"p":"callback","o":true}],"p5DocPath":"saveFrames"},{"label":"loadImage","type":"method","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"failureCallback","o":true}],"p5DocPath":"loadImage"},{"label":"saveGif","type":"method","params":[{"p":"filename","o":false},{"p":"duration","o":false},{"p":"options","o":true}],"p5DocPath":"saveGif"},{"label":"image","type":"method","p5DocPath":"image"},{"label":"tint","type":"method","p5DocPath":"tint"},{"label":"noTint","type":"method","p5DocPath":"noTint"},{"label":"imageMode","type":"method","params":[{"p":"mode","o":false}],"p5DocPath":"imageMode"},{"label":"pixels","type":"variable","params":[],"p5DocPath":"pixels"},{"label":"blend","type":"method","p5DocPath":"blend"},{"label":"copy","type":"method","p5DocPath":"copy"},{"label":"filter","type":"method","p5DocPath":"filter"},{"label":"get","type":"method","p5DocPath":"get"},{"label":"loadPixels","type":"method","p5DocPath":"loadPixels"},{"label":"set","type":"method","params":[{"p":"x","o":false},{"p":"y","o":false},{"p":"c","o":false}],"p5DocPath":"set"},{"label":"updatePixels","type":"method","params":[{"p":"x","o":true},{"p":"y","o":true},{"p":"w","o":true},{"p":"h","o":true}],"p5DocPath":"updatePixels"},{"label":"loadJSON","type":"method","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"errorCallback","o":true}],"p5DocPath":"loadJSON"},{"label":"loadStrings","type":"method","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"errorCallback","o":true}],"p5DocPath":"loadStrings"},{"label":"loadTable","type":"method","params":[{"p":"filename","o":false},{"p":"extension","o":true},{"p":"header","o":true},{"p":"callback","o":true},{"p":"errorCallback","o":true}],"p5DocPath":"loadTable"},{"label":"loadXML","type":"method","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"errorCallback","o":true}],"p5DocPath":"loadXML"},{"label":"loadBytes","type":"method","params":[{"p":"file","o":false},{"p":"callback","o":true},{"p":"errorCallback","o":true}],"p5DocPath":"loadBytes"},{"label":"httpGet","type":"method","p5DocPath":"httpGet"},{"label":"httpPost","type":"method","p5DocPath":"httpPost"},{"label":"httpDo","type":"method","p5DocPath":"httpDo"},{"label":"createWriter","type":"method","params":[{"p":"name","o":false},{"p":"extension","o":true}],"p5DocPath":"createWriter"},{"label":"save","type":"method","params":[{"p":"objectOrFilename","o":true},{"p":"filename","o":true},{"p":"options","o":true}],"p5DocPath":"save"},{"label":"saveJSON","type":"method","params":[{"p":"json","o":false},{"p":"filename","o":false},{"p":"optimize","o":true}],"p5DocPath":"saveJSON"},{"label":"saveStrings","type":"method","params":[{"p":"list","o":false},{"p":"filename","o":false},{"p":"extension","o":true},{"p":"isCRLF","o":true}],"p5DocPath":"saveStrings"},{"label":"saveTable","type":"method","params":[{"p":"Table","o":false},{"p":"filename","o":false},{"p":"options","o":true}],"p5DocPath":"saveTable"},{"label":"abs","type":"method","params":[{"p":"n","o":false}],"p5DocPath":"abs"},{"label":"ceil","type":"method","params":[{"p":"n","o":false}],"p5DocPath":"ceil"},{"label":"constrain","type":"method","params":[{"p":"n","o":false},{"p":"low","o":false},{"p":"high","o":false}],"p5DocPath":"constrain"},{"label":"dist","type":"method","p5DocPath":"dist"},{"label":"exp","type":"method","params":[{"p":"n","o":false}],"p5DocPath":"exp"},{"label":"floor","type":"method","params":[{"p":"n","o":false}],"p5DocPath":"floor"},{"label":"lerp","type":"method","params":[{"p":"start","o":false},{"p":"stop","o":false},{"p":"amt","o":false}],"p5DocPath":"lerp"},{"label":"log","type":"method","params":[{"p":"n","o":false}],"p5DocPath":"log"},{"label":"mag","type":"method","params":[{"p":"x","o":false},{"p":"y","o":false}],"p5DocPath":"mag"},{"label":"map","type":"method","params":[{"p":"value","o":false},{"p":"start1","o":false},{"p":"stop1","o":false},{"p":"start2","o":false},{"p":"stop2","o":false},{"p":"withinBounds","o":true}],"p5DocPath":"map"},{"label":"max","type":"method","p5DocPath":"max"},{"label":"min","type":"method","p5DocPath":"min"},{"label":"norm","type":"method","params":[{"p":"value","o":false},{"p":"start","o":false},{"p":"stop","o":false}],"p5DocPath":"norm"},{"label":"pow","type":"method","params":[{"p":"n","o":false},{"p":"e","o":false}],"p5DocPath":"pow"},{"label":"round","type":"method","params":[{"p":"n","o":false},{"p":"decimals","o":true}],"p5DocPath":"round"},{"label":"sq","type":"method","params":[{"p":"n","o":false}],"p5DocPath":"sq"},{"label":"sqrt","type":"method","params":[{"p":"n","o":false}],"p5DocPath":"sqrt"},{"label":"fract","type":"method","params":[{"p":"n","o":false}],"p5DocPath":"fract"},{"label":"createVector","type":"method","params":[{"p":"x","o":true},{"p":"y","o":true},{"p":"z","o":true}],"p5DocPath":"createVector"},{"label":"noise","type":"method","params":[{"p":"x","o":false},{"p":"y","o":true},{"p":"z","o":true}],"p5DocPath":"noise"},{"label":"noiseDetail","type":"method","params":[{"p":"lod","o":false},{"p":"falloff","o":false}],"p5DocPath":"noiseDetail"},{"label":"noiseSeed","type":"method","params":[{"p":"seed","o":false}],"p5DocPath":"noiseSeed"},{"label":"randomSeed","type":"method","params":[{"p":"seed","o":false}],"p5DocPath":"randomSeed"},{"label":"random","type":"method","p5DocPath":"random"},{"label":"randomGaussian","type":"method","params":[{"p":"mean","o":true},{"p":"sd","o":true}],"p5DocPath":"randomGaussian"},{"label":"acos","type":"method","params":[{"p":"value","o":false}],"p5DocPath":"acos"},{"label":"asin","type":"method","params":[{"p":"value","o":false}],"p5DocPath":"asin"},{"label":"atan","type":"method","params":[{"p":"value","o":false}],"p5DocPath":"atan"},{"label":"atan2","type":"method","params":[{"p":"y","o":false},{"p":"x","o":false}],"p5DocPath":"atan2"},{"label":"cos","type":"method","params":[{"p":"angle","o":false}],"p5DocPath":"cos"},{"label":"sin","type":"method","params":[{"p":"angle","o":false}],"p5DocPath":"sin"},{"label":"tan","type":"method","params":[{"p":"angle","o":false}],"p5DocPath":"tan"},{"label":"degrees","type":"method","params":[{"p":"radians","o":false}],"p5DocPath":"degrees"},{"label":"radians","type":"method","params":[{"p":"degrees","o":false}],"p5DocPath":"radians"},{"label":"angleMode","type":"method","p5DocPath":"angleMode"},{"label":"textAlign","type":"method","p5DocPath":"textAlign"},{"label":"textLeading","type":"method","p5DocPath":"textLeading"},{"label":"textSize","type":"method","p5DocPath":"textSize"},{"label":"textStyle","type":"method","p5DocPath":"textStyle"},{"label":"textWidth","type":"method","params":[{"p":"str","o":false}],"p5DocPath":"textWidth"},{"label":"textAscent","type":"method","p5DocPath":"textAscent"},{"label":"textDescent","type":"method","p5DocPath":"textDescent"},{"label":"textWrap","type":"method","params":[{"p":"style","o":false}],"p5DocPath":"textWrap"},{"label":"loadFont","type":"method","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"failureCallback","o":true}],"p5DocPath":"loadFont"},{"label":"text","type":"method","params":[{"p":"str","o":false},{"p":"x","o":false},{"p":"y","o":false},{"p":"maxWidth","o":true},{"p":"maxHeight","o":true}],"p5DocPath":"text"},{"label":"textFont","type":"method","p5DocPath":"textFont"},{"label":"append","type":"method","params":[{"p":"array","o":false},{"p":"value","o":false}],"p5DocPath":"append"},{"label":"arrayCopy","type":"method","p5DocPath":"arrayCopy"},{"label":"concat","type":"method","params":[{"p":"a","o":false},{"p":"b","o":false}],"p5DocPath":"concat"},{"label":"reverse","type":"method","params":[{"p":"list","o":false}],"p5DocPath":"reverse"},{"label":"shorten","type":"method","params":[{"p":"list","o":false}],"p5DocPath":"shorten"},{"label":"shuffle","type":"method","params":[{"p":"array","o":false},{"p":"bool","o":true}],"p5DocPath":"shuffle"},{"label":"sort","type":"method","params":[{"p":"list","o":false},{"p":"count","o":true}],"p5DocPath":"sort"},{"label":"splice","type":"method","params":[{"p":"list","o":false},{"p":"value","o":false},{"p":"position","o":false}],"p5DocPath":"splice"},{"label":"subset","type":"method","params":[{"p":"list","o":false},{"p":"start","o":false},{"p":"count","o":true}],"p5DocPath":"subset"},{"label":"float","type":"method","p5DocPath":"float"},{"label":"int","type":"method","p5DocPath":"int"},{"label":"str","type":"method","params":[{"p":"n","o":false}],"p5DocPath":"str"},{"label":"boolean","type":"method","p5DocPath":"boolean"},{"label":"byte","type":"method","p5DocPath":"byte"},{"label":"char","type":"method","p5DocPath":"char"},{"label":"unchar","type":"method","p5DocPath":"unchar"},{"label":"hex","type":"method","p5DocPath":"hex"},{"label":"unhex","type":"method","p5DocPath":"unhex"},{"label":"join","type":"method","params":[{"p":"list","o":false},{"p":"separator","o":false}],"p5DocPath":"join"},{"label":"match","type":"method","params":[{"p":"str","o":false},{"p":"regexp","o":false}],"p5DocPath":"match"},{"label":"matchAll","type":"method","params":[{"p":"str","o":false},{"p":"regexp","o":false}],"p5DocPath":"matchAll"},{"label":"nf","type":"method","p5DocPath":"nf"},{"label":"nfc","type":"method","p5DocPath":"nfc"},{"label":"nfp","type":"method","p5DocPath":"nfp"},{"label":"nfs","type":"method","p5DocPath":"nfs"},{"label":"split","type":"method","params":[{"p":"value","o":false},{"p":"delim","o":false}],"p5DocPath":"split"},{"label":"splitTokens","type":"method","params":[{"p":"value","o":false},{"p":"delim","o":true}],"p5DocPath":"splitTokens"},{"label":"trim","type":"method","p5DocPath":"trim"},{"label":"day","type":"method","p5DocPath":"day"},{"label":"hour","type":"method","p5DocPath":"hour"},{"label":"minute","type":"method","p5DocPath":"minute"},{"label":"millis","type":"method","p5DocPath":"millis"},{"label":"month","type":"method","p5DocPath":"month"},{"label":"second","type":"method","p5DocPath":"second"},{"label":"year","type":"method","p5DocPath":"year"},{"label":"beginGeometry","type":"method","p5DocPath":"beginGeometry"},{"label":"endGeometry","type":"method","p5DocPath":"endGeometry"},{"label":"buildGeometry","type":"method","params":[{"p":"callback","o":false}],"p5DocPath":"buildGeometry"},{"label":"freeGeometry","type":"method","params":[{"p":"geometry","o":false}],"p5DocPath":"freeGeometry"},{"label":"plane","type":"method","params":[{"p":"width","o":true},{"p":"height","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5DocPath":"plane"},{"label":"box","type":"method","params":[{"p":"width","o":true},{"p":"height","o":true},{"p":"depth","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5DocPath":"box"},{"label":"sphere","type":"method","params":[{"p":"radius","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5DocPath":"sphere"},{"label":"cylinder","type":"method","params":[{"p":"radius","o":true},{"p":"height","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true},{"p":"bottomCap","o":true},{"p":"topCap","o":true}],"p5DocPath":"cylinder"},{"label":"cone","type":"method","params":[{"p":"radius","o":true},{"p":"height","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true},{"p":"cap","o":true}],"p5DocPath":"cone"},{"label":"ellipsoid","type":"method","params":[{"p":"radiusX","o":true},{"p":"radiusY","o":true},{"p":"radiusZ","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5DocPath":"ellipsoid"},{"label":"torus","type":"method","params":[{"p":"radius","o":true},{"p":"tubeRadius","o":true},{"p":"detailX","o":true},{"p":"detailY","o":true}],"p5DocPath":"torus"},{"label":"orbitControl","type":"method","params":[{"p":"sensitivityX","o":true},{"p":"sensitivityY","o":true},{"p":"sensitivityZ","o":true},{"p":"options","o":true}],"p5DocPath":"orbitControl"},{"label":"debugMode","type":"method","p5DocPath":"debugMode"},{"label":"noDebugMode","type":"method","p5DocPath":"noDebugMode"},{"label":"ambientLight","type":"method","p5DocPath":"ambientLight"},{"label":"specularColor","type":"method","p5DocPath":"specularColor"},{"label":"directionalLight","type":"method","p5DocPath":"directionalLight"},{"label":"pointLight","type":"method","p5DocPath":"pointLight"},{"label":"imageLight","type":"method","params":[{"p":"img","o":false}],"p5DocPath":"imageLight"},{"label":"panorama","type":"method","params":[{"p":"img","o":false}],"p5DocPath":"panorama"},{"label":"lights","type":"method","p5DocPath":"lights"},{"label":"lightFalloff","type":"method","params":[{"p":"constant","o":false},{"p":"linear","o":false},{"p":"quadratic","o":false}],"p5DocPath":"lightFalloff"},{"label":"spotLight","type":"method","p5DocPath":"spotLight"},{"label":"noLights","type":"method","p5DocPath":"noLights"},{"label":"loadModel","type":"method","p5DocPath":"loadModel"},{"label":"model","type":"method","params":[{"p":"model","o":false}],"p5DocPath":"model"},{"label":"createModel","type":"method","p5DocPath":"createModel"},{"label":"loadShader","type":"method","params":[{"p":"vertFilename","o":false},{"p":"fragFilename","o":false},{"p":"successCallback","o":true},{"p":"failureCallback","o":true}],"p5DocPath":"loadShader"},{"label":"createShader","type":"method","params":[{"p":"vertSrc","o":false},{"p":"fragSrc","o":false},{"p":"options","o":true}],"p5DocPath":"createShader"},{"label":"createFilterShader","type":"method","params":[{"p":"fragSrc","o":false}],"p5DocPath":"createFilterShader"},{"label":"shader","type":"method","params":[{"p":"s","o":false}],"p5DocPath":"shader"},{"label":"baseMaterialShader","type":"method","p5DocPath":"baseMaterialShader"},{"label":"baseNormalShader","type":"method","p5DocPath":"baseNormalShader"},{"label":"baseColorShader","type":"method","p5DocPath":"baseColorShader"},{"label":"baseStrokeShader","type":"method","p5DocPath":"baseStrokeShader"},{"label":"resetShader","type":"method","p5DocPath":"resetShader"},{"label":"texture","type":"method","params":[{"p":"tex","o":false}],"p5DocPath":"texture"},{"label":"textureMode","type":"method","params":[{"p":"mode","o":false}],"p5DocPath":"textureMode"},{"label":"textureWrap","type":"method","params":[{"p":"wrapX","o":false},{"p":"wrapY","o":true}],"p5DocPath":"textureWrap"},{"label":"normalMaterial","type":"method","p5DocPath":"normalMaterial"},{"label":"ambientMaterial","type":"method","p5DocPath":"ambientMaterial"},{"label":"emissiveMaterial","type":"method","p5DocPath":"emissiveMaterial"},{"label":"specularMaterial","type":"method","p5DocPath":"specularMaterial"},{"label":"shininess","type":"method","params":[{"p":"shine","o":false}],"p5DocPath":"shininess"},{"label":"metalness","type":"method","params":[{"p":"metallic","o":false}],"p5DocPath":"metalness"},{"label":"camera","type":"method","params":[{"p":"x","o":true},{"p":"y","o":true},{"p":"z","o":true},{"p":"centerX","o":true},{"p":"centerY","o":true},{"p":"centerZ","o":true},{"p":"upX","o":true},{"p":"upY","o":true},{"p":"upZ","o":true}],"p5DocPath":"camera"},{"label":"perspective","type":"method","params":[{"p":"fovy","o":true},{"p":"aspect","o":true},{"p":"near","o":true},{"p":"far","o":true}],"p5DocPath":"perspective"},{"label":"linePerspective","type":"method","p5DocPath":"linePerspective"},{"label":"ortho","type":"method","params":[{"p":"left","o":true},{"p":"right","o":true},{"p":"bottom","o":true},{"p":"top","o":true},{"p":"near","o":true},{"p":"far","o":true}],"p5DocPath":"ortho"},{"label":"frustum","type":"method","params":[{"p":"left","o":true},{"p":"right","o":true},{"p":"bottom","o":true},{"p":"top","o":true},{"p":"near","o":true},{"p":"far","o":true}],"p5DocPath":"frustum"},{"label":"createCamera","type":"method","p5DocPath":"createCamera"},{"label":"setCamera","type":"method","params":[{"p":"cam","o":false}],"p5DocPath":"setCamera"},{"label":"setAttributes","type":"method","p5DocPath":"setAttributes"},{"label":"getAudioContext","type":"method","p5DocPath":"getAudioContext"},{"label":"userStartAudio","type":"method","params":[{"p":"elements","o":true},{"p":"callback","o":true}],"p5DocPath":"userStartAudio"},{"label":"getOutputVolume","type":"method","p5DocPath":"getOutputVolume"},{"label":"outputVolume","type":"method","params":[{"p":"volume","o":false},{"p":"rampTime","o":true},{"p":"timeFromNow","o":true}],"p5DocPath":"outputVolume"},{"label":"soundOut","type":"variable","params":[],"p5DocPath":"soundOut"},{"label":"sampleRate","type":"method","p5DocPath":"sampleRate"},{"label":"freqToMidi","type":"method","params":[{"p":"frequency","o":false}],"p5DocPath":"freqToMidi"},{"label":"midiToFreq","type":"method","params":[{"p":"midiNote","o":false}],"p5DocPath":"midiToFreq"},{"label":"soundFormats","type":"method","params":[{"p":"formats","o":true}],"p5DocPath":"soundFormats"},{"label":"saveSound","type":"method","params":[{"p":"soundFile","o":false},{"p":"fileName","o":false}],"p5DocPath":"saveSound"},{"label":"loadSound","type":"method","params":[{"p":"path","o":false},{"p":"successCallback","o":true},{"p":"errorCallback","o":true},{"p":"whileLoading","o":true}],"p5DocPath":"loadSound"},{"label":"createConvolver","type":"method","params":[{"p":"path","o":false},{"p":"callback","o":true},{"p":"errorCallback","o":true}],"p5DocPath":"createConvolver"},{"label":"setBPM","type":"method","params":[{"p":"BPM","o":false},{"p":"rampTime","o":false}],"p5DocPath":"setBPM"},{"label":"true","type":"boolean","p5DocPath":"boolean"},{"label":"false","type":"boolean","p5DocPath":"boolean"},{"label":"await","type":"keyword"},{"label":"class","type":"keyword","p5DocPath":"class"},{"label":"const","type":"keyword","p5DocPath":"const"},{"label":"else","type":"keyword","p5DocPath":"if-else"},{"label":"export","type":"keyword"},{"label":"for","type":"keyword","p5DocPath":"for"},{"label":"function","type":"keyword","p5DocPath":"function"},{"label":"if","type":"keyword","p5DocPath":"if-else"},{"label":"return","type":"keyword","p5DocPath":"return"},{"label":"while","type":"keyword","p5DocPath":"while"},{"label":"with","type":"keyword"},{"label":"let","type":"keyword","p5DocPath":"let"},{"label":"Array","type":"obj"},{"label":"Boolean","type":"obj"},{"label":"Date","type":"obj"},{"label":"Error","type":"obj"},{"label":"Function","type":"obj"},{"label":"JSON","type":"obj","p5DocPath":"JSON"},{"label":"Math","type":"obj"},{"label":"Number","type":"obj"},{"label":"Object","type":"obj"},{"label":"RegExp","type":"obj"},{"label":"String","type":"obj"},{"label":"Promise","type":"obj"},{"label":"Set","type":"obj"},{"label":"Map","type":"obj"},{"label":"Symbol","type":"obj"},{"label":"WeakMap","type":"obj"},{"label":"WeakSet","type":"obj"},{"label":"ArrayBuffer","type":"obj"},{"label":"DataView","type":"obj"},{"label":"Int32Array","type":"obj"},{"label":"Uint32Array","type":"obj"},{"label":"Float32Array","type":"obj"},{"label":"window","type":"obj"},{"label":"document","type":"obj"},{"label":"navigator","type":"obj"},{"label":"console","type":"obj","p5DocPath":"console"},{"label":"localStorage","type":"obj"},{"label":"sessionStorage","type":"obj"},{"label":"history","type":"obj"},{"label":"location","type":"obj"}]; diff --git a/server/scripts/update-p5-hinter.js b/server/scripts/update-p5-hinter.js index a6a667eac4..0c6b4a7cc5 100644 --- a/server/scripts/update-p5-hinter.js +++ b/server/scripts/update-p5-hinter.js @@ -2,79 +2,55 @@ const fs = require('fs'); const process = require('process'); const axios = require('axios'); -// const getDescription = (d) => { -// return d.split('\n')[0].replace('', ''); -// }; - +// TODO: Currently this makes duplicate entries because +// the default Javascript hinter also has these, +// but should we keep them around for the p5 reference links? const reservedKeywords = [ - { name: 'await', p5DocPath: false }, - { name: 'break', p5DocPath: false }, - { name: 'case', p5DocPath: false }, - { name: 'catch', p5DocPath: false }, + { name: 'await', p5DocPath: undefined }, { name: 'class', p5DocPath: 'class' }, { name: 'const', p5DocPath: 'const' }, - { name: 'continue', p5DocPath: false }, - { name: 'debugger', p5DocPath: false }, - { name: 'default', p5DocPath: false }, - { name: 'delete', p5DocPath: false }, - { name: 'do', p5DocPath: false }, { name: 'else', p5DocPath: 'if-else' }, - { name: 'export', p5DocPath: false }, - { name: 'extends', p5DocPath: false }, - { name: 'finally', p5DocPath: false }, + { name: 'export', p5DocPath: undefined }, { name: 'for', p5DocPath: 'for' }, { name: 'function', p5DocPath: 'function' }, { name: 'if', p5DocPath: 'if-else' }, - { name: 'import', p5DocPath: false }, - { name: 'in', p5DocPath: false }, - { name: 'instanceof', p5DocPath: false }, - { name: 'new', p5DocPath: false }, { name: 'return', p5DocPath: 'return' }, - { name: 'super', p5DocPath: false }, - { name: 'switch', p5DocPath: false }, - { name: 'this', p5DocPath: false }, - { name: 'throw', p5DocPath: false }, - { name: 'try', p5DocPath: false }, - { name: 'typeof', p5DocPath: false }, - { name: 'var', p5DocPath: false }, - { name: 'void', p5DocPath: false }, { name: 'while', p5DocPath: 'while' }, - { name: 'with', p5DocPath: false }, - { name: 'yield', p5DocPath: false }, + { name: 'with', p5DocPath: undefined }, { name: 'let', p5DocPath: 'let' } ]; const reservedObjects = [ - { name: 'Array', p5DocPath: false }, - { name: 'Boolean', p5DocPath: false }, - { name: 'Date', p5DocPath: false }, - { name: 'Error', p5DocPath: false }, - { name: 'Function', p5DocPath: false }, + { name: 'Array', p5DocPath: undefined }, + { name: 'Boolean', p5DocPath: undefined }, + { name: 'Date', p5DocPath: undefined }, + { name: 'Error', p5DocPath: undefined }, + { name: 'Function', p5DocPath: undefined }, { name: 'JSON', p5DocPath: 'JSON' }, - { name: 'Math', p5DocPath: false }, - { name: 'Number', p5DocPath: false }, - { name: 'Object', p5DocPath: false }, - { name: 'RegExp', p5DocPath: false }, - { name: 'String', p5DocPath: false }, - { name: 'Promise', p5DocPath: false }, - { name: 'Set', p5DocPath: false }, - { name: 'Map', p5DocPath: false }, - { name: 'Symbol', p5DocPath: false }, - { name: 'WeakMap', p5DocPath: false }, - { name: 'WeakSet', p5DocPath: false }, - { name: 'ArrayBuffer', p5DocPath: false }, - { name: 'DataView', p5DocPath: false }, - { name: 'Int32Array', p5DocPath: false }, - { name: 'Uint32Array', p5DocPath: false }, - { name: 'Float32Array', p5DocPath: false }, - { name: 'window', p5DocPath: false }, - { name: 'document', p5DocPath: false }, - { name: 'navigator', p5DocPath: false }, + { name: 'Math', p5DocPath: undefined }, + { name: 'Number', p5DocPath: undefined }, + { name: 'Object', p5DocPath: undefined }, + { name: 'RegExp', p5DocPath: undefined }, + { name: 'String', p5DocPath: undefined }, + { name: 'Promise', p5DocPath: undefined }, + { name: 'Set', p5DocPath: undefined }, + { name: 'Map', p5DocPath: undefined }, + { name: 'Symbol', p5DocPath: undefined }, + { name: 'WeakMap', p5DocPath: undefined }, + { name: 'WeakSet', p5DocPath: undefined }, + { name: 'ArrayBuffer', p5DocPath: undefined }, + { name: 'DataView', p5DocPath: undefined }, + { name: 'Int32Array', p5DocPath: undefined }, + { name: 'Uint32Array', p5DocPath: undefined }, + { name: 'Float32Array', p5DocPath: undefined }, + { name: 'window', p5DocPath: undefined }, + { name: 'document', p5DocPath: undefined }, + { name: 'navigator', p5DocPath: undefined }, { name: 'console', p5DocPath: 'console' }, - { name: 'localStorage', p5DocPath: false }, - { name: 'sessionStorage', p5DocPath: false }, - { name: 'history', p5DocPath: false }, - { name: 'location', p5DocPath: false } + { name: 'localStorage', p5DocPath: undefined }, + { name: 'sessionStorage', p5DocPath: undefined }, + { name: 'history', p5DocPath: undefined }, + { name: 'location', p5DocPath: undefined } ]; axios @@ -92,49 +68,51 @@ axios obj.name && obj.itemtype ) { - let type; + let itemType; let params = []; if (obj.itemtype === 'method') { - type = 'fun'; + itemType = 'method'; + // Adds the parameters to the method. + // I'm not sure this will be used but we can at least keep it around. params = obj.params?.map((param) => ({ p: param.name, // param name o: param.optional ?? false // optional })); } else if (obj.itemtype === 'property') { - type = 'var'; - } else type = 'attr'; + itemType = obj.module === 'Constants' ? 'constant' : 'variable'; + } else itemType = 'attr'; p5Keywords.push({ - text: obj.name, - type, + label: obj.name, + type: itemType, params, - p5: true + p5DocPath: obj.name }); } }); ['true', 'false'].forEach((bol) => { p5Keywords.push({ - text: bol, + label: bol, type: 'boolean', - p5: 'boolean' + p5DocPath: 'boolean' }); }); reservedKeywords.forEach((keyword) => { p5Keywords.push({ - text: keyword.name, + label: keyword.name, type: 'keyword', - p5: keyword.p5DocPath + p5DocPath: keyword.p5DocPath }); }); reservedObjects.forEach((keyword) => { p5Keywords.push({ - text: keyword.name, + label: keyword.name, type: 'obj', - p5: keyword.p5DocPath + p5DocPath: keyword.p5DocPath }); });