@refrakt-md/storytelling 0.7.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/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +118 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +159 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/bond.d.ts +23 -0
- package/dist/schema/bond.d.ts.map +1 -0
- package/dist/schema/bond.js +10 -0
- package/dist/schema/bond.js.map +1 -0
- package/dist/schema/character.d.ts +27 -0
- package/dist/schema/character.d.ts.map +1 -0
- package/dist/schema/character.js +11 -0
- package/dist/schema/character.js.map +1 -0
- package/dist/schema/faction.d.ts +26 -0
- package/dist/schema/faction.d.ts.map +1 -0
- package/dist/schema/faction.js +11 -0
- package/dist/schema/faction.js.map +1 -0
- package/dist/schema/lore.d.ts +20 -0
- package/dist/schema/lore.d.ts.map +1 -0
- package/dist/schema/lore.js +9 -0
- package/dist/schema/lore.js.map +1 -0
- package/dist/schema/plot.d.ts +42 -0
- package/dist/schema/plot.d.ts.map +1 -0
- package/dist/schema/plot.js +19 -0
- package/dist/schema/plot.js.map +1 -0
- package/dist/schema/realm.d.ts +27 -0
- package/dist/schema/realm.d.ts.map +1 -0
- package/dist/schema/realm.js +11 -0
- package/dist/schema/realm.js.map +1 -0
- package/dist/schema/story-section.d.ts +14 -0
- package/dist/schema/story-section.d.ts.map +1 -0
- package/dist/schema/story-section.js +6 -0
- package/dist/schema/story-section.js.map +1 -0
- package/dist/schema/storyboard.d.ts +30 -0
- package/dist/schema/storyboard.d.ts.map +1 -0
- package/dist/schema/storyboard.js +10 -0
- package/dist/schema/storyboard.js.map +1 -0
- package/dist/tags/bond.d.ts +3 -0
- package/dist/tags/bond.d.ts.map +1 -0
- package/dist/tags/bond.js +71 -0
- package/dist/tags/bond.js.map +1 -0
- package/dist/tags/character.d.ts +4 -0
- package/dist/tags/character.d.ts.map +1 -0
- package/dist/tags/character.js +162 -0
- package/dist/tags/character.js.map +1 -0
- package/dist/tags/faction.d.ts +4 -0
- package/dist/tags/faction.d.ts.map +1 -0
- package/dist/tags/faction.js +148 -0
- package/dist/tags/faction.js.map +1 -0
- package/dist/tags/lore.d.ts +3 -0
- package/dist/tags/lore.d.ts.map +1 -0
- package/dist/tags/lore.js +61 -0
- package/dist/tags/lore.js.map +1 -0
- package/dist/tags/plot.d.ts +4 -0
- package/dist/tags/plot.d.ts.map +1 -0
- package/dist/tags/plot.js +189 -0
- package/dist/tags/plot.js.map +1 -0
- package/dist/tags/realm.d.ts +4 -0
- package/dist/tags/realm.d.ts.map +1 -0
- package/dist/tags/realm.js +160 -0
- package/dist/tags/realm.js.map +1 -0
- package/dist/tags/storyboard.d.ts +4 -0
- package/dist/tags/storyboard.d.ts.map +1 -0
- package/dist/tags/storyboard.js +100 -0
- package/dist/tags/storyboard.js.map +1 -0
- package/dist/types.d.ts +23 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +24 -0
- package/dist/types.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentType } from "@refrakt-md/types";
|
|
2
|
+
export declare class StoryboardPanel {
|
|
3
|
+
}
|
|
4
|
+
export interface StoryboardPanelComponent extends ComponentType<StoryboardPanel> {
|
|
5
|
+
tag: 'div';
|
|
6
|
+
properties: {
|
|
7
|
+
image: 'img';
|
|
8
|
+
caption: 'p';
|
|
9
|
+
};
|
|
10
|
+
refs: {
|
|
11
|
+
body: 'div';
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare class Storyboard {
|
|
15
|
+
columns: number;
|
|
16
|
+
style: string;
|
|
17
|
+
panel: StoryboardPanel[];
|
|
18
|
+
}
|
|
19
|
+
export interface StoryboardComponent extends ComponentType<Storyboard> {
|
|
20
|
+
tag: 'div';
|
|
21
|
+
properties: {
|
|
22
|
+
panel: 'div';
|
|
23
|
+
style: 'meta';
|
|
24
|
+
columns: 'meta';
|
|
25
|
+
};
|
|
26
|
+
refs: {
|
|
27
|
+
panels: 'div';
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=storyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storyboard.d.ts","sourceRoot":"","sources":["../../src/schema/storyboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,qBAAa,eAAe;CAC3B;AAED,MAAM,WAAW,wBAAyB,SAAQ,aAAa,CAAC,eAAe,CAAC;IAC/E,GAAG,EAAE,KAAK,CAAC;IACX,UAAU,EAAE;QACX,KAAK,EAAE,KAAK,CAAC;QACb,OAAO,EAAE,GAAG,CAAC;KACb,CAAC;IACF,IAAI,EAAE;QACL,IAAI,EAAE,KAAK,CAAC;KACZ,CAAA;CACD;AAED,qBAAa,UAAU;IACtB,OAAO,EAAE,MAAM,CAAK;IACpB,KAAK,EAAE,MAAM,CAAW;IACxB,KAAK,EAAE,eAAe,EAAE,CAAM;CAC9B;AAED,MAAM,WAAW,mBAAoB,SAAQ,aAAa,CAAC,UAAU,CAAC;IACrE,GAAG,EAAE,KAAK,CAAC;IACX,UAAU,EAAE;QACX,KAAK,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,EAAE;QACL,MAAM,EAAE,KAAK,CAAC;KACd,CAAA;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storyboard.js","sourceRoot":"","sources":["../../src/schema/storyboard.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAe;CAC3B;AAaD,MAAM,OAAO,UAAU;IAAvB;QACC,YAAO,GAAW,CAAC,CAAC;QACpB,UAAK,GAAW,OAAO,CAAC;QACxB,UAAK,GAAsB,EAAE,CAAC;IAC/B,CAAC;CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bond.d.ts","sourceRoot":"","sources":["../../src/tags/bond.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAkDvC,eAAO,MAAM,IAAI,gBAA0B,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import Markdoc from '@markdoc/markdoc';
|
|
11
|
+
const { Tag } = Markdoc;
|
|
12
|
+
import { attribute, Model, createComponentRenderable, createSchema } from '@refrakt-md/runes';
|
|
13
|
+
import { schema } from '../types.js';
|
|
14
|
+
class BondModel extends Model {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.from = '';
|
|
18
|
+
this.to = '';
|
|
19
|
+
this.type = '';
|
|
20
|
+
this.status = 'active';
|
|
21
|
+
this.bidirectional = true;
|
|
22
|
+
}
|
|
23
|
+
transform() {
|
|
24
|
+
const fromTag = new Tag('span', {}, [this.from]);
|
|
25
|
+
const toTag = new Tag('span', {}, [this.to]);
|
|
26
|
+
const connector = new Tag('div', { 'data-name': 'connector' }, [
|
|
27
|
+
new Tag('span', { 'data-name': 'arrow' }),
|
|
28
|
+
]);
|
|
29
|
+
const bondTypeMeta = new Tag('meta', { content: this.type });
|
|
30
|
+
const statusMeta = new Tag('meta', { content: this.status });
|
|
31
|
+
const bidirectionalMeta = new Tag('meta', { content: String(this.bidirectional) });
|
|
32
|
+
const body = this.transformChildren().wrap('div');
|
|
33
|
+
return createComponentRenderable(schema.Bond, {
|
|
34
|
+
tag: 'div',
|
|
35
|
+
properties: {
|
|
36
|
+
from: fromTag,
|
|
37
|
+
to: toTag,
|
|
38
|
+
bondType: bondTypeMeta,
|
|
39
|
+
status: statusMeta,
|
|
40
|
+
bidirectional: bidirectionalMeta,
|
|
41
|
+
},
|
|
42
|
+
refs: {
|
|
43
|
+
connector,
|
|
44
|
+
body: body.tag('div'),
|
|
45
|
+
},
|
|
46
|
+
children: [fromTag, connector, toTag, bondTypeMeta, statusMeta, bidirectionalMeta, body.next()],
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
__decorate([
|
|
51
|
+
attribute({ type: String, required: true }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], BondModel.prototype, "from", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
attribute({ type: String, required: true }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], BondModel.prototype, "to", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
attribute({ type: String, required: false }),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], BondModel.prototype, "type", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
attribute({ type: String, required: false }),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], BondModel.prototype, "status", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
attribute({ type: Boolean, required: false }),
|
|
68
|
+
__metadata("design:type", Boolean)
|
|
69
|
+
], BondModel.prototype, "bidirectional", void 0);
|
|
70
|
+
export const bond = createSchema(BondModel);
|
|
71
|
+
//# sourceMappingURL=bond.js.map
|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.ts","sourceRoot":"","sources":["../../src/tags/character.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AA+IvC,eAAO,MAAM,gBAAgB,gBAAkC,CAAC;AAChE,eAAO,MAAM,SAAS,gBAA+B,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import Markdoc from '@markdoc/markdoc';
|
|
11
|
+
const { Ast, Tag } = Markdoc;
|
|
12
|
+
import { NodeStream, attribute, group, Model, createComponentRenderable, createSchema, headingsToList } from '@refrakt-md/runes';
|
|
13
|
+
import { schema } from '../types.js';
|
|
14
|
+
class StorySectionModel extends Model {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.name = '';
|
|
18
|
+
}
|
|
19
|
+
transform() {
|
|
20
|
+
const nameTag = new Tag('span', {}, [this.name]);
|
|
21
|
+
const body = this.transformChildren().wrap('div');
|
|
22
|
+
return createComponentRenderable(schema.CharacterSection, {
|
|
23
|
+
tag: 'div',
|
|
24
|
+
properties: { name: nameTag },
|
|
25
|
+
refs: { body: body.tag('div') },
|
|
26
|
+
children: [nameTag, body.next()],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
attribute({ type: String, required: true }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], StorySectionModel.prototype, "name", void 0);
|
|
34
|
+
const roleType = ['protagonist', 'antagonist', 'supporting', 'minor'];
|
|
35
|
+
const statusType = ['alive', 'dead', 'unknown', 'missing'];
|
|
36
|
+
class CharacterModel extends Model {
|
|
37
|
+
constructor() {
|
|
38
|
+
super(...arguments);
|
|
39
|
+
this.headingLevel = undefined;
|
|
40
|
+
this.name = '';
|
|
41
|
+
this.role = 'supporting';
|
|
42
|
+
this.status = 'alive';
|
|
43
|
+
this.aliases = '';
|
|
44
|
+
this.tags = '';
|
|
45
|
+
}
|
|
46
|
+
convertHeadings(nodes) {
|
|
47
|
+
const level = this.headingLevel ?? nodes.find(n => n.type === 'heading')?.attributes.level;
|
|
48
|
+
if (!level)
|
|
49
|
+
return nodes;
|
|
50
|
+
const converted = headingsToList({ level })(nodes);
|
|
51
|
+
const n = converted.length - 1;
|
|
52
|
+
if (!converted[n] || converted[n].type !== 'list')
|
|
53
|
+
return nodes;
|
|
54
|
+
const tags = converted[n].children.map(item => {
|
|
55
|
+
const heading = item.children[0];
|
|
56
|
+
const name = Array.from(heading.walk())
|
|
57
|
+
.filter(n => n.type === 'text')
|
|
58
|
+
.map(t => t.attributes.content)
|
|
59
|
+
.join(' ');
|
|
60
|
+
return new Ast.Node('tag', { name }, item.children.slice(1), 'character-section');
|
|
61
|
+
});
|
|
62
|
+
converted.splice(n, 1, ...tags);
|
|
63
|
+
return converted;
|
|
64
|
+
}
|
|
65
|
+
processChildren(nodes) {
|
|
66
|
+
return super.processChildren(this.convertHeadings(nodes));
|
|
67
|
+
}
|
|
68
|
+
transform() {
|
|
69
|
+
const header = this.header.transform();
|
|
70
|
+
const itemStream = this.itemgroup.transform();
|
|
71
|
+
const nameTag = new Tag('span', {}, [this.name]);
|
|
72
|
+
const roleMeta = new Tag('meta', { content: this.role });
|
|
73
|
+
const statusMeta = new Tag('meta', { content: this.status });
|
|
74
|
+
const aliasesMeta = new Tag('meta', { content: this.aliases });
|
|
75
|
+
const tagsMeta = new Tag('meta', { content: this.tags });
|
|
76
|
+
// Extract portrait image from header
|
|
77
|
+
const portrait = header.tag('img').limit(1);
|
|
78
|
+
const hasPortrait = portrait.count() > 0;
|
|
79
|
+
const portraitDiv = hasPortrait ? portrait.wrap('div') : undefined;
|
|
80
|
+
const sections = itemStream.tag('div').typeof('CharacterSection');
|
|
81
|
+
const hasSections = sections.count() > 0;
|
|
82
|
+
const children = [nameTag, roleMeta, statusMeta, aliasesMeta, tagsMeta];
|
|
83
|
+
if (portraitDiv)
|
|
84
|
+
children.push(portraitDiv.next());
|
|
85
|
+
if (hasSections) {
|
|
86
|
+
const sectionsContainer = sections.wrap('div');
|
|
87
|
+
children.push(sectionsContainer.next());
|
|
88
|
+
return createComponentRenderable(schema.Character, {
|
|
89
|
+
tag: 'article',
|
|
90
|
+
property: 'contentSection',
|
|
91
|
+
properties: {
|
|
92
|
+
name: nameTag,
|
|
93
|
+
role: roleMeta,
|
|
94
|
+
status: statusMeta,
|
|
95
|
+
aliases: aliasesMeta,
|
|
96
|
+
tags: tagsMeta,
|
|
97
|
+
section: sections,
|
|
98
|
+
},
|
|
99
|
+
refs: {
|
|
100
|
+
...(portraitDiv ? { portrait: portraitDiv } : {}),
|
|
101
|
+
sections: sectionsContainer,
|
|
102
|
+
},
|
|
103
|
+
children,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const body = itemStream.wrap('div');
|
|
108
|
+
children.push(body.next());
|
|
109
|
+
return createComponentRenderable(schema.Character, {
|
|
110
|
+
tag: 'article',
|
|
111
|
+
property: 'contentSection',
|
|
112
|
+
properties: {
|
|
113
|
+
name: nameTag,
|
|
114
|
+
role: roleMeta,
|
|
115
|
+
status: statusMeta,
|
|
116
|
+
aliases: aliasesMeta,
|
|
117
|
+
tags: tagsMeta,
|
|
118
|
+
},
|
|
119
|
+
refs: {
|
|
120
|
+
...(portraitDiv ? { portrait: portraitDiv } : {}),
|
|
121
|
+
body,
|
|
122
|
+
},
|
|
123
|
+
children,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
__decorate([
|
|
129
|
+
attribute({ type: Number, required: false }),
|
|
130
|
+
__metadata("design:type", Object)
|
|
131
|
+
], CharacterModel.prototype, "headingLevel", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
attribute({ type: String, required: true }),
|
|
134
|
+
__metadata("design:type", String)
|
|
135
|
+
], CharacterModel.prototype, "name", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
attribute({ type: String, required: false, matches: roleType.slice() }),
|
|
138
|
+
__metadata("design:type", Object)
|
|
139
|
+
], CharacterModel.prototype, "role", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
attribute({ type: String, required: false, matches: statusType.slice() }),
|
|
142
|
+
__metadata("design:type", Object)
|
|
143
|
+
], CharacterModel.prototype, "status", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
attribute({ type: String, required: false }),
|
|
146
|
+
__metadata("design:type", String)
|
|
147
|
+
], CharacterModel.prototype, "aliases", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
attribute({ type: String, required: false }),
|
|
150
|
+
__metadata("design:type", String)
|
|
151
|
+
], CharacterModel.prototype, "tags", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
group({ include: ['heading', 'paragraph', 'image'] }),
|
|
154
|
+
__metadata("design:type", NodeStream)
|
|
155
|
+
], CharacterModel.prototype, "header", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
group({ include: ['tag'] }),
|
|
158
|
+
__metadata("design:type", NodeStream)
|
|
159
|
+
], CharacterModel.prototype, "itemgroup", void 0);
|
|
160
|
+
export const characterSection = createSchema(StorySectionModel);
|
|
161
|
+
export const character = createSchema(CharacterModel);
|
|
162
|
+
//# sourceMappingURL=character.js.map
|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,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;8BAC9C,UAAU;8CAAC;AAGnB;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;8BACjB,UAAU;iDAAC;AA8FvB,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faction.d.ts","sourceRoot":"","sources":["../../src/tags/faction.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAgIvC,eAAO,MAAM,cAAc,gBAAoC,CAAC;AAChE,eAAO,MAAM,OAAO,gBAA6B,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import Markdoc from '@markdoc/markdoc';
|
|
11
|
+
const { Ast, Tag } = Markdoc;
|
|
12
|
+
import { NodeStream, attribute, group, Model, createComponentRenderable, createSchema, headingsToList } from '@refrakt-md/runes';
|
|
13
|
+
import { schema } from '../types.js';
|
|
14
|
+
class FactionSectionModel extends Model {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.name = '';
|
|
18
|
+
}
|
|
19
|
+
transform() {
|
|
20
|
+
const nameTag = new Tag('span', {}, [this.name]);
|
|
21
|
+
const body = this.transformChildren().wrap('div');
|
|
22
|
+
return createComponentRenderable(schema.FactionSection, {
|
|
23
|
+
tag: 'div',
|
|
24
|
+
properties: { name: nameTag },
|
|
25
|
+
refs: { body: body.tag('div') },
|
|
26
|
+
children: [nameTag, body.next()],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
attribute({ type: String, required: true }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], FactionSectionModel.prototype, "name", void 0);
|
|
34
|
+
class FactionModel extends Model {
|
|
35
|
+
constructor() {
|
|
36
|
+
super(...arguments);
|
|
37
|
+
this.headingLevel = undefined;
|
|
38
|
+
this.name = '';
|
|
39
|
+
this.type = '';
|
|
40
|
+
this.alignment = '';
|
|
41
|
+
this.size = '';
|
|
42
|
+
this.tags = '';
|
|
43
|
+
}
|
|
44
|
+
convertHeadings(nodes) {
|
|
45
|
+
const level = this.headingLevel ?? nodes.find(n => n.type === 'heading')?.attributes.level;
|
|
46
|
+
if (!level)
|
|
47
|
+
return nodes;
|
|
48
|
+
const converted = headingsToList({ level })(nodes);
|
|
49
|
+
const n = converted.length - 1;
|
|
50
|
+
if (!converted[n] || converted[n].type !== 'list')
|
|
51
|
+
return nodes;
|
|
52
|
+
const tags = converted[n].children.map(item => {
|
|
53
|
+
const heading = item.children[0];
|
|
54
|
+
const name = Array.from(heading.walk())
|
|
55
|
+
.filter(n => n.type === 'text')
|
|
56
|
+
.map(t => t.attributes.content)
|
|
57
|
+
.join(' ');
|
|
58
|
+
return new Ast.Node('tag', { name }, item.children.slice(1), 'faction-section');
|
|
59
|
+
});
|
|
60
|
+
converted.splice(n, 1, ...tags);
|
|
61
|
+
return converted;
|
|
62
|
+
}
|
|
63
|
+
processChildren(nodes) {
|
|
64
|
+
return super.processChildren(this.convertHeadings(nodes));
|
|
65
|
+
}
|
|
66
|
+
transform() {
|
|
67
|
+
const header = this.header.transform();
|
|
68
|
+
const itemStream = this.itemgroup.transform();
|
|
69
|
+
const nameTag = new Tag('span', {}, [this.name]);
|
|
70
|
+
const factionTypeMeta = new Tag('meta', { content: this.type });
|
|
71
|
+
const alignmentMeta = new Tag('meta', { content: this.alignment });
|
|
72
|
+
const sizeMeta = new Tag('meta', { content: this.size });
|
|
73
|
+
const tagsMeta = new Tag('meta', { content: this.tags });
|
|
74
|
+
const sections = itemStream.tag('div').typeof('FactionSection');
|
|
75
|
+
const hasSections = sections.count() > 0;
|
|
76
|
+
const children = [nameTag, factionTypeMeta, alignmentMeta, sizeMeta, tagsMeta];
|
|
77
|
+
if (hasSections) {
|
|
78
|
+
const sectionsContainer = sections.wrap('div');
|
|
79
|
+
children.push(sectionsContainer.next());
|
|
80
|
+
return createComponentRenderable(schema.Faction, {
|
|
81
|
+
tag: 'article',
|
|
82
|
+
property: 'contentSection',
|
|
83
|
+
properties: {
|
|
84
|
+
name: nameTag,
|
|
85
|
+
factionType: factionTypeMeta,
|
|
86
|
+
alignment: alignmentMeta,
|
|
87
|
+
size: sizeMeta,
|
|
88
|
+
tags: tagsMeta,
|
|
89
|
+
section: sections,
|
|
90
|
+
},
|
|
91
|
+
refs: { sections: sectionsContainer },
|
|
92
|
+
children,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
const body = itemStream.wrap('div');
|
|
97
|
+
children.push(body.next());
|
|
98
|
+
return createComponentRenderable(schema.Faction, {
|
|
99
|
+
tag: 'article',
|
|
100
|
+
property: 'contentSection',
|
|
101
|
+
properties: {
|
|
102
|
+
name: nameTag,
|
|
103
|
+
factionType: factionTypeMeta,
|
|
104
|
+
alignment: alignmentMeta,
|
|
105
|
+
size: sizeMeta,
|
|
106
|
+
tags: tagsMeta,
|
|
107
|
+
},
|
|
108
|
+
refs: { body },
|
|
109
|
+
children,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
__decorate([
|
|
115
|
+
attribute({ type: Number, required: false }),
|
|
116
|
+
__metadata("design:type", Object)
|
|
117
|
+
], FactionModel.prototype, "headingLevel", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
attribute({ type: String, required: true }),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], FactionModel.prototype, "name", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
attribute({ type: String, required: false }),
|
|
124
|
+
__metadata("design:type", String)
|
|
125
|
+
], FactionModel.prototype, "type", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
attribute({ type: String, required: false }),
|
|
128
|
+
__metadata("design:type", String)
|
|
129
|
+
], FactionModel.prototype, "alignment", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
attribute({ type: String, required: false }),
|
|
132
|
+
__metadata("design:type", String)
|
|
133
|
+
], FactionModel.prototype, "size", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
attribute({ type: String, required: false }),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], FactionModel.prototype, "tags", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
group({ include: ['heading', 'paragraph', 'image'] }),
|
|
140
|
+
__metadata("design:type", NodeStream)
|
|
141
|
+
], FactionModel.prototype, "header", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
group({ include: ['tag'] }),
|
|
144
|
+
__metadata("design:type", NodeStream)
|
|
145
|
+
], FactionModel.prototype, "itemgroup", void 0);
|
|
146
|
+
export const factionSection = createSchema(FactionSectionModel);
|
|
147
|
+
export const faction = createSchema(FactionModel);
|
|
148
|
+
//# sourceMappingURL=faction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faction.js","sourceRoot":"","sources":["../../src/tags/faction.ts"],"names":[],"mappings":";;;;;;;;;AA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E,CAAC;;+CACtB;AAGvB;IADC,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CAC3B;AAGlB;IADC,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CAC3B;AAGlB;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;8BAC9C,UAAU;4CAAC;AAGnB;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;8BACjB,UAAU;+CAAC;AAkFvB,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lore.d.ts","sourceRoot":"","sources":["../../src/tags/lore.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AA0CvC,eAAO,MAAM,IAAI,gBAA0B,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import Markdoc from '@markdoc/markdoc';
|
|
11
|
+
const { Tag } = Markdoc;
|
|
12
|
+
import { attribute, Model, createComponentRenderable, createSchema } from '@refrakt-md/runes';
|
|
13
|
+
import { schema } from '../types.js';
|
|
14
|
+
class LoreModel extends Model {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.title = '';
|
|
18
|
+
this.category = '';
|
|
19
|
+
this.spoiler = false;
|
|
20
|
+
this.tags = '';
|
|
21
|
+
}
|
|
22
|
+
transform() {
|
|
23
|
+
const titleTag = new Tag('span', {}, [this.title]);
|
|
24
|
+
const categoryMeta = new Tag('meta', { content: this.category });
|
|
25
|
+
const spoilerMeta = new Tag('meta', { content: String(this.spoiler) });
|
|
26
|
+
const tagsMeta = new Tag('meta', { content: this.tags });
|
|
27
|
+
const body = this.transformChildren().wrap('div');
|
|
28
|
+
return createComponentRenderable(schema.Lore, {
|
|
29
|
+
tag: 'article',
|
|
30
|
+
property: 'contentSection',
|
|
31
|
+
properties: {
|
|
32
|
+
title: titleTag,
|
|
33
|
+
category: categoryMeta,
|
|
34
|
+
spoiler: spoilerMeta,
|
|
35
|
+
tags: tagsMeta,
|
|
36
|
+
},
|
|
37
|
+
refs: {
|
|
38
|
+
body: body.tag('div'),
|
|
39
|
+
},
|
|
40
|
+
children: [titleTag, categoryMeta, spoilerMeta, tagsMeta, body.next()],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
__decorate([
|
|
45
|
+
attribute({ type: String, required: true }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], LoreModel.prototype, "title", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
attribute({ type: String, required: false }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], LoreModel.prototype, "category", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
attribute({ type: Boolean, required: false }),
|
|
54
|
+
__metadata("design:type", Boolean)
|
|
55
|
+
], LoreModel.prototype, "spoiler", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
attribute({ type: String, required: false }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], LoreModel.prototype, "tags", void 0);
|
|
60
|
+
export const lore = createSchema(LoreModel);
|
|
61
|
+
//# sourceMappingURL=lore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lore.js","sourceRoot":"","sources":["../../src/tags/lore.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,SAAU,SAAQ,KAAK;IAA7B;;QAEC,UAAK,GAAW,EAAE,CAAC;QAGnB,aAAQ,GAAW,EAAE,CAAC;QAGtB,YAAO,GAAY,KAAK,CAAC;QAGzB,SAAI,GAAW,EAAE,CAAC;IAwBnB,CAAC;IAtBA,SAAS;QACR,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACnD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACvE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,MAAM,IAAI,GAAG,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