@refrakt-md/business 0.33.0 → 0.35.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/index.d.ts.map +1 -1
- package/dist/index.js +22 -6
- package/dist/index.js.map +1 -1
- package/dist/tags/cast.d.ts +8 -0
- package/dist/tags/cast.d.ts.map +1 -1
- package/dist/tags/cast.js +30 -14
- package/dist/tags/cast.js.map +1 -1
- package/dist/tags/organization.d.ts +31 -0
- package/dist/tags/organization.d.ts.map +1 -1
- package/dist/tags/organization.js +49 -15
- package/dist/tags/organization.js.map +1 -1
- package/dist/tags/timeline.d.ts +20 -0
- package/dist/tags/timeline.d.ts.map +1 -1
- package/dist/tags/timeline.js +59 -23
- package/dist/tags/timeline.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMhD,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMhD,eAAO,MAAM,QAAQ,EAAE,MAoFtB,CAAC;AAEF,eAAe,QAAQ,CAAC;AAExB,YAAY,EACX,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACb,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,9 +5,9 @@ import { config } from './config.js';
|
|
|
5
5
|
export const business = {
|
|
6
6
|
name: 'business',
|
|
7
7
|
displayName: 'Business',
|
|
8
|
-
version: '0.
|
|
8
|
+
version: '0.35.0',
|
|
9
9
|
runes: {
|
|
10
|
-
|
|
10
|
+
cast: {
|
|
11
11
|
transform: cast,
|
|
12
12
|
aliases: ['team'],
|
|
13
13
|
description: 'People directory for team pages, cast lists, or speaker lineups. List items with "Name - Role" pattern become entries.',
|
|
@@ -24,13 +24,19 @@ export const business = {
|
|
|
24
24
|
transform: castMember,
|
|
25
25
|
description: 'Individual cast/team member with name and role',
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
organization: {
|
|
28
28
|
transform: organization,
|
|
29
29
|
aliases: ['business'],
|
|
30
30
|
description: 'Structured business/organization information with contact details, hours, and location',
|
|
31
31
|
seoType: 'Organization',
|
|
32
32
|
category: 'Semantic',
|
|
33
|
-
snippet: [
|
|
33
|
+
snippet: [
|
|
34
|
+
'{% organization %}',
|
|
35
|
+
'# ${1:Organization Name}',
|
|
36
|
+
'',
|
|
37
|
+
'${2:Description}',
|
|
38
|
+
'{% /organization %}',
|
|
39
|
+
],
|
|
34
40
|
fixture: `{% organization type="LocalBusiness" %}
|
|
35
41
|
# Acme Coffee Shop
|
|
36
42
|
|
|
@@ -43,12 +49,22 @@ Your neighborhood coffee shop since 2015.
|
|
|
43
49
|
- [Instagram](https://instagram.com/acmecoffee)
|
|
44
50
|
{% /organization %}`,
|
|
45
51
|
},
|
|
46
|
-
|
|
52
|
+
timeline: {
|
|
47
53
|
transform: timeline,
|
|
48
54
|
description: 'Chronological event display where headings become dated milestones',
|
|
49
55
|
seoType: 'ItemList',
|
|
50
56
|
category: 'Semantic',
|
|
51
|
-
snippet: [
|
|
57
|
+
snippet: [
|
|
58
|
+
'{% timeline %}',
|
|
59
|
+
'## ${1:2024} \\u2014 ${2:Milestone One}',
|
|
60
|
+
'',
|
|
61
|
+
'${3:Description of this milestone.}',
|
|
62
|
+
'',
|
|
63
|
+
'## ${4:2025} \\u2014 ${5:Milestone Two}',
|
|
64
|
+
'',
|
|
65
|
+
'${6:Description of this milestone.}',
|
|
66
|
+
'{% /timeline %}',
|
|
67
|
+
],
|
|
52
68
|
fixture: `{% timeline %}
|
|
53
69
|
## 2024 — Project Inception
|
|
54
70
|
Initial prototype exploring Markdoc extensions for component-rich content.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,QAAQ,GAAW;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,QAAQ,GAAW;IAC/B,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE;QACN,IAAI,EAAE;YACL,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EACV,wHAAwH;YACzH,OAAO,EAAE,QAAQ;YACjB,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE,CAAC,YAAY,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,aAAa,CAAC;YAC5F,OAAO,EAAE;;;;YAIA;SACT;QACD,aAAa,EAAE;YACd,SAAS,EAAE,UAAU;YACrB,WAAW,EAAE,gDAAgD;SAC7D;QACD,YAAY,EAAE;YACb,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,CAAC,UAAU,CAAC;YACrB,WAAW,EACV,wFAAwF;YACzF,OAAO,EAAE,cAAc;YACvB,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE;gBACR,oBAAoB;gBACpB,0BAA0B;gBAC1B,EAAE;gBACF,kBAAkB;gBAClB,qBAAqB;aACrB;YACD,OAAO,EAAE;;;;;;;;;;oBAUQ;SACjB;QACD,QAAQ,EAAE;YACT,SAAS,EAAE,QAAQ;YACnB,WAAW,EAAE,oEAAoE;YACjF,OAAO,EAAE,UAAU;YACnB,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE;gBACR,gBAAgB;gBAChB,yCAAyC;gBACzC,EAAE;gBACF,qCAAqC;gBACrC,EAAE;gBACF,yCAAyC;gBACzC,EAAE;gBACF,qCAAqC;gBACrC,iBAAiB;aACjB;YACD,OAAO,EAAE;;;;;;;;;gBASI;SACb;QACD,gBAAgB,EAAE;YACjB,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,+CAA+C;SAC5D;KACD;IACD,KAAK,EAAE;QACN,KAAK,EAAE,MAA4D;KACnE;CACD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/tags/cast.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import Markdoc from '@markdoc/markdoc';
|
|
2
|
+
export declare const castMemberSchema: {
|
|
3
|
+
readonly type: "Person";
|
|
4
|
+
readonly properties: {
|
|
5
|
+
readonly name: "name";
|
|
6
|
+
readonly role: "jobTitle";
|
|
7
|
+
readonly portrait: "image";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
2
10
|
export declare const castMember: Markdoc.Schema;
|
|
3
11
|
export declare const castSections: {
|
|
4
12
|
readonly preamble: "preamble";
|
package/dist/tags/cast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cast.d.ts","sourceRoot":"","sources":["../../src/tags/cast.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"cast.d.ts","sourceRoot":"","sources":["../../src/tags/cast.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAiBvC,eAAO,MAAM,gBAAgB;;;;;;;CAGnB,CAAC;AAEX,eAAO,MAAM,UAAU,gBA4CrB,CAAC;AAKH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,IAAI,gBAoEf,CAAC"}
|
package/dist/tags/cast.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import Markdoc from '@markdoc/markdoc';
|
|
2
2
|
const { Tag } = Markdoc;
|
|
3
|
-
import { createComponentRenderable, createContentModelSchema, asNodes, pageSectionProperties, resolveImageScheme, LAYOUT, layoutMatches } from '@refrakt-md/runes';
|
|
3
|
+
import { createComponentRenderable, createContentModelSchema, asNodes, pageSectionProperties, resolveImageScheme, LAYOUT, layoutMatches, } from '@refrakt-md/runes';
|
|
4
4
|
import { RenderableNodeCursor } from '@refrakt-md/runes';
|
|
5
|
+
// SPEC-130 / WORK-568 — Group B. `portrait` is the source that needed a name:
|
|
6
|
+
// the schema reached the image as an anonymous local variable, so nothing
|
|
7
|
+
// outside this function could see what `image` pointed at.
|
|
8
|
+
export const castMemberSchema = {
|
|
9
|
+
type: 'Person',
|
|
10
|
+
properties: { name: 'name', role: 'jobTitle', portrait: 'image' },
|
|
11
|
+
};
|
|
5
12
|
export const castMember = createContentModelSchema({
|
|
13
|
+
schema: castMemberSchema,
|
|
6
14
|
attributes: {
|
|
7
15
|
name: { type: String, required: false, description: 'Display name of the cast member.' },
|
|
8
16
|
role: { type: String, required: false, description: 'Job title or role held by this member.' },
|
|
@@ -10,9 +18,7 @@ export const castMember = createContentModelSchema({
|
|
|
10
18
|
},
|
|
11
19
|
contentModel: {
|
|
12
20
|
type: 'sequence',
|
|
13
|
-
fields: [
|
|
14
|
-
{ name: 'body', match: 'any', optional: true, greedy: true },
|
|
15
|
-
],
|
|
21
|
+
fields: [{ name: 'body', match: 'any', optional: true, greedy: true }],
|
|
16
22
|
},
|
|
17
23
|
transform(resolved, attrs, config) {
|
|
18
24
|
const nameTag = new Tag('span', {}, [attrs.name ?? '']);
|
|
@@ -29,17 +35,14 @@ export const castMember = createContentModelSchema({
|
|
|
29
35
|
children.push(portraitTag);
|
|
30
36
|
}
|
|
31
37
|
children.push(nameTag, roleTag, body.next());
|
|
32
|
-
return createComponentRenderable({
|
|
38
|
+
return createComponentRenderable({
|
|
39
|
+
rune: 'cast-member',
|
|
33
40
|
tag: 'li',
|
|
34
41
|
refs: {
|
|
35
42
|
name: nameTag,
|
|
36
43
|
role: roleTag,
|
|
37
44
|
body: body.tag('div'),
|
|
38
|
-
|
|
39
|
-
schema: {
|
|
40
|
-
name: nameTag,
|
|
41
|
-
jobTitle: roleTag,
|
|
42
|
-
...(portraitTag ? { image: portraitTag } : {}),
|
|
45
|
+
...(portraitTag ? { portrait: portraitTag } : {}),
|
|
43
46
|
},
|
|
44
47
|
children,
|
|
45
48
|
});
|
|
@@ -48,19 +51,31 @@ export const castMember = createContentModelSchema({
|
|
|
48
51
|
// SPEC-125 Phase 2 — join tables the rune declares about itself. Referenced
|
|
49
52
|
// from the theme config rather than owned by it: a theme may not redefine
|
|
50
53
|
// what a section *is* (ADR-028).
|
|
51
|
-
export const castSections = {
|
|
54
|
+
export const castSections = {
|
|
55
|
+
preamble: 'preamble',
|
|
56
|
+
headline: 'title',
|
|
57
|
+
blurb: 'description',
|
|
58
|
+
};
|
|
52
59
|
export const cast = createContentModelSchema({
|
|
53
60
|
sections: castSections,
|
|
54
61
|
attributes: {
|
|
55
62
|
// `grid`/`list`/`carousel` from the canonical const (ADR-018 / SPEC-100).
|
|
56
|
-
layout: {
|
|
63
|
+
layout: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: false,
|
|
66
|
+
matches: layoutMatches([LAYOUT.grid, LAYOUT.list, LAYOUT.carousel]),
|
|
67
|
+
description: 'Visual arrangement of members: grid (cards), list (compact roster), or carousel (scroll-snap track).',
|
|
68
|
+
},
|
|
57
69
|
},
|
|
58
70
|
contentModel: {
|
|
59
71
|
type: 'sequence',
|
|
60
72
|
fields: [
|
|
61
73
|
{ name: 'header', match: 'heading|paragraph|image', optional: true, greedy: true },
|
|
62
74
|
{
|
|
63
|
-
name: 'members',
|
|
75
|
+
name: 'members',
|
|
76
|
+
match: 'list',
|
|
77
|
+
optional: true,
|
|
78
|
+
greedy: true,
|
|
64
79
|
itemModel: {
|
|
65
80
|
fields: [
|
|
66
81
|
{ name: 'image', match: 'image', optional: true, extract: 'src' },
|
|
@@ -88,7 +103,8 @@ export const cast = createContentModelSchema({
|
|
|
88
103
|
children.push(header.wrap('header').next());
|
|
89
104
|
}
|
|
90
105
|
children.push(membersList);
|
|
91
|
-
return createComponentRenderable({
|
|
106
|
+
return createComponentRenderable({
|
|
107
|
+
rune: 'cast',
|
|
92
108
|
tag: 'section',
|
|
93
109
|
property: 'contentSection',
|
|
94
110
|
properties: {
|
package/dist/tags/cast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cast.js","sourceRoot":"","sources":["../../src/tags/cast.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"cast.js","sourceRoot":"","sources":["../../src/tags/cast.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;AACxB,OAAO,EACN,yBAAyB,EACzB,wBAAwB,EACxB,OAAO,EACP,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,EACN,aAAa,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,8EAA8E;AAC9E,0EAA0E;AAC1E,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D,CAAC,CAAC"}
|
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
import Markdoc from '@markdoc/markdoc';
|
|
2
|
+
/**
|
|
3
|
+
* The organization categories an author may write, which are also the
|
|
4
|
+
* schema.org types they publish.
|
|
5
|
+
*
|
|
6
|
+
* WORK-568 corrected the sixth: schema.org has `NGO`, and has never had
|
|
7
|
+
* `NonProfit`. The enum validated against itself, so `matches` was satisfied and
|
|
8
|
+
* nothing noticed the value was not in the vocabulary it claimed to speak —
|
|
9
|
+
* every site writing `type="NonProfit"` published a `@type` no consumer
|
|
10
|
+
* resolves. It is SPEC-130's argument in miniature: the mapping was already a
|
|
11
|
+
* curated table, already wrong, and wrong somewhere no tool could look.
|
|
12
|
+
*/
|
|
13
|
+
declare const orgType: readonly ["Organization", "LocalBusiness", "Corporation", "EducationalOrganization", "GovernmentOrganization", "NGO"];
|
|
14
|
+
declare const orgProperties: {
|
|
15
|
+
readonly headline: "name";
|
|
16
|
+
readonly blurb: "description";
|
|
17
|
+
};
|
|
18
|
+
export declare const organizationSchema: {
|
|
19
|
+
by: string;
|
|
20
|
+
rows: Record<(typeof orgType)[number], {
|
|
21
|
+
type: string;
|
|
22
|
+
properties: typeof orgProperties;
|
|
23
|
+
}>;
|
|
24
|
+
fallback: {
|
|
25
|
+
type: string;
|
|
26
|
+
properties: {
|
|
27
|
+
readonly headline: "name";
|
|
28
|
+
readonly blurb: "description";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
2
32
|
export declare const organizationSections: {
|
|
3
33
|
readonly preamble: "preamble";
|
|
4
34
|
readonly headline: "title";
|
|
@@ -6,4 +36,5 @@ export declare const organizationSections: {
|
|
|
6
36
|
readonly body: "body";
|
|
7
37
|
};
|
|
8
38
|
export declare const organization: Markdoc.Schema;
|
|
39
|
+
export {};
|
|
9
40
|
//# sourceMappingURL=organization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/tags/organization.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/tags/organization.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAYvC;;;;;;;;;;GAUG;AACH,QAAA,MAAM,OAAO,uHAOH,CAAC;AAIX,QAAA,MAAM,aAAa;;;CAAsD,CAAC;AAO1E,eAAO,MAAM,kBAAkB;;UAIzB,MAAM,CAAC,CAAC,OAAO,OAAO,EAAE,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,aAAa,CAAA;KAAE,CAAC;;;;;;;;CAEzF,CAAC;AAKF,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAEX,eAAO,MAAM,YAAY,gBAiDvB,CAAC"}
|
|
@@ -1,16 +1,58 @@
|
|
|
1
1
|
import Markdoc from '@markdoc/markdoc';
|
|
2
2
|
const { Tag } = Markdoc;
|
|
3
|
-
import { createContentModelSchema, createComponentRenderable, asNodes, RenderableNodeCursor, pageSectionProperties, unwrapParagraphImages } from '@refrakt-md/runes';
|
|
4
|
-
|
|
3
|
+
import { createContentModelSchema, createComponentRenderable, asNodes, RenderableNodeCursor, pageSectionProperties, unwrapParagraphImages, } from '@refrakt-md/runes';
|
|
4
|
+
/**
|
|
5
|
+
* The organization categories an author may write, which are also the
|
|
6
|
+
* schema.org types they publish.
|
|
7
|
+
*
|
|
8
|
+
* WORK-568 corrected the sixth: schema.org has `NGO`, and has never had
|
|
9
|
+
* `NonProfit`. The enum validated against itself, so `matches` was satisfied and
|
|
10
|
+
* nothing noticed the value was not in the vocabulary it claimed to speak —
|
|
11
|
+
* every site writing `type="NonProfit"` published a `@type` no consumer
|
|
12
|
+
* resolves. It is SPEC-130's argument in miniature: the mapping was already a
|
|
13
|
+
* curated table, already wrong, and wrong somewhere no tool could look.
|
|
14
|
+
*/
|
|
15
|
+
const orgType = [
|
|
16
|
+
'Organization',
|
|
17
|
+
'LocalBusiness',
|
|
18
|
+
'Corporation',
|
|
19
|
+
'EducationalOrganization',
|
|
20
|
+
'GovernmentOrganization',
|
|
21
|
+
'NGO',
|
|
22
|
+
];
|
|
23
|
+
// The properties are the same whichever row is selected — all six are
|
|
24
|
+
// `Organization` subtypes, so they share its `name` and `description`.
|
|
25
|
+
const orgProperties = { headline: 'name', blurb: 'description' };
|
|
26
|
+
// SPEC-130 / WORK-568 — `organization` was already doing what this milestone
|
|
27
|
+
// proposes: deriving a schema.org type from a content attribute, written
|
|
28
|
+
// imperatively as `typeof: attrs.type`. `by: 'type'` says the same thing where a
|
|
29
|
+
// reviewer can read it, and keys the rows off the one list that also feeds
|
|
30
|
+
// `matches`, so the accepted values and the published types cannot drift.
|
|
31
|
+
export const organizationSchema = {
|
|
32
|
+
by: 'type',
|
|
33
|
+
rows: Object.fromEntries(orgType.map((type) => [type, { type, properties: orgProperties }])),
|
|
34
|
+
fallback: { type: 'Organization', properties: orgProperties },
|
|
35
|
+
};
|
|
5
36
|
// SPEC-125 Phase 2 — join tables the rune declares about itself. Referenced
|
|
6
37
|
// from the theme config rather than owned by it: a theme may not redefine
|
|
7
38
|
// what a section *is* (ADR-028).
|
|
8
|
-
export const organizationSections = {
|
|
39
|
+
export const organizationSections = {
|
|
40
|
+
preamble: 'preamble',
|
|
41
|
+
headline: 'title',
|
|
42
|
+
blurb: 'description',
|
|
43
|
+
body: 'body',
|
|
44
|
+
};
|
|
9
45
|
export const organization = createContentModelSchema({
|
|
46
|
+
schema: organizationSchema,
|
|
10
47
|
sections: organizationSections,
|
|
11
48
|
provides: ['prose'],
|
|
12
49
|
attributes: {
|
|
13
|
-
type: {
|
|
50
|
+
type: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: false,
|
|
53
|
+
matches: orgType.slice(),
|
|
54
|
+
description: 'Schema.org organization category used for structured data.',
|
|
55
|
+
},
|
|
14
56
|
},
|
|
15
57
|
contentModel: {
|
|
16
58
|
type: 'sequence',
|
|
@@ -27,10 +69,10 @@ export const organization = createContentModelSchema({
|
|
|
27
69
|
const typeMeta = new Tag('meta', { content: attrs.type ?? 'Organization' });
|
|
28
70
|
const sectionProps = pageSectionProperties(header);
|
|
29
71
|
const bodyDiv = body.wrap('div');
|
|
30
|
-
return createComponentRenderable({
|
|
72
|
+
return createComponentRenderable({
|
|
73
|
+
rune: 'organization',
|
|
31
74
|
tag: 'article',
|
|
32
75
|
property: 'contentSection',
|
|
33
|
-
typeof: attrs.type || undefined,
|
|
34
76
|
properties: {
|
|
35
77
|
type: typeMeta,
|
|
36
78
|
},
|
|
@@ -38,15 +80,7 @@ export const organization = createContentModelSchema({
|
|
|
38
80
|
...sectionProps,
|
|
39
81
|
body: bodyDiv,
|
|
40
82
|
},
|
|
41
|
-
|
|
42
|
-
name: sectionProps.headline,
|
|
43
|
-
description: sectionProps.blurb,
|
|
44
|
-
},
|
|
45
|
-
children: [
|
|
46
|
-
typeMeta,
|
|
47
|
-
header.wrap('header').next(),
|
|
48
|
-
bodyDiv.next(),
|
|
49
|
-
],
|
|
83
|
+
children: [typeMeta, header.wrap('header').next(), bodyDiv.next()],
|
|
50
84
|
});
|
|
51
85
|
},
|
|
52
86
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../src/tags/organization.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../src/tags/organization.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;AACxB,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EACzB,OAAO,EACP,oBAAoB,EACpB,qB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ts
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import Markdoc from '@markdoc/markdoc';
|
|
2
|
+
export declare const timelineEntrySchema: {
|
|
3
|
+
readonly type: "ListItem";
|
|
4
|
+
readonly properties: {
|
|
5
|
+
readonly label: "name";
|
|
6
|
+
readonly date: "description";
|
|
7
|
+
};
|
|
8
|
+
};
|
|
2
9
|
export declare const timelineEntry: Markdoc.Schema;
|
|
3
10
|
export declare const timelineSections: {
|
|
4
11
|
readonly preamble: "preamble";
|
|
5
12
|
readonly headline: "title";
|
|
6
13
|
readonly blurb: "description";
|
|
7
14
|
};
|
|
15
|
+
export declare const timelineSchema: {
|
|
16
|
+
readonly type: "ItemList";
|
|
17
|
+
readonly lists: readonly ["itemListElement"];
|
|
18
|
+
readonly children: {
|
|
19
|
+
readonly 'timeline-entry': {
|
|
20
|
+
readonly type: "ListItem";
|
|
21
|
+
readonly property: "itemListElement";
|
|
22
|
+
readonly generated: {
|
|
23
|
+
readonly position: "index";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
8
28
|
export declare const timeline: Markdoc.Schema;
|
|
9
29
|
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../src/tags/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../src/tags/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAmBvC,eAAO,MAAM,mBAAmB;;;;;;CAGtB,CAAC;AAEX,eAAO,MAAM,aAAa,gBAoCxB,CAAC;AAKH,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAUX,eAAO,MAAM,cAAc;;;;;;;;;;;;CAUjB,CAAC;AAEX,eAAO,MAAM,QAAQ,gBA+DnB,CAAC"}
|
package/dist/tags/timeline.js
CHANGED
|
@@ -1,32 +1,48 @@
|
|
|
1
1
|
import Markdoc from '@markdoc/markdoc';
|
|
2
2
|
const { Tag } = Markdoc;
|
|
3
|
-
import { createComponentRenderable, createContentModelSchema, asNodes, RenderableNodeCursor, pageSectionProperties } from '@refrakt-md/runes';
|
|
3
|
+
import { createComponentRenderable, createContentModelSchema, asNodes, RenderableNodeCursor, pageSectionProperties, } from '@refrakt-md/runes';
|
|
4
|
+
// SPEC-130 / WORK-568 — Group B, the flat half of the pair. The entry declares
|
|
5
|
+
// what it says about itself; `timelineSchema` below declares the property that
|
|
6
|
+
// holds it and the position it sits at, because only the parent knows an index.
|
|
7
|
+
//
|
|
8
|
+
// `description` for the date is what shipped, recorded in the baseline. It is a
|
|
9
|
+
// stretch — `ListItem` has no date property, and `startDate` would need a
|
|
10
|
+
// different `@type` — but reproducing it exactly was that item's job; changing
|
|
11
|
+
// the claim is not.
|
|
12
|
+
export const timelineEntrySchema = {
|
|
13
|
+
type: 'ListItem',
|
|
14
|
+
properties: { label: 'name', date: 'description' },
|
|
15
|
+
};
|
|
4
16
|
export const timelineEntry = createContentModelSchema({
|
|
17
|
+
schema: timelineEntrySchema,
|
|
5
18
|
attributes: {
|
|
6
|
-
date: {
|
|
7
|
-
|
|
19
|
+
date: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: false,
|
|
22
|
+
description: 'Date or time shown on this entry (e.g. "2024-03", "Q1 2025").',
|
|
23
|
+
},
|
|
24
|
+
label: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: false,
|
|
27
|
+
description: 'Short title or milestone name for the entry.',
|
|
28
|
+
},
|
|
8
29
|
},
|
|
9
30
|
contentModel: {
|
|
10
31
|
type: 'sequence',
|
|
11
|
-
fields: [
|
|
12
|
-
{ name: 'body', match: 'any', optional: true, greedy: true },
|
|
13
|
-
],
|
|
32
|
+
fields: [{ name: 'body', match: 'any', optional: true, greedy: true }],
|
|
14
33
|
},
|
|
15
34
|
transform(resolved, attrs, config) {
|
|
16
35
|
const dateTag = new Tag('time', {}, [attrs.date ?? '']);
|
|
17
36
|
const labelTag = new Tag('span', {}, [attrs.label ?? '']);
|
|
18
37
|
const body = new RenderableNodeCursor(Markdoc.transform(asNodes(resolved.body), config)).wrap('div');
|
|
19
|
-
return createComponentRenderable({
|
|
38
|
+
return createComponentRenderable({
|
|
39
|
+
rune: 'timeline-entry',
|
|
20
40
|
tag: 'li',
|
|
21
41
|
refs: {
|
|
22
42
|
date: dateTag,
|
|
23
43
|
label: labelTag,
|
|
24
44
|
body: body.tag('div'),
|
|
25
45
|
},
|
|
26
|
-
schema: {
|
|
27
|
-
name: labelTag,
|
|
28
|
-
description: dateTag,
|
|
29
|
-
},
|
|
30
46
|
children: [dateTag, labelTag, body.next()],
|
|
31
47
|
});
|
|
32
48
|
},
|
|
@@ -34,11 +50,39 @@ export const timelineEntry = createContentModelSchema({
|
|
|
34
50
|
// SPEC-125 Phase 2 — join tables the rune declares about itself. Referenced
|
|
35
51
|
// from the theme config rather than owned by it: a theme may not redefine
|
|
36
52
|
// what a section *is* (ADR-028).
|
|
37
|
-
export const timelineSections = {
|
|
53
|
+
export const timelineSections = {
|
|
54
|
+
preamble: 'preamble',
|
|
55
|
+
headline: 'title',
|
|
56
|
+
blurb: 'description',
|
|
57
|
+
};
|
|
58
|
+
// SPEC-130 / WORK-571 — the other half of `position: 'index'`. `timeline` used
|
|
59
|
+
// to walk its entries and push a `<meta property="position">` into each; the
|
|
60
|
+
// index is now declared and the applier generates it, as `String(index + 1)` so
|
|
61
|
+
// the RDFa and the JSON-LD agree.
|
|
62
|
+
//
|
|
63
|
+
// `itemListElement` is a declared list, so a one-entry timeline emits an array
|
|
64
|
+
// like any other (D6). The `ItemList` itself carries no properties of its own —
|
|
65
|
+
// that is what shipped, and the entries keep it from being a bare entity (D4).
|
|
66
|
+
export const timelineSchema = {
|
|
67
|
+
type: 'ItemList',
|
|
68
|
+
lists: ['itemListElement'],
|
|
69
|
+
children: {
|
|
70
|
+
'timeline-entry': {
|
|
71
|
+
type: 'ListItem',
|
|
72
|
+
property: 'itemListElement',
|
|
73
|
+
generated: { position: 'index' },
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
38
77
|
export const timeline = createContentModelSchema({
|
|
78
|
+
schema: timelineSchema,
|
|
39
79
|
sections: timelineSections,
|
|
40
80
|
attributes: {
|
|
41
|
-
direction: {
|
|
81
|
+
direction: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: false,
|
|
84
|
+
description: 'Axis along which entries are laid out (vertical or horizontal).',
|
|
85
|
+
},
|
|
42
86
|
},
|
|
43
87
|
contentModel: () => ({
|
|
44
88
|
type: 'sections',
|
|
@@ -67,19 +111,14 @@ export const timeline = createContentModelSchema({
|
|
|
67
111
|
const sectionNodes = new RenderableNodeCursor(Markdoc.transform(allItems, config));
|
|
68
112
|
const directionMeta = new Tag('meta', { content: attrs.direction ?? 'vertical' });
|
|
69
113
|
const items = sectionNodes.tag('li').typeof('TimelineEntry');
|
|
70
|
-
// Inject position meta into each entry for schema.org ListItem
|
|
71
|
-
items.toArray().forEach((entry, index) => {
|
|
72
|
-
if (Tag.isTag(entry)) {
|
|
73
|
-
entry.children.push(new Tag('meta', { property: 'position', content: index + 1 }));
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
114
|
const entriesList = new Tag('ol', {}, items.toArray());
|
|
77
115
|
const children = [directionMeta];
|
|
78
116
|
if (headerNodes.count() > 0) {
|
|
79
117
|
children.push(headerNodes.wrap('header').next());
|
|
80
118
|
}
|
|
81
119
|
children.push(entriesList);
|
|
82
|
-
return createComponentRenderable({
|
|
120
|
+
return createComponentRenderable({
|
|
121
|
+
rune: 'timeline',
|
|
83
122
|
tag: 'section',
|
|
84
123
|
property: 'contentSection',
|
|
85
124
|
properties: {
|
|
@@ -87,9 +126,6 @@ export const timeline = createContentModelSchema({
|
|
|
87
126
|
entry: items,
|
|
88
127
|
},
|
|
89
128
|
refs: { ...pageSectionProperties(headerNodes), entries: entriesList },
|
|
90
|
-
schema: {
|
|
91
|
-
itemListElement: items,
|
|
92
|
-
},
|
|
93
129
|
children,
|
|
94
130
|
});
|
|
95
131
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../src/tags/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../src/tags/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;AACxB,OAAO,EACN,yBAAyB,EACzB,wBAAwB,EACxB,OAAO,EACP,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,EAAE;AACF,gFAAgF;AAChF,0EAA0E;AAC1E,+EAA+E;AAC/E,oBAAoB;AACpB,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE;CACzC,CAAC;AAEX,MAAM,CAAC,MAAM,aAAa,GAAG,wBAAwB,CAAC;IACrD,MAAM,EAAE,mBAAmB;IAC3B,UAAU,EAAE;QACX,IAAI,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,+DAA+D;SAC5E;QACD,KAAK,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,8CAA8C;SAC3D;KACD;IACD,YAAY,EAAE;QACb,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,CAAC,EAAE,IA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AU,EAAE;gBACX,SAAS,EAAE,aAAa;gBACxB,KAAK,EAAE,KAAK;aACZ;YACD,IAAI,EAAE,EAAE,GAAG,qBAAqB,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE;YACrE,QAAQ;SACR,CAAC,CAAC;IACJ,CAAC;CACD,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refrakt-md/business",
|
|
3
3
|
"description": "Business runes for refrakt.md — team pages, organizations, and timelines",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.35.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"build": "tsc"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@refrakt-md/types": "0.
|
|
25
|
-
"@refrakt-md/transform": "0.
|
|
26
|
-
"@refrakt-md/runes": "0.
|
|
24
|
+
"@refrakt-md/types": "0.35.0",
|
|
25
|
+
"@refrakt-md/transform": "0.35.0",
|
|
26
|
+
"@refrakt-md/runes": "0.35.0",
|
|
27
27
|
"@markdoc/markdoc": "0.4.0",
|
|
28
28
|
"reflect-metadata": "^0.2.0"
|
|
29
29
|
}
|