ve.ScriptManager

ve.Component. ve.ScriptManager

Refer to ve.Component for methods or fields inherited from this Component's parent such as .options.attributes or .element.

Visual block-based and code-based IDE used to assemble .js script files. ES6 compatible; non-compatible files will degrade to code editor only.

Note: Declaring duplicate ve.ScriptManager components will reset the main Blockly workspace for each new instance.

  • Functional binding: veScriptManager().
  • This component has special default settings located in ve.registry.settings.ScriptManager.
Constructor:
  • arg0_value: string - The code to load into the present ve.ScriptManager.
  • arg1_options: Object
    • .do_not_auto_detect_project=false: boolean - Whether to attempt to read from the base .ve-sm file upon initialisation.
    • .do_not_cache_file_explorer=false: boolean - Whether the file directory should remain the same as when last opened.
    • .do_not_display_file_name=false: boolean
    • .do_not_display_project_name=false: boolean
    • .folder_path=process.cwd(): string
    • .save_extension=[".*"]: Array<string>
      • .settings: Object
        • .autosave_projects=true: boolean
        • .display_load_errors=false: boolean
        • .monaco_theme="nord": string
        • .index_documentation=true: boolean
        • .log_large_objects_in_console=false: boolean
        • .manual_synchronisation: true
        • .scene_height=0: number - The scene height of the main workspace in px.
        • .theme="theme-default": string - Either 'theme-default'/'theme-light'
        • .view_file_explorer=true: boolean
Instance:
  • .console_el: HTMLElement
    • .print: function(arg0_message:string, arg1_type:string) - arg1_type is either 'message'/'error'.
  • ._file_path: string - The file path currently opened.
  • .leftbar_file_explorer: ve.FileExplorer
  • .scene_blockly: ve.ScriptManagerBlockly
  • .scene_monaco: ve.ScriptManagerMonaco
  • .scene_interface: ve.FlexInterface
  • .v: string

Private Fields:

Methods:
  • loadSettings(arg0_settings:Object)
  • saveSettings() | string
  • setCodeEditorTheme(arg0_theme_class:string)
  • setTheme(arg0_theme_class:string)
  • throwLoadError(arg0_error:Error|string)

Extends

Classes

ve.ScriptManager.FindAndReplace
ve.ScriptManager.UI_Bottombar

Members

v :string

Returns the current output code in the present Component.

  • Accessor of: ve.ScriptManager
Source:
Type:
  • string

v

Sets the current output code in the present Component.

  • Accessor of: ve.ScriptManager
Source:

from_binding

Internal .from_binding setter for handling .options.from_binding. Accepts a string literal that is then parsed to a variable reference.

.to_binding counterparts are manually handled child-side.

Overrides:
Source:

limit

Tests the current this.limit by calling this.limit_function(this.v, this). Otherwise resolves to true if no .options.limit is set.

Overrides:
Source:

name

Returns the visual name of the present ve.Component,

Overrides:
Source:

Methods

loadSettings(arg0_settingsopt, arg1_loaded)

Loads a new settings object and refreshes the present Component to display them, then sets this._settings.

  • Method of: ve.ScriptManager
Source:
Parameters:
Name Type Attributes Description
arg0_settings Object <optional>
Name Type Attributes Description
project_folder string <optional>
monaco_theme string <optional>

One of the default Monaco themes or a custom JSON theme name.

hide_blockly boolean <optional>
scene_height number <optional>
theme theme <optional>

Either 'theme-default'/'theme-light'

view_file_explorer boolean <optional>

Whether to show the file explorer.

arg1_loaded boolean

saveSettings() → {string}

Returns the present this._settings as a string.

  • Method of: ve.ScriptManager
Source:
Returns:
Type:
string

setCodeEditorTheme(arg0_theme_class)

Sets the present code editor theme.

  • Method of: ve.ScriptManager
Source:
Parameters:
Name Type Description
arg0_theme_class string

setTheme(arg0_theme_class)

Sets the theme of the overall editor.

  • Method of: ve.ScriptManager
Source:
Parameters:
Name Type Description
arg0_theme_class string

Either 'theme-default'/'theme-light'

throwLoadError(arg0_error)

Displays a load error window given an error, or a variable that resolves to a string.

  • Method of: ve.ScriptManager
Source:
Parameters:
Name Type Description
arg0_error Error | string

addComponent()

Adds the current component to this.parent_el should it exist.

Overrides:
Source:

bind(arg0_container_el)

Manually binds/mounts the present ve.Component into the visual DOM.

Overrides:
Source:
Parameters:
Name Type Description
arg0_container_el HTMLElement

fireFromBinding()

Pseudo-setter from binding. Fires only upon program-driven changes to .v directly, which means that this has to be monitored manually component-side in set v(). This should always come last in set v().

Overrides:
Source:

fireToBinding()

Pseudo-setter to binding. Fires only upon user-driven changes, which means that this has to be monitored manually component-side.

Overrides:
Source:

remove()

Removes the component/element from the DOM.

Overrides:
Source:

removeComponent()

Removes the current component from this.parent_el should it exist.

Overrides:
Source:

setOwner(arg0_value, arg1_owner_array)

Sets the root parent and ownership tree. Influences this.parent_el, this.owner, this.owners.

Overrides:
Source:
Parameters:
Name Type Description
arg0_value
arg1_owner_array

setValueFromObject(arg0_object, arg1_object)

Destructures Object values and transfers them into the .v instance fields of each Vercengen component.

Overrides:
Source:
Parameters:
Name Type Description
arg0_object Object

The Vercengen object to transfer to.

arg1_object Object

The other object to transfer from.