Created
October 20, 2020 16:37
-
-
Save xeladotbe/69ef39d52828dd91b0b9e620d5bbaf00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"document": { | |
"type": "APL", | |
"version": "1.4", | |
"settings": {}, | |
"theme": "dark", | |
"import": [], | |
"resources": [], | |
"styles": {}, | |
"onMount": [], | |
"graphics": {}, | |
"commands": { | |
"Highlight": { | |
"parameters": [ | |
"tokens", | |
{ | |
"name": "index", | |
"type": "number", | |
"default": "0" | |
} | |
], | |
"commands": [ | |
{ | |
"type": "SetValue", | |
"componentId": "tokens", | |
"property": "token", | |
"value": "${index}" | |
}, | |
{ | |
"when": "${index < tokens.length}", | |
"type": "Sequential", | |
"commands": [ | |
{ | |
"type": "Idle", | |
"delay": "${tokens[index].minimumDwellTime || 500}" | |
}, | |
{ | |
"type": "Highlight", | |
"index": "${index + 1}", | |
"tokens": "${tokens}" | |
} | |
] | |
} | |
] | |
} | |
}, | |
"layouts": {}, | |
"mainTemplate": { | |
"parameters": [ | |
"payload" | |
], | |
"items": [ | |
{ | |
"type": "Container", | |
"id": "tokens", | |
"direction": "row", | |
"bind": [ | |
{ | |
"name": "token", | |
"type": "number", | |
"value": "-1" | |
} | |
], | |
"onMount": [ | |
{ | |
"type": "Highlight", | |
"tokens": "${payload.currentView.properties.tokens}" | |
} | |
], | |
"wrap": "wrap", | |
"data": "${payload.currentView.properties.tokens}", | |
"items": [ | |
{ | |
"color": "${index == token ? 'red' : 'white'}", | |
"type": "Text", | |
"spacing": "10dp", | |
"text": "${data.value}" | |
} | |
] | |
} | |
] | |
} | |
}, | |
"datasources": { | |
"currentView": { | |
"type": "object", | |
"properties": { | |
"tokens": [ | |
{ | |
"value": "Lorem" | |
}, | |
{ | |
"value": "ipsum" | |
}, | |
{ | |
"value": "dolor" | |
}, | |
{ | |
"value": "sit", | |
"minimumDwellTime": 300 | |
}, | |
{ | |
"value": "amet,", | |
"minimumDwellTime": 300 | |
}, | |
{ | |
"value": "consetetur", | |
"minimumDwellTime": 800 | |
}, | |
{ | |
"value": "sadipscing", | |
"minimumDwellTime": 800 | |
}, | |
{ | |
"value": "elitr" | |
} | |
] | |
} | |
} | |
}, | |
"sources": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment