mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 18:48:13 +08:00
Clean up code for optional node inputs/outputs
This removes the unused Split Channels node's primary output
This commit is contained in:
@@ -681,9 +681,9 @@
|
||||
viewBox="0 0 8 8"
|
||||
class="port"
|
||||
data-port="input"
|
||||
data-datatype={node.primaryInput}
|
||||
style:--data-color={`var(--color-data-${node.primaryInput})`}
|
||||
style:--data-color-dim={`var(--color-data-${node.primaryInput}-dim)`}
|
||||
data-datatype={node.primaryInput?.dataType}
|
||||
style:--data-color={`var(--color-data-${node.primaryInput?.dataType})`}
|
||||
style:--data-color-dim={`var(--color-data-${node.primaryInput?.dataType}-dim)`}
|
||||
>
|
||||
<title>{node.primaryInput} data</title>
|
||||
<path d="M0,6.306A1.474,1.474,0,0,0,2.356,7.724L7.028,5.248c1.3-.687,1.3-1.809,0-2.5L2.356.276A1.474,1.474,0,0,0,0,1.694Z" />
|
||||
@@ -768,15 +768,15 @@
|
||||
{/if}
|
||||
<!-- Input ports -->
|
||||
<div class="input ports">
|
||||
{#if node.primaryInput}
|
||||
{#if node.primaryInput?.dataType}
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 8 8"
|
||||
class="port primary-port"
|
||||
data-port="input"
|
||||
data-datatype={node.primaryInput}
|
||||
style:--data-color={`var(--color-data-${node.primaryInput})`}
|
||||
style:--data-color-dim={`var(--color-data-${node.primaryInput}-dim)`}
|
||||
data-datatype={node.primaryInput?.dataType}
|
||||
style:--data-color={`var(--color-data-${node.primaryInput?.dataType})`}
|
||||
style:--data-color-dim={`var(--color-data-${node.primaryInput?.dataType}-dim)`}
|
||||
>
|
||||
<title>{node.primaryInput} data</title>
|
||||
<path d="M0,6.306A1.474,1.474,0,0,0,2.356,7.724L7.028,5.248c1.3-.687,1.3-1.809,0-2.5L2.356.276A1.474,1.474,0,0,0,0,1.694Z" />
|
||||
@@ -835,7 +835,7 @@
|
||||
<clipPath id={clipPathId}>
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d={nodeBorderMask(120, node.primaryInput !== undefined, node.exposedInputs.length, node.primaryOutput !== undefined, node.exposedOutputs.length)}
|
||||
d={nodeBorderMask(120, node.primaryInput?.dataType !== undefined, node.exposedInputs.length, node.primaryOutput !== undefined, node.exposedOutputs.length)}
|
||||
/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
|
||||
@@ -81,13 +81,13 @@ export class FrontendDocumentDetails extends DocumentDetails {
|
||||
|
||||
export type FrontendGraphDataType = "general" | "raster" | "color" | "vector" | "vec2" | "graphic" | "artboard";
|
||||
|
||||
export class NodeGraphInput {
|
||||
export class FrontendGraphInput {
|
||||
readonly dataType!: FrontendGraphDataType;
|
||||
|
||||
readonly name!: string;
|
||||
}
|
||||
|
||||
export class NodeGraphOutput {
|
||||
export class FrontendGraphOutput {
|
||||
readonly dataType!: FrontendGraphDataType;
|
||||
|
||||
readonly name!: string;
|
||||
@@ -98,13 +98,13 @@ export class FrontendNode {
|
||||
|
||||
readonly displayName!: string;
|
||||
|
||||
readonly primaryInput!: FrontendGraphDataType | undefined;
|
||||
readonly primaryInput!: FrontendGraphInput | undefined;
|
||||
|
||||
readonly exposedInputs!: NodeGraphInput[];
|
||||
readonly exposedInputs!: FrontendGraphInput[];
|
||||
|
||||
readonly primaryOutput!: NodeGraphOutput | undefined;
|
||||
readonly primaryOutput!: FrontendGraphOutput | undefined;
|
||||
|
||||
readonly exposedOutputs!: NodeGraphOutput[];
|
||||
readonly exposedOutputs!: FrontendGraphOutput[];
|
||||
|
||||
@TupleToVec2
|
||||
readonly position!: XY | undefined;
|
||||
|
||||
Reference in New Issue
Block a user