Skip to content

Commit a3d5753

Browse files
authored
Merge pull request #1 from author-elements/v2
Extend author-menu
2 parents a18a9b8 + dcaa231 commit a3d5753

File tree

85 files changed

+7019
-441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+7019
-441
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.*
22
_*
3-
dist
3+
/dist
44
!.gitignore
55
!.npmignore
66
!.travis.yml

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "@author.io/element-select",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "author-select custom element (web component).",
55
"main": "dist/author-select.min.js",
66
"scripts": {
77
"build": "npm run clean && rollup -c ./rollup.release.config.js",
8+
"build-dev": "npm run build && npm run build-showroom",
9+
"build-showroom": "cd showroom/ && npm run build && cd ../",
810
"clean": "node clean.js",
911
"deploy": "npm run build && npm publish --access public",
1012
"test": "npm run build && karma start karma.conf.es6.js && karma start karma.conf.es6-modules.js && karma start karma.conf.es5.js && npm run test:syntax",

showroom/build.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ class Builder extends ProductionLine {
1212
this.devMode = false
1313
}
1414

15+
copyComponent (cb) {
16+
fs.copySync(this.paths.component, this.outputDirectory('webcomponents'))
17+
18+
cb()
19+
}
20+
1521
copyCustomElements (cb) {
1622
this.walk(this.paths.authorElements).forEach(dir => {
1723
let filepath = path.join(dir, 'dist')
@@ -83,6 +89,7 @@ class Builder extends ProductionLine {
8389
this.clean()
8490
// this.copyAssets(true)
8591
this.addTask('Copy Libraries', next => this.copyLibs(next))
92+
this.addTask('Copy Component', next => this.copyComponent(next))
8693
this.addTask('Copy Custom Elements', next => this.copyCustomElements(next))
8794
this.buildHTML()
8895
this.addTask('Build JavaScript', next => this.processJavascript(!devMode, next))
@@ -120,6 +127,7 @@ builder.paths = {
120127
javascript: path.join(builder.SOURCE, 'js', '/**/*.js'),
121128
css: path.join(builder.SOURCE, 'css', '/**/*.css'),
122129
lib: path.join(builder.SOURCE, 'lib'),
130+
component: path.resolve('..', 'dist'),
123131
authorElements: './node_modules/@author.io/element-*'
124132
}
125133

showroom/dist/css/main.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

showroom/dist/css/main.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

showroom/dist/index.html

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!DOCTYPE html>
2+
<html class="chassis" lang="en" dir="ltr">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width" />
6+
7+
<title>&lt;author-select&gt; Demo</title>
8+
9+
<link rel="stylesheet" href="css/main.css">
10+
<link rel="stylesheet" href="lib/prismjs/prism.css">
11+
12+
<script src="https://cdn.author.io/ngn/latest/legacy.complete.min.js"></script>
13+
<script src="https://cdn.author.io/ngnx/latest/complete.min.js"></script>
14+
15+
<script src="webcomponents/author-base.js"></script>
16+
<script src="webcomponents/author-control.js"></script>
17+
<script src="webcomponents/author-menu.js"></script>
18+
<script src="webcomponents/author-selected-options.js"></script>
19+
<script src="webcomponents/author-options.js"></script>
20+
<script src="webcomponents/author-option.js"></script>
21+
<script src="webcomponents/author-optgroup-label.js"></script>
22+
<script src="webcomponents/author-optgroup.js"></script>
23+
<script src="webcomponents/author-select.js"></script>
24+
</head>
25+
26+
<body class="author-select" data-theme="default">
27+
<header>
28+
<div class="width constraint">
29+
<h1>&lt;author-select&gt; Element Demo</h1>
30+
<aside class="links">
31+
<h2 class="hidden">Navigation</h2>
32+
<a href="https://author.io" target="_blank">author.io</a>
33+
</aside>
34+
</div>
35+
</header>
36+
37+
<main>
38+
<div class="content">
39+
<author-control class="theme">
40+
<label>Theme</label>
41+
<select placeholder="Select a Theme">
42+
<option value="1">Default</option>
43+
<option value="2">Dark</option>
44+
<option value="3">Other</option>
45+
</select>
46+
</author-control>
47+
48+
<section class="demo">
49+
<author-control class="default">
50+
<label>Basic Select Menu</label>
51+
<select placeholder="Select an Option">
52+
<option value="Option 1">Option 1</option>
53+
<option value="Option 2">Option 2</option>
54+
<option value="Option 3">Option 3</option>
55+
56+
<optgroup label="Grouped Options">
57+
<option value="Grouped Option 1">Grouped Option 1</option>
58+
<option value="Grouped Option 2">Grouped Option 2</option>
59+
<option value="Grouped Option 3">Grouped Option 3</option>
60+
</optgroup>
61+
</select>
62+
</author-control>
63+
64+
<button>Multiple</button>
65+
</section>
66+
</div>
67+
</main>
68+
</body>
69+
70+
<script src="lib/prismjs/prism.js"></script>
71+
<script src="js/index.js"></script>
72+
</html>

showroom/dist/js/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* author-select-showroom v1.0.0 generated on Tue Mar 26 2019.
3+
* Built at 23:45:21 GMT-0700 (Pacific Daylight Time)
4+
* Copyright (c) 2019 Author.io
5+
*/
6+
"use strict";var Demo=new NGNX.VIEW.Registry({selector:".demo",namespace:"demo.",init:function(){console.log("works")}});
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/* PrismJS 1.15.0
2+
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript&plugins=unescaped-markup */
3+
/**
4+
* prism.js default theme for JavaScript, CSS and HTML
5+
* Based on dabblet (http://dabblet.com)
6+
* @author Lea Verou
7+
*/
8+
9+
code[class*="language-"],
10+
pre[class*="language-"] {
11+
color: black;
12+
background: none;
13+
text-shadow: 0 1px white;
14+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
15+
font-size: 1em;
16+
text-align: left;
17+
white-space: pre;
18+
word-spacing: normal;
19+
word-break: normal;
20+
word-wrap: normal;
21+
line-height: 1.5;
22+
23+
-moz-tab-size: 4;
24+
-o-tab-size: 4;
25+
tab-size: 4;
26+
27+
-webkit-hyphens: none;
28+
-moz-hyphens: none;
29+
-ms-hyphens: none;
30+
hyphens: none;
31+
}
32+
33+
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
34+
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
35+
text-shadow: none;
36+
background: #b3d4fc;
37+
}
38+
39+
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
40+
code[class*="language-"]::selection, code[class*="language-"] ::selection {
41+
text-shadow: none;
42+
background: #b3d4fc;
43+
}
44+
45+
@media print {
46+
code[class*="language-"],
47+
pre[class*="language-"] {
48+
text-shadow: none;
49+
}
50+
}
51+
52+
/* Code blocks */
53+
pre[class*="language-"] {
54+
overflow: auto;
55+
}
56+
57+
/* Inline code */
58+
:not(pre) > code[class*="language-"] {
59+
padding: .1em;
60+
border-radius: .3em;
61+
white-space: normal;
62+
}
63+
64+
.token.comment,
65+
.token.prolog,
66+
.token.doctype,
67+
.token.cdata {
68+
color: slategray;
69+
}
70+
71+
.token.punctuation {
72+
color: #999;
73+
}
74+
75+
.namespace {
76+
opacity: .7;
77+
}
78+
79+
.token.property,
80+
.token.tag,
81+
.token.boolean,
82+
.token.number,
83+
.token.constant,
84+
.token.symbol,
85+
.token.deleted {
86+
color: #905;
87+
}
88+
89+
.token.selector,
90+
.token.attr-name,
91+
.token.string,
92+
.token.char,
93+
.token.builtin,
94+
.token.inserted {
95+
color: #690;
96+
}
97+
98+
.token.operator,
99+
.token.entity,
100+
.token.url,
101+
.language-css .token.string,
102+
.style .token.string {
103+
color: #9a6e3a;
104+
background: hsla(0, 0%, 100%, .5);
105+
}
106+
107+
.token.atrule,
108+
.token.attr-value,
109+
.token.keyword {
110+
color: #07a;
111+
}
112+
113+
.token.function,
114+
.token.class-name {
115+
color: #DD4A68;
116+
}
117+
118+
.token.regex,
119+
.token.important,
120+
.token.variable {
121+
color: #e90;
122+
}
123+
124+
.token.important,
125+
.token.bold {
126+
font-weight: bold;
127+
}
128+
.token.italic {
129+
font-style: italic;
130+
}
131+
132+
.token.entity {
133+
cursor: help;
134+
}
135+
136+
/* Fallback, in case JS does not run, to ensure the code is at least visible */
137+
[class*='lang-'] script[type='text/plain'],
138+
[class*='language-'] script[type='text/plain'],
139+
script[type='text/plain'][class*='lang-'],
140+
script[type='text/plain'][class*='language-'] {
141+
display: block;
142+
font: 100% Consolas, Monaco, monospace;
143+
white-space: pre;
144+
overflow: auto;
145+
}

0 commit comments

Comments
 (0)