Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: Split basic fusion prototype files and define defaults #3915

Merged
merged 5 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Deprecated/Array.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# deprecated since Neos 4.2 in favor of Neos.Fusion:Join
prototype(Neos.Fusion:Array) {
@class = 'Neos\\Fusion\\FusionObjects\\ArrayImplementation'
@sortProperties = true
}
15 changes: 15 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Deprecated/Attributes.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Renders attributes of a HTML tag
#
# Usage:
# attributes = Neos.Fusion:Attributes {
# foo = 'bar'
# class = Neos.Fusion:DataStructure {
# class1 = 'class1'
# class2 = 'class2'
# }
# }
#
# @deprecated since Neos 5.0 in favor of Neos.Fusion:Tag internal attributes handling when a datastructure is passed
prototype(Neos.Fusion:Attributes) {
@class = 'Neos\\Fusion\\FusionObjects\\AttributesImplementation'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @deprecated since Neos 4.2 in favor of Neos.Fusion:Loop
prototype(Neos.Fusion:Collection) {
@class = 'Neos\\Fusion\\FusionObjects\\CollectionImplementation'
itemName = 'item'
itemKey = 'itemKey'
iterationName = 'iterator'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @deprecated since Neos 4.2 in favor of Neos.Fusion:DataStructure
prototype(Neos.Fusion:RawArray) {
@class = 'Neos\\Fusion\\FusionObjects\\RawArrayImplementation'
@sortProperties = true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @deprecated since Neos 4.2 in favor of Neos.Fusion:Map
prototype(Neos.Fusion:RawCollection) {
@class = 'Neos\\Fusion\\FusionObjects\\RawCollectionImplementation'
itemName = 'item'
itemKey = 'itemKey'
iterationName = 'iterator'
}
26 changes: 26 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/ActionUri.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Renders an URI pointing to a controller/action
#
# Usage:
# uri = Neos.Fusion:ActionUri {
# package = 'Some.Package'
# controller = 'Standard'
# action = 'index'
# }
#
prototype(Neos.Fusion:ActionUri) {
@class = 'Neos\\Fusion\\FusionObjects\\ActionUriImplementation'
request = ${request}
package = null
subpackage = null
controller = null
action = null
format = null
section = null
additionalParams = Neos.Fusion:DataStructure
arguments = Neos.Fusion:DataStructure
argumentsToBeExcludedFromQueryString = Neos.Fusion:DataStructure
addQueryString = false
absolute = false

@exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\AbsorbingHandler'
}
26 changes: 26 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Augmenter.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Modify given html content and add attributes
#
# Usage:
# augmentedHtml = Neos.Fusion:Augmenter {
# class = 'some-class'
# content = '<h1>Header</h1>'
# }
#
# Usage: as processor
# augmentedHtml = '<h1>Header</h1>'
# augmentedHtml.@process.augmenter = Neos.Fusion:Augmenter {
# class = 'some-class'
# }
#
prototype(Neos.Fusion:Augmenter) {
@class = 'Neos\\Fusion\\FusionObjects\\AugmenterImplementation'
@sortProperties = false

# If more than one tag is found the content is wrapped in the fallback tag before augmentation
fallbackTagName = 'div'

# The content that shall be augmented
content = ${value}

# All other fusion properties are added to the html content as html attributes
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
prototype(Neos.Fusion:CanRender) {
@class = 'Neos\\Fusion\\FusionObjects\\CanRenderImplementation'
type = null
path = null
}
4 changes: 4 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Case.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
prototype(Neos.Fusion:Case) {
@class = 'Neos\\Fusion\\FusionObjects\\CaseImplementation'
@sortProperties = true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
prototype(Neos.Fusion:Component) {
@class = 'Neos\\Fusion\\FusionObjects\\ComponentImplementation'
@sortProperties = false
renderer = ''
mhsdesign marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
prototype(Neos.Fusion:DataStructure) {
@class = 'Neos\\Fusion\\FusionObjects\\DataStructureImplementation'
@sortProperties = true
}
6 changes: 6 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Debug.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
prototype(Neos.Fusion:Debug) {
@class = 'Neos\\Fusion\\FusionObjects\\DebugImplementation'
value = ${value}
title = ''
plaintext = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
prototype(Neos.Fusion:DebugDump) {
@class = 'Neos\\Fusion\\FusionObjects\\DebugDumpImplementation'
value = ${value}
enabled = true
}
13 changes: 13 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Fragment.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Render a content fragment without any additional markup
# to allow placing conditions for multiple tags at once.
#
# Usage:
# renderer = afx`
# <Neos.Fusion:Fragment @if.isEnabled={props.enable}>
# <h1>Example</h1>
# <h2>Content</h2>
# </Neos.Fusion:Fragment>
# `
prototype(Neos.Fusion:Fragment) < prototype(Neos.Fusion:Component) {
renderer = ${props.content}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are globally applied cache identifiers.
# If you don't make @cache.entryIdentifiers another prototype (like a Neos.Fusion:DataStructure)
# they will be rendered as this prototype, which means everything in here is added to ALL cached
# Fusion parts.
# The baseUri contains the protocol (http/https), domain and port.
#
# WARNING: Do not delete this prototype, it is used inside of \Neos\Fusion\Core\Cache\RuntimeContentCache::buildCacheIdentifierValues() as a fallback.
#
prototype(Neos.Fusion:GlobalCacheIdentifiers) < prototype(Neos.Fusion:DataStructure) {
format = ${request.format}
baseUri = ${String.toString(BaseUri.getConfiguredBaseUriOrFallbackToCurrentRequest(request.httpRequest))}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Render an HTTP message (response)
#
# This is a convenient base prototype for rendering documents.
#
# Usage:
# page = Neos.Fusion:Http.Message {
# httpResponseHead {
# statusCode = 404
# headers.Content-Type = 'application/json'
# }
# }
#
#
prototype(Neos.Fusion:Http.Message) < prototype(Neos.Fusion:Join) {
@class = 'Neos\\Fusion\\FusionObjects\\HttpResponseImplementation'
@sortProperties = true
httpResponseHead = Neos.Fusion:Http.ResponseHead
httpResponseHead.@position = 'start 1000'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Render a HTTP response header
#
prototype(Neos.Fusion:Http.ResponseHead) {
@class = 'Neos\\Fusion\\FusionObjects\\Http\\ResponseHeadImplementation'
headers = Neos.Fusion:DataStructure {
@sortProperties = false
}
}
5 changes: 5 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Join.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
prototype(Neos.Fusion:Join) {
@class = 'Neos\\Fusion\\FusionObjects\\JoinImplementation'
@sortProperties = true
@glue = ''
}
22 changes: 22 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Link.Action.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Renders a link pointing to a controller/action
#
# Usage:
# link = afx`
# <Neos.Fusion:Link.Action class="action-link" href.package="Some.Package" href.controller="Standard" href.action="index">
# Some Link
# </Neos.Fusion:Link.Action>
# `
#
prototype(Neos.Fusion:Link.Action) < prototype(Neos.Fusion:Component) {
href = Neos.Fusion:ActionUri
content = ''

renderer = Neos.Fusion:Tag {
tagName = 'a'
attributes {
@ignoreProperties = ${['content']}
@apply.props = ${props}
}
content = ${props.content}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Renders a link pointing to a resource
#
# Usage:
# link = afx`
# <Neos.Fusion:Link.Resource class="resource-link" href.path="resource://Some.Package/Public/Images/SomeImage.png">
# Some Link
# </Neos.Fusion:Link.Resource>
# `
#
prototype(Neos.Fusion:Link.Resource) < prototype(Neos.Fusion:Component) {
href = Neos.Fusion:ResourceUri {
localize = true
}
content = ''

renderer = Neos.Fusion:Tag {
tagName = 'a'
attributes {
@ignoreProperties = ${['content']}
@apply.props = ${props}
}
content = ${props.content}
}
}
7 changes: 7 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Loop.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
prototype(Neos.Fusion:Loop) {
@class = 'Neos\\Fusion\\FusionObjects\\LoopImplementation'
itemName = 'item'
itemKey = 'itemKey'
iterationName = 'iterator'
@glue = ''
}
9 changes: 9 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Map.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prototype(Neos.Fusion:Map) {
@class = 'Neos\\Fusion\\FusionObjects\\MapImplementation'
items = ${[]}
itemName = 'item'
itemKey = 'itemKey'
iterationName = 'iterator'
keyRenderer = null
itemRenderer = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
# }
prototype(Neos.Fusion:Match) {
@class = 'Neos\\Fusion\\FusionObjects\\MatchImplementation'
@default = null
@subject = ''
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
prototype(Neos.Fusion:Matcher) {
@class = 'Neos\\Fusion\\FusionObjects\\MatcherImplementation'
condition = false
type = null
renderPath = null
}
10 changes: 10 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Reduce.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prototype(Neos.Fusion:Reduce) {
@class = 'Neos\\Fusion\\FusionObjects\\ReduceImplementation'
items = ${[]}
itemName = 'item'
itemKey = 'itemKey'
carryName = 'carry'
iterationName = 'iterator'
initialValue = null
itemReducer = null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
prototype(Neos.Fusion:Renderer) {
@class = 'Neos\\Fusion\\FusionObjects\\RendererImplementation'
type = null
renderPath = null
renderer = null
}
16 changes: 16 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/ResourceUri.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Renders an URI pointing to a resource
#
# Usage:
# fileUri = Neos.Fusion:ResourceUri {
# path = 'resource://Some.Package/Public/Images/SomeImage.png'
# }
#
prototype(Neos.Fusion:ResourceUri) {
@class = 'Neos\\Fusion\\FusionObjects\\ResourceUriImplementation'
path = null
package = null
resource = null
localize = true

@exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\AbsorbingHandler'
}
19 changes: 19 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Tag.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Renders an HTML tag
#
# Usage:
# tag = Neos.Fusion:Tag {
# tagName = 'h1'
# attributes = {
# class = 'some-class'
# }
# }
#
prototype(Neos.Fusion:Tag) {
@class = 'Neos\\Fusion\\FusionObjects\\TagImplementation'
attributes = Neos.Fusion:DataStructure {
@sortProperties = false
}
omitClosingTag = false
selfClosingTag = false
allowEmptyAttributes = true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
prototype(Neos.Fusion:Template) {
@class = 'Neos\\Fusion\\FusionObjects\\TemplateImplementation'
templatePath = null
partialRootPath = null
layoutRootPath = null
sectionName = null
}
29 changes: 29 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/UriBuilder.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Renders an URI pointing to a controller/action
#
# Usage:
# uri = Neos.Fusion:UriBuilder {
# package = 'Some.Package'
# controller = 'Standard'
# action = 'index'
# }
#
prototype(Neos.Fusion:UriBuilder) {
@class = 'Neos\\Fusion\\FusionObjects\\UriBuilderImplementation'
package = null
subpackage = null
controller = null
action = null
format = null
section = null
additionalParams = Neos.Fusion:DataStructure {
@sortProperties = false
}
argumentsToBeExcludedFromQueryString = Neos.Fusion:DataStructure
arguments = Neos.Fusion:DataStructure {
@sortProperties = false
}
addQueryString = false
absolute = false

@exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\AbsorbingHandler'
}
4 changes: 4 additions & 0 deletions Neos.Fusion/Resources/Private/Fusion/Prototypes/Value.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
prototype(Neos.Fusion:Value) {
@class = 'Neos\\Fusion\\FusionObjects\\ValueImplementation'
value = null
}