@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,325 @@
|
|
|
1
|
+
import { useEffect, useId, useRef, useState } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import './library.css';
|
|
4
|
+
import { useEditorText } from '../../i18n/index.js';
|
|
5
|
+
|
|
6
|
+
/** One thing that can be chosen, with the sub-items that come with it. */
|
|
7
|
+
export interface PickerOption {
|
|
8
|
+
title: string;
|
|
9
|
+
detail?: string;
|
|
10
|
+
/** Chosen with the option and all on by default — a role's bullets. */
|
|
11
|
+
parts?: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** A titled list of options. A picker with one group draws no heading. */
|
|
15
|
+
export interface PickerGroup {
|
|
16
|
+
id: string;
|
|
17
|
+
heading?: string;
|
|
18
|
+
/** One line under the heading saying what choosing here does. */
|
|
19
|
+
hint?: string;
|
|
20
|
+
options: readonly PickerOption[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface PickedOption {
|
|
24
|
+
index: number;
|
|
25
|
+
/** Indices of the option's parts that stayed chosen. */
|
|
26
|
+
parts: number[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** What was chosen, per group id, in the order the options are listed. */
|
|
30
|
+
export type PickerSelection = Record<string, PickedOption[]>;
|
|
31
|
+
|
|
32
|
+
export interface LibraryPickerProps {
|
|
33
|
+
title: string;
|
|
34
|
+
/** Where this was opened from, and what happens next. */
|
|
35
|
+
subtitle?: string;
|
|
36
|
+
groups: readonly PickerGroup[];
|
|
37
|
+
/** Said when there is nothing to choose. */
|
|
38
|
+
empty: string;
|
|
39
|
+
/** The add button's words for the current selection, e.g. "Add 3 bullets". */
|
|
40
|
+
addLabel: (selection: PickerSelection) => string;
|
|
41
|
+
onAdd: (selection: PickerSelection) => void;
|
|
42
|
+
onClose: () => void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const keyOf = (group: string, index: number) => `${group}:${index}`;
|
|
46
|
+
|
|
47
|
+
/** The drawn box for a visually hidden checkbox; the input stays the control. */
|
|
48
|
+
function Check({ small = false }: { small?: boolean }) {
|
|
49
|
+
return (
|
|
50
|
+
<span
|
|
51
|
+
className="tpl-library__check"
|
|
52
|
+
data-small={small ? '' : undefined}
|
|
53
|
+
aria-hidden="true"
|
|
54
|
+
>
|
|
55
|
+
<svg viewBox="0 0 16 16">
|
|
56
|
+
<path d="M3.5 8.5 6.5 11.5 12.5 5" />
|
|
57
|
+
</svg>
|
|
58
|
+
</span>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A dialog of grouped checklists. Presentational: it knows options, parts and
|
|
64
|
+
* a selection — nothing about resumes — so each caller decides what an option
|
|
65
|
+
* is and what adding means. Portalled out of the page, so it is chrome and is
|
|
66
|
+
* never printed.
|
|
67
|
+
*/
|
|
68
|
+
export function LibraryPicker({
|
|
69
|
+
title,
|
|
70
|
+
subtitle,
|
|
71
|
+
groups,
|
|
72
|
+
empty,
|
|
73
|
+
addLabel,
|
|
74
|
+
onAdd,
|
|
75
|
+
onClose,
|
|
76
|
+
}: LibraryPickerProps) {
|
|
77
|
+
const [chosen, setChosen] = useState<
|
|
78
|
+
ReadonlyMap<string, ReadonlySet<number>>
|
|
79
|
+
>(new Map());
|
|
80
|
+
const panel = useRef<HTMLDivElement>(null);
|
|
81
|
+
const titleId = useId();
|
|
82
|
+
const { t, format, plural } = useEditorText();
|
|
83
|
+
|
|
84
|
+
/* Focus the dialog, not its first option: a ring on an item nobody chose
|
|
85
|
+
reads as a selection. Tab reaches the options from here. */
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const previous = document.activeElement as HTMLElement | null;
|
|
88
|
+
panel.current?.focus({ preventScroll: true });
|
|
89
|
+
return () => previous?.focus?.();
|
|
90
|
+
}, []);
|
|
91
|
+
|
|
92
|
+
const allParts = (option: PickerOption | undefined) =>
|
|
93
|
+
new Set(option?.parts?.map((_, p) => p) ?? []);
|
|
94
|
+
|
|
95
|
+
const toggle = (group: PickerGroup, index: number) =>
|
|
96
|
+
setChosen((current) => {
|
|
97
|
+
const next = new Map(current);
|
|
98
|
+
const key = keyOf(group.id, index);
|
|
99
|
+
if (next.has(key)) next.delete(key);
|
|
100
|
+
else next.set(key, allParts(group.options[index]));
|
|
101
|
+
return next;
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const togglePart = (group: PickerGroup, index: number, part: number) =>
|
|
105
|
+
setChosen((current) => {
|
|
106
|
+
const next = new Map(current);
|
|
107
|
+
const key = keyOf(group.id, index);
|
|
108
|
+
const parts = new Set(next.get(key) ?? []);
|
|
109
|
+
if (parts.has(part)) parts.delete(part);
|
|
110
|
+
else parts.add(part);
|
|
111
|
+
next.set(key, parts);
|
|
112
|
+
return next;
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const allChosen = (group: PickerGroup) =>
|
|
116
|
+
group.options.every((_, i) => chosen.has(keyOf(group.id, i)));
|
|
117
|
+
|
|
118
|
+
const toggleAll = (group: PickerGroup) =>
|
|
119
|
+
setChosen((current) => {
|
|
120
|
+
const next = new Map(current);
|
|
121
|
+
const clear = allChosen(group);
|
|
122
|
+
group.options.forEach((option, i) => {
|
|
123
|
+
const key = keyOf(group.id, i);
|
|
124
|
+
if (clear) next.delete(key);
|
|
125
|
+
else if (!next.has(key)) next.set(key, allParts(option));
|
|
126
|
+
});
|
|
127
|
+
return next;
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const selection: PickerSelection = Object.fromEntries(
|
|
131
|
+
groups.map((group) => [
|
|
132
|
+
group.id,
|
|
133
|
+
group.options.flatMap((_, index) => {
|
|
134
|
+
const parts = chosen.get(keyOf(group.id, index));
|
|
135
|
+
return parts
|
|
136
|
+
? [{ index, parts: [...parts].sort((a, b) => a - b) }]
|
|
137
|
+
: [];
|
|
138
|
+
}),
|
|
139
|
+
]),
|
|
140
|
+
);
|
|
141
|
+
const nothing = groups.every((group) => group.options.length === 0);
|
|
142
|
+
|
|
143
|
+
return createPortal(
|
|
144
|
+
<div
|
|
145
|
+
className="tpl-library__scrim"
|
|
146
|
+
data-chrome
|
|
147
|
+
onMouseDown={(e) => {
|
|
148
|
+
e.stopPropagation();
|
|
149
|
+
if (e.target === e.currentTarget) onClose();
|
|
150
|
+
}}
|
|
151
|
+
onClick={(e) => e.stopPropagation()}
|
|
152
|
+
>
|
|
153
|
+
<div
|
|
154
|
+
ref={panel}
|
|
155
|
+
className="tpl-library"
|
|
156
|
+
role="dialog"
|
|
157
|
+
aria-modal="true"
|
|
158
|
+
aria-labelledby={titleId}
|
|
159
|
+
tabIndex={-1}
|
|
160
|
+
onKeyDown={(e) => {
|
|
161
|
+
e.stopPropagation();
|
|
162
|
+
if (e.key === 'Escape') onClose();
|
|
163
|
+
}}
|
|
164
|
+
>
|
|
165
|
+
<header className="tpl-library__head">
|
|
166
|
+
<span className="tpl-library__mark" aria-hidden="true">
|
|
167
|
+
<svg viewBox="0 0 16 16">
|
|
168
|
+
<path d="M8 2.5v6.5M5.5 6.5 8 9l2.5-2.5M3 9.5v3h10v-3" />
|
|
169
|
+
</svg>
|
|
170
|
+
</span>
|
|
171
|
+
<div className="tpl-library__heading">
|
|
172
|
+
<h2 id={titleId} className="tpl-library__title">
|
|
173
|
+
{title}
|
|
174
|
+
</h2>
|
|
175
|
+
{subtitle && <p className="tpl-library__subtitle">{subtitle}</p>}
|
|
176
|
+
</div>
|
|
177
|
+
<button
|
|
178
|
+
type="button"
|
|
179
|
+
className="tpl-library__close"
|
|
180
|
+
aria-label={t.library.close}
|
|
181
|
+
onClick={onClose}
|
|
182
|
+
>
|
|
183
|
+
<svg viewBox="0 0 16 16" aria-hidden="true">
|
|
184
|
+
<path d="M4 4l8 8M12 4l-8 8" />
|
|
185
|
+
</svg>
|
|
186
|
+
</button>
|
|
187
|
+
</header>
|
|
188
|
+
|
|
189
|
+
{nothing ? (
|
|
190
|
+
<div className="tpl-library__empty">
|
|
191
|
+
<span className="tpl-library__empty-mark" aria-hidden="true">
|
|
192
|
+
<svg viewBox="0 0 16 16">
|
|
193
|
+
<path d="M3.5 8.5 6.5 11.5 12.5 5" />
|
|
194
|
+
</svg>
|
|
195
|
+
</span>
|
|
196
|
+
<p className="tpl-library__empty-title">{t.library.allSet}</p>
|
|
197
|
+
<p className="tpl-library__empty-text">{empty}</p>
|
|
198
|
+
</div>
|
|
199
|
+
) : (
|
|
200
|
+
<div className="tpl-library__body">
|
|
201
|
+
{groups
|
|
202
|
+
.filter((group) => group.options.length > 0)
|
|
203
|
+
.map((group) => (
|
|
204
|
+
<section
|
|
205
|
+
key={group.id}
|
|
206
|
+
className="tpl-library__group"
|
|
207
|
+
aria-label={group.heading ?? title}
|
|
208
|
+
>
|
|
209
|
+
{(group.heading || group.options.length > 1) && (
|
|
210
|
+
<div className="tpl-library__group-head">
|
|
211
|
+
{group.heading && (
|
|
212
|
+
<div>
|
|
213
|
+
<h3 className="tpl-library__group-title">
|
|
214
|
+
{group.heading}
|
|
215
|
+
<span className="tpl-library__count">
|
|
216
|
+
{group.options.length}
|
|
217
|
+
</span>
|
|
218
|
+
</h3>
|
|
219
|
+
{group.hint && (
|
|
220
|
+
<p className="tpl-library__group-hint">
|
|
221
|
+
{group.hint}
|
|
222
|
+
</p>
|
|
223
|
+
)}
|
|
224
|
+
</div>
|
|
225
|
+
)}
|
|
226
|
+
{group.options.length > 1 && (
|
|
227
|
+
<button
|
|
228
|
+
type="button"
|
|
229
|
+
className="tpl-library__all"
|
|
230
|
+
onClick={() => toggleAll(group)}
|
|
231
|
+
>
|
|
232
|
+
{allChosen(group)
|
|
233
|
+
? t.library.clear
|
|
234
|
+
: t.library.selectAll}
|
|
235
|
+
</button>
|
|
236
|
+
)}
|
|
237
|
+
</div>
|
|
238
|
+
)}
|
|
239
|
+
<ul className="tpl-library__list">
|
|
240
|
+
{group.options.map((option, i) => {
|
|
241
|
+
const parts = chosen.get(keyOf(group.id, i));
|
|
242
|
+
const on = parts !== undefined;
|
|
243
|
+
return (
|
|
244
|
+
<li key={i}>
|
|
245
|
+
<label
|
|
246
|
+
className="tpl-library__option"
|
|
247
|
+
data-on={on ? '' : undefined}
|
|
248
|
+
>
|
|
249
|
+
<input
|
|
250
|
+
type="checkbox"
|
|
251
|
+
className="tpl-library__input"
|
|
252
|
+
checked={on}
|
|
253
|
+
onChange={() => toggle(group, i)}
|
|
254
|
+
/>
|
|
255
|
+
<Check />
|
|
256
|
+
<span className="tpl-library__text">
|
|
257
|
+
<span className="tpl-library__name">
|
|
258
|
+
{option.title}
|
|
259
|
+
</span>
|
|
260
|
+
{option.detail && (
|
|
261
|
+
<span className="tpl-library__detail">
|
|
262
|
+
{option.detail}
|
|
263
|
+
</span>
|
|
264
|
+
)}
|
|
265
|
+
</span>
|
|
266
|
+
</label>
|
|
267
|
+
{on && option.parts && option.parts.length > 0 && (
|
|
268
|
+
<ul
|
|
269
|
+
className="tpl-library__parts"
|
|
270
|
+
aria-label={format(t.library.bulletsOf, {
|
|
271
|
+
title: option.title,
|
|
272
|
+
})}
|
|
273
|
+
>
|
|
274
|
+
{option.parts.map((part, p) => (
|
|
275
|
+
<li key={p}>
|
|
276
|
+
<label className="tpl-library__part">
|
|
277
|
+
<input
|
|
278
|
+
type="checkbox"
|
|
279
|
+
className="tpl-library__input"
|
|
280
|
+
checked={parts.has(p)}
|
|
281
|
+
onChange={() => togglePart(group, i, p)}
|
|
282
|
+
/>
|
|
283
|
+
<Check small />
|
|
284
|
+
<span>{part}</span>
|
|
285
|
+
</label>
|
|
286
|
+
</li>
|
|
287
|
+
))}
|
|
288
|
+
</ul>
|
|
289
|
+
)}
|
|
290
|
+
</li>
|
|
291
|
+
);
|
|
292
|
+
})}
|
|
293
|
+
</ul>
|
|
294
|
+
</section>
|
|
295
|
+
))}
|
|
296
|
+
</div>
|
|
297
|
+
)}
|
|
298
|
+
|
|
299
|
+
<footer className="tpl-library__actions">
|
|
300
|
+
{!nothing && (
|
|
301
|
+
<span className="tpl-library__selected" aria-live="polite">
|
|
302
|
+
{chosen.size === 0
|
|
303
|
+
? t.library.nothingSelected
|
|
304
|
+
: plural(t.library.selected, chosen.size)}
|
|
305
|
+
</span>
|
|
306
|
+
)}
|
|
307
|
+
<button type="button" className="tpl-library__btn" onClick={onClose}>
|
|
308
|
+
{nothing ? t.library.done : t.library.cancel}
|
|
309
|
+
</button>
|
|
310
|
+
{!nothing && (
|
|
311
|
+
<button
|
|
312
|
+
type="button"
|
|
313
|
+
className="tpl-library__btn tpl-library__btn--primary"
|
|
314
|
+
disabled={chosen.size === 0}
|
|
315
|
+
onClick={() => onAdd(selection)}
|
|
316
|
+
>
|
|
317
|
+
{chosen.size === 0 ? t.library.add : addLabel(selection)}
|
|
318
|
+
</button>
|
|
319
|
+
)}
|
|
320
|
+
</footer>
|
|
321
|
+
</div>
|
|
322
|
+
</div>,
|
|
323
|
+
document.body,
|
|
324
|
+
);
|
|
325
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createContext, useContext, useMemo, type ReactNode } from 'react';
|
|
2
|
+
import type { ResumeEdits, ResumeObject } from '@resumekit/schema';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* What the document was PROJECTED from: the writer's résumé and the overlay
|
|
6
|
+
* applied to it.
|
|
7
|
+
*
|
|
8
|
+
* Not a capability — this says nothing about what may be done to the document —
|
|
9
|
+
* but the answer to a question every surface has to ask: which entry is drawn
|
|
10
|
+
* in which position, and therefore what each field's path is. A résumé the
|
|
11
|
+
* candidate has reordered renders `experience.2` in first place, and its fields
|
|
12
|
+
* must keep saying `experience.2.*` so a stored value follows the job rather
|
|
13
|
+
* than the position.
|
|
14
|
+
*
|
|
15
|
+
* It exists because that answer used to come from the AUTHORING context, which
|
|
16
|
+
* only the editor mounts. The saved-résumé view and the export renderer
|
|
17
|
+
* therefore fell back to numbering entries by where they were drawn — so every
|
|
18
|
+
* per-path value on a reordered entry was read at the wrong address there:
|
|
19
|
+
* a space set above the second role, and its bolding and its link with it,
|
|
20
|
+
* silently moved to whichever role happened to be drawn second. The document on
|
|
21
|
+
* screen and the document that gets sent have to agree about what an entry is
|
|
22
|
+
* called, so both mount this.
|
|
23
|
+
*/
|
|
24
|
+
export interface DocumentOverlay {
|
|
25
|
+
/** The writer's résumé — what every slot reference resolves against. */
|
|
26
|
+
base?: ResumeObject;
|
|
27
|
+
/** The overlay it was projected through. Structural operations only matter. */
|
|
28
|
+
edits?: ResumeEdits;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const OverlayContext = createContext<DocumentOverlay>({});
|
|
32
|
+
|
|
33
|
+
export function DocumentOverlayProvider({
|
|
34
|
+
base,
|
|
35
|
+
edits,
|
|
36
|
+
children,
|
|
37
|
+
}: DocumentOverlay & { children: ReactNode }) {
|
|
38
|
+
// Keyed on the values themselves: this is read by every collection in the
|
|
39
|
+
// document, and a fresh object per render would re-derive all of them.
|
|
40
|
+
const value = useMemo(() => ({ base, edits }), [base, edits]);
|
|
41
|
+
return (
|
|
42
|
+
<OverlayContext.Provider value={value}>{children}</OverlayContext.Provider>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** What the document was projected from, or an empty answer outside one. */
|
|
47
|
+
export function useDocumentOverlay(): DocumentOverlay {
|
|
48
|
+
return useContext(OverlayContext);
|
|
49
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch the editing layer before anything needs it.
|
|
3
|
+
*
|
|
4
|
+
* The controls live behind a dynamic import so that a document which is only
|
|
5
|
+
* being read — the saved-résumé view, and the renderer that produces the PDF —
|
|
6
|
+
* never loads them or the drag library they use. That split is worth keeping,
|
|
7
|
+
* but it has a cost the editor should not pay: the chunk is requested when the
|
|
8
|
+
* first collection renders its first control, which is the moment a candidate
|
|
9
|
+
* reaches for one.
|
|
10
|
+
*
|
|
11
|
+
* So a surface that KNOWS it will be edited says so on mount, and the fetch
|
|
12
|
+
* overlaps the time somebody spends reading their résumé rather than the time
|
|
13
|
+
* they spend waiting for a button.
|
|
14
|
+
*
|
|
15
|
+
* Idempotent: the module cache makes a second call free, so a caller may say it
|
|
16
|
+
* as often as it likes.
|
|
17
|
+
*/
|
|
18
|
+
export function preloadEditingLayer(): Promise<unknown> {
|
|
19
|
+
return Promise.all([
|
|
20
|
+
import('./AuthoredItems.js'),
|
|
21
|
+
import('../nodes/AuthoredBullets.js'),
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
useCallback,
|
|
4
|
+
useContext,
|
|
5
|
+
useEffect,
|
|
6
|
+
useMemo,
|
|
7
|
+
useState,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
} from 'react';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Which entry the candidate is working on.
|
|
13
|
+
*
|
|
14
|
+
* Separate from Craft.js's own selection, and deliberately: Craft selects a
|
|
15
|
+
* FIELD — the string being typed into — while this selects a REGION, the role or
|
|
16
|
+
* qualification that field belongs to. Both are true at once when somebody
|
|
17
|
+
* clicks a job title, and each drives its own controls: the formatting rail acts
|
|
18
|
+
* on the field, the overlay acts on the entry.
|
|
19
|
+
*
|
|
20
|
+
* One selection for the whole document rather than one per collection, so
|
|
21
|
+
* clicking a qualification puts away the role's overlay. That is the behaviour
|
|
22
|
+
* every direct-manipulation editor has, and it only works if the state sits
|
|
23
|
+
* above every collection.
|
|
24
|
+
*/
|
|
25
|
+
interface EntrySelection {
|
|
26
|
+
active: string | null;
|
|
27
|
+
select: (key: string | null) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const SelectionContext = createContext<EntrySelection>({
|
|
31
|
+
active: null,
|
|
32
|
+
select: () => undefined,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export function EntrySelectionProvider({ children }: { children: ReactNode }) {
|
|
36
|
+
const [active, setActive] = useState<string | null>(null);
|
|
37
|
+
|
|
38
|
+
const select = useCallback((key: string | null) => setActive(key), []);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (active === null) return;
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
* A click outside any entry puts the overlay away. Captured on `pointerdown`
|
|
45
|
+
* rather than `click` so the overlay is gone before a new selection paints,
|
|
46
|
+
* and it never flickers through a frame showing two.
|
|
47
|
+
*/
|
|
48
|
+
const onPointerDown = (event: PointerEvent) => {
|
|
49
|
+
const target = event.target as HTMLElement | null;
|
|
50
|
+
if (target?.closest('[data-entry]') || target?.closest('[data-chrome]')) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
setActive(null);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/* Escape is the way out that needs no aim, and the one a keyboard user has. */
|
|
57
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
58
|
+
if (event.key === 'Escape') setActive(null);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/*
|
|
62
|
+
* And it is put away before printing, for the same reason the field
|
|
63
|
+
* selection is: what is on paper is the document, never the tools.
|
|
64
|
+
*/
|
|
65
|
+
const onBeforePrint = () => setActive(null);
|
|
66
|
+
|
|
67
|
+
document.addEventListener('pointerdown', onPointerDown, true);
|
|
68
|
+
document.addEventListener('keydown', onKeyDown);
|
|
69
|
+
window.addEventListener('beforeprint', onBeforePrint);
|
|
70
|
+
return () => {
|
|
71
|
+
document.removeEventListener('pointerdown', onPointerDown, true);
|
|
72
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
73
|
+
window.removeEventListener('beforeprint', onBeforePrint);
|
|
74
|
+
};
|
|
75
|
+
}, [active]);
|
|
76
|
+
|
|
77
|
+
const value = useMemo(() => ({ active, select }), [active, select]);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<SelectionContext.Provider value={value}>
|
|
81
|
+
{children}
|
|
82
|
+
</SelectionContext.Provider>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function useEntrySelection(): EntrySelection {
|
|
87
|
+
return useContext(SelectionContext);
|
|
88
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { COLLECTIONS, type CollectionId } from '@resumekit/schema';
|
|
3
|
+
import { useAutosave } from '../autosave-context.js';
|
|
4
|
+
import { useEditorText } from '../i18n/index.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Everything a collection can do, and every reason it cannot.
|
|
8
|
+
*
|
|
9
|
+
* This is the whole behavioural surface of the feature, and it exists once. A
|
|
10
|
+
* template receives none of it: an entry component is handed values and a path,
|
|
11
|
+
* so a template cannot acquire the ability to add or remove by reaching past
|
|
12
|
+
* its own interface. `collections.spec.tsx` asserts that.
|
|
13
|
+
*/
|
|
14
|
+
export interface CollectionHandle<T> {
|
|
15
|
+
readonly id: CollectionId;
|
|
16
|
+
readonly items: readonly T[];
|
|
17
|
+
/** False for a singular location, which is why the summary offers no add. */
|
|
18
|
+
readonly canAdd: boolean;
|
|
19
|
+
readonly canMove: boolean;
|
|
20
|
+
/** Why this item cannot be removed, or `undefined` when it can. */
|
|
21
|
+
removeReason: (index: number) => string | undefined;
|
|
22
|
+
add: (afterIndex?: number) => void;
|
|
23
|
+
/** Insert ready-made items after `afterIndex`, as ONE step of the document's history. */
|
|
24
|
+
addMany: (afterIndex: number, items: readonly T[]) => void;
|
|
25
|
+
remove: (index: number) => void;
|
|
26
|
+
move: (from: number, to: number) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** How a particular storage answers the three operations. */
|
|
30
|
+
export interface CollectionStore<T> {
|
|
31
|
+
items: readonly T[];
|
|
32
|
+
insert: (index: number, item: T) => void;
|
|
33
|
+
/** Several items at once; stores that can write them as one step say how. */
|
|
34
|
+
insertMany?: (index: number, items: readonly T[]) => void;
|
|
35
|
+
removeAt: (index: number) => void;
|
|
36
|
+
reorder: (from: number, to: number) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Why the item at `index` may not be removed, beyond the minimum length the
|
|
39
|
+
* table already enforces. The overlay-backed store answers here that the
|
|
40
|
+
* writer produced this entry and it is hidden rather than deleted.
|
|
41
|
+
*/
|
|
42
|
+
removeReason?: (index: number) => string | undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Move `from` to `to`, returning a new array. The one definition of the move. */
|
|
46
|
+
export function movedTo<T>(items: readonly T[], from: number, to: number): T[] {
|
|
47
|
+
const next = [...items];
|
|
48
|
+
const [moved] = next.splice(from, 1);
|
|
49
|
+
if (moved === undefined) return [...items];
|
|
50
|
+
next.splice(Math.max(0, Math.min(to, next.length)), 0, moved);
|
|
51
|
+
return next;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The policy half of a collection: what may be done, and what may not.
|
|
56
|
+
*
|
|
57
|
+
* Storage-agnostic on purpose. A bullet list is held in the editor's own node
|
|
58
|
+
* props because its text is text like any other; an experience entry is held in
|
|
59
|
+
* the presentation overlay because adding one is a decision, not a difference
|
|
60
|
+
* between two strings. Both are the same collection to a candidate, so both get
|
|
61
|
+
* the same rules from here and differ only in the `store` they are given.
|
|
62
|
+
*
|
|
63
|
+
* It is also where every collection **stores itself**. Adding a bullet, removing
|
|
64
|
+
* a role and reordering a qualification all arrive here, and all three are the
|
|
65
|
+
* same kind of event: a discrete act with nothing still coming after it. So the
|
|
66
|
+
* save request is made once, in the one place all three pass through, rather
|
|
67
|
+
* than at each of the several call sites that could have forgotten it — and it
|
|
68
|
+
* is made AFTER the guards, so a removal the rules refused writes nothing.
|
|
69
|
+
*/
|
|
70
|
+
export function useCollection<T>(
|
|
71
|
+
id: CollectionId,
|
|
72
|
+
store: CollectionStore<T>,
|
|
73
|
+
): CollectionHandle<T> {
|
|
74
|
+
const def = COLLECTIONS[id];
|
|
75
|
+
const text = useEditorText();
|
|
76
|
+
const { items } = store;
|
|
77
|
+
const { saveNow } = useAutosave();
|
|
78
|
+
|
|
79
|
+
return useMemo<CollectionHandle<T>>(
|
|
80
|
+
() => ({
|
|
81
|
+
id,
|
|
82
|
+
items,
|
|
83
|
+
canAdd: def.arity === 'many',
|
|
84
|
+
canMove: def.reorderable && items.length > 1,
|
|
85
|
+
|
|
86
|
+
removeReason: (index) => {
|
|
87
|
+
const { t, format } = text;
|
|
88
|
+
if (def.arity !== 'many') return t.refusal.single;
|
|
89
|
+
if (items.length <= def.min) {
|
|
90
|
+
/*
|
|
91
|
+
* Explained rather than hidden — the rule #29 set for the last
|
|
92
|
+
* bullet, now stated for every collection that has a minimum. A rule
|
|
93
|
+
* the candidate cannot see is a rule they run into.
|
|
94
|
+
*/
|
|
95
|
+
return def.min === 1
|
|
96
|
+
? format(t.refusal.minimumOne, text.noun(def.noun))
|
|
97
|
+
: format(t.refusal.minimum, { count: def.min });
|
|
98
|
+
}
|
|
99
|
+
return store.removeReason?.(index);
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
add: (afterIndex) => {
|
|
103
|
+
if (def.arity !== 'many') return;
|
|
104
|
+
const at = afterIndex === undefined ? items.length : afterIndex + 1;
|
|
105
|
+
store.insert(at, def.mint() as T);
|
|
106
|
+
saveNow();
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
addMany: (afterIndex, added) => {
|
|
110
|
+
if (def.arity !== 'many' || added.length === 0) return;
|
|
111
|
+
const at = afterIndex + 1;
|
|
112
|
+
if (store.insertMany) store.insertMany(at, added);
|
|
113
|
+
else added.forEach((item, i) => store.insert(at + i, item));
|
|
114
|
+
saveNow();
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
remove: (index) => {
|
|
118
|
+
if (def.arity !== 'many' || items.length <= def.min) return;
|
|
119
|
+
if (store.removeReason?.(index) !== undefined) return;
|
|
120
|
+
store.removeAt(index);
|
|
121
|
+
saveNow();
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
move: (from, to) => {
|
|
125
|
+
if (!def.reorderable) return;
|
|
126
|
+
if (from === to || from < 0 || from >= items.length) return;
|
|
127
|
+
store.reorder(from, Math.max(0, Math.min(to, items.length - 1)));
|
|
128
|
+
saveNow();
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
131
|
+
[id, def, items, store, saveNow, text],
|
|
132
|
+
);
|
|
133
|
+
}
|