Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit e803c55

Browse files
1 parent 56e8b88 commit e803c55

File tree

19 files changed

+9692
-14
lines changed

19 files changed

+9692
-14
lines changed

assets/js/.babelrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"ie": 11
8+
}
9+
}
10+
]
11+
],
12+
"plugins": [
13+
[
14+
"@babel/plugin-transform-react-jsx",
15+
{
16+
"pragma": "wp.element.createElement"
17+
}
18+
]
19+
]
20+
}

assets/js/.eslintrc

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:react/recommended"
5+
],
6+
"env": {
7+
"node": true,
8+
"mocha": true,
9+
"es6": true,
10+
"browser": true
11+
},
12+
"settings": {
13+
"react": {
14+
"version": "latest"
15+
}
16+
},
17+
"rules": {
18+
"camelcase": [
19+
"error",
20+
{
21+
"properties": "always"
22+
}
23+
],
24+
"require-jsdoc": [
25+
"error",
26+
{
27+
"require": {
28+
"FunctionDeclaration": true,
29+
"MethodDefinition": true,
30+
"ClassDeclaration": true
31+
}
32+
}
33+
],
34+
"valid-jsdoc": [
35+
"error",
36+
{
37+
"requireReturn": false,
38+
"preferType": {
39+
"String": "string",
40+
"Object": "object",
41+
"Number": "number",
42+
"Function": "function",
43+
"Void": "void"
44+
}
45+
}
46+
],
47+
"quotes": [
48+
"error",
49+
"single",
50+
"avoid-escape"
51+
],
52+
"key-spacing": [
53+
"error",
54+
{
55+
"singleLine": {
56+
"beforeColon": false,
57+
"afterColon": true
58+
},
59+
"multiLine": {
60+
"beforeColon": false,
61+
"afterColon": true
62+
}
63+
}
64+
],
65+
"no-magic-numbers": [
66+
"error",
67+
{
68+
"ignoreArrayIndexes": true
69+
}
70+
],
71+
"eqeqeq": "error",
72+
"block-scoped-var": "error",
73+
"complexity": [
74+
"error",
75+
{
76+
"maximum": 20
77+
}
78+
],
79+
"curly": "error",
80+
"default-case": "error",
81+
"dot-location": [
82+
"error",
83+
"property"
84+
],
85+
"guard-for-in": "error",
86+
"no-eval": "error",
87+
"block-spacing": "error",
88+
"brace-style": "error",
89+
"comma-spacing": [
90+
"error",
91+
{
92+
"before": false,
93+
"after": true
94+
}
95+
],
96+
"id-length": [
97+
"error",
98+
{
99+
"min": 2,
100+
"properties": "never",
101+
"exceptions": [
102+
"$"
103+
]
104+
}
105+
],
106+
"indent": [
107+
"error",
108+
"tab",
109+
{
110+
"MemberExpression": "off"
111+
}
112+
],
113+
"space-before-function-paren": [
114+
"error",
115+
"never"
116+
],
117+
"space-before-blocks": "error",
118+
"prefer-const": "error",
119+
"no-var": "error",
120+
"arrow-body-style": "off",
121+
"arrow-spacing": "error",
122+
"strict": [
123+
"error"
124+
],
125+
"no-warning-comments": [
126+
"warn",
127+
{
128+
"terms": [
129+
"todo",
130+
"fixme",
131+
"hack"
132+
],
133+
"location": "anywhere"
134+
}
135+
],
136+
"semi": [
137+
"error"
138+
],
139+
"react/react-in-jsx-scope": "off",
140+
"react/prop-types": "off",
141+
"react/display-name": "off"
142+
},
143+
"parserOptions": {
144+
"sourceType": "module",
145+
"ecmaVersion": 2018
146+
},
147+
"globals": {
148+
"markerAnimationParams": true,
149+
"wp": true
150+
}
151+
}

assets/js/.gitignore

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
node_modules/
2-
src/
3-
v8-compile-cache-0/
4-
5-
gutenberg.config.js
6-
editor.config.js
7-
marker-animation.config.js
8-
package.json
9-
package-lock.json
2+
coverage/
3+
.nyc_output/

assets/js/.htaccess

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Order Deny,Allow
2+
Deny from all
3+
4+
#allow access to assets
5+
<Files *.min.js>
6+
Allow from all
7+
</Files>

assets/js/gutenberg.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const webpack = require( 'webpack' );
2+
const pkg = require( './package' );
3+
4+
const banner = `${ pkg.name }-gutenberg ${ pkg.version }\nCopyright (c) ${ new Date().getFullYear() } ${ pkg.author }\nLicense: ${ pkg.license }`;
5+
6+
const webpackConfig = {
7+
context: __dirname + '/src/gutenberg',
8+
entry: './index.js',
9+
output: {
10+
path: __dirname,
11+
filename: `${ pkg.name }-gutenberg.min.js`,
12+
},
13+
module: {
14+
rules: [
15+
{
16+
test: /\.js$/,
17+
exclude: /node_modules/,
18+
loader: 'babel-loader',
19+
},
20+
],
21+
},
22+
plugins: [
23+
new webpack.BannerPlugin( banner ),
24+
new webpack.DefinePlugin( {
25+
'PLUGIN_NAME': JSON.stringify( `${ pkg.name }` ),
26+
'PARAMETER_NAME': JSON.stringify( 'markerAnimationParams' ),
27+
} ),
28+
],
29+
};
30+
31+
module.exports = webpackConfig;

assets/js/marker-animation-gutenberg.min.js

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const webpack = require( 'webpack' );
2+
const pkg = require( './package' );
3+
4+
const banner = `${ pkg.name } ${ pkg.version } - ${ pkg.description }\nCopyright (c) ${ new Date().getFullYear() } ${ pkg.author }\nLicense: ${ pkg.license }`;
5+
6+
const webpackConfig = {
7+
context: __dirname + '/src/marker-animation',
8+
entry: './index.js',
9+
output: {
10+
path: __dirname,
11+
filename: `${ pkg.name }.min.js`,
12+
},
13+
module: {
14+
rules: [
15+
{
16+
test: /\.js$/,
17+
exclude: /node_modules/,
18+
loader: 'babel-loader',
19+
},
20+
],
21+
},
22+
externals: {
23+
jquery: 'jQuery',
24+
},
25+
plugins: [
26+
new webpack.BannerPlugin( banner ),
27+
],
28+
};
29+
30+
module.exports = webpackConfig;

assets/js/marker-animation.min.js

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

0 commit comments

Comments
 (0)