kamrify commited on
Commit
8a554f1
Β·
1 Parent(s): a47eab3

Rearrange and update dev build script

Browse files
{assets/styles/scss β†’ demo}/base.scss RENAMED
File without changes
demo/demo.scss ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import "base";
2
+ @import "../src/sholo";
3
+
4
+ $container-width: 500px !default;
5
+ $logo-font-size: 55px !default;
6
+ $button-font-size: 13px !default;
7
+ $dark-button-bg: #2d2d2d !default;
8
+ $dark-button-text: #ffffff !default;
9
+ $light-button-bg: #f5f5f5 !default;
10
+ $light-button-text: #2d2d2d !default;
11
+
12
+ .page-wrap {
13
+ padding-top: 1px;
14
+ width: $container-width;
15
+ margin: auto;
16
+ }
17
+
18
+ .btn {
19
+ font-size: $button-font-size;
20
+ padding: 7px 10px;
21
+ border-radius: 3px;
22
+
23
+ &.btn__dark {
24
+ background: $dark-button-bg;
25
+ color: $dark-button-text;
26
+ }
27
+
28
+ &.btn__light {
29
+ background: $light-button-bg;
30
+ color: $light-button-text;
31
+ }
32
+ }
33
+
34
+ section {
35
+ margin-bottom: 35px;
36
+ }
37
+
38
+ .section__header {
39
+ margin: 80px 0 50px;
40
+ text-align: center;
41
+ display: block;
42
+ padding: 10px 10px 20px;
43
+
44
+ h1 {
45
+ font-size: $logo-font-size;
46
+ }
47
+ }
index.html CHANGED
@@ -6,7 +6,7 @@
6
  content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
7
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
8
  <title>Sholo</title>
9
- <link rel="stylesheet" href="./assets/styles/css/demo.css">
10
  </head>
11
  <body>
12
  <div class="page-wrap">
@@ -55,7 +55,7 @@
55
  </section>
56
  </div>
57
 
58
- <script src="./assets/scripts/dist/sholo.js"></script>
59
  <script>
60
  const sholo = new Sholo({
61
  animate: true,
@@ -85,7 +85,7 @@
85
  popover: {
86
  title: 'Adding Introductions',
87
  description: 'You can use it to add popovers on top of the website',
88
- position: 'right',
89
  },
90
  },
91
  {
 
6
  content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
7
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
8
  <title>Sholo</title>
9
+ <link rel="stylesheet" href="./dist/demo.css">
10
  </head>
11
  <body>
12
  <div class="page-wrap">
 
55
  </section>
56
  </div>
57
 
58
+ <script src="./dist/sholo.js"></script>
59
  <script>
60
  const sholo = new Sholo({
61
  animate: true,
 
85
  popover: {
86
  title: 'Adding Introductions',
87
  description: 'You can use it to add popovers on top of the website',
88
+ position: 'rig',
89
  },
90
  },
91
  {
postcss.config.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- autoprefixer: {},
4
- },
5
- };
 
 
 
 
 
 
{assets/scripts/src β†’ src/common}/constants.js RENAMED
File without changes
{assets/scripts/src β†’ src/common}/polyfill.js RENAMED
File without changes
{assets/scripts/src β†’ src/core}/element.js RENAMED
@@ -7,7 +7,7 @@ import Position from './position';
7
  export default class Element {
8
  /**
9
  * DOM element object
10
- * @param {Node} node
11
  * @param {Object} options
12
  * @param {Popover} popover
13
  * @param {Overlay} overlay
 
7
  export default class Element {
8
  /**
9
  * DOM element object
10
+ * @param {Node|HTMLElement} node
11
  * @param {Object} options
12
  * @param {Popover} popover
13
  * @param {Overlay} overlay
{assets/scripts/src β†’ src/core}/overlay.js RENAMED
@@ -1,5 +1,5 @@
1
  import Position from './position';
2
- import { ID_OVERLAY, OVERLAY_ZINDEX } from './constants';
3
 
4
  /**
5
  * Responsible for overlay creation and manipulation i.e.
 
1
  import Position from './position';
2
+ import { ID_OVERLAY, OVERLAY_ZINDEX } from '../common/constants';
3
 
4
  /**
5
  * Responsible for overlay creation and manipulation i.e.
{assets/scripts/src β†’ src/core}/popover.js RENAMED
@@ -8,7 +8,7 @@ import {
8
  CLASS_POPOVER_TITLE, CLASS_PREV_STEP_BTN,
9
  ID_POPOVER,
10
  POPOVER_HTML,
11
- } from './constants';
12
 
13
  /**
14
  * Popover that is displayed on top of the highlighted element
 
8
  CLASS_POPOVER_TITLE, CLASS_PREV_STEP_BTN,
9
  ID_POPOVER,
10
  POPOVER_HTML,
11
+ } from '../common/constants';
12
 
13
  /**
14
  * Popover that is displayed on top of the highlighted element
{assets/scripts/src β†’ src/core}/position.js RENAMED
File without changes
assets/scripts/src/sholo.js β†’ src/index.js RENAMED
@@ -1,7 +1,7 @@
1
- import Overlay from './overlay';
2
- import Element from './element';
3
- import './polyfill';
4
- import Popover from './popover';
5
  import {
6
  CLASS_CLOSE_BTN,
7
  CLASS_NEXT_STEP_BTN,
@@ -11,7 +11,7 @@ import {
11
  OVERLAY_ANIMATE,
12
  OVERLAY_OPACITY,
13
  OVERLAY_PADDING, RIGHT_KEY_CODE,
14
- } from './constants';
15
 
16
  /**
17
  * Plugin class that drives the plugin
 
1
+ import Overlay from './core/overlay';
2
+ import Element from './core/element';
3
+ import Popover from './core/popover';
4
+ import './common/polyfill';
5
  import {
6
  CLASS_CLOSE_BTN,
7
  CLASS_NEXT_STEP_BTN,
 
11
  OVERLAY_ANIMATE,
12
  OVERLAY_OPACITY,
13
  OVERLAY_PADDING, RIGHT_KEY_CODE,
14
+ } from './common/constants';
15
 
16
  /**
17
  * Plugin class that drives the plugin
assets/styles/scss/demo.scss β†’ src/sholo.scss RENAMED
@@ -1,51 +1,3 @@
1
- @import "base";
2
-
3
- $container-width: 500px !default;
4
- $logo-font-size: 55px !default;
5
- $button-font-size: 13px !default;
6
- $dark-button-bg: #2d2d2d !default;
7
- $dark-button-text: #ffffff !default;
8
- $light-button-bg: #f5f5f5 !default;
9
- $light-button-text: #2d2d2d !default;
10
-
11
- .page-wrap {
12
- padding-top: 1px;
13
- width: $container-width;
14
- margin: auto;
15
- }
16
-
17
- .btn {
18
- font-size: $button-font-size;
19
- padding: 7px 10px;
20
- border-radius: 3px;
21
-
22
- &.btn__dark {
23
- background: $dark-button-bg;
24
- color: $dark-button-text;
25
- }
26
-
27
- &.btn__light {
28
- background: $light-button-bg;
29
- color: $light-button-text;
30
- }
31
- }
32
-
33
- section {
34
- margin-bottom: 35px;
35
- }
36
-
37
- .section__header {
38
- margin: 80px 0 50px;
39
- text-align: center;
40
- display: block;
41
- padding: 10px 10px 20px;
42
-
43
- h1 {
44
- font-size: $logo-font-size;
45
- }
46
- }
47
-
48
- /////////////////////////////////////////
49
  div#sholo-popover-item {
50
  display: none;
51
  position: absolute;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  div#sholo-popover-item {
2
  display: none;
3
  position: absolute;
webpack.config.dev.js CHANGED
@@ -5,13 +5,13 @@ module.exports = {
5
  mode: 'development',
6
  entry: [
7
  'webpack-dev-server/client?http://localhost:3000',
8
- './assets/styles/scss/demo.scss',
9
- './assets/scripts/src/sholo.js',
10
  ],
11
  output: {
12
- path: path.join(__dirname, '/assets'),
13
- publicPath: '/assets/',
14
- filename: 'scripts/dist/sholo.js',
15
  libraryTarget: 'umd',
16
  library: 'Sholo',
17
  },
@@ -44,7 +44,7 @@ module.exports = {
44
  },
45
  plugins: [
46
  new ExtractTextPlugin({
47
- filename: 'styles/css/demo.css',
48
  allChunks: true,
49
  }),
50
  ],
 
5
  mode: 'development',
6
  entry: [
7
  'webpack-dev-server/client?http://localhost:3000',
8
+ './demo/demo.scss',
9
+ './src/index.js',
10
  ],
11
  output: {
12
+ path: path.join(__dirname, '/dist'),
13
+ publicPath: '/dist/',
14
+ filename: 'sholo.js',
15
  libraryTarget: 'umd',
16
  library: 'Sholo',
17
  },
 
44
  },
45
  plugins: [
46
  new ExtractTextPlugin({
47
+ filename: 'demo.css',
48
  allChunks: true,
49
  }),
50
  ],