nodoku-core 0.3.6 → 0.3.13
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/README.md +960 -960
- package/esm/bin/mustache/component-resolver.ts.hbs +38 -38
- package/esm/bin/mustache/content-schema.json.hbs +131 -131
- package/esm/bin/mustache/visual-schema.json.hbs +164 -164
- package/esm/core/dummy-comp.jsx +60 -60
- package/esm/core/rendering-page.jsx +4 -4
- package/package.json +51 -52
- package/schemas/content-common-schema.json +131 -131
- package/schemas/manifest-schema.json +57 -57
- package/schemas/md-content-block-delimiter.json +25 -25
- package/schemas/skin-common-schema.json +140 -140
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import {AsyncFunctionComponent, DummyComp, NdComponentDefinition} from "nodoku-core";
|
|
2
|
-
|
|
3
|
-
{{#modules}}
|
|
4
|
-
import { {{comps}} } from "{{module}}";
|
|
5
|
-
{{/modules}}
|
|
6
|
-
|
|
7
|
-
const components: Map<string, {compo: AsyncFunctionComponent, compoDef: NdComponentDefinition}> = new Map<string, {compo: AsyncFunctionComponent, compoDef: NdComponentDefinition}>();
|
|
8
|
-
|
|
9
|
-
{{#comps}}
|
|
10
|
-
components.set("{{{name}}}", {compo: {{impl}}, compoDef: new NdComponentDefinition({{{numBlocks}}}, "{{{defaultThemeFile}}}")});
|
|
11
|
-
{{/comps}}
|
|
12
|
-
|
|
13
|
-
{{^clSideComps.length}}
|
|
14
|
-
export type ClientSideComponentNameEnum = void;
|
|
15
|
-
{{/clSideComps.length}}
|
|
16
|
-
|
|
17
|
-
{{#clSideComps.length}}
|
|
18
|
-
export type ClientSideComponentNameEnum =
|
|
19
|
-
{{#clSideComps.length}}
|
|
20
|
-
{{#clSideComps}}
|
|
21
|
-
"{{{n}}}"{{^isLast}} | {{/isLast}}{{#isLast}};{{/isLast}}
|
|
22
|
-
{{/clSideComps}}
|
|
23
|
-
{{/clSideComps.length}}
|
|
24
|
-
|
|
25
|
-
export const fromStringToClientSideComponentNameEnum = (c: string): ClientSideComponentNameEnum | undefined => {
|
|
26
|
-
{{#clSideComps}}
|
|
27
|
-
if (c === "{{{n}}}") {
|
|
28
|
-
return "{{{n}}}";
|
|
29
|
-
}
|
|
30
|
-
{{/clSideComps}}
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
{{/clSideComps.length}}
|
|
35
|
-
|
|
36
|
-
export async function nodokuComponentResolver(componentName: string): Promise<{compo: AsyncFunctionComponent, compoDef: NdComponentDefinition}> {
|
|
37
|
-
const f: {compo: AsyncFunctionComponent, compoDef: NdComponentDefinition} | undefined = components.get(componentName);
|
|
38
|
-
return f ? f : {compo: DummyComp, compoDef: new NdComponentDefinition(1)};
|
|
1
|
+
import {AsyncFunctionComponent, DummyComp, NdComponentDefinition} from "nodoku-core";
|
|
2
|
+
|
|
3
|
+
{{#modules}}
|
|
4
|
+
import { {{comps}} } from "{{module}}";
|
|
5
|
+
{{/modules}}
|
|
6
|
+
|
|
7
|
+
const components: Map<string, {compo: AsyncFunctionComponent, compoDef: NdComponentDefinition}> = new Map<string, {compo: AsyncFunctionComponent, compoDef: NdComponentDefinition}>();
|
|
8
|
+
|
|
9
|
+
{{#comps}}
|
|
10
|
+
components.set("{{{name}}}", {compo: {{impl}}, compoDef: new NdComponentDefinition({{{numBlocks}}}, "{{{defaultThemeFile}}}")});
|
|
11
|
+
{{/comps}}
|
|
12
|
+
|
|
13
|
+
{{^clSideComps.length}}
|
|
14
|
+
export type ClientSideComponentNameEnum = void;
|
|
15
|
+
{{/clSideComps.length}}
|
|
16
|
+
|
|
17
|
+
{{#clSideComps.length}}
|
|
18
|
+
export type ClientSideComponentNameEnum =
|
|
19
|
+
{{#clSideComps.length}}
|
|
20
|
+
{{#clSideComps}}
|
|
21
|
+
"{{{n}}}"{{^isLast}} | {{/isLast}}{{#isLast}};{{/isLast}}
|
|
22
|
+
{{/clSideComps}}
|
|
23
|
+
{{/clSideComps.length}}
|
|
24
|
+
|
|
25
|
+
export const fromStringToClientSideComponentNameEnum = (c: string): ClientSideComponentNameEnum | undefined => {
|
|
26
|
+
{{#clSideComps}}
|
|
27
|
+
if (c === "{{{n}}}") {
|
|
28
|
+
return "{{{n}}}";
|
|
29
|
+
}
|
|
30
|
+
{{/clSideComps}}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
{{/clSideComps.length}}
|
|
35
|
+
|
|
36
|
+
export async function nodokuComponentResolver(componentName: string): Promise<{compo: AsyncFunctionComponent, compoDef: NdComponentDefinition}> {
|
|
37
|
+
const f: {compo: AsyncFunctionComponent, compoDef: NdComponentDefinition} | undefined = components.get(componentName);
|
|
38
|
+
return f ? f : {compo: DummyComp, compoDef: new NdComponentDefinition(1)};
|
|
39
39
|
}
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "Landing buddy content page schema",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"definitions": {
|
|
5
|
-
"Link": {
|
|
6
|
-
"type": "string",
|
|
7
|
-
"pattern": "{{{linkRegexPattern}}}"
|
|
8
|
-
},
|
|
9
|
-
"ClickableText": {
|
|
10
|
-
"oneOf": [
|
|
11
|
-
{
|
|
12
|
-
"type": "string"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"type": "object",
|
|
16
|
-
"properties": {
|
|
17
|
-
"text": {
|
|
18
|
-
"type": "string"
|
|
19
|
-
},
|
|
20
|
-
"link": {
|
|
21
|
-
"$ref": "#/definitions/Link"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
"Image": {
|
|
28
|
-
"oneOf": [
|
|
29
|
-
{
|
|
30
|
-
"type": "object",
|
|
31
|
-
"properties": {
|
|
32
|
-
"title": {
|
|
33
|
-
"type": "string"
|
|
34
|
-
},
|
|
35
|
-
"url": {
|
|
36
|
-
"type": "string"
|
|
37
|
-
},
|
|
38
|
-
"alt": {
|
|
39
|
-
"type": "string"
|
|
40
|
-
},
|
|
41
|
-
"link": {
|
|
42
|
-
"$ref": "#/definitions/Link"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"required": [
|
|
46
|
-
"url"
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"type": "string"
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
"ContentBlock": {
|
|
55
|
-
"type": "object",
|
|
56
|
-
"properties": {
|
|
57
|
-
"id": {
|
|
58
|
-
"type": "string"
|
|
59
|
-
},
|
|
60
|
-
"title": {
|
|
61
|
-
"$ref": "#/definitions/ClickableText"
|
|
62
|
-
},
|
|
63
|
-
"subTitle": {
|
|
64
|
-
"$ref": "#/definitions/ClickableText"
|
|
65
|
-
},
|
|
66
|
-
"h3": {
|
|
67
|
-
"$ref": "#/definitions/ClickableText"
|
|
68
|
-
},
|
|
69
|
-
"h4": {
|
|
70
|
-
"$ref": "#/definitions/ClickableText"
|
|
71
|
-
},
|
|
72
|
-
"h5": {
|
|
73
|
-
"$ref": "#/definitions/ClickableText"
|
|
74
|
-
},
|
|
75
|
-
"h6": {
|
|
76
|
-
"$ref": "#/definitions/ClickableText"
|
|
77
|
-
},
|
|
78
|
-
"footer": {
|
|
79
|
-
"$ref": "#/definitions/ClickableText"
|
|
80
|
-
},
|
|
81
|
-
"images": {
|
|
82
|
-
"type": "array",
|
|
83
|
-
"items": {
|
|
84
|
-
"$ref": "#/definitions/Image"
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"paragraphs": {
|
|
88
|
-
"type": "array",
|
|
89
|
-
"items": {
|
|
90
|
-
"$ref": "#/definitions/ClickableText"
|
|
91
|
-
},
|
|
92
|
-
"additionalItems": false
|
|
93
|
-
},
|
|
94
|
-
"bgImage": {
|
|
95
|
-
"$ref": "#/definitions/Image"
|
|
96
|
-
},
|
|
97
|
-
"namespace": {
|
|
98
|
-
"type": "string"
|
|
99
|
-
},
|
|
100
|
-
"tags": {
|
|
101
|
-
"type": "array",
|
|
102
|
-
"items": {
|
|
103
|
-
"type": "string"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"attributes": {
|
|
107
|
-
"type": "object",
|
|
108
|
-
"additionalProperties": {
|
|
109
|
-
"type": "string"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
"additionalItems": false,
|
|
115
|
-
"additionalProperties": false
|
|
116
|
-
},
|
|
117
|
-
"SectionBlock": {
|
|
118
|
-
"type": "array",
|
|
119
|
-
"items": {
|
|
120
|
-
"$ref": "#/definitions/ContentBlock"
|
|
121
|
-
},
|
|
122
|
-
"additionalItems": false,
|
|
123
|
-
"additionalProperties": false
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"type": "array",
|
|
127
|
-
"items": {
|
|
128
|
-
"$ref": "#/definitions/ContentBlock"
|
|
129
|
-
},
|
|
130
|
-
"additionalItems": false,
|
|
131
|
-
"additionalProperties": false
|
|
1
|
+
{
|
|
2
|
+
"description": "Landing buddy content page schema",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"Link": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"pattern": "{{{linkRegexPattern}}}"
|
|
8
|
+
},
|
|
9
|
+
"ClickableText": {
|
|
10
|
+
"oneOf": [
|
|
11
|
+
{
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"text": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"link": {
|
|
21
|
+
"$ref": "#/definitions/Link"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"Image": {
|
|
28
|
+
"oneOf": [
|
|
29
|
+
{
|
|
30
|
+
"type": "object",
|
|
31
|
+
"properties": {
|
|
32
|
+
"title": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"url": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"alt": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"link": {
|
|
42
|
+
"$ref": "#/definitions/Link"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": [
|
|
46
|
+
"url"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "string"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"ContentBlock": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"id": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"title": {
|
|
61
|
+
"$ref": "#/definitions/ClickableText"
|
|
62
|
+
},
|
|
63
|
+
"subTitle": {
|
|
64
|
+
"$ref": "#/definitions/ClickableText"
|
|
65
|
+
},
|
|
66
|
+
"h3": {
|
|
67
|
+
"$ref": "#/definitions/ClickableText"
|
|
68
|
+
},
|
|
69
|
+
"h4": {
|
|
70
|
+
"$ref": "#/definitions/ClickableText"
|
|
71
|
+
},
|
|
72
|
+
"h5": {
|
|
73
|
+
"$ref": "#/definitions/ClickableText"
|
|
74
|
+
},
|
|
75
|
+
"h6": {
|
|
76
|
+
"$ref": "#/definitions/ClickableText"
|
|
77
|
+
},
|
|
78
|
+
"footer": {
|
|
79
|
+
"$ref": "#/definitions/ClickableText"
|
|
80
|
+
},
|
|
81
|
+
"images": {
|
|
82
|
+
"type": "array",
|
|
83
|
+
"items": {
|
|
84
|
+
"$ref": "#/definitions/Image"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"paragraphs": {
|
|
88
|
+
"type": "array",
|
|
89
|
+
"items": {
|
|
90
|
+
"$ref": "#/definitions/ClickableText"
|
|
91
|
+
},
|
|
92
|
+
"additionalItems": false
|
|
93
|
+
},
|
|
94
|
+
"bgImage": {
|
|
95
|
+
"$ref": "#/definitions/Image"
|
|
96
|
+
},
|
|
97
|
+
"namespace": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
},
|
|
100
|
+
"tags": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"items": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"attributes": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"additionalProperties": {
|
|
109
|
+
"type": "string"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
},
|
|
114
|
+
"additionalItems": false,
|
|
115
|
+
"additionalProperties": false
|
|
116
|
+
},
|
|
117
|
+
"SectionBlock": {
|
|
118
|
+
"type": "array",
|
|
119
|
+
"items": {
|
|
120
|
+
"$ref": "#/definitions/ContentBlock"
|
|
121
|
+
},
|
|
122
|
+
"additionalItems": false,
|
|
123
|
+
"additionalProperties": false
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"type": "array",
|
|
127
|
+
"items": {
|
|
128
|
+
"$ref": "#/definitions/ContentBlock"
|
|
129
|
+
},
|
|
130
|
+
"additionalItems": false,
|
|
131
|
+
"additionalProperties": false
|
|
132
132
|
}
|