@tokens-studio/graph-engine-nodes-figma
Version:
Figma-specific nodes for the graph engine
29 lines • 1.02 kB
JavaScript
import { Node } from '@tokens-studio/graph-engine';
import { TokenSchema } from '@tokens-studio/graph-engine-nodes-design-tokens/schemas/index.js';
import { mergeTokenExtensions } from '../utils/tokenMerge.js';
export default class NodeDefinition extends Node {
static title = 'Scope All';
static type = 'studio.tokens.figma.scopeAll';
static description = 'Adds ALL_SCOPES scope to a Figma token';
constructor(props) {
super(props);
this.addInput('token', {
type: {
...TokenSchema,
description: 'The design token to add ALL_SCOPES to'
}
});
this.addOutput('token', {
type: TokenSchema
});
}
execute() {
const inputs = this.getAllInputs();
const newScopes = ['ALL_SCOPES'];
const modifiedToken = mergeTokenExtensions(inputs.token, {
scopes: newScopes
});
this.outputs.token.set(modifiedToken);
}
}
//# sourceMappingURL=scopeAll.js.map