-
Notifications
You must be signed in to change notification settings - Fork 0
/
Living Documentation - Tokens Studio.json
1 lines (1 loc) · 3.62 KB
/
Living Documentation - Tokens Studio.json
1
{"id":"lfsww93gp6glo077uf9","name":"Living Documentation - Tokens Studio","description":"Takes a token set and a filter and creates documentation values based on layer names","color":"purple","actions":[{"id":"l0dq25uezrpvfe3kwuh","command":{"name":"askForInput","metadata":{"inputVariable":"set","inputPrompt":"Which set?"},"title":"","description":""},"actions":[]},{"id":"l0dq3szyvki45bxvukq","command":{"name":"askForInput","metadata":{"inputVariable":"startsWith","inputPrompt":"Token name (startsWith)"},"title":"","description":""},"actions":[]},{"id":"l0doweczslxczzg0tdr","command":{"name":"setVariable","metadata":{"key":"tokenValues","value":"eval(function main() { const pluginData = figma.root.getSharedPluginData(\"tokens\", \"values\")\nconst tokens= JSON.parse(pluginData);\nconst parsed = tokens[\"{{set}}\"].filter(token => token.name.startsWith(\"{{startsWith}}\"));\nreturn JSON.stringify(parsed) }; main())"},"title":"","description":""},"actions":[]},{"id":"l0ehyhw0q86eeaj7jb","command":{"name":"createFrame","metadata":{},"title":"","description":""},"actions":[{"id":"l0ehzbv7q2ca5u9yyce","command":{"name":"setVariable","metadata":{"key":"parentFrameId","value":"{{this.id}}"},"title":"","description":""},"actions":[]},{"id":"l0ehymbrsj59nwetuzh","command":{"name":"setAutoLayout","metadata":{"layoutMode":"VERTICAL","itemSpacing":"16","horizontalSizingMode":"AUTO","verticalSizingMode":"AUTO","horizontalAlignItems":"MIN","verticalAlignItems":"MIN","alignment":"PACKED","paddingLeft":"32","paddingRight":"32","paddingTop":"32","paddingBottom":"32"},"title":"","description":""},"actions":[]}]},{"id":"l0dqg1jsnp9cxh9e94a","command":{"name":"getCurrentSelection","metadata":{},"title":"","description":""},"actions":[{"id":"l0dqgpmtlbuc7hl271s","command":{"name":"setVariable","metadata":{"key":"templateLayer","value":"{{this.id}}"},"title":"","description":""},"actions":[]},{"id":"l0dq1h0fvi96c6pthu7","command":{"name":"forEach","metadata":{"array":"{{tokenValues}}"},"title":"","description":""},"actions":[{"id":"l0e5nw0u7n3979916nj","command":{"name":"setVariable","metadata":{"key":"token","value":"{{item}}"},"title":"","description":""},"actions":[]},{"id":"l0e4pl732rf28li1plf","command":{"name":"getNodeById","metadata":{"id":"{{templateLayer}}"},"title":"","description":""},"actions":[{"id":"l0e4qbq5xz0n47cl0ci","command":{"name":"duplicate","metadata":{},"title":"","description":""},"actions":[{"id":"l0e4rsfl4c3ap5bcwvi","command":{"name":"setName","metadata":{"layerName":"{{item.name}}"},"title":"","description":""},"actions":[]},{"id":"l0e4tjwdtsdmrq27udq","command":{"name":"find","metadata":{"findType":"findAll","location":"parentAction","key":"name","condition":"beginsWith","value":"__"},"title":"","description":""},"actions":[{"id":"l0e4uaypmdrc64lcucd","command":{"name":"forEach","metadata":{},"title":"","description":""},"actions":[{"id":"l0e75pu3sjgi7looldp","command":{"name":"setSelection","metadata":{},"title":"","description":""},"actions":[]},{"id":"l0eizrwycxmfz67vxzf","command":{"name":"setTextCharacters","metadata":{"characters":"{{item.name}}"},"title":"","description":""},"actions":[]},{"id":"l0e69601jrm8olc3swf","command":{"name":"runScript","metadata":{"script":"const property = \"{{item.name}}\".replace(\"__\", \"\");\nconst value = \"{{token.name}}\";\nconst layer = figma.currentPage.selection[0];\nlayer.setSharedPluginData(\"tokens\", property, `\"${value}\"`);"},"title":"","description":""},"actions":[]}]}]},{"id":"l0ei07nbx9q7nvudfq9","command":{"name":"reparent","metadata":{"parentID":"{{parentFrameId}}"},"title":"","description":""},"actions":[]}]}]}]}]}],"createdAt":1680047486476,"automationWasChanged":true}