Graphite/frontend/src/components
Keavon Chambers 0a9427fe6e Polish node graph frames and rename them for clarity (#1104)
* Polish layer panel UI and layer type icons/text

* Assorted UI text and comment cleanup

* Insert Transform node before Imaginate node via tool

* Rename "Node Graph Frame" to Layer type and Frame tool

* Rename "Node Graph Frame" to "Frame" tool

* Update Node Graph Frame -> Frame tool icon

* Fix lint warnings
2023-04-03 01:52:25 -07:00
..
floating-menus Replace TS relative @ import path (#1087) 2023-03-26 01:39:38 +01:00
layout Replace TS relative @ import path (#1087) 2023-03-26 01:39:38 +01:00
panels Polish node graph frames and rename them for clarity (#1104) 2023-04-03 01:52:25 -07:00
widgets Replace TS relative @ import path (#1087) 2023-03-26 01:39:38 +01:00
window Fix regressions introduced in the vector nodes migration (#1100) 2023-03-31 21:15:49 +01:00
Editor.svelte Replace TS relative @ import path (#1087) 2023-03-26 01:39:38 +01:00
README.md Remove all references to Vue 2023-03-10 04:02:02 -08:00

README.md

Overview of /frontend/src/components/

Each component represents a (usually reusable) part of the Graphite Editor GUI. These all get mounted in Editor.svelte (in the /src directory above this one).

Floating Menus: floating-menus/

The temporary UI areas with dark backgrounds which hover over the top of the editor window content. Examples include popovers, dropdown menu selectors, and dialog modals.

Layout: layout/

Useful containers that control the flow of content held within.

Panels: panels/

The dockable tabbed regions like the Document, Properties, Layer Tree, and Node Graph panels.

Widgets: widgets/

The interactive input items used to display information and provide user control.

Window: window/

The building blocks for the Title Bar, Workspace, and Status Bar within an editor application window.

Svelte tips and tricks

This section contains a growing list of quick reference information for helpful Svelte solutions and best practices. Feel free to add to this to help contributors learn things, or yourself remember tricks you'll likely forget in a few months.

Bi-directional props

The component declares this:

// The dispatcher that sends the changed value as a custom event to the parent
const dispatch = createEventDispatcher<{ theBidirectionalProperty: number }>();

// The prop
export let theBidirectionalProperty: number;

// Called only when `theBidirectionalProperty` is changed from outside this component via its props
$: console.log(theBidirectionalProperty);

// Example of a method that would update the value
function doSomething() {
	dispatch("theBidirectionalProperty", SOME_NEW_VALUE);
},

Users of the component do this for theCorrespondingDataEntry to be a two-way binding:

let theCorrespondingDataEntry = 42;
<DropdownInput
	theBidirectionalProperty={theCorrespondingDataEntry}
	on:theBidirectionalProperty={({ detail }) => { theCorrespondingDataEntry = detail; }}
/>