Skip to content

Commit e8fdcf6

Browse files
committed
Fix: Neos 9 compatibility
1 parent a08c84b commit e8fdcf6

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ This prototype is a small helper to write prototypes for the `ConditionPrototype
174174
| `content` | (string) The node type name the content type. Defaults to `this.mixin` |
175175
| `contentCollection` | (string) The filter for the content collection. Defaults to `[instanceof Neos.Neos:ContentCollection]` |
176176
| `documentNode` | (node) The node from the document. Defaults to `documentNode` |
177-
| `alwaysInclude` | (boolean) If `true`, the prototype return `true`. Defaults to `node.context.inBackend` |
177+
| `alwaysInclude` | (boolean) If `true`, the prototype return `true`. Defaults to `Carbon.IncludeAssets:InBackend` |
178178

179179
### [Carbon.IncludeAssets:Collection]
180180

Resources/Private/Fusion/External/Case.fusion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ prototype(Carbon.IncludeAssets:Case) < prototype(Neos.Fusion:Component) {
1616
contentCollection = '[instanceof Neos.Neos:ContentCollection]'
1717
documentNode = ${documentNode}
1818

19-
alwaysInclude = ${node.context.inBackend}
19+
alwaysInclude = Carbon.IncludeAssets:InBackend
2020

2121
renderer = Neos.Fusion:Case {
2222
alwaysInclude {

Resources/Private/Fusion/External/File.fusion

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ prototype(Carbon.IncludeAssets:File) < prototype(Neos.Fusion:Component) {
2222
// This is a internal variable, please use `assetPath` for an single file
2323
paths = ${Configuration.setting('Carbon.IncludeAssets.Default.Path')}
2424

25+
inBackend = Carbon.IncludeAssets:InBackend
26+
2527
@if.fileIsSet = ${this.file}
2628

2729
renderer = Neos.Fusion:Component {
@@ -61,7 +63,7 @@ prototype(Carbon.IncludeAssets:File) < prototype(Neos.Fusion:Component) {
6163
renderer = Carbon.IncludeAssets:Internal.TypeCase {
6264
type = ${props.type}
6365
css = afx`
64-
<Carbon.IncludeAssets:Internal.Tag.CSS path={props.path} fileObject={props.fileObject} cacheBuster={props.cacheBuster} async={this.fileObject.async ? node.context.live : false} />
66+
<Carbon.IncludeAssets:Internal.Tag.CSS path={props.path} fileObject={props.fileObject} cacheBuster={props.cacheBuster} async={this.fileObject.async ? !props.inBackend : false} />
6567
`
6668
js = afx`
6769
<Carbon.IncludeAssets:Internal.Tag.JS path={props.path} fileObject={props.fileObject} cacheBuster={props.cacheBuster} />
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
prototype(Carbon.IncludeAssets:InBackend) < prototype(Neos.Fusion:Value) {
2+
node = ${node}
3+
4+
// Neos 9 compatible
5+
renderingMode = ${renderingMode ? renderingMode.isEdit : null}
6+
7+
// Neos 8 compatible
8+
value = ${Type.isBoolean(this.renderingMode) ? this.renderingMode : this.node.context.inBackend}
9+
}

Resources/Private/Fusion/Internal/Package.fusion

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ prototype(Carbon.IncludeAssets:Internal.Package) < prototype(Neos.Fusion:Compone
1414
// Internal property
1515
mergedConfig = ${Array.concat(Configuration.setting('Carbon.IncludeAssets.Default'), this.config)}
1616
sitePackageKey = ${this.monocle ? sitePackageKey : node.context.currentSite.siteResourcesPackageKey}
17+
inBackend = Carbon.IncludeAssets:InBackend
1718

1819
renderer = Neos.Fusion:Component {
1920
@if.hasCustomCondition = Neos.Fusion:Case {
@@ -34,7 +35,7 @@ prototype(Carbon.IncludeAssets:Internal.Package) < prototype(Neos.Fusion:Compone
3435
collection = Neos.Fusion:Map {
3536
items = ${String.split(props.mergedConfig.Order, ',')}
3637
itemRenderer = Neos.Fusion:Value {
37-
condition = ${props.monocle ? item != 'Backend' : (item == 'General' || (item == 'Backend' && node.context.inBackend) || (item == 'Live' && node.context.live))}
38+
condition = ${props.monocle ? item != 'Backend' : (item == 'General' || (item == 'Backend' && props.inBackend) || (item == 'Live' && !props.inBackend))}
3839
value = ${this.condition ? props.mergedConfig[item][props.location] : false}
3940
@process.convertToArray = ${Type.isString(value) ? String.split(value, ',') : value}
4041
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "GPL-3.0-or-later",
66
"keywords": ["flow", "neos", "fusion", "helper", "carbon"],
77
"require": {
8-
"neos/neos": "^8.0",
8+
"neos/neos": "^8.0 || ^9.0",
99
"carbon/eel": "^2.0"
1010
},
1111
"authors": [

0 commit comments

Comments
 (0)