@resumekit/react 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +74 -2
- package/dist/PagedSheet.d.ts +63 -0
- package/dist/PagedSheet.d.ts.map +1 -0
- package/dist/PagedSheet.js +584 -0
- package/dist/TemplateDocument.d.ts +33 -0
- package/dist/TemplateDocument.d.ts.map +1 -0
- package/dist/TemplateDocument.js +33 -0
- package/dist/autosave-context.d.ts +37 -0
- package/dist/autosave-context.d.ts.map +1 -0
- package/dist/autosave-context.js +24 -0
- package/dist/collections/AuthoredItems.d.ts +9 -0
- package/dist/collections/AuthoredItems.d.ts.map +1 -0
- package/dist/collections/AuthoredItems.js +116 -0
- package/dist/collections/Collection.d.ts +48 -0
- package/dist/collections/Collection.d.ts.map +1 -0
- package/dist/collections/Collection.js +24 -0
- package/dist/collections/CollectionItems.d.ts +94 -0
- package/dist/collections/CollectionItems.d.ts.map +1 -0
- package/dist/collections/CollectionItems.js +91 -0
- package/dist/collections/EntryOverlay.d.ts +38 -0
- package/dist/collections/EntryOverlay.d.ts.map +1 -0
- package/dist/collections/EntryOverlay.js +51 -0
- package/dist/collections/SortableItems.d.ts +52 -0
- package/dist/collections/SortableItems.d.ts.map +1 -0
- package/dist/collections/SortableItems.js +80 -0
- package/dist/collections/authoring-context.d.ts +69 -0
- package/dist/collections/authoring-context.d.ts.map +1 -0
- package/dist/collections/authoring-context.js +36 -0
- package/dist/collections/collection.css +462 -0
- package/dist/collections/entry-text.d.ts +23 -0
- package/dist/collections/entry-text.d.ts.map +1 -0
- package/dist/collections/entry-text.js +35 -0
- package/dist/collections/icons.d.ts +53 -0
- package/dist/collections/icons.d.ts.map +1 -0
- package/dist/collections/icons.js +56 -0
- package/dist/collections/library/LibraryAction.d.ts +24 -0
- package/dist/collections/library/LibraryAction.d.ts.map +1 -0
- package/dist/collections/library/LibraryAction.js +122 -0
- package/dist/collections/library/LibraryPicker.d.ts +42 -0
- package/dist/collections/library/LibraryPicker.d.ts.map +1 -0
- package/dist/collections/library/LibraryPicker.js +94 -0
- package/dist/collections/library/library.css +435 -0
- package/dist/collections/overlay-context.d.ts +34 -0
- package/dist/collections/overlay-context.d.ts.map +1 -0
- package/dist/collections/overlay-context.js +13 -0
- package/dist/collections/preload.d.ts +19 -0
- package/dist/collections/preload.d.ts.map +1 -0
- package/dist/collections/preload.js +23 -0
- package/dist/collections/selection-context.d.ts +25 -0
- package/dist/collections/selection-context.d.ts.map +1 -0
- package/dist/collections/selection-context.js +49 -0
- package/dist/collections/useCollection.d.ts +58 -0
- package/dist/collections/useCollection.d.ts.map +1 -0
- package/dist/collections/useCollection.js +90 -0
- package/dist/collections/useCustomEntries.d.ts +18 -0
- package/dist/collections/useCustomEntries.d.ts.map +1 -0
- package/dist/collections/useCustomEntries.js +56 -0
- package/dist/collections/useSectionCollection.d.ts +48 -0
- package/dist/collections/useSectionCollection.d.ts.map +1 -0
- package/dist/collections/useSectionCollection.js +169 -0
- package/dist/document.css +185 -0
- package/dist/export-bundle/bundle.css +2 -0
- package/dist/export-bundle/bundle.js +67 -0
- package/dist/fields/date-issues-context.d.ts +20 -0
- package/dist/fields/date-issues-context.d.ts.map +1 -0
- package/dist/fields/date-issues-context.js +68 -0
- package/dist/fields/field-registry.d.ts +163 -0
- package/dist/fields/field-registry.d.ts.map +1 -0
- package/dist/fields/field-registry.js +175 -0
- package/dist/fonts/README.md +207 -0
- package/dist/fonts/arimo-400.woff2 +0 -0
- package/dist/fonts/arimo-400i.woff2 +0 -0
- package/dist/fonts/arimo-700.woff2 +0 -0
- package/dist/fonts/arimo-700i.woff2 +0 -0
- package/dist/fonts/bitter-400.woff2 +0 -0
- package/dist/fonts/bitter-400i.woff2 +0 -0
- package/dist/fonts/bitter-700.woff2 +0 -0
- package/dist/fonts/bitter-700i.woff2 +0 -0
- package/dist/fonts/cabin-700.woff2 +0 -0
- package/dist/fonts/carlito-400.woff2 +0 -0
- package/dist/fonts/carlito-400i.woff2 +0 -0
- package/dist/fonts/carlito-700.woff2 +0 -0
- package/dist/fonts/carlito-700i.woff2 +0 -0
- package/dist/fonts/clearsans-400.woff2 +0 -0
- package/dist/fonts/clearsans-400i.woff2 +0 -0
- package/dist/fonts/cochineal-400.woff2 +0 -0
- package/dist/fonts/cochineal-400i.woff2 +0 -0
- package/dist/fonts/cochineal-700.woff2 +0 -0
- package/dist/fonts/ebgaramond-400.woff2 +0 -0
- package/dist/fonts/ebgaramond-400i.woff2 +0 -0
- package/dist/fonts/ebgaramond-700.woff2 +0 -0
- package/dist/fonts/ebgaramond-700i.woff2 +0 -0
- package/dist/fonts/fonts.css +622 -0
- package/dist/fonts/gelasio-400.woff2 +0 -0
- package/dist/fonts/gelasio-400i.woff2 +0 -0
- package/dist/fonts/gelasio-700.woff2 +0 -0
- package/dist/fonts/gelasio-700i.woff2 +0 -0
- package/dist/fonts/heros-400.woff2 +0 -0
- package/dist/fonts/heros-400i.woff2 +0 -0
- package/dist/fonts/heros-700.woff2 +0 -0
- package/dist/fonts/heros-700i.woff2 +0 -0
- package/dist/fonts/inconsolata-400.woff2 +0 -0
- package/dist/fonts/lato-100.woff2 +0 -0
- package/dist/fonts/lato-300.woff2 +0 -0
- package/dist/fonts/lato-300i.woff2 +0 -0
- package/dist/fonts/lato-400.woff2 +0 -0
- package/dist/fonts/lato-400i.woff2 +0 -0
- package/dist/fonts/lato-700.woff2 +0 -0
- package/dist/fonts/lato-700i.woff2 +0 -0
- package/dist/fonts/licenses/arimo-OFL.txt +93 -0
- package/dist/fonts/licenses/bitter-OFL.txt +94 -0
- package/dist/fonts/licenses/cabin-OFL.txt +93 -0
- package/dist/fonts/licenses/carlito-OFL.txt +94 -0
- package/dist/fonts/licenses/clearsans-APACHE-2.0.txt +205 -0
- package/dist/fonts/licenses/cochineal-OFL.txt +96 -0
- package/dist/fonts/licenses/ebgaramond-OFL.txt +93 -0
- package/dist/fonts/licenses/gelasio-OFL.txt +93 -0
- package/dist/fonts/licenses/heros-GUST-FONT-LICENSE.txt +30 -0
- package/dist/fonts/licenses/inconsolata-OFL.txt +93 -0
- package/dist/fonts/licenses/latinmodern-GUST-FONT-LICENSE.txt +35 -0
- package/dist/fonts/licenses/lato-OFL.txt +93 -0
- package/dist/fonts/licenses/ptserif-OFL.txt +93 -0
- package/dist/fonts/licenses/raleway-OFL.txt +93 -0
- package/dist/fonts/licenses/roboto-OFL.txt +93 -0
- package/dist/fonts/licenses/robotocondensed-OFL.txt +93 -0
- package/dist/fonts/licenses/robotoslab-APACHE-2.0.txt +205 -0
- package/dist/fonts/licenses/sourcesans3-OFL.txt +93 -0
- package/dist/fonts/licenses/tinos-OFL.txt +93 -0
- package/dist/fonts/lmmono-400.woff2 +0 -0
- package/dist/fonts/lmroman-400.woff2 +0 -0
- package/dist/fonts/lmroman-400i.woff2 +0 -0
- package/dist/fonts/lmroman-700.woff2 +0 -0
- package/dist/fonts/lmroman-700i.woff2 +0 -0
- package/dist/fonts/lmromancaps-400.woff2 +0 -0
- package/dist/fonts/ptserif-400.woff2 +0 -0
- package/dist/fonts/ptserif-400i.woff2 +0 -0
- package/dist/fonts/ptserif-700.woff2 +0 -0
- package/dist/fonts/ptserif-700i.woff2 +0 -0
- package/dist/fonts/raleway-300.woff2 +0 -0
- package/dist/fonts/raleway-400.woff2 +0 -0
- package/dist/fonts/raleway-400i.woff2 +0 -0
- package/dist/fonts/raleway-500.woff2 +0 -0
- package/dist/fonts/raleway-700.woff2 +0 -0
- package/dist/fonts/roboto-100.woff2 +0 -0
- package/dist/fonts/roboto-300.woff2 +0 -0
- package/dist/fonts/roboto-300i.woff2 +0 -0
- package/dist/fonts/roboto-400.woff2 +0 -0
- package/dist/fonts/roboto-400i.woff2 +0 -0
- package/dist/fonts/roboto-700.woff2 +0 -0
- package/dist/fonts/robotocondensed-400.woff2 +0 -0
- package/dist/fonts/robotocondensed-400i.woff2 +0 -0
- package/dist/fonts/robotocondensed-700.woff2 +0 -0
- package/dist/fonts/robotocondensed-700i.woff2 +0 -0
- package/dist/fonts/robotoslab-700.woff2 +0 -0
- package/dist/fonts/sourcesans3-300.woff2 +0 -0
- package/dist/fonts/sourcesans3-300i.woff2 +0 -0
- package/dist/fonts/sourcesans3-400.woff2 +0 -0
- package/dist/fonts/sourcesans3-400i.woff2 +0 -0
- package/dist/fonts/sourcesans3-700.woff2 +0 -0
- package/dist/fonts/tinos-400.woff2 +0 -0
- package/dist/fonts/tinos-400i.woff2 +0 -0
- package/dist/fonts/tinos-700.woff2 +0 -0
- package/dist/fonts/tinos-700i.woff2 +0 -0
- package/dist/i18n/README.md +52 -0
- package/dist/i18n/catalog.d.ts +39 -0
- package/dist/i18n/catalog.d.ts.map +1 -0
- package/dist/i18n/catalog.js +43 -0
- package/dist/i18n/format.d.ts +14 -0
- package/dist/i18n/format.d.ts.map +1 -0
- package/dist/i18n/format.js +38 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/locale-context.d.ts +43 -0
- package/dist/i18n/locale-context.d.ts.map +1 -0
- package/dist/i18n/locale-context.js +74 -0
- package/dist/i18n/locales/en.json +337 -0
- package/dist/i18n/locales/es.json +337 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +99 -0
- package/dist/kit/BulletSkillGroup.d.ts +20 -0
- package/dist/kit/BulletSkillGroup.d.ts.map +1 -0
- package/dist/kit/BulletSkillGroup.js +25 -0
- package/dist/kit/DescribedEntries.d.ts +41 -0
- package/dist/kit/DescribedEntries.d.ts.map +1 -0
- package/dist/kit/DescribedEntries.js +57 -0
- package/dist/kit/DocumentSection.d.ts +58 -0
- package/dist/kit/DocumentSection.d.ts.map +1 -0
- package/dist/kit/DocumentSection.js +38 -0
- package/dist/kit/GridSkillGroup.d.ts +12 -0
- package/dist/kit/GridSkillGroup.d.ts.map +1 -0
- package/dist/kit/GridSkillGroup.js +14 -0
- package/dist/kit/Heading.d.ts +11 -0
- package/dist/kit/Heading.d.ts.map +1 -0
- package/dist/kit/Heading.js +10 -0
- package/dist/kit/InitialsAvatar.d.ts +17 -0
- package/dist/kit/InitialsAvatar.d.ts.map +1 -0
- package/dist/kit/InitialsAvatar.js +18 -0
- package/dist/kit/InitialsChip.d.ts +16 -0
- package/dist/kit/InitialsChip.d.ts.map +1 -0
- package/dist/kit/InitialsChip.js +16 -0
- package/dist/kit/InlineSkillGroup.d.ts +22 -0
- package/dist/kit/InlineSkillGroup.d.ts.map +1 -0
- package/dist/kit/InlineSkillGroup.js +16 -0
- package/dist/kit/LabelledSkillGroup.d.ts +24 -0
- package/dist/kit/LabelledSkillGroup.d.ts.map +1 -0
- package/dist/kit/LabelledSkillGroup.js +20 -0
- package/dist/kit/LanguageList.d.ts +28 -0
- package/dist/kit/LanguageList.d.ts.map +1 -0
- package/dist/kit/LanguageList.js +56 -0
- package/dist/kit/Separator.d.ts +20 -0
- package/dist/kit/Separator.d.ts.map +1 -0
- package/dist/kit/Separator.js +21 -0
- package/dist/kit/TagSkillGroup.d.ts +8 -0
- package/dist/kit/TagSkillGroup.d.ts.map +1 -0
- package/dist/kit/TagSkillGroup.js +10 -0
- package/dist/kit/avatar.css +42 -0
- package/dist/kit/contact-icons.css +70 -0
- package/dist/kit/contact.d.ts +16 -0
- package/dist/kit/contact.d.ts.map +1 -0
- package/dist/kit/contact.js +18 -0
- package/dist/kit/described.css +114 -0
- package/dist/kit/documentStyle.d.ts +12 -0
- package/dist/kit/documentStyle.d.ts.map +1 -0
- package/dist/kit/documentStyle.js +24 -0
- package/dist/kit/heading.css +17 -0
- package/dist/kit/keywords.css +127 -0
- package/dist/kit/language.css +104 -0
- package/dist/kit/layout.css +16 -0
- package/dist/kit/monogram.d.ts +6 -0
- package/dist/kit/monogram.d.ts.map +1 -0
- package/dist/kit/monogram.js +12 -0
- package/dist/kit/panel.css +26 -0
- package/dist/kit/skill-grid.css +93 -0
- package/dist/kit/skill-tags.css +36 -0
- package/dist/kit/textShapes.d.ts +24 -0
- package/dist/kit/textShapes.d.ts.map +1 -0
- package/dist/kit/textShapes.js +32 -0
- package/dist/letter/LetterDocument.d.ts +13 -0
- package/dist/letter/LetterDocument.d.ts.map +1 -0
- package/dist/letter/LetterDocument.js +12 -0
- package/dist/letter/letter.css +75 -0
- package/dist/nodes/AuthoredBullets.d.ts +22 -0
- package/dist/nodes/AuthoredBullets.d.ts.map +1 -0
- package/dist/nodes/AuthoredBullets.js +101 -0
- package/dist/nodes/CustomSections.d.ts +42 -0
- package/dist/nodes/CustomSections.d.ts.map +1 -0
- package/dist/nodes/CustomSections.js +27 -0
- package/dist/nodes/EditableBulletList.d.ts +15 -0
- package/dist/nodes/EditableBulletList.d.ts.map +1 -0
- package/dist/nodes/EditableBulletList.js +98 -0
- package/dist/nodes/EditableInlineList.d.ts +27 -0
- package/dist/nodes/EditableInlineList.d.ts.map +1 -0
- package/dist/nodes/EditableInlineList.js +50 -0
- package/dist/nodes/EditableText.d.ts +79 -0
- package/dist/nodes/EditableText.d.ts.map +1 -0
- package/dist/nodes/EditableText.js +113 -0
- package/dist/nodes/LinkField.d.ts +103 -0
- package/dist/nodes/LinkField.d.ts.map +1 -0
- package/dist/nodes/LinkField.js +277 -0
- package/dist/nodes/PlainTextField.d.ts +38 -0
- package/dist/nodes/PlainTextField.d.ts.map +1 -0
- package/dist/nodes/PlainTextField.js +72 -0
- package/dist/nodes/formatting.d.ts +34 -0
- package/dist/nodes/formatting.d.ts.map +1 -0
- package/dist/nodes/formatting.js +24 -0
- package/dist/nodes/link-field.css +200 -0
- package/dist/nodes/locked.d.ts +38 -0
- package/dist/nodes/locked.d.ts.map +1 -0
- package/dist/nodes/locked.js +65 -0
- package/dist/nodes/template-node.css +720 -0
- package/dist/paged.css +265 -0
- package/dist/pagination.d.ts +93 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +167 -0
- package/dist/picture-context.d.ts +6 -0
- package/dist/picture-context.d.ts.map +1 -0
- package/dist/picture-context.js +14 -0
- package/dist/presentation-context.d.ts +45 -0
- package/dist/presentation-context.d.ts.map +1 -0
- package/dist/presentation-context.js +44 -0
- package/dist/presented.d.ts +16 -0
- package/dist/presented.d.ts.map +1 -0
- package/dist/presented.js +22 -0
- package/dist/rail/ContainerRail.d.ts +29 -0
- package/dist/rail/ContainerRail.d.ts.map +1 -0
- package/dist/rail/ContainerRail.js +50 -0
- package/dist/rail/EntryActions.d.ts +19 -0
- package/dist/rail/EntryActions.d.ts.map +1 -0
- package/dist/rail/EntryActions.js +17 -0
- package/dist/rail/rail-store.d.ts +42 -0
- package/dist/rail/rail-store.d.ts.map +1 -0
- package/dist/rail/rail-store.js +107 -0
- package/dist/rail/rail.css +188 -0
- package/dist/rail/useSpaceDrag.d.ts +30 -0
- package/dist/rail/useSpaceDrag.d.ts.map +1 -0
- package/dist/rail/useSpaceDrag.js +154 -0
- package/dist/registry.d.ts +35 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +74 -0
- package/dist/spacing/spacing-context.d.ts +53 -0
- package/dist/spacing/spacing-context.d.ts.map +1 -0
- package/dist/spacing/spacing-context.js +36 -0
- package/dist/spacing/spacing.css +159 -0
- package/dist/spacing/useSpaceSlot.d.ts +52 -0
- package/dist/spacing/useSpaceSlot.d.ts.map +1 -0
- package/dist/spacing/useSpaceSlot.js +38 -0
- package/dist/static/api.d.ts +13 -0
- package/dist/static/api.d.ts.map +1 -0
- package/dist/static/api.js +1 -0
- package/dist/static/static.mjs +33779 -0
- package/dist/static/templates/academic.css +1 -0
- package/dist/static/templates/alta.css +1 -0
- package/dist/static/templates/classic.css +1 -0
- package/dist/static/templates/cobalt.css +1 -0
- package/dist/static/templates/compact.css +1 -0
- package/dist/static/templates/contemporary.css +1 -0
- package/dist/static/templates/creative.css +1 -0
- package/dist/static/templates/crimson.css +1 -0
- package/dist/static/templates/curve.css +1 -0
- package/dist/static/templates/double-column-logos.css +1 -0
- package/dist/static/templates/double-column.css +1 -0
- package/dist/static/templates/elegant-logos.css +1 -0
- package/dist/static/templates/elegant.css +1 -0
- package/dist/static/templates/engineer.css +1 -0
- package/dist/static/templates/executive.css +1 -0
- package/dist/static/templates/harvard.css +1 -0
- package/dist/static/templates/hipster.css +1 -0
- package/dist/static/templates/ivy.css +1 -0
- package/dist/static/templates/meridian.css +1 -0
- package/dist/static/templates/modern.css +1 -0
- package/dist/static/templates/polished.css +1 -0
- package/dist/static/templates/portrait.css +1 -0
- package/dist/static/templates/prism.css +1 -0
- package/dist/static/templates/scholar.css +1 -0
- package/dist/static/templates/split.css +1 -0
- package/dist/static/templates/stylish.css +1 -0
- package/dist/static/templates/timeline.css +1 -0
- package/dist/static/templates.css +1 -0
- package/dist/templates/academic/AcademicDocument.d.ts +6 -0
- package/dist/templates/academic/AcademicDocument.d.ts.map +1 -0
- package/dist/templates/academic/AcademicDocument.js +29 -0
- package/dist/templates/academic/academic.css +284 -0
- package/dist/templates/academic/entries.d.ts +22 -0
- package/dist/templates/academic/entries.d.ts.map +1 -0
- package/dist/templates/academic/entries.js +17 -0
- package/dist/templates/alta/AltaDocument.d.ts +6 -0
- package/dist/templates/alta/AltaDocument.d.ts.map +1 -0
- package/dist/templates/alta/AltaDocument.js +29 -0
- package/dist/templates/alta/alta.css +413 -0
- package/dist/templates/alta/entries.d.ts +22 -0
- package/dist/templates/alta/entries.d.ts.map +1 -0
- package/dist/templates/alta/entries.js +17 -0
- package/dist/templates/classic/ClassicDocument.d.ts +6 -0
- package/dist/templates/classic/ClassicDocument.d.ts.map +1 -0
- package/dist/templates/classic/ClassicDocument.js +26 -0
- package/dist/templates/classic/classic.css +251 -0
- package/dist/templates/classic/entries.d.ts +22 -0
- package/dist/templates/classic/entries.d.ts.map +1 -0
- package/dist/templates/classic/entries.js +17 -0
- package/dist/templates/cobalt/CobaltDocument.d.ts +6 -0
- package/dist/templates/cobalt/CobaltDocument.d.ts.map +1 -0
- package/dist/templates/cobalt/CobaltDocument.js +28 -0
- package/dist/templates/cobalt/cobalt.css +478 -0
- package/dist/templates/cobalt/crest.d.ts +6 -0
- package/dist/templates/cobalt/crest.d.ts.map +1 -0
- package/dist/templates/cobalt/crest.js +8 -0
- package/dist/templates/cobalt/entries.d.ts +22 -0
- package/dist/templates/cobalt/entries.d.ts.map +1 -0
- package/dist/templates/cobalt/entries.js +17 -0
- package/dist/templates/compact/CompactDocument.d.ts +6 -0
- package/dist/templates/compact/CompactDocument.d.ts.map +1 -0
- package/dist/templates/compact/CompactDocument.js +28 -0
- package/dist/templates/compact/compact.css +240 -0
- package/dist/templates/compact/entries.d.ts +22 -0
- package/dist/templates/compact/entries.d.ts.map +1 -0
- package/dist/templates/compact/entries.js +17 -0
- package/dist/templates/contemporary/ContemporaryDocument.d.ts +6 -0
- package/dist/templates/contemporary/ContemporaryDocument.d.ts.map +1 -0
- package/dist/templates/contemporary/ContemporaryDocument.js +29 -0
- package/dist/templates/contemporary/contemporary.css +411 -0
- package/dist/templates/contemporary/entries.d.ts +22 -0
- package/dist/templates/contemporary/entries.d.ts.map +1 -0
- package/dist/templates/contemporary/entries.js +17 -0
- package/dist/templates/creative/CreativeDocument.d.ts +6 -0
- package/dist/templates/creative/CreativeDocument.d.ts.map +1 -0
- package/dist/templates/creative/CreativeDocument.js +29 -0
- package/dist/templates/creative/creative.css +326 -0
- package/dist/templates/creative/entries.d.ts +22 -0
- package/dist/templates/creative/entries.d.ts.map +1 -0
- package/dist/templates/creative/entries.js +17 -0
- package/dist/templates/crimson/CrimsonDocument.d.ts +6 -0
- package/dist/templates/crimson/CrimsonDocument.d.ts.map +1 -0
- package/dist/templates/crimson/CrimsonDocument.js +30 -0
- package/dist/templates/crimson/crimson.css +301 -0
- package/dist/templates/crimson/entries.d.ts +22 -0
- package/dist/templates/crimson/entries.d.ts.map +1 -0
- package/dist/templates/crimson/entries.js +17 -0
- package/dist/templates/curve/CurveDocument.d.ts +6 -0
- package/dist/templates/curve/CurveDocument.d.ts.map +1 -0
- package/dist/templates/curve/CurveDocument.js +29 -0
- package/dist/templates/curve/curve.css +330 -0
- package/dist/templates/curve/entries.d.ts +22 -0
- package/dist/templates/curve/entries.d.ts.map +1 -0
- package/dist/templates/curve/entries.js +17 -0
- package/dist/templates/double-column/DoubleColumnDocument.d.ts +6 -0
- package/dist/templates/double-column/DoubleColumnDocument.d.ts.map +1 -0
- package/dist/templates/double-column/DoubleColumnDocument.js +29 -0
- package/dist/templates/double-column/double-column.css +331 -0
- package/dist/templates/double-column/entries.d.ts +22 -0
- package/dist/templates/double-column/entries.d.ts.map +1 -0
- package/dist/templates/double-column/entries.js +17 -0
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.d.ts +6 -0
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.d.ts.map +1 -0
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.js +28 -0
- package/dist/templates/double-column-logos/double-column-logos.css +333 -0
- package/dist/templates/double-column-logos/entries.d.ts +22 -0
- package/dist/templates/double-column-logos/entries.d.ts.map +1 -0
- package/dist/templates/double-column-logos/entries.js +18 -0
- package/dist/templates/elegant/ElegantDocument.d.ts +6 -0
- package/dist/templates/elegant/ElegantDocument.d.ts.map +1 -0
- package/dist/templates/elegant/ElegantDocument.js +31 -0
- package/dist/templates/elegant/elegant.css +358 -0
- package/dist/templates/elegant/entries.d.ts +22 -0
- package/dist/templates/elegant/entries.d.ts.map +1 -0
- package/dist/templates/elegant/entries.js +17 -0
- package/dist/templates/elegant-logos/ElegantLogosDocument.d.ts +6 -0
- package/dist/templates/elegant-logos/ElegantLogosDocument.d.ts.map +1 -0
- package/dist/templates/elegant-logos/ElegantLogosDocument.js +30 -0
- package/dist/templates/elegant-logos/elegant-logos.css +370 -0
- package/dist/templates/elegant-logos/entries.d.ts +22 -0
- package/dist/templates/elegant-logos/entries.d.ts.map +1 -0
- package/dist/templates/elegant-logos/entries.js +18 -0
- package/dist/templates/engineer/EngineerDocument.d.ts +6 -0
- package/dist/templates/engineer/EngineerDocument.d.ts.map +1 -0
- package/dist/templates/engineer/EngineerDocument.js +26 -0
- package/dist/templates/engineer/engineer.css +261 -0
- package/dist/templates/engineer/entries.d.ts +22 -0
- package/dist/templates/engineer/entries.d.ts.map +1 -0
- package/dist/templates/engineer/entries.js +17 -0
- package/dist/templates/executive/ExecutiveDocument.d.ts +6 -0
- package/dist/templates/executive/ExecutiveDocument.d.ts.map +1 -0
- package/dist/templates/executive/ExecutiveDocument.js +29 -0
- package/dist/templates/executive/entries.d.ts +22 -0
- package/dist/templates/executive/entries.d.ts.map +1 -0
- package/dist/templates/executive/entries.js +17 -0
- package/dist/templates/executive/executive.css +394 -0
- package/dist/templates/harvard/HarvardDocument.d.ts +6 -0
- package/dist/templates/harvard/HarvardDocument.d.ts.map +1 -0
- package/dist/templates/harvard/HarvardDocument.js +25 -0
- package/dist/templates/harvard/entries.d.ts +28 -0
- package/dist/templates/harvard/entries.d.ts.map +1 -0
- package/dist/templates/harvard/entries.js +22 -0
- package/dist/templates/harvard/harvard.css +436 -0
- package/dist/templates/hipster/HipsterDocument.d.ts +6 -0
- package/dist/templates/hipster/HipsterDocument.d.ts.map +1 -0
- package/dist/templates/hipster/HipsterDocument.js +30 -0
- package/dist/templates/hipster/entries.d.ts +22 -0
- package/dist/templates/hipster/entries.d.ts.map +1 -0
- package/dist/templates/hipster/entries.js +17 -0
- package/dist/templates/hipster/hipster.css +442 -0
- package/dist/templates/ivy/IvyDocument.d.ts +6 -0
- package/dist/templates/ivy/IvyDocument.d.ts.map +1 -0
- package/dist/templates/ivy/IvyDocument.js +26 -0
- package/dist/templates/ivy/entries.d.ts +22 -0
- package/dist/templates/ivy/entries.d.ts.map +1 -0
- package/dist/templates/ivy/entries.js +17 -0
- package/dist/templates/ivy/ivy.css +292 -0
- package/dist/templates/meridian/MeridianDocument.d.ts +6 -0
- package/dist/templates/meridian/MeridianDocument.d.ts.map +1 -0
- package/dist/templates/meridian/MeridianDocument.js +28 -0
- package/dist/templates/meridian/entries.d.ts +22 -0
- package/dist/templates/meridian/entries.d.ts.map +1 -0
- package/dist/templates/meridian/entries.js +17 -0
- package/dist/templates/meridian/meridian.css +431 -0
- package/dist/templates/modern/ModernDocument.d.ts +6 -0
- package/dist/templates/modern/ModernDocument.d.ts.map +1 -0
- package/dist/templates/modern/ModernDocument.js +29 -0
- package/dist/templates/modern/entries.d.ts +22 -0
- package/dist/templates/modern/entries.d.ts.map +1 -0
- package/dist/templates/modern/entries.js +17 -0
- package/dist/templates/modern/modern.css +309 -0
- package/dist/templates/polished/PolishedDocument.d.ts +6 -0
- package/dist/templates/polished/PolishedDocument.d.ts.map +1 -0
- package/dist/templates/polished/PolishedDocument.js +28 -0
- package/dist/templates/polished/entries.d.ts +22 -0
- package/dist/templates/polished/entries.d.ts.map +1 -0
- package/dist/templates/polished/entries.js +17 -0
- package/dist/templates/polished/polished.css +327 -0
- package/dist/templates/portrait/PortraitDocument.d.ts +6 -0
- package/dist/templates/portrait/PortraitDocument.d.ts.map +1 -0
- package/dist/templates/portrait/PortraitDocument.js +30 -0
- package/dist/templates/portrait/entries.d.ts +22 -0
- package/dist/templates/portrait/entries.d.ts.map +1 -0
- package/dist/templates/portrait/entries.js +17 -0
- package/dist/templates/portrait/portrait.css +427 -0
- package/dist/templates/prism/PrismDocument.d.ts +6 -0
- package/dist/templates/prism/PrismDocument.d.ts.map +1 -0
- package/dist/templates/prism/PrismDocument.js +35 -0
- package/dist/templates/prism/entries.d.ts +22 -0
- package/dist/templates/prism/entries.d.ts.map +1 -0
- package/dist/templates/prism/entries.js +17 -0
- package/dist/templates/prism/prism.css +314 -0
- package/dist/templates/scholar/ScholarDocument.d.ts +6 -0
- package/dist/templates/scholar/ScholarDocument.d.ts.map +1 -0
- package/dist/templates/scholar/ScholarDocument.js +27 -0
- package/dist/templates/scholar/entries.d.ts +22 -0
- package/dist/templates/scholar/entries.d.ts.map +1 -0
- package/dist/templates/scholar/entries.js +17 -0
- package/dist/templates/scholar/scholar.css +279 -0
- package/dist/templates/skills.d.ts +19 -0
- package/dist/templates/skills.d.ts.map +1 -0
- package/dist/templates/skills.js +19 -0
- package/dist/templates/split/SplitDocument.d.ts +6 -0
- package/dist/templates/split/SplitDocument.d.ts.map +1 -0
- package/dist/templates/split/SplitDocument.js +29 -0
- package/dist/templates/split/entries.d.ts +22 -0
- package/dist/templates/split/entries.d.ts.map +1 -0
- package/dist/templates/split/entries.js +17 -0
- package/dist/templates/split/split.css +337 -0
- package/dist/templates/stylish/StylishDocument.d.ts +6 -0
- package/dist/templates/stylish/StylishDocument.d.ts.map +1 -0
- package/dist/templates/stylish/StylishDocument.js +29 -0
- package/dist/templates/stylish/entries.d.ts +22 -0
- package/dist/templates/stylish/entries.d.ts.map +1 -0
- package/dist/templates/stylish/entries.js +17 -0
- package/dist/templates/stylish/stylish.css +340 -0
- package/dist/templates/timeline/TimelineDocument.d.ts +6 -0
- package/dist/templates/timeline/TimelineDocument.d.ts.map +1 -0
- package/dist/templates/timeline/TimelineDocument.js +27 -0
- package/dist/templates/timeline/entries.d.ts +22 -0
- package/dist/templates/timeline/entries.d.ts.map +1 -0
- package/dist/templates/timeline/entries.js +17 -0
- package/dist/templates/timeline/timeline.css +295 -0
- package/dist/useFitZoom.d.ts +99 -0
- package/dist/useFitZoom.d.ts.map +1 -0
- package/dist/useFitZoom.js +171 -0
- package/package.json +81 -3
- package/src/PagedSheet.tsx +792 -0
- package/src/TemplateDocument.tsx +112 -0
- package/src/autosave-context.tsx +67 -0
- package/src/collections/AuthoredItems.tsx +199 -0
- package/src/collections/Collection.tsx +73 -0
- package/src/collections/CollectionItems.tsx +318 -0
- package/src/collections/EntryOverlay.tsx +162 -0
- package/src/collections/SortableItems.tsx +167 -0
- package/src/collections/authoring-context.tsx +140 -0
- package/src/collections/entry-text.ts +41 -0
- package/src/collections/icons.tsx +83 -0
- package/src/collections/library/LibraryAction.tsx +200 -0
- package/src/collections/library/LibraryPicker.tsx +325 -0
- package/src/collections/overlay-context.tsx +49 -0
- package/src/collections/preload.ts +23 -0
- package/src/collections/selection-context.tsx +88 -0
- package/src/collections/useCollection.ts +133 -0
- package/src/collections/useCustomEntries.ts +84 -0
- package/src/collections/useSectionCollection.ts +268 -0
- package/src/compiler/emit.ts +736 -0
- package/src/compiler/schema.ts +689 -0
- package/src/export/entry.tsx +177 -0
- package/src/fields/date-issues-context.tsx +105 -0
- package/src/fields/field-registry.tsx +358 -0
- package/src/i18n/catalog.ts +81 -0
- package/src/i18n/format.ts +50 -0
- package/src/i18n/index.ts +21 -0
- package/src/i18n/locale-context.tsx +135 -0
- package/src/index.ts +156 -0
- package/src/kit/BulletSkillGroup.tsx +37 -0
- package/src/kit/DescribedEntries.tsx +132 -0
- package/src/kit/DocumentSection.tsx +97 -0
- package/src/kit/GridSkillGroup.tsx +17 -0
- package/src/kit/Heading.tsx +17 -0
- package/src/kit/InitialsAvatar.tsx +31 -0
- package/src/kit/InitialsChip.tsx +29 -0
- package/src/kit/InlineSkillGroup.tsx +41 -0
- package/src/kit/LabelledSkillGroup.tsx +68 -0
- package/src/kit/LanguageList.tsx +148 -0
- package/src/kit/Separator.tsx +30 -0
- package/src/kit/TagSkillGroup.tsx +19 -0
- package/src/kit/contact.ts +34 -0
- package/src/kit/documentStyle.ts +33 -0
- package/src/kit/monogram.ts +11 -0
- package/src/kit/textShapes.tsx +61 -0
- package/src/letter/LetterDocument.tsx +33 -0
- package/src/nodes/AuthoredBullets.tsx +253 -0
- package/src/nodes/CustomSections.tsx +138 -0
- package/src/nodes/EditableBulletList.tsx +186 -0
- package/src/nodes/EditableInlineList.tsx +109 -0
- package/src/nodes/EditableText.tsx +261 -0
- package/src/nodes/LinkField.tsx +438 -0
- package/src/nodes/PlainTextField.tsx +132 -0
- package/src/nodes/formatting.ts +58 -0
- package/src/nodes/locked.ts +67 -0
- package/src/pagination.ts +238 -0
- package/src/picture-context.tsx +18 -0
- package/src/presentation-context.tsx +87 -0
- package/src/presented.ts +29 -0
- package/src/rail/ContainerRail.tsx +145 -0
- package/src/rail/EntryActions.tsx +104 -0
- package/src/rail/rail-store.tsx +126 -0
- package/src/rail/useSpaceDrag.ts +177 -0
- package/src/registry.ts +101 -0
- package/src/spacing/spacing-context.tsx +100 -0
- package/src/spacing/useSpaceSlot.tsx +97 -0
- package/src/static/api.ts +19 -0
- package/src/static/fixtures.ts +80 -0
- package/src/static/render.tsx +24 -0
- package/src/templates/academic/AcademicDocument.tsx +255 -0
- package/src/templates/academic/entries.tsx +176 -0
- package/src/templates/alta/AltaDocument.tsx +265 -0
- package/src/templates/alta/entries.tsx +167 -0
- package/src/templates/classic/ClassicDocument.tsx +248 -0
- package/src/templates/classic/entries.tsx +175 -0
- package/src/templates/cobalt/CobaltDocument.tsx +302 -0
- package/src/templates/cobalt/crest.tsx +31 -0
- package/src/templates/cobalt/entries.tsx +136 -0
- package/src/templates/compact/CompactDocument.tsx +256 -0
- package/src/templates/compact/entries.tsx +167 -0
- package/src/templates/contemporary/ContemporaryDocument.tsx +287 -0
- package/src/templates/contemporary/entries.tsx +167 -0
- package/src/templates/creative/CreativeDocument.tsx +269 -0
- package/src/templates/creative/entries.tsx +167 -0
- package/src/templates/crimson/CrimsonDocument.tsx +283 -0
- package/src/templates/crimson/entries.tsx +169 -0
- package/src/templates/curve/CurveDocument.tsx +259 -0
- package/src/templates/curve/entries.tsx +168 -0
- package/src/templates/double-column/DoubleColumnDocument.tsx +269 -0
- package/src/templates/double-column/entries.tsx +169 -0
- package/src/templates/double-column-logos/DoubleColumnLogosDocument.tsx +262 -0
- package/src/templates/double-column-logos/entries.tsx +172 -0
- package/src/templates/elegant/ElegantDocument.tsx +297 -0
- package/src/templates/elegant/entries.tsx +167 -0
- package/src/templates/elegant-logos/ElegantLogosDocument.tsx +291 -0
- package/src/templates/elegant-logos/entries.tsx +170 -0
- package/src/templates/engineer/EngineerDocument.tsx +248 -0
- package/src/templates/engineer/entries.tsx +170 -0
- package/src/templates/executive/ExecutiveDocument.tsx +312 -0
- package/src/templates/executive/entries.tsx +146 -0
- package/src/templates/harvard/HarvardDocument.tsx +248 -0
- package/src/templates/harvard/entries.tsx +205 -0
- package/src/templates/hipster/HipsterDocument.tsx +289 -0
- package/src/templates/hipster/entries.tsx +175 -0
- package/src/templates/ivy/IvyDocument.tsx +248 -0
- package/src/templates/ivy/entries.tsx +167 -0
- package/src/templates/meridian/MeridianDocument.tsx +304 -0
- package/src/templates/meridian/entries.tsx +140 -0
- package/src/templates/modern/ModernDocument.tsx +265 -0
- package/src/templates/modern/entries.tsx +167 -0
- package/src/templates/polished/PolishedDocument.tsx +262 -0
- package/src/templates/polished/entries.tsx +167 -0
- package/src/templates/portrait/PortraitDocument.tsx +278 -0
- package/src/templates/portrait/entries.tsx +173 -0
- package/src/templates/prism/PrismDocument.tsx +307 -0
- package/src/templates/prism/entries.tsx +175 -0
- package/src/templates/scholar/ScholarDocument.tsx +266 -0
- package/src/templates/scholar/entries.tsx +169 -0
- package/src/templates/skills.ts +21 -0
- package/src/templates/split/SplitDocument.tsx +293 -0
- package/src/templates/split/entries.tsx +164 -0
- package/src/templates/stylish/StylishDocument.tsx +265 -0
- package/src/templates/stylish/entries.tsx +167 -0
- package/src/templates/timeline/TimelineDocument.tsx +251 -0
- package/src/templates/timeline/entries.tsx +173 -0
- package/src/useFitZoom.ts +185 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ResumeSectionId } from '@resumekit/schema';
|
|
3
|
+
import { useSpaceSlot } from '../spacing/useSpaceSlot.js';
|
|
4
|
+
import { EditableText } from '../nodes/EditableText.js';
|
|
5
|
+
import { Heading } from './Heading.js';
|
|
6
|
+
import { leadLetters, type HeadingLead } from './textShapes.js';
|
|
7
|
+
|
|
8
|
+
export interface DocumentSectionProps {
|
|
9
|
+
/** The stored section this is, which gives it an adjustable gap and a rail. */
|
|
10
|
+
id: ResumeSectionId;
|
|
11
|
+
/**
|
|
12
|
+
* What this section is called by default — the template's own word for it.
|
|
13
|
+
*
|
|
14
|
+
* Printed unless the candidate has renamed the section, and used as the
|
|
15
|
+
* guidance in the field when they clear it, so a section can never end up
|
|
16
|
+
* with no heading at all.
|
|
17
|
+
*/
|
|
18
|
+
title: string;
|
|
19
|
+
/**
|
|
20
|
+
* The heading the candidate typed, from `resume.section_headings[id]`.
|
|
21
|
+
*
|
|
22
|
+
* Passed in rather than read from a context because a template already has
|
|
23
|
+
* the résumé in hand, and a second way to reach the document's own data is a
|
|
24
|
+
* second thing that can disagree with the first.
|
|
25
|
+
*/
|
|
26
|
+
heading?: string;
|
|
27
|
+
/** The template's own section and heading classes. */
|
|
28
|
+
className: string;
|
|
29
|
+
headingClassName: string;
|
|
30
|
+
/**
|
|
31
|
+
* The heading's first letters set apart for the template's stylesheet
|
|
32
|
+
* (`headingAccent`). The heading stays one field.
|
|
33
|
+
*/
|
|
34
|
+
headingLead?: HeadingLead;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* One of the résumé's named sections, in whichever template draws it.
|
|
40
|
+
*
|
|
41
|
+
* The gap above it, its rail, and its editable heading come with it, so every
|
|
42
|
+
* template offers the same controls by using this rather than by remembering
|
|
43
|
+
* to. A component rather than a hook per section, because a template renders a
|
|
44
|
+
* section only when it has something in it, and a hook cannot be called behind
|
|
45
|
+
* that.
|
|
46
|
+
*
|
|
47
|
+
* ## The heading is a field
|
|
48
|
+
*
|
|
49
|
+
* `EditableText`, addressed at `section_headings.<id>`, so renaming a section
|
|
50
|
+
* is an ordinary `set` edit and needs no edit kind, no store and no save path of
|
|
51
|
+
* its own — it rides the one the rest of the document's text already uses, and
|
|
52
|
+
* is therefore undoable, exportable and template-independent for free. A custom
|
|
53
|
+
* section's heading has been editable since it was introduced; this is the same
|
|
54
|
+
* capability for the sections the schema names.
|
|
55
|
+
*
|
|
56
|
+
* The VALUE is `heading || title`: the candidate's word when they have typed
|
|
57
|
+
* one, and the template's own otherwise. So the default is real text that
|
|
58
|
+
* prints and extracts rather than a placeholder, and clearing the field returns
|
|
59
|
+
* the section to its proper name instead of leaving the page with a nameless
|
|
60
|
+
* block of entries.
|
|
61
|
+
*/
|
|
62
|
+
export function DocumentSection({
|
|
63
|
+
id,
|
|
64
|
+
title,
|
|
65
|
+
heading,
|
|
66
|
+
className,
|
|
67
|
+
headingClassName,
|
|
68
|
+
headingLead,
|
|
69
|
+
children,
|
|
70
|
+
}: DocumentSectionProps) {
|
|
71
|
+
/*
|
|
72
|
+
* The rail is named by what is PRINTED, so "Interests · space above" names
|
|
73
|
+
* the section the candidate can see rather than the one the schema calls it.
|
|
74
|
+
*/
|
|
75
|
+
const printed = heading || title;
|
|
76
|
+
const space = useSpaceSlot({ section: id }, printed);
|
|
77
|
+
return (
|
|
78
|
+
<section className={className} {...space.rootProps}>
|
|
79
|
+
{space.handle}
|
|
80
|
+
<Heading
|
|
81
|
+
level={2}
|
|
82
|
+
className={headingClassName}
|
|
83
|
+
data-block
|
|
84
|
+
data-keep-with-next
|
|
85
|
+
>
|
|
86
|
+
<EditableText
|
|
87
|
+
path={`section_headings.${id}`}
|
|
88
|
+
value={printed}
|
|
89
|
+
placeholder={title}
|
|
90
|
+
defaultValue={title}
|
|
91
|
+
shape={headingLead && leadLetters(headingLead)}
|
|
92
|
+
/>
|
|
93
|
+
</Heading>
|
|
94
|
+
{children}
|
|
95
|
+
</section>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LabelledSkillGroup,
|
|
3
|
+
type SkillGroupProps,
|
|
4
|
+
} from './LabelledSkillGroup.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A skills group as one row of an invisible table: its category in the label
|
|
8
|
+
* column, its skills in cells. The shape is `skill-grid.css`; drawn inside a
|
|
9
|
+
* `tpl-skill-grid` list.
|
|
10
|
+
*
|
|
11
|
+
* The skills are list items with no separator between them. Chromium drops a
|
|
12
|
+
* hidden separator from the PDF it prints, so what a parser can see is the
|
|
13
|
+
* cell: one skill per cell reads as one skill per line.
|
|
14
|
+
*/
|
|
15
|
+
export function GridSkillGroup(props: SkillGroupProps) {
|
|
16
|
+
return <LabelledSkillGroup {...props} block="tpl-skill-grid" />;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { usePicture } from '../picture-context.js';
|
|
3
|
+
import './heading.css';
|
|
4
|
+
|
|
5
|
+
type HeadingProps = HTMLAttributes<HTMLElement> & {
|
|
6
|
+
level: 1 | 2 | 3;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
'data-block'?: boolean;
|
|
9
|
+
'data-keep-with-next'?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** A heading — or, in a picture, a `div` drawn like one (`heading.css`). */
|
|
13
|
+
export function Heading({ level, ...props }: HeadingProps) {
|
|
14
|
+
if (usePicture()) return <div data-h={level} {...props} />;
|
|
15
|
+
const Tag = `h${level}` as const;
|
|
16
|
+
return <Tag {...props} />;
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { monogram } from './monogram.js';
|
|
2
|
+
import './avatar.css';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The candidate's initials, where a design shows a portrait.
|
|
6
|
+
*
|
|
7
|
+
* A résumé stores no photograph, and one cannot be invented — but the slot is
|
|
8
|
+
* part of the design, and leaving it empty is a hole in the page. So the
|
|
9
|
+
* initials are drawn there, derived from the name printed beside them, which
|
|
10
|
+
* means they can never disagree with it.
|
|
11
|
+
*
|
|
12
|
+
* `aria-hidden`, and no text of its own that a parser would read: the name is
|
|
13
|
+
* real text a few millimetres away, and an extracted "IW" between it and the
|
|
14
|
+
* headline would be noise in the one place a screening system is strictest.
|
|
15
|
+
*/
|
|
16
|
+
export function InitialsAvatar({
|
|
17
|
+
name,
|
|
18
|
+
className,
|
|
19
|
+
}: {
|
|
20
|
+
name: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}) {
|
|
23
|
+
return (
|
|
24
|
+
<p
|
|
25
|
+
className={['tpl-avatar', className].filter(Boolean).join(' ')}
|
|
26
|
+
aria-hidden="true"
|
|
27
|
+
>
|
|
28
|
+
{monogram(name)}
|
|
29
|
+
</p>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { monogram } from './monogram.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An employer's initials, where a design shows its logo.
|
|
5
|
+
*
|
|
6
|
+
* A résumé stores no logos, and fetching one would mean a network request from
|
|
7
|
+
* a renderer that resolves no URLs — the property that keeps a crafted résumé
|
|
8
|
+
* from steering it anywhere. So the chip carries the initials of the name the
|
|
9
|
+
* entry already prints.
|
|
10
|
+
*
|
|
11
|
+
* `aria-hidden`, and nothing for a parser to read: the employer's name is real
|
|
12
|
+
* text beside it.
|
|
13
|
+
*/
|
|
14
|
+
export function InitialsChip({
|
|
15
|
+
name,
|
|
16
|
+
className,
|
|
17
|
+
}: {
|
|
18
|
+
name: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}) {
|
|
21
|
+
return (
|
|
22
|
+
<span
|
|
23
|
+
className={['tpl-chip', className].filter(Boolean).join(' ')}
|
|
24
|
+
aria-hidden="true"
|
|
25
|
+
>
|
|
26
|
+
{monogram(name)}
|
|
27
|
+
</span>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { SkillGroup } from '@resumekit/schema';
|
|
2
|
+
import { useEditorText } from '../i18n/index.js';
|
|
3
|
+
import { EditableInlineList } from '../nodes/EditableInlineList.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A skills group as its items on a line, for the templates that print skills
|
|
7
|
+
* as one run of keywords.
|
|
8
|
+
*
|
|
9
|
+
* Like `BulletSkillGroup`, not an addressable container: the group is storage,
|
|
10
|
+
* the skills are what the page shows. Its separator is a real character, so a
|
|
11
|
+
* parser reading the exported PDF gets "React · TypeScript" rather than two
|
|
12
|
+
* words run together.
|
|
13
|
+
*/
|
|
14
|
+
export function InlineSkillGroup({
|
|
15
|
+
item,
|
|
16
|
+
path,
|
|
17
|
+
separator = ', ',
|
|
18
|
+
first,
|
|
19
|
+
}: {
|
|
20
|
+
item: SkillGroup;
|
|
21
|
+
path: string;
|
|
22
|
+
/**
|
|
23
|
+
* Written between groups, as text — the same separator the items inside a
|
|
24
|
+
* group use, so several groups read as the one run of keywords the page
|
|
25
|
+
* shows rather than as a list of lists.
|
|
26
|
+
*/
|
|
27
|
+
separator?: string;
|
|
28
|
+
first: boolean;
|
|
29
|
+
}) {
|
|
30
|
+
const { placeholder } = useEditorText();
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
{!first && separator}
|
|
34
|
+
<EditableInlineList
|
|
35
|
+
path={`${path}.items`}
|
|
36
|
+
items={item.items}
|
|
37
|
+
placeholder={placeholder('items')}
|
|
38
|
+
/>
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { SkillGroup } from '@resumekit/schema';
|
|
3
|
+
import type { ItemRootProps } from '../collections/CollectionItems.js';
|
|
4
|
+
import { useAuthoring } from '../collections/authoring-context.js';
|
|
5
|
+
import { useEditorText } from '../i18n/index.js';
|
|
6
|
+
import { EditableText } from '../nodes/EditableText.js';
|
|
7
|
+
import { EditableBulletList } from '../nodes/EditableBulletList.js';
|
|
8
|
+
|
|
9
|
+
export interface SkillGroupProps {
|
|
10
|
+
item: SkillGroup;
|
|
11
|
+
path: string;
|
|
12
|
+
chrome: ReactNode;
|
|
13
|
+
itemProps: ItemRootProps;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A skills group the page shows as a group: its category, then its skills.
|
|
18
|
+
* The grid and the tags differ only in their classes and stylesheet.
|
|
19
|
+
*
|
|
20
|
+
* Unlike `BulletSkillGroup`, the group has a heading, so it is an addressable
|
|
21
|
+
* entry with a rail of its own. A group with no category prints no label while
|
|
22
|
+
* read and offers one while authoring.
|
|
23
|
+
*/
|
|
24
|
+
export function LabelledSkillGroup({
|
|
25
|
+
item,
|
|
26
|
+
path,
|
|
27
|
+
chrome,
|
|
28
|
+
itemProps,
|
|
29
|
+
block,
|
|
30
|
+
list,
|
|
31
|
+
}: SkillGroupProps & {
|
|
32
|
+
/** The kit's class for this layout: `tpl-skill-grid` or `tpl-skill-tags`. */
|
|
33
|
+
block: string;
|
|
34
|
+
/** Classes of a wrapper around the skills, when the layout needs one. */
|
|
35
|
+
list?: string;
|
|
36
|
+
}) {
|
|
37
|
+
const { placeholder } = useEditorText();
|
|
38
|
+
const authoring = useAuthoring() !== null;
|
|
39
|
+
const labelled = item.category.length > 0 || authoring;
|
|
40
|
+
const skills = (
|
|
41
|
+
<EditableBulletList
|
|
42
|
+
path={`${path}.items`}
|
|
43
|
+
items={item.items}
|
|
44
|
+
placeholder={placeholder('item')}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
return (
|
|
48
|
+
<div
|
|
49
|
+
{...itemProps}
|
|
50
|
+
className={
|
|
51
|
+
labelled ? `${block}__group` : `${block}__group ${block}__group--bare`
|
|
52
|
+
}
|
|
53
|
+
data-block
|
|
54
|
+
>
|
|
55
|
+
{chrome}
|
|
56
|
+
{labelled && (
|
|
57
|
+
<span className={`${block}__label`}>
|
|
58
|
+
<EditableText
|
|
59
|
+
path={`${path}.category`}
|
|
60
|
+
value={item.category}
|
|
61
|
+
placeholder={placeholder('category')}
|
|
62
|
+
/>
|
|
63
|
+
</span>
|
|
64
|
+
)}
|
|
65
|
+
{list ? <div className={list}>{skills}</div> : skills}
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { LANGUAGE_LEVELS, type Language } from '@resumekit/schema';
|
|
2
|
+
import { DocumentSection } from './DocumentSection.js';
|
|
3
|
+
import type { HeadingLead } from './textShapes.js';
|
|
4
|
+
import { Collection } from '../collections/Collection.js';
|
|
5
|
+
import { useAuthoring } from '../collections/authoring-context.js';
|
|
6
|
+
import { EditableText } from '../nodes/EditableText.js';
|
|
7
|
+
import { useField } from '../fields/field-registry.js';
|
|
8
|
+
import { useDocumentText, useEditorText } from '../i18n/index.js';
|
|
9
|
+
|
|
10
|
+
/** How many of the five steps a level fills. `native` fills all five. */
|
|
11
|
+
function filled(level: string): number {
|
|
12
|
+
const index = LANGUAGE_LEVELS.indexOf(
|
|
13
|
+
level as (typeof LANGUAGE_LEVELS)[number],
|
|
14
|
+
);
|
|
15
|
+
return index < 0 ? 0 : LANGUAGE_LEVELS.length - index;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The level: a word, and — where the template draws one — a five-step meter.
|
|
20
|
+
*
|
|
21
|
+
* The WORD is the content and the meter is the decoration, which is the whole
|
|
22
|
+
* reason this meter is allowed to exist. `docs/template-contract.md` refuses a
|
|
23
|
+
* proficiency meter whose proportions nothing recorded; this one renders one
|
|
24
|
+
* step per stored enum value, and the word beside it carries the meaning for a
|
|
25
|
+
* parser, for a reader, and for a page that prints no marks it was not given.
|
|
26
|
+
*
|
|
27
|
+
* The meter is `aria-hidden` because the word is already the accessible
|
|
28
|
+
* content, and five announced circles are noise.
|
|
29
|
+
*
|
|
30
|
+
* A level with no value yet — a row the candidate has just added — renders no
|
|
31
|
+
* meter and no word. An unchosen level is not a sixth level.
|
|
32
|
+
*/
|
|
33
|
+
function LevelChoice({ path, value }: { path: string; value: string }) {
|
|
34
|
+
const { value: live, editing, set } = useField(path, value);
|
|
35
|
+
const { t } = useEditorText();
|
|
36
|
+
/* How a stored level is written on the page: the document's words. */
|
|
37
|
+
const levels: Readonly<Record<string, string>> = useDocumentText().t.levels;
|
|
38
|
+
const word = levels[live] ?? '';
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
{editing ? (
|
|
43
|
+
<select
|
|
44
|
+
className="tpl-language__choice"
|
|
45
|
+
value={live}
|
|
46
|
+
aria-label={t.language.level}
|
|
47
|
+
onChange={(e) => set(e.target.value)}
|
|
48
|
+
>
|
|
49
|
+
<option value="">{t.language.choose}</option>
|
|
50
|
+
{LANGUAGE_LEVELS.map((level) => (
|
|
51
|
+
<option key={level} value={level}>
|
|
52
|
+
{levels[level]}
|
|
53
|
+
</option>
|
|
54
|
+
))}
|
|
55
|
+
</select>
|
|
56
|
+
) : (
|
|
57
|
+
<span className="tpl-language__level">{word}</span>
|
|
58
|
+
)}
|
|
59
|
+
|
|
60
|
+
{word && (
|
|
61
|
+
<span className="tpl-language__meter" aria-hidden="true">
|
|
62
|
+
{LANGUAGE_LEVELS.map((_, i) => (
|
|
63
|
+
<span
|
|
64
|
+
key={i}
|
|
65
|
+
className={
|
|
66
|
+
i < filled(live)
|
|
67
|
+
? 'tpl-language__step tpl-language__step--on'
|
|
68
|
+
: 'tpl-language__step'
|
|
69
|
+
}
|
|
70
|
+
/>
|
|
71
|
+
))}
|
|
72
|
+
</span>
|
|
73
|
+
)}
|
|
74
|
+
</>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface LanguageListProps {
|
|
79
|
+
/** Optional for the reason `DescribedEntries` states: an unparsed résumé
|
|
80
|
+
* genuinely lacks the field. */
|
|
81
|
+
items: readonly Language[] | undefined;
|
|
82
|
+
/** The template's own section, heading and row classes. */
|
|
83
|
+
className: string;
|
|
84
|
+
headingClassName: string;
|
|
85
|
+
rowClassName: string;
|
|
86
|
+
/** The heading's default, as printed when the candidate has not renamed it. */
|
|
87
|
+
title?: string;
|
|
88
|
+
/** What the candidate renamed it to, from `resume.section_headings.languages`. */
|
|
89
|
+
heading?: string;
|
|
90
|
+
/** As `DocumentSection`'s. */
|
|
91
|
+
headingLead?: HeadingLead;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The languages the candidate speaks, each with a level.
|
|
96
|
+
*
|
|
97
|
+
* Read from `resume.languages`. Before that field existed every template found
|
|
98
|
+
* languages by filtering the skills groups for one whose category matched
|
|
99
|
+
* `/^languages?/i` — so the section had no level and therefore no meter, no
|
|
100
|
+
* `RESUME_SECTIONS` member and therefore no adjustable gap, and it rendered
|
|
101
|
+
* nothing at all for the candidate who had not guessed the magic category name.
|
|
102
|
+
*/
|
|
103
|
+
export function LanguageList({
|
|
104
|
+
items,
|
|
105
|
+
className,
|
|
106
|
+
headingClassName,
|
|
107
|
+
rowClassName,
|
|
108
|
+
title,
|
|
109
|
+
heading,
|
|
110
|
+
headingLead,
|
|
111
|
+
}: LanguageListProps) {
|
|
112
|
+
const authoring = useAuthoring() !== null;
|
|
113
|
+
const { placeholder } = useEditorText();
|
|
114
|
+
const doc = useDocumentText();
|
|
115
|
+
const entries = items ?? [];
|
|
116
|
+
if (entries.length === 0 && !authoring) return null;
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<DocumentSection
|
|
120
|
+
id="languages"
|
|
121
|
+
title={title ?? doc.t.sections.languages}
|
|
122
|
+
heading={heading}
|
|
123
|
+
className={`tpl-languages ${className}`}
|
|
124
|
+
headingClassName={headingClassName}
|
|
125
|
+
headingLead={headingLead}
|
|
126
|
+
>
|
|
127
|
+
<Collection section="languages" items={entries}>
|
|
128
|
+
{({ item, path, chrome, itemProps }) => (
|
|
129
|
+
<div
|
|
130
|
+
{...itemProps}
|
|
131
|
+
className={`tpl-language ${rowClassName}`}
|
|
132
|
+
data-block
|
|
133
|
+
>
|
|
134
|
+
{chrome}
|
|
135
|
+
<span className="tpl-language__name">
|
|
136
|
+
<EditableText
|
|
137
|
+
path={`${path}.name`}
|
|
138
|
+
value={item.name}
|
|
139
|
+
placeholder={placeholder('language')}
|
|
140
|
+
/>
|
|
141
|
+
</span>
|
|
142
|
+
<LevelChoice path={`${path}.level`} value={item.level} />
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
145
|
+
</Collection>
|
|
146
|
+
</DocumentSection>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useAuthoring } from '../collections/authoring-context.js';
|
|
2
|
+
import { useDocumentText, type DocumentMessages } from '../i18n/index.js';
|
|
3
|
+
|
|
4
|
+
type JoinWord = keyof DocumentMessages['joins'];
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What stands between two fields on one line — ", ", " – ", " in ".
|
|
8
|
+
*
|
|
9
|
+
* Printed only when BOTH sides have a value, so a qualification with no field
|
|
10
|
+
* does not end in a dangling comma. While authoring it is always there: each
|
|
11
|
+
* empty side shows its guidance, and two guidances with nothing between them
|
|
12
|
+
* run together into one unreadable word.
|
|
13
|
+
*
|
|
14
|
+
* `text` is punctuation, the same in every language. `word` is a word, which
|
|
15
|
+
* prints in the document's language.
|
|
16
|
+
*/
|
|
17
|
+
export function Separator({
|
|
18
|
+
between,
|
|
19
|
+
text,
|
|
20
|
+
word,
|
|
21
|
+
}: {
|
|
22
|
+
between: readonly [unknown, unknown];
|
|
23
|
+
text?: string;
|
|
24
|
+
word?: JoinWord;
|
|
25
|
+
}) {
|
|
26
|
+
const authoring = useAuthoring() !== null;
|
|
27
|
+
const joins = useDocumentText().t.joins;
|
|
28
|
+
if (!authoring && !(between[0] && between[1])) return null;
|
|
29
|
+
return <>{word ? ` ${joins[word]} ` : text}</>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LabelledSkillGroup,
|
|
3
|
+
type SkillGroupProps,
|
|
4
|
+
} from './LabelledSkillGroup.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A skills group as its category over a run of underlined tags. The group's
|
|
8
|
+
* shape is `skill-tags.css` and the tags are `tpl-keywords--tags`, the same
|
|
9
|
+
* tags an unlabelled run draws; drawn inside a `tpl-skill-tags` list.
|
|
10
|
+
*/
|
|
11
|
+
export function TagSkillGroup(props: SkillGroupProps) {
|
|
12
|
+
return (
|
|
13
|
+
<LabelledSkillGroup
|
|
14
|
+
{...props}
|
|
15
|
+
block="tpl-skill-tags"
|
|
16
|
+
list="tpl-keywords tpl-keywords--tags"
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ResumeObject } from '@resumekit/schema';
|
|
2
|
+
import { useEditorText } from '../i18n/index.js';
|
|
3
|
+
|
|
4
|
+
export type ContactField = keyof ResumeObject['contact'] &
|
|
5
|
+
('email' | 'phone' | 'location');
|
|
6
|
+
|
|
7
|
+
export interface ContactLine {
|
|
8
|
+
field: ContactField;
|
|
9
|
+
path: `contact.${ContactField}`;
|
|
10
|
+
value: string;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The contact details a template prints, in the template's own order.
|
|
16
|
+
*
|
|
17
|
+
* While authoring every field is offered, filled or not — an absent field is
|
|
18
|
+
* one a candidate cannot add. On paper only what was filled in survives.
|
|
19
|
+
*/
|
|
20
|
+
export function useContactLines(
|
|
21
|
+
contact: ResumeObject['contact'],
|
|
22
|
+
order: readonly ContactField[],
|
|
23
|
+
authoring: boolean,
|
|
24
|
+
): ContactLine[] {
|
|
25
|
+
const { placeholder } = useEditorText();
|
|
26
|
+
return order
|
|
27
|
+
.filter((field) => authoring || contact[field])
|
|
28
|
+
.map((field) => ({
|
|
29
|
+
field,
|
|
30
|
+
path: `contact.${field}` as const,
|
|
31
|
+
value: String(contact[field] ?? ''),
|
|
32
|
+
placeholder: placeholder(field),
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
DENSITIES,
|
|
4
|
+
DOCUMENT_FONTS,
|
|
5
|
+
INK_COLORS,
|
|
6
|
+
type DocumentStyle,
|
|
7
|
+
} from '@resumekit/schema';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The candidate's document style as custom properties on a template's root,
|
|
11
|
+
* named with the template's own prefix (`--h-font`, `--c-ink`, …) so its
|
|
12
|
+
* stylesheet stays the only definition of how it looks.
|
|
13
|
+
*
|
|
14
|
+
* Accent and density are written only when chosen: `document-styling` (#36)
|
|
15
|
+
* requires a document that sets neither to render as the template defines it.
|
|
16
|
+
*/
|
|
17
|
+
export function documentStyle(
|
|
18
|
+
prefix: string,
|
|
19
|
+
style: DocumentStyle | undefined,
|
|
20
|
+
): CSSProperties {
|
|
21
|
+
if (!style) return {};
|
|
22
|
+
return {
|
|
23
|
+
[`--${prefix}-font`]: DOCUMENT_FONTS[style.font].stack,
|
|
24
|
+
[`--${prefix}-ink`]: INK_COLORS[style.ink].hex,
|
|
25
|
+
[`--${prefix}-scale`]: String(style.scale),
|
|
26
|
+
...(style.accent
|
|
27
|
+
? { [`--${prefix}-accent`]: INK_COLORS[style.accent].hex }
|
|
28
|
+
: {}),
|
|
29
|
+
...(style.density
|
|
30
|
+
? { [`--${prefix}-density`]: String(DENSITIES[style.density].factor) }
|
|
31
|
+
: {}),
|
|
32
|
+
} as CSSProperties;
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A monogram derived from the name rather than stored: one that could be
|
|
3
|
+
* edited separately could disagree with the name printed beside it.
|
|
4
|
+
*/
|
|
5
|
+
export function monogram(name: string): string {
|
|
6
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
7
|
+
if (parts.length === 0) return '';
|
|
8
|
+
const first = parts[0][0] ?? '';
|
|
9
|
+
const last = parts.length > 1 ? (parts[parts.length - 1][0] ?? '') : '';
|
|
10
|
+
return (first + last).toUpperCase();
|
|
11
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* How a field's text is drawn when it is not being typed into: the same
|
|
5
|
+
* characters, in spans a stylesheet can set apart. `EditableText` applies it
|
|
6
|
+
* to the value it prints, so reading and editing draw the same thing, and the
|
|
7
|
+
* field stays one field: one path, one value, one caret while it is selected.
|
|
8
|
+
*
|
|
9
|
+
* A shape never adds or drops a character. Extraction, copying and a screen
|
|
10
|
+
* reader see the text exactly as typed.
|
|
11
|
+
*/
|
|
12
|
+
export type TextShape = (text: string) => ReactNode;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A name as given names and surname (`name: { split: true }`): everything
|
|
16
|
+
* before the last word, the space, then the last word, so a design can set the
|
|
17
|
+
* two at different weights. One word is drawn as the surname alone.
|
|
18
|
+
*/
|
|
19
|
+
export function nameParts(first: string, last: string): TextShape {
|
|
20
|
+
return (text) => {
|
|
21
|
+
const m = /^(\s*)(.*\S)(\s+)(\S+)(\s*)$/s.exec(text);
|
|
22
|
+
if (!m) return <span className={last}>{text}</span>;
|
|
23
|
+
const [, before, given, gap, surname, after] = m;
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
{before}
|
|
27
|
+
<span className={first}>{given}</span>
|
|
28
|
+
{gap}
|
|
29
|
+
<span className={last}>{surname}</span>
|
|
30
|
+
{after}
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The first `count` letters of a heading, set apart (`headingAccent: n`). */
|
|
37
|
+
export interface HeadingLead {
|
|
38
|
+
count: number;
|
|
39
|
+
className: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
* Counted in code points, so an accented or astral letter is never cut in
|
|
44
|
+
* half. Whitespace is not counted as a letter of the lead.
|
|
45
|
+
*/
|
|
46
|
+
export function leadLetters({ count, className }: HeadingLead): TextShape {
|
|
47
|
+
return (text) => {
|
|
48
|
+
const chars = Array.from(text);
|
|
49
|
+
let end = 0;
|
|
50
|
+
for (let seen = 0; end < chars.length && seen < count; end++) {
|
|
51
|
+
if (/\S/.test(chars[end] as string)) seen++;
|
|
52
|
+
}
|
|
53
|
+
if (end === 0) return text;
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
<span className={className}>{chars.slice(0, end).join('')}</span>
|
|
57
|
+
{chars.slice(end).join('')}
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Letter } from '@resumekit/schema';
|
|
2
|
+
import { useDocumentText } from '../i18n/index.js';
|
|
3
|
+
import './letter.css';
|
|
4
|
+
|
|
5
|
+
export interface LetterDocumentProps {
|
|
6
|
+
letter: Letter;
|
|
7
|
+
/** The date line, already written — see `letterDate`. */
|
|
8
|
+
date: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A cover letter as the page it is sent as: US Letter, one-inch margins,
|
|
13
|
+
* business block format. The one definition the letter view on screen and the
|
|
14
|
+
* exported file both draw.
|
|
15
|
+
*/
|
|
16
|
+
export function LetterDocument({ letter, date }: LetterDocumentProps) {
|
|
17
|
+
const doc = useDocumentText();
|
|
18
|
+
return (
|
|
19
|
+
<article className="tpl-letter" aria-label={doc.t.letter} lang={doc.locale}>
|
|
20
|
+
<p className="tpl-letter__sender">{letter.signature}</p>
|
|
21
|
+
<p className="tpl-letter__date">{date}</p>
|
|
22
|
+
{letter.recipient && (
|
|
23
|
+
<p className="tpl-letter__recipient">{letter.recipient}</p>
|
|
24
|
+
)}
|
|
25
|
+
<p>{letter.greeting}</p>
|
|
26
|
+
{letter.paragraphs.map((paragraph, i) => (
|
|
27
|
+
<p key={i}>{paragraph}</p>
|
|
28
|
+
))}
|
|
29
|
+
<p className="tpl-letter__closing">{letter.closing}</p>
|
|
30
|
+
<p className="tpl-letter__signature">{letter.signature}</p>
|
|
31
|
+
</article>
|
|
32
|
+
);
|
|
33
|
+
}
|