@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,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
useContext,
|
|
4
|
+
useEffect,
|
|
5
|
+
useState,
|
|
6
|
+
useSyncExternalStore,
|
|
7
|
+
type ReactNode,
|
|
8
|
+
} from 'react';
|
|
9
|
+
|
|
10
|
+
/** The attribute a container carries to host a rail. Its value is the key. */
|
|
11
|
+
export const RAIL_KEY = 'data-rail-key';
|
|
12
|
+
|
|
13
|
+
type Slot = 'hovered' | 'focused' | 'pinned';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Which container is pointed at, which holds focus, and which is pinned by a
|
|
17
|
+
* drag under way — the only state the rails need, held once for the document.
|
|
18
|
+
*
|
|
19
|
+
* A store rather than state in a provider: a container subscribes to whether
|
|
20
|
+
* IT is active, so moving the pointer re-renders the container losing the
|
|
21
|
+
* rail and the one gaining it, and nothing else in the document.
|
|
22
|
+
*/
|
|
23
|
+
export class RailStore {
|
|
24
|
+
private keys: Record<Slot, string | null> = {
|
|
25
|
+
hovered: null,
|
|
26
|
+
focused: null,
|
|
27
|
+
pinned: null,
|
|
28
|
+
};
|
|
29
|
+
private readonly listeners = new Set<() => void>();
|
|
30
|
+
|
|
31
|
+
subscribe = (listener: () => void) => {
|
|
32
|
+
this.listeners.add(listener);
|
|
33
|
+
return () => {
|
|
34
|
+
this.listeners.delete(listener);
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
set(slot: Slot, key: string | null) {
|
|
39
|
+
if (this.keys[slot] === key) return;
|
|
40
|
+
this.keys[slot] = key;
|
|
41
|
+
for (const listener of this.listeners) listener();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** 0 none · 1 hovered · 2 strong (focused or pinned). */
|
|
45
|
+
levelOf(key: string): number {
|
|
46
|
+
const { hovered, focused, pinned } = this.keys;
|
|
47
|
+
if (focused === key || pinned === key) return 2;
|
|
48
|
+
if (pinned !== null) return 0;
|
|
49
|
+
return hovered === key ? 1 : 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
pin(key: string) {
|
|
53
|
+
this.set('pinned', key);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
unpin(key: string) {
|
|
57
|
+
if (this.keys.pinned === key) this.set('pinned', null);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* An inert store: a document being read has no rails, and nothing subscribes. */
|
|
62
|
+
const RailContext = createContext<RailStore | null>(null);
|
|
63
|
+
|
|
64
|
+
const hostOf = (target: EventTarget | null): string | null => {
|
|
65
|
+
const element = target instanceof Element ? target : null;
|
|
66
|
+
return element?.closest(`[${RAIL_KEY}]`)?.getAttribute(RAIL_KEY) ?? null;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Installs the document's rail state, once. A provider below one that already
|
|
71
|
+
* exists adds nothing, so the spacing and authoring layers can both ask for it.
|
|
72
|
+
*/
|
|
73
|
+
export function RailProvider({ children }: { children: ReactNode }) {
|
|
74
|
+
const outer = useContext(RailContext);
|
|
75
|
+
const [store] = useState(() => outer ?? new RailStore());
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (outer) return;
|
|
79
|
+
/* Delegated: one listener for every container in the document. */
|
|
80
|
+
const onOver = (e: PointerEvent) => store.set('hovered', hostOf(e.target));
|
|
81
|
+
const onLeave = () => store.set('hovered', null);
|
|
82
|
+
const onFocusIn = (e: FocusEvent) => store.set('focused', hostOf(e.target));
|
|
83
|
+
const onFocusOut = (e: FocusEvent) => {
|
|
84
|
+
if (hostOf(e.relatedTarget) === null) store.set('focused', null);
|
|
85
|
+
};
|
|
86
|
+
document.addEventListener('pointerover', onOver);
|
|
87
|
+
document.documentElement.addEventListener('pointerleave', onLeave);
|
|
88
|
+
document.addEventListener('focusin', onFocusIn);
|
|
89
|
+
document.addEventListener('focusout', onFocusOut);
|
|
90
|
+
return () => {
|
|
91
|
+
document.removeEventListener('pointerover', onOver);
|
|
92
|
+
document.documentElement.removeEventListener('pointerleave', onLeave);
|
|
93
|
+
document.removeEventListener('focusin', onFocusIn);
|
|
94
|
+
document.removeEventListener('focusout', onFocusOut);
|
|
95
|
+
};
|
|
96
|
+
}, [outer, store]);
|
|
97
|
+
|
|
98
|
+
if (outer) return <>{children}</>;
|
|
99
|
+
return <RailContext.Provider value={store}>{children}</RailContext.Provider>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const NONE = () => 0;
|
|
103
|
+
const noSubscribe = () => () => undefined;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* How present this container's rail is: 0 absent, 1 faint (pointed at), 2
|
|
107
|
+
* solid (focused, or a drag it started is under way). Always 0 outside a
|
|
108
|
+
* provider, which is every document that is only being read.
|
|
109
|
+
*/
|
|
110
|
+
export function useRailLevel(key: string): number {
|
|
111
|
+
const store = useContext(RailContext);
|
|
112
|
+
return useSyncExternalStore(
|
|
113
|
+
store?.subscribe ?? noSubscribe,
|
|
114
|
+
store ? () => store.levelOf(key) : NONE,
|
|
115
|
+
NONE,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Pin and release this container's rail around a drag. */
|
|
120
|
+
export function useRailPin(key: string) {
|
|
121
|
+
const store = useContext(RailContext);
|
|
122
|
+
return {
|
|
123
|
+
pin: () => store?.pin(key),
|
|
124
|
+
unpin: () => store?.unpin(key),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { useRef, useState, type PointerEvent, type KeyboardEvent } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
SECTION_SPACES,
|
|
4
|
+
SPACE_MAX_STEPS,
|
|
5
|
+
SPACE_QUANTUM,
|
|
6
|
+
spaceAtStep,
|
|
7
|
+
} from '@resumekit/schema';
|
|
8
|
+
import { useAutosave } from '../autosave-context.js';
|
|
9
|
+
import { useSpace, type SpaceTarget } from '../spacing/spacing-context.js';
|
|
10
|
+
import { useRailPin } from './rail-store.js';
|
|
11
|
+
import { useEditorText } from '../i18n/index.js';
|
|
12
|
+
|
|
13
|
+
/** One step on screen when nothing can be measured — a test renderer only. */
|
|
14
|
+
const FALLBACK_UNIT = 8;
|
|
15
|
+
/** How many units the probe is tall, so a sub-pixel unit measures precisely. */
|
|
16
|
+
const PROBE_UNITS = 10;
|
|
17
|
+
/** How far the pointer must travel, in steps, before the value moves at all. */
|
|
18
|
+
const DEAD_ZONE = SPACE_QUANTUM;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* One step of this template's rhythm, in SCREEN pixels — measured by a probe
|
|
22
|
+
* laid out inside the zoomed sheet, so the zoom needs no separate correction.
|
|
23
|
+
* A custom property cannot simply be read: it comes back as the literal
|
|
24
|
+
* `calc(...)` text. Once per press, not per frame: it forces a layout.
|
|
25
|
+
*/
|
|
26
|
+
function unitOf(element: HTMLElement | null): number {
|
|
27
|
+
if (!element?.ownerDocument) return FALLBACK_UNIT;
|
|
28
|
+
const probe = element.ownerDocument.createElement('span');
|
|
29
|
+
probe.style.cssText = `position:absolute;visibility:hidden;pointer-events:none;width:0;height:calc(var(--tpl-space-unit, 8px) * ${PROBE_UNITS})`;
|
|
30
|
+
element.append(probe);
|
|
31
|
+
const measured = probe.getBoundingClientRect().height / PROBE_UNITS;
|
|
32
|
+
probe.remove();
|
|
33
|
+
return measured > 0 ? measured : FALLBACK_UNIT;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The gap above a container, as a drag and as a keyboard slider.
|
|
38
|
+
*
|
|
39
|
+
* Every position it can reach is a step of the catalog's scale, which is what
|
|
40
|
+
* keeps the ATS guarantee enumerable. A drag lasts exactly as long as the
|
|
41
|
+
* press — it ends wherever the pointer is released, in or out of the window —
|
|
42
|
+
* and it pins the container's rail, so leaving the container mid-drag does
|
|
43
|
+
* not take the control away from under the pointer.
|
|
44
|
+
*/
|
|
45
|
+
export function useSpaceDrag(
|
|
46
|
+
target: SpaceTarget,
|
|
47
|
+
label: string,
|
|
48
|
+
railKey: string,
|
|
49
|
+
) {
|
|
50
|
+
const { steps, adjustable, setSteps } = useSpace(target);
|
|
51
|
+
const { t, format, locale } = useEditorText();
|
|
52
|
+
const { saveNow } = useAutosave();
|
|
53
|
+
const { pin, unpin } = useRailPin(railKey);
|
|
54
|
+
const [dragging, setDragging] = useState<number | null>(null);
|
|
55
|
+
const shown = dragging ?? steps;
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* What has been ASKED for, as against what has come back. A repeated key
|
|
59
|
+
* arrives before the previous value has made the round trip through the
|
|
60
|
+
* screen's state, so the handler must add to the pending figure, not to
|
|
61
|
+
* `steps`. A render carrying a value not seen from upstream adopts it.
|
|
62
|
+
*/
|
|
63
|
+
const latest = useRef(steps);
|
|
64
|
+
const seen = useRef(steps);
|
|
65
|
+
if (steps !== seen.current) {
|
|
66
|
+
seen.current = steps;
|
|
67
|
+
latest.current = steps;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const commit = (next: number) => {
|
|
71
|
+
const wanted = Math.round(next / SPACE_QUANTUM) * SPACE_QUANTUM;
|
|
72
|
+
const clamped = Number(
|
|
73
|
+
Math.max(0, Math.min(SPACE_MAX_STEPS, wanted)).toFixed(1),
|
|
74
|
+
);
|
|
75
|
+
latest.current = clamped;
|
|
76
|
+
if (clamped !== steps) setSteps(clamped);
|
|
77
|
+
return clamped;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const onPointerDown = (event: PointerEvent<HTMLElement>) => {
|
|
81
|
+
if (event.button !== 0) return;
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
event.stopPropagation();
|
|
84
|
+
|
|
85
|
+
const startY = event.clientY;
|
|
86
|
+
const startSteps = latest.current;
|
|
87
|
+
const perStep = unitOf(event.currentTarget);
|
|
88
|
+
const element = event.currentTarget;
|
|
89
|
+
const view = element.ownerDocument.defaultView ?? window;
|
|
90
|
+
|
|
91
|
+
element.setPointerCapture?.(event.pointerId);
|
|
92
|
+
setDragging(startSteps);
|
|
93
|
+
pin();
|
|
94
|
+
/* A drag passes over text; it must not select it on the way. */
|
|
95
|
+
const root = element.ownerDocument.documentElement;
|
|
96
|
+
const selecting = root.style.userSelect;
|
|
97
|
+
root.style.userSelect = 'none';
|
|
98
|
+
|
|
99
|
+
/* On the WINDOW, torn down as one, so a release anywhere ends the drag. */
|
|
100
|
+
const drag = new AbortController();
|
|
101
|
+
const { signal } = drag;
|
|
102
|
+
|
|
103
|
+
const move = (e: globalThis.PointerEvent) => {
|
|
104
|
+
if (e.pointerId !== event.pointerId) return;
|
|
105
|
+
// A move with no button held is a release nobody reported.
|
|
106
|
+
if (e.buttons === 0) {
|
|
107
|
+
end();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const travelled = (e.clientY - startY) / perStep;
|
|
111
|
+
if (Math.abs(travelled) < DEAD_ZONE && latest.current === startSteps) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
setDragging(commit(startSteps + travelled));
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const end = () => {
|
|
118
|
+
if (signal.aborted) return;
|
|
119
|
+
drag.abort();
|
|
120
|
+
element.releasePointerCapture?.(event.pointerId);
|
|
121
|
+
setDragging(null);
|
|
122
|
+
unpin();
|
|
123
|
+
root.style.userSelect = selecting;
|
|
124
|
+
saveNow();
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
view.addEventListener('pointermove', move, { signal });
|
|
128
|
+
view.addEventListener('pointerup', end, { signal });
|
|
129
|
+
view.addEventListener('pointercancel', end, { signal });
|
|
130
|
+
view.addEventListener('blur', end, { signal });
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/* The same, from the keyboard: a quantum per arrow, a unit per page. */
|
|
134
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
135
|
+
const by = {
|
|
136
|
+
ArrowUp: -SPACE_QUANTUM,
|
|
137
|
+
ArrowDown: SPACE_QUANTUM,
|
|
138
|
+
PageUp: -1,
|
|
139
|
+
PageDown: 1,
|
|
140
|
+
}[event.key];
|
|
141
|
+
const to =
|
|
142
|
+
event.key === 'Home'
|
|
143
|
+
? 0
|
|
144
|
+
: event.key === 'End'
|
|
145
|
+
? SPACE_MAX_STEPS
|
|
146
|
+
: undefined;
|
|
147
|
+
if (by === undefined && to === undefined) return;
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
commit(to ?? latest.current + (by as number));
|
|
150
|
+
saveNow();
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
adjustable,
|
|
155
|
+
shown,
|
|
156
|
+
dragging: dragging !== null,
|
|
157
|
+
sliderProps: {
|
|
158
|
+
role: 'slider',
|
|
159
|
+
tabIndex: 0,
|
|
160
|
+
'aria-label': format(t.space.handle, { name: label }),
|
|
161
|
+
'aria-orientation': 'vertical' as const,
|
|
162
|
+
'aria-valuemin': 0,
|
|
163
|
+
'aria-valuemax': SPACE_MAX_STEPS,
|
|
164
|
+
'aria-valuenow': shown,
|
|
165
|
+
// The scale is fifths, so the announced value has to be too.
|
|
166
|
+
'aria-valuetext':
|
|
167
|
+
spaceAtStep(shown) === 'none'
|
|
168
|
+
? t.space.none
|
|
169
|
+
: (SECTION_SPACES[spaceAtStep(shown)]?.steps ?? 0).toLocaleString(
|
|
170
|
+
locale,
|
|
171
|
+
),
|
|
172
|
+
title: format(t.space.handleTitle, { name: label }),
|
|
173
|
+
onPointerDown,
|
|
174
|
+
onKeyDown,
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
}
|
package/src/registry.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { ResumeObject, TemplateId } from '@resumekit/schema';
|
|
3
|
+
import { EditableText } from './nodes/EditableText.js';
|
|
4
|
+
import { EditableBulletList } from './nodes/EditableBulletList.js';
|
|
5
|
+
import { EditableInlineList } from './nodes/EditableInlineList.js';
|
|
6
|
+
import { HarvardDocument } from './templates/harvard/HarvardDocument.js';
|
|
7
|
+
import { IvyDocument } from './templates/ivy/IvyDocument.js';
|
|
8
|
+
import { ClassicDocument } from './templates/classic/ClassicDocument.js';
|
|
9
|
+
import { CompactDocument } from './templates/compact/CompactDocument.js';
|
|
10
|
+
import { TimelineDocument } from './templates/timeline/TimelineDocument.js';
|
|
11
|
+
import { ModernDocument } from './templates/modern/ModernDocument.js';
|
|
12
|
+
import { StylishDocument } from './templates/stylish/StylishDocument.js';
|
|
13
|
+
import { CreativeDocument } from './templates/creative/CreativeDocument.js';
|
|
14
|
+
import { ContemporaryDocument } from './templates/contemporary/ContemporaryDocument.js';
|
|
15
|
+
import { DoubleColumnDocument } from './templates/double-column/DoubleColumnDocument.js';
|
|
16
|
+
import { DoubleColumnLogosDocument } from './templates/double-column-logos/DoubleColumnLogosDocument.js';
|
|
17
|
+
import { ElegantDocument } from './templates/elegant/ElegantDocument.js';
|
|
18
|
+
import { ElegantLogosDocument } from './templates/elegant-logos/ElegantLogosDocument.js';
|
|
19
|
+
import { PolishedDocument } from './templates/polished/PolishedDocument.js';
|
|
20
|
+
import { ExecutiveDocument } from './templates/executive/ExecutiveDocument.js';
|
|
21
|
+
import { MeridianDocument } from './templates/meridian/MeridianDocument.js';
|
|
22
|
+
import { CobaltDocument } from './templates/cobalt/CobaltDocument.js';
|
|
23
|
+
import { CrimsonDocument } from './templates/crimson/CrimsonDocument.js';
|
|
24
|
+
import { EngineerDocument } from './templates/engineer/EngineerDocument.js';
|
|
25
|
+
import { SplitDocument } from './templates/split/SplitDocument.js';
|
|
26
|
+
import { AcademicDocument } from './templates/academic/AcademicDocument.js';
|
|
27
|
+
import { AltaDocument } from './templates/alta/AltaDocument.js';
|
|
28
|
+
import { PrismDocument } from './templates/prism/PrismDocument.js';
|
|
29
|
+
import { HipsterDocument } from './templates/hipster/HipsterDocument.js';
|
|
30
|
+
import { ScholarDocument } from './templates/scholar/ScholarDocument.js';
|
|
31
|
+
import { PortraitDocument } from './templates/portrait/PortraitDocument.js';
|
|
32
|
+
import { CurveDocument } from './templates/curve/CurveDocument.js';
|
|
33
|
+
import './nodes/template-node.css';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A template's renderer: the document component, plus the Craft.js resolver that
|
|
37
|
+
* can reconstruct its node tree.
|
|
38
|
+
*
|
|
39
|
+
* Adding a template is one entry here and one document file — everything else
|
|
40
|
+
* (the editor, the overlay, the save path, the print rules) is template-agnostic
|
|
41
|
+
* by construction. `registry.spec.ts` asserts this map and `TEMPLATES` in
|
|
42
|
+
* `@resumekit/schema` name exactly the same templates, so a catalog entry with no
|
|
43
|
+
* renderer, or a renderer no catalog knows about, fails the suite.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* What every template's document component accepts: the resume, and nothing
|
|
47
|
+
* else. Presentation arrives by context, because Craft node props are frozen at
|
|
48
|
+
* mount — see `presentation-context.tsx`.
|
|
49
|
+
*/
|
|
50
|
+
export interface TemplateDocumentProps {
|
|
51
|
+
resume: ResumeObject;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface TemplateRenderer {
|
|
55
|
+
Document: ComponentType<TemplateDocumentProps>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const TEMPLATE_RENDERERS: Record<TemplateId, TemplateRenderer> = {
|
|
59
|
+
harvard: { Document: HarvardDocument },
|
|
60
|
+
ivy: { Document: IvyDocument },
|
|
61
|
+
classic: { Document: ClassicDocument },
|
|
62
|
+
compact: { Document: CompactDocument },
|
|
63
|
+
timeline: { Document: TimelineDocument },
|
|
64
|
+
modern: { Document: ModernDocument },
|
|
65
|
+
stylish: { Document: StylishDocument },
|
|
66
|
+
creative: { Document: CreativeDocument },
|
|
67
|
+
contemporary: { Document: ContemporaryDocument },
|
|
68
|
+
'double-column': { Document: DoubleColumnDocument },
|
|
69
|
+
'double-column-logos': { Document: DoubleColumnLogosDocument },
|
|
70
|
+
elegant: { Document: ElegantDocument },
|
|
71
|
+
'elegant-logos': { Document: ElegantLogosDocument },
|
|
72
|
+
polished: { Document: PolishedDocument },
|
|
73
|
+
executive: { Document: ExecutiveDocument },
|
|
74
|
+
meridian: { Document: MeridianDocument },
|
|
75
|
+
cobalt: { Document: CobaltDocument },
|
|
76
|
+
crimson: { Document: CrimsonDocument },
|
|
77
|
+
engineer: { Document: EngineerDocument },
|
|
78
|
+
split: { Document: SplitDocument },
|
|
79
|
+
academic: { Document: AcademicDocument },
|
|
80
|
+
alta: { Document: AltaDocument },
|
|
81
|
+
prism: { Document: PrismDocument },
|
|
82
|
+
hipster: { Document: HipsterDocument },
|
|
83
|
+
scholar: { Document: ScholarDocument },
|
|
84
|
+
portrait: { Document: PortraitDocument },
|
|
85
|
+
curve: { Document: CurveDocument },
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The editable field components, for the test that no field accepts a
|
|
90
|
+
* presentational prop.
|
|
91
|
+
*
|
|
92
|
+
* A list rather than a resolver: there is no library to resolve a name for any
|
|
93
|
+
* more (`retire-craftjs`), but the RULE those nodes are held to survives the
|
|
94
|
+
* mechanism — a field may carry `bold`, `align`, `ink` and `href` from the
|
|
95
|
+
* catalog, and never a style, a class or a dimension.
|
|
96
|
+
*/
|
|
97
|
+
export const REGISTERED_NODES: [string, unknown][] = [
|
|
98
|
+
['EditableText', EditableText],
|
|
99
|
+
['EditableBulletList', EditableBulletList],
|
|
100
|
+
['EditableInlineList', EditableInlineList],
|
|
101
|
+
];
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { createContext, useContext, useMemo, type ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
formatFor,
|
|
4
|
+
spaceAtStep,
|
|
5
|
+
spaceSteps,
|
|
6
|
+
spacingFor,
|
|
7
|
+
type ResumeSectionId,
|
|
8
|
+
type ResumeSectionSpacing,
|
|
9
|
+
type SectionSpaceId,
|
|
10
|
+
} from '@resumekit/schema';
|
|
11
|
+
import { useDocumentFormats } from '../presentation-context.js';
|
|
12
|
+
import { RailProvider } from '../rail/rail-store.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Which gap is being talked about.
|
|
16
|
+
*
|
|
17
|
+
* Two arms because the document stores them in two places, and it stores them
|
|
18
|
+
* in two places because they answer different questions. A SECTION is a fixed
|
|
19
|
+
* part of every résumé — "the space above Experience" is true of a document
|
|
20
|
+
* whose experience the writer has rewritten twice — so it is keyed by name. An
|
|
21
|
+
* ENTRY is one of many and moves when the candidate reorders it, so it is keyed
|
|
22
|
+
* by its own path, on the same per-field record its bolding travels on. Naming
|
|
23
|
+
* an entry by position would leave the space behind when the job moved.
|
|
24
|
+
*/
|
|
25
|
+
export type SpaceTarget =
|
|
26
|
+
{ readonly section: ResumeSectionId } | { readonly path: string };
|
|
27
|
+
|
|
28
|
+
export interface DocumentSpacingValue {
|
|
29
|
+
/** Space above each named section, as stored. */
|
|
30
|
+
sections?: ResumeSectionSpacing;
|
|
31
|
+
/**
|
|
32
|
+
* Record a new space above `target`.
|
|
33
|
+
*
|
|
34
|
+
* Absent means the document is being READ — the saved-résumé view, the export
|
|
35
|
+
* renderer, the printed page — and no handle is drawn at all. Same rule as
|
|
36
|
+
* the authoring context: a surface that only displays a résumé gets a
|
|
37
|
+
* document with no controls in it without asking for one.
|
|
38
|
+
*/
|
|
39
|
+
onChange?: (target: SpaceTarget, space: SectionSpaceId) => void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const SpacingContext = createContext<DocumentSpacingValue>({});
|
|
43
|
+
|
|
44
|
+
export function DocumentSpacingProvider({
|
|
45
|
+
value,
|
|
46
|
+
children,
|
|
47
|
+
}: {
|
|
48
|
+
value: DocumentSpacingValue;
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
}) {
|
|
51
|
+
const { sections, onChange } = value;
|
|
52
|
+
// Keyed on the values themselves: this is read by every gap in the document,
|
|
53
|
+
// and a fresh object per render of the screen above would re-render all of
|
|
54
|
+
// them for a change none of them can see.
|
|
55
|
+
const published = useMemo(
|
|
56
|
+
() => ({ sections, onChange }),
|
|
57
|
+
[sections, onChange],
|
|
58
|
+
);
|
|
59
|
+
return (
|
|
60
|
+
<SpacingContext.Provider value={published}>
|
|
61
|
+
{/* Adjustable gaps are reached through their containers' rails. */}
|
|
62
|
+
{onChange ? <RailProvider>{children}</RailProvider> : children}
|
|
63
|
+
</SpacingContext.Provider>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface SpaceHandleState {
|
|
68
|
+
/** How many steps of the template's own unit sit above this target. */
|
|
69
|
+
steps: number;
|
|
70
|
+
/** Whether this document offers the control at all. */
|
|
71
|
+
adjustable: boolean;
|
|
72
|
+
/** Record a number of steps. Clamped to the catalog on the way in. */
|
|
73
|
+
setSteps: (steps: number) => void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The space above one target, and the means of changing it.
|
|
78
|
+
*
|
|
79
|
+
* Reads the two stores through the one hook so a caller never has to know which
|
|
80
|
+
* of them holds its answer — a section handle and an entry handle are the same
|
|
81
|
+
* control, and the difference between them is a detail of where the value is
|
|
82
|
+
* written down.
|
|
83
|
+
*/
|
|
84
|
+
export function useSpace(target: SpaceTarget): SpaceHandleState {
|
|
85
|
+
const { sections, onChange } = useContext(SpacingContext);
|
|
86
|
+
const formats = useDocumentFormats();
|
|
87
|
+
|
|
88
|
+
const stored =
|
|
89
|
+
'section' in target
|
|
90
|
+
? spacingFor(sections, target.section)?.space
|
|
91
|
+
: formatFor(formats, target.path)?.space;
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
steps: spaceSteps(stored),
|
|
95
|
+
adjustable: onChange !== undefined,
|
|
96
|
+
// `spaceAtStep` is what stops a drag — arithmetic on a pointer — from
|
|
97
|
+
// expressing anything the catalog does not hold.
|
|
98
|
+
setSteps: (steps: number) => onChange?.(target, spaceAtStep(steps)),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useMemo, type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { ContainerRail } from '../rail/ContainerRail.js';
|
|
3
|
+
import { RAIL_KEY } from '../rail/rail-store.js';
|
|
4
|
+
import { useSpace, type SpaceTarget } from './spacing-context.js';
|
|
5
|
+
import './spacing.css';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What an element needs in order to have a gap ABOVE it, and the control for it.
|
|
9
|
+
*
|
|
10
|
+
* Two halves, and neither of them is an element of its own. `rootProps` goes on
|
|
11
|
+
* the résumé's own element — a marker and a step count, no box — and the space
|
|
12
|
+
* itself is drawn by that element's own `margin-top`, which its template already
|
|
13
|
+
* declares and which this only adds to. `handle` is absolutely positioned, so it
|
|
14
|
+
* hangs in the margin above the element and occupies no layout at all.
|
|
15
|
+
*
|
|
16
|
+
* That is the whole point of the shape. A WRAPPER was the obvious way to hold a
|
|
17
|
+
* gap and its control together, and it was wrong twice over: it is a real
|
|
18
|
+
* element, present in the editor and absent from the preview, so the same
|
|
19
|
+
* document measured differently in the two; and it made every entry an only
|
|
20
|
+
* child, which quietly broke `:first-of-type` in Harvard and the `+` rule in
|
|
21
|
+
* Cobalt — the editor drew 4pt above every role where the preview drew 7. A
|
|
22
|
+
* control has no business changing what the document is.
|
|
23
|
+
*
|
|
24
|
+
* MARGIN and not padding: margin sits outside the border box, so the entry's
|
|
25
|
+
* own selection outline is the same box whether or not there is space above it,
|
|
26
|
+
* and the space reads as document between two entries rather than as part of the
|
|
27
|
+
* one below.
|
|
28
|
+
*/
|
|
29
|
+
export interface SpaceSlot {
|
|
30
|
+
/**
|
|
31
|
+
* Spread onto the résumé element the space sits above.
|
|
32
|
+
*
|
|
33
|
+
* Two markers, because they answer two questions and are true at different
|
|
34
|
+
* times. `data-gap` says this element HOSTS a control — it is what gives the
|
|
35
|
+
* rail a positioning context, and it exists only where the document can be
|
|
36
|
+
* edited. `data-spaced` says this element CARRIES space, which is a fact
|
|
37
|
+
* about the document and so is identically true in the editor, the preview
|
|
38
|
+
* and the export. Rolling them into one meant the editor styled every gap as
|
|
39
|
+
* though it were open.
|
|
40
|
+
*/
|
|
41
|
+
rootProps: {
|
|
42
|
+
'data-gap'?: string;
|
|
43
|
+
'data-spaced'?: string;
|
|
44
|
+
'data-rail-key'?: string;
|
|
45
|
+
style?: CSSProperties;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Rendered INSIDE that element, as chrome: a section's rail, which appears
|
|
49
|
+
* only while the section is pointed at or focused. `null` on a read-only
|
|
50
|
+
* document, and for an entry — whose rail its authoring layer draws, with
|
|
51
|
+
* the entry's own actions beside the space control.
|
|
52
|
+
*/
|
|
53
|
+
handle: ReactNode;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function useSpaceSlot(target: SpaceTarget, label: string): SpaceSlot {
|
|
57
|
+
const { steps, adjustable } = useSpace(target);
|
|
58
|
+
/*
|
|
59
|
+
* `target` is written inline at nearly every call site — `{ section: 'skills' }`
|
|
60
|
+
* — so it is a new object on every render. Keying the memo on what it SAYS
|
|
61
|
+
* rather than on which object it is keeps the props stable for a document
|
|
62
|
+
* being typed into.
|
|
63
|
+
*/
|
|
64
|
+
const key = 'section' in target ? `s:${target.section}` : `p:${target.path}`;
|
|
65
|
+
|
|
66
|
+
return useMemo(
|
|
67
|
+
() => ({
|
|
68
|
+
/*
|
|
69
|
+
* A document being READ with no space gets neither marker, no property
|
|
70
|
+
* and no handle — so the export renderer and the saved-résumé view
|
|
71
|
+
* produce exactly the DOM they always did.
|
|
72
|
+
*/
|
|
73
|
+
rootProps: {
|
|
74
|
+
...(adjustable ? { 'data-gap': '' } : {}),
|
|
75
|
+
...(adjustable && 'section' in target
|
|
76
|
+
? { [RAIL_KEY]: `s:${target.section}` }
|
|
77
|
+
: {}),
|
|
78
|
+
...(steps > 0
|
|
79
|
+
? {
|
|
80
|
+
'data-spaced': '',
|
|
81
|
+
style: { '--tpl-space-steps': steps } as CSSProperties,
|
|
82
|
+
}
|
|
83
|
+
: {}),
|
|
84
|
+
},
|
|
85
|
+
handle:
|
|
86
|
+
adjustable && 'section' in target ? (
|
|
87
|
+
<ContainerRail
|
|
88
|
+
railKey={`s:${target.section}`}
|
|
89
|
+
toolbarLabel={`${label} — section actions`}
|
|
90
|
+
space={{ target, label }}
|
|
91
|
+
/>
|
|
92
|
+
) : null,
|
|
93
|
+
}),
|
|
94
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
95
|
+
[steps, adjustable, key, label],
|
|
96
|
+
);
|
|
97
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ResumeObject, TemplateId } from '@resumekit/schema';
|
|
2
|
+
|
|
3
|
+
export interface StaticOptions {
|
|
4
|
+
/** The document's language, e.g. `es`; the template's default otherwise. */
|
|
5
|
+
language?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Draw the page as a picture of itself, for embedding in another page: links
|
|
8
|
+
* are text, headings stay out of the host's outline, no editor attributes.
|
|
9
|
+
*/
|
|
10
|
+
picture?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type RenderStatic = (
|
|
14
|
+
template: TemplateId,
|
|
15
|
+
resume: ResumeObject,
|
|
16
|
+
options?: StaticOptions,
|
|
17
|
+
) => string;
|
|
18
|
+
|
|
19
|
+
export declare const renderStatic: RenderStatic;
|