-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCollection.fusion
55 lines (51 loc) · 2.17 KB
/
Collection.fusion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* This prototype output a collection of files
*/
prototype(Carbon.IncludeAssets:Collection) < prototype(Neos.Fusion:Component) {
@propTypes {
collection = ${PropTypes.arrayOf(PropTypes.string)}
assetPackage = ${PropTypes.string}
cacheBuster = ${PropTypes.boolean}
disableCacheBusterForPreloadAsset = ${PropTypes.boolean}
paths = ${
PropTypes.dataStructure({
'Inline': PropTypes.dataStructure({
'CSS': PropTypes.string,
'JS': PropTypes.string,
'MJS': PropTypes.string,
'HTML': PropTypes.string
}),
'File': PropTypes.dataStructure({
'CSS': PropTypes.string,
'JS': PropTypes.string,
'MJS': PropTypes.string,
'PRELOADASSET': PropTypes.string,
'PRELOADCSS': PropTypes.string,
'PRELOADSCRIPT': PropTypes.string,
'MODULEPRELOAD': PropTypes.string
})
}).isRequired
}
wrapper = ${PropTypes.string}
}
collection = ${[]}
assetPackage = ${null}
cacheBuster = ${Configuration.setting('Carbon.IncludeAssets.Default.CacheBuster')}
disableCacheBusterForPreloadAsset = ${Configuration.setting('Carbon.IncludeAssets.Default.DisableCacheBusterForPreloadAsset')}
paths = ${Configuration.setting('Carbon.IncludeAssets.Default.Path')}
wrapper = ${null}
@if.hasAssetPackage = ${this.assetPackage && Type.isArray(this.collection) && Array.length(this.collection)}
renderer = afx`
<Carbon.IncludeAssets:Internal.Wrapper wrapper={props.wrapper}>
<Neos.Fusion:Loop items={props.collection}>
<Carbon.IncludeAssets:File
file={item}
assetPackage={props.assetPackage}
cacheBuster={props.cacheBuster}
disableCacheBusterForPreloadAsset={props.disableCacheBusterForPreloadAsset}
paths={props.paths}
/>
</Neos.Fusion:Loop>
</Carbon.IncludeAssets:Internal.Wrapper>
`
}