under construction
This commit is contained in:
29
elex-theme/.editorconfig
Normal file
29
elex-theme/.editorconfig
Normal file
@@ -0,0 +1,29 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
|
||||
[*]
|
||||
|
||||
# Change these settings to your own preference
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# We recommend you to keep these unchanged
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.json]
|
||||
indent_size = 2
|
||||
|
||||
[*.{html,js,md}]
|
||||
block_comment_start = /**
|
||||
block_comment = *
|
||||
block_comment_end = */
|
||||
23
elex-theme/.gitignore
vendored
Normal file
23
elex-theme/.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
## editors
|
||||
/.idea
|
||||
/.vscode
|
||||
|
||||
## system files
|
||||
.DS_Store
|
||||
|
||||
## npm
|
||||
/node_modules/
|
||||
/npm-debug.log
|
||||
|
||||
## testing
|
||||
/coverage/
|
||||
|
||||
## temp folders
|
||||
/.tmp/
|
||||
|
||||
# build
|
||||
/_site/
|
||||
/dist/
|
||||
/out-tsc/
|
||||
|
||||
storybook-static
|
||||
21
elex-theme/LICENSE
Normal file
21
elex-theme/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 elex-theme
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
30
elex-theme/README.md
Normal file
30
elex-theme/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
<p align="center">
|
||||
<img width="200" src="https://open-wc.org/hero.png"></img>
|
||||
</p>
|
||||
|
||||
## Open-wc Starter App
|
||||
|
||||
[](https://github.com/open-wc)
|
||||
|
||||
## Quickstart
|
||||
|
||||
To get started:
|
||||
|
||||
```sh
|
||||
npm init @open-wc
|
||||
# requires node 10 & npm 6 or higher
|
||||
```
|
||||
|
||||
## Scripts
|
||||
|
||||
- `start` runs your app for development, reloading on file changes
|
||||
- `start:build` runs your app after it has been built using the build command
|
||||
- `build` builds your app and outputs it in your `dist` directory
|
||||
- `test` runs your test suite with Web Test Runner
|
||||
- `lint` runs the linter for your project
|
||||
|
||||
## Tooling configs
|
||||
|
||||
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
||||
|
||||
If you customize the configuration a lot, you can consider moving them to individual files.
|
||||
26
elex-theme/custom-elements.json
Normal file
26
elex-theme/custom-elements.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": 2,
|
||||
"tags": [
|
||||
{
|
||||
"name": "elex-theme",
|
||||
"description": "An application with a title and an action counter",
|
||||
"properties": [
|
||||
{
|
||||
"name": "title",
|
||||
"type": "String",
|
||||
"description": "The title of your application",
|
||||
"default": "Hey there"
|
||||
},
|
||||
{
|
||||
"name": "page",
|
||||
"type": "String",
|
||||
"description": "Which page to show",
|
||||
"default": "main"
|
||||
}
|
||||
],
|
||||
"events": [],
|
||||
"slots": [],
|
||||
"cssProperties": []
|
||||
}
|
||||
]
|
||||
}
|
||||
28
elex-theme/index.html
Normal file
28
elex-theme/index.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||
<meta name="Description" content="Put your description here.">
|
||||
<base href="/">
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: sans-serif;
|
||||
background-color: #ededed;
|
||||
}
|
||||
</style>
|
||||
<title>elex-theme</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<elex-theme></elex-theme>
|
||||
|
||||
<script type="module" src="./out-tsc/src/app.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
84
elex-theme/package.json
Normal file
84
elex-theme/package.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.10",
|
||||
"@babel/preset-env": "^7.13.10",
|
||||
"@open-wc/eslint-config": "^4.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.17.0",
|
||||
"@typescript-eslint/parser": "^4.17.0",
|
||||
"@web/dev-server": "^0.1.8",
|
||||
"babel-loader": "^8.2.2",
|
||||
"concurrently": "^5.3.0",
|
||||
"css-loader": "^5.2.0",
|
||||
"eslint": "^7.21.0",
|
||||
"eslint-config-prettier": "^7.2.0",
|
||||
"husky": "^4.3.8",
|
||||
"lint-staged": "^10.5.4",
|
||||
"prettier": "^2.2.1",
|
||||
"style-loader": "^2.0.0",
|
||||
"ts-loader": "^8.0.18",
|
||||
"tslib": "^2.1.0",
|
||||
"typescript": "^4.2.3",
|
||||
"webpack": "^5.25.0",
|
||||
"webpack-cli": "^4.5.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
||||
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
||||
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
|
||||
"build": "webpack"
|
||||
},
|
||||
"name": "elex-theme",
|
||||
"version": "0.0.0",
|
||||
"description": "Webcomponent elex-theme following open-wc recommendations",
|
||||
"author": "elex-theme",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@material/mwc-button": "^0.20.0",
|
||||
"@material/mwc-drawer": "^0.20.0",
|
||||
"@material/mwc-icon-button": "^0.20.0",
|
||||
"@material/mwc-top-app-bar": "^0.20.0",
|
||||
"@material/mwc-top-app-bar-fixed": "^0.20.0",
|
||||
"easymde": "^2.14.0",
|
||||
"lit-element": "^2.4.0",
|
||||
"lit-html": "^1.3.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"extends": [
|
||||
"@open-wc/eslint-config",
|
||||
"eslint-config-prettier"
|
||||
],
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error"
|
||||
],
|
||||
"import/no-unresolved": "off",
|
||||
"import/extensions": [
|
||||
"info",
|
||||
"always",
|
||||
{
|
||||
"ignorePackages": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true,
|
||||
"arrowParens": "avoid"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.ts": [
|
||||
"eslint --fix",
|
||||
"prettier --write"
|
||||
]
|
||||
}
|
||||
}
|
||||
79
elex-theme/src/ElexTheme.ts
Normal file
79
elex-theme/src/ElexTheme.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import { LitElement, html, css, property, customElement } from 'lit-element';
|
||||
import { openWcLogo } from './open-wc-logo';
|
||||
|
||||
@customElement('elex-theme')
|
||||
export class ElexTheme extends LitElement {
|
||||
@property({ type: String }) title = 'My app';
|
||||
|
||||
static styles = css`
|
||||
:host {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
font-size: calc(10px + 2vmin);
|
||||
color: #1a2b42;
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
background-color: var(--elex-theme-background-color);
|
||||
}
|
||||
|
||||
main {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.logo > svg {
|
||||
margin-top: 36px;
|
||||
animation: app-logo-spin infinite 20s linear;
|
||||
}
|
||||
|
||||
@keyframes app-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.app-footer {
|
||||
font-size: calc(12px + 0.5vmin);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.app-footer a {
|
||||
margin-left: 5px;
|
||||
}
|
||||
`;
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<main>
|
||||
<div class="logo">${openWcLogo}</div>
|
||||
<h1>${this.title}</h1>
|
||||
|
||||
<p>Edit <code>src/ElexTheme.js</code> and save to reload!</p>
|
||||
<a
|
||||
class="app-link"
|
||||
href="https://open-wc.org/guides/developing-components/code-examples"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Code examples
|
||||
</a>
|
||||
</main>
|
||||
|
||||
<p class="app-footer">
|
||||
🚽 Made with love by
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href="https://github.com/open-wc"
|
||||
>open-wc</a
|
||||
>.
|
||||
</p>
|
||||
`;
|
||||
}
|
||||
}
|
||||
9
elex-theme/src/app.ts
Normal file
9
elex-theme/src/app.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export { ElexTheme } from './ElexTheme';
|
||||
export * from '@material/mwc-button';
|
||||
export * from '@material/mwc-icon-button';
|
||||
|
||||
export * from '@material/mwc-top-app-bar-fixed';
|
||||
export * from '@material/mwc-drawer';
|
||||
|
||||
//import * as EasyMDE from 'easymde';
|
||||
//export {EasyMDE};
|
||||
33
elex-theme/src/open-wc-logo.ts
Normal file
33
elex-theme/src/open-wc-logo.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { html } from 'lit-html';
|
||||
|
||||
export const openWcLogo = html`
|
||||
<svg
|
||||
width="244px"
|
||||
height="244px"
|
||||
viewBox="0 0 244 244"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
>
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||
<stop stop-color="#9B00FF" offset="0%"></stop>
|
||||
<stop stop-color="#0077FF" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g
|
||||
id="Page-1"
|
||||
stroke="none"
|
||||
stroke-width="1"
|
||||
fill="none"
|
||||
fill-rule="evenodd"
|
||||
>
|
||||
<path
|
||||
d="M205.639259,176.936244 C207.430887,174.217233 209.093339,171.405629 210.617884,168.510161 M215.112174,158.724316 C216.385153,155.50304 217.495621,152.199852 218.433474,148.824851 M220.655293,138.874185 C221.231935,135.482212 221.637704,132.03207 221.863435,128.532919 M222,118.131039 C221.860539,114.466419 221.523806,110.85231 221.000113,107.299021 M218.885321,96.8583653 C218.001583,93.4468963 216.942225,90.1061026 215.717466,86.8461994 M211.549484,77.3039459 C209.957339,74.1238901 208.200597,71.0404957 206.290425,68.0649233 M200.180513,59.5598295 C181.848457,36.6639805 153.655709,22 122.036748,22 C66.7879774,22 22,66.771525 22,122 C22,177.228475 66.7879774,222 122.036748,222 C152.914668,222 180.52509,208.015313 198.875424,186.036326"
|
||||
id="Shape"
|
||||
stroke="url(#linearGradient-1)"
|
||||
stroke-width="42.0804674"
|
||||
></path>
|
||||
</g>
|
||||
</svg>
|
||||
`;
|
||||
136
elex-theme/templates/document.html
Normal file
136
elex-theme/templates/document.html
Normal file
@@ -0,0 +1,136 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--mdc-theme-primary: orange;
|
||||
}
|
||||
html, body{
|
||||
margin:0; border:0; padding:0;
|
||||
width: 100%; height: 100%;
|
||||
}
|
||||
</style>
|
||||
<script type="module" src="/dist/bundle.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
const drawer = document.getElementsByTagName('mwc-drawer')[0];
|
||||
if (drawer) {
|
||||
const container = drawer.parentNode;
|
||||
container.addEventListener('MDCTopAppBar:nav', () => {
|
||||
drawer.open = !drawer.open;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<mwc-drawer hasHeader type="dismissible">
|
||||
<span slot="title">Drawer Title</span>
|
||||
<div>
|
||||
<p>
|
||||
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the
|
||||
charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to
|
||||
ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying
|
||||
through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our
|
||||
power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to
|
||||
be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of
|
||||
business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore
|
||||
always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or
|
||||
else he endures pains to avoid worse pains."
|
||||
</p>
|
||||
</div>
|
||||
<div slot="appContent">
|
||||
<mwc-top-app-bar-fixed>
|
||||
<mwc-icon-button slot="navigationIcon" icon="menu"></mwc-icon-button>
|
||||
<div slot="title">Title</div>
|
||||
<div>
|
||||
<p>Hello</p>
|
||||
<mwc-button raised label="Button"></mwc-button>
|
||||
<p>
|
||||
The standard Lorem Ipsum passage, used since the 1500s
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
|
||||
magna
|
||||
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
consequat. Duis
|
||||
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
|
||||
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
||||
|
||||
Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
|
||||
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem
|
||||
aperiam,
|
||||
eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim
|
||||
ipsam
|
||||
voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione
|
||||
voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,
|
||||
adipisci velit,
|
||||
sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim
|
||||
ad minima
|
||||
veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi
|
||||
consequatur? Quis
|
||||
autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui
|
||||
dolorem
|
||||
eum fugiat quo voluptas nulla pariatur?"
|
||||
|
||||
1914 translation by H. Rackham
|
||||
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I
|
||||
will give
|
||||
you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the
|
||||
master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure,
|
||||
but
|
||||
because those who do not know how to pursue pleasure rationally encounter consequences that are extremely
|
||||
painful. Nor
|
||||
again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because
|
||||
occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial
|
||||
example,
|
||||
which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has
|
||||
any right
|
||||
to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a
|
||||
pain
|
||||
that produces no resultant pleasure?"
|
||||
|
||||
Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
|
||||
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque
|
||||
corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in
|
||||
culpa qui
|
||||
officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita
|
||||
distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod
|
||||
maxime
|
||||
placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et
|
||||
aut
|
||||
officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non
|
||||
recusandae.
|
||||
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut
|
||||
perferendis doloribus asperiores repellat."
|
||||
|
||||
1914 translation by H. Rackham
|
||||
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized
|
||||
by the
|
||||
charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are
|
||||
bound to
|
||||
ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as
|
||||
saying
|
||||
through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour,
|
||||
when our
|
||||
power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure
|
||||
is to
|
||||
be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the
|
||||
obligations of
|
||||
business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man
|
||||
therefore
|
||||
always holds in these matters to this principle of selection: he rejects pleasures to secure other greater
|
||||
pleasures, or
|
||||
else he endures pains to avoid worse pains."
|
||||
</p>
|
||||
</div>
|
||||
</mwc-top-app-bar-fixed>
|
||||
|
||||
</div>
|
||||
</mwc-drawer>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
62
elex-theme/templates/editor.html
Normal file
62
elex-theme/templates/editor.html
Normal file
@@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<!-- <link rel="stylesheet" href="../node_modules/easymde/dist/easymde.min.css">
|
||||
<script src="../node_modules/easymde/dist/easymde.min.js"></script> -->
|
||||
<style>
|
||||
:root {
|
||||
--mdc-theme-primary: orange;
|
||||
}
|
||||
html, body{
|
||||
margin:0; border:0; padding:0;
|
||||
width: 100%; height: 100%;
|
||||
}
|
||||
</style>
|
||||
<script src="../dist/editor.js"></script>
|
||||
<script type="module" src="../dist/bundle.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
const drawer = document.getElementsByTagName('mwc-drawer')[0];
|
||||
if (drawer) {
|
||||
const container = drawer.parentNode;
|
||||
container.addEventListener('MDCTopAppBar:nav', () => {
|
||||
drawer.open = !drawer.open;
|
||||
});
|
||||
}
|
||||
|
||||
let easyMDE = new EasyMDE({ element: document.getElementById('editor') });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<mwc-drawer hasHeader type="dismissible">
|
||||
<span slot="title">Drawer Title</span>
|
||||
<div>
|
||||
<p>
|
||||
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the
|
||||
charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to
|
||||
ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying
|
||||
through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our
|
||||
power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to
|
||||
be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of
|
||||
business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore
|
||||
always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or
|
||||
else he endures pains to avoid worse pains."
|
||||
</p>
|
||||
</div>
|
||||
<div slot="appContent">
|
||||
<mwc-top-app-bar-fixed>
|
||||
<mwc-icon-button slot="navigationIcon" icon="menu"></mwc-icon-button>
|
||||
<div slot="title">Editor title</div>
|
||||
</mwc-top-app-bar-fixed>
|
||||
<div>
|
||||
<textarea id="editor"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</mwc-drawer>
|
||||
</body>
|
||||
</html>
|
||||
19
elex-theme/tsconfig.json
Normal file
19
elex-theme/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2018",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"noEmitOnError": true,
|
||||
"lib": ["es2017", "dom"],
|
||||
"strict": true,
|
||||
"esModuleInterop": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"experimentalDecorators": true,
|
||||
"importHelpers": true,
|
||||
"outDir": "out-tsc",
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"rootDir": "./"
|
||||
},
|
||||
"include": ["**/*.ts", "src/app.ts"]
|
||||
}
|
||||
28
elex-theme/web-dev-server.config.mjs
Normal file
28
elex-theme/web-dev-server.config.mjs
Normal file
@@ -0,0 +1,28 @@
|
||||
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
||||
|
||||
/** Use Hot Module replacement by adding --hmr to the start command */
|
||||
const hmr = process.argv.includes('--hmr');
|
||||
|
||||
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
||||
nodeResolve: true,
|
||||
open: '/',
|
||||
watch: !hmr,
|
||||
|
||||
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
||||
// esbuildTarget: 'auto'
|
||||
|
||||
/** Set appIndex to enable SPA routing */
|
||||
// appIndex: 'demo/index.html',
|
||||
|
||||
/** Confgure bare import resolve plugin */
|
||||
// nodeResolve: {
|
||||
// exportConditions: ['browser', 'development']
|
||||
// },
|
||||
|
||||
plugins: [
|
||||
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
||||
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
||||
],
|
||||
|
||||
// See documentation for all available options
|
||||
});
|
||||
41
elex-theme/webpack.config.js
Normal file
41
elex-theme/webpack.config.js
Normal file
@@ -0,0 +1,41 @@
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
|
||||
module.exports = {
|
||||
mode: "development",
|
||||
entry: {
|
||||
bundle: "./src/app.ts",
|
||||
editor: ["./node_modules/easymde/dist/easymde.min.js",
|
||||
"./node_modules/easymde/dist/easymde.min.css"]
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: '[name].js'
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(ts|js)$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env']
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'ts-loader'
|
||||
}
|
||||
]
|
||||
},{
|
||||
test: /\.css$/i,
|
||||
use: ['style-loader', 'css-loader'],
|
||||
}
|
||||
],
|
||||
},
|
||||
plugins: [new webpack.ProgressPlugin()],
|
||||
resolve: {
|
||||
extensions: [".tsx", ".ts", ".js"],
|
||||
},
|
||||
};
|
||||
4301
elex-theme/yarn-error.log
Normal file
4301
elex-theme/yarn-error.log
Normal file
File diff suppressed because it is too large
Load Diff
5518
elex-theme/yarn.lock
Normal file
5518
elex-theme/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user