Threepipe Tweakpane Editor Plugin
    Preparing search index...

    Class StickyNotesUiPlugin

    Sticky Notes UI Plugin

    Shows the notes of NotesPlugin as post-its over the canvas, in one of two layouts (StickyNotesLayout): board (a post-it per note) or stack (a pile); minimized takes them off the canvas. The icon buttons at the bottom left (each with a tooltip) add a note, pick the store of new notes, arrange the board, switch the layout and minimise; when minimised, one button with the number of notes brings them back.

    • "Add a note" adds a note at once, in the store of new notes (NotesPlugin.defaultStore). The button next to it shows the icon of that store (a file, a browser window, a cloud for a store of the app); a click opens a menu of the stores.
    • The icon on a note shows its store; a click opens the same menu, to move the note.
    • Each note has "Add the time and the selection" (NotesPlugin.contextLine), "Copy the text" (the icon shows a check for a moment) and "Delete".
    • "Add a note" opens the post-it by the dock: above it, or below it when the dock is at the top of the canvas. Notes added in code (NotesPlugin.addNote) go in the columns of arrange.
    • Drag a post-it by its bar, and size it from its bottom right corner. A click on a post-it brings it up.
    • Drag the dock by its handle (the dots at its left) or its free part, to move it out of the way; a double click there puts it back in its corner, as does "Reset places". The board and the pile keep their places above the corner.
    • The places, the sizes, the order, the layout, the colour and the place of the dock are kept in localStorage (storageKey), not in the file.

    The post-its fill the nearest positioned ancestor of the layer, so the viewer container must be positioned (for example position: relative) for the post-its to stay inside the canvas. The post-its and the dock are above the loading screen and below the bars of the editor; their menus are in a second layer, with the popups of the page.

    The tooltips use tippy.js with the editor theme of the editor (its CSS is added with the styles, see InjectStyles).

    The plugin's UI folder (Sticky Notes) has the settings: show, layout, colour, arrange, reset the places.

    Hierarchy

    • AViewerPluginSync
      • StickyNotesUiPlugin
    Index
    • Parameters

      • storageKey: string = 'threepipe-sticky-notes'

        the localStorage key of the layout, the colour, the places, the sizes and the order

      • startMinimized: boolean = true

        the post-its start minimized on each page load, so they do not cover the canvas; the button of the dock brings back the layout that the person set last. false: they start in that layout.

      Returns StickyNotesUiPlugin

    _dirty: boolean = false
    _viewer?: ThreeViewer
    _viewerListeners: PartialRecord<IViewerEventTypes, (e: IViewerEvent) => void> = {}
    color: StickyNotesColor = 'yellow'

    The colour of the post-its. theme: the colours of the Tweakpane theme

    constructor: typeof AViewerPluginSync & typeof AViewerPlugin
    dependencies: typeof NotesPlugin[] = ...
    dock: HTMLDivElement

    The buttons at the bottom left of the canvas, after a drag handle: add a note, the store of new notes, arrange, the layout and minimise (in the minimized layout, the button that brings the post-its back). Place it with its style when the corner is taken, e.g. dock.style.bottom = '56px'; the pile starts above it. The person can drag it elsewhere: that move is its transform, so do not set one.

    element: HTMLDivElement

    The layer over the canvas that holds the post-its and the dock

    enabled: boolean = true
    isViewerPluginSync: true = ...
    layout: StickyNotesLayout = 'board'
    shown: boolean = true

    The notes are on the canvas

    storageKey: string

    The localStorage key of the layout, the colour, the places, the sizes and the order

    toJSON: any = undefined
    uiConfig: UiObjectConfig = ...
    InjectStyles: boolean = true

    Adds the stylesheet of the notes and of the tooltips to the page when the first plugin is made. Off: the page styles the snp- classes and the tooltips.

    OldPluginType?: string
    PluginType: "StickyNotesUiPlugin" = 'StickyNotesUiPlugin'
    • Parameters

      • e: IViewerEvent

      Returns IViewerEvent

    • Parameters

      • Optionalprefix: string

      Returns string

    • 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