@resumekit/react 0.1.0 → 0.2.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/document.css +1 -0
- package/dist/export-bundle/bundle.css +1 -1
- package/dist/export-bundle/bundle.js +10 -10
- package/dist/kit/documentStyle.d.ts +8 -0
- package/dist/kit/documentStyle.d.ts.map +1 -1
- package/dist/kit/documentStyle.js +41 -1
- package/dist/kit/typography.css +86 -0
- package/dist/nodes/formatting.d.ts +5 -1
- package/dist/nodes/formatting.d.ts.map +1 -1
- package/dist/nodes/formatting.js +4 -1
- package/dist/nodes/locked.d.ts.map +1 -1
- package/dist/nodes/locked.js +3 -0
- package/dist/static/static.mjs +155 -4
- package/dist/templates/academic/AcademicDocument.d.ts.map +1 -1
- package/dist/templates/academic/AcademicDocument.js +2 -2
- package/dist/templates/alta/AltaDocument.d.ts.map +1 -1
- package/dist/templates/alta/AltaDocument.js +2 -2
- package/dist/templates/classic/ClassicDocument.d.ts.map +1 -1
- package/dist/templates/classic/ClassicDocument.js +2 -2
- package/dist/templates/cobalt/CobaltDocument.d.ts.map +1 -1
- package/dist/templates/cobalt/CobaltDocument.js +2 -2
- package/dist/templates/compact/CompactDocument.d.ts.map +1 -1
- package/dist/templates/compact/CompactDocument.js +2 -2
- package/dist/templates/contemporary/ContemporaryDocument.d.ts.map +1 -1
- package/dist/templates/contemporary/ContemporaryDocument.js +2 -2
- package/dist/templates/creative/CreativeDocument.d.ts.map +1 -1
- package/dist/templates/creative/CreativeDocument.js +2 -2
- package/dist/templates/crimson/CrimsonDocument.d.ts.map +1 -1
- package/dist/templates/crimson/CrimsonDocument.js +2 -2
- package/dist/templates/curve/CurveDocument.d.ts.map +1 -1
- package/dist/templates/curve/CurveDocument.js +2 -2
- package/dist/templates/double-column/DoubleColumnDocument.d.ts.map +1 -1
- package/dist/templates/double-column/DoubleColumnDocument.js +2 -2
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.d.ts.map +1 -1
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.js +2 -2
- package/dist/templates/elegant/ElegantDocument.d.ts.map +1 -1
- package/dist/templates/elegant/ElegantDocument.js +2 -2
- package/dist/templates/elegant-logos/ElegantLogosDocument.d.ts.map +1 -1
- package/dist/templates/elegant-logos/ElegantLogosDocument.js +2 -2
- package/dist/templates/engineer/EngineerDocument.d.ts.map +1 -1
- package/dist/templates/engineer/EngineerDocument.js +2 -2
- package/dist/templates/executive/ExecutiveDocument.d.ts.map +1 -1
- package/dist/templates/executive/ExecutiveDocument.js +2 -2
- package/dist/templates/harvard/HarvardDocument.d.ts.map +1 -1
- package/dist/templates/harvard/HarvardDocument.js +2 -2
- package/dist/templates/hipster/HipsterDocument.d.ts.map +1 -1
- package/dist/templates/hipster/HipsterDocument.js +2 -2
- package/dist/templates/ivy/IvyDocument.d.ts.map +1 -1
- package/dist/templates/ivy/IvyDocument.js +2 -2
- package/dist/templates/meridian/MeridianDocument.d.ts.map +1 -1
- package/dist/templates/meridian/MeridianDocument.js +2 -2
- package/dist/templates/modern/ModernDocument.d.ts.map +1 -1
- package/dist/templates/modern/ModernDocument.js +2 -2
- package/dist/templates/polished/PolishedDocument.d.ts.map +1 -1
- package/dist/templates/polished/PolishedDocument.js +2 -2
- package/dist/templates/portrait/PortraitDocument.d.ts.map +1 -1
- package/dist/templates/portrait/PortraitDocument.js +2 -2
- package/dist/templates/prism/PrismDocument.d.ts.map +1 -1
- package/dist/templates/prism/PrismDocument.js +2 -2
- package/dist/templates/scholar/ScholarDocument.d.ts.map +1 -1
- package/dist/templates/scholar/ScholarDocument.js +2 -2
- package/dist/templates/split/SplitDocument.d.ts.map +1 -1
- package/dist/templates/split/SplitDocument.js +2 -2
- package/dist/templates/stylish/StylishDocument.d.ts.map +1 -1
- package/dist/templates/stylish/StylishDocument.js +2 -2
- package/dist/templates/timeline/TimelineDocument.d.ts.map +1 -1
- package/dist/templates/timeline/TimelineDocument.js +2 -2
- package/package.json +2 -2
- package/src/compiler/emit.ts +2 -2
- package/src/kit/documentStyle.ts +47 -0
- package/src/nodes/formatting.ts +13 -1
- package/src/nodes/locked.ts +3 -0
- package/src/templates/academic/AcademicDocument.tsx +5 -1
- package/src/templates/alta/AltaDocument.tsx +5 -1
- package/src/templates/classic/ClassicDocument.tsx +5 -1
- package/src/templates/cobalt/CobaltDocument.tsx +5 -1
- package/src/templates/compact/CompactDocument.tsx +5 -1
- package/src/templates/contemporary/ContemporaryDocument.tsx +5 -1
- package/src/templates/creative/CreativeDocument.tsx +5 -1
- package/src/templates/crimson/CrimsonDocument.tsx +5 -1
- package/src/templates/curve/CurveDocument.tsx +5 -1
- package/src/templates/double-column/DoubleColumnDocument.tsx +5 -1
- package/src/templates/double-column-logos/DoubleColumnLogosDocument.tsx +5 -1
- package/src/templates/elegant/ElegantDocument.tsx +5 -1
- package/src/templates/elegant-logos/ElegantLogosDocument.tsx +5 -1
- package/src/templates/engineer/EngineerDocument.tsx +5 -1
- package/src/templates/executive/ExecutiveDocument.tsx +5 -1
- package/src/templates/harvard/HarvardDocument.tsx +5 -1
- package/src/templates/hipster/HipsterDocument.tsx +5 -1
- package/src/templates/ivy/IvyDocument.tsx +5 -1
- package/src/templates/meridian/MeridianDocument.tsx +5 -1
- package/src/templates/modern/ModernDocument.tsx +5 -1
- package/src/templates/polished/PolishedDocument.tsx +5 -1
- package/src/templates/portrait/PortraitDocument.tsx +5 -1
- package/src/templates/prism/PrismDocument.tsx +5 -1
- package/src/templates/scholar/ScholarDocument.tsx +5 -1
- package/src/templates/split/SplitDocument.tsx +5 -1
- package/src/templates/stylish/StylishDocument.tsx +5 -1
- package/src/templates/timeline/TimelineDocument.tsx +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitDocument.d.ts","sourceRoot":"","sources":["../../../src/templates/split/SplitDocument.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"SplitDocument.d.ts","sourceRoot":"","sources":["../../../src/templates/split/SplitDocument.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAwBtD,OAAO,sBAAsB,CAAC;AAC9B,OAAO,aAAa,CAAC;AAGrB,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE,kBAAkB,+BAmQ3D"}
|
|
@@ -11,7 +11,7 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
11
11
|
import { TagSkillGroup } from '../../kit/TagSkillGroup.js';
|
|
12
12
|
import { nameParts } from '../../kit/textShapes.js';
|
|
13
13
|
import { useContactLines } from '../../kit/contact.js';
|
|
14
|
-
import { documentStyle } from '../../kit/documentStyle.js';
|
|
14
|
+
import { documentStyle, documentStyleAttributes, } from '../../kit/documentStyle.js';
|
|
15
15
|
import { Heading } from '../../kit/Heading.js';
|
|
16
16
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
17
17
|
import { SplitCustomEntry, SplitEducationEntry, SplitExperienceEntry, } from './entries.js';
|
|
@@ -25,5 +25,5 @@ export function SplitDocument({ resume }) {
|
|
|
25
25
|
const authoring = useAuthoring() !== null;
|
|
26
26
|
const contact = useContactLines(resume.contact, ['location'], authoring);
|
|
27
27
|
const contact2 = useContactLines(resume.contact, ['email', 'phone'], authoring);
|
|
28
|
-
return (_jsxs("article", { className: "tpl-split", style: documentStyle('sp', style), "aria-label": doc.t.resume, lang: doc.locale, children: [_jsxs("header", { className: "tpl-split__head", "data-block": true, children: [_jsx(Heading, { level: 1, className: "tpl-split__name", children: _jsx(EditableText, { path: "name", value: resume.name, shape: nameParts('tpl-split__name-first', 'tpl-split__name-last') }) }), (resume.headline || authoring) && (_jsx("p", { className: "tpl-split__headline", children: _jsx(EditableText, { path: "headline", value: resume.headline ?? '', placeholder: placeholder('headline') }) })), contact.length > 0 && (_jsx("p", { className: "tpl-split__contact", children: contact.map(({ field, path, value, placeholder }) => (_jsx("span", { className: `tpl-split__contact-item tpl-contact--${field}`, children: _jsx(EditableText, { path: path, value: value, placeholder: placeholder }) }, path))) })), contact2.length > 0 && (_jsx("p", { className: "tpl-split__contact", children: contact2.map(({ field, path, value, placeholder }) => (_jsx("span", { className: `tpl-split__contact-item tpl-contact--${field}`, children: _jsx(EditableText, { path: path, value: value, placeholder: placeholder }) }, path))) }))] }), _jsxs("div", { className: "tpl-split__body", "data-layout": "row", children: [_jsxs("aside", { className: "tpl-split__aside", "data-flow": true, children: [(resume.education.length > 0 || authoring) && (_jsx(DocumentSection, { id: "education", heading: resume.section_headings?.education, title: doc.t.sections.education, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx(Collection, { section: "education", items: resume.education, children: ({ item, path, chrome, itemProps }) => (_jsx(SplitEducationEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), (resume.links.length > 0 || authoring) && (_jsxs("section", { className: "tpl-split__section", children: [_jsx(Heading, { level: 2, className: "tpl-split__heading", "data-block": true, "data-keep-with-next": true, children: doc.t.panels.links }), _jsx("ul", { className: "tpl-split__links", "data-block": true, "data-split": true, children: _jsx(Collection, { section: "links", items: resume.links, gap: false, children: ({ item, path, chrome, itemProps, justAdded }) => (_jsxs("li", { ...itemProps, className: "tpl-split__link tpl-contact--link", children: [chrome, _jsx(LinkField, { item: item, path: path, justAdded: justAdded })] })) }) })] })), _jsx(DescribedEntries, { id: "courses", heading: resume.section_headings?.courses, title: doc.t.sections.courses, className: "tpl-split__section tpl-split__courses", headingClassName: "tpl-split__heading", items: resume.courses, entryClassName: "tpl-split__described" }), (resume.skills.length > 0 || authoring) && (_jsx(DocumentSection, { id: "skills", heading: resume.section_headings?.skills, title: doc.t.sections.skills, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx("div", { className: "tpl-skill-tags", children: _jsx(Collection, { section: "skills", items: resume.skills, children: ({ item, path, chrome, itemProps }) => (_jsx(TagSkillGroup, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) }) })), _jsx(LanguageList, { items: resume.languages, heading: resume.section_headings?.languages, className: "tpl-split__section", headingClassName: "tpl-split__heading", rowClassName: "tpl-split__language" }), (resume.certifications.length > 0 || authoring) && (_jsx(DocumentSection, { id: "certifications", heading: resume.section_headings?.certifications, title: doc.t.sections.certifications, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx("div", { "data-block": true, "data-split": true, children: _jsx(EditableBulletList, { path: "certifications", items: resume.certifications, placeholder: placeholder('certification') }) }) })), _jsx(DescribedEntries, { id: "passions", heading: resume.section_headings?.passions, title: doc.t.sections.passions, className: "tpl-split__section", headingClassName: "tpl-split__heading", items: resume.passions, entryClassName: "tpl-split__described" })] }), _jsxs("div", { className: "tpl-split__main", "data-flow": true, children: [(resume.summary || authoring) && (_jsx(DocumentSection, { id: "summary", heading: resume.section_headings?.summary, title: doc.t.sections.summary, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx("p", { className: "tpl-split__prose", "data-block": true, children: _jsx(EditableText, { path: "summary", value: resume.summary ?? '', placeholder: placeholder('summary'), multiline: true }) }) })), (resume.experience.length > 0 || authoring) && (_jsx(DocumentSection, { id: "experience", heading: resume.section_headings?.experience, title: doc.t.sections.experience, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx(Collection, { section: "experience", items: resume.experience, children: ({ item, path, chrome, itemProps }) => (_jsx(SplitExperienceEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), _jsx(DescribedEntries, { id: "achievements", heading: resume.section_headings?.achievements, title: doc.t.sections.achievements, className: "tpl-split__section", headingClassName: "tpl-split__heading", items: resume.achievements, entryClassName: "tpl-split__described" }), _jsx(CustomSections, { sections: resume.custom_sections, sectionClass: "tpl-split__section", headingClass: "tpl-split__heading", Entry: SplitCustomEntry })] })] })] }));
|
|
28
|
+
return (_jsxs("article", { className: "tpl-split", style: documentStyle('sp', style), ...documentStyleAttributes(style), "aria-label": doc.t.resume, lang: doc.locale, children: [_jsxs("header", { className: "tpl-split__head", "data-block": true, children: [_jsx(Heading, { level: 1, className: "tpl-split__name", children: _jsx(EditableText, { path: "name", value: resume.name, shape: nameParts('tpl-split__name-first', 'tpl-split__name-last') }) }), (resume.headline || authoring) && (_jsx("p", { className: "tpl-split__headline", children: _jsx(EditableText, { path: "headline", value: resume.headline ?? '', placeholder: placeholder('headline') }) })), contact.length > 0 && (_jsx("p", { className: "tpl-split__contact", children: contact.map(({ field, path, value, placeholder }) => (_jsx("span", { className: `tpl-split__contact-item tpl-contact--${field}`, children: _jsx(EditableText, { path: path, value: value, placeholder: placeholder }) }, path))) })), contact2.length > 0 && (_jsx("p", { className: "tpl-split__contact", children: contact2.map(({ field, path, value, placeholder }) => (_jsx("span", { className: `tpl-split__contact-item tpl-contact--${field}`, children: _jsx(EditableText, { path: path, value: value, placeholder: placeholder }) }, path))) }))] }), _jsxs("div", { className: "tpl-split__body", "data-layout": "row", children: [_jsxs("aside", { className: "tpl-split__aside", "data-flow": true, children: [(resume.education.length > 0 || authoring) && (_jsx(DocumentSection, { id: "education", heading: resume.section_headings?.education, title: doc.t.sections.education, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx(Collection, { section: "education", items: resume.education, children: ({ item, path, chrome, itemProps }) => (_jsx(SplitEducationEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), (resume.links.length > 0 || authoring) && (_jsxs("section", { className: "tpl-split__section", children: [_jsx(Heading, { level: 2, className: "tpl-split__heading", "data-block": true, "data-keep-with-next": true, children: doc.t.panels.links }), _jsx("ul", { className: "tpl-split__links", "data-block": true, "data-split": true, children: _jsx(Collection, { section: "links", items: resume.links, gap: false, children: ({ item, path, chrome, itemProps, justAdded }) => (_jsxs("li", { ...itemProps, className: "tpl-split__link tpl-contact--link", children: [chrome, _jsx(LinkField, { item: item, path: path, justAdded: justAdded })] })) }) })] })), _jsx(DescribedEntries, { id: "courses", heading: resume.section_headings?.courses, title: doc.t.sections.courses, className: "tpl-split__section tpl-split__courses", headingClassName: "tpl-split__heading", items: resume.courses, entryClassName: "tpl-split__described" }), (resume.skills.length > 0 || authoring) && (_jsx(DocumentSection, { id: "skills", heading: resume.section_headings?.skills, title: doc.t.sections.skills, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx("div", { className: "tpl-skill-tags", children: _jsx(Collection, { section: "skills", items: resume.skills, children: ({ item, path, chrome, itemProps }) => (_jsx(TagSkillGroup, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) }) })), _jsx(LanguageList, { items: resume.languages, heading: resume.section_headings?.languages, className: "tpl-split__section", headingClassName: "tpl-split__heading", rowClassName: "tpl-split__language" }), (resume.certifications.length > 0 || authoring) && (_jsx(DocumentSection, { id: "certifications", heading: resume.section_headings?.certifications, title: doc.t.sections.certifications, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx("div", { "data-block": true, "data-split": true, children: _jsx(EditableBulletList, { path: "certifications", items: resume.certifications, placeholder: placeholder('certification') }) }) })), _jsx(DescribedEntries, { id: "passions", heading: resume.section_headings?.passions, title: doc.t.sections.passions, className: "tpl-split__section", headingClassName: "tpl-split__heading", items: resume.passions, entryClassName: "tpl-split__described" })] }), _jsxs("div", { className: "tpl-split__main", "data-flow": true, children: [(resume.summary || authoring) && (_jsx(DocumentSection, { id: "summary", heading: resume.section_headings?.summary, title: doc.t.sections.summary, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx("p", { className: "tpl-split__prose", "data-block": true, children: _jsx(EditableText, { path: "summary", value: resume.summary ?? '', placeholder: placeholder('summary'), multiline: true }) }) })), (resume.experience.length > 0 || authoring) && (_jsx(DocumentSection, { id: "experience", heading: resume.section_headings?.experience, title: doc.t.sections.experience, className: "tpl-split__section", headingClassName: "tpl-split__heading", children: _jsx(Collection, { section: "experience", items: resume.experience, children: ({ item, path, chrome, itemProps }) => (_jsx(SplitExperienceEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), _jsx(DescribedEntries, { id: "achievements", heading: resume.section_headings?.achievements, title: doc.t.sections.achievements, className: "tpl-split__section", headingClassName: "tpl-split__heading", items: resume.achievements, entryClassName: "tpl-split__described" }), _jsx(CustomSections, { sections: resume.custom_sections, sectionClass: "tpl-split__section", headingClass: "tpl-split__heading", Entry: SplitCustomEntry })] })] })] }));
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StylishDocument.d.ts","sourceRoot":"","sources":["../../../src/templates/stylish/StylishDocument.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"StylishDocument.d.ts","sourceRoot":"","sources":["../../../src/templates/stylish/StylishDocument.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAwBtD,OAAO,sBAAsB,CAAC;AAC9B,OAAO,6BAA6B,CAAC;AACrC,OAAO,eAAe,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,oBAAoB,+BAsO/D"}
|
|
@@ -11,7 +11,7 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
11
11
|
import { TagSkillGroup } from '../../kit/TagSkillGroup.js';
|
|
12
12
|
import { InitialsAvatar } from '../../kit/InitialsAvatar.js';
|
|
13
13
|
import { useContactLines } from '../../kit/contact.js';
|
|
14
|
-
import { documentStyle } from '../../kit/documentStyle.js';
|
|
14
|
+
import { documentStyle, documentStyleAttributes, } from '../../kit/documentStyle.js';
|
|
15
15
|
import { Heading } from '../../kit/Heading.js';
|
|
16
16
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
17
17
|
import { StylishCustomEntry, StylishEducationEntry, StylishExperienceEntry, } from './entries.js';
|
|
@@ -25,5 +25,5 @@ export function StylishDocument({ resume }) {
|
|
|
25
25
|
const style = useDocumentStyle();
|
|
26
26
|
const authoring = useAuthoring() !== null;
|
|
27
27
|
const contact = useContactLines(resume.contact, ['phone', 'email', 'location'], authoring);
|
|
28
|
-
return (_jsxs("article", { className: "tpl-stylish", style: documentStyle('st', style), "aria-label": doc.t.resume, lang: doc.locale, children: [_jsxs("header", { className: "tpl-stylish__head-block", "data-layout": "row", "data-block": true, children: [_jsxs("div", { className: "tpl-stylish__identity", children: [_jsx(Heading, { level: 1, className: "tpl-stylish__name", children: _jsx(EditableText, { path: "name", value: resume.name }) }), (resume.headline || authoring) && (_jsx("p", { className: "tpl-stylish__headline", children: _jsx(EditableText, { path: "headline", value: resume.headline ?? '', placeholder: placeholder('headline') }) })), (contact.length > 0 || resume.links.length > 0 || authoring) && (_jsxs("p", { className: "tpl-stylish__contact tpl-contact-icons", children: [contact.map(({ field, path, value, placeholder }) => (_jsx("span", { className: `tpl-stylish__contact-item tpl-contact--${field}`, children: _jsx(EditableText, { path: path, value: value, placeholder: placeholder }) }, path))), _jsx(Collection, { section: "links", items: resume.links, gap: false, emptyAdd: "inline", children: ({ item, path, chrome, itemProps, justAdded }) => (_jsx("span", { className: "tpl-stylish__contact-item tpl-contact--link", children: _jsxs("span", { ...itemProps, children: [chrome, _jsx(LinkField, { item: item, path: path, justAdded: justAdded })] }) })) })] }))] }), _jsx(InitialsAvatar, { name: resume.name, className: "tpl-stylish__avatar" })] }), _jsxs("div", { className: "tpl-stylish__body", "data-layout": "row", children: [_jsxs("aside", { className: "tpl-stylish__aside", "data-flow": true, children: [_jsx(DescribedEntries, { id: "achievements", heading: resume.section_headings?.achievements, title: doc.t.sections.achievements, className: "tpl-stylish__section tpl-described--marked", headingClassName: "tpl-stylish__heading", items: resume.achievements, entryClassName: "tpl-stylish__described" }), _jsx(CustomSections, { sections: resume.custom_sections, sectionClass: "tpl-stylish__section", headingClass: "tpl-stylish__heading", Entry: StylishCustomEntry }), (resume.skills.length > 0 || authoring) && (_jsx(DocumentSection, { id: "skills", heading: resume.section_headings?.skills, title: doc.t.sections.skills, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx("div", { className: "tpl-skill-tags", children: _jsx(Collection, { section: "skills", items: resume.skills, children: ({ item, path, chrome, itemProps }) => (_jsx(TagSkillGroup, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) }) })), _jsx(DescribedEntries, { id: "courses", heading: resume.section_headings?.courses, title: doc.t.sections.courses, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", items: resume.courses, entryClassName: "tpl-stylish__described" }), resume.certifications.length > 0 && (_jsx(DocumentSection, { id: "certifications", heading: resume.section_headings?.certifications, title: doc.t.sections.certifications, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx("div", { "data-block": true, "data-split": true, children: _jsx(EditableBulletList, { path: "certifications", items: resume.certifications, placeholder: placeholder('certification') }) }) })), _jsx(DescribedEntries, { id: "passions", heading: resume.section_headings?.passions, title: doc.t.sections.passions, className: "tpl-stylish__section tpl-described--marked", headingClassName: "tpl-stylish__heading", items: resume.passions, entryClassName: "tpl-stylish__described" })] }), _jsxs("div", { className: "tpl-stylish__main", "data-flow": true, children: [(resume.summary || authoring) && (_jsx(DocumentSection, { id: "summary", heading: resume.section_headings?.summary, title: doc.t.sections.summary, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx("p", { className: "tpl-stylish__prose", "data-block": true, children: _jsx(EditableText, { path: "summary", value: resume.summary ?? '', placeholder: placeholder('summary'), multiline: true }) }) })), (resume.experience.length > 0 || authoring) && (_jsx(DocumentSection, { id: "experience", heading: resume.section_headings?.experience, title: doc.t.sections.experience, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx(Collection, { section: "experience", items: resume.experience, children: ({ item, path, chrome, itemProps }) => (_jsx(StylishExperienceEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), (resume.education.length > 0 || authoring) && (_jsx(DocumentSection, { id: "education", heading: resume.section_headings?.education, title: doc.t.sections.education, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx(Collection, { section: "education", items: resume.education, children: ({ item, path, chrome, itemProps }) => (_jsx(StylishEducationEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), _jsx(LanguageList, { items: resume.languages, heading: resume.section_headings?.languages, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", rowClassName: "tpl-stylish__language" })] })] })] }));
|
|
28
|
+
return (_jsxs("article", { className: "tpl-stylish", style: documentStyle('st', style), ...documentStyleAttributes(style), "aria-label": doc.t.resume, lang: doc.locale, children: [_jsxs("header", { className: "tpl-stylish__head-block", "data-layout": "row", "data-block": true, children: [_jsxs("div", { className: "tpl-stylish__identity", children: [_jsx(Heading, { level: 1, className: "tpl-stylish__name", children: _jsx(EditableText, { path: "name", value: resume.name }) }), (resume.headline || authoring) && (_jsx("p", { className: "tpl-stylish__headline", children: _jsx(EditableText, { path: "headline", value: resume.headline ?? '', placeholder: placeholder('headline') }) })), (contact.length > 0 || resume.links.length > 0 || authoring) && (_jsxs("p", { className: "tpl-stylish__contact tpl-contact-icons", children: [contact.map(({ field, path, value, placeholder }) => (_jsx("span", { className: `tpl-stylish__contact-item tpl-contact--${field}`, children: _jsx(EditableText, { path: path, value: value, placeholder: placeholder }) }, path))), _jsx(Collection, { section: "links", items: resume.links, gap: false, emptyAdd: "inline", children: ({ item, path, chrome, itemProps, justAdded }) => (_jsx("span", { className: "tpl-stylish__contact-item tpl-contact--link", children: _jsxs("span", { ...itemProps, children: [chrome, _jsx(LinkField, { item: item, path: path, justAdded: justAdded })] }) })) })] }))] }), _jsx(InitialsAvatar, { name: resume.name, className: "tpl-stylish__avatar" })] }), _jsxs("div", { className: "tpl-stylish__body", "data-layout": "row", children: [_jsxs("aside", { className: "tpl-stylish__aside", "data-flow": true, children: [_jsx(DescribedEntries, { id: "achievements", heading: resume.section_headings?.achievements, title: doc.t.sections.achievements, className: "tpl-stylish__section tpl-described--marked", headingClassName: "tpl-stylish__heading", items: resume.achievements, entryClassName: "tpl-stylish__described" }), _jsx(CustomSections, { sections: resume.custom_sections, sectionClass: "tpl-stylish__section", headingClass: "tpl-stylish__heading", Entry: StylishCustomEntry }), (resume.skills.length > 0 || authoring) && (_jsx(DocumentSection, { id: "skills", heading: resume.section_headings?.skills, title: doc.t.sections.skills, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx("div", { className: "tpl-skill-tags", children: _jsx(Collection, { section: "skills", items: resume.skills, children: ({ item, path, chrome, itemProps }) => (_jsx(TagSkillGroup, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) }) })), _jsx(DescribedEntries, { id: "courses", heading: resume.section_headings?.courses, title: doc.t.sections.courses, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", items: resume.courses, entryClassName: "tpl-stylish__described" }), resume.certifications.length > 0 && (_jsx(DocumentSection, { id: "certifications", heading: resume.section_headings?.certifications, title: doc.t.sections.certifications, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx("div", { "data-block": true, "data-split": true, children: _jsx(EditableBulletList, { path: "certifications", items: resume.certifications, placeholder: placeholder('certification') }) }) })), _jsx(DescribedEntries, { id: "passions", heading: resume.section_headings?.passions, title: doc.t.sections.passions, className: "tpl-stylish__section tpl-described--marked", headingClassName: "tpl-stylish__heading", items: resume.passions, entryClassName: "tpl-stylish__described" })] }), _jsxs("div", { className: "tpl-stylish__main", "data-flow": true, children: [(resume.summary || authoring) && (_jsx(DocumentSection, { id: "summary", heading: resume.section_headings?.summary, title: doc.t.sections.summary, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx("p", { className: "tpl-stylish__prose", "data-block": true, children: _jsx(EditableText, { path: "summary", value: resume.summary ?? '', placeholder: placeholder('summary'), multiline: true }) }) })), (resume.experience.length > 0 || authoring) && (_jsx(DocumentSection, { id: "experience", heading: resume.section_headings?.experience, title: doc.t.sections.experience, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx(Collection, { section: "experience", items: resume.experience, children: ({ item, path, chrome, itemProps }) => (_jsx(StylishExperienceEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), (resume.education.length > 0 || authoring) && (_jsx(DocumentSection, { id: "education", heading: resume.section_headings?.education, title: doc.t.sections.education, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", children: _jsx(Collection, { section: "education", items: resume.education, children: ({ item, path, chrome, itemProps }) => (_jsx(StylishEducationEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), _jsx(LanguageList, { items: resume.languages, heading: resume.section_headings?.languages, className: "tpl-stylish__section", headingClassName: "tpl-stylish__heading", rowClassName: "tpl-stylish__language" })] })] })] }));
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineDocument.d.ts","sourceRoot":"","sources":["../../../src/templates/timeline/TimelineDocument.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"TimelineDocument.d.ts","sourceRoot":"","sources":["../../../src/templates/timeline/TimelineDocument.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAuBtD,OAAO,6BAA6B,CAAC;AACrC,OAAO,gBAAgB,CAAC;AAGxB,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE,qBAAqB,+BA0NjE"}
|
|
@@ -10,7 +10,7 @@ import { DescribedEntries } from '../../kit/DescribedEntries.js';
|
|
|
10
10
|
import { LanguageList } from '../../kit/LanguageList.js';
|
|
11
11
|
import { BulletSkillGroup } from '../../kit/BulletSkillGroup.js';
|
|
12
12
|
import { useContactLines } from '../../kit/contact.js';
|
|
13
|
-
import { documentStyle } from '../../kit/documentStyle.js';
|
|
13
|
+
import { documentStyle, documentStyleAttributes, } from '../../kit/documentStyle.js';
|
|
14
14
|
import { Heading } from '../../kit/Heading.js';
|
|
15
15
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
16
16
|
import { TimelineCustomEntry, TimelineEducationEntry, TimelineExperienceEntry, } from './entries.js';
|
|
@@ -23,5 +23,5 @@ export function TimelineDocument({ resume }) {
|
|
|
23
23
|
const style = useDocumentStyle();
|
|
24
24
|
const authoring = useAuthoring() !== null;
|
|
25
25
|
const contact = useContactLines(resume.contact, ['phone', 'email', 'location'], authoring);
|
|
26
|
-
return (_jsxs("article", { className: "tpl-timeline", style: documentStyle('tl', style), "aria-label": doc.t.resume, lang: doc.locale, children: [_jsxs("header", { className: "tpl-timeline__head-block", "data-block": true, children: [_jsx(Heading, { level: 1, className: "tpl-timeline__name", children: _jsx(EditableText, { path: "name", value: resume.name }) }), (resume.headline || authoring) && (_jsx("p", { className: "tpl-timeline__headline", children: _jsx(EditableText, { path: "headline", value: resume.headline ?? '', placeholder: placeholder('headline') }) })), (contact.length > 0 || resume.links.length > 0 || authoring) && (_jsxs("p", { className: "tpl-timeline__contact tpl-contact-icons", children: [contact.map(({ field, path, value, placeholder }) => (_jsx("span", { className: `tpl-timeline__contact-item tpl-contact--${field}`, children: _jsx(EditableText, { path: path, value: value, placeholder: placeholder }) }, path))), _jsx(Collection, { section: "links", items: resume.links, gap: false, emptyAdd: "inline", children: ({ item, path, chrome, itemProps, justAdded }) => (_jsx("span", { className: "tpl-timeline__contact-item tpl-contact--link", children: _jsxs("span", { ...itemProps, children: [chrome, _jsx(LinkField, { item: item, path: path, justAdded: justAdded })] }) })) })] }))] }), (resume.summary || authoring) && (_jsx(DocumentSection, { id: "summary", heading: resume.section_headings?.summary, title: doc.t.sections.summary, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx("p", { className: "tpl-timeline__prose", "data-block": true, children: _jsx(EditableText, { path: "summary", value: resume.summary ?? '', placeholder: placeholder('summary'), multiline: true }) }) })), (resume.experience.length > 0 || authoring) && (_jsx(DocumentSection, { id: "experience", heading: resume.section_headings?.experience, title: doc.t.sections.experience, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx(Collection, { section: "experience", items: resume.experience, children: ({ item, path, chrome, itemProps }) => (_jsx(TimelineExperienceEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), (resume.education.length > 0 || authoring) && (_jsx(DocumentSection, { id: "education", heading: resume.section_headings?.education, title: doc.t.sections.education, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx(Collection, { section: "education", items: resume.education, children: ({ item, path, chrome, itemProps }) => (_jsx(TimelineEducationEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), _jsx(DescribedEntries, { id: "achievements", heading: resume.section_headings?.achievements, title: doc.t.sections.achievements, className: "tpl-timeline__section tpl-described--marked tpl-described--grid", headingClassName: "tpl-timeline__heading", items: resume.achievements, entryClassName: "tpl-timeline__described" }), _jsx(CustomSections, { sections: resume.custom_sections, sectionClass: "tpl-timeline__section", headingClass: "tpl-timeline__heading", Entry: TimelineCustomEntry }), (resume.skills.length > 0 || authoring) && (_jsx(DocumentSection, { id: "skills", heading: resume.section_headings?.skills, title: doc.t.sections.skills, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx("div", { className: "tpl-keywords tpl-keywords--tags", "data-block": true, "data-split": true, children: _jsx(Collection, { section: "skills", items: resume.skills, noun: "skill", gap: false, children: ({ item, path }) => _jsx(BulletSkillGroup, { item: item, path: path }) }) }) })), _jsx(DescribedEntries, { id: "courses", heading: resume.section_headings?.courses, title: doc.t.sections.courses, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", items: resume.courses, entryClassName: "tpl-timeline__described" }), _jsx(LanguageList, { items: resume.languages, heading: resume.section_headings?.languages, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", rowClassName: "tpl-timeline__language" }), resume.certifications.length > 0 && (_jsx(DocumentSection, { id: "certifications", heading: resume.section_headings?.certifications, title: doc.t.sections.certifications, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx("div", { "data-block": true, "data-split": true, children: _jsx(EditableBulletList, { path: "certifications", items: resume.certifications, placeholder: placeholder('certification') }) }) })), _jsx(DescribedEntries, { id: "passions", heading: resume.section_headings?.passions, title: doc.t.sections.passions, className: "tpl-timeline__section tpl-described--marked", headingClassName: "tpl-timeline__heading", items: resume.passions, entryClassName: "tpl-timeline__described" })] }));
|
|
26
|
+
return (_jsxs("article", { className: "tpl-timeline", style: documentStyle('tl', style), ...documentStyleAttributes(style), "aria-label": doc.t.resume, lang: doc.locale, children: [_jsxs("header", { className: "tpl-timeline__head-block", "data-block": true, children: [_jsx(Heading, { level: 1, className: "tpl-timeline__name", children: _jsx(EditableText, { path: "name", value: resume.name }) }), (resume.headline || authoring) && (_jsx("p", { className: "tpl-timeline__headline", children: _jsx(EditableText, { path: "headline", value: resume.headline ?? '', placeholder: placeholder('headline') }) })), (contact.length > 0 || resume.links.length > 0 || authoring) && (_jsxs("p", { className: "tpl-timeline__contact tpl-contact-icons", children: [contact.map(({ field, path, value, placeholder }) => (_jsx("span", { className: `tpl-timeline__contact-item tpl-contact--${field}`, children: _jsx(EditableText, { path: path, value: value, placeholder: placeholder }) }, path))), _jsx(Collection, { section: "links", items: resume.links, gap: false, emptyAdd: "inline", children: ({ item, path, chrome, itemProps, justAdded }) => (_jsx("span", { className: "tpl-timeline__contact-item tpl-contact--link", children: _jsxs("span", { ...itemProps, children: [chrome, _jsx(LinkField, { item: item, path: path, justAdded: justAdded })] }) })) })] }))] }), (resume.summary || authoring) && (_jsx(DocumentSection, { id: "summary", heading: resume.section_headings?.summary, title: doc.t.sections.summary, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx("p", { className: "tpl-timeline__prose", "data-block": true, children: _jsx(EditableText, { path: "summary", value: resume.summary ?? '', placeholder: placeholder('summary'), multiline: true }) }) })), (resume.experience.length > 0 || authoring) && (_jsx(DocumentSection, { id: "experience", heading: resume.section_headings?.experience, title: doc.t.sections.experience, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx(Collection, { section: "experience", items: resume.experience, children: ({ item, path, chrome, itemProps }) => (_jsx(TimelineExperienceEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), (resume.education.length > 0 || authoring) && (_jsx(DocumentSection, { id: "education", heading: resume.section_headings?.education, title: doc.t.sections.education, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx(Collection, { section: "education", items: resume.education, children: ({ item, path, chrome, itemProps }) => (_jsx(TimelineEducationEntry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) }) })), _jsx(DescribedEntries, { id: "achievements", heading: resume.section_headings?.achievements, title: doc.t.sections.achievements, className: "tpl-timeline__section tpl-described--marked tpl-described--grid", headingClassName: "tpl-timeline__heading", items: resume.achievements, entryClassName: "tpl-timeline__described" }), _jsx(CustomSections, { sections: resume.custom_sections, sectionClass: "tpl-timeline__section", headingClass: "tpl-timeline__heading", Entry: TimelineCustomEntry }), (resume.skills.length > 0 || authoring) && (_jsx(DocumentSection, { id: "skills", heading: resume.section_headings?.skills, title: doc.t.sections.skills, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx("div", { className: "tpl-keywords tpl-keywords--tags", "data-block": true, "data-split": true, children: _jsx(Collection, { section: "skills", items: resume.skills, noun: "skill", gap: false, children: ({ item, path }) => _jsx(BulletSkillGroup, { item: item, path: path }) }) }) })), _jsx(DescribedEntries, { id: "courses", heading: resume.section_headings?.courses, title: doc.t.sections.courses, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", items: resume.courses, entryClassName: "tpl-timeline__described" }), _jsx(LanguageList, { items: resume.languages, heading: resume.section_headings?.languages, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", rowClassName: "tpl-timeline__language" }), resume.certifications.length > 0 && (_jsx(DocumentSection, { id: "certifications", heading: resume.section_headings?.certifications, title: doc.t.sections.certifications, className: "tpl-timeline__section", headingClassName: "tpl-timeline__heading", children: _jsx("div", { "data-block": true, "data-split": true, children: _jsx(EditableBulletList, { path: "certifications", items: resume.certifications, placeholder: placeholder('certification') }) }) })), _jsx(DescribedEntries, { id: "passions", heading: resume.section_headings?.passions, title: doc.t.sections.passions, className: "tpl-timeline__section tpl-described--marked", headingClassName: "tpl-timeline__heading", items: resume.passions, entryClassName: "tpl-timeline__described" })] }));
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@resumekit/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Editable, paginated resume templates for React: about thirty print-accurate designs, an in-place editing kit, a static renderer and a self-contained export bundle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"resume",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@dnd-kit/core": "^6.3.1",
|
|
58
58
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
59
59
|
"@dnd-kit/sortable": "^10.0.0",
|
|
60
|
-
"@resumekit/schema": "^0.
|
|
60
|
+
"@resumekit/schema": "^0.2.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"react": "^19.0.0",
|
package/src/compiler/emit.ts
CHANGED
|
@@ -689,7 +689,7 @@ function emitDocument(d: TemplateDescription): string {
|
|
|
689
689
|
`import { ${textShapes.join(', ')} } from '../../kit/textShapes.js';`,
|
|
690
690
|
contactNodes.length > 0 &&
|
|
691
691
|
`import { useContactLines } from '../../kit/contact.js';`,
|
|
692
|
-
`import { documentStyle } from '../../kit/documentStyle.js';`,
|
|
692
|
+
`import { documentStyle, documentStyleAttributes } from '../../kit/documentStyle.js';`,
|
|
693
693
|
`import { Heading } from '../../kit/Heading.js';`,
|
|
694
694
|
linkFields && `import { LinkField } from '../../nodes/LinkField.js';`,
|
|
695
695
|
entryNames.length > 0 &&
|
|
@@ -728,7 +728,7 @@ function emitDocument(d: TemplateDescription): string {
|
|
|
728
728
|
(d.headingAccent !== undefined
|
|
729
729
|
? ` const headingLead = { count: ${d.headingAccent}, className: ${q(cls(d, 'heading-lead'))} };\n\n`
|
|
730
730
|
: '') +
|
|
731
|
-
` return (\n<article\nclassName=${q(d.prefix)}\nstyle={documentStyle(${q(d.styleKey)}, style)}\n` +
|
|
731
|
+
` return (\n<article\nclassName=${q(d.prefix)}\nstyle={documentStyle(${q(d.styleKey)}, style)}\n{...documentStyleAttributes(style)}\n` +
|
|
732
732
|
`aria-label={doc.t.resume}\nlang={doc.locale}\n>\n` +
|
|
733
733
|
d.layout.map((n) => emitLayout(c, n)).join('\n\n') +
|
|
734
734
|
`\n</article>\n );\n}\n`
|
package/src/kit/documentStyle.ts
CHANGED
|
@@ -2,7 +2,10 @@ import type { CSSProperties } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
DENSITIES,
|
|
4
4
|
DOCUMENT_FONTS,
|
|
5
|
+
HEADING_WEIGHTS,
|
|
5
6
|
INK_COLORS,
|
|
7
|
+
LETTER_SPACINGS,
|
|
8
|
+
LINE_HEIGHTS,
|
|
6
9
|
type DocumentStyle,
|
|
7
10
|
} from '@resumekit/schema';
|
|
8
11
|
|
|
@@ -29,5 +32,49 @@ export function documentStyle(
|
|
|
29
32
|
...(style.density
|
|
30
33
|
? { [`--${prefix}-density`]: String(DENSITIES[style.density].factor) }
|
|
31
34
|
: {}),
|
|
35
|
+
/*
|
|
36
|
+
* The typographic presets, under one shared prefix rather than the
|
|
37
|
+
* template's: `typography.css` applies them the same way in every
|
|
38
|
+
* template, keyed on the `data-rk-*` attributes below, so a template's
|
|
39
|
+
* stylesheet never has to know they exist.
|
|
40
|
+
*/
|
|
41
|
+
...(style.tracking
|
|
42
|
+
? { '--rk-tracking': `${LETTER_SPACINGS[style.tracking].em}em` }
|
|
43
|
+
: {}),
|
|
44
|
+
...(style.leading
|
|
45
|
+
? { '--rk-leading': String(LINE_HEIGHTS[style.leading].value) }
|
|
46
|
+
: {}),
|
|
47
|
+
...(style.headingFont
|
|
48
|
+
? { '--rk-heading-font': DOCUMENT_FONTS[style.headingFont].stack }
|
|
49
|
+
: {}),
|
|
50
|
+
...(style.headingWeight
|
|
51
|
+
? {
|
|
52
|
+
'--rk-heading-weight': String(
|
|
53
|
+
HEADING_WEIGHTS[style.headingWeight].weight,
|
|
54
|
+
),
|
|
55
|
+
}
|
|
56
|
+
: {}),
|
|
32
57
|
} as CSSProperties;
|
|
33
58
|
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Which typographic presets the document chose, as attributes on the template's
|
|
62
|
+
* root. Only a chosen preset is written: `typography.css` keys every rule on
|
|
63
|
+
* the attribute's presence, so a document that chose none is drawn by the
|
|
64
|
+
* template's stylesheet alone — the same guarantee `documentStyle` keeps for
|
|
65
|
+
* accent and density.
|
|
66
|
+
*/
|
|
67
|
+
export function documentStyleAttributes(
|
|
68
|
+
style: DocumentStyle | undefined,
|
|
69
|
+
): Record<`data-rk-${string}`, string> {
|
|
70
|
+
if (!style) return {};
|
|
71
|
+
return {
|
|
72
|
+
...(style.tracking && { 'data-rk-tracking': style.tracking }),
|
|
73
|
+
...(style.leading && { 'data-rk-leading': style.leading }),
|
|
74
|
+
...(style.headingFont && { 'data-rk-heading-font': style.headingFont }),
|
|
75
|
+
...(style.headingCase && { 'data-rk-heading-case': style.headingCase }),
|
|
76
|
+
...(style.headingWeight && {
|
|
77
|
+
'data-rk-heading-weight': style.headingWeight,
|
|
78
|
+
}),
|
|
79
|
+
};
|
|
80
|
+
}
|
package/src/nodes/formatting.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
INK_COLORS,
|
|
4
|
+
type FieldAlign,
|
|
5
|
+
type FieldStepId,
|
|
6
|
+
type InkId,
|
|
7
|
+
} from '@resumekit/schema';
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* The formatting a node may carry.
|
|
@@ -11,6 +16,10 @@ import { INK_COLORS, type FieldAlign, type InkId } from '@resumekit/schema';
|
|
|
11
16
|
*/
|
|
12
17
|
export interface FieldFormatting {
|
|
13
18
|
bold?: boolean;
|
|
19
|
+
italic?: boolean;
|
|
20
|
+
underline?: boolean;
|
|
21
|
+
/** One step smaller or larger than the template sets the line. */
|
|
22
|
+
step?: FieldStepId;
|
|
14
23
|
align?: FieldAlign;
|
|
15
24
|
ink?: InkId;
|
|
16
25
|
/*
|
|
@@ -37,6 +46,9 @@ export function formatClass(format: FieldFormatting, base: string): string {
|
|
|
37
46
|
return [
|
|
38
47
|
base,
|
|
39
48
|
format.bold ? 'is-bold' : '',
|
|
49
|
+
format.italic ? 'is-italic' : '',
|
|
50
|
+
format.underline ? 'is-underline' : '',
|
|
51
|
+
format.step ? `is-step-${format.step}` : '',
|
|
40
52
|
format.align ? `is-${format.align}` : '',
|
|
41
53
|
]
|
|
42
54
|
.filter(Boolean)
|
package/src/nodes/locked.ts
CHANGED
|
@@ -53,6 +53,9 @@ export const FORBIDDEN_NODE_PROPS: readonly string[] = [
|
|
|
53
53
|
*/
|
|
54
54
|
export const BOUNDED_NODE_PROPS: Readonly<Record<string, string>> = {
|
|
55
55
|
bold: 'boolean',
|
|
56
|
+
italic: 'boolean',
|
|
57
|
+
underline: 'boolean',
|
|
58
|
+
step: 'FieldStepId',
|
|
56
59
|
align: 'FieldAlign',
|
|
57
60
|
ink: 'InkId',
|
|
58
61
|
/*
|
|
@@ -16,7 +16,10 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
16
16
|
import { GridSkillGroup } from '../../kit/GridSkillGroup.js';
|
|
17
17
|
import { InitialsAvatar } from '../../kit/InitialsAvatar.js';
|
|
18
18
|
import { useContactLines } from '../../kit/contact.js';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
documentStyle,
|
|
21
|
+
documentStyleAttributes,
|
|
22
|
+
} from '../../kit/documentStyle.js';
|
|
20
23
|
import { Heading } from '../../kit/Heading.js';
|
|
21
24
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
22
25
|
import {
|
|
@@ -49,6 +52,7 @@ export function AcademicDocument({ resume }: AcademicDocumentProps) {
|
|
|
49
52
|
<article
|
|
50
53
|
className="tpl-academic"
|
|
51
54
|
style={documentStyle('ac', style)}
|
|
55
|
+
{...documentStyleAttributes(style)}
|
|
52
56
|
aria-label={doc.t.resume}
|
|
53
57
|
lang={doc.locale}
|
|
54
58
|
>
|
|
@@ -16,7 +16,10 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
16
16
|
import { TagSkillGroup } from '../../kit/TagSkillGroup.js';
|
|
17
17
|
import { InitialsAvatar } from '../../kit/InitialsAvatar.js';
|
|
18
18
|
import { useContactLines } from '../../kit/contact.js';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
documentStyle,
|
|
21
|
+
documentStyleAttributes,
|
|
22
|
+
} from '../../kit/documentStyle.js';
|
|
20
23
|
import { Heading } from '../../kit/Heading.js';
|
|
21
24
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
22
25
|
import {
|
|
@@ -49,6 +52,7 @@ export function AltaDocument({ resume }: AltaDocumentProps) {
|
|
|
49
52
|
<article
|
|
50
53
|
className="tpl-alta"
|
|
51
54
|
style={documentStyle('al', style)}
|
|
55
|
+
{...documentStyleAttributes(style)}
|
|
52
56
|
aria-label={doc.t.resume}
|
|
53
57
|
lang={doc.locale}
|
|
54
58
|
>
|
|
@@ -15,7 +15,10 @@ import { DescribedEntries } from '../../kit/DescribedEntries.js';
|
|
|
15
15
|
import { LanguageList } from '../../kit/LanguageList.js';
|
|
16
16
|
import { GridSkillGroup } from '../../kit/GridSkillGroup.js';
|
|
17
17
|
import { useContactLines } from '../../kit/contact.js';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
documentStyle,
|
|
20
|
+
documentStyleAttributes,
|
|
21
|
+
} from '../../kit/documentStyle.js';
|
|
19
22
|
import { Heading } from '../../kit/Heading.js';
|
|
20
23
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
21
24
|
import {
|
|
@@ -46,6 +49,7 @@ export function ClassicDocument({ resume }: ClassicDocumentProps) {
|
|
|
46
49
|
<article
|
|
47
50
|
className="tpl-classic"
|
|
48
51
|
style={documentStyle('cl', style)}
|
|
52
|
+
{...documentStyleAttributes(style)}
|
|
49
53
|
aria-label={doc.t.resume}
|
|
50
54
|
lang={doc.locale}
|
|
51
55
|
>
|
|
@@ -15,7 +15,10 @@ import { DescribedEntries } from '../../kit/DescribedEntries.js';
|
|
|
15
15
|
import { LanguageList } from '../../kit/LanguageList.js';
|
|
16
16
|
import { BulletSkillGroup } from '../../kit/BulletSkillGroup.js';
|
|
17
17
|
import { useContactLines } from '../../kit/contact.js';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
documentStyle,
|
|
20
|
+
documentStyleAttributes,
|
|
21
|
+
} from '../../kit/documentStyle.js';
|
|
19
22
|
import { Heading } from '../../kit/Heading.js';
|
|
20
23
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
21
24
|
import {
|
|
@@ -48,6 +51,7 @@ export function CobaltDocument({ resume }: CobaltDocumentProps) {
|
|
|
48
51
|
<article
|
|
49
52
|
className="tpl-cob"
|
|
50
53
|
style={documentStyle('c', style)}
|
|
54
|
+
{...documentStyleAttributes(style)}
|
|
51
55
|
aria-label={doc.t.resume}
|
|
52
56
|
lang={doc.locale}
|
|
53
57
|
>
|
|
@@ -15,7 +15,10 @@ import { DescribedEntries } from '../../kit/DescribedEntries.js';
|
|
|
15
15
|
import { LanguageList } from '../../kit/LanguageList.js';
|
|
16
16
|
import { BulletSkillGroup } from '../../kit/BulletSkillGroup.js';
|
|
17
17
|
import { useContactLines } from '../../kit/contact.js';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
documentStyle,
|
|
20
|
+
documentStyleAttributes,
|
|
21
|
+
} from '../../kit/documentStyle.js';
|
|
19
22
|
import { Heading } from '../../kit/Heading.js';
|
|
20
23
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
21
24
|
import {
|
|
@@ -48,6 +51,7 @@ export function CompactDocument({ resume }: CompactDocumentProps) {
|
|
|
48
51
|
<article
|
|
49
52
|
className="tpl-compact"
|
|
50
53
|
style={documentStyle('cp', style)}
|
|
54
|
+
{...documentStyleAttributes(style)}
|
|
51
55
|
aria-label={doc.t.resume}
|
|
52
56
|
lang={doc.locale}
|
|
53
57
|
>
|
|
@@ -16,7 +16,10 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
16
16
|
import { GridSkillGroup } from '../../kit/GridSkillGroup.js';
|
|
17
17
|
import { InitialsAvatar } from '../../kit/InitialsAvatar.js';
|
|
18
18
|
import { useContactLines } from '../../kit/contact.js';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
documentStyle,
|
|
21
|
+
documentStyleAttributes,
|
|
22
|
+
} from '../../kit/documentStyle.js';
|
|
20
23
|
import { Heading } from '../../kit/Heading.js';
|
|
21
24
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
22
25
|
import {
|
|
@@ -49,6 +52,7 @@ export function ContemporaryDocument({ resume }: ContemporaryDocumentProps) {
|
|
|
49
52
|
<article
|
|
50
53
|
className="tpl-contemporary"
|
|
51
54
|
style={documentStyle('cn', style)}
|
|
55
|
+
{...documentStyleAttributes(style)}
|
|
52
56
|
aria-label={doc.t.resume}
|
|
53
57
|
lang={doc.locale}
|
|
54
58
|
>
|
|
@@ -16,7 +16,10 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
16
16
|
import { BulletSkillGroup } from '../../kit/BulletSkillGroup.js';
|
|
17
17
|
import { InitialsAvatar } from '../../kit/InitialsAvatar.js';
|
|
18
18
|
import { useContactLines } from '../../kit/contact.js';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
documentStyle,
|
|
21
|
+
documentStyleAttributes,
|
|
22
|
+
} from '../../kit/documentStyle.js';
|
|
20
23
|
import { Heading } from '../../kit/Heading.js';
|
|
21
24
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
22
25
|
import {
|
|
@@ -49,6 +52,7 @@ export function CreativeDocument({ resume }: CreativeDocumentProps) {
|
|
|
49
52
|
<article
|
|
50
53
|
className="tpl-creative"
|
|
51
54
|
style={documentStyle('cr', style)}
|
|
55
|
+
{...documentStyleAttributes(style)}
|
|
52
56
|
aria-label={doc.t.resume}
|
|
53
57
|
lang={doc.locale}
|
|
54
58
|
>
|
|
@@ -16,7 +16,10 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
16
16
|
import { GridSkillGroup } from '../../kit/GridSkillGroup.js';
|
|
17
17
|
import { nameParts } from '../../kit/textShapes.js';
|
|
18
18
|
import { useContactLines } from '../../kit/contact.js';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
documentStyle,
|
|
21
|
+
documentStyleAttributes,
|
|
22
|
+
} from '../../kit/documentStyle.js';
|
|
20
23
|
import { Heading } from '../../kit/Heading.js';
|
|
21
24
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
22
25
|
import {
|
|
@@ -51,6 +54,7 @@ export function CrimsonDocument({ resume }: CrimsonDocumentProps) {
|
|
|
51
54
|
<article
|
|
52
55
|
className="tpl-crimson"
|
|
53
56
|
style={documentStyle('crm', style)}
|
|
57
|
+
{...documentStyleAttributes(style)}
|
|
54
58
|
aria-label={doc.t.resume}
|
|
55
59
|
lang={doc.locale}
|
|
56
60
|
>
|
|
@@ -16,7 +16,10 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
16
16
|
import { GridSkillGroup } from '../../kit/GridSkillGroup.js';
|
|
17
17
|
import { InitialsAvatar } from '../../kit/InitialsAvatar.js';
|
|
18
18
|
import { useContactLines } from '../../kit/contact.js';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
documentStyle,
|
|
21
|
+
documentStyleAttributes,
|
|
22
|
+
} from '../../kit/documentStyle.js';
|
|
20
23
|
import { Heading } from '../../kit/Heading.js';
|
|
21
24
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
22
25
|
import {
|
|
@@ -49,6 +52,7 @@ export function CurveDocument({ resume }: CurveDocumentProps) {
|
|
|
49
52
|
<article
|
|
50
53
|
className="tpl-curve"
|
|
51
54
|
style={documentStyle('cv', style)}
|
|
55
|
+
{...documentStyleAttributes(style)}
|
|
52
56
|
aria-label={doc.t.resume}
|
|
53
57
|
lang={doc.locale}
|
|
54
58
|
>
|
|
@@ -16,7 +16,10 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
16
16
|
import { BulletSkillGroup } from '../../kit/BulletSkillGroup.js';
|
|
17
17
|
import { InitialsAvatar } from '../../kit/InitialsAvatar.js';
|
|
18
18
|
import { useContactLines } from '../../kit/contact.js';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
documentStyle,
|
|
21
|
+
documentStyleAttributes,
|
|
22
|
+
} from '../../kit/documentStyle.js';
|
|
20
23
|
import { Heading } from '../../kit/Heading.js';
|
|
21
24
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
22
25
|
import {
|
|
@@ -49,6 +52,7 @@ export function DoubleColumnDocument({ resume }: DoubleColumnDocumentProps) {
|
|
|
49
52
|
<article
|
|
50
53
|
className="tpl-dc"
|
|
51
54
|
style={documentStyle('dc', style)}
|
|
55
|
+
{...documentStyleAttributes(style)}
|
|
52
56
|
aria-label={doc.t.resume}
|
|
53
57
|
lang={doc.locale}
|
|
54
58
|
>
|
|
@@ -15,7 +15,10 @@ import { DescribedEntries } from '../../kit/DescribedEntries.js';
|
|
|
15
15
|
import { LanguageList } from '../../kit/LanguageList.js';
|
|
16
16
|
import { BulletSkillGroup } from '../../kit/BulletSkillGroup.js';
|
|
17
17
|
import { useContactLines } from '../../kit/contact.js';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
documentStyle,
|
|
20
|
+
documentStyleAttributes,
|
|
21
|
+
} from '../../kit/documentStyle.js';
|
|
19
22
|
import { Heading } from '../../kit/Heading.js';
|
|
20
23
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
21
24
|
import {
|
|
@@ -50,6 +53,7 @@ export function DoubleColumnLogosDocument({
|
|
|
50
53
|
<article
|
|
51
54
|
className="tpl-dcl"
|
|
52
55
|
style={documentStyle('dcl', style)}
|
|
56
|
+
{...documentStyleAttributes(style)}
|
|
53
57
|
aria-label={doc.t.resume}
|
|
54
58
|
lang={doc.locale}
|
|
55
59
|
>
|
|
@@ -16,7 +16,10 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
16
16
|
import { GridSkillGroup } from '../../kit/GridSkillGroup.js';
|
|
17
17
|
import { InitialsAvatar } from '../../kit/InitialsAvatar.js';
|
|
18
18
|
import { useContactLines } from '../../kit/contact.js';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
documentStyle,
|
|
21
|
+
documentStyleAttributes,
|
|
22
|
+
} from '../../kit/documentStyle.js';
|
|
20
23
|
import { Heading } from '../../kit/Heading.js';
|
|
21
24
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
22
25
|
import {
|
|
@@ -47,6 +50,7 @@ export function ElegantDocument({ resume }: ElegantDocumentProps) {
|
|
|
47
50
|
<article
|
|
48
51
|
className="tpl-elegant"
|
|
49
52
|
style={documentStyle('el', style)}
|
|
53
|
+
{...documentStyleAttributes(style)}
|
|
50
54
|
aria-label={doc.t.resume}
|
|
51
55
|
lang={doc.locale}
|
|
52
56
|
>
|
|
@@ -15,7 +15,10 @@ import { DescribedEntries } from '../../kit/DescribedEntries.js';
|
|
|
15
15
|
import { LanguageList } from '../../kit/LanguageList.js';
|
|
16
16
|
import { GridSkillGroup } from '../../kit/GridSkillGroup.js';
|
|
17
17
|
import { useContactLines } from '../../kit/contact.js';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
documentStyle,
|
|
20
|
+
documentStyleAttributes,
|
|
21
|
+
} from '../../kit/documentStyle.js';
|
|
19
22
|
import { Heading } from '../../kit/Heading.js';
|
|
20
23
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
21
24
|
import {
|
|
@@ -46,6 +49,7 @@ export function ElegantLogosDocument({ resume }: ElegantLogosDocumentProps) {
|
|
|
46
49
|
<article
|
|
47
50
|
className="tpl-ell"
|
|
48
51
|
style={documentStyle('ell', style)}
|
|
52
|
+
{...documentStyleAttributes(style)}
|
|
49
53
|
aria-label={doc.t.resume}
|
|
50
54
|
lang={doc.locale}
|
|
51
55
|
>
|
|
@@ -15,7 +15,10 @@ import { DescribedEntries } from '../../kit/DescribedEntries.js';
|
|
|
15
15
|
import { LanguageList } from '../../kit/LanguageList.js';
|
|
16
16
|
import { GridSkillGroup } from '../../kit/GridSkillGroup.js';
|
|
17
17
|
import { useContactLines } from '../../kit/contact.js';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
documentStyle,
|
|
20
|
+
documentStyleAttributes,
|
|
21
|
+
} from '../../kit/documentStyle.js';
|
|
19
22
|
import { Heading } from '../../kit/Heading.js';
|
|
20
23
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
21
24
|
import {
|
|
@@ -46,6 +49,7 @@ export function EngineerDocument({ resume }: EngineerDocumentProps) {
|
|
|
46
49
|
<article
|
|
47
50
|
className="tpl-engineer"
|
|
48
51
|
style={documentStyle('eng', style)}
|
|
52
|
+
{...documentStyleAttributes(style)}
|
|
49
53
|
aria-label={doc.t.resume}
|
|
50
54
|
lang={doc.locale}
|
|
51
55
|
>
|
|
@@ -16,7 +16,10 @@ import { LanguageList } from '../../kit/LanguageList.js';
|
|
|
16
16
|
import { BulletSkillGroup } from '../../kit/BulletSkillGroup.js';
|
|
17
17
|
import { monogram } from '../../kit/monogram.js';
|
|
18
18
|
import { useContactLines } from '../../kit/contact.js';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
documentStyle,
|
|
21
|
+
documentStyleAttributes,
|
|
22
|
+
} from '../../kit/documentStyle.js';
|
|
20
23
|
import { Heading } from '../../kit/Heading.js';
|
|
21
24
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
22
25
|
import {
|
|
@@ -49,6 +52,7 @@ export function ExecutiveDocument({ resume }: ExecutiveDocumentProps) {
|
|
|
49
52
|
<article
|
|
50
53
|
className="tpl-exec"
|
|
51
54
|
style={documentStyle('e', style)}
|
|
55
|
+
{...documentStyleAttributes(style)}
|
|
52
56
|
aria-label={doc.t.resume}
|
|
53
57
|
lang={doc.locale}
|
|
54
58
|
>
|
|
@@ -14,7 +14,10 @@ import { DocumentSection } from '../../kit/DocumentSection.js';
|
|
|
14
14
|
import { DescribedEntries } from '../../kit/DescribedEntries.js';
|
|
15
15
|
import { LanguageList } from '../../kit/LanguageList.js';
|
|
16
16
|
import { useContactLines } from '../../kit/contact.js';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
documentStyle,
|
|
19
|
+
documentStyleAttributes,
|
|
20
|
+
} from '../../kit/documentStyle.js';
|
|
18
21
|
import { Heading } from '../../kit/Heading.js';
|
|
19
22
|
import { LinkField } from '../../nodes/LinkField.js';
|
|
20
23
|
import {
|
|
@@ -46,6 +49,7 @@ export function HarvardDocument({ resume }: HarvardDocumentProps) {
|
|
|
46
49
|
<article
|
|
47
50
|
className="tpl-harvard"
|
|
48
51
|
style={documentStyle('h', style)}
|
|
52
|
+
{...documentStyleAttributes(style)}
|
|
49
53
|
aria-label={doc.t.resume}
|
|
50
54
|
lang={doc.locale}
|
|
51
55
|
>
|