Releases: CarbonPackages/Carbon.Eel
2.10.0
✨ Add JavaScript and CSS minifier
Carbon.String.minifyJS(javascript)
Minifies JavaScript so that it can be delivered to the client quicker.
javascript
(string, required) The JavaScript to minify
Return The minified JavaScript
Carbon.String.minifyCSS(javascript)
Minifies CSS so that it can be delivered to the client quicker.
css
(string, required) The CSS to minify
Return The minified CSS
Full Changelog: 2.9.0...2.10.0
2.9.0
✨ Feature
AlpineJS.expression(value)
Use this to pass a javascript expression inside of the AlpineJS.object
or AlpineJS.xData
helper
Example:
AlpineJS.object({theme: AlpineJS.expression("localStorage.theme||'system'"), show: props.show})
AlpineJS.xData('themeSwitcher', {theme: AlpineJS.expression("localStorage.theme||'system'"), show: props.show})
Result will be:
{theme:localStorage.theme||'system',show:true}
themeSwitcher({theme:localStorage.theme||'system',show:true})
Full Changelog: 2.8.1...2.9.0
2.8.1
Full Changelog: 2.8.0...2.8.1
2.8.0

✨ AlpineJS Helper
AlpineJS.object(arg1, arg2, ..argN)
Generate an object for AlpineJS directive x-data
.
Supports nested arrays. You could do the same with Json.stringify()
, but this function is shorter, as AlpineJS accepts objects and easier to write and read.
Examples:
AlpineJS.object({effect: 'slide', spaceBetween: 12, loop: true, navigation: null}) == '{effect:'slide',spaceBetween:12,loop:true,navigation:null}'
AlpineJS.object({nested: {value: true, nulled: null}}) == '{nested:{value:true,nulled:null}}'
...arguments
The array
Return The JavaScript object as string
AlpineJS.xData(name, arg1, arg2, ..argN)
Generate a function call for AlpineJS. More info.
Supports nested arrays. In named arrays ({first:1,second:null}
) null
get filtered out, but in list arrays ([1,null]
) and in plain values the will stay.
Examples:
AlpineJS.xData('slider', {effect: 'slide', spaceBetween: 12, loop: true, navigation: null}) == 'slider({effect:'slide',spaceBetween:12,loop:true})'
AlpineJS.xData('slider', 'one', 1, false, null, ['string', 2, null]) == 'slider('one',1,false,null,['string',2,null])'
AlpineJS.xData('nested', {nested: {value: true}}) == 'nested({nested:{value:true}})'
name
(string) The name forAlpine.data
...arguments
(mixed) The options for the function
Return The string for the x-data function call
Full Changelog: 2.7.0...2.8.0
2.7.0
Full Changelog: 2.6.0...2.7.0
2.6.0
Full Changelog: 2.5.0...2.6.0
2.5.0
2.4.0
✨ Feature
Add Carbon.Array.isCountable(variable)
Check if the given variable is countable
Return true
or false
Full Changelog: 2.3.3...2.4.0
2.3.3
Full Changelog: 2.3.2...2.3.3
2.3.2
Full Changelog: 2.3.1...2.3.2