Skip to content

Commit

Permalink
Update React demo and fix issue with window global for React
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferbaxter committed Sep 21, 2018
1 parent de774ee commit 486886b
Show file tree
Hide file tree
Showing 14 changed files with 495 additions and 258 deletions.
4 changes: 2 additions & 2 deletions demo/preact-map/.babelrc
@@ -1,9 +1,9 @@
{
"presets": [
"env"
"@babel/preset-env"
],
"plugins": [
["transform-react-jsx", {
["@babel/plugin-transform-react-jsx", {
"pragma": "h"
}]
]
Expand Down
84 changes: 82 additions & 2 deletions demo/preact-map/dist/main.css
@@ -1,2 +1,82 @@
.candidateTable_victor{padding-right:6px;vertical-align:middle;display:inline;opacity:0}.candidateTable_displayVictor{opacity:1}.candidateTable_name,.candidateTable_shortName{color:#000;vertical-align:middle}.candidateTable_party,.candidateTable_shortParty{color:#000}.candidateTable_shortParty{display:none}.candidateTable_votes{color:#000}.candidateTable_percent{color:#000;font-weight:700}
.candidateMap_tooltip{position:absolute;top:-30px;width:360px;display:none;text-align:center;background:#ff0;padding:1em 0;pointer-events:none}.candidateMap_showTooltip{display:block}.candidateMap_wrapper{position:relative}
/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.candidateTable_victor {
padding-right: 6px;
vertical-align: middle;
display: inline;
opacity: 0;
}
.candidateTable_displayVictor {
opacity: 1;
}

.candidateTable_name,
.candidateTable_shortName {
color: #000;
vertical-align: middle;
}

.candidateTable_party,
.candidateTable_shortParty {
color: #000;
}
.candidateTable_shortParty {
display: none;
}

.candidateTable_votes {
color: #000;
}

.candidateTable_percent {
color: #000;
font-weight: bold;
}
/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.candidateMap_tooltip {
position: absolute;
top: -30px;
width: 360px;
display: none;
text-align: center;
background: #ff0;
padding: 1em 0;
pointer-events: none;
}

.candidateMap_showTooltip {
display: block;
}

.candidateMap_wrapper {
position: relative;
}
57 changes: 36 additions & 21 deletions demo/preact-map/dist/main.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions demo/preact-map/package.json
Expand Up @@ -13,14 +13,14 @@
"preact": "8.3.1"
},
"devDependencies": {
"babel-core": "6.26.3",
"@babel/core": "7.1.0",
"@babel/preset-env": "7.1.0",
"@babel/plugin-transform-react-jsx": "7.0.0",
"babel-loader": "8.0.0",
"babel-plugin-transform-react-jsx": "6.24.1",
"babel-preset-env": "1.7.0",
"css-loader": "0.28.11",
"mini-css-extract-plugin": "0.4.2",
"css-loader": "1.0.0",
"mini-css-extract-plugin": "0.4.3",
"style-loader": "0.23.0",
"webpack": "4.17.2",
"webpack-cli": "2.1.5"
"webpack": "4.19.1",
"webpack-cli": "3.1.0"
}
}
11 changes: 11 additions & 0 deletions demo/preact-map/renovate.json
@@ -0,0 +1,11 @@
{
"extends": [
"config:base"
],
"dependencies": {
"enabled": false
},
"devDependencies": {
"enabled": false
}
}
4 changes: 2 additions & 2 deletions demo/react-map/.babelrc
@@ -1,8 +1,8 @@
{
"presets": [
"env"
"@babel/preset-env"
],
"plugins": [
["transform-react-jsx", {}]
["@babel/plugin-transform-react-jsx", {}]
]
}
86 changes: 84 additions & 2 deletions demo/react-map/dist/main.css
@@ -1,2 +1,84 @@
.candidateTable_victor{padding-right:6px;vertical-align:middle;display:inline;opacity:0}.candidateTable_displayVictor{opacity:1}.candidateTable_name,.candidateTable_shortName{color:#000;vertical-align:middle}.candidateTable_party,.candidateTable_shortParty{color:#000}.candidateTable_shortParty{display:none}.candidateTable_votes{color:#000}.candidateTable_percent{color:#000;font-weight:700}
.candidateMap_tooltip{position:absolute;top:-30px;width:360px;display:none;text-align:center;background:#ff0;padding:1em 0;pointer-events:none}.candidateMap_showTooltip{display:block}.candidateMap_wrapper{position:relative}
/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.candidateTable_victor {
padding-right: 6px;
vertical-align: middle;
display: inline;
opacity: 0;
}
.candidateTable_displayVictor {
opacity: 1;
}

.candidateTable_name,
.candidateTable_shortName {
color: #000;
vertical-align: middle;
}

.candidateTable_party,
.candidateTable_shortParty {
color: #000;
}
.candidateTable_shortParty {
display: none;
}

.candidateTable_votes {
color: #000;
}

.candidateTable_percent {
color: #000;
font-weight: bold;
}

/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.candidateMap_tooltip {
position: absolute;
top: -30px;
width: 360px;
display: none;
text-align: center;
background: #ff0;
padding: 1em 0;
pointer-events: none;
}

.candidateMap_showTooltip {
display: block;
}

.candidateMap_wrapper {
position: relative;
}

0 comments on commit 486886b

Please sign in to comment.