Skip to content

Commit

Permalink
Merge pull request #61 from StartAutomating/Emoji-CSS
Browse files Browse the repository at this point in the history
Emoji 0.1.4
  • Loading branch information
StartAutomating committed Mar 8, 2024
2 parents d7fa07b + 6d76cb0 commit 3ea5c5f
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 34 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,11 @@
## Emoji 0.1.4:

* Emoji.Symbol.CSS (#58)
* ... and new views (#60)
* Also making color more tolerant of strict mode (#59)

---

## Emoji 0.1.3:

* Improved Formatting
Expand Down
98 changes: 85 additions & 13 deletions Emoji.format.ps1xml
@@ -1,4 +1,4 @@
<!-- Generated with EZOut 2.0.4: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<!-- Generated with EZOut 2.0.5: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Configuration>
<ViewDefinitions>
<View>
Expand Down Expand Up @@ -110,8 +110,12 @@
elseif ($styleProp -match '\.') {
$targetObject = $psStyle
foreach ($dotProperty in $styleProp -split '(?&lt;!\.)\.') {
if ($targetObject.Item -is [Management.Automation.PSMethodInfo] -or
$targetObject -is [Collections.IDictionary]) {
if (
($targetObject.psobject.Members['Item'] -and
($targetObject.Item -is [Management.Automation.PSMethodInfo])
) -or
$targetObject -is [Collections.IDictionary]
) {
$targetObject = $targetObject[$dotProperty]
} else {
$targetObject = $targetObject.$dotProperty
Expand Down Expand Up @@ -144,8 +148,12 @@
elseif ($styleProp -match '\.') {
$targetObject = $psStyle
foreach ($dotProperty in $styleProp -split '(?&lt;!\.)\.') {
if ($targetObject.Item -is [Management.Automation.PSMethodInfo] -or
$targetObject -is [Collections.IDictionary]) {
if (
($targetObject.psobject.Members['Item'] -and
($targetObject.Item -is [Management.Automation.PSMethodInfo])
) -or
$targetObject -is [Collections.IDictionary]
) {
$targetObject = $targetObject[$dotProperty]
} else {
$targetObject = $targetObject.$dotProperty
Expand Down Expand Up @@ -209,8 +217,12 @@
elseif ($styleProp -match '\.') {
$targetObject = $psStyle
foreach ($dotProperty in $styleProp -split '(?&lt;!\.)\.') {
if ($targetObject.Item -is [Management.Automation.PSMethodInfo] -or
$targetObject -is [Collections.IDictionary]) {
if (
($targetObject.psobject.Members['Item'] -and
($targetObject.Item -is [Management.Automation.PSMethodInfo])
) -or
$targetObject -is [Collections.IDictionary]
) {
$targetObject = $targetObject[$dotProperty]
} else {
$targetObject = $targetObject.$dotProperty
Expand Down Expand Up @@ -261,6 +273,29 @@
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>CSS</Name>
<ViewSelectedBy>
<TypeName>Emoji.Symbol</TypeName>
</ViewSelectedBy>
<TableControl>
<AutoSize />
<TableHeaders>
<TableColumnHeader>
<Alignment>Left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>CSS</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Emoji.Symbol</Name>
<ViewSelectedBy>
Expand All @@ -285,8 +320,12 @@
elseif ($styleProp -match '\.') {
$targetObject = $psStyle
foreach ($dotProperty in $styleProp -split '(?&lt;!\.)\.') {
if ($targetObject.Item -is [Management.Automation.PSMethodInfo] -or
$targetObject -is [Collections.IDictionary]) {
if (
($targetObject.psobject.Members['Item'] -and
($targetObject.Item -is [Management.Automation.PSMethodInfo])
) -or
$targetObject -is [Collections.IDictionary]
) {
$targetObject = $targetObject[$dotProperty]
} else {
$targetObject = $targetObject.$dotProperty
Expand Down Expand Up @@ -359,8 +398,12 @@
elseif ($styleProp -match '\.') {
$targetObject = $psStyle
foreach ($dotProperty in $styleProp -split '(?&lt;!\.)\.') {
if ($targetObject.Item -is [Management.Automation.PSMethodInfo] -or
$targetObject -is [Collections.IDictionary]) {
if (
($targetObject.psobject.Members['Item'] -and
($targetObject.Item -is [Management.Automation.PSMethodInfo])
) -or
$targetObject -is [Collections.IDictionary]
) {
$targetObject = $targetObject[$dotProperty]
} else {
$targetObject = $targetObject.$dotProperty
Expand Down Expand Up @@ -397,8 +440,12 @@
elseif ($styleProp -match '\.') {
$targetObject = $psStyle
foreach ($dotProperty in $styleProp -split '(?&lt;!\.)\.') {
if ($targetObject.Item -is [Management.Automation.PSMethodInfo] -or
$targetObject -is [Collections.IDictionary]) {
if (
($targetObject.psobject.Members['Item'] -and
($targetObject.Item -is [Management.Automation.PSMethodInfo])
) -or
$targetObject -is [Collections.IDictionary]
) {
$targetObject = $targetObject[$dotProperty]
} else {
$targetObject = $targetObject.$dotProperty
Expand Down Expand Up @@ -430,5 +477,30 @@
</CustomEntries>
</CustomControl>
</View>
<View>
<Name>CSS</Name>
<ViewSelectedBy>
<TypeName>Emoji.Symbol</TypeName>
</ViewSelectedBy>
<CustomControl>
<CustomEntries>
<CustomEntry>
<CustomItem>
<Text>/*</Text>
<ExpressionBinding>
<ScriptBlock>
$_.Emoji.PadRight(3)
</ScriptBlock>
</ExpressionBinding>
<Text>*/</Text>
<NewLine />
<ExpressionBinding>
<PropertyName>CSS</PropertyName>
</ExpressionBinding>
</CustomItem>
</CustomEntry>
</CustomEntries>
</CustomControl>
</View>
</ViewDefinitions>
</Configuration>
25 changes: 6 additions & 19 deletions Emoji.psd1
@@ -1,5 +1,5 @@
@{

Check warning on line 1 in Emoji.psd1

View workflow job for this annotation

GitHub Actions / PowerShellStaticAnalysis

PSUseBOMForUnicodeEncodedFile : Missing BOM encoding for non-ASCII encoded file 'Emoji.psd1'
ModuleVersion = '0.1.3'
ModuleVersion = '0.1.4'
RootModule = 'Emoji.psm1'

Check warning on line 4 in Emoji.psd1

View workflow job for this annotation

GitHub Actions / PowerShellStaticAnalysis

PSAvoidTrailingWhitespace : Line has trailing whitespace
Description = '⟩⚡PowerShell Emoji 😎😉😍🥰🤔😟'
Expand All @@ -18,30 +18,17 @@
LicenseURI = 'https://github.com/StartAutomating/blob/main/LICENSE'
Tags = 'Emoji', 'PowerShell'
ReleaseNotes = @'
## Emoji 0.1.3:
## Emoji 0.1.4:
* Improved Formatting
* Now with Color (and better padding) (#46)
* Adding Custom formats (#47)
* Adding PowerShell formats (#49)
* Emoji Sequences:
* Get-Emoji -Sequence (#55)
* Emoji.Sequences.All (#41)
* Emoji.Sequences.Add (#39)
* Emoji.Sequences.Remove (#40)
* Emoji.get/set Sequence (#35)
* Sequence Formatting (#54)
* Added `Emoji.get_Demos` (#42)
* Added `/Demos/Emoji.demo.ps1` (#43)
* Set-Emoji
* Added -ScriptBlock (#51)
* Defaulting Value (#52)
* Emoji.Symbol.CSS (#58)
* ... and new views (#60)
* Also making color more tolerant of strict mode (#59)
---
Full history in [CHANGELOG](https://github.com/StartAutomating/Emoji/blob/main/CHANGELOG.md)
Like it? Star It! Love it? Support It!
Like it? [Star It](https://github.com/StartAutomating/Emoji)! Love it? [Support It!](https://github.com/sponsors/StartAutomating)
'@
}
Recommends = 'Posh','PipeScript','EZOut'
Expand Down
18 changes: 17 additions & 1 deletion Emoji.types.ps1xml
@@ -1,4 +1,4 @@
<!-- Generated with EZOut 2.0.4: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<!-- Generated with EZOut 2.0.5: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Types>
<Type>
<Name>Emoji</Name>
Expand Down Expand Up @@ -591,6 +591,22 @@ foreach ($property in $this.psobject.properties) {
<Name>Emoji</Name>
<ReferencedMemberName>String</ReferencedMemberName>
</AliasProperty>
<ScriptProperty>
<Name>CSS</Name>
<GetScriptBlock>
&lt;#
.SYNOPSIS
Gets an Emoji as CSS
.DESCRIPTION
Gets an Emoji as a CSS rule
#&gt;
param()

$className = $this.Name.ToLower() -replace '\s','-'
".${className}::before { content: `"$($this.Emoji)`"; }"

</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>Number</Name>
<GetScriptBlock>
Expand Down
17 changes: 16 additions & 1 deletion Types/Emoji.Symbol/Emoji.Symbol.format.ps1
Expand Up @@ -24,6 +24,10 @@ Write-FormatView -TypeName Emoji.Symbol -Property Emoji -AlignProperty @{
Emoji = 'Left'
} -AutoSize -Name Emoji

Write-FormatView -TypeName Emoji.Symbol -Property CSS -AlignProperty @{
CSS = 'Left'
} -AutoSize -Name CSS

Write-FormatView -TypeName Emoji.Symbol -Action {
Write-FormatViewExpression -ScriptBlock {
$_.Emoji.PadRight(4)
Expand All @@ -44,4 +48,15 @@ Write-FormatView -TypeName Emoji.Symbol -Action {
Write-FormatViewExpression -Property PowerShell -Style Foreground.Cyan

Write-FormatViewExpression -Property Name -Style Foreground.Green
} -Name PowerShell
} -Name PowerShell

Write-FormatView -TypeName Emoji.Symbol -Action {
Write-FormatViewExpression -Text "/*"
Write-FormatViewExpression -ScriptBlock {
$_.Emoji.PadRight(3)
}

Write-FormatViewExpression -Text "*/"
Write-FormatViewExpression -Newline
Write-FormatViewExpression -Property CSS
} -Name CSS
10 changes: 10 additions & 0 deletions Types/Emoji.Symbol/get_CSS.ps1
@@ -0,0 +1,10 @@
<#
.SYNOPSIS
Gets an Emoji as CSS
.DESCRIPTION
Gets an Emoji as a CSS rule
#>
param()

$className = $this.Name.ToLower() -replace '\s','-'
".${className}::before { content: `"$($this.Emoji)`"; }"

0 comments on commit 3ea5c5f

Please sign in to comment.