Threepipe Tweakpane Editor Plugin
    Preparing search index...

    Class TweakpaneEditorPlugin

    Hierarchy

    Index
    _dirty: boolean = false
    _viewer?: ThreeViewer
    _viewerListeners: PartialRecord<IViewerEventTypes, (e: IViewerEvent) => void> = {}
    constructor: typeof AViewerPluginSync & typeof AViewerPlugin
    dependencies: (typeof TweakpaneUiPlugin | typeof FullScreenPlugin)[] = ...
    enabled: boolean = true
    frame?: EditorFrame

    The page frame, with the mode bar on the right instead of the mode tabs at the bottom. It is there when layout is not classic, after loadPlugins.

    frameOptions: Omit<
        EditorFrameOptions,
        "layout"
        | "onPickLayout"
        | "onRename"
        | "viewer",
    > = {}

    Options of the page frame (the app name, the theme pairs), used when the frame is made. The plugin sets the layout, the pick in the layout menu (layout), the rename (documentName) and the viewer.

    isViewerPluginSync: true = ...
    modeDivs: (HTMLDivElement | undefined)[] = []
    modeKeys: string[] = []
    modePlugins: Class<IViewerPlugin<ThreeViewer, boolean>>[][] = []
    toJSON: any = undefined
    uiConfig: UiObjectConfig = ...
    uiPlugin?: TweakpaneUiPlugin
    DefaultLayout: EditorPageLayout = 'titlebar'

    The page layout when none is stored. Set it before the plugin is made, as LayoutStorageKey.

    LayoutStorageKey: string | null = 'tpEditorLayout'

    The localStorage key that keeps the page layout the person picked, or null to not keep it. Set it before the plugin is made: the plugin reads the stored layout when it is made.

    OldPluginType?: string
    PluginType: string = 'TweakpaneEditorPlugin'
    • get documentName(): string

      The name in the bars of the page frame: the open file or project. The app sets it, for example the name of the first loaded file (as the tweakpane-editor example does), and a click on it in the bar renames it. Empty: no name. Each change sends documentNameChange, so the app can use the name elsewhere (the example names the exported file with it). It is kept when the frame is made again.

      Returns string

    • set documentName(name: string): void

      Parameters

      • name: string

      Returns void

    • get preventIosInputZoom(): boolean

      iOS and iPadOS zoom the page into a focused text field with text under 16 px (the search fields, the Tweakpane text fields) and do not zoom back out. On (the default), the plugin stops that zoom while it is added, on iOS only: it adds maximum-scale=1 to the viewport meta tag of the page, and puts the tag back when it is removed or this is turned off. A pinch zoom still works in Safari, which ignores the tag for it; an in-app browser (WKWebView) or a web app on the home screen follows the tag and blocks it: turn this off there. The exported function preventIosInputZoom does it.

      Returns boolean

    • set preventIosInputZoom(prevent: boolean): void

      Parameters

      • prevent: boolean

      Returns void

    • Parameters

      • e: IViewerEvent

      Returns IViewerEvent

    • Parameters

      • Optionalprefix: string

      Returns string

    • Adds a panel to the page frame (EditorFrame.addPanel): an element in a place (left, the sidebar left of the canvas; bottom, the strip below it; right, the top of the panel above the settings of the mode), with an entry in the mode bar (options: its name, icon and colour, and the place where it starts). The person shows or hides it with its entry, and moves it to another place with the menu of its entry (a right-click, or a long press). The plugin keeps the panel and adds it again when it makes the frame again (at loadPlugins, and after the classic layout, which has no frame). Move or hide it from code with frame.movePanel and frame.setPanelHidden.

      Parameters

      Returns void

    • Parameters

      • key: any
      • setDirty: boolean = true

      Returns void

    • Parameters

      • key: any
      • setDirty: boolean = true

      Returns void

    • Returns ISerializedConfig | Record<string, never>

    • Parameters

      • state: any

      Returns Promise<void>

    • Parameters

      • ...args: any[]

      Returns any