Graphite/frontend-svelte/src/components
Keavon Chambers 33b5c0f5f4 Svelte: Fix FontInput component infinite loop 2023-02-12 01:01:40 -08:00
..
floating-menus Svelte: Fix calling DOM API functions on the actual elements 2023-01-13 17:17:38 -08:00
layout Svelte: Fix calling DOM API functions on the actual elements 2023-01-13 17:17:38 -08:00
panels Update Imaginate to output bitmap data to the graph via Image Frame node (#1001) 2023-02-11 08:56:31 +00:00
widgets Svelte: Fix FontInput component infinite loop 2023-02-12 01:01:40 -08:00
window Port frontend from Vue to Svelte (WIP in separate folder, many bugs) (#964) 2023-01-13 01:05:20 -08:00
Editor.svelte Port frontend from Vue to Svelte (WIP in separate folder, many bugs) (#964) 2023-01-13 01:05:20 -08:00
README.md Port frontend from Vue to Svelte (WIP in separate folder, many bugs) (#964) 2023-01-13 01:05:20 -08:00

README.md

Overview of /frontend-svelte/src/components/

Each component represents a (usually reusable) part of the Graphite Editor GUI. These all get mounted within the Vue entry point, App.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.

Vue tips and tricks

This section contains a growing list of quick reference information for helpful Vue 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:

export default defineComponent({
	emits: ["update:theBidirectionalProperty"],
	props: {
		theBidirectionalProperty: {
			type: Number as PropType<number>,
			required: false,
		},
	},
	watch: {
		// Called only when `theBidirectionalProperty` is changed from outside this component (with v-model)
		theBidirectionalProperty(newSelectedIndex: number | undefined) {},
	},
	methods: {
		doSomething() {
			this.$emit("update:theBidirectionalProperty", SOME_NEW_VALUE);
		},
	},
});

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

<DropdownInput v-model:theBidirectionalProperty="theCorrespondingDataEntry" />