@resumekit/react 0.0.0-stage → 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/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 +186 -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 +20 -0
- package/dist/kit/documentStyle.d.ts.map +1 -0
- package/dist/kit/documentStyle.js +64 -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/kit/typography.css +86 -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 +38 -0
- package/dist/nodes/formatting.d.ts.map +1 -0
- package/dist/nodes/formatting.js +27 -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 +68 -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 +33930 -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 +80 -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 +70 -0
- package/src/nodes/locked.ts +70 -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 +259 -0
- package/src/templates/academic/entries.tsx +176 -0
- package/src/templates/alta/AltaDocument.tsx +269 -0
- package/src/templates/alta/entries.tsx +167 -0
- package/src/templates/classic/ClassicDocument.tsx +252 -0
- package/src/templates/classic/entries.tsx +175 -0
- package/src/templates/cobalt/CobaltDocument.tsx +306 -0
- package/src/templates/cobalt/crest.tsx +31 -0
- package/src/templates/cobalt/entries.tsx +136 -0
- package/src/templates/compact/CompactDocument.tsx +260 -0
- package/src/templates/compact/entries.tsx +167 -0
- package/src/templates/contemporary/ContemporaryDocument.tsx +291 -0
- package/src/templates/contemporary/entries.tsx +167 -0
- package/src/templates/creative/CreativeDocument.tsx +273 -0
- package/src/templates/creative/entries.tsx +167 -0
- package/src/templates/crimson/CrimsonDocument.tsx +287 -0
- package/src/templates/crimson/entries.tsx +169 -0
- package/src/templates/curve/CurveDocument.tsx +263 -0
- package/src/templates/curve/entries.tsx +168 -0
- package/src/templates/double-column/DoubleColumnDocument.tsx +273 -0
- package/src/templates/double-column/entries.tsx +169 -0
- package/src/templates/double-column-logos/DoubleColumnLogosDocument.tsx +266 -0
- package/src/templates/double-column-logos/entries.tsx +172 -0
- package/src/templates/elegant/ElegantDocument.tsx +301 -0
- package/src/templates/elegant/entries.tsx +167 -0
- package/src/templates/elegant-logos/ElegantLogosDocument.tsx +295 -0
- package/src/templates/elegant-logos/entries.tsx +170 -0
- package/src/templates/engineer/EngineerDocument.tsx +252 -0
- package/src/templates/engineer/entries.tsx +170 -0
- package/src/templates/executive/ExecutiveDocument.tsx +316 -0
- package/src/templates/executive/entries.tsx +146 -0
- package/src/templates/harvard/HarvardDocument.tsx +252 -0
- package/src/templates/harvard/entries.tsx +205 -0
- package/src/templates/hipster/HipsterDocument.tsx +293 -0
- package/src/templates/hipster/entries.tsx +175 -0
- package/src/templates/ivy/IvyDocument.tsx +252 -0
- package/src/templates/ivy/entries.tsx +167 -0
- package/src/templates/meridian/MeridianDocument.tsx +308 -0
- package/src/templates/meridian/entries.tsx +140 -0
- package/src/templates/modern/ModernDocument.tsx +269 -0
- package/src/templates/modern/entries.tsx +167 -0
- package/src/templates/polished/PolishedDocument.tsx +266 -0
- package/src/templates/polished/entries.tsx +167 -0
- package/src/templates/portrait/PortraitDocument.tsx +282 -0
- package/src/templates/portrait/entries.tsx +173 -0
- package/src/templates/prism/PrismDocument.tsx +311 -0
- package/src/templates/prism/entries.tsx +175 -0
- package/src/templates/scholar/ScholarDocument.tsx +270 -0
- package/src/templates/scholar/entries.tsx +169 -0
- package/src/templates/skills.ts +21 -0
- package/src/templates/split/SplitDocument.tsx +297 -0
- package/src/templates/split/entries.tsx +164 -0
- package/src/templates/stylish/StylishDocument.tsx +269 -0
- package/src/templates/stylish/entries.tsx +167 -0
- package/src/templates/timeline/TimelineDocument.tsx +255 -0
- package/src/templates/timeline/entries.tsx +173 -0
- package/src/useFitZoom.ts +185 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_TEMPLATE_ID,
|
|
3
|
+
type ResumePresentation,
|
|
4
|
+
type ResumeObject,
|
|
5
|
+
} from '@resumekit/schema';
|
|
6
|
+
import { TEMPLATE_RENDERERS } from './registry.js';
|
|
7
|
+
import { presentedResume } from './presented.js';
|
|
8
|
+
import { PagedSheet } from './PagedSheet.js';
|
|
9
|
+
import { DocumentPresentationProvider } from './presentation-context.js';
|
|
10
|
+
import { DocumentSpacingProvider } from './spacing/spacing-context.js';
|
|
11
|
+
import { DocumentOverlayProvider } from './collections/overlay-context.js';
|
|
12
|
+
import './document.css';
|
|
13
|
+
|
|
14
|
+
export interface TemplateDocumentProps {
|
|
15
|
+
/** The writer's resume object. */
|
|
16
|
+
resume: ResumeObject;
|
|
17
|
+
/** How the owner chose to present it; absent means the default template. */
|
|
18
|
+
presentation?: ResumePresentation;
|
|
19
|
+
/**
|
|
20
|
+
* The gap between sheets. Defaults to the gap drawn on screen; the export
|
|
21
|
+
* renderer passes `0`, because paper has none.
|
|
22
|
+
*
|
|
23
|
+
* This is the whole of the difference between the document on screen and the
|
|
24
|
+
* document in the file. Everything else — the components, the stylesheets, the
|
|
25
|
+
* geometry, the paginator — is one definition used twice.
|
|
26
|
+
*/
|
|
27
|
+
sheetGap?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Shrink the page to fit a container narrower than the paper, as on a phone.
|
|
30
|
+
* For viewing only: the export must never pass it, since a rendered page is
|
|
31
|
+
* the page.
|
|
32
|
+
*/
|
|
33
|
+
shrinkToFit?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Below this a page is unreadable anyway; it scrolls rather than shrinks.
|
|
38
|
+
* 0.3 is what a 320px phone needs once the card's padding is taken: at 0.35 the
|
|
39
|
+
* page was wider than its card there and lost its right edge.
|
|
40
|
+
*/
|
|
41
|
+
const SHRINK_MIN = 0.3;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A resume rendered read-only in its template.
|
|
45
|
+
*
|
|
46
|
+
* The same component tree the designer edits, mounted with `enabled={false}` so
|
|
47
|
+
* nothing is selectable and no field ever becomes an input. Reusing the tree
|
|
48
|
+
* rather than writing a second renderer is what guarantees the read-only view
|
|
49
|
+
* and the editable one cannot drift apart — there is one Harvard template, not a
|
|
50
|
+
* viewing copy and an editing copy.
|
|
51
|
+
*/
|
|
52
|
+
export function TemplateDocument({
|
|
53
|
+
resume,
|
|
54
|
+
presentation,
|
|
55
|
+
sheetGap,
|
|
56
|
+
shrinkToFit = false,
|
|
57
|
+
}: TemplateDocumentProps) {
|
|
58
|
+
const templateId = presentation?.template_id ?? DEFAULT_TEMPLATE_ID;
|
|
59
|
+
const { Document } = TEMPLATE_RENDERERS[templateId];
|
|
60
|
+
const presented = presentedResume(resume, presentation?.edits ?? []);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div className="tpl-editor tpl-editor--static">
|
|
64
|
+
{/* No field registry, so every field renders as text and neither the
|
|
65
|
+
preview nor the export has to remember to turn anything off. */}
|
|
66
|
+
{/* Same paged canvas and the same presentation path as the designer,
|
|
67
|
+
so a saved resume shows the same pages in the same places as the
|
|
68
|
+
editor that produced it. */}
|
|
69
|
+
<DocumentPresentationProvider
|
|
70
|
+
style={presentation?.style}
|
|
71
|
+
formats={presentation?.formats}
|
|
72
|
+
language={presentation?.language}
|
|
73
|
+
>
|
|
74
|
+
{/*
|
|
75
|
+
* The recorded space, with no way to change it.
|
|
76
|
+
*
|
|
77
|
+
* Mounted without an `onChange`, which is the whole of what makes
|
|
78
|
+
* this read-only: every gap renders the space its owner recorded and
|
|
79
|
+
* draws no handle, so the saved-résumé view and the PDF renderer
|
|
80
|
+
* carry the document and none of the workshop. The same rule the
|
|
81
|
+
* authoring context follows, stated the same way.
|
|
82
|
+
*/}
|
|
83
|
+
{/*
|
|
84
|
+
* What this document was projected from, so its entries are addressed
|
|
85
|
+
* the same way the editor addressed them. Without it a reordered
|
|
86
|
+
* résumé numbered its entries by where they were DRAWN here, and
|
|
87
|
+
* every stored value on one — its space, its bolding, its link — was
|
|
88
|
+
* read at the wrong address.
|
|
89
|
+
*/}
|
|
90
|
+
<DocumentOverlayProvider
|
|
91
|
+
base={resume}
|
|
92
|
+
edits={presentation?.edits ?? []}
|
|
93
|
+
>
|
|
94
|
+
<DocumentSpacingProvider
|
|
95
|
+
value={{ sections: presentation?.section_spacing }}
|
|
96
|
+
>
|
|
97
|
+
<PagedSheet
|
|
98
|
+
sheetGap={sheetGap}
|
|
99
|
+
minZoom={shrinkToFit ? SHRINK_MIN : 1}
|
|
100
|
+
measureKey={JSON.stringify([
|
|
101
|
+
presentation?.style,
|
|
102
|
+
presentation?.section_spacing,
|
|
103
|
+
])}
|
|
104
|
+
>
|
|
105
|
+
<Document resume={presented} />
|
|
106
|
+
</PagedSheet>
|
|
107
|
+
</DocumentSpacingProvider>
|
|
108
|
+
</DocumentOverlayProvider>
|
|
109
|
+
</DocumentPresentationProvider>
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createContext, useContext, type ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* How a document says it has changed enough to be worth storing.
|
|
5
|
+
*
|
|
6
|
+
* The candidate no longer presses anything: there is no save control, so the
|
|
7
|
+
* document is responsible for knowing when it has become worth writing down.
|
|
8
|
+
* That knowledge is genuinely per-component and cannot be recovered from the
|
|
9
|
+
* outside — a surface watching the overlay sees only "something differs", and
|
|
10
|
+
* cannot tell a keystroke mid-word from a role the candidate just deleted. So
|
|
11
|
+
* each component says which of the two it just did, and the host decides what
|
|
12
|
+
* that costs in requests.
|
|
13
|
+
*
|
|
14
|
+
* Two verbs, and the difference between them is the only decision a component
|
|
15
|
+
* makes:
|
|
16
|
+
*
|
|
17
|
+
* - `saveNow` — a discrete act that is finished the moment it happens. Adding a
|
|
18
|
+
* bullet, removing a role, reordering. There is no "rest of it" coming, and
|
|
19
|
+
* waiting would only mean the candidate watching an unsaved document.
|
|
20
|
+
* - `saveSoon` — one keystroke of something still being typed. The host
|
|
21
|
+
* coalesces these, so a sentence is one write rather than forty.
|
|
22
|
+
*
|
|
23
|
+
* Both end in the same call — the one the save button used to make. Nothing
|
|
24
|
+
* here saves anything; this is a way to ASK, and the host owns the answer.
|
|
25
|
+
*/
|
|
26
|
+
export interface AutosaveContextValue {
|
|
27
|
+
/** Store the document as soon as the change has landed. */
|
|
28
|
+
saveNow: () => void;
|
|
29
|
+
/** Store the document once the typing it belongs to has settled. */
|
|
30
|
+
saveSoon: () => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* What a document that is only being read does when it is asked to save:
|
|
35
|
+
* nothing.
|
|
36
|
+
*
|
|
37
|
+
* A default rather than a `null` for the same reason `useFieldFormat` has one —
|
|
38
|
+
* a component must render identically whether or not it can be edited, and a
|
|
39
|
+
* component that had to ask which mode it was in before it could report a
|
|
40
|
+
* change would be two components. The read-only document, the saved-résumé view
|
|
41
|
+
* and the export renderer mount no provider and therefore never write.
|
|
42
|
+
*/
|
|
43
|
+
const NEVER: AutosaveContextValue = {
|
|
44
|
+
saveNow: () => undefined,
|
|
45
|
+
saveSoon: () => undefined,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const AutosaveContext = createContext<AutosaveContextValue>(NEVER);
|
|
49
|
+
|
|
50
|
+
export function DocumentAutosaveProvider({
|
|
51
|
+
value,
|
|
52
|
+
children,
|
|
53
|
+
}: {
|
|
54
|
+
value: AutosaveContextValue;
|
|
55
|
+
children: ReactNode;
|
|
56
|
+
}) {
|
|
57
|
+
return (
|
|
58
|
+
<AutosaveContext.Provider value={value}>
|
|
59
|
+
{children}
|
|
60
|
+
</AutosaveContext.Provider>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** How this component reports that it changed the document. */
|
|
65
|
+
export function useAutosave(): AutosaveContextValue {
|
|
66
|
+
return useContext(AutosaveContext);
|
|
67
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { isValidElement } from 'react';
|
|
2
|
+
import { COLLECTIONS } from '@resumekit/schema';
|
|
3
|
+
import { EntryOverlay } from './EntryOverlay.js';
|
|
4
|
+
import { SortableItems, useDragHandle } from './SortableItems.js';
|
|
5
|
+
import { useEntrySelection } from './selection-context.js';
|
|
6
|
+
import { useSpaceSlot } from '../spacing/useSpaceSlot.js';
|
|
7
|
+
import { ContainerRail } from '../rail/ContainerRail.js';
|
|
8
|
+
import { EntryActions } from '../rail/EntryActions.js';
|
|
9
|
+
import { RAIL_KEY } from '../rail/rail-store.js';
|
|
10
|
+
import { useItemName } from './entry-text.js';
|
|
11
|
+
import { useEditorText } from '../i18n/index.js';
|
|
12
|
+
import type {
|
|
13
|
+
CollectionItemsProps,
|
|
14
|
+
ItemProps,
|
|
15
|
+
ItemRootProps,
|
|
16
|
+
} from './CollectionItems.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Everything an authorable document needs, and nothing a readable one does.
|
|
20
|
+
*
|
|
21
|
+
* Split into its own module so that the drag-and-drop library is reached only
|
|
22
|
+
* through a dynamic import. `template-rendering` requires that the read-only
|
|
23
|
+
* document and the export renderer load no editing code, and an import at the
|
|
24
|
+
* top of a shared file would have made that untrue however carefully the
|
|
25
|
+
* component was guarded — the requirement is about the bundle, not the render.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An item on a document that is being AUTHORED.
|
|
30
|
+
*
|
|
31
|
+
* A component rather than a loop body, because the drag handle is a hook and a
|
|
32
|
+
* hook cannot be called per iteration of a map.
|
|
33
|
+
*/
|
|
34
|
+
function AuthoredItem<T>({
|
|
35
|
+
collection,
|
|
36
|
+
index,
|
|
37
|
+
path,
|
|
38
|
+
id,
|
|
39
|
+
noun,
|
|
40
|
+
label,
|
|
41
|
+
gap,
|
|
42
|
+
sortable,
|
|
43
|
+
children,
|
|
44
|
+
}: ItemProps<T> & { id: string; sortable: boolean }) {
|
|
45
|
+
const { handleProps, setNodeRef, style } = useDragHandle(id, !sortable);
|
|
46
|
+
const { active, select } = useEntrySelection();
|
|
47
|
+
const selected = active === id;
|
|
48
|
+
/*
|
|
49
|
+
* The gap above this entry — how one role is separated from the one before
|
|
50
|
+
* it. Addressed by the entry's own PATH, so the space follows the job through
|
|
51
|
+
* a reorder rather than staying at the position it was set in.
|
|
52
|
+
*/
|
|
53
|
+
const itemName = useItemName(noun, index);
|
|
54
|
+
const space = useSpaceSlot({ path }, itemName);
|
|
55
|
+
const { t, format, noun: forms } = useEditorText();
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* A CONTAINER — a role, a school, a skills group, a custom section — carries
|
|
59
|
+
* one rail beside the sheet with the space above it and its own actions. A
|
|
60
|
+
* bullet or an inline item sits inside a line of the document, where a rail in
|
|
61
|
+
* the margin could not point at it, so it keeps its compact toolbar.
|
|
62
|
+
*/
|
|
63
|
+
const shape = COLLECTIONS[collection.id].shape;
|
|
64
|
+
const container = shape === 'entry' || shape === 'section';
|
|
65
|
+
const railKey = `e:${id}`;
|
|
66
|
+
const itemLabel = format(t.entry.name, {
|
|
67
|
+
...forms(noun),
|
|
68
|
+
section: label,
|
|
69
|
+
position: index + 1,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const element = children({
|
|
73
|
+
item: collection.items[index] as T,
|
|
74
|
+
path,
|
|
75
|
+
index,
|
|
76
|
+
/*
|
|
77
|
+
* Chrome, absolutely positioned, no layout. A container's rail exists only
|
|
78
|
+
* while it is pointed at, focused or selected; a line item's toolbar only
|
|
79
|
+
* while it is selected — or the page would be a wall of controls.
|
|
80
|
+
*/
|
|
81
|
+
chrome: container ? (
|
|
82
|
+
<ContainerRail
|
|
83
|
+
railKey={railKey}
|
|
84
|
+
toolbarLabel={format(t.entry.toolbar, { name: itemLabel })}
|
|
85
|
+
selected={selected}
|
|
86
|
+
space={gap ? { target: { path }, label: itemName } : null}
|
|
87
|
+
>
|
|
88
|
+
<EntryActions
|
|
89
|
+
collection={collection}
|
|
90
|
+
index={index}
|
|
91
|
+
noun={noun}
|
|
92
|
+
path={path}
|
|
93
|
+
handleProps={sortable ? handleProps : undefined}
|
|
94
|
+
/>
|
|
95
|
+
</ContainerRail>
|
|
96
|
+
) : selected ? (
|
|
97
|
+
<EntryOverlay
|
|
98
|
+
collection={collection}
|
|
99
|
+
index={index}
|
|
100
|
+
noun={noun}
|
|
101
|
+
label={label}
|
|
102
|
+
handleProps={sortable ? handleProps : undefined}
|
|
103
|
+
/>
|
|
104
|
+
) : null,
|
|
105
|
+
/* Whether this is the entry the candidate just asked for — see
|
|
106
|
+
`SectionCollectionHandle.justAdded`. */
|
|
107
|
+
justAdded: collection.justAdded?.(index) ?? false,
|
|
108
|
+
itemProps: {
|
|
109
|
+
/*
|
|
110
|
+
* The marker every editing affordance hangs off: the outline that shows
|
|
111
|
+
* the entry can be acted on, the positioning context its controls need,
|
|
112
|
+
* and the name the guide label reads. Written for every authored item —
|
|
113
|
+
* not only a draggable one — so an entry in a collection of one is still
|
|
114
|
+
* visibly an entry.
|
|
115
|
+
*
|
|
116
|
+
* Its VALUE is the collection's own shape, because how much room the ring
|
|
117
|
+
* may take beside an item is a property of what the item is. A block
|
|
118
|
+
* entry has a page margin to spend and nothing to collide with, which is
|
|
119
|
+
* what the 24px default is for; an item that sits INSIDE a line of the
|
|
120
|
+
* document has the rest of that line on both sides of it, and the same
|
|
121
|
+
* ring reached across the separator and over the phone number next to it.
|
|
122
|
+
* Every rule that already existed matches on the attribute's presence, so
|
|
123
|
+
* naming it costs nothing and `collection.css` gains one rule.
|
|
124
|
+
*/
|
|
125
|
+
'data-entry': COLLECTIONS[collection.id].shape,
|
|
126
|
+
'data-entry-label': itemName,
|
|
127
|
+
...(container ? { [RAIL_KEY]: railKey } : {}),
|
|
128
|
+
...(selected ? { 'data-selected': '' } : {}),
|
|
129
|
+
/*
|
|
130
|
+
* Selecting on click and NOT stopping the event. A click on a job title
|
|
131
|
+
* both selects the field to type in and selects the entry it belongs to,
|
|
132
|
+
* which is what a candidate means by it — the formatting rail acts on the
|
|
133
|
+
* field, this overlay acts on the entry, and neither has to win.
|
|
134
|
+
*/
|
|
135
|
+
onClick: () => select(id),
|
|
136
|
+
...(gap ? space.rootProps : {}),
|
|
137
|
+
/*
|
|
138
|
+
* Merged rather than spread over: the sortable transform and the recorded
|
|
139
|
+
* step count are both styles on this one element, and whichever was
|
|
140
|
+
* written second would otherwise delete the other.
|
|
141
|
+
*/
|
|
142
|
+
...(sortable
|
|
143
|
+
? {
|
|
144
|
+
ref: setNodeRef,
|
|
145
|
+
style: { ...(gap ? space.rootProps.style : {}), ...style },
|
|
146
|
+
}
|
|
147
|
+
: {}),
|
|
148
|
+
} as ItemRootProps,
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
return isValidElement(element) ? element : null;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** The items of a collection, drawn with their controls. */
|
|
155
|
+
export default function AuthoredItems<T>({
|
|
156
|
+
collection,
|
|
157
|
+
basePath,
|
|
158
|
+
noun,
|
|
159
|
+
label,
|
|
160
|
+
gap,
|
|
161
|
+
ids,
|
|
162
|
+
sortable,
|
|
163
|
+
children,
|
|
164
|
+
}: Pick<
|
|
165
|
+
CollectionItemsProps<T>,
|
|
166
|
+
'collection' | 'basePath' | 'noun' | 'label'
|
|
167
|
+
> & {
|
|
168
|
+
gap: boolean;
|
|
169
|
+
ids: readonly string[];
|
|
170
|
+
sortable: boolean;
|
|
171
|
+
children: CollectionItemsProps<T>['children'];
|
|
172
|
+
}) {
|
|
173
|
+
const rendered = collection.items.map((_, index) => (
|
|
174
|
+
<AuthoredItem
|
|
175
|
+
key={ids[index]}
|
|
176
|
+
id={ids[index] as string}
|
|
177
|
+
collection={collection}
|
|
178
|
+
index={index}
|
|
179
|
+
noun={noun}
|
|
180
|
+
label={label}
|
|
181
|
+
gap={gap}
|
|
182
|
+
sortable={sortable}
|
|
183
|
+
path={
|
|
184
|
+
collection.pathOf?.(index) ??
|
|
185
|
+
`${basePath ?? ''}.${index}`.replace(/^\./, '')
|
|
186
|
+
}
|
|
187
|
+
>
|
|
188
|
+
{children}
|
|
189
|
+
</AuthoredItem>
|
|
190
|
+
));
|
|
191
|
+
|
|
192
|
+
return sortable ? (
|
|
193
|
+
<SortableItems ids={ids} onMove={collection.move}>
|
|
194
|
+
{rendered}
|
|
195
|
+
</SortableItems>
|
|
196
|
+
) : (
|
|
197
|
+
<>{rendered}</>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { COLLECTIONS, type AppendableSection } from '@resumekit/schema';
|
|
2
|
+
import { useSectionCollection } from './useSectionCollection.js';
|
|
3
|
+
import { CollectionItems, type EntryRenderProps } from './CollectionItems.js';
|
|
4
|
+
import { useEditorText } from '../i18n/index.js';
|
|
5
|
+
import type { ReactElement } from 'react';
|
|
6
|
+
|
|
7
|
+
export type { EntryRenderProps };
|
|
8
|
+
|
|
9
|
+
export interface CollectionProps<T> {
|
|
10
|
+
section: AppendableSection;
|
|
11
|
+
items: readonly T[];
|
|
12
|
+
children: (props: EntryRenderProps<T>) => ReactElement | null;
|
|
13
|
+
/**
|
|
14
|
+
* What to call one of these. Defaults to the domain's own word for it, so a
|
|
15
|
+
* template never names a thing differently from the rest of the product.
|
|
16
|
+
*/
|
|
17
|
+
noun?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether these items may carry structural space above them. The template
|
|
20
|
+
* decides — see `CollectionItems`. Defaults to on.
|
|
21
|
+
*/
|
|
22
|
+
gap?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* How the empty-state add control sits in the document.
|
|
25
|
+
*
|
|
26
|
+
* `block` — the default — is a control on a line of its own, which is right
|
|
27
|
+
* for a SECTION a template omits when it has no data: there is no line below
|
|
28
|
+
* it to push.
|
|
29
|
+
*
|
|
30
|
+
* `inline` is for a collection that renders inside a line of the document,
|
|
31
|
+
* where a block control is a second line the preview does not have. It draws
|
|
32
|
+
* an empty field with a placeholder instead, sized like the items beside it,
|
|
33
|
+
* so the line keeps its shape.
|
|
34
|
+
*/
|
|
35
|
+
emptyAdd?: 'block' | 'inline';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A repeatable section of the résumé: its items, and everything that may be
|
|
40
|
+
* done to them.
|
|
41
|
+
*
|
|
42
|
+
* The behaviour lives in `useSectionCollection` and the markup in
|
|
43
|
+
* `CollectionItems`; this is the seam between them. A template passes what an
|
|
44
|
+
* item looks like and receives no way to change the list — which is what stops
|
|
45
|
+
* "just this one button, just here" from becoming four divergent
|
|
46
|
+
* implementations of add.
|
|
47
|
+
*
|
|
48
|
+
* With no authoring context — the read-only document, the saved-résumé view,
|
|
49
|
+
* the export renderer — this renders the items and nothing else, so a printed
|
|
50
|
+
* page cannot carry a control and no consumer has to remember to turn one off.
|
|
51
|
+
*/
|
|
52
|
+
export function Collection<T>({
|
|
53
|
+
section,
|
|
54
|
+
items,
|
|
55
|
+
children,
|
|
56
|
+
noun,
|
|
57
|
+
gap,
|
|
58
|
+
emptyAdd,
|
|
59
|
+
}: CollectionProps<T>) {
|
|
60
|
+
const collection = useSectionCollection<T>(section, items);
|
|
61
|
+
const { sectionName } = useEditorText();
|
|
62
|
+
return (
|
|
63
|
+
<CollectionItems
|
|
64
|
+
collection={collection}
|
|
65
|
+
noun={noun ?? COLLECTIONS[section].noun}
|
|
66
|
+
label={sectionName(section)}
|
|
67
|
+
gap={gap}
|
|
68
|
+
emptyAdd={emptyAdd}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</CollectionItems>
|
|
72
|
+
);
|
|
73
|
+
}
|