Git Product home page Git Product logo

earlyadopters.umbraco.templates's Introduction

earlyadopters.umbraco.templates's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bakersbakebread

earlyadopters.umbraco.templates's Issues

Adding a .vscode folder in assets?

Would you be open to adding a .vscode-folder with some Lit snippets to the assets folder in .Client?

I can provide a PR if you want to =D

I use this snippets.code-snippets, that will add snippets for:

  • litnew Creating a Lit Element
  • umblocalize Creating a Storybook Story (probably not needed here)
  • lwhen Creates a when directive
{
	// Place your Fundrella.Web.UI.Client workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
	// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
	// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
	// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
	// Placeholders with the same ids are connected.
	// Example:
	"New Lit Element": {
		"description": "create a new lit element",
		"scope": "javascript,typescript",
		"prefix": "litnew",
		"body": [
			"import { LitElement,css,html,customElement,property} from '@newsletter-studio/lit';",
			"import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';",
			"import { UmbTextStyles } from '@umbraco-cms/backoffice/style';",
			//"import {classMap} from 'lit/directives/class-map.js'",
			"",
			"/**",
			"* ${TM_FILENAME_BASE/(.*)\\..+$/$1/} description",
			"* @element ${TM_FILENAME_BASE/(.*)\\..+$/$1/}",
			"* @fires CustomEvent#change - lorem ipsum ",
			"* @cssprop --ns-foo-bar - Color of lorem",
			"*/",
			"",
			"@customElement('${TM_FILENAME_BASE/(.*)\\..+$/$1/}')",
			"export class ${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element extends UmbElementMixin(LitElement) {",
			"",
			"\t/**",
			"\t* Description ",
			"\t*/",
			"\t@property({type:Boolean})",
			"\tdisabled : boolean = false;",
			"",
			"\trender() {",
			"\t\treturn html`",
			"\t\t\t<div>",
			"\t\t\t\t${TM_FILENAME_BASE/(.*)\\..+$/$1/}$1",
			"\t\t\t</div>",
			"\t\t`",
			"",
			"\t}",
			"",
			"\tstatic styles = [UmbTextStyles, css`",
			"",
			"\t\t:host {",
			"\t\t--lorem-ipsum : var(--lorem-ipsum2,#ff00ff);",
			"\t\t}",
			"\t`]",
			"}",
			"",
			"export default ${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element;",
			"",
			"declare global {",
			"\tinterface HTMLElementTagNameMap {",
			"\t\t'${TM_FILENAME_BASE/(.*)\\..+$/$1/}': ${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element;",
			"\t}",
			"}"
		]
	},
	"New Storybook Story": {
		"description": "Creates a new storybook story component.",
		"scope": "javascript,typescript",
		"prefix": "storynew",
		"body": [
			"import type { Meta, StoryObj } from '@storybook/web-components';",
			//"import { html } from 'lit-html';",
			"import type { ${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element } from './${TM_FILENAME_BASE/(.*)\\..+$/$1/}.element.js';",
			"import '@newsletter-studio/components';",
			//"import './${TM_FILENAME_BASE/(.*)\\..+$/$1/}.element';",
			"",
			//"/**",
			//"* ${TM_FILENAME_BASE/(.*)\\..+$/$1/}",
			//"* ${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element extends LitElement",
			//"*/",
			"export default {",
			"\tid: '${TM_FILENAME_BASE/(.*)\\..+$/$1/}',",
			"\tcomponent: '${TM_FILENAME_BASE/(.*)\\..+$/$1/}',",
			"\ttitle: 'Components/${TM_FILENAME_BASE/(.*)\\..+$/$1/}',",
			//MJ: 240404: Remove these auto docs, not needed thanks to preview.ts/main.ts settings.
			//"\ttags: ['autodocs'],",
			//"\tdecorators: [",
			//"\t\t(Story: ()=>string) => html`<div class='app-container'>${Story()}</div>`,",
			//"\t],",
			"\t",
			"} as Meta<${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element>;",
			"",
			"export const Primary : StoryObj<${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element> = {",
			"\t ",
			"}"
		]
	},
	"Umbraco Lit Localize Term" : {
		"description": "",
		"scope" :"html",
		"prefix" : "umblocalize",
		"body" : [
			"${this.localize.term('ns_${1}')}"
		]
	},
    "Lit When" : {
		"description": "",
		"scope" :"html",
		"prefix" : "lwhen",
		"body" : [
			"${when(${1},()=>html``)}"
		]
	}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.