Skip to content

Commit

Permalink
New: Use Carbon.FileLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Feb 11, 2024
1 parent 0304374 commit 1b2544a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
32 changes: 13 additions & 19 deletions Resources/Private/Fusion/Presentation/Map.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,25 @@ prototype(Carbon.GeoMap:Presentation.Map) < prototype(Neos.Fusion:Component) {
mjs = ${Configuration.setting('Carbon.GeoMap.slipstream.mjs')}
}

// @internal Move to @private if minimal Neos requirement is 8.3 or higher
_fileLoader = ${{js: this.js, mjs: this.mjs, css: this.css, slipstream: this.slipstream}}
[email protected] = Carbon.FileLoader:Component {
slipstream = ${value.slipstream}
js = ${value.js}
mjs = ${value.mjs}
css = ${value.css}
}
_fileLoaderAsAttributes = ${!Type.isString(this._fileLoader)}

renderer = afx`
<div
class={Carbon.String.merge("carbon-geomap", props.class, props.additionalClass)}
data-center={Json.stringify(props.center)}
data-zoom={props.zoom}
{...(props._fileLoaderAsAttributes ? props._fileLoader : {})}
{...props.attributes}
>
<link
@if.set={props.css}
rel="stylesheet"
href={props.css}
data-slipstream={props.slipstream.css}
/>
<script
@if.set={props.js}
src={props.js}
data-slipstream={props.slipstream.js}
defer
></script>
<script
@if.set={props.mjs}
src={props.mjs}
data-slipstream={props.slipstream.mjs}
defer
type="module"
></script>
{props._fileLoaderAsAttributes ? '' : props._fileLoader}
<div
class="carbon-geomap__canvas"
data-effect={Type.isString(props.effect) ? props.effect : null}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
],
"require": {
"neos/neos": "^7.3 || ^8.0",
"sitegeist/slipstream": "^2.0",
"carbon/notification": "^2.1",
"carbon/geomapeditor": "^0.1.1",
"carbon/rangeeditor": "^0.1",
"carbon/fileloader": "^0.1",
"carbon/eel": "^2.7",
"shel/neos-colorpicker": "^1.5"
},
Expand Down

0 comments on commit 1b2544a

Please sign in to comment.