mypgs 1.4.0 → 1.4.1
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/assets/javascript/index.js +3 -1
- package/assets/javascript/pgs.d.ts +6 -0
- package/assets/scss/index.scss +3 -3
- package/dist/index.d.ts +6 -0
- package/package.json +3 -2
- package/plugins/vite-plugin-pgs.js +14 -0
- package/templates/html/demo.js +6 -13
- /package/assets/javascript/{patterns → layout}/_header.js +0 -0
- /package/assets/scss/{patterns → layout}/_footer.scss +0 -0
- /package/assets/scss/{patterns → layout}/_header.scss +0 -0
- /package/templates/html/{patterns → layout}/footer.html +0 -0
- /package/templates/html/{patterns → layout}/header.html +0 -0
package/assets/scss/index.scss
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
@include meta.load-css("layout/grid");
|
|
24
24
|
@include meta.load-css("layout/pageShell");
|
|
25
25
|
@include meta.load-css("layout/gap");
|
|
26
|
+
@include meta.load-css("layout/header");
|
|
27
|
+
@include meta.load-css("layout/footer");
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
/*
|
|
@@ -56,7 +58,5 @@
|
|
|
56
58
|
|--------------------------------------------------------------------------
|
|
57
59
|
*/
|
|
58
60
|
[pgs~=initP] {
|
|
59
|
-
@include meta.load-css("patterns/header");
|
|
60
|
-
@include meta.load-css("patterns/footer");
|
|
61
61
|
@include meta.load-css("patterns/cookieConsent");
|
|
62
|
-
}
|
|
62
|
+
}
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mypgs",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "MyPGS frontend theme and UI behaviors, with bundled JavaScript and CSS assets.",
|
|
5
5
|
"main": "./dist/javascript/index.js",
|
|
6
6
|
"module": "./assets/javascript/index.js",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"default": "./dist/javascript/index.js"
|
|
13
13
|
},
|
|
14
14
|
"./style.css": "./dist/css/index.css",
|
|
15
|
-
"./style.min.css": "./dist/css/index.min.css"
|
|
15
|
+
"./style.min.css": "./dist/css/index.min.css",
|
|
16
|
+
"./vite-plugin-pgs": "./plugins/vite-plugin-pgs.js"
|
|
16
17
|
},
|
|
17
18
|
"style": "./dist/css/index.css",
|
|
18
19
|
"scripts": {
|
package/templates/html/demo.js
CHANGED
|
@@ -31,15 +31,13 @@ const templateFiles = [
|
|
|
31
31
|
"layout/flex.html",
|
|
32
32
|
"layout/grid.html",
|
|
33
33
|
"layout/pageShell.html",
|
|
34
|
+
"layout/footer.html",
|
|
35
|
+
"layout/header.html",
|
|
34
36
|
"patterns/cookieConsent.html",
|
|
35
|
-
"patterns/header.html",
|
|
36
|
-
"patterns/footer.html",
|
|
37
37
|
];
|
|
38
38
|
|
|
39
39
|
function getTemplateTitle(path) {
|
|
40
|
-
return path
|
|
41
|
-
.replace(".html", "")
|
|
42
|
-
.replace("/", " / ")
|
|
40
|
+
return path.replace(".html", "").replace("/", " / ")
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
function renderSourceTemplate(section, html) {
|
|
@@ -72,9 +70,7 @@ function renderTitle(section, path) {
|
|
|
72
70
|
|
|
73
71
|
async function loadTemplate(path) {
|
|
74
72
|
const response = await fetch(path);
|
|
75
|
-
if (!response.ok) {
|
|
76
|
-
throw new Error(`${path}: ${response.status}`);
|
|
77
|
-
}
|
|
73
|
+
if (!response.ok) throw new Error(`${path}: ${response.status}`);
|
|
78
74
|
return response.text();
|
|
79
75
|
}
|
|
80
76
|
|
|
@@ -90,8 +86,8 @@ async function bootDemo() {
|
|
|
90
86
|
const AFTER = document.getElementById("templates-demo-after");
|
|
91
87
|
|
|
92
88
|
for (const path of templateFiles) {
|
|
93
|
-
const isHeader = path === "
|
|
94
|
-
const isfooter = path === "
|
|
89
|
+
const isHeader = path === "layout/header.html";
|
|
90
|
+
const isfooter = path === "layout/footer.html";
|
|
95
91
|
const isBody = path === "layout/body.html";
|
|
96
92
|
|
|
97
93
|
if (isHeader || isfooter) {
|
|
@@ -103,7 +99,6 @@ async function bootDemo() {
|
|
|
103
99
|
message.textContent = `Template non caricato: ${error.message}`;
|
|
104
100
|
layoutRoot.append(message);
|
|
105
101
|
}
|
|
106
|
-
|
|
107
102
|
continue;
|
|
108
103
|
}
|
|
109
104
|
|
|
@@ -116,7 +111,6 @@ async function bootDemo() {
|
|
|
116
111
|
const html = await loadTemplate(path);
|
|
117
112
|
renderSourceTemplate(section, html);
|
|
118
113
|
MAIN.append(section);
|
|
119
|
-
|
|
120
114
|
continue
|
|
121
115
|
}
|
|
122
116
|
|
|
@@ -133,7 +127,6 @@ async function bootDemo() {
|
|
|
133
127
|
|
|
134
128
|
if (path == "layout/section.html" || path == "layout/pageShell.html") {
|
|
135
129
|
section.style.display = "contents";
|
|
136
|
-
|
|
137
130
|
Array.from(section.children).forEach(c => c.style.width = "100%");
|
|
138
131
|
}
|
|
139
132
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|