-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Glimmer TS language * Add Glimmer TS samples * Run script/update-ids * Added a naive heuristic to disambiguate .gts files between Gerber Image and Glimmer TS languages * Add heuristic test for gts files * Run script/list-grammars * Update grammar submodule for vsc-ember-syntax * Update grammar submodule for vsc-ember-syntax * Update grammar submodule for vsc-ember-syntax --------- Co-authored-by: Colin Seymour <[email protected]>
- Loading branch information
Showing
8 changed files
with
131 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Component from '@glimmer/component'; | ||
import FreestyleUsage from 'ember-freestyle/components/freestyle/usage'; | ||
import BoxelInputTime, { Time } from './index'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { cssVariable, CSSVariableInfo } from 'ember-freestyle/decorators/css-variable'; | ||
import { fn } from '@ember/helper'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class BoxelInputTimeUsage extends Component { | ||
cssClassName = 'boxel-input-time'; | ||
|
||
@cssVariable declare boxelInputTimeBackgroundColor: CSSVariableInfo; // TODO: replace or remove | ||
@tracked value = new Date(2022,2,3,13,45); | ||
@tracked minValue = new Date(2022,2,3,11,0); | ||
@tracked minuteInterval = 5; | ||
@action timeChanged(val: Time) { | ||
this.value = val as Date; //TODO: casting??? | ||
} | ||
<template> | ||
<FreestyleUsage @name="Input::Time"> | ||
<:description> | ||
A succint version of a time picker. | ||
</:description> | ||
<:example> | ||
<BoxelInputTime | ||
@value={{this.value}} | ||
@minValue={{this.minValue}} | ||
@minuteInterval={{this.minuteInterval}} | ||
@onChange={{this.timeChanged}} | ||
/> | ||
</:example> | ||
<:api as |Args|> | ||
<Args.Object | ||
@name="value" | ||
@description="The current value (undefined or conforming to a Time interface that is a subset of JavaScript's Date API" | ||
@value={{this.value}} | ||
@onInput={{fn (mut this.value)}} | ||
/> | ||
<Args.Object | ||
@name="minValue" | ||
@description="The times before this value will disabled" | ||
@value={{this.minValue}} | ||
/> | ||
<Args.Number | ||
@name="minuteInterval" | ||
@description="The interval at which to show minute options" | ||
@defaultValue={{5}} | ||
@value={{this.minuteInterval}} | ||
@onInput={{fn (mut this.minuteInterval)}} | ||
/> | ||
<Args.Action | ||
@name="onChange" | ||
@description="Called when the user changed the time" | ||
/> | ||
</:api> | ||
</FreestyleUsage> | ||
</template> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { LinkTo } from '@ember/routing'; | ||
import { TOC } from '@ember/component/template-only'; | ||
import Resource from 'ember-crate/models/resource'; | ||
import HeroIcon from 'ember-heroicons/components/hero-icon'; | ||
|
||
const formatDate = (date: Date) => { | ||
const options: Intl.DateTimeFormatOptions = { month: 'short', day: 'numeric', year: 'numeric' }; | ||
return new Intl.DateTimeFormat('en-US', options).format(new Date(date)); | ||
}; | ||
|
||
export const ResourceCard: TOC<{ Args: { resource: Resource } }> = <template> | ||
<LinkTo | ||
@route='resources.resource' | ||
@model={{@resource.slug}} | ||
class='block max-w-sm rounded-lg border border-gray-200 bg-white drop-shadow-sm hover:bg-slate-50' | ||
> | ||
<div class='p-3 md:p-4'> | ||
<div class='flex gap-2'> | ||
<h5 | ||
class='text-l mb-2 h-[3em] font-medium tracking-tight text-gray-900 line-clamp-2 xl:text-xl tracking-tight' | ||
>{{@resource.title}}</h5> | ||
{{#if @resource.isFeatured}} | ||
<HeroIcon | ||
@icon='star' | ||
@type='solid' | ||
class='mt-2 h-4 w-4 shrink-0 text-yellow-400' | ||
/> | ||
{{/if}} | ||
</div> | ||
|
||
<div | ||
class='flex flex-col justify-between gap-2 lg:flex-row lg:items-center' | ||
> | ||
<div class='flex items-center text-sm text-slate-700'> | ||
<HeroIcon @icon='clock' @type='outline' class='mr-2 h-4 w-4' /> | ||
<span>{{formatDate @resource.publishDate}}</span> | ||
</div> | ||
<div | ||
class='w-fit grow-0 rounded bg-slate-100 px-2.5 py-0.5 text-xs font-medium text-slate-800' | ||
> | ||
{{@resource.type}} | ||
</div> | ||
</div> | ||
</div> | ||
</LinkTo> | ||
</template>; | ||
|
||
export default ResourceCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule vsc-ember-syntax
updated
22 files
+10 −0 | .github/workflows/workflow.yaml | |
+21 −0 | LICENSE | |
+0 −11 | LICENSE.md | |
+4 −2 | README.md | |
+24 −15 | package.json | |
+18 −3 | src/index.ts | |
+3 −0 | syntaxes/README.md | |
+0 −4 | syntaxes/glimmer-js.json | |
+0 −4 | syntaxes/glimmer-ts.json | |
+7 −5 | syntaxes/inline.hbs.json | |
+5 −2 | syntaxes/inline.template.json | |
+294 −0 | syntaxes/markdown.glimmer.codeblock.json | |
+1,492 −0 | syntaxes/source.gjs.json | |
+1,492 −0 | syntaxes/source.gts.json | |
+135 −0 | syntaxes/src/index.mjs | |
+148 −0 | syntaxes/src/inline.hbs.mjs | |
+89 −0 | syntaxes/src/inline.template.mjs | |
+53 −0 | syntaxes/src/markdown.glimmer.codeblock.mjs | |
+6 −0 | syntaxes/src/source.gjs.mjs | |
+6 −0 | syntaxes/src/source.gts.mjs | |
+1,085 −0 | syntaxes/src/text.html.ember-handlebars.mjs | |
+7 −5 | syntaxes/text.html.ember-handlebars.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters