setmy-info-less-extended 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cucumber.js ADDED
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ default: [
3
+ `--format-options '{"snippetInterface": "synchronous"}'`,
4
+ '--require ./src/test/js/bdd/given.js',
5
+ '--require ./src/test/js/bdd/when.js',
6
+ '--require ./src/test/js/bdd/then.js',
7
+ './src/test/gherkin'
8
+ ].join(' ')
9
+ };
package/dist/main.css ADDED
@@ -0,0 +1,76 @@
1
+ /* values/main.less */
2
+ /* values/colors/main.less */
3
+ /* values/fonts/main.less */
4
+ body.framesDefaultPadding {
5
+ height: calc(100% - 0px);
6
+ width: calc(100% - 0px);
7
+ padding: 0px;
8
+ }
9
+ .contentHeader {
10
+ width: 100%;
11
+ height: 50px;
12
+ }
13
+ .defaultHeader {
14
+ width: 100%;
15
+ height: 25px;
16
+ }
17
+ .content {
18
+ width: 100%;
19
+ height: calc(100% - 75px);
20
+ }
21
+ .contentFooter {
22
+ width: 100%;
23
+ height: 25px;
24
+ }
25
+ .sectionLeft {
26
+ width: calc(30% - 8px - 4px);
27
+ height: 100%;
28
+ }
29
+ .verticalSeparator {
30
+ width: 8px;
31
+ height: 100%;
32
+ display: block;
33
+ }
34
+ .sectionRight {
35
+ width: 70%;
36
+ height: 100%;
37
+ }
38
+ .sectionHeader {
39
+ width: 100%;
40
+ height: 25px;
41
+ }
42
+ .sectionLeftUp {
43
+ width: 100%;
44
+ height: calc(60% - 4px - 8px);
45
+ }
46
+ .contentLeftUp {
47
+ width: 100%;
48
+ height: calc(100% - 25px);
49
+ }
50
+ .horizontalSeparator {
51
+ height: 4px;
52
+ }
53
+ .sectionLeftBottom {
54
+ width: 100%;
55
+ height: calc(40%);
56
+ }
57
+ .contentLeftBottom {
58
+ width: 100%;
59
+ height: calc(100% - 25px);
60
+ }
61
+ .sectionRightUp {
62
+ width: 100%;
63
+ height: 30%;
64
+ }
65
+ .contentRightUp {
66
+ width: 100%;
67
+ height: calc(100% - 25px);
68
+ }
69
+ .sectionRightBottom {
70
+ width: 100%;
71
+ height: calc(70% - 4px - 8px);
72
+ }
73
+ .contentRightBottom {
74
+ width: 100%;
75
+ height: calc(100% - 25px);
76
+ }
@@ -0,0 +1 @@
1
+ body.framesDefaultPadding{height:calc(100% - 0px);width:calc(100% - 0px);padding:0}.contentHeader{width:100%;height:50px}.defaultHeader{width:100%;height:25px}.content{width:100%;height:calc(100% - 75px)}.contentFooter{width:100%;height:25px}.sectionLeft{width:calc(30% - 8px - 4px);height:100%}.verticalSeparator{width:8px;height:100%;display:block}.sectionRight{width:70%;height:100%}.sectionHeader{width:100%;height:25px}.sectionLeftUp{width:100%;height:calc(60% - 4px - 8px)}.contentLeftUp{width:100%;height:calc(100% - 25px)}.horizontalSeparator{height:4px}.sectionLeftBottom{width:100%;height:calc(40%)}.contentLeftBottom{width:100%;height:calc(100% - 25px)}.sectionRightUp{width:100%;height:30%}.contentRightUp{width:100%;height:calc(100% - 25px)}.sectionRightBottom{width:100%;height:calc(70% - 4px - 8px)}.contentRightBottom{width:100%;height:calc(100% - 25px)}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "setmy-info-less-extended",
3
+ "version": "3.0.0",
4
+ "description": "SMI LESS project",
5
+ "main": "dist/main.min.css",
6
+ "dependencies": {
7
+ "setmy-info-less": "*"
8
+ },
9
+ "scripts": {
10
+ "build": "npm run css && npm run css-min && npm run html",
11
+ "build:experimental": "npm run css:experimental",
12
+ "css": "lessc ./src/main/less/main.less dist/main.css",
13
+ "css:experimental": "lessc ./src/main/less/experimental/main.less dist/experimental.css",
14
+ "css-min": "lessc ./src/main/less/main.less dist/main.min.css --clean-css",
15
+ "css:debug": "lessc --modify-var=debug=true ./src/main/less/main.less dist/main.css",
16
+ "html": "node ./src/test/js/pugBuild.js",
17
+ "start": "node ./src/test/js/server.js",
18
+ "watch": "less-watch-compiler ./src/main/less dist main.less",
19
+ "watch:pug": "node ./src/test/js/pugWatch.js",
20
+ "clean": "rimraf dist",
21
+ "clean:all": "rimraf dist node_modules",
22
+ "verify": "npm test && npm run e2e && npm run lint:less && npm run cucumber",
23
+ "test": "jest",
24
+ "e2e": "npx playwright test --config=playwright.config.js",
25
+ "e2e:one": "npx playwright test --config=playwright.config.js",
26
+ "cucumber": "cucumber-js",
27
+ "lint:less": "stylelint ./src/main/less/**/*.less",
28
+ "lint:fix-less": "stylelint ./src/main/less/**/*.less --fix"
29
+ },
30
+ "keywords": [
31
+ "less",
32
+ "css",
33
+ "pug",
34
+ "playwright",
35
+ "jest"
36
+ ],
37
+ "author": "Imre Tabur <imre.tabur@mail.ee>",
38
+ "license": "MIT",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/setmy-info/setmy-info-less.git"
42
+ },
43
+ "homepage": "https://github.com/setmy-info/setmy-info-less",
44
+ "devDependencies": {
45
+ "@cucumber/cucumber": "^12.6.0",
46
+ "@playwright/test": "^1.53.1",
47
+ "express": "^5.1.0",
48
+ "jest": "^30.2.0",
49
+ "less": "^4.3.0",
50
+ "less-plugin-clean-css": "^1.6.0",
51
+ "less-watch-compiler": "^1.16.3",
52
+ "playwright": "^1.53.1",
53
+ "postcss-less": "^6.0.0",
54
+ "pug": "^3.0.3",
55
+ "rimraf": "^6.0.1",
56
+ "stylelint": "^16.21.1",
57
+ "stylelint-config-standard": "^38.0.0",
58
+ "stylelint-less": "^3.0.1"
59
+ }
60
+ }
@@ -0,0 +1,16 @@
1
+ const {defineConfig} = require('@playwright/test');
2
+ const firefoxHelper = require('./src/test/js/firefoxHelper');
3
+
4
+ const firefoxPath = firefoxHelper.getFirefoxPath();
5
+
6
+ module.exports = defineConfig({
7
+ testDir: 'src/test/js',
8
+ timeout: 30000,
9
+ retries: 0,
10
+ use: {
11
+ headless: false,
12
+ browserName: 'firefox',
13
+ executablePath: firefoxPath
14
+ },
15
+ testMatch: '**/*.e2e.js'
16
+ });
@@ -0,0 +1,35 @@
1
+ .AliceBlue {
2
+ background: @blue-300;
3
+ }
4
+
5
+ .MoreBlue {
6
+ background: @blue-600;
7
+ }
8
+
9
+ .blanchedalmond {
10
+ background: blanchedalmond;
11
+ }
12
+
13
+ .Aquamarine {
14
+ background: Aquamarine;
15
+ }
16
+
17
+ .Beige {
18
+ background: Beige;
19
+ }
20
+
21
+ .Bisque {
22
+ background: Bisque;
23
+ }
24
+
25
+ .BurlyWood {
26
+ background: BurlyWood;
27
+ }
28
+
29
+ .Cornsilk {
30
+ background: Cornsilk;
31
+ }
32
+
33
+ .Cyan {
34
+ background: Cyan;
35
+ }
@@ -0,0 +1,3 @@
1
+ /* experimental.less */
2
+ @import url("../../../../../setmy-info-less/src/main/less/values/index.less");
3
+ @import url("experimental-frames-colors.less");
@@ -0,0 +1,115 @@
1
+ @numberOfMenuPanels: 2;
2
+ @headerHeight: @numberOfMenuPanels * @halfDefaultHeight;
3
+ @footerHeight: @halfDefaultHeight;
4
+
5
+ @sectionHeaderHeight: @halfDefaultHeight;
6
+
7
+ @verticalSeparatorWidth: 8px;
8
+ @horizontalSeparatorHeight: 4px;
9
+
10
+ @paddingValue: 0px;
11
+ @doublePaddingValue: @paddingValue * 2;
12
+
13
+ @headerFooterSum: @headerHeight + @footerHeight;
14
+
15
+ body.framesDefaultPadding {
16
+ height: calc(100% - @doublePaddingValue);
17
+ width: calc(100% - @doublePaddingValue);
18
+ padding: @paddingValue;
19
+ }
20
+
21
+ .contentHeader {
22
+ width: 100%;
23
+ height: @headerHeight;
24
+ }
25
+
26
+ .defaultHeader {
27
+ width: 100%;
28
+ height: @halfDefaultHeight
29
+ }
30
+
31
+ .content {
32
+ width: 100%;
33
+ height: calc(100% - @headerFooterSum);
34
+ }
35
+
36
+ .contentFooter {
37
+ width: 100%;
38
+ height: @footerHeight;
39
+ }
40
+
41
+ @leftWidth: 30%;
42
+ @rightWidth: 100% - @leftWidth;
43
+
44
+ .sectionLeft {
45
+ width: calc(@leftWidth - @verticalSeparatorWidth - @defaultBorderVerticalAmount);
46
+ height: 100%;
47
+ }
48
+
49
+ .verticalSeparator {
50
+ width: @verticalSeparatorWidth;
51
+ height: 100%;
52
+ display: block;
53
+ }
54
+
55
+ .sectionRight {
56
+ width: @rightWidth;
57
+ height: 100%;
58
+ }
59
+
60
+ .sectionHeader {
61
+ width: 100%;
62
+ height: @sectionHeaderHeight;
63
+ }
64
+
65
+ @contentLeftUpHeight: 60%;
66
+ @contentLeftBottomHeight: 100% - @contentLeftUpHeight;
67
+ @doubleDefaultBorderHorizontalAmount: 2 * @defaultBorderHorizontalAmount;
68
+ @x: @horizontalSeparatorHeight - @doubleDefaultBorderHorizontalAmount;
69
+
70
+ .sectionLeftUp {
71
+ width: 100%;
72
+ height: calc(@contentLeftUpHeight - @horizontalSeparatorHeight - @doubleDefaultBorderHorizontalAmount);
73
+ }
74
+
75
+ .contentLeftUp {
76
+ width: 100%;
77
+ height: calc(100% - @sectionHeaderHeight);
78
+ }
79
+
80
+ .horizontalSeparator {
81
+ height: @horizontalSeparatorHeight;
82
+ }
83
+
84
+ .sectionLeftBottom {
85
+ width: 100%;
86
+ height: calc(@contentLeftBottomHeight);
87
+ }
88
+
89
+ .contentLeftBottom {
90
+ width: 100%;
91
+ height: calc(100% - @sectionHeaderHeight);
92
+ }
93
+
94
+ @contentRightUpHeight: 30%;
95
+ @contentRightBottomHeight: 100% - @contentRightUpHeight;
96
+
97
+ .sectionRightUp {
98
+ width: 100%;
99
+ height: @contentRightUpHeight;
100
+ }
101
+
102
+ .contentRightUp {
103
+ width: 100%;
104
+ height: calc(100% - @sectionHeaderHeight);
105
+ }
106
+
107
+ .sectionRightBottom {
108
+ width: 100%;
109
+ height: calc(@contentRightBottomHeight - @horizontalSeparatorHeight - @doubleDefaultBorderHorizontalAmount);
110
+ }
111
+
112
+ .contentRightBottom {
113
+ width: 100%;
114
+ height: calc(100% - @sectionHeaderHeight);
115
+ }
@@ -0,0 +1,3 @@
1
+ @import url("../../../../setmy-info-less/src/main/less/values/index.less");
2
+ @import url("frames/index.less");
3
+
@@ -0,0 +1,20 @@
1
+ Feature: body page
2
+
3
+ Scenario: body rendering with specific properties
4
+ Given page name is "body"
5
+ When page is rendered
6
+ And page element ID is "body"
7
+ Then page should have title "body.html"
8
+ And page element margin should be "0px 0px 0px 0px"
9
+ And page element padding should be "0px 0px 0px 0px"
10
+ And page element font family should be "DejaVu Serif, Roboto, Arial, Noto Sans, Noto, sans-serif"
11
+ And page element font size should be "16px"
12
+ And page element X should be 0
13
+ And page element Y should be 0
14
+ And page element WIDTH should be 2000
15
+ And page element HEIGHT should be 1200
16
+ And page element TOP should be 0
17
+ And page element LEFT should be 0
18
+ And page element background color should be "rgba(0, 0, 0, 0)"
19
+ And page element color should be "rgb(0, 0, 0)"
20
+ And page is closed
@@ -0,0 +1,7 @@
1
+ const {Given} = require('@cucumber/cucumber');
2
+ const pageHelper = require('../pageHelper');
3
+
4
+ Given('page name is {string}', function (name) {
5
+ pageHelper.pageName(name);
6
+ pageHelper.getPath();
7
+ });
@@ -0,0 +1,60 @@
1
+ const {Then} = require('@cucumber/cucumber');
2
+ const {expect} = require('@playwright/test');
3
+ const pageHelper = require('../pageHelper');
4
+
5
+ Then('page should have title {string}', async function (expectedTitle) {
6
+ const title = await pageHelper.data.page.title();
7
+ expect(title).toBe(expectedTitle);
8
+ });
9
+
10
+ Then('page element margin should be {string}', function (expectedMargin) {
11
+ expect(pageHelper.data.computedStyles.margin).toBe(expectedMargin);
12
+ });
13
+
14
+ Then('page element padding should be {string}', async function (expectedPadding) {
15
+ expect(pageHelper.data.computedStyles.padding).toBe(expectedPadding);
16
+ });
17
+
18
+ Then('page element font family should be {string}', async function (expectedFontFamily) {
19
+ expect(pageHelper.data.computedStyles.fontFamily).toBe(expectedFontFamily);
20
+ });
21
+
22
+ Then('page element font size should be {string}', async function (expectedFontSize) {
23
+ expect(pageHelper.data.computedStyles.fontSize).toBe(expectedFontSize);
24
+ });
25
+
26
+ Then('page element X should be {int}', async function (expectedX) {
27
+ expect(pageHelper.data.computedStyles.x).toBe(expectedX);
28
+ });
29
+
30
+ Then('page element Y should be {int}', async function (expectedY) {
31
+ expect(pageHelper.data.computedStyles.y).toBe(expectedY);
32
+ });
33
+
34
+ Then('page element WIDTH should be {int}', async function (expectedWidth) {
35
+ expect(pageHelper.data.computedStyles.width).toBe(expectedWidth);
36
+ });
37
+
38
+ Then('page element HEIGHT should be {int}', async function (expectedHeight) {
39
+ expect(pageHelper.data.computedStyles.height).toBe(expectedHeight);
40
+ });
41
+
42
+ Then('page element TOP should be {int}', async function (expectedTop) {
43
+ expect(pageHelper.data.computedStyles.top).toBe(expectedTop);
44
+ });
45
+
46
+ Then('page element LEFT should be {int}', async function (expectedLeft) {
47
+ expect(pageHelper.data.computedStyles.left).toBe(expectedLeft);
48
+ });
49
+
50
+ Then('page element background color should be {string}', async function (expectedBackColor) {
51
+ expect(pageHelper.data.computedStyles.backgroundColor).toBe(expectedBackColor);
52
+ });
53
+
54
+ Then('page element color should be {string}', async function (expectedColor) {
55
+ expect(pageHelper.data.computedStyles.color).toBe(expectedColor);
56
+ });
57
+
58
+ Then('page is closed', async function () {
59
+ await pageHelper.pageClose();
60
+ });
@@ -0,0 +1,10 @@
1
+ const {When} = require('@cucumber/cucumber');
2
+ const pageHelper = require('../pageHelper');
3
+
4
+ When('page is rendered', async function () {
5
+ await pageHelper.pageIsRendered();
6
+ });
7
+
8
+ When('page element ID is {string}', async function (elementId) {
9
+ await pageHelper.elementIdIs(elementId);
10
+ });
@@ -0,0 +1,38 @@
1
+ const {test, expect} = require('@playwright/test');
2
+ const pageHelper = require('../pageHelper');
3
+ const getTestPageName = require('../testPageName');
4
+
5
+ const pageName = getTestPageName();
6
+
7
+ test.describe(pageName + ' page layout tests', async () => {
8
+
9
+ test.beforeAll(async () => {
10
+ pageHelper.pageName(pageName);
11
+ pageHelper.getPath();
12
+ await pageHelper.pageIsRendered();
13
+ });
14
+
15
+ test('should load the page and check title', async () => {
16
+
17
+ const title = await pageHelper.data.page.title();
18
+ expect(title).toBe('body.html');
19
+
20
+ await pageHelper.elementExpectations(
21
+ 'body',
22
+ {
23
+ margin: '0px 0px 0px 0px',
24
+ padding: '0px 0px 0px 0px',
25
+ fontFamily: 'DejaVu Serif, Roboto, Arial, Noto Sans, Noto, sans-serif',
26
+ fontSize: '16px',
27
+ x: 0,
28
+ y: 0,
29
+ width: 2000,
30
+ height: 1200,
31
+ top: 0,
32
+ left: 0,
33
+ backgroundColor: 'rgba(0, 0, 0, 0)',
34
+ color: 'rgb(0, 0, 0)'
35
+ }
36
+ );
37
+ });
38
+ });
@@ -0,0 +1,17 @@
1
+ const os = require('os');
2
+ const path = require('path');
3
+
4
+ function getFirefoxPath() {
5
+ let firefoxPath;
6
+ if (os.platform() === 'win32') {
7
+ firefoxPath = path.join('C:', 'Program Files', 'Mozilla Firefox', 'firefox.exe');
8
+ } else if (os.platform() === 'linux') {
9
+ firefoxPath = '/opt/firefox/firefox';
10
+ }
11
+ console.log("Firefox path: ", firefoxPath)
12
+ return firefoxPath;
13
+ }
14
+
15
+ module.exports = {
16
+ getFirefoxPath
17
+ };
@@ -0,0 +1,102 @@
1
+ //const pugTranspile = require('./pugTranspile');
2
+ const path = require("path");
3
+ const {firefox} = require('playwright');
4
+ const firefoxHelper = require("./firefoxHelper");
5
+ const {expect} = require("@playwright/test");
6
+
7
+ const data = {
8
+ browserConfig: {
9
+ headless: false,
10
+ firefoxPath: firefoxHelper.getFirefoxPath()
11
+ },
12
+ windowConfig: {
13
+ viewport: {width: 2000, height: 1200}
14
+ },
15
+ };
16
+
17
+ function pageName(name) {
18
+ data.name = name;
19
+ }
20
+
21
+ function getPath() {
22
+ const filePath = 'file://' + path.resolve(__dirname, '../../../dist/' + data.name + '.html');
23
+ data.filePath = filePath;
24
+ return data.filePath;
25
+ }
26
+
27
+ async function pageIsRendered() {
28
+ data.browser = await firefox.launch(data.browserConfig);
29
+ data.context = await data.browser.newContext(data.windowConfig);
30
+ data.page = await data.context.newPage();
31
+ await data.page.goto(data.filePath);
32
+ }
33
+
34
+ async function elementExpectations(elementId, exp) {
35
+ await elementIdIs(elementId);
36
+ expectations(exp);
37
+ }
38
+
39
+ async function elementIdIs(elementId) {
40
+ data.elementId = elementId;
41
+ data.selector = `#${data.elementId}`;
42
+ data.elementHandle = await data.page.$(data.selector);
43
+ if (!data.elementHandle) {
44
+ throw new Error(`Element with ID '${data.elementId}' not found`);
45
+ }
46
+ data.computedStyles = await data.page.evaluate((sel) => {
47
+ const el = document.querySelector(sel);
48
+ const style = window.getComputedStyle(el);
49
+ const rect = el.getBoundingClientRect();
50
+ const allStyles = {};
51
+ for (let i = 0; i < style.length; i++) {
52
+ const prop = style[i];
53
+ allStyles[prop] = style.getPropertyValue(prop);
54
+ }
55
+ return {
56
+ margin: `${style.marginTop} ${style.marginRight} ${style.marginBottom} ${style.marginLeft}`,
57
+ padding: `${style.paddingTop} ${style.paddingRight} ${style.paddingBottom} ${style.paddingLeft}`,
58
+ fontFamily: style.fontFamily,
59
+ fontSize: style.fontSize,
60
+ x: rect.x,
61
+ y: rect.y,
62
+ top: Math.round(rect.top),
63
+ left: Math.round(rect.left),
64
+ width: Math.round(rect.width),
65
+ height: Math.round(rect.height),
66
+ backgroundColor: style.backgroundColor,
67
+ color: style.color,
68
+ allStyles: allStyles
69
+ };
70
+ }, data.selector);
71
+ }
72
+
73
+ function expectations(ex) {
74
+ expect(data.computedStyles.margin).toBe(ex.margin);
75
+ expect(data.computedStyles.padding).toBe(ex.padding);
76
+ expect(data.computedStyles.fontFamily).toContain(ex.fontFamily);
77
+ expect(data.computedStyles.fontSize).toBe(ex.fontSize);
78
+ expect(data.computedStyles.width).toBe(ex.width);
79
+ expect(data.computedStyles.height).toBe(ex.height);
80
+ expect(data.computedStyles.backgroundColor).toBe(ex.backgroundColor);
81
+ expect(data.computedStyles.color).toBe(ex.color);
82
+ expect(data.computedStyles.top).toBe(ex.top);
83
+ expect(data.computedStyles.left).toBe(ex.left);
84
+ expect(data.computedStyles.x).toBe(ex.x);
85
+ expect(data.computedStyles.y).toBe(ex.y);
86
+ }
87
+
88
+ async function pageClose() {
89
+ await data.page.close();
90
+ await data.browser.close();
91
+ }
92
+
93
+ module.exports = {
94
+ pageName,
95
+ getPath,
96
+ pageIsRendered,
97
+ elementIdIs,
98
+ data,
99
+ expectations,
100
+ elementExpectations,
101
+ pageClose
102
+ };
@@ -0,0 +1,37 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const pugTranspile = require('./pugTranspile');
4
+
5
+ const inputDir = path.join(__dirname, '../pug');
6
+ const partialsDir = path.join(inputDir, 'partials');
7
+
8
+ function getPartials() {
9
+ return fs.readdirSync(partialsDir)
10
+ .filter(file => file.endsWith('.pug'))
11
+ .map(file => path.basename(file, '.pug'));
12
+ }
13
+
14
+ function main() {
15
+ const dir = inputDir;
16
+ const files = fs.readdirSync(dir);
17
+ files.forEach((file) => {
18
+ const filePath = path.join(dir, file);
19
+ const stat = fs.statSync(filePath);
20
+ if (stat.isFile() && file.endsWith('.pug')) {
21
+ const pageName = path.basename(filePath, path.extname(filePath));
22
+ if (pageName === "main") {
23
+ const partials = getPartials();
24
+ for (const partial of partials) {
25
+ pugTranspile.transpileHtml(pageName, {
26
+ title: partial + '.html',
27
+ page: partial
28
+ });
29
+ }
30
+ } else {
31
+ pugTranspile.transpileHtml(pageName, {title: pageName + ".html"});
32
+ }
33
+ }
34
+ });
35
+ }
36
+
37
+ main();
@@ -0,0 +1,16 @@
1
+ const pug = require('pug');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+
5
+ function transpileHtml(name, locals = {}) {
6
+ const outputName = locals.page || name;
7
+ const pugFile = path.join(__dirname, '../pug/' + name + ".pug");
8
+ const htmlFile = path.join(__dirname, '../../../dist/' + outputName + ".html");
9
+ const compiledFunction = pug.compileFile(pugFile);
10
+ fs.writeFileSync(htmlFile, compiledFunction(locals));
11
+ console.log(`✔ Compiled: ${pugFile} → ${htmlFile}`);
12
+ }
13
+
14
+ module.exports = {
15
+ transpileHtml
16
+ };
@@ -0,0 +1,23 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const pugTranspile = require('./pugTranspile');
4
+
5
+ const inputDir = path.join(__dirname, '../pug');
6
+
7
+ function main() {
8
+ console.log('Watching .pug files for changes...');
9
+
10
+ fs.watch(inputDir, {recursive: false}, (eventType, filename) => {
11
+ if (filename && filename.endsWith('.pug')) {
12
+ const pageName = path.basename(filename, path.extname(filename));
13
+ console.log(`Rebuilding ${filename}...`);
14
+ try {
15
+ pugTranspile.transpileHtml(pageName, {title: pageName + ".html"});
16
+ } catch (e) {
17
+ console.error(e);
18
+ }
19
+ }
20
+ });
21
+ }
22
+
23
+ main();
@@ -0,0 +1,15 @@
1
+ const express = require('express');
2
+ const path = require('path');
3
+
4
+ const app = express();
5
+ const port = 3000;
6
+
7
+ app.use(express.static(path.join(__dirname, '../../../dist')));
8
+
9
+ app.get('/', (req, res) => {
10
+ res.sendFile(path.join(__dirname, '../../../dist', 'index.html'));
11
+ });
12
+
13
+ app.listen(port, () => {
14
+ console.log(`Server listening at http://localhost:${port}`);
15
+ });
@@ -0,0 +1,10 @@
1
+ const path = require('path');
2
+
3
+ module.exports = function getTestPageName() {
4
+ const caller = new Error().stack
5
+ .split('\n')[2]
6
+ .match(/\(([^)]+)\)/)?.[1] || '';
7
+ const fileName = path.basename(caller);
8
+ const pageName = fileName.split('.')[0];
9
+ return pageName;
10
+ };
@@ -0,0 +1,5 @@
1
+ describe('Something', () => {
2
+ test('should have the correct TRUE', () => {
3
+ expect(true).toBe(true);
4
+ });
5
+ });
@@ -0,0 +1,4 @@
1
+ doctype html
2
+ html(lang="en")
3
+ include include/head.pug
4
+ body(id="body")
@@ -0,0 +1,9 @@
1
+ head(id="head")
2
+ title #{title}
3
+ meta(charset="UTF-8")
4
+ meta(name="viewport", content="width=device-width, initial-scale=1.0")
5
+ meta(name="description", content="HTML 5 CSS test pages")
6
+ meta(name="author", content="Imre Tabur")
7
+ link(rel="stylesheet", type="text/css", href="../../setmy-info-less/dist/main.css")
8
+ link(rel="stylesheet", type="text/css", href="main.css")
9
+ link(rel="stylesheet", type="text/css", href="experimental.css")
@@ -0,0 +1,12 @@
1
+ doctype html
2
+ html(lang="en")
3
+ include include/head.pug
4
+ body(id="body" class="framesDefaultPadding")
5
+ app(id="app")
6
+ div(id="application")
7
+ if page == 'abc'
8
+ include ./partials/abc.pug
9
+ else if page == "experimental-frames"
10
+ include ./partials/experimental-frames.pug
11
+ else
12
+ div Error. Page Not found.
@@ -0,0 +1 @@
1
+ span Hello World
@@ -0,0 +1,100 @@
1
+ header(class="contentHeader AliceBlue")
2
+ menu
3
+ li(class="floatLeft Aquamarine halfHeight") Floating left A
4
+ li(class="floatLeft Aquamarine halfHeight") Floating left B
5
+ li(class="floatRight Aquamarine halfHeight") Floating right B
6
+ li(class="floatRight Aquamarine halfHeight") Floating right A
7
+ li(class="floatClear")
8
+ menu
9
+ li(class="floatLeft Aquamarine halfHeight") Floating left A
10
+ li(class="floatLeft Aquamarine halfHeight") Floating left B
11
+ li(class="floatRight Aquamarine halfHeight") Floating right B
12
+ li(class="floatRight Aquamarine halfHeight") Floating right A
13
+ li(class="floatClear")
14
+ main(class="content")
15
+ section(class="sectionLeft floatLeft")
16
+ div(class="sectionLeftUp defaultBorder")
17
+ header(class="sectionHeader AliceBlue")
18
+ menu
19
+ li(class="floatLeft Aquamarine halfHeight") A
20
+ li(class="floatLeft Aquamarine halfHeight") B
21
+ li(class="floatRight Aquamarine halfHeight") B
22
+ li(class="floatRight Aquamarine halfHeight") A
23
+ li(class="floatClear")
24
+ div(class="contentLeftUp noWrap autoScrollBars Beige")
25
+ include lines
26
+ div(id="horizontalLeftDivider" class="horizontalSeparator cursorHorizontalResize")
27
+ div(class="sectionLeftBottom defaultBorder")
28
+ header(class="sectionHeader AliceBlue")
29
+ menu
30
+ li(class="floatLeft Aquamarine halfHeight") A
31
+ li(class="floatLeft Aquamarine halfHeight") B
32
+ li(class="floatRight Aquamarine halfHeight") B
33
+ li(class="floatRight Aquamarine halfHeight") A
34
+ li(class="floatClear")
35
+ div(class="contentLeftBottom noWrap autoScrollBars Bisque")
36
+ include lines
37
+ div(id="verticalDivider" class="verticalSeparator cursorVerticalResize floatLeft")
38
+ section(class="sectionRight floatLeft")
39
+ div(class="sectionRightUp defaultBorder")
40
+ header(class="sectionHeader AliceBlue")
41
+ menu
42
+ li(class="floatLeft Aquamarine halfHeight") A
43
+ li(class="floatLeft Aquamarine halfHeight") B
44
+ li(class="floatRight Aquamarine halfHeight") B
45
+ li(class="floatRight Aquamarine halfHeight") A
46
+ li(class="floatClear")
47
+ div(class="contentRightUp noWrap autoScrollBars BurlyWood")
48
+ include lines
49
+ div(id="horizontalRightDivider" class="horizontalSeparator cursorHorizontalResize")
50
+ div(class="sectionRightBottom defaultBorder")
51
+ header(class="sectionHeader AliceBlue")
52
+ menu
53
+ li(class="floatLeft Aquamarine halfHeight") A
54
+ li(class="floatLeft Aquamarine halfHeight") B
55
+ li(class="floatRight Aquamarine halfHeight") B
56
+ li(class="floatRight Aquamarine halfHeight") A
57
+ li(class="floatClear")
58
+ div(class="contentRightBottom noWrap autoScrollBars Cornsilk")
59
+ include lines
60
+ div(class="floatClear")
61
+ footer(class="contentFooter AliceBlue")
62
+ menu
63
+ li(class="floatLeft Aquamarine halfHeight") Floating left A
64
+ li(class="floatLeft Aquamarine halfHeight") Floating left B
65
+ li(class="floatRight Aquamarine halfHeight") Floating right B
66
+ li(class="floatRight Aquamarine halfHeight") Floating right A
67
+ li(class="floatClear")
68
+
69
+ script.
70
+ // Broken for window re-sizing.
71
+ const verticalDivider = document.getElementById('verticalDivider');
72
+ const leftPanel = document.querySelector('.sectionLeft');
73
+ const rightPanel = document.querySelector('.sectionRight');
74
+ const computedStyleLeft = window.getComputedStyle(leftPanel);
75
+ const computedStyleRight = window.getComputedStyle(rightPanel);
76
+ console.log(computedStyleLeft)
77
+ console.log(computedStyleRight)
78
+ let isDragging = false;
79
+ verticalDivider.addEventListener('mousedown', function (e) {
80
+ isDragging = true;
81
+ document.body.style.cursor = 'col-resize';
82
+ e.preventDefault();
83
+ });
84
+
85
+ document.addEventListener('mousemove', function (e) {
86
+ if (!isDragging) return;
87
+ const totalWidth = verticalDivider.parentElement.clientWidth;
88
+ const newLeftWidth = e.clientX;
89
+ const minWidth = 100;
90
+ if (newLeftWidth < minWidth || newLeftWidth > totalWidth - minWidth) return;
91
+ leftPanel.style.width = `${newLeftWidth}px`;
92
+ rightPanel.style.width = `${totalWidth - newLeftWidth - verticalDivider.offsetWidth}px`;
93
+ });
94
+
95
+ document.addEventListener('mouseup', function () {
96
+ if (isDragging) {
97
+ isDragging = false;
98
+ document.body.style.cursor = 'default';
99
+ }
100
+ });
@@ -0,0 +1,2 @@
1
+ - for (let i = 0; i < 50; i++)
2
+ div Left Up #{i} Longer Longer Longer Longer Longer Longer Longer Longer Longer
@@ -0,0 +1,21 @@
1
+ module.exports = {
2
+ customSyntax: 'postcss-less',
3
+ configBasedir: "src/main/less",
4
+ extends: [
5
+ 'stylelint-config-standard'
6
+ ],
7
+ rules: {
8
+ 'block-no-empty': null,//true
9
+ 'selector-class-pattern': null,
10
+ 'media-feature-range-notation': 'prefix',
11
+ 'declaration-property-value-no-unknown': null,
12
+ "selector-type-no-unknown": [true, {
13
+ ignoreTypes: ["app"]
14
+ }],
15
+ },
16
+ ignoreFiles: [
17
+ '**/node_modules/**',
18
+ '**/dist/**',
19
+ '**/experimental/**'
20
+ ]
21
+ };