@wwawing/page-generator 3.12.9 → 3.12.11
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/lib/helper/copyright.js +1 -2
- package/lib/index.js +21 -22
- package/module/helper/copyright.js +1 -2
- package/module/index.js +18 -19
- package/package.json +2 -2
package/lib/helper/copyright.js
CHANGED
|
@@ -16,8 +16,7 @@ function generateOfficialCopyright() {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
exports.generateOfficialCopyright = generateOfficialCopyright;
|
|
19
|
-
function generateWWAWingCopyright(date) {
|
|
20
|
-
if (date === void 0) { date = new Date(); }
|
|
19
|
+
function generateWWAWingCopyright(date = new Date()) {
|
|
21
20
|
return {
|
|
22
21
|
range: {
|
|
23
22
|
firstYear: 2013,
|
package/lib/index.js
CHANGED
|
@@ -24,12 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.render = void 0;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function generateTemplateValues(
|
|
31
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
32
|
-
var page = _a.page, wwa = _a.wwa, copyrights = _a.copyrights;
|
|
27
|
+
const pug = __importStar(require("pug"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const Helper = __importStar(require("./helper"));
|
|
30
|
+
function generateTemplateValues({ page, wwa, copyrights }) {
|
|
31
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
33
32
|
return {
|
|
34
33
|
head: {
|
|
35
34
|
pageTitle: (page === null || page === void 0 ? void 0 : page.title) || "World Wide Adventure Wing",
|
|
@@ -40,34 +39,34 @@ function generateTemplateValues(_a) {
|
|
|
40
39
|
wwa: {
|
|
41
40
|
attributes: {
|
|
42
41
|
"data-wwa-mapdata": wwa.resources.mapData,
|
|
43
|
-
"data-wwa-urlgate-enable": Helper.toStringBoolean(((
|
|
42
|
+
"data-wwa-urlgate-enable": Helper.toStringBoolean(((_a = wwa.gameOption) === null || _a === void 0 ? void 0 : _a.isUrlGateEnabled) || true),
|
|
44
43
|
"data-wwa-title-img": wwa.resources.titleImage,
|
|
45
44
|
"data-wwa-audio-dir": wwa.resources.audioDir,
|
|
46
|
-
"data-wwa-classic-mode-enable": Helper.toStringBooleanOptional((
|
|
47
|
-
"data-wwa-item-effect-enable": Helper.toStringBooleanOptional((
|
|
48
|
-
"data-wwa-use-go-to-wwa": Helper.toStringBooleanOptional((
|
|
49
|
-
"data-wwa-looking-around": Helper.toStringBooleanOptional((
|
|
50
|
-
"data-wwa-autosave":
|
|
45
|
+
"data-wwa-classic-mode-enable": Helper.toStringBooleanOptional((_b = wwa.gameOption) === null || _b === void 0 ? void 0 : _b.isClassicMode),
|
|
46
|
+
"data-wwa-item-effect-enable": Helper.toStringBooleanOptional((_c = wwa.gameOption) === null || _c === void 0 ? void 0 : _c.isItemEffectEnabled),
|
|
47
|
+
"data-wwa-use-go-to-wwa": Helper.toStringBooleanOptional((_d = wwa.gameOption) === null || _d === void 0 ? void 0 : _d.useGoToWWA),
|
|
48
|
+
"data-wwa-looking-around": Helper.toStringBooleanOptional((_e = wwa.gameOption) === null || _e === void 0 ? void 0 : _e.useLookingAround),
|
|
49
|
+
"data-wwa-autosave": `${(_h = (_g = (_f = wwa.gameOption) === null || _f === void 0 ? void 0 : _f.autoSave) === null || _g === void 0 ? void 0 : _g.intervalSteps) !== null && _h !== void 0 ? _h : "0"}`,
|
|
51
50
|
"data-wwa-resume-savedata": wwa.resumeSaveData,
|
|
52
|
-
"data-wwa-var-dump-elm": ((
|
|
51
|
+
"data-wwa-var-dump-elm": ((_k = (_j = wwa.gameOption) === null || _j === void 0 ? void 0 : _j.userVars) === null || _k === void 0 ? void 0 : _k.dumpElementId) ? `#${wwa.gameOption.userVars.dumpElementId}` : undefined,
|
|
53
52
|
"data-wwa-user-var-names-file": wwa.resources.userVarNamesFile,
|
|
54
|
-
"data-wwa-display-user-vars": Helper.toStringBooleanOptional((
|
|
55
|
-
"data-wwa-virtualpad-enable": Helper.toStringBooleanOptional((
|
|
56
|
-
"data-wwa-virtualpad-viewport-fit-enable": Helper.toStringBooleanOptional((
|
|
57
|
-
"data-wwa-virtualpad-controller-elm": ((
|
|
53
|
+
"data-wwa-display-user-vars": Helper.toStringBooleanOptional((_m = (_l = wwa.gameOption) === null || _l === void 0 ? void 0 : _l.userVars) === null || _m === void 0 ? void 0 : _m.canDisplay),
|
|
54
|
+
"data-wwa-virtualpad-enable": Helper.toStringBooleanOptional((_p = (_o = wwa.gameOption) === null || _o === void 0 ? void 0 : _o.virtualPad) === null || _p === void 0 ? void 0 : _p.enable),
|
|
55
|
+
"data-wwa-virtualpad-viewport-fit-enable": Helper.toStringBooleanOptional((_r = (_q = wwa.gameOption) === null || _q === void 0 ? void 0 : _q.virtualPad) === null || _r === void 0 ? void 0 : _r.viewportFitEnable),
|
|
56
|
+
"data-wwa-virtualpad-controller-elm": ((_t = (_s = wwa.gameOption) === null || _s === void 0 ? void 0 : _s.virtualPad) === null || _t === void 0 ? void 0 : _t.controllerId) ? `#${wwa.gameOption.virtualPad.controllerId}` : undefined,
|
|
58
57
|
}
|
|
59
58
|
},
|
|
60
|
-
varDumpElement: ((
|
|
61
|
-
virtualPadController: ((
|
|
59
|
+
varDumpElement: ((_v = (_u = wwa.gameOption) === null || _u === void 0 ? void 0 : _u.userVars) === null || _v === void 0 ? void 0 : _v.dumpElementId) ? { id: wwa.gameOption.userVars.dumpElementId } : undefined,
|
|
60
|
+
virtualPadController: ((_x = (_w = wwa.gameOption) === null || _w === void 0 ? void 0 : _w.virtualPad) === null || _x === void 0 ? void 0 : _x.controllerId) ? { id: wwa.gameOption.virtualPad.controllerId } : undefined,
|
|
62
61
|
footer: {
|
|
63
62
|
copyrights: Helper.generateCopyrights(copyrights)
|
|
64
63
|
}
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
66
|
function render(config) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const templateValues = generateTemplateValues(config);
|
|
68
|
+
const pugFilePath = path.join(__dirname, "wwa.pug");
|
|
69
|
+
const compileTemplate = pug.compileFile(pugFilePath, { pretty: true });
|
|
71
70
|
return compileTemplate(templateValues) + "\n";
|
|
72
71
|
}
|
|
73
72
|
exports.render = render;
|
|
@@ -12,8 +12,7 @@ export function generateOfficialCopyright() {
|
|
|
12
12
|
credit: "NAO",
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export function generateWWAWingCopyright(date) {
|
|
16
|
-
if (date === void 0) { date = new Date(); }
|
|
15
|
+
export function generateWWAWingCopyright(date = new Date()) {
|
|
17
16
|
return {
|
|
18
17
|
range: {
|
|
19
18
|
firstYear: 2013,
|
package/module/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as pug from "pug";
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import * as Helper from "./helper";
|
|
4
|
-
function generateTemplateValues(
|
|
5
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
6
|
-
var page = _a.page, wwa = _a.wwa, copyrights = _a.copyrights;
|
|
4
|
+
function generateTemplateValues({ page, wwa, copyrights }) {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
7
6
|
return {
|
|
8
7
|
head: {
|
|
9
8
|
pageTitle: (page === null || page === void 0 ? void 0 : page.title) || "World Wide Adventure Wing",
|
|
@@ -14,33 +13,33 @@ function generateTemplateValues(_a) {
|
|
|
14
13
|
wwa: {
|
|
15
14
|
attributes: {
|
|
16
15
|
"data-wwa-mapdata": wwa.resources.mapData,
|
|
17
|
-
"data-wwa-urlgate-enable": Helper.toStringBoolean(((
|
|
16
|
+
"data-wwa-urlgate-enable": Helper.toStringBoolean(((_a = wwa.gameOption) === null || _a === void 0 ? void 0 : _a.isUrlGateEnabled) || true),
|
|
18
17
|
"data-wwa-title-img": wwa.resources.titleImage,
|
|
19
18
|
"data-wwa-audio-dir": wwa.resources.audioDir,
|
|
20
|
-
"data-wwa-classic-mode-enable": Helper.toStringBooleanOptional((
|
|
21
|
-
"data-wwa-item-effect-enable": Helper.toStringBooleanOptional((
|
|
22
|
-
"data-wwa-use-go-to-wwa": Helper.toStringBooleanOptional((
|
|
23
|
-
"data-wwa-looking-around": Helper.toStringBooleanOptional((
|
|
24
|
-
"data-wwa-autosave":
|
|
19
|
+
"data-wwa-classic-mode-enable": Helper.toStringBooleanOptional((_b = wwa.gameOption) === null || _b === void 0 ? void 0 : _b.isClassicMode),
|
|
20
|
+
"data-wwa-item-effect-enable": Helper.toStringBooleanOptional((_c = wwa.gameOption) === null || _c === void 0 ? void 0 : _c.isItemEffectEnabled),
|
|
21
|
+
"data-wwa-use-go-to-wwa": Helper.toStringBooleanOptional((_d = wwa.gameOption) === null || _d === void 0 ? void 0 : _d.useGoToWWA),
|
|
22
|
+
"data-wwa-looking-around": Helper.toStringBooleanOptional((_e = wwa.gameOption) === null || _e === void 0 ? void 0 : _e.useLookingAround),
|
|
23
|
+
"data-wwa-autosave": `${(_h = (_g = (_f = wwa.gameOption) === null || _f === void 0 ? void 0 : _f.autoSave) === null || _g === void 0 ? void 0 : _g.intervalSteps) !== null && _h !== void 0 ? _h : "0"}`,
|
|
25
24
|
"data-wwa-resume-savedata": wwa.resumeSaveData,
|
|
26
|
-
"data-wwa-var-dump-elm": ((
|
|
25
|
+
"data-wwa-var-dump-elm": ((_k = (_j = wwa.gameOption) === null || _j === void 0 ? void 0 : _j.userVars) === null || _k === void 0 ? void 0 : _k.dumpElementId) ? `#${wwa.gameOption.userVars.dumpElementId}` : undefined,
|
|
27
26
|
"data-wwa-user-var-names-file": wwa.resources.userVarNamesFile,
|
|
28
|
-
"data-wwa-display-user-vars": Helper.toStringBooleanOptional((
|
|
29
|
-
"data-wwa-virtualpad-enable": Helper.toStringBooleanOptional((
|
|
30
|
-
"data-wwa-virtualpad-viewport-fit-enable": Helper.toStringBooleanOptional((
|
|
31
|
-
"data-wwa-virtualpad-controller-elm": ((
|
|
27
|
+
"data-wwa-display-user-vars": Helper.toStringBooleanOptional((_m = (_l = wwa.gameOption) === null || _l === void 0 ? void 0 : _l.userVars) === null || _m === void 0 ? void 0 : _m.canDisplay),
|
|
28
|
+
"data-wwa-virtualpad-enable": Helper.toStringBooleanOptional((_p = (_o = wwa.gameOption) === null || _o === void 0 ? void 0 : _o.virtualPad) === null || _p === void 0 ? void 0 : _p.enable),
|
|
29
|
+
"data-wwa-virtualpad-viewport-fit-enable": Helper.toStringBooleanOptional((_r = (_q = wwa.gameOption) === null || _q === void 0 ? void 0 : _q.virtualPad) === null || _r === void 0 ? void 0 : _r.viewportFitEnable),
|
|
30
|
+
"data-wwa-virtualpad-controller-elm": ((_t = (_s = wwa.gameOption) === null || _s === void 0 ? void 0 : _s.virtualPad) === null || _t === void 0 ? void 0 : _t.controllerId) ? `#${wwa.gameOption.virtualPad.controllerId}` : undefined,
|
|
32
31
|
}
|
|
33
32
|
},
|
|
34
|
-
varDumpElement: ((
|
|
35
|
-
virtualPadController: ((
|
|
33
|
+
varDumpElement: ((_v = (_u = wwa.gameOption) === null || _u === void 0 ? void 0 : _u.userVars) === null || _v === void 0 ? void 0 : _v.dumpElementId) ? { id: wwa.gameOption.userVars.dumpElementId } : undefined,
|
|
34
|
+
virtualPadController: ((_x = (_w = wwa.gameOption) === null || _w === void 0 ? void 0 : _w.virtualPad) === null || _x === void 0 ? void 0 : _x.controllerId) ? { id: wwa.gameOption.virtualPad.controllerId } : undefined,
|
|
36
35
|
footer: {
|
|
37
36
|
copyrights: Helper.generateCopyrights(copyrights)
|
|
38
37
|
}
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
40
|
export function render(config) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const templateValues = generateTemplateValues(config);
|
|
42
|
+
const pugFilePath = path.join(__dirname, "wwa.pug");
|
|
43
|
+
const compileTemplate = pug.compileFile(pugFilePath, { pretty: true });
|
|
45
44
|
return compileTemplate(templateValues) + "\n";
|
|
46
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwawing/page-generator",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.11",
|
|
4
4
|
"description": "a HTML file generator for WWA Wing",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"node": ">=18",
|
|
44
44
|
"npm": ">=8"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "9cd59237d23c90c4d6c1a9eed2c5eae337948941"
|
|
47
47
|
}
|