Merge branch 'master' of github.com:perry-C/omi

This commit is contained in:
perry-C 2021-08-11 13:17:31 +08:00
commit c22c3b5465
5825 changed files with 7643 additions and 35261 deletions

View File

@ -32,7 +32,7 @@
"omi": "latest"
},
"devDependencies": {
"@omiu/icon": "^0.0.3",
"@omiu/icon": "^0.0.4",
"@open-wc/testing": "^2.5.33",
"@types/node": "^16.4.7",
"@web/test-runner": "^0.13.13",
@ -47,4 +47,4 @@
"omiu",
"form"
]
}
}

View File

@ -25,80 +25,83 @@
<script src="https://unpkg.com/@omiu/avatar"></script>
<script src="https://unpkg.com/@omiu/image"></script>
<div>
<div style="height: 100vh; display: flex; justify-content: space-around; flex-wrap: wrap; background: #F0F2F5;">
<o-card title="Default size card" hoverable="always" block="1">
<o-link underline='0' type="primary" target="_blank" href="https://tencent.github.io/omi/" slot="extra">More
</o-link>
<p>Card content</p>
<p>Card content</p>
<p>Card content</p>
</o-card>
<div style="margin: 5%; height: 200px; width: 300px;">
<o-card title="Default size card" hoverable="always" block="1">
<o-link underline='0' type="primary" target="_blank" href="https://tencent.github.io/omi/" slot="extra">More
</o-link>
<p>Card content</p>
<p>Card content</p>
<p>Card content</p>
</o-card>
</div>
<o-card title="Simple Card" hoverable="true">
<!-- slot="cover" 若不填充内容则header栏不显示。-简洁卡片 -->
<div slot="cover">
</div>
<p>Simple Card</p>
<p>Card content</p>
<p>Card content</p>
</o-card>
<div style="margin: 5%; height: 200px; width: 300px;">
<o-card title="Simple Card" hoverable="always" block="1">
<!-- slot="cover" 若不填充内容则header栏不显示。-简洁卡片 -->
<div slot="cover">
</div>
<p>Simple Card</p>
<p>Card content</p>
<p>Card content</p>
</o-card>
</div>
<!-- 若需实现底部栏按钮id,actions为必选参数 -->
<o-card title="Action card" size="medium" id="myActionA"
actions="[{icon: 'add-a-photo-rounded'},{icon: 'add-ic-call-rounded'},{icon: 'add-comment-rounded'}]">
<o-link underline='0' type="primary" target="_blank" href="https://tencent.github.io/omi/" slot="extra">More
</o-link>
<p>Card content</p>
<p>Card content</p>
<p>Card content</p>
</o-card>
<div style="margin: 5%; height: 200px; width: 300px;">
<o-card title="Action card" id="myActionA" hoverable="always" actions="[{icon: 'add-a-photo-rounded'},{icon: 'add-ic-call-rounded'},{icon: 'add-comment-rounded'}]" block="1">
<o-link underline='0' type="primary" target="_blank" href="https://tencent.github.io/omi/" slot="extra">More
</o-link>
<p>Card content</p>
<p>Card content</p>
<p>Card content</p>
</o-card>
</div>
<o-card title="DNT's card" id="myActionB" actions="[{icon: 'add-ic-call-rounded'}]" hoverable="true">
<o-avatar slot="extra">DNT</o-avatar>
<p>Tel:</p>
<p>Company:</p>
<p>...</p>
</o-card>
<o-card title="Action card" size="medium" id="myActionC"
actions="[{icon: 'add-ic-call-rounded'},{icon: 'add-comment-rounded'}]" hoverable="true">
<o-image slot="cover"
src="https://cdc-old-dcloud-migrate-1258344706.cos.ap-guangzhou.myqcloud.com/data2/material/thumb/1/1190188000/VCG41N1127233809.jpg/thumb">
</o-image>
<div style="display: flex; justify-content: space-around;">
<o-avatar style="margin: auto 0px;"
src="https://wx.gtimg.com/resource/feuploader/202108/fb85c997c6476acd7a1441043fdda775_204x204.png"></o-avatar>
<div>
<p style="font-weight: 600; font-size: 1.2em;">Card title</p>
<p>This is the description</p>
<div style="margin: 5%; height: 200px; width: 300px;">
<o-card title="DNT's card" id="myActionB" actions="[{icon: 'add-ic-call-rounded'}]" hoverable="true" block="1">
<o-avatar slot="extra">DNT</o-avatar>
<p>Tel:</p>
<p>Company:</p>
<p>...</p>
</o-card>
</div>
<div style="margin: 2% 5%; height: 200px; width: 300px;">
<o-card bordered=false hoverable="false" title="Action card" id="myActionC" actions="[{icon: 'add-ic-call-rounded'},{icon: 'add-comment-rounded'}]" block="1">
<o-image slot="cover"
src="https://cdc-old-dcloud-migrate-1258344706.cos.ap-guangzhou.myqcloud.com/data2/material/thumb/1/1190188000/VCG41N1127233809.jpg/thumb">
</o-image>
<div style="display: flex; justify-content: space-around;">
<o-avatar style="margin: auto 0px;"
src="https://wx.gtimg.com/resource/feuploader/202108/fb85c997c6476acd7a1441043fdda775_204x204.png"></o-avatar>
<div>
<p style="font-weight: 600; font-size: 1.2em;">Card title</p>
<p>This is the description</p>
</div>
</div>
</div>
</o-card>
</o-card>
</div>
<o-card hoverable="true" block="1">
<o-image slot="cover"
src="https://cdc-old-dcloud-migrate-1258344706.cos.ap-guangzhou.myqcloud.com/data2/material/thumb/1/1199435000/VCG211199435578.jpg/thumb">
</o-image>
<p style="font-weight: 500">OMI Card</p>
<p>
<o-link underline='0' type="primary" target="_blank" href="https://tencent.github.io/omi/" slot="extra">Welcome
to OMI</o-link>
</p>
</o-card>
<div style="margin: 2% 5%; height: 200px; width: 300px;">
<o-card hoverable="true" block="1">
<o-image slot="cover"
src="https://cdc-old-dcloud-migrate-1258344706.cos.ap-guangzhou.myqcloud.com/data2/material/thumb/1/1199435000/VCG211199435578.jpg/thumb">
</o-image>
<p style="font-weight: 500">OMI Card</p>
<p>
<o-link underline='0' type="primary" target="_blank" href="https://tencent.github.io/omi/" slot="extra">Welcome
to OMI</o-link>
</p>
</o-card>
</div>
</div>
<script>
document.querySelector('#myActionA').addEventListener('EvtChange', function (evt) {
console.log(evt.detail.icon + ' is clicked')
})
document.querySelector('#myActionB').addEventListener('EvtChange', function (evt) {
console.log(evt.detail.icon + ' is clicked')
})
document.querySelector('#myActionC').addEventListener('EvtChange', function (evt) {
console.log(evt.detail.icon + ' is clicked')
})
</script>
</body>

View File

@ -1,6 +1,6 @@
{
"name": "@omiu/card",
"version": "0.0.6",
"version": "0.0.7",
"main": "dist/index.es.js",
"exports": {
".": "./dist/index.es.js"

View File

@ -9,33 +9,46 @@ export type Props = {
const tagName = 'my-demo'
@tag(tagName)
export default class MyDemo extends WeElement<Props> {
render(props: Props) {
pickAction = (evt) => {
console.log(evt.detail)
const btn = evt.detail.action
if(btn.icon === 'add-comment-rounded') {
alert(btn.icon)
} else if (btn.icon === 'add-a-photo-rounded') {
alert(btn.icon)
} else if (btn.icon === 'add-ic-call-rounded') {
alert(btn.icon)
}
}
render() {
return (
<div>
<h1 onclick={() => {
this.update()
}}>JSX Mode</h1>
<o-card title="My demo" hoverable="true" actions={[{ icon: 'add-a-photo-rounded' },{ icon: 'add-ic-call-rounded' },{ icon: 'add-comment-rounded' }]}>
<o-image
slot="cover"
src="https://cdc-old-dcloud-migrate-1258344706.cos.ap-guangzhou.myqcloud.com/data2/material/thumb/1/1190188000/VCG41N1127233809.jpg/thumb"
></o-image>
<div style="display: flex; justify-content: space-around; margin: 10px 0px">
<o-avatar
style="margin: auto 0px;"
src="https://wx.gtimg.com/resource/feuploader/202108/fb85c997c6476acd7a1441043fdda775_204x204.png"
></o-avatar>
<div>
<p style="font-weight: 600; font-size: 1.2em;">Card title</p>
<p>This is the description</p>
</div>
<div style="background: #F0F2F5">
<h1 onclick={() => {
this.update()
}}>JSX Mode</h1>
<div >
<o-card onChange={this.pickAction} title="My demo" hoverable="true" actions={[{ icon: 'add-a-photo-rounded' },{ icon: 'add-ic-call-rounded' },{ icon: 'add-comment-rounded' }]}>
<o-image
slot="cover"
src="https://cdc-old-dcloud-migrate-1258344706.cos.ap-guangzhou.myqcloud.com/data2/material/thumb/1/1190188000/VCG41N1127233809.jpg/thumb"
></o-image>
<div style="display: flex; justify-content: space-around; margin: 10px 0px">
<o-avatar
style="margin: auto 0px;"
src="https://wx.gtimg.com/resource/feuploader/202108/fb85c997c6476acd7a1441043fdda775_204x204.png"
></o-avatar>
<div>
<p style="font-weight: 600; font-size: 1.2em;">Card title</p>
<p>This is the description</p>
</div>
</div>
</o-card>
</div>
</o-card>
</div>
</div>
)
}
}

View File

@ -9,19 +9,7 @@
.o-card {
display: flex;
flex-direction: column;
border: 1px solid #EFEFEF;
}
.o-card-medium {
display: flex;
flex-direction: column;
border: 1px solid #EFEFEF;
}
.o-card-small {
display: flex;
flex-direction: column;
border: 1px solid #EFEFEF;
background: #FFF;
}
.o-card-header {
@ -31,20 +19,6 @@
border-radius: 2px 2px 0 0;
}
.o-card-header-medium {
min-height: 42px;
padding: 0 18px;
border-bottom: 1px solid #EFEFEF;
border-radius: 2px 2px 0 0;
}
.o-card-header-small {
min-height: 36px;
padding: 0 12px;
border-bottom: 1px solid #EFEFEF;
border-radius: 2px 2px 0 0;
}
.o-card-title {
float: left;
padding: 16px 0;
@ -61,38 +35,6 @@
cursor: pointer;
}
.o-card-title-medium {
float: left;
padding: 10px 0;
font-weight: 500;
font-size: 17px;
}
.o-card-extra-medium {
float: right;
margin-left: auto;
padding: 10px 0;
font-weight: 500;
font-size: 14px;
cursor: pointer;
}
.o-card-title-small {
float: left;
padding: 10px 0;
font-weight: 500;
font-size: 16px;
}
.o-card-extra-small {
float: right;
margin-left: auto;
padding: 10px 0;
font-weight: 500;
font-size: 14px;
cursor: pointer;
}
.o-card-body {
margin: 12px 24px;
font-weight: 200;
@ -100,39 +42,35 @@
line-height: 1.6;
}
.o-card-body-medium {
margin: 11px 22px;
font-weight: 200;
font-size: 13px;
line-height: 1.4;
}
.o-card-body-small {
margin: 10px 20px;
font-weight: 200;
font-size: 12px;
line-height: 1.2;
}
.o-card-footer {
height: 56px;
display: flex;
justify-content: center;
background-color: #fff;
background: #FFF;
}
.item.selected {
.o-card-btn.selected {
color: #07C160;
}
.item {
.o-card-btn:last-child {
flex: 1;
appearance: none;
-webkit-appearance: none;
position: relative;
cursor: pointer;
outline: none;
border-top: 1px solid #EFEFEF;
border-right: none;
border-left: none;
border-bottom: none;
background: #FFF;
color: rgba(0, 0, 0, 0.54);
padding: 6px 12px 8px;
transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, padding-top 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
button {
.o-card-btn {
flex: 1;
appearance: none;
-webkit-appearance: none;
position: relative;
@ -142,10 +80,29 @@ button {
border-right: 1px solid #EFEFEF;
border-left: none;
border-bottom: none;
background-color: #fff;
background: #FFF;
color: rgba(0, 0, 0, 0.54);
padding: 6px 12px 8px;
}
button:hover {
.o-card-btn:last-child:hover {
flex: 1;
appearance: none;
-webkit-appearance: none;
position: relative;
cursor: pointer;
outline: none;
border-top: 1px solid #EFEFEF;
border-right: none;
border-left: none;
border-bottom: none;
background: #EFEFEF;
color: rgba(0, 0, 0, 0.54);
padding: 6px 12px 8px;
}
.o-card-btn:hover {
flex: 1;
appearance: none;
-webkit-appearance: none;
position: relative;
@ -155,7 +112,9 @@ button:hover {
border-right: 1px solid #EFEFEF;
border-left: none;
border-bottom: none;
background-color: #EFEFEF;
background: #EFEFEF;
color: rgba(0, 0, 0, 0.54);
padding: 6px 12px 8px;
}
.icon {
@ -190,5 +149,3 @@ button:hover {
-webkit-font-feature-settings: "liga";
-webkit-font-smoothing: antialiased;
}
/*# sourceMappingURL=index.css.map */

View File

@ -9,22 +9,7 @@
.o-card {
display: flex;
flex-direction: column;
border: 1px solid #EFEFEF;
}
.o-card-medium {
display: flex;
flex-direction: column;
border: 1px solid #EFEFEF;
}
.o-card-small {
display: flex;
flex-direction: column;
border: 1px solid #EFEFEF;
background: #FFF;
}
.o-card-header {
@ -34,20 +19,6 @@
border-radius: 2px 2px 0 0;
}
.o-card-header-medium {
min-height: 42px;
padding: 0 18px;
border-bottom: 1px solid #EFEFEF;
border-radius: 2px 2px 0 0;
}
.o-card-header-small {
min-height: 36px;
padding: 0 12px;
border-bottom: 1px solid #EFEFEF;
border-radius: 2px 2px 0 0;
}
.o-card-title {
float: left;
padding: 16px 0;
@ -63,39 +34,6 @@
font-size: 14px;
cursor: pointer;
}
.o-card-title-medium {
float: left;
padding: 10px 0;
font-weight: 500;
font-size: 17px;
}
.o-card-extra-medium {
float: right;
margin-left: auto;
padding: 10px 0;
font-weight: 500;
font-size: 14px;
cursor: pointer;
}
.o-card-title-small {
float: left;
padding: 10px 0;
font-weight: 500;
font-size: 16px;
}
.o-card-extra-small {
float: right;
margin-left: auto;
padding: 10px 0;
font-weight: 500;
font-size: 14px;
cursor: pointer;
}
.o-card-body {
margin: 12px 24px;
font-weight: 200;
@ -103,39 +41,35 @@
line-height: 1.6;
}
.o-card-body-medium {
margin: 11px 22px;
font-weight: 200;
font-size: 13px;
line-height: 1.4;
}
.o-card-body-small {
margin: 10px 20px;
font-weight: 200;
font-size: 12px;
line-height: 1.2;
}
.o-card-footer {
height: 56px;
display: flex;
justify-content: center;
background-color: #fff;
background: #FFF;
}
.item.selected {
.o-card-btn.selected {
color: #07C160;
}
.item {
.o-card-btn:last-child {
flex: 1;
appearance: none;
-webkit-appearance: none;
position: relative;
cursor: pointer;
outline: none;
border-top: 1px solid #EFEFEF;
border-right: none;
border-left: none;
border-bottom: none;
background: #FFF;
color: rgba(0, 0, 0, 0.54);
padding: 6px 12px 8px;
transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, padding-top 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
button {
.o-card-btn {
flex: 1;
appearance: none;
-webkit-appearance: none;
position: relative;
@ -145,10 +79,29 @@ button {
border-right: 1px solid #EFEFEF;
border-left: none;
border-bottom: none;
background-color: #fff;
background: #FFF;
color: rgba(0, 0, 0, 0.54);
padding: 6px 12px 8px;
}
button:hover {
.o-card-btn:last-child:hover {
flex: 1;
appearance: none;
-webkit-appearance: none;
position: relative;
cursor: pointer;
outline: none;
border-top: 1px solid #EFEFEF;
border-right: none;
border-left: none;
border-bottom: none;
background: #EFEFEF;
color: rgba(0, 0, 0, 0.54);
padding: 6px 12px 8px;
}
.o-card-btn:hover {
flex: 1;
appearance: none;
-webkit-appearance: none;
position: relative;
@ -158,7 +111,9 @@ button:hover {
border-right: 1px solid #EFEFEF;
border-left: none;
border-bottom: none;
background-color: #EFEFEF;
background: #EFEFEF;
color: rgba(0, 0, 0, 0.54);
padding: 6px 12px 8px;
}
.icon {

View File

@ -1,13 +1,28 @@
import { tag, h, WeElement, OverwriteProps, extractClass } from 'omi'
import { tag, h, WeElement, OverwriteProps } from 'omi'
import * as css from './index.scss'
export type Attrs = {
/**
*
*/
title?: string,
/**
*
*/
bordered?: boolean,
/**
*
*/
hoverable?: 'always' | 'true' | 'false',
extra?: string,
/**
*
*/
actions?: any[],
size?: 'large' | 'medium' | 'small',
/**
*
*/
onChange?: (evt: any, index: any) => void
}
const tagName = 'o-card'
@ -22,9 +37,9 @@ declare global {
export type Props = OverwriteProps<Attrs, { title?: string,
hoverable?: 'always' | 'true' | 'false',
extra?: string,
bordered?: boolean,
actions?: any[],
size?: 'large' | 'medium' | 'small', }>
onChange?: (evt: any, index: any) => void }>
@tag(tagName)
export default class Card extends WeElement<Props> {
@ -33,74 +48,61 @@ export default class Card extends WeElement<Props> {
static defaultProps = {
title: '',
hoverable: '',
extra: ''
hoverable: 'true',
bordered: true
}
static propTypes = {
title: String,
hoverable: String,
extra: String,
actions: Array,
size: String
bordered: Boolean
}
clickHandler = (item: any) => {
this.fire('EvtChange', item)
this.update(true)
onIconClick = (evt, index) => {
this.fire('change', {
action: this.props.actions[index],
index: index,
evt: evt.currentTarget
})
}
handleMousemove = (item: string) => {
if (item==="always") {
beforeRender() {
this.handleBorder()
this.handleMousemove()
}
handleBorder = () => {
if (this.props.bordered) {
this.css = this.css + `.o-card {
display: flex;
flex-direction: column;
background: #FFF;
border: 1px solid #EFEFEF;
}`
}
}
handleMousemove = () => {
const hover = this.props.hoverable
if (!hover) return
if (hover==="always") {
(this.css = this.css + `.o-card {
display: flex;
flex-direction: column;
box-shadow: 0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017;
transition: all .3s;
z-index: 1;
background: #FFF;
}`)
} else if (hover==="true") {
(this.css = this.css + `.o-card:hover {
display: flex;
flex-direction: column;
box-shadow: 0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017;
transition: all .3s;
background: #FFF;
}`)
return;
}
const hovercss = () => {
switch(this.props.size){
case 'large':
(this.css = this.css + `.o-card:hover {
display: flex;
flex-direction: column;
box-shadow: 0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017;
transition: all .3s;
z-index: 1;
}`)
break;
case 'medium':
(this.css = this.css + `.o-card-medium:hover {
display: flex;
flex-direction: column;
box-shadow: 0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017;
transition: all .3s;
z-index: 1;
}`)
break;
case 'small':
(this.css = this.css + `.o-card-small:hover {
display: flex;
flex-direction: column;
box-shadow: 0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017;
transition: all .3s;
z-index: 1;
}`)
break;
default:
(this.css = this.css + `.o-card:hover {
display: flex;
flex-direction: column;
box-shadow: 0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017;
transition: all .3s;
z-index: 1;
}`)
}
}
item && hovercss()
}
_iconTag: any
@ -108,35 +110,25 @@ export default class Card extends WeElement<Props> {
render(props: Props) {
return (
<h.f>
<div {...extractClass(props, 'o-card', {
['o-card-' + props.size]: props.size
})} onMousemove={this.handleMousemove(props.hoverable)}>
<div class="o-card" onMousemove={this.handleMousemove}>
<slot name="cover">
<div {...extractClass(props, 'o-card-header', {
['o-card-header-' + props.size]: props.size
})}>
<div {...extractClass(props, 'o-card-title', {
['o-card-title-' + props.size]: props.size
})}>{props.title}</div>
<div {...extractClass(props, 'o-card-extra', {
['o-card-extra-' + props.size]: props.size
})}>
<slot name="extra"></slot>
</div>
<div class="o-card-header">
<div class="o-card-title">{props.title}</div>
<div class="o-card-extra">
<slot name="extra"></slot>
</div>
</div>
</slot>
<div {...extractClass(props, 'o-card-body', {
['o-card-body-' + props.size]: props.size
})}>
<div class="o-card-body">
<slot></slot>
</div>
{props.actions ? (
<div class="o-card-footer">
{props.actions.map((item) => {
{props.actions.map((item, index) => {
this._iconTag = 'o-icon-' + item.icon
return <button onClick={_ => { this.clickHandler(item) }} className="item">
return <button onClick={evt => { this.onIconClick(evt, index) }} class="o-card-btn">
<this._iconTag class="icon" />
</button>
})}

6
components/checkbox/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.DS_Store
dist
node_modules
*.local
*.lock
*.log

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Omiu</title>
<script type="module" src="/src/demo.tsx"></script>
</head>
<body>
<h1>JSX Mode <a href="./index.html">HTML Mode</a></h1>
</body>
</html>

View File

@ -1,43 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<meta charset="UTF-8" />
<title>Add Omi in One Minute</title>
</head>
<body>
<a href="https://github.com/Tencent/omi" target="_blank" style="position: fixed; right: 0; top: 0; z-index: 3;">
<img src="//alloyteam.github.io/github.png" alt="">
</a>
<div>
<o-checkbox label='Label'> </o-checkbox>
<br />
<o-checkbox checked label='checked'> </o-checkbox>
<br />
<o-checkbox id="myCheckbox" indeterminate label='indeterminate'> </o-checkbox>
<br />
<o-checkbox disabled label='disabled'> </o-checkbox>
<br />
<o-checkbox disabled checked label='disabled checked'> </o-checkbox>
</div>
<script src="https://tencent.github.io/omi/packages/omi/dist/omi.js"></script>
<script src="../../src/index.js"></script>
<script>
document.querySelector('#myCheckbox').addEventListener('change', function (evt) {
console.log(evt.detail)
})
</script>
</body>
</html>

View File

@ -1,63 +0,0 @@
{
"parser": "babel-eslint",
"extends": ["prettier"],
"plugins": ["prettier"],
"env": {
"browser": true,
"mocha": true,
"node": true,
"es6": true
},
"parserOptions": {
"ecmaFeatures": {
"modules": true,
"jsx": true
}
},
"globals": {
"sinon": true,
"expect": true
},
"rules": {
"prettier/prettier": "error",
"no-cond-assign": 1,
"no-empty": 0,
"no-console": 1,
"semi": [1, "never"],
"camelcase": 0,
"comma-style": 2,
"comma-dangle": [2, "never"],
"indent": ["error", 2],
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"no-trailing-spaces": [2, { "skipBlankLines": true }],
"max-nested-callbacks": [2, 3],
"no-eval": 2,
"no-implied-eval": 2,
"no-new-func": 2,
"guard-for-in": 0,
"eqeqeq": 0,
"no-else-return": 2,
"no-redeclare": 2,
"no-dupe-keys": 2,
"radix": 2,
"strict": [2, "never"],
"no-shadow": 0,
"callback-return": [1, ["callback", "cb", "next", "done"]],
"no-delete-var": 2,
"no-undef-init": 2,
"no-shadow-restricted-names": 2,
"handle-callback-err": 0,
"no-lonely-if": 2,
"keyword-spacing": 2,
"constructor-super": 2,
"no-this-before-super": 2,
"no-dupe-class-members": 2,
"no-const-assign": 2,
"prefer-spread": 2,
"no-useless-concat": 2,
"no-var": 2,
"object-shorthand": 2,
"prefer-arrow-callback": 2,
"quotes": [1, "single"]
}
}

View File

@ -1,21 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View File

@ -1,69 +0,0 @@
## Develop
```bash
npm install
npm start
```
## Release
```bash
npm run build
```
## Eslint + Prettier
``` bash
npm run fix
```
## Directory description
```
├─ config
├─ public
├─ scripts
├─ src
│ ├─ assets
│ ├─ elements //Store all custom elements
│ ├─ store //Store all this store of pages
│ ├─ admin.js //Entry js of compilerwill build to admin.html
│ └─ index.js //Entry js of compilerwill build to index.html
```
## Build Scripts
```json
"scripts": {
"start": "node scripts/start.js",
"build": "PUBLIC_URL=. node scripts/build.js",
"build-windows": "set PUBLIC_URL=.&& node scripts/build.js",
"fix": "eslint src --fix"
}
```
You can set up the PUBLIC_URL, such as:
```bash
...
"build": "PUBLIC_URL=https://fe.wxpay.oa.com/dv node scripts/build.js",
"build-windows": "set PUBLIC_URL=https://fe.wxpay.oa.com/dv&& node scripts/build.js",
...
```
## Switch omi and omio
Add or remove the alias config in package.json to switch omi and omio
```js
...
"alias": {
"omi": "omio"
}
...
```
## License
MIT

View File

@ -1,28 +0,0 @@
let fs = require('fs'),
fileList = [];
if (typeof String.prototype.endsWith != 'function') {
String.prototype.endsWith = function (suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
}
function walk(path) {
let dirList = fs.readdirSync(path);
dirList.forEach(function (item) {
if (!fs.statSync(path + '/' + item).isDirectory()) {
if (item.endsWith('\.js')) {
fileList.push(item.substr(0, item.length - 3));
}
} else {
//walk(path + '/' + item);
}
});
}
walk('./src');
module.exports = fileList;

View File

@ -1,93 +0,0 @@
'use strict';
const fs = require('fs');
const path = require('path');
const paths = require('./paths');
// Make sure that including paths.js after env.js will read .env variables.
delete require.cache[require.resolve('./paths')];
const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
);
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
var dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
paths.dotenv,
].filter(Boolean);
// Load environment variables from .env* files. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set. Variable expansion is supported in .env files.
// https://github.com/motdotla/dotenv
// https://github.com/motdotla/dotenv-expand
dotenvFiles.forEach(dotenvFile => {
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv').config({
path: dotenvFile,
})
);
}
});
// We support resolving modules according to `NODE_PATH`.
// This lets you use absolute paths in imports inside large monorepos:
// https://github.com/facebookincubator/create-react-app/issues/253.
// It works similar to `NODE_PATH` in Node itself:
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.join(path.delimiter);
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
// injected into the application via DefinePlugin in Webpack configuration.
const REACT_APP = /^REACT_APP_/i;
function getClientEnvironment(publicUrl) {
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
return env;
},
{
// Useful for determining whether were running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: publicUrl,
}
);
// Stringify all values so we can feed into Webpack DefinePlugin
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
env[key] = JSON.stringify(raw[key]);
return env;
}, {}),
};
return { raw, stringified };
}
module.exports = getClientEnvironment;

View File

@ -1,14 +0,0 @@
'use strict';
// This is a custom Jest transformer turning style imports into empty objects.
// http://facebook.github.io/jest/docs/en/webpack.html
module.exports = {
process() {
return 'module.exports = {};';
},
getCacheKey() {
// The output is always the same.
return 'cssTransform';
},
};

View File

@ -1,12 +0,0 @@
'use strict';
const path = require('path');
// This is a custom Jest transformer turning file imports into filenames.
// http://facebook.github.io/jest/docs/en/webpack.html
module.exports = {
process(src, filename) {
return `module.exports = ${JSON.stringify(path.basename(filename))};`;
},
};

View File

@ -1,55 +0,0 @@
'use strict';
const path = require('path');
const fs = require('fs');
const url = require('url');
// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebookincubator/create-react-app/issues/637
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
const envPublicUrl = process.env.PUBLIC_URL;
function ensureSlash(path, needsSlash) {
const hasSlash = path.endsWith('/');
if (hasSlash && !needsSlash) {
return path.substr(path, path.length - 1);
} else if (!hasSlash && needsSlash) {
return `${path}/`;
} else {
return path;
}
}
const getPublicUrl = appPackageJson =>
envPublicUrl || require(appPackageJson).homepage;
// We use `PUBLIC_URL` environment variable or "homepage" field to infer
// "public path" at which the app is served.
// Webpack needs to know it to put the right <script> hrefs into HTML even in
// single-page apps that may serve index.html for nested URLs like /todos/42.
// We can't use a relative path in HTML because we don't want to load something
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
function getServedPath(appPackageJson) {
const publicUrl = getPublicUrl(appPackageJson);
const servedUrl =
envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');
return ensureSlash(servedUrl, true);
}
// config after eject: we're in ./config/
module.exports = {
dotenv: resolveApp('.env'),
appBuild: resolveApp('build'),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveApp('src/index.js'),
appPackageJson: resolveApp('package.json'),
appSrc: resolveApp('src'),
yarnLockFile: resolveApp('yarn.lock'),
testsSetup: resolveApp('src/setupTests.js'),
appNodeModules: resolveApp('node_modules'),
publicUrl: getPublicUrl(resolveApp('package.json')),
servedPath: getServedPath(resolveApp('package.json')),
};

View File

@ -1,22 +0,0 @@
'use strict';
if (typeof Promise === 'undefined') {
// Rejection tracking prevents a common issue where React gets into an
// inconsistent state due to an error, but it gets swallowed by a Promise,
// and the user has no idea what causes React's erratic future behavior.
require('promise/lib/rejection-tracking').enable();
window.Promise = require('promise/lib/es6-extensions.js');
}
// fetch() polyfill for making API calls.
require('whatwg-fetch');
// Object.assign() is commonly used with React.
// It will use the native implementation if it's present and isn't buggy.
Object.assign = require('object-assign');
// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
// We don't polyfill it in the browser--this is user's responsibility.
if (process.env.NODE_ENV === 'test') {
require('raf').polyfill(global);
}

View File

@ -1,315 +0,0 @@
'use strict';
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getClientEnvironment = require('./env');
const paths = require('./paths');
const fileList = require('./entry');
const pjson = require('../package.json');
let entry = {};
let htmlWebpackPlugins = [];
fileList.forEach(function (item) {
entry[item] = [
require.resolve('./polyfills'),
require.resolve('react-dev-utils/webpackHotDevClient'),
paths.appSrc + '/' + item + '.js',
];
htmlWebpackPlugins.push(
new HtmlWebpackPlugin({
inject: true,
chunks: [item],
template: paths.appHtml,
filename: item + '.html'
}));
});
// Webpack uses `publicPath` to determine where the app is being served from.
// In development, we always serve from the root. This makes config easier.
const publicPath = '/';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_PATH%/xyz looks better than %PUBLIC_PATH%xyz.
const publicUrl = '';
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);
// This is the development configuration.
// It is focused on developer experience and fast rebuilds.
// The production configuration is different and lives in a separate file.
module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.
devtool: 'cheap-module-source-map',
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.
entry: entry,
output: {
// Add /* filename */ comments to generated require()s in the output.
pathinfo: true,
path: paths.appBuild,
// This does not produce a real file. It's just the virtual path that is
// served by WebpackDevServer in development. This is the JS bundle
// containing code from all our entry points, and the Webpack runtime.
filename: 'static/js/[name].bundle.js',
// There are also additional JS chunk files if you use code splitting.
chunkFilename: 'static/js/[name].chunk.js',
// This is the URL that app is served from. We use "/" in development.
publicPath: publicPath,
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: info =>
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules', paths.appNodeModules].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebookincubator/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
alias: pjson.alias,
plugins: [
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
],
},
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
// First, run the linter.
// It's important to do this before Babel processes the JS.
// {
// test: /\.(js|jsx|mjs)$/,
// enforce: 'pre',
// use: [
// {
// options: {
// formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'),
// },
// loader: require.resolve('eslint-loader'),
// },
// ],
// include: paths.appSrc,
// },
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
// "url" loader works like "file" loader except that it embeds assets
// smaller than specified limit in bytes as data URLs to avoid requests.
// A missing `test` is equivalent to a match.
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process JS with Babel.
{
test: /\.(js|jsx|mjs)$/,
//include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
"presets": [
"@babel/preset-env",
[
"@babel/preset-react",
{
"pragma": "Omi.h",
"pragmaFrag": "Omi.h.f"
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-bind",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-syntax-dynamic-import"
],
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
},
},
{
test: /[\\|\/]_[\S]*\.css$/,
use: [
'to-string-loader',
'css-loader'
]
},
{
test: /[\\|\/]_[\S]*\.less$/,
use: [
'to-string-loader',
'css-loader',
'less-loader'
]
},
{
test: /\.less$/,
use: [
'style-loader',
'css-loader',
'less-loader'
]
},
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader turns CSS into JS modules that inject <style> tags.
// In production, we use a plugin to extract that CSS to a file, but
// in development "style" loader enables hot editing of CSS.
{
test: /\.css$/,
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
],
},
// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.
// This loader doesn't use a "test" so it will catch all modules
// that fall through the other loaders.
{
// Exclude `js` files to keep "css" loader working as it injects
// its runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
loader: require.resolve('file-loader'),
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
],
},
// ** STOP ** Are you adding a new loader?
// Make sure to add the new loader(s) before the "file" loader.
],
},
plugins: [
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In development, this will be an empty string.
...htmlWebpackPlugins,
new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw),
// Generates an `index.html` file with the <script> injected.
// new HtmlWebpackPlugin({
// inject: true,
// chunks:["index"],
// template: paths.appHtml,
// }),
// new HtmlWebpackPlugin({
// inject: true,
// chunks:["admin"],
// template:paths.appHtml,
// filename:'admin.html'
// }),
// Add module names to factory functions so they appear in browser profiler.
new webpack.NamedModulesPlugin(),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.
new webpack.DefinePlugin(env.stringified),
// This is necessary to emit hot updates (currently CSS only):
new webpack.HotModuleReplacementPlugin(),
// Watcher doesn't work well if you mistype casing in a path so we use
// a plugin that prints an error when you attempt to do this.
// See https://github.com/facebookincubator/create-react-app/issues/240
new CaseSensitivePathsPlugin(),
// If you require a missing module and then `npm install` it, you still have
// to restart the development server for Webpack to discover it. This plugin
// makes the discovery automatic so you don't have to restart.
// See https://github.com/facebookincubator/create-react-app/issues/186
//new WatchMissingNodeModulesPlugin(paths.appNodeModules),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
// Turn off performance hints during development because we don't do any
// splitting or minification in interest of speed. These warnings become
// cumbersome.
performance: {
hints: false,
},
mode: 'development'
};

View File

@ -1,370 +0,0 @@
'use strict';
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const miniCssExtractPlugin = require('mini-css-extract-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const paths = require('./paths');
const getClientEnvironment = require('./env');
const fileList = require('./entry');
const pjson = require('../package.json');
let entry = {};
let htmlWebpackPlugins = [];
fileList.forEach(function (item) {
entry[item] = [
require.resolve('./polyfills'),
paths.appSrc + '/' + item + '.js',
];
htmlWebpackPlugins.push(
new HtmlWebpackPlugin({
inject: true,
chunks:[item],
template: paths.appHtml,
filename: item + '.html',
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
},
}))
});
// Webpack uses `publicPath` to determine where the app is being served from.
// It requires a trailing slash, or the file assets will get an incorrect path.
const publicPath = paths.servedPath;
// Some apps do not use client-side routing with pushState.
// For these, "homepage" can be set to "." to enable relative asset paths.
const shouldUseRelativeAssetPaths = publicPath === './';
// Source maps are resource heavy and can cause out of memory issue for large source files.
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
const publicUrl = publicPath.slice(0, -1);
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);
// Assert this just to be safe.
// Development builds of React are slow and not intended for production.
if (env.stringified['process.env'].NODE_ENV !== '"production"') {
throw new Error('Production builds must have NODE_ENV=production.');
}
// Note: defined here because it will be used more than once.
const cssFilename = 'static/css/[name].[contenthash:8].css';
// ExtractTextPlugin expects the build output to be flat.
// (See https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/27)
// However, our output is structured with css, js and media folders.
// To have this structure working with relative paths, we have to use custom options.
const extractTextPluginOptions = shouldUseRelativeAssetPaths
? // Making sure that the publicPath goes back to to build folder.
{ publicPath: Array(cssFilename.split('/').length).join('../') }
: {};
// This is the production configuration.
// It compiles slowly and is focused on producing a fast and minimal bundle.
// The development configuration is different and lives in a separate file.
module.exports = {
// Don't attempt to continue if there are any errors.
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
devtool: shouldUseSourceMap ? 'source-map' : false,
// In production, we only want to load the polyfills and the app code.
entry: entry,
output: {
// The build folder.
path: paths.appBuild,
// Generated JS file names (with nested folders).
// There will be one main bundle, and one file per asynchronous chunk.
// We don't currently advertise code splitting but Webpack supports it.
filename: 'static/js/[name].[chunkhash:8].js',
chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js',
// We inferred the "public path" (such as / or /my-project) from homepage.
publicPath: publicPath,
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: info =>
path
.relative(paths.appSrc, info.absoluteResourcePath)
.replace(/\\/g, '/'),
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules', paths.appNodeModules].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebookincubator/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
alias: pjson.alias,
plugins: [
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
],
},
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
// First, run the linter.
// It's important to do this before Babel processes the JS.
// {
// test: /\.(js|jsx|mjs)$/,
// enforce: 'pre',
// use: [
// {
// options: {
// formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'),
// },
// loader: require.resolve('eslint-loader'),
// },
// ],
// include: paths.appSrc,
// },
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
// "url" loader works just like "file" loader but it also embeds
// assets smaller than specified size as data URLs to avoid requests.
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process JS with Babel.
{
test: /\.(js|jsx|mjs)$/,
//include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
"presets": [
"@babel/preset-env",
[
"@babel/preset-react",
{
"pragma": "Omi.h",
"pragmaFrag": "Omi.h.f"
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-bind",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-syntax-dynamic-import"
],
compact: true,
},
},
{
test: /[\\|\/]_[\S]*\.css$/,
use: [
'to-string-loader',
'css-loader'
]
},
{
test: /[\\|\/]_[\S]*\.less$/,
use: [
'to-string-loader',
'css-loader',
'less-loader'
]
},
{
test: /\.less$/,
use: [
'style-loader',
'css-loader',
'less-loader'
]
},
// The notation here is somewhat confusing.
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader normally turns CSS into JS modules injecting <style>,
// but unlike in development configuration, we do something different.
// `ExtractTextPlugin` first applies the "postcss" and "css" loaders
// (second argument), then grabs the result CSS and puts it into a
// separate file in our build process. This way we actually ship
// a single CSS file in production instead of JS code injecting <style>
// tags. If you use code splitting, however, any async bundles will still
// use the "style" loader inside the async code so CSS from them won't be
// in the main CSS file.
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
// "file" loader makes sure assets end up in the `build` folder.
// When you `import` an asset, you get its filename.
// This loader doesn't use a "test" so it will catch all modules
// that fall through the other loaders.
{
loader: require.resolve('file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// it's runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
// ** STOP ** Are you adding a new loader?
// Make sure to add the new loader(s) before the "file" loader.
],
},
],
},
plugins: [
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In production, it will be an empty string unless you specify "homepage"
// in `package.json`, in which case it will be the pathname of that URL.
// Generates an `index.html` file with the <script> injected.
...htmlWebpackPlugins,
new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
// It is absolutely essential that NODE_ENV was set to production here.
// Otherwise React will be compiled in the very slow development mode.
new webpack.DefinePlugin(env.stringified),
// Minify the code.
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false,
// // Disabled because of an issue with Uglify breaking seemingly valid code:
// // https://github.com/facebookincubator/create-react-app/issues/2376
// // Pending further investigation:
// // https://github.com/mishoo/UglifyJS2/issues/2011
// comparisons: false,
// },
// mangle: {
// safari10: true,
// },
// output: {
// comments: false,
// // Turned on because emoji and regex is not minified properly using default
// // https://github.com/facebookincubator/create-react-app/issues/2488
// ascii_only: true,
// },
// sourceMap: shouldUseSourceMap,
// }),
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
// new ExtractTextPlugin({
// filename: cssFilename,
// }),
new miniCssExtractPlugin({
filename: cssFilename
}),
// Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without
// having to parse `index.html`.
new ManifestPlugin({
fileName: 'asset-manifest.json',
}),
// Generate a service worker script that will precache, and keep up to date,
// the HTML & assets that are part of the Webpack build.
new SWPrecacheWebpackPlugin({
// By default, a cache-busting query parameter is appended to requests
// used to populate the caches, to ensure the responses are fresh.
// If a URL is already hashed by Webpack, then there is no concern
// about it being stale, and the cache-busting can be skipped.
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: 'service-worker.js',
logger(message) {
if (message.indexOf('Total precache size is') === 0) {
// This message occurs for every build and is a bit too noisy.
return;
}
if (message.indexOf('Skipping static resource') === 0) {
// This message obscures real errors so we ignore it.
// https://github.com/facebookincubator/create-react-app/issues/2612
return;
}
console.log(message);
},
minify: true,
// For unknown URLs, fallback to the index page
navigateFallback: publicUrl + '/index.html',
// Ignores URLs starting from /__ (useful for Firebase):
// https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219
navigateFallbackWhitelist: [/^(?!\/__).*/],
// Don't precache sourcemaps (they're large) and build asset manifest:
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
}),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
mode: 'production',
optimization: {
minimize: true
}
};

View File

@ -1,108 +0,0 @@
'use strict';
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
const ignoredFiles = require('react-dev-utils/ignoredFiles');
const config = require('./webpack.config.dev');
const paths = require('./paths');
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
const host = process.env.HOST || '0.0.0.0';
// const fileList = require('./entry');
// let rewrites = [];
// fileList.forEach(function (item) {
// rewrites.push({ from: new RegExp('^\/' + item + '.html', 'g'), to: '/build/' + item + '.html' })
// });
module.exports = function(proxy, allowedHost) {
return {
// WebpackDevServer 2.4.3 introduced a security fix that prevents remote
// websites from potentially accessing local content through DNS rebinding:
// https://github.com/webpack/webpack-dev-server/issues/887
// https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
// However, it made several existing use cases such as development in cloud
// environment or subdomains in development significantly more complicated:
// https://github.com/facebookincubator/create-react-app/issues/2271
// https://github.com/facebookincubator/create-react-app/issues/2233
// While we're investigating better solutions, for now we will take a
// compromise. Since our WDS configuration only serves files in the `public`
// folder we won't consider accessing them a vulnerability. However, if you
// use the `proxy` feature, it gets more dangerous because it can expose
// remote code execution vulnerabilities in backends like Django and Rails.
// So we will disable the host check normally, but enable it if you have
// specified the `proxy` setting. Finally, we let you override it if you
// really know what you're doing with a special environment variable.
disableHostCheck:
!proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true',
// Enable gzip compression of generated files.
compress: true,
// Silence WebpackDevServer's own logs since they're generally not useful.
// It will still show compile warnings and errors with this setting.
clientLogLevel: 'none',
// By default WebpackDevServer serves physical files from current directory
// in addition to all the virtual build products that it serves from memory.
// This is confusing because those files wont automatically be available in
// production build folder unless we copy them. However, copying the whole
// project directory is dangerous because we may expose sensitive files.
// Instead, we establish a convention that only files in `public` directory
// get served. Our build script will copy `public` into the `build` folder.
// In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
// Note that we only recommend to use `public` folder as an escape hatch
// for files like `favicon.ico`, `manifest.json`, and libraries that are
// for some reason broken when imported through Webpack. If you just want to
// use an image, put it in `src` and `import` it from JavaScript instead.
contentBase: paths.appPublic,
// By default files from `contentBase` will not trigger a page reload.
watchContentBase: true,
// Enable hot reloading server. It will provide /sockjs-node/ endpoint
// for the WebpackDevServer client so it can learn when the files were
// updated. The WebpackDevServer client is included as an entry point
// in the Webpack development configuration. Note that only changes
// to CSS are currently hot reloaded. JS changes will refresh the browser.
hot: true,
// It is important to tell WebpackDevServer to use the same "root" path
// as we specified in the config. In development, we always serve from /.
publicPath: config.output.publicPath,
// WebpackDevServer is noisy by default so we emit custom message instead
// by listening to the compiler events with `compiler.plugin` calls above.
quiet: true,
// Reportedly, this avoids CPU overload on some systems.
// https://github.com/facebookincubator/create-react-app/issues/293
// src/node_modules is not ignored to support absolute imports
// https://github.com/facebookincubator/create-react-app/issues/1065
watchOptions: {
ignored: ignoredFiles(paths.appSrc),
},
// Enable HTTPS if the HTTPS environment variable is set to 'true'
https: protocol === 'https',
host: host,
overlay: false,
historyApiFallback: {
// Paths with dots should still use the history fallback.
// See https://github.com/facebookincubator/create-react-app/issues/387.
disableDotRule: true
//rewrites: rewrites
},
public: allowedHost,
proxy,
before(app) {
// This lets us open files from the runtime error overlay.
app.use(errorOverlayMiddleware());
// This service worker file is effectively a 'no-op' that will reset any
// previous service worker registered for the same host:port combination.
// We do this in development to avoid hitting the production cache if
// it used the same host and port.
// https://github.com/facebookincubator/create-react-app/issues/2272#issuecomment-302832432
app.use(noopServiceWorkerMiddleware());
},
};
};

View File

@ -1,144 +0,0 @@
{
"name": "omi-demo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.2.3",
"@babel/plugin-proposal-decorators": "^7.2.3",
"@babel/plugin-proposal-function-bind": "^7.2.0",
"@babel/plugin-proposal-object-rest-spread": "^7.2.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.2.3",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.3.1",
"@omiu/checkbox": "latest",
"autoprefixer": "7.1.6",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",
"babel-loader": "^8.0.5",
"case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "1.1.3",
"css": "^2.2.4",
"css-loader": "^1.0.1",
"dotenv": "4.0.0",
"dotenv-expand": "4.2.0",
"eslint": "^4.18.2",
"eslint-config-prettier": "^3.1.0",
"eslint-loader": "1.9.0",
"eslint-plugin-flowtype": "2.39.1",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jsx-a11y": "5.1.1",
"eslint-plugin-prettier": "^3.0.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file": "^0.2.2",
"file-loader": "^2.0.0",
"fs-extra": "3.0.1",
"html-webpack-plugin": "^4.0.0-beta.5",
"jest": "20.0.4",
"less": "^3.10.0",
"less-loader": "^5.0.0",
"mini-css-extract-plugin": "^0.5.0",
"object-assign": "4.1.1",
"omi": "latest",
"omi-router": "latest",
"omio": "latest",
"omiu": "latest",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.8",
"prettier": "^1.14.3",
"promise": "8.0.1",
"raf": "3.4.0",
"react-dev-utils": "^7.0.1",
"reomi": "latest",
"resolve": "1.6.0",
"style-loader": "0.19.0",
"sw-precache-webpack-plugin": "^0.11.5",
"to-string-loader": "^1.1.5",
"url": "^0.11.0",
"url-loader": "^1.1.2",
"webpack": "^4.28.3",
"webpack-cli": "^3.2.0",
"webpack-dev-server": "^3.1.10",
"webpack-manifest-plugin": "^2.0.4",
"webpack-merge": "^4.2.1",
"whatwg-fetch": "2.0.3"
},
"scripts": {
"start": "node scripts/start.js",
"build": "PUBLIC_URL=. node scripts/build.js",
"build-windows": "set PUBLIC_URL=.&& node scripts/build.js",
"fix": "eslint src --fix"
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,mjs}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}",
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}"
],
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
},
"moduleFileExtensions": [
"web.js",
"js",
"json",
"web.jsx",
"jsx",
"node",
"mjs"
]
},
"babel": {
"presets": [
"@babel/preset-env",
[
"@babel/preset-react",
{
"pragma": "Omi.h"
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/transform-runtime",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-bind",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-syntax-dynamic-import"
]
},
"prettier": {
"singleQuote": true,
"semi": false,
"tabWidth": 2,
"useTabs": false
},
"alias": {
"omi": "omio"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

View File

@ -1,40 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Omi</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

View File

@ -1,15 +0,0 @@
{
"short_name": "Omi App",
"name": "Omi Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -1,150 +0,0 @@
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const path = require('path');
const chalk = require('chalk');
const fs = require('fs-extra');
const webpack = require('webpack');
const config = require('../config/webpack.config.prod');
const paths = require('../config/paths');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError');
const measureFileSizesBeforeBuild =
FileSizeReporter.measureFileSizesBeforeBuild;
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
const useYarn = fs.existsSync(paths.yarnLockFile);
// These sizes are pretty large. We'll warn for bundles exceeding them.
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1);
}
// First, read the current file sizes in build directory.
// This lets us display how much they changed later.
measureFileSizesBeforeBuild(paths.appBuild)
.then(previousFileSizes => {
// Remove all content but keep the directory so that
// if you're in it, you don't end up in Trash
fs.emptyDirSync(paths.appBuild);
// Merge with the public folder
copyPublicFolder();
// Start the webpack build
return build(previousFileSizes);
})
.then(
({ stats, previousFileSizes, warnings }) => {
if (warnings.length) {
console.log(chalk.yellow('Compiled with warnings.\n'));
console.log(warnings.join('\n\n'));
console.log(
'\nSearch for the ' +
chalk.underline(chalk.yellow('keywords')) +
' to learn more about each warning.'
);
console.log(
'To ignore, add ' +
chalk.cyan('// eslint-disable-next-line') +
' to the line before.\n'
);
} else {
console.log(chalk.green('Compiled successfully.\n'));
}
console.log('File sizes after gzip:\n');
printFileSizesAfterBuild(
stats,
previousFileSizes,
paths.appBuild,
WARN_AFTER_BUNDLE_GZIP_SIZE,
WARN_AFTER_CHUNK_GZIP_SIZE
);
console.log();
const appPackage = require(paths.appPackageJson);
const publicUrl = paths.publicUrl;
const publicPath = config.output.publicPath;
const buildFolder = path.relative(process.cwd(), paths.appBuild);
printHostingInstructions(
appPackage,
publicUrl,
publicPath,
buildFolder,
useYarn
);
},
err => {
console.log(chalk.red('Failed to compile.\n'));
printBuildError(err);
process.exit(1);
}
);
// Create the production build and print the deployment instructions.
function build(previousFileSizes) {
console.log('Creating an optimized production build...');
let compiler = webpack(config);
return new Promise((resolve, reject) => {
compiler.run((err, stats) => {
if (err) {
return reject(err);
}
const messages = formatWebpackMessages(stats.toJson({}, true));
if (messages.errors.length) {
// Only keep the first error. Others are often indicative
// of the same problem, but confuse the reader with noise.
if (messages.errors.length > 1) {
messages.errors.length = 1;
}
return reject(new Error(messages.errors.join('\n\n')));
}
if (
process.env.CI &&
(typeof process.env.CI !== 'string' ||
process.env.CI.toLowerCase() !== 'false') &&
messages.warnings.length
) {
console.log(
chalk.yellow(
'\nTreating warnings as errors because process.env.CI = true.\n' +
'Most CI servers set it automatically.\n'
)
);
return reject(new Error(messages.warnings.join('\n\n')));
}
return resolve({
stats,
previousFileSizes,
warnings: messages.warnings,
});
});
});
}
function copyPublicFolder() {
fs.copySync(paths.appPublic, paths.appBuild, {
dereference: true,
filter: file => file !== paths.appHtml,
});
}

View File

@ -1,107 +0,0 @@
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const fs = require('fs');
const chalk = require('chalk');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const clearConsole = require('react-dev-utils/clearConsole');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const {
choosePort,
createCompiler,
prepareProxy,
prepareUrls,
} = require('react-dev-utils/WebpackDevServerUtils');
const openBrowser = require('react-dev-utils/openBrowser');
const paths = require('../config/paths');
const config = require('../config/webpack.config.dev');
const createDevServerConfig = require('../config/webpackDevServer.config');
const useYarn = fs.existsSync(paths.yarnLockFile);
const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1);
}
// Tools like Cloud9 rely on this.
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
const HOST = process.env.HOST || '0.0.0.0';
if (process.env.HOST) {
console.log(
chalk.cyan(
`Attempting to bind to HOST environment variable: ${chalk.yellow(
chalk.bold(process.env.HOST)
)}`
)
);
console.log(
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
);
console.log(`Learn more here: ${chalk.yellow('http://bit.ly/2mwWSwH')}`);
console.log();
}
// We attempt to use the default port but if it is busy, we offer the user to
// run on a different port. `choosePort()` Promise resolves to the next free port.
choosePort(HOST, DEFAULT_PORT)
.then(port => {
if (port == null) {
// We have not found a port.
return;
}
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
const appName = require(paths.appPackageJson).name;
const urls = prepareUrls(protocol, HOST, port);
// Create a webpack compiler that is configured with custom messages.
const compiler = createCompiler(webpack, config, appName, urls, useYarn);
// Load proxy config
const proxySetting = require(paths.appPackageJson).proxy;
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
// Serve webpack assets generated by the compiler over a web sever.
const serverConfig = createDevServerConfig(
proxyConfig,
urls.lanUrlForConfig
);
const devServer = new WebpackDevServer(compiler, serverConfig);
// Launch WebpackDevServer.
devServer.listen(port, HOST, err => {
if (err) {
return console.log(err);
}
if (isInteractive) {
clearConsole();
}
console.log(chalk.cyan('Starting the development server...\n'));
openBrowser(urls.localUrlForBrowser);
});
['SIGINT', 'SIGTERM'].forEach(function(sig) {
process.on(sig, function() {
devServer.close();
process.exit();
});
});
})
.catch(err => {
if (err && err.message) {
console.log(err.message);
}
process.exit(1);
});

View File

@ -1,27 +0,0 @@
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'test';
process.env.NODE_ENV = 'test';
process.env.PUBLIC_URL = '';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const jest = require('jest');
let argv = process.argv.slice(2);
// Watch unless on CI or in coverage mode
if (!process.env.CI && argv.indexOf('--coverage') < 0) {
argv.push('--watch');
}
jest.run(argv);

View File

@ -1,52 +0,0 @@
import { define, render } from 'omi'
import '@omiu/checkbox'
class Store {
data = {
count: 1
}
sub = () => {
this.data.count--
}
add = () => {
this.data.count++
}
onChange = (evt) => {
console.log(evt.detail)
}
}
define('my-counter', _ => (
<div>
<button onClick={_.store.sub}>-</button>
<span>{_.store.data.count}</span>
<button onClick={_.store.add}>+</button>
<div>
<o-checkbox label="Label"></o-checkbox>
<br />
<o-checkbox checked label="checked"></o-checkbox>
<br />
<o-checkbox onChange={_.store.onChange} indeterminate label="indeterminate"></o-checkbox>
<br />
<o-checkbox disabled label="disabled"></o-checkbox>
<br />
<o-checkbox disabled checked label="disabled checked"></o-checkbox>
</div>
</div>
), {
use: ['count'],
//or using useSelf, useSelf will update self only, exclude children components
//useSelf: ['count'],
css: `span { color: red; }`,
installed() {
console.log('installed')
}
})
render(<my-counter />, 'body', new Store)

View File

@ -1,3 +0,0 @@
node_modules
/build
/*.log

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
/*! For license information please see bundle.36834.esm.js.LICENSE.txt */

View File

@ -1 +0,0 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"bundle.36834.esm.js","sourceRoot":""}

View File

@ -1 +0,0 @@
body,html{font:14px/1.21 Helvetica Neue,arial,sans-serif;font-weight:400}h1{text-align:center}

File diff suppressed because one or more lines are too long

View File

@ -1,51 +0,0 @@
/*!
* https://github.com/Palindrom/JSONPatcherProxy
* (c) 2017 Starcounter
* MIT license
*/
/*! !../node_modules/_css-loader@1.0.1@css-loader!../node_modules/_resolve-url-loader@3.1.1@resolve-url-loader!../node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js??ref--4-3!./index.scss */
/*! ../node_modules/_css-loader@1.0.1@css-loader/lib/css-base.js */
/*! ../theme.ts */
/*! ./index.scss */
/*! no static exports found */
/*! omi */
/*!******************!*\
!*** ./theme.ts ***!
\******************/
/*!***********************!*\
!*** ./src/index.tsx ***!
\***********************/
/*!************************!*\
!*** ./src/index.scss ***!
\************************/
/*!*******************************************************************!*\
!*** ./node_modules/_css-loader@1.0.1@css-loader/lib/css-base.js ***!
\*******************************************************************/
/*!******************************************************************************!*\
!*** external {"commonjs":"omi","commonjs2":"omi","amd":"omi","root":"Omi"} ***!
\******************************************************************************/
/*!****************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/_css-loader@1.0.1@css-loader!./node_modules/_resolve-url-loader@3.1.1@resolve-url-loader!./node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js??ref--4-3!./src/index.scss ***!
\****************************************************************************************************************************************************************************************************/
/**
* @license
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>preact</title><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-capable" content="yes"><link rel="apple-touch-icon" href="./assets/icons/apple-touch-icon.png"><link rel="manifest" href="./manifest.json"><style>body,html{font:14px/1.21 Helvetica Neue,arial,sans-serif;font-weight:400}</style><link href="./bundle.c3928.css" rel="preload" as="style"></head><body><script type="__PREACT_CLI_DATA__">{"preRenderData":{"url":"/"}}</script><script nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" src="./bundle.36834.esm.js" type="module"></script><script nomodule="" src="./polyfills.edd28.js"></script><script nomodule="" defer="defer" src="./bundle.c4a12.js"></script><link rel="stylesheet" href="./bundle.c3928.css"></body></html>

View File

@ -1,14 +0,0 @@
{
"name": "preact-cli app",
"start_url": "/",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#673ab8",
"icons": [
{
"src": "/assets/icon.png",
"type": "image/png",
"sizes": "512x512"
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"polyfills.df96b.esm.js","sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"url":"/"}

View File

@ -1,22 +0,0 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "cf3fdf7af60a294d6d3f48cb7ad82488",
"url": "./assets/icon.png"
},
{
"revision": "c4a1246028cd06da30a2",
"url": "./bundle.36834.esm.js"
},
{
"revision": "c4a1246028cd06da30a2",
"url": "./bundle.c3928.css"
},
{
"revision": "afb6e80e2951dd2f752fede45fd1c40f",
"url": "./index.html"
},
{
"revision": "edd28f5b8c25e742e6f7",
"url": "./polyfills.df96b.esm.js"
}
]);

View File

@ -1,34 +0,0 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "cf3fdf7af60a294d6d3f48cb7ad82488",
"url": "./assets/icon.png"
},
{
"revision": "c4a1246028cd06da30a2",
"url": "./bundle.c3928.css"
},
{
"revision": "c4a1246028cd06da30a2",
"url": "./bundle.c4a12.js"
},
{
"revision": "afb6e80e2951dd2f752fede45fd1c40f",
"url": "./index.html"
},
{
"revision": "edd28f5b8c25e742e6f7",
"url": "./polyfills.edd28.js"
},
{
"revision": "144c6ff1323d2d15182a7d2af08d027e",
"url": "./sw-debug.js"
},
{
"revision": "e5b166af83e9b29fe82b9e130c43f8a2",
"url": "./sw-esm.js"
},
{
"revision": "35f469807c222617fb0443903454e907",
"url": "./sw.js"
}
]);

View File

@ -1 +0,0 @@
{"/":{"bundle.c3928.css":{"type":"style","weight":1},"bundle.36834.esm.js":{"type":"script","weight":1}}}

View File

@ -1,11 +0,0 @@
html, body {
font: 14px/1.21 'Helvetica Neue', arial, sans-serif;
font-weight: 400;
}
h1 {
text-align: center;
}
/*# sourceMappingURL=ssr-bundle.c3928.css.map*/

View File

@ -1 +0,0 @@
{"version":3,"sources":["webpack:///style.css"],"names":[],"mappings":"AAAA;CACC,mDAAmD;CACnD,gBAAgB;AACjB;;AAEA;CACC,kBAAkB;AACnB","file":"ssr-bundle.c3928.css","sourcesContent":["html, body {\n\tfont: 14px/1.21 'Helvetica Neue', arial, sans-serif;\n\tfont-weight: 400;\n}\n\nh1 {\n\ttext-align: center;\n}\n"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,21 +0,0 @@
self.addEventListener('fetch', function(event) {
var isPostRequest = event.request.method === 'POST';
event.respondWith(
fetch(event.request).catch(function(err) {
if (err instanceof TypeError) {
if (isPostRequest) {
// eslint-disable-next-line
console.log(
'⚛Preact CLI development tip: A POST request just failed. This might fail for your users as well due to a network error. It may be worth exploring the backgroundSync API.'
);
} else {
// eslint-disable-next-line
console.log(
'⚛Preact CLI development tip: A GET request just failed. This might fail for your users as well due to a network error. It may be worth adding runtimeCaching to your Service Worker.'
);
}
}
return err;
})
);
});

View File

@ -1,4 +0,0 @@
importScripts("./precache-manifest.330c07249434bc07e8a97e99f8761e9b.esm.js", "https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
!function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var t={};r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(r){return e[r]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="./",r(r.s="Ohax")}({Ohax:function(){self.__precacheManifest=[].concat(self.__precacheManifest||[]);var e=function(e){return"navigate"===e.request.mode};workbox.routing.registerRoute((function(r){return e(r.event)}),new workbox.strategies.NetworkFirst({cacheName:workbox.core.cacheNames.precache,networkTimeoutSeconds:5,plugins:[new workbox.cacheableResponse.Plugin({statuses:[200]})]})),workbox.precaching.precacheAndRoute(self.__precacheManifest,{}),workbox.routing.setCatchHandler((function(r){return e(r.event)?caches.match(workbox.precaching.getCacheKeyForURL("/index.html")):Response.error()}))}});
//# sourceMappingURL=sw-esm.js.map

View File

@ -1 +0,0 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"sw-esm.js","sourceRoot":""}

View File

@ -1,4 +0,0 @@
importScripts("./precache-manifest.377a47762525299db9abec43be77c1ee.js", "https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
!function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var t={};r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(r){return e[r]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="./",r(r.s="Ohax")}({Ohax:function(){self.__precacheManifest=[].concat(self.__precacheManifest||[]);var e=function(e){return"navigate"===e.request.mode};workbox.routing.registerRoute((function(r){return e(r.event)}),new workbox.strategies.NetworkFirst({cacheName:workbox.core.cacheNames.precache,networkTimeoutSeconds:5,plugins:[new workbox.cacheableResponse.Plugin({statuses:[200]})]})),workbox.precaching.precacheAndRoute(self.__precacheManifest,{}),workbox.routing.setCatchHandler((function(r){return e(r.event)?caches.match(workbox.precaching.getCacheKeyForURL("/index.html")):Response.error()}))}});
//# sourceMappingURL=sw.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,16 +0,0 @@
{
"name": "preact",
"short_name": "preact",
"start_url": "/",
"display": "standalone",
"orientation": "portrait",
"background_color": "#fff",
"theme_color": "#673ab8",
"icons": [
{
"src": "/assets/icon.png",
"type": "image/png",
"sizes": "512x512"
}
]
}

View File

@ -1,30 +0,0 @@
{
"private": true,
"name": "preact",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"build": "preact build",
"serve": "sirv build --cors --single",
"dev": "preact watch",
"start": "preact watch",
"lint": "eslint src"
},
"eslintConfig": {
"extends": "eslint-config-synacor"
},
"eslintIgnore": [
"build/*"
],
"devDependencies": {
"eslint": "^6.0.1",
"eslint-config-synacor": "^3.0.4",
"preact-cli": "^3.0.0-rc.6",
"sirv-cli": "^0.4.5"
},
"dependencies": {
"preact": "^10.1.0",
"preact-render-to-string": "^5.1.2",
"@omiu/checkbox": "latest"
}
}

View File

@ -1,3 +0,0 @@
export default (config) => {
config.output.publicPath = './';
};

File diff suppressed because one or more lines are too long

View File

@ -1,33 +0,0 @@
import './style';
import { Component } from 'preact';
//import '../../../src/index.js'
import '@omiu/checkbox'
export default class App extends Component {
onChange = (evt) => {
console.log(evt.detail)
}
render() {
return (
<div>
<o-checkbox label="Label"></o-checkbox>
<br />
<br />
<o-checkbox checked label="checked"></o-checkbox>
<br />
<br />
<o-checkbox onChange={this.onChange} indeterminate label="indeterminate"></o-checkbox>
<br />
<br />
<o-checkbox disabled label="disabled"></o-checkbox>
<br /> <br />
<o-checkbox disabled checked label="disabled checked"></o-checkbox>
</div>
);
}
}

View File

@ -1,8 +0,0 @@
html, body {
font: 14px/1.21 'Helvetica Neue', arial, sans-serif;
font-weight: 400;
}
h1 {
text-align: center;
}

View File

@ -1 +0,0 @@
SKIP_PREFLIGHT_CHECK=true

View File

@ -1,23 +0,0 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View File

@ -1,68 +0,0 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `yarn start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `yarn test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `yarn build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `yarn build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

View File

@ -1,36 +0,0 @@
{
"name": "react-demo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@omiu/checkbox": "latest",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"jsx-native-events": "^1.0.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -1,43 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,25 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -1,3 +0,0 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

View File

@ -1,38 +0,0 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@ -1,33 +0,0 @@
import React from 'react';
/** @jsx nativeEvents */
import nativeEvents from 'jsx-native-events'
import logo from './logo.svg';
import './App.css';
import '@omiu/checkbox'
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<o-checkbox label="Label"></o-checkbox>
<br />
<o-checkbox checked label="checked"></o-checkbox>
<br />
<o-checkbox onEventChange={evt=>console.log(evt.detail)} indeterminate label="indeterminate"></o-checkbox>
<br />
<o-checkbox disabled label="disabled"></o-checkbox>
<br />
<o-checkbox disabled checked label="disabled checked"></o-checkbox>
</header>
</div>
);
}
export default App;

View File

@ -1,9 +0,0 @@
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

View File

@ -1,13 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

View File

@ -1,17 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();

View File

@ -1,7 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
<g fill="#61DAFB">
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
<circle cx="420.9" cy="296.5" r="45.7"/>
<path d="M520.5 78.1z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,141 +0,0 @@
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export function register(config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl, config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
headers: { 'Service-Worker': 'script' },
})
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready
.then(registration => {
registration.unregister();
})
.catch(error => {
console.error(error.message);
});
}
}

View File

@ -1,5 +0,0 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect';

View File

@ -1 +0,0 @@
../../../src/index.js

View File

@ -1,21 +0,0 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@ -1,24 +0,0 @@
# vue
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

@ -1,5 +0,0 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

View File

@ -1,44 +0,0 @@
{
"name": "vue",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"start": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.4",
"vue": "^2.6.11",
"@omiu/checkbox": "latest"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.3.0",
"@vue/cli-plugin-eslint": "~4.3.0",
"@vue/cli-service": "~4.3.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@ -1,46 +0,0 @@
<template>
<div id="app">
<o-checkbox label="Label"></o-checkbox>
<br />
<o-checkbox checked label="checked"></o-checkbox>
<br />
<o-checkbox @change="onChange" indeterminate label="indeterminate"></o-checkbox>
<br />
<o-checkbox disabled label="disabled"></o-checkbox>
<br />
<o-checkbox disabled checked label="disabled checked"></o-checkbox>
</div>
</template>
<script>
// import HelloWorld from './components/HelloWorld.vue'
//import '../../../src/index.js'
import '@omiu/checkbox'
export default {
name: 'App',
methods: {
onChange(evt) {
console.log(evt.detail)
}
},
components: {
//HelloWorld
}
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
/* margin-top: 60px; */
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -1,58 +0,0 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

View File

@ -1,8 +0,0 @@
import Vue from 'vue'
import App from './App.vue'
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Omiu</title>
<script type="module" src="/src/index.tsx"></script>
</head>
<body>
<h1>HTML Mode <a href="./demo.html">JSX Mode</a></h1>
<div>
<o-checkbox label='Label'> </o-checkbox>
<br />
<o-checkbox checked label='checked'> </o-checkbox>
<br />
<o-checkbox id="myCheckbox" indeterminate label='indeterminate'> </o-checkbox>
<br />
<o-checkbox disabled label='disabled'> </o-checkbox>
<br />
<o-checkbox disabled checked label='disabled checked'> </o-checkbox>
</div>
<script>
document.querySelector('#myCheckbox').addEventListener('change', function (evt) {
console.log(evt.detail)
})
</script>
</body>
</html>

View File

@ -1,99 +1,41 @@
{
"name": "@omiu/checkbox",
"version": "0.0.11",
"description": "Omi UI Components.",
"main": "src/index.js",
"module": "src/index.esm.js",
"types": "src/index.d.ts",
"scripts": {
"start": "node ./scripts/webpack.build.js -- demo",
"build": "node ./scripts/webpack.build.js -- build && rollup -c scripts/rollup.config.js && node ./scripts/rollup.end.js"
"version": "0.0.13",
"main": "dist/index.es.js",
"exports": {
".": "./dist/index.es.js"
},
"typings": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/Tencent/omi.git"
"types": "types/index.d.ts",
"scripts": {
"start": "yarn watch & vite",
"dev": "yarn start",
"build": "vite build && yarn build:scss",
"build:demo": "vite build",
"build:scss": "sass src/index.scss src/index.css",
"watch": "sass --watch src/index.scss src/index.css --no-source-map",
"pretest": "yarn build",
"test": "web-test-runner \"test/*.js\" --node-resolve"
},
"files": [
"src",
"dist",
"typings.json"
"types"
],
"keywords": [
"omiu",
"omi",
"omio",
"preact",
"react",
"virtual dom",
"vdom",
"components",
"virtual",
"dom"
],
"author": "dntzhang <dntzhang@qq.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/Tencent/omi/issues"
},
"homepage": "http://omijs.org",
"devDependencies": {
"@rollup/plugin-commonjs": "^11.1.0",
"css": "^2.2.4",
"css-loader": "^1.0.1",
"file": "^0.2.2",
"file-loader": "^2.0.0",
"html-webpack-plugin": "^3.2.0",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"mini-css-extract-plugin": "^0.4.5",
"node-sass": "^4.12.0",
"omi": "latest",
"omio": "latest",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"progress-bar-webpack-plugin": "^2.1.0",
"resolve-url-loader": "^3.1.0",
"rollup": "^2.7.1",
"rollup-plugin-license": "^2.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-scss": "^2.4.0",
"rollup-plugin-typescript": "^1.0.1",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"to-string-loader": "^1.1.5",
"ts-loader": "^5.4.4",
"typescript": "^3.2.1",
"url": "^0.11.0",
"url-loader": "^1.1.2",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.1",
"webpack-dev-server": "^3.1.10",
"webpack-merge": "^4.1.4"
},
"greenkeeper": {
"ignore": [
"babel-cli",
"babel-core",
"babel-eslint",
"babel-loader",
"jscodeshift",
"rollup-plugin-babel"
]
},
"bundlesize": [
{
"path": "./dist/omim.min.js",
"threshold": "4Kb"
}
],
"prettier": {
"singleQuote": true,
"semi": false,
"tabWidth": 2,
"useTabs": false
},
"dependencies": {
"omi": "latest",
"@omiu/common": "latest"
}
"@omiu/common": "latest",
"omi": "latest"
},
"devDependencies": {
"@open-wc/testing": "^2.5.33",
"@types/node": "^16.4.13",
"@web/test-runner": "^0.13.15",
"sass": "^1.37.5",
"typescript": "^4.3.5",
"vite": "^2.4.4"
},
"license": "MIT",
"keywords": [
"omi",
"omiu",
"form"
]
}

View File

@ -1,38 +0,0 @@
import nodeResolve from "rollup-plugin-node-resolve";
import typescript from 'rollup-plugin-typescript';
import scss from 'rollup-plugin-scss'
import commonjs from '@rollup/plugin-commonjs';
const fs = require('fs')
const license = require("rollup-plugin-license");
const pkg = require("../package.json");
const licensePlugin = license({
banner: `${pkg.name} v${pkg.version} http://omijs.org\r\nFront End Cross-Frameworks Framework.\r\nBy dntzhang https://github.com/dntzhang \r\n Github: https://github.com/Tencent/omi\r\n MIT Licensed.`
});
export default {
input: "src/index.tsx",
output: {
format: "es",
file: "./src/index.esm.js",
name: pkg.name,
sourcemap: true,
strict: true
},
plugins: [
nodeResolve({
main: true
}),
scss({
//output: false,
output: function (styles, styleNodes) {
fs.writeFileSync('./src/index.css', styles)
},
}),
typescript(),
commonjs(),
licensePlugin
],
external: ['omi']
};

View File

@ -1,16 +0,0 @@
const fs = require('fs')
const css = fs.readFileSync('./src/index.css')
const js = fs.readFileSync('./src/index.esm.js', 'utf-8')
fs.writeFileSync('./src/index.esm.js',
js.replace(`var css = /*#__PURE__*/Object.freeze({
__proto__: null
});`, `
var css = \`${css}\`
`)
)

Some files were not shown because too many files have changed in this diff Show More