@resumekit/react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -2
- package/dist/PagedSheet.d.ts +63 -0
- package/dist/PagedSheet.d.ts.map +1 -0
- package/dist/PagedSheet.js +584 -0
- package/dist/TemplateDocument.d.ts +33 -0
- package/dist/TemplateDocument.d.ts.map +1 -0
- package/dist/TemplateDocument.js +33 -0
- package/dist/autosave-context.d.ts +37 -0
- package/dist/autosave-context.d.ts.map +1 -0
- package/dist/autosave-context.js +24 -0
- package/dist/collections/AuthoredItems.d.ts +9 -0
- package/dist/collections/AuthoredItems.d.ts.map +1 -0
- package/dist/collections/AuthoredItems.js +116 -0
- package/dist/collections/Collection.d.ts +48 -0
- package/dist/collections/Collection.d.ts.map +1 -0
- package/dist/collections/Collection.js +24 -0
- package/dist/collections/CollectionItems.d.ts +94 -0
- package/dist/collections/CollectionItems.d.ts.map +1 -0
- package/dist/collections/CollectionItems.js +91 -0
- package/dist/collections/EntryOverlay.d.ts +38 -0
- package/dist/collections/EntryOverlay.d.ts.map +1 -0
- package/dist/collections/EntryOverlay.js +51 -0
- package/dist/collections/SortableItems.d.ts +52 -0
- package/dist/collections/SortableItems.d.ts.map +1 -0
- package/dist/collections/SortableItems.js +80 -0
- package/dist/collections/authoring-context.d.ts +69 -0
- package/dist/collections/authoring-context.d.ts.map +1 -0
- package/dist/collections/authoring-context.js +36 -0
- package/dist/collections/collection.css +462 -0
- package/dist/collections/entry-text.d.ts +23 -0
- package/dist/collections/entry-text.d.ts.map +1 -0
- package/dist/collections/entry-text.js +35 -0
- package/dist/collections/icons.d.ts +53 -0
- package/dist/collections/icons.d.ts.map +1 -0
- package/dist/collections/icons.js +56 -0
- package/dist/collections/library/LibraryAction.d.ts +24 -0
- package/dist/collections/library/LibraryAction.d.ts.map +1 -0
- package/dist/collections/library/LibraryAction.js +122 -0
- package/dist/collections/library/LibraryPicker.d.ts +42 -0
- package/dist/collections/library/LibraryPicker.d.ts.map +1 -0
- package/dist/collections/library/LibraryPicker.js +94 -0
- package/dist/collections/library/library.css +435 -0
- package/dist/collections/overlay-context.d.ts +34 -0
- package/dist/collections/overlay-context.d.ts.map +1 -0
- package/dist/collections/overlay-context.js +13 -0
- package/dist/collections/preload.d.ts +19 -0
- package/dist/collections/preload.d.ts.map +1 -0
- package/dist/collections/preload.js +23 -0
- package/dist/collections/selection-context.d.ts +25 -0
- package/dist/collections/selection-context.d.ts.map +1 -0
- package/dist/collections/selection-context.js +49 -0
- package/dist/collections/useCollection.d.ts +58 -0
- package/dist/collections/useCollection.d.ts.map +1 -0
- package/dist/collections/useCollection.js +90 -0
- package/dist/collections/useCustomEntries.d.ts +18 -0
- package/dist/collections/useCustomEntries.d.ts.map +1 -0
- package/dist/collections/useCustomEntries.js +56 -0
- package/dist/collections/useSectionCollection.d.ts +48 -0
- package/dist/collections/useSectionCollection.d.ts.map +1 -0
- package/dist/collections/useSectionCollection.js +169 -0
- package/dist/document.css +185 -0
- package/dist/export-bundle/bundle.css +2 -0
- package/dist/export-bundle/bundle.js +67 -0
- package/dist/fields/date-issues-context.d.ts +20 -0
- package/dist/fields/date-issues-context.d.ts.map +1 -0
- package/dist/fields/date-issues-context.js +68 -0
- package/dist/fields/field-registry.d.ts +163 -0
- package/dist/fields/field-registry.d.ts.map +1 -0
- package/dist/fields/field-registry.js +175 -0
- package/dist/fonts/README.md +207 -0
- package/dist/fonts/arimo-400.woff2 +0 -0
- package/dist/fonts/arimo-400i.woff2 +0 -0
- package/dist/fonts/arimo-700.woff2 +0 -0
- package/dist/fonts/arimo-700i.woff2 +0 -0
- package/dist/fonts/bitter-400.woff2 +0 -0
- package/dist/fonts/bitter-400i.woff2 +0 -0
- package/dist/fonts/bitter-700.woff2 +0 -0
- package/dist/fonts/bitter-700i.woff2 +0 -0
- package/dist/fonts/cabin-700.woff2 +0 -0
- package/dist/fonts/carlito-400.woff2 +0 -0
- package/dist/fonts/carlito-400i.woff2 +0 -0
- package/dist/fonts/carlito-700.woff2 +0 -0
- package/dist/fonts/carlito-700i.woff2 +0 -0
- package/dist/fonts/clearsans-400.woff2 +0 -0
- package/dist/fonts/clearsans-400i.woff2 +0 -0
- package/dist/fonts/cochineal-400.woff2 +0 -0
- package/dist/fonts/cochineal-400i.woff2 +0 -0
- package/dist/fonts/cochineal-700.woff2 +0 -0
- package/dist/fonts/ebgaramond-400.woff2 +0 -0
- package/dist/fonts/ebgaramond-400i.woff2 +0 -0
- package/dist/fonts/ebgaramond-700.woff2 +0 -0
- package/dist/fonts/ebgaramond-700i.woff2 +0 -0
- package/dist/fonts/fonts.css +622 -0
- package/dist/fonts/gelasio-400.woff2 +0 -0
- package/dist/fonts/gelasio-400i.woff2 +0 -0
- package/dist/fonts/gelasio-700.woff2 +0 -0
- package/dist/fonts/gelasio-700i.woff2 +0 -0
- package/dist/fonts/heros-400.woff2 +0 -0
- package/dist/fonts/heros-400i.woff2 +0 -0
- package/dist/fonts/heros-700.woff2 +0 -0
- package/dist/fonts/heros-700i.woff2 +0 -0
- package/dist/fonts/inconsolata-400.woff2 +0 -0
- package/dist/fonts/lato-100.woff2 +0 -0
- package/dist/fonts/lato-300.woff2 +0 -0
- package/dist/fonts/lato-300i.woff2 +0 -0
- package/dist/fonts/lato-400.woff2 +0 -0
- package/dist/fonts/lato-400i.woff2 +0 -0
- package/dist/fonts/lato-700.woff2 +0 -0
- package/dist/fonts/lato-700i.woff2 +0 -0
- package/dist/fonts/licenses/arimo-OFL.txt +93 -0
- package/dist/fonts/licenses/bitter-OFL.txt +94 -0
- package/dist/fonts/licenses/cabin-OFL.txt +93 -0
- package/dist/fonts/licenses/carlito-OFL.txt +94 -0
- package/dist/fonts/licenses/clearsans-APACHE-2.0.txt +205 -0
- package/dist/fonts/licenses/cochineal-OFL.txt +96 -0
- package/dist/fonts/licenses/ebgaramond-OFL.txt +93 -0
- package/dist/fonts/licenses/gelasio-OFL.txt +93 -0
- package/dist/fonts/licenses/heros-GUST-FONT-LICENSE.txt +30 -0
- package/dist/fonts/licenses/inconsolata-OFL.txt +93 -0
- package/dist/fonts/licenses/latinmodern-GUST-FONT-LICENSE.txt +35 -0
- package/dist/fonts/licenses/lato-OFL.txt +93 -0
- package/dist/fonts/licenses/ptserif-OFL.txt +93 -0
- package/dist/fonts/licenses/raleway-OFL.txt +93 -0
- package/dist/fonts/licenses/roboto-OFL.txt +93 -0
- package/dist/fonts/licenses/robotocondensed-OFL.txt +93 -0
- package/dist/fonts/licenses/robotoslab-APACHE-2.0.txt +205 -0
- package/dist/fonts/licenses/sourcesans3-OFL.txt +93 -0
- package/dist/fonts/licenses/tinos-OFL.txt +93 -0
- package/dist/fonts/lmmono-400.woff2 +0 -0
- package/dist/fonts/lmroman-400.woff2 +0 -0
- package/dist/fonts/lmroman-400i.woff2 +0 -0
- package/dist/fonts/lmroman-700.woff2 +0 -0
- package/dist/fonts/lmroman-700i.woff2 +0 -0
- package/dist/fonts/lmromancaps-400.woff2 +0 -0
- package/dist/fonts/ptserif-400.woff2 +0 -0
- package/dist/fonts/ptserif-400i.woff2 +0 -0
- package/dist/fonts/ptserif-700.woff2 +0 -0
- package/dist/fonts/ptserif-700i.woff2 +0 -0
- package/dist/fonts/raleway-300.woff2 +0 -0
- package/dist/fonts/raleway-400.woff2 +0 -0
- package/dist/fonts/raleway-400i.woff2 +0 -0
- package/dist/fonts/raleway-500.woff2 +0 -0
- package/dist/fonts/raleway-700.woff2 +0 -0
- package/dist/fonts/roboto-100.woff2 +0 -0
- package/dist/fonts/roboto-300.woff2 +0 -0
- package/dist/fonts/roboto-300i.woff2 +0 -0
- package/dist/fonts/roboto-400.woff2 +0 -0
- package/dist/fonts/roboto-400i.woff2 +0 -0
- package/dist/fonts/roboto-700.woff2 +0 -0
- package/dist/fonts/robotocondensed-400.woff2 +0 -0
- package/dist/fonts/robotocondensed-400i.woff2 +0 -0
- package/dist/fonts/robotocondensed-700.woff2 +0 -0
- package/dist/fonts/robotocondensed-700i.woff2 +0 -0
- package/dist/fonts/robotoslab-700.woff2 +0 -0
- package/dist/fonts/sourcesans3-300.woff2 +0 -0
- package/dist/fonts/sourcesans3-300i.woff2 +0 -0
- package/dist/fonts/sourcesans3-400.woff2 +0 -0
- package/dist/fonts/sourcesans3-400i.woff2 +0 -0
- package/dist/fonts/sourcesans3-700.woff2 +0 -0
- package/dist/fonts/tinos-400.woff2 +0 -0
- package/dist/fonts/tinos-400i.woff2 +0 -0
- package/dist/fonts/tinos-700.woff2 +0 -0
- package/dist/fonts/tinos-700i.woff2 +0 -0
- package/dist/i18n/README.md +52 -0
- package/dist/i18n/catalog.d.ts +39 -0
- package/dist/i18n/catalog.d.ts.map +1 -0
- package/dist/i18n/catalog.js +43 -0
- package/dist/i18n/format.d.ts +14 -0
- package/dist/i18n/format.d.ts.map +1 -0
- package/dist/i18n/format.js +38 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/locale-context.d.ts +43 -0
- package/dist/i18n/locale-context.d.ts.map +1 -0
- package/dist/i18n/locale-context.js +74 -0
- package/dist/i18n/locales/en.json +337 -0
- package/dist/i18n/locales/es.json +337 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +99 -0
- package/dist/kit/BulletSkillGroup.d.ts +20 -0
- package/dist/kit/BulletSkillGroup.d.ts.map +1 -0
- package/dist/kit/BulletSkillGroup.js +25 -0
- package/dist/kit/DescribedEntries.d.ts +41 -0
- package/dist/kit/DescribedEntries.d.ts.map +1 -0
- package/dist/kit/DescribedEntries.js +57 -0
- package/dist/kit/DocumentSection.d.ts +58 -0
- package/dist/kit/DocumentSection.d.ts.map +1 -0
- package/dist/kit/DocumentSection.js +38 -0
- package/dist/kit/GridSkillGroup.d.ts +12 -0
- package/dist/kit/GridSkillGroup.d.ts.map +1 -0
- package/dist/kit/GridSkillGroup.js +14 -0
- package/dist/kit/Heading.d.ts +11 -0
- package/dist/kit/Heading.d.ts.map +1 -0
- package/dist/kit/Heading.js +10 -0
- package/dist/kit/InitialsAvatar.d.ts +17 -0
- package/dist/kit/InitialsAvatar.d.ts.map +1 -0
- package/dist/kit/InitialsAvatar.js +18 -0
- package/dist/kit/InitialsChip.d.ts +16 -0
- package/dist/kit/InitialsChip.d.ts.map +1 -0
- package/dist/kit/InitialsChip.js +16 -0
- package/dist/kit/InlineSkillGroup.d.ts +22 -0
- package/dist/kit/InlineSkillGroup.d.ts.map +1 -0
- package/dist/kit/InlineSkillGroup.js +16 -0
- package/dist/kit/LabelledSkillGroup.d.ts +24 -0
- package/dist/kit/LabelledSkillGroup.d.ts.map +1 -0
- package/dist/kit/LabelledSkillGroup.js +20 -0
- package/dist/kit/LanguageList.d.ts +28 -0
- package/dist/kit/LanguageList.d.ts.map +1 -0
- package/dist/kit/LanguageList.js +56 -0
- package/dist/kit/Separator.d.ts +20 -0
- package/dist/kit/Separator.d.ts.map +1 -0
- package/dist/kit/Separator.js +21 -0
- package/dist/kit/TagSkillGroup.d.ts +8 -0
- package/dist/kit/TagSkillGroup.d.ts.map +1 -0
- package/dist/kit/TagSkillGroup.js +10 -0
- package/dist/kit/avatar.css +42 -0
- package/dist/kit/contact-icons.css +70 -0
- package/dist/kit/contact.d.ts +16 -0
- package/dist/kit/contact.d.ts.map +1 -0
- package/dist/kit/contact.js +18 -0
- package/dist/kit/described.css +114 -0
- package/dist/kit/documentStyle.d.ts +12 -0
- package/dist/kit/documentStyle.d.ts.map +1 -0
- package/dist/kit/documentStyle.js +24 -0
- package/dist/kit/heading.css +17 -0
- package/dist/kit/keywords.css +127 -0
- package/dist/kit/language.css +104 -0
- package/dist/kit/layout.css +16 -0
- package/dist/kit/monogram.d.ts +6 -0
- package/dist/kit/monogram.d.ts.map +1 -0
- package/dist/kit/monogram.js +12 -0
- package/dist/kit/panel.css +26 -0
- package/dist/kit/skill-grid.css +93 -0
- package/dist/kit/skill-tags.css +36 -0
- package/dist/kit/textShapes.d.ts +24 -0
- package/dist/kit/textShapes.d.ts.map +1 -0
- package/dist/kit/textShapes.js +32 -0
- package/dist/letter/LetterDocument.d.ts +13 -0
- package/dist/letter/LetterDocument.d.ts.map +1 -0
- package/dist/letter/LetterDocument.js +12 -0
- package/dist/letter/letter.css +75 -0
- package/dist/nodes/AuthoredBullets.d.ts +22 -0
- package/dist/nodes/AuthoredBullets.d.ts.map +1 -0
- package/dist/nodes/AuthoredBullets.js +101 -0
- package/dist/nodes/CustomSections.d.ts +42 -0
- package/dist/nodes/CustomSections.d.ts.map +1 -0
- package/dist/nodes/CustomSections.js +27 -0
- package/dist/nodes/EditableBulletList.d.ts +15 -0
- package/dist/nodes/EditableBulletList.d.ts.map +1 -0
- package/dist/nodes/EditableBulletList.js +98 -0
- package/dist/nodes/EditableInlineList.d.ts +27 -0
- package/dist/nodes/EditableInlineList.d.ts.map +1 -0
- package/dist/nodes/EditableInlineList.js +50 -0
- package/dist/nodes/EditableText.d.ts +79 -0
- package/dist/nodes/EditableText.d.ts.map +1 -0
- package/dist/nodes/EditableText.js +113 -0
- package/dist/nodes/LinkField.d.ts +103 -0
- package/dist/nodes/LinkField.d.ts.map +1 -0
- package/dist/nodes/LinkField.js +277 -0
- package/dist/nodes/PlainTextField.d.ts +38 -0
- package/dist/nodes/PlainTextField.d.ts.map +1 -0
- package/dist/nodes/PlainTextField.js +72 -0
- package/dist/nodes/formatting.d.ts +34 -0
- package/dist/nodes/formatting.d.ts.map +1 -0
- package/dist/nodes/formatting.js +24 -0
- package/dist/nodes/link-field.css +200 -0
- package/dist/nodes/locked.d.ts +38 -0
- package/dist/nodes/locked.d.ts.map +1 -0
- package/dist/nodes/locked.js +65 -0
- package/dist/nodes/template-node.css +720 -0
- package/dist/paged.css +265 -0
- package/dist/pagination.d.ts +93 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +167 -0
- package/dist/picture-context.d.ts +6 -0
- package/dist/picture-context.d.ts.map +1 -0
- package/dist/picture-context.js +14 -0
- package/dist/presentation-context.d.ts +45 -0
- package/dist/presentation-context.d.ts.map +1 -0
- package/dist/presentation-context.js +44 -0
- package/dist/presented.d.ts +16 -0
- package/dist/presented.d.ts.map +1 -0
- package/dist/presented.js +22 -0
- package/dist/rail/ContainerRail.d.ts +29 -0
- package/dist/rail/ContainerRail.d.ts.map +1 -0
- package/dist/rail/ContainerRail.js +50 -0
- package/dist/rail/EntryActions.d.ts +19 -0
- package/dist/rail/EntryActions.d.ts.map +1 -0
- package/dist/rail/EntryActions.js +17 -0
- package/dist/rail/rail-store.d.ts +42 -0
- package/dist/rail/rail-store.d.ts.map +1 -0
- package/dist/rail/rail-store.js +107 -0
- package/dist/rail/rail.css +188 -0
- package/dist/rail/useSpaceDrag.d.ts +30 -0
- package/dist/rail/useSpaceDrag.d.ts.map +1 -0
- package/dist/rail/useSpaceDrag.js +154 -0
- package/dist/registry.d.ts +35 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +74 -0
- package/dist/spacing/spacing-context.d.ts +53 -0
- package/dist/spacing/spacing-context.d.ts.map +1 -0
- package/dist/spacing/spacing-context.js +36 -0
- package/dist/spacing/spacing.css +159 -0
- package/dist/spacing/useSpaceSlot.d.ts +52 -0
- package/dist/spacing/useSpaceSlot.d.ts.map +1 -0
- package/dist/spacing/useSpaceSlot.js +38 -0
- package/dist/static/api.d.ts +13 -0
- package/dist/static/api.d.ts.map +1 -0
- package/dist/static/api.js +1 -0
- package/dist/static/static.mjs +33779 -0
- package/dist/static/templates/academic.css +1 -0
- package/dist/static/templates/alta.css +1 -0
- package/dist/static/templates/classic.css +1 -0
- package/dist/static/templates/cobalt.css +1 -0
- package/dist/static/templates/compact.css +1 -0
- package/dist/static/templates/contemporary.css +1 -0
- package/dist/static/templates/creative.css +1 -0
- package/dist/static/templates/crimson.css +1 -0
- package/dist/static/templates/curve.css +1 -0
- package/dist/static/templates/double-column-logos.css +1 -0
- package/dist/static/templates/double-column.css +1 -0
- package/dist/static/templates/elegant-logos.css +1 -0
- package/dist/static/templates/elegant.css +1 -0
- package/dist/static/templates/engineer.css +1 -0
- package/dist/static/templates/executive.css +1 -0
- package/dist/static/templates/harvard.css +1 -0
- package/dist/static/templates/hipster.css +1 -0
- package/dist/static/templates/ivy.css +1 -0
- package/dist/static/templates/meridian.css +1 -0
- package/dist/static/templates/modern.css +1 -0
- package/dist/static/templates/polished.css +1 -0
- package/dist/static/templates/portrait.css +1 -0
- package/dist/static/templates/prism.css +1 -0
- package/dist/static/templates/scholar.css +1 -0
- package/dist/static/templates/split.css +1 -0
- package/dist/static/templates/stylish.css +1 -0
- package/dist/static/templates/timeline.css +1 -0
- package/dist/static/templates.css +1 -0
- package/dist/templates/academic/AcademicDocument.d.ts +6 -0
- package/dist/templates/academic/AcademicDocument.d.ts.map +1 -0
- package/dist/templates/academic/AcademicDocument.js +29 -0
- package/dist/templates/academic/academic.css +284 -0
- package/dist/templates/academic/entries.d.ts +22 -0
- package/dist/templates/academic/entries.d.ts.map +1 -0
- package/dist/templates/academic/entries.js +17 -0
- package/dist/templates/alta/AltaDocument.d.ts +6 -0
- package/dist/templates/alta/AltaDocument.d.ts.map +1 -0
- package/dist/templates/alta/AltaDocument.js +29 -0
- package/dist/templates/alta/alta.css +413 -0
- package/dist/templates/alta/entries.d.ts +22 -0
- package/dist/templates/alta/entries.d.ts.map +1 -0
- package/dist/templates/alta/entries.js +17 -0
- package/dist/templates/classic/ClassicDocument.d.ts +6 -0
- package/dist/templates/classic/ClassicDocument.d.ts.map +1 -0
- package/dist/templates/classic/ClassicDocument.js +26 -0
- package/dist/templates/classic/classic.css +251 -0
- package/dist/templates/classic/entries.d.ts +22 -0
- package/dist/templates/classic/entries.d.ts.map +1 -0
- package/dist/templates/classic/entries.js +17 -0
- package/dist/templates/cobalt/CobaltDocument.d.ts +6 -0
- package/dist/templates/cobalt/CobaltDocument.d.ts.map +1 -0
- package/dist/templates/cobalt/CobaltDocument.js +28 -0
- package/dist/templates/cobalt/cobalt.css +478 -0
- package/dist/templates/cobalt/crest.d.ts +6 -0
- package/dist/templates/cobalt/crest.d.ts.map +1 -0
- package/dist/templates/cobalt/crest.js +8 -0
- package/dist/templates/cobalt/entries.d.ts +22 -0
- package/dist/templates/cobalt/entries.d.ts.map +1 -0
- package/dist/templates/cobalt/entries.js +17 -0
- package/dist/templates/compact/CompactDocument.d.ts +6 -0
- package/dist/templates/compact/CompactDocument.d.ts.map +1 -0
- package/dist/templates/compact/CompactDocument.js +28 -0
- package/dist/templates/compact/compact.css +240 -0
- package/dist/templates/compact/entries.d.ts +22 -0
- package/dist/templates/compact/entries.d.ts.map +1 -0
- package/dist/templates/compact/entries.js +17 -0
- package/dist/templates/contemporary/ContemporaryDocument.d.ts +6 -0
- package/dist/templates/contemporary/ContemporaryDocument.d.ts.map +1 -0
- package/dist/templates/contemporary/ContemporaryDocument.js +29 -0
- package/dist/templates/contemporary/contemporary.css +411 -0
- package/dist/templates/contemporary/entries.d.ts +22 -0
- package/dist/templates/contemporary/entries.d.ts.map +1 -0
- package/dist/templates/contemporary/entries.js +17 -0
- package/dist/templates/creative/CreativeDocument.d.ts +6 -0
- package/dist/templates/creative/CreativeDocument.d.ts.map +1 -0
- package/dist/templates/creative/CreativeDocument.js +29 -0
- package/dist/templates/creative/creative.css +326 -0
- package/dist/templates/creative/entries.d.ts +22 -0
- package/dist/templates/creative/entries.d.ts.map +1 -0
- package/dist/templates/creative/entries.js +17 -0
- package/dist/templates/crimson/CrimsonDocument.d.ts +6 -0
- package/dist/templates/crimson/CrimsonDocument.d.ts.map +1 -0
- package/dist/templates/crimson/CrimsonDocument.js +30 -0
- package/dist/templates/crimson/crimson.css +301 -0
- package/dist/templates/crimson/entries.d.ts +22 -0
- package/dist/templates/crimson/entries.d.ts.map +1 -0
- package/dist/templates/crimson/entries.js +17 -0
- package/dist/templates/curve/CurveDocument.d.ts +6 -0
- package/dist/templates/curve/CurveDocument.d.ts.map +1 -0
- package/dist/templates/curve/CurveDocument.js +29 -0
- package/dist/templates/curve/curve.css +330 -0
- package/dist/templates/curve/entries.d.ts +22 -0
- package/dist/templates/curve/entries.d.ts.map +1 -0
- package/dist/templates/curve/entries.js +17 -0
- package/dist/templates/double-column/DoubleColumnDocument.d.ts +6 -0
- package/dist/templates/double-column/DoubleColumnDocument.d.ts.map +1 -0
- package/dist/templates/double-column/DoubleColumnDocument.js +29 -0
- package/dist/templates/double-column/double-column.css +331 -0
- package/dist/templates/double-column/entries.d.ts +22 -0
- package/dist/templates/double-column/entries.d.ts.map +1 -0
- package/dist/templates/double-column/entries.js +17 -0
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.d.ts +6 -0
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.d.ts.map +1 -0
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.js +28 -0
- package/dist/templates/double-column-logos/double-column-logos.css +333 -0
- package/dist/templates/double-column-logos/entries.d.ts +22 -0
- package/dist/templates/double-column-logos/entries.d.ts.map +1 -0
- package/dist/templates/double-column-logos/entries.js +18 -0
- package/dist/templates/elegant/ElegantDocument.d.ts +6 -0
- package/dist/templates/elegant/ElegantDocument.d.ts.map +1 -0
- package/dist/templates/elegant/ElegantDocument.js +31 -0
- package/dist/templates/elegant/elegant.css +358 -0
- package/dist/templates/elegant/entries.d.ts +22 -0
- package/dist/templates/elegant/entries.d.ts.map +1 -0
- package/dist/templates/elegant/entries.js +17 -0
- package/dist/templates/elegant-logos/ElegantLogosDocument.d.ts +6 -0
- package/dist/templates/elegant-logos/ElegantLogosDocument.d.ts.map +1 -0
- package/dist/templates/elegant-logos/ElegantLogosDocument.js +30 -0
- package/dist/templates/elegant-logos/elegant-logos.css +370 -0
- package/dist/templates/elegant-logos/entries.d.ts +22 -0
- package/dist/templates/elegant-logos/entries.d.ts.map +1 -0
- package/dist/templates/elegant-logos/entries.js +18 -0
- package/dist/templates/engineer/EngineerDocument.d.ts +6 -0
- package/dist/templates/engineer/EngineerDocument.d.ts.map +1 -0
- package/dist/templates/engineer/EngineerDocument.js +26 -0
- package/dist/templates/engineer/engineer.css +261 -0
- package/dist/templates/engineer/entries.d.ts +22 -0
- package/dist/templates/engineer/entries.d.ts.map +1 -0
- package/dist/templates/engineer/entries.js +17 -0
- package/dist/templates/executive/ExecutiveDocument.d.ts +6 -0
- package/dist/templates/executive/ExecutiveDocument.d.ts.map +1 -0
- package/dist/templates/executive/ExecutiveDocument.js +29 -0
- package/dist/templates/executive/entries.d.ts +22 -0
- package/dist/templates/executive/entries.d.ts.map +1 -0
- package/dist/templates/executive/entries.js +17 -0
- package/dist/templates/executive/executive.css +394 -0
- package/dist/templates/harvard/HarvardDocument.d.ts +6 -0
- package/dist/templates/harvard/HarvardDocument.d.ts.map +1 -0
- package/dist/templates/harvard/HarvardDocument.js +25 -0
- package/dist/templates/harvard/entries.d.ts +28 -0
- package/dist/templates/harvard/entries.d.ts.map +1 -0
- package/dist/templates/harvard/entries.js +22 -0
- package/dist/templates/harvard/harvard.css +436 -0
- package/dist/templates/hipster/HipsterDocument.d.ts +6 -0
- package/dist/templates/hipster/HipsterDocument.d.ts.map +1 -0
- package/dist/templates/hipster/HipsterDocument.js +30 -0
- package/dist/templates/hipster/entries.d.ts +22 -0
- package/dist/templates/hipster/entries.d.ts.map +1 -0
- package/dist/templates/hipster/entries.js +17 -0
- package/dist/templates/hipster/hipster.css +442 -0
- package/dist/templates/ivy/IvyDocument.d.ts +6 -0
- package/dist/templates/ivy/IvyDocument.d.ts.map +1 -0
- package/dist/templates/ivy/IvyDocument.js +26 -0
- package/dist/templates/ivy/entries.d.ts +22 -0
- package/dist/templates/ivy/entries.d.ts.map +1 -0
- package/dist/templates/ivy/entries.js +17 -0
- package/dist/templates/ivy/ivy.css +292 -0
- package/dist/templates/meridian/MeridianDocument.d.ts +6 -0
- package/dist/templates/meridian/MeridianDocument.d.ts.map +1 -0
- package/dist/templates/meridian/MeridianDocument.js +28 -0
- package/dist/templates/meridian/entries.d.ts +22 -0
- package/dist/templates/meridian/entries.d.ts.map +1 -0
- package/dist/templates/meridian/entries.js +17 -0
- package/dist/templates/meridian/meridian.css +431 -0
- package/dist/templates/modern/ModernDocument.d.ts +6 -0
- package/dist/templates/modern/ModernDocument.d.ts.map +1 -0
- package/dist/templates/modern/ModernDocument.js +29 -0
- package/dist/templates/modern/entries.d.ts +22 -0
- package/dist/templates/modern/entries.d.ts.map +1 -0
- package/dist/templates/modern/entries.js +17 -0
- package/dist/templates/modern/modern.css +309 -0
- package/dist/templates/polished/PolishedDocument.d.ts +6 -0
- package/dist/templates/polished/PolishedDocument.d.ts.map +1 -0
- package/dist/templates/polished/PolishedDocument.js +28 -0
- package/dist/templates/polished/entries.d.ts +22 -0
- package/dist/templates/polished/entries.d.ts.map +1 -0
- package/dist/templates/polished/entries.js +17 -0
- package/dist/templates/polished/polished.css +327 -0
- package/dist/templates/portrait/PortraitDocument.d.ts +6 -0
- package/dist/templates/portrait/PortraitDocument.d.ts.map +1 -0
- package/dist/templates/portrait/PortraitDocument.js +30 -0
- package/dist/templates/portrait/entries.d.ts +22 -0
- package/dist/templates/portrait/entries.d.ts.map +1 -0
- package/dist/templates/portrait/entries.js +17 -0
- package/dist/templates/portrait/portrait.css +427 -0
- package/dist/templates/prism/PrismDocument.d.ts +6 -0
- package/dist/templates/prism/PrismDocument.d.ts.map +1 -0
- package/dist/templates/prism/PrismDocument.js +35 -0
- package/dist/templates/prism/entries.d.ts +22 -0
- package/dist/templates/prism/entries.d.ts.map +1 -0
- package/dist/templates/prism/entries.js +17 -0
- package/dist/templates/prism/prism.css +314 -0
- package/dist/templates/scholar/ScholarDocument.d.ts +6 -0
- package/dist/templates/scholar/ScholarDocument.d.ts.map +1 -0
- package/dist/templates/scholar/ScholarDocument.js +27 -0
- package/dist/templates/scholar/entries.d.ts +22 -0
- package/dist/templates/scholar/entries.d.ts.map +1 -0
- package/dist/templates/scholar/entries.js +17 -0
- package/dist/templates/scholar/scholar.css +279 -0
- package/dist/templates/skills.d.ts +19 -0
- package/dist/templates/skills.d.ts.map +1 -0
- package/dist/templates/skills.js +19 -0
- package/dist/templates/split/SplitDocument.d.ts +6 -0
- package/dist/templates/split/SplitDocument.d.ts.map +1 -0
- package/dist/templates/split/SplitDocument.js +29 -0
- package/dist/templates/split/entries.d.ts +22 -0
- package/dist/templates/split/entries.d.ts.map +1 -0
- package/dist/templates/split/entries.js +17 -0
- package/dist/templates/split/split.css +337 -0
- package/dist/templates/stylish/StylishDocument.d.ts +6 -0
- package/dist/templates/stylish/StylishDocument.d.ts.map +1 -0
- package/dist/templates/stylish/StylishDocument.js +29 -0
- package/dist/templates/stylish/entries.d.ts +22 -0
- package/dist/templates/stylish/entries.d.ts.map +1 -0
- package/dist/templates/stylish/entries.js +17 -0
- package/dist/templates/stylish/stylish.css +340 -0
- package/dist/templates/timeline/TimelineDocument.d.ts +6 -0
- package/dist/templates/timeline/TimelineDocument.d.ts.map +1 -0
- package/dist/templates/timeline/TimelineDocument.js +27 -0
- package/dist/templates/timeline/entries.d.ts +22 -0
- package/dist/templates/timeline/entries.d.ts.map +1 -0
- package/dist/templates/timeline/entries.js +17 -0
- package/dist/templates/timeline/timeline.css +295 -0
- package/dist/useFitZoom.d.ts +99 -0
- package/dist/useFitZoom.d.ts.map +1 -0
- package/dist/useFitZoom.js +171 -0
- package/package.json +81 -3
- package/src/PagedSheet.tsx +792 -0
- package/src/TemplateDocument.tsx +112 -0
- package/src/autosave-context.tsx +67 -0
- package/src/collections/AuthoredItems.tsx +199 -0
- package/src/collections/Collection.tsx +73 -0
- package/src/collections/CollectionItems.tsx +318 -0
- package/src/collections/EntryOverlay.tsx +162 -0
- package/src/collections/SortableItems.tsx +167 -0
- package/src/collections/authoring-context.tsx +140 -0
- package/src/collections/entry-text.ts +41 -0
- package/src/collections/icons.tsx +83 -0
- package/src/collections/library/LibraryAction.tsx +200 -0
- package/src/collections/library/LibraryPicker.tsx +325 -0
- package/src/collections/overlay-context.tsx +49 -0
- package/src/collections/preload.ts +23 -0
- package/src/collections/selection-context.tsx +88 -0
- package/src/collections/useCollection.ts +133 -0
- package/src/collections/useCustomEntries.ts +84 -0
- package/src/collections/useSectionCollection.ts +268 -0
- package/src/compiler/emit.ts +736 -0
- package/src/compiler/schema.ts +689 -0
- package/src/export/entry.tsx +177 -0
- package/src/fields/date-issues-context.tsx +105 -0
- package/src/fields/field-registry.tsx +358 -0
- package/src/i18n/catalog.ts +81 -0
- package/src/i18n/format.ts +50 -0
- package/src/i18n/index.ts +21 -0
- package/src/i18n/locale-context.tsx +135 -0
- package/src/index.ts +156 -0
- package/src/kit/BulletSkillGroup.tsx +37 -0
- package/src/kit/DescribedEntries.tsx +132 -0
- package/src/kit/DocumentSection.tsx +97 -0
- package/src/kit/GridSkillGroup.tsx +17 -0
- package/src/kit/Heading.tsx +17 -0
- package/src/kit/InitialsAvatar.tsx +31 -0
- package/src/kit/InitialsChip.tsx +29 -0
- package/src/kit/InlineSkillGroup.tsx +41 -0
- package/src/kit/LabelledSkillGroup.tsx +68 -0
- package/src/kit/LanguageList.tsx +148 -0
- package/src/kit/Separator.tsx +30 -0
- package/src/kit/TagSkillGroup.tsx +19 -0
- package/src/kit/contact.ts +34 -0
- package/src/kit/documentStyle.ts +33 -0
- package/src/kit/monogram.ts +11 -0
- package/src/kit/textShapes.tsx +61 -0
- package/src/letter/LetterDocument.tsx +33 -0
- package/src/nodes/AuthoredBullets.tsx +253 -0
- package/src/nodes/CustomSections.tsx +138 -0
- package/src/nodes/EditableBulletList.tsx +186 -0
- package/src/nodes/EditableInlineList.tsx +109 -0
- package/src/nodes/EditableText.tsx +261 -0
- package/src/nodes/LinkField.tsx +438 -0
- package/src/nodes/PlainTextField.tsx +132 -0
- package/src/nodes/formatting.ts +58 -0
- package/src/nodes/locked.ts +67 -0
- package/src/pagination.ts +238 -0
- package/src/picture-context.tsx +18 -0
- package/src/presentation-context.tsx +87 -0
- package/src/presented.ts +29 -0
- package/src/rail/ContainerRail.tsx +145 -0
- package/src/rail/EntryActions.tsx +104 -0
- package/src/rail/rail-store.tsx +126 -0
- package/src/rail/useSpaceDrag.ts +177 -0
- package/src/registry.ts +101 -0
- package/src/spacing/spacing-context.tsx +100 -0
- package/src/spacing/useSpaceSlot.tsx +97 -0
- package/src/static/api.ts +19 -0
- package/src/static/fixtures.ts +80 -0
- package/src/static/render.tsx +24 -0
- package/src/templates/academic/AcademicDocument.tsx +255 -0
- package/src/templates/academic/entries.tsx +176 -0
- package/src/templates/alta/AltaDocument.tsx +265 -0
- package/src/templates/alta/entries.tsx +167 -0
- package/src/templates/classic/ClassicDocument.tsx +248 -0
- package/src/templates/classic/entries.tsx +175 -0
- package/src/templates/cobalt/CobaltDocument.tsx +302 -0
- package/src/templates/cobalt/crest.tsx +31 -0
- package/src/templates/cobalt/entries.tsx +136 -0
- package/src/templates/compact/CompactDocument.tsx +256 -0
- package/src/templates/compact/entries.tsx +167 -0
- package/src/templates/contemporary/ContemporaryDocument.tsx +287 -0
- package/src/templates/contemporary/entries.tsx +167 -0
- package/src/templates/creative/CreativeDocument.tsx +269 -0
- package/src/templates/creative/entries.tsx +167 -0
- package/src/templates/crimson/CrimsonDocument.tsx +283 -0
- package/src/templates/crimson/entries.tsx +169 -0
- package/src/templates/curve/CurveDocument.tsx +259 -0
- package/src/templates/curve/entries.tsx +168 -0
- package/src/templates/double-column/DoubleColumnDocument.tsx +269 -0
- package/src/templates/double-column/entries.tsx +169 -0
- package/src/templates/double-column-logos/DoubleColumnLogosDocument.tsx +262 -0
- package/src/templates/double-column-logos/entries.tsx +172 -0
- package/src/templates/elegant/ElegantDocument.tsx +297 -0
- package/src/templates/elegant/entries.tsx +167 -0
- package/src/templates/elegant-logos/ElegantLogosDocument.tsx +291 -0
- package/src/templates/elegant-logos/entries.tsx +170 -0
- package/src/templates/engineer/EngineerDocument.tsx +248 -0
- package/src/templates/engineer/entries.tsx +170 -0
- package/src/templates/executive/ExecutiveDocument.tsx +312 -0
- package/src/templates/executive/entries.tsx +146 -0
- package/src/templates/harvard/HarvardDocument.tsx +248 -0
- package/src/templates/harvard/entries.tsx +205 -0
- package/src/templates/hipster/HipsterDocument.tsx +289 -0
- package/src/templates/hipster/entries.tsx +175 -0
- package/src/templates/ivy/IvyDocument.tsx +248 -0
- package/src/templates/ivy/entries.tsx +167 -0
- package/src/templates/meridian/MeridianDocument.tsx +304 -0
- package/src/templates/meridian/entries.tsx +140 -0
- package/src/templates/modern/ModernDocument.tsx +265 -0
- package/src/templates/modern/entries.tsx +167 -0
- package/src/templates/polished/PolishedDocument.tsx +262 -0
- package/src/templates/polished/entries.tsx +167 -0
- package/src/templates/portrait/PortraitDocument.tsx +278 -0
- package/src/templates/portrait/entries.tsx +173 -0
- package/src/templates/prism/PrismDocument.tsx +307 -0
- package/src/templates/prism/entries.tsx +175 -0
- package/src/templates/scholar/ScholarDocument.tsx +266 -0
- package/src/templates/scholar/entries.tsx +169 -0
- package/src/templates/skills.ts +21 -0
- package/src/templates/split/SplitDocument.tsx +293 -0
- package/src/templates/split/entries.tsx +164 -0
- package/src/templates/stylish/StylishDocument.tsx +265 -0
- package/src/templates/stylish/entries.tsx +167 -0
- package/src/templates/timeline/TimelineDocument.tsx +251 -0
- package/src/templates/timeline/entries.tsx +173 -0
- package/src/useFitZoom.ts +185 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { GripIcon, PlusIcon, TrashIcon } from '../collections/icons.js';
|
|
4
|
+
import { SortableItems, useDragHandle } from '../collections/SortableItems.js';
|
|
5
|
+
import { useEditorText } from '../i18n/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* One bullet: its text, its grip, and its two controls.
|
|
8
|
+
*
|
|
9
|
+
* The grip stands **in the marker's column**. A bullet's first column is the
|
|
10
|
+
* marker gutter — every template draws a `•` there — and on hover the marker
|
|
11
|
+
* gives that space up to the handle rather than the handle finding space of its
|
|
12
|
+
* own. So the row does not grow, nothing to the right of it shifts, and the
|
|
13
|
+
* affordance appears exactly where the eye already is.
|
|
14
|
+
*
|
|
15
|
+
* Vertically it is centred on the whole bullet rather than sitting on the first
|
|
16
|
+
* baseline where the marker sits: it is the handle for the row, and on a bullet
|
|
17
|
+
* that wraps to three lines a top-aligned handle reads as belonging to the first
|
|
18
|
+
* of them.
|
|
19
|
+
*
|
|
20
|
+
* Add and remove sit in the page's right margin, out of the document's flow,
|
|
21
|
+
* and appear on the same hover. Both were previously shown whenever the list was
|
|
22
|
+
* selected, which meant a candidate had to click a bullet before learning it
|
|
23
|
+
* could be added to.
|
|
24
|
+
*/
|
|
25
|
+
function Bullet({ index, item, path, bullets, editing, onEdit, sortable, placeholder, onActivate, fieldRef, }) {
|
|
26
|
+
const { handleProps, setNodeRef, style } = useDragHandle(`${path}:${index}`, !sortable);
|
|
27
|
+
const refusal = bullets.removeReason(index);
|
|
28
|
+
const { t, format } = useEditorText();
|
|
29
|
+
const position = { position: index + 1 };
|
|
30
|
+
return (_jsxs("li", { className: "tpl-bullet", "data-authored": true,
|
|
31
|
+
/*
|
|
32
|
+
* Which bullet the caret belongs in. A bullet list is ONE editor node, so
|
|
33
|
+
* selecting it turns every bullet into a field in the same render — and
|
|
34
|
+
* without this, which of them ends up focused is left to the order the
|
|
35
|
+
* browser happens to deliver the events in.
|
|
36
|
+
*/
|
|
37
|
+
onPointerDown: () => onActivate(index), ref: sortable ? setNodeRef : undefined, style: sortable ? style : undefined, children: [_jsx("button", { type: "button", className: "tpl-bullet__grip", "data-chrome": true, title: t.bullets.drag, "aria-label": format(t.bullets.moveLabel, position), ...(sortable ? handleProps : {}), children: _jsx(GripIcon, {}) }), editing ? (_jsx("span", { className: "tpl-text tpl-grow", "data-value": item, children: _jsx("textarea", { className: "tpl-input", ref: (el) => fieldRef(index, el), value: item, rows: 1, "aria-label": `${path}.${index}`,
|
|
38
|
+
/*
|
|
39
|
+
* The guidance survives the click into the field.
|
|
40
|
+
*
|
|
41
|
+
* The row draws it while the bullet is at rest, and this is the
|
|
42
|
+
* same sentence for the state where that drawing is replaced by a
|
|
43
|
+
* control — otherwise clicking an empty bullet to find out what
|
|
44
|
+
* goes in it removes the only thing that said. A textarea's own
|
|
45
|
+
* `placeholder` is painted by the browser and is never part of the
|
|
46
|
+
* value, so it stays out of the résumé exactly as the drawn one
|
|
47
|
+
* does.
|
|
48
|
+
*/
|
|
49
|
+
placeholder: placeholder, onChange: (e) => onEdit(index, e.target.value) }) })) : (_jsx("span", { className: "tpl-text", "data-empty": item.length === 0 || undefined, "data-placeholder": placeholder, children: item })), _jsxs("span", { className: "tpl-bullet__tools", "data-chrome": true, contentEditable: false, children: [_jsx("button", { type: "button", className: "tpl-tool", title: t.bullets.addBelow, "aria-label": format(t.bullets.addAfterLabel, position), onClick: () => bullets.add(index), children: _jsx(PlusIcon, {}) }), _jsx("button", { type: "button", className: "tpl-tool", "data-tone": "danger", disabled: refusal !== undefined,
|
|
50
|
+
/*
|
|
51
|
+
* Disabled and explained rather than hidden: a rule the candidate
|
|
52
|
+
* cannot see is a rule they run into. The words are the collection's,
|
|
53
|
+
* not this component's.
|
|
54
|
+
*/
|
|
55
|
+
title: refusal ?? t.bullets.remove, "aria-label": format(t.bullets.removeLabel, position), onClick: () => bullets.remove(index), children: _jsx(TrashIcon, {}) })] })] }));
|
|
56
|
+
}
|
|
57
|
+
export default function AuthoredBullets({ path, items, bullets, editing, onEdit, placeholder, }) {
|
|
58
|
+
const sortable = bullets.canMove;
|
|
59
|
+
const ids = items.map((_, index) => `${path}:${index}`);
|
|
60
|
+
/* The bullet the candidate pointed at, and the fields to put the caret in. */
|
|
61
|
+
const [caret, setCaret] = useState(null);
|
|
62
|
+
const fields = useRef({});
|
|
63
|
+
/* Read by the ref callback below, which runs during a commit and would
|
|
64
|
+
otherwise close over the caret this render happened to start with. */
|
|
65
|
+
const wanted = useRef(caret);
|
|
66
|
+
wanted.current = caret;
|
|
67
|
+
/*
|
|
68
|
+
* `preventScroll`, for the reason `PlainTextField` gives: the bullet was
|
|
69
|
+
* pointed at, so it is already on screen, and focusing it must not move the
|
|
70
|
+
* page. Inside the sheet's `zoom` the browser's own idea of where it is
|
|
71
|
+
* scrolling to is wrong by a factor of it, so "reveal the focused element"
|
|
72
|
+
* threw the line the candidate had just clicked out of view.
|
|
73
|
+
*/
|
|
74
|
+
const putCaretIn = (field) => field?.focus({ preventScroll: true });
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!editing || caret === null)
|
|
77
|
+
return;
|
|
78
|
+
putCaretIn(fields.current[caret]);
|
|
79
|
+
}, [editing, caret]);
|
|
80
|
+
const rows = items.map((item, index) => (_jsx(Bullet
|
|
81
|
+
// Bullets have no identity of their own — they are strings the candidate
|
|
82
|
+
// reorders and deletes — so the index is the only honest key.
|
|
83
|
+
, { index: index, item: item, path: path, bullets: bullets, editing: editing, onEdit: onEdit, placeholder: placeholder, sortable: sortable, onActivate: setCaret, fieldRef: (i, el) => {
|
|
84
|
+
fields.current[i] = el;
|
|
85
|
+
/*
|
|
86
|
+
* And focused as it ARRIVES, not only when the caret moves.
|
|
87
|
+
*
|
|
88
|
+
* A click both selects the list and names the bullet, so the field is
|
|
89
|
+
* mounted by the same commit that sets the caret — but the row can be
|
|
90
|
+
* mounted again straight after, when the click that revealed it also
|
|
91
|
+
* selects the entry around it. The effect above does not run a second
|
|
92
|
+
* time (neither `editing` nor `caret` has changed), so the focus it
|
|
93
|
+
* placed went out with the old element and the candidate typed into
|
|
94
|
+
* nothing. Re-placing it here costs a call on a field that already has
|
|
95
|
+
* it and closes the gap the timing opened.
|
|
96
|
+
*/
|
|
97
|
+
if (el && i === wanted.current)
|
|
98
|
+
putCaretIn(el);
|
|
99
|
+
} }, index)));
|
|
100
|
+
return sortable ? (_jsx(SortableItems, { ids: ids, onMove: bullets.move, children: rows })) : (_jsx(_Fragment, { children: rows }));
|
|
101
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { CustomEntry, CustomSection } from '@resumekit/schema';
|
|
3
|
+
import { type HeadingLead } from '../kit/textShapes.js';
|
|
4
|
+
import { type ItemRootProps } from '../collections/CollectionItems.js';
|
|
5
|
+
/** What every template supplies for one entry of a candidate's own section. */
|
|
6
|
+
export type CustomEntryComponent = ComponentType<{
|
|
7
|
+
item: CustomEntry;
|
|
8
|
+
path: string;
|
|
9
|
+
chrome: ReactNode;
|
|
10
|
+
itemProps: ItemRootProps;
|
|
11
|
+
}>;
|
|
12
|
+
export interface CustomSectionsProps {
|
|
13
|
+
sections: readonly CustomSection[] | undefined;
|
|
14
|
+
/** The template's own section wrapper class. */
|
|
15
|
+
sectionClass: string;
|
|
16
|
+
/** The template's own heading class, so the heading matches its neighbours. */
|
|
17
|
+
headingClass: string;
|
|
18
|
+
/**
|
|
19
|
+
* The template's own entry markup.
|
|
20
|
+
*
|
|
21
|
+
* This is what removed the neutral layout. The original note here explained
|
|
22
|
+
* that borrowing one template's entry markup "would render as debris in the
|
|
23
|
+
* other three" — true while entry markup was inline in a document's JSX, and
|
|
24
|
+
* false now that each template names a component for it. A candidate's own
|
|
25
|
+
* section is set in the same pattern as the sections above it.
|
|
26
|
+
*/
|
|
27
|
+
Entry: CustomEntryComponent;
|
|
28
|
+
/** As `DocumentSection`'s. */
|
|
29
|
+
headingLead?: HeadingLead;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The sections a candidate added, rendered in whichever template is mounted.
|
|
33
|
+
*
|
|
34
|
+
* Every field is a Craft.js linked node addressed by its DOMAIN path, exactly
|
|
35
|
+
* as the writer-produced fields are, so `serialize.ts` reads them with the walk
|
|
36
|
+
* it already has and nothing here needs to know a custom section is special.
|
|
37
|
+
*
|
|
38
|
+
* Nothing is a canvas and nothing takes a drag connector: an authored section
|
|
39
|
+
* is as locked as a written one.
|
|
40
|
+
*/
|
|
41
|
+
export declare function CustomSections({ sections, sectionClass, headingClass, headingLead, Entry, }: CustomSectionsProps): import("react").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=CustomSections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomSections.d.ts","sourceRoot":"","sources":["../../src/nodes/CustomSections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIpE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,mCAAmC,CAAC;AAG3C,+EAA+E;AAC/E,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC;IAC/C,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,WAAW,mBAAmB;IAWlC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,CAAC;IAC/C,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;;;OAQG;IACH,KAAK,EAAE,oBAAoB,CAAC;IAC5B,8BAA8B;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAyDD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,KAAK,GACN,EAAE,mBAAmB,+BAgBrB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEditorText } from '../i18n/index.js';
|
|
3
|
+
import { EditableText } from './EditableText.js';
|
|
4
|
+
import { Heading } from '../kit/Heading.js';
|
|
5
|
+
import { leadLetters } from '../kit/textShapes.js';
|
|
6
|
+
import { CollectionItems, } from '../collections/CollectionItems.js';
|
|
7
|
+
import { useCustomEntries } from '../collections/useCustomEntries.js';
|
|
8
|
+
/** One declared section: the template's heading, the template's entries. */
|
|
9
|
+
function AuthoredSection({ section, index, sectionClass, headingClass, headingLead, Entry, }) {
|
|
10
|
+
const collection = useCustomEntries(section.id, section.entries);
|
|
11
|
+
const { t } = useEditorText();
|
|
12
|
+
const base = `custom_sections.${index}`;
|
|
13
|
+
return (_jsxs("section", { className: sectionClass, children: [_jsx(Heading, { level: 2, className: headingClass, "data-block": true, "data-keep-with-next": true, children: _jsx(EditableText, { path: `${base}.heading`, value: section.heading, placeholder: t.placeholders.heading, shape: headingLead && leadLetters(headingLead) }) }), _jsx(CollectionItems, { collection: collection, basePath: `${base}.entries`, noun: "entry", label: section.heading || t.customSection, children: ({ item, path, chrome, itemProps }) => (_jsx(Entry, { item: item, path: path, chrome: chrome, itemProps: itemProps })) })] }));
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The sections a candidate added, rendered in whichever template is mounted.
|
|
17
|
+
*
|
|
18
|
+
* Every field is a Craft.js linked node addressed by its DOMAIN path, exactly
|
|
19
|
+
* as the writer-produced fields are, so `serialize.ts` reads them with the walk
|
|
20
|
+
* it already has and nothing here needs to know a custom section is special.
|
|
21
|
+
*
|
|
22
|
+
* Nothing is a canvas and nothing takes a drag connector: an authored section
|
|
23
|
+
* is as locked as a written one.
|
|
24
|
+
*/
|
|
25
|
+
export function CustomSections({ sections = [], sectionClass, headingClass, headingLead, Entry, }) {
|
|
26
|
+
return (_jsx(_Fragment, { children: sections.map((section, i) => (_jsx(AuthoredSection, { section: section, index: i, sectionClass: sectionClass, headingClass: headingClass, headingLead: headingLead, Entry: Entry }, section.id))) }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface EditableBulletListProps {
|
|
2
|
+
/**
|
|
3
|
+
* What an empty row says it wants.
|
|
4
|
+
*
|
|
5
|
+
* A list of achievements and a list of skills are the same control and not
|
|
6
|
+
* the same field: a skills row guided by "what you did, and what changed
|
|
7
|
+
* because of it" asks for a sentence where the page wants a keyword.
|
|
8
|
+
*/
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
/** Where this list lives in the `ResumeObject` — e.g. `experience.0.bullets`. */
|
|
11
|
+
path: string;
|
|
12
|
+
items: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function EditableBulletList({ path, items, placeholder: givenPlaceholder, }: EditableBulletListProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=EditableBulletList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditableBulletList.d.ts","sourceRoot":"","sources":["../../src/nodes/EditableBulletList.tsx"],"names":[],"mappings":"AAeA,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AA+BD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,WAAW,EAAE,gBAAgB,GAC9B,EAAE,uBAAuB,+BA2HzB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, lazy, useMemo } from 'react';
|
|
3
|
+
import { useField } from '../fields/field-registry.js';
|
|
4
|
+
import { formatClass, formatInk, inkAttr } from './formatting.js';
|
|
5
|
+
import { useFieldFormat } from '../presentation-context.js';
|
|
6
|
+
import { movedTo, useCollection, } from '../collections/useCollection.js';
|
|
7
|
+
import { useAuthoring } from '../collections/authoring-context.js';
|
|
8
|
+
import { useAutosave } from '../autosave-context.js';
|
|
9
|
+
import { useEditorText } from '../i18n/index.js';
|
|
10
|
+
import { usePicture } from '../picture-context.js';
|
|
11
|
+
/**
|
|
12
|
+
* A list of bullets, and the same collection rules everything else obeys.
|
|
13
|
+
*
|
|
14
|
+
* A bullet rewords work the résumé already claims, so retyping it is the
|
|
15
|
+
* candidate speaking about their own experience.
|
|
16
|
+
*
|
|
17
|
+
* What is different here is only the STORE. A bullet is text, and text lives in
|
|
18
|
+
* the editor's own node props — so add, remove and move write there rather than
|
|
19
|
+
* into the presentation overlay, where an appended entry lives. Every rule
|
|
20
|
+
* around them (that a list has a minimum, what the refusal says when it is
|
|
21
|
+
* reached, what a move means) comes from `useCollection`, which is the same
|
|
22
|
+
* source `experience` and `education` read. Before `document-collections` (#57)
|
|
23
|
+
* those rules were written out again here, and the minimum was a constant this
|
|
24
|
+
* file owned.
|
|
25
|
+
*
|
|
26
|
+
* Its controls live in `AuthoredBullets`, reached through a dynamic import, so
|
|
27
|
+
* a document that is only being read carries neither them nor the drag library
|
|
28
|
+
* they use. What is left here is the list itself, which is the same list either
|
|
29
|
+
* way.
|
|
30
|
+
*/
|
|
31
|
+
/*
|
|
32
|
+
* Loaded on demand — see `AuthoredBullets`. The read-only fallback below is
|
|
33
|
+
* rendered until it arrives, so the bullets are on screen before their controls
|
|
34
|
+
* rather than after them.
|
|
35
|
+
*/
|
|
36
|
+
const AuthoredBullets = lazy(() => import('./AuthoredBullets.js'));
|
|
37
|
+
export function EditableBulletList({ path, items, placeholder: givenPlaceholder, }) {
|
|
38
|
+
const { t } = useEditorText();
|
|
39
|
+
const placeholder = givenPlaceholder ?? t.placeholders.bullet;
|
|
40
|
+
const format = useFieldFormat(path);
|
|
41
|
+
const picture = usePicture();
|
|
42
|
+
const authoring = useAuthoring();
|
|
43
|
+
/*
|
|
44
|
+
* Only the TEXT is asked for here. Adding, removing and reordering a bullet
|
|
45
|
+
* are stored by `useCollection`, which is where all three actually happen —
|
|
46
|
+
* this component would be a second, drifting opinion about the same events.
|
|
47
|
+
* What it owns is the one thing `useCollection` cannot see: a keystroke.
|
|
48
|
+
*/
|
|
49
|
+
const { saveSoon } = useAutosave();
|
|
50
|
+
const { value: live, editing, selected, select, set } = useField(path, items);
|
|
51
|
+
/*
|
|
52
|
+
* COPIES, where this used to `splice` an Immer draft inside `setProp`.
|
|
53
|
+
*
|
|
54
|
+
* That draft was the one place Craft's Immer integration was load-bearing
|
|
55
|
+
* rather than incidental, and it is the line to read twice in this file: a
|
|
56
|
+
* mutating call was correct there because nothing outside `setProp` ever
|
|
57
|
+
* touched those props. Here the value is ordinary state, so a mutation would
|
|
58
|
+
* be a mutation — the array is rebuilt instead, which is what React expects
|
|
59
|
+
* and what makes an edit and a reorder the same kind of operation.
|
|
60
|
+
*/
|
|
61
|
+
const store = useMemo(() => ({
|
|
62
|
+
items: live,
|
|
63
|
+
insert: (index, item) => set([...live.slice(0, index), item, ...live.slice(index)]),
|
|
64
|
+
removeAt: (index) => set(live.filter((_, at) => at !== index)),
|
|
65
|
+
reorder: (from, to) => set(movedTo([...live], from, to)),
|
|
66
|
+
}), [live, set]);
|
|
67
|
+
const bullets = useCollection('experience_bullets', store);
|
|
68
|
+
/*
|
|
69
|
+
* One empty bullet, drawn but not STORED, for a list that has none.
|
|
70
|
+
*
|
|
71
|
+
* An entry with no bullets rendered an empty `<ul>`: nothing on the page, and
|
|
72
|
+
* every control that adds or edits a bullet hangs off a bullet ROW, so the
|
|
73
|
+
* list a candidate needed to start was the one thing they could not reach.
|
|
74
|
+
* A minted role carries a bullet for this reason; an entry the writer
|
|
75
|
+
* produced without one, or an authored section's first entry, does not.
|
|
76
|
+
*
|
|
77
|
+
* Drawn rather than stored, because storing it would put an empty bullet into
|
|
78
|
+
* every such entry the moment the editor opened — a change to the document
|
|
79
|
+
* that the candidate did not make and would have to undo. It becomes real on
|
|
80
|
+
* the first keystroke, which is the moment they meant it.
|
|
81
|
+
*
|
|
82
|
+
* Only while AUTHORING. A document being read has nothing to fill in, and an
|
|
83
|
+
* empty `<li>` under a role is a bullet in the exported file.
|
|
84
|
+
*/
|
|
85
|
+
const guided = authoring !== null && live.length === 0;
|
|
86
|
+
const shown = guided ? [''] : live;
|
|
87
|
+
const edit = (index, next) => {
|
|
88
|
+
/* The guide row has no entry behind it yet, so typing into it CREATES the
|
|
89
|
+
list rather than replacing a member of an empty one — `map` over `[]`
|
|
90
|
+
yields `[]`, and the first thing typed would be dropped. */
|
|
91
|
+
set(guided ? [next] : live.map((item, at) => (at === index ? next : item)));
|
|
92
|
+
saveSoon();
|
|
93
|
+
};
|
|
94
|
+
/* A press selects the field — Craft's `connect` used to attach this. */
|
|
95
|
+
const onMouseDown = editing ? () => select() : undefined;
|
|
96
|
+
const plain = shown.map((item, index) => (_jsx("li", { className: "tpl-bullet", children: _jsx("span", { className: "tpl-text", "data-empty": item.length === 0 || undefined, "data-placeholder": picture ? undefined : placeholder, children: item }) }, index)));
|
|
97
|
+
return (_jsx("ul", { onMouseDown: onMouseDown, className: formatClass(format, 'tpl-bullets'), style: formatInk(format), "data-ink": inkAttr(format), "data-path": picture ? undefined : path, "data-editing": selected || undefined, children: authoring ? (_jsx(Suspense, { fallback: plain, children: _jsx(AuthoredBullets, { path: path, items: shown, bullets: bullets, editing: selected, onEdit: edit, placeholder: placeholder }) })) : (plain) }));
|
|
98
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface EditableInlineListProps {
|
|
2
|
+
/** Where this list lives in the `ResumeObject` — e.g. `skills.0.items`. */
|
|
3
|
+
path: string;
|
|
4
|
+
items: string[];
|
|
5
|
+
/**
|
|
6
|
+
* Shown while the list is empty. Never saved — the same bargain
|
|
7
|
+
* `EditableText` makes, and drawn the same way, by CSS.
|
|
8
|
+
*
|
|
9
|
+
* Not optional in practice, whatever the type says. An empty inline list has
|
|
10
|
+
* no text, and a span with no text has no width: a skills group the candidate
|
|
11
|
+
* had just added drew its category, a colon, and then nothing — no visible
|
|
12
|
+
* field, and nothing with an area to click on. The guidance is what gives an
|
|
13
|
+
* empty list a body.
|
|
14
|
+
*/
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A keyword list rendered inline — `Node.js, TypeScript, NestJS` — which is how
|
|
19
|
+
* the knowledge base says skills belong on a resume: a flat comma-separated
|
|
20
|
+
* list, no rating bars, no years-per-skill, no grid.
|
|
21
|
+
*
|
|
22
|
+
* While it is being edited the raw text is held locally and the split array is
|
|
23
|
+
* written through to the node on every keystroke. Deriving the displayed text
|
|
24
|
+
* from the array instead would delete the comma the moment it was typed.
|
|
25
|
+
*/
|
|
26
|
+
export declare function EditableInlineList({ path, items, placeholder, }: EditableInlineListProps): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=EditableInlineList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditableInlineList.d.ts","sourceRoot":"","sources":["../../src/nodes/EditableInlineList.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,uBAAuB;IACtC,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAYD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,WAAW,GACZ,EAAE,uBAAuB,+BA4DzB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useField } from '../fields/field-registry.js';
|
|
4
|
+
import { formatClass, formatInk, inkAttr } from './formatting.js';
|
|
5
|
+
import { useFieldFormat } from '../presentation-context.js';
|
|
6
|
+
import { useAutosave } from '../autosave-context.js';
|
|
7
|
+
import { PlainTextField } from './PlainTextField.js';
|
|
8
|
+
import { usePicture } from '../picture-context.js';
|
|
9
|
+
/** How a keyword list reads on the page, and how the candidate types it. */
|
|
10
|
+
const SEPARATOR = ', ';
|
|
11
|
+
function split(text) {
|
|
12
|
+
return text
|
|
13
|
+
.split(',')
|
|
14
|
+
.map((item) => item.trim())
|
|
15
|
+
.filter((item) => item.length > 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A keyword list rendered inline — `Node.js, TypeScript, NestJS` — which is how
|
|
19
|
+
* the knowledge base says skills belong on a resume: a flat comma-separated
|
|
20
|
+
* list, no rating bars, no years-per-skill, no grid.
|
|
21
|
+
*
|
|
22
|
+
* While it is being edited the raw text is held locally and the split array is
|
|
23
|
+
* written through to the node on every keystroke. Deriving the displayed text
|
|
24
|
+
* from the array instead would delete the comma the moment it was typed.
|
|
25
|
+
*/
|
|
26
|
+
export function EditableInlineList({ path, items, placeholder, }) {
|
|
27
|
+
const format = useFieldFormat(path);
|
|
28
|
+
const picture = usePicture();
|
|
29
|
+
const { value, editing, selected, select, set } = useField(path, items);
|
|
30
|
+
/* Typing, so deferred — the same bargain `EditableText` makes. */
|
|
31
|
+
const { saveSoon } = useAutosave();
|
|
32
|
+
/*
|
|
33
|
+
* The raw text, held locally while it is being typed.
|
|
34
|
+
*
|
|
35
|
+
* Deriving the displayed text from the array instead would delete the comma
|
|
36
|
+
* the moment it was typed. The field itself is uncontrolled — see
|
|
37
|
+
* `PlainTextField` — so this is only what the UNSELECTED text is read from
|
|
38
|
+
* once the candidate leaves.
|
|
39
|
+
*/
|
|
40
|
+
const [buffer, setBuffer] = useState(null);
|
|
41
|
+
const text = buffer ?? value.join(SEPARATOR);
|
|
42
|
+
const change = (next) => {
|
|
43
|
+
setBuffer(next);
|
|
44
|
+
set(split(next));
|
|
45
|
+
saveSoon();
|
|
46
|
+
};
|
|
47
|
+
/* A press selects the field — Craft's `connect` used to attach this. */
|
|
48
|
+
const onMouseDown = editing ? () => select() : undefined;
|
|
49
|
+
return (_jsx("span", { onMouseDown: onMouseDown, className: formatClass(format, 'tpl-text'), style: formatInk(format), "data-ink": inkAttr(format), "data-empty": (!selected && text.length === 0) || undefined, "data-placeholder": picture ? undefined : placeholder, "data-path": picture ? undefined : path, children: selected ? (_jsx(PlainTextField, { value: text, placeholder: placeholder, label: path, onChange: change })) : (text) }));
|
|
50
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { TextShape } from '../kit/textShapes.js';
|
|
2
|
+
export interface EditableTextProps {
|
|
3
|
+
/** Where this text lives in the `ResumeObject` — e.g. `experience.0.title`. */
|
|
4
|
+
path: string;
|
|
5
|
+
value: string;
|
|
6
|
+
/** Shown when the writer had nothing for this field. Never saved. */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the text wraps. A content property, not a style one: the summary is
|
|
10
|
+
* a paragraph and a job title is a line, and that is true in every template.
|
|
11
|
+
*/
|
|
12
|
+
multiline?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Where this text points, supplied by the DOCUMENT rather than by the
|
|
15
|
+
* candidate's formatting.
|
|
16
|
+
*
|
|
17
|
+
* The résumé already carries `links[]` — a label and a URL — and the templates
|
|
18
|
+
* rendered the label as dead text, so "GitHub" reached an employer as a word
|
|
19
|
+
* they had to retype. This is that URL, and it is now the only way a link is
|
|
20
|
+
* MADE: the rail's per-field `href` control is gone, because a link is content
|
|
21
|
+
* and two homes for one fact is what the ranking below exists to paper over.
|
|
22
|
+
* A stored `format.href` is still read, for a document formatted while that
|
|
23
|
+
* control existed.
|
|
24
|
+
*/
|
|
25
|
+
href?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether this text is typed into HERE.
|
|
28
|
+
*
|
|
29
|
+
* `false` — the default — is every ordinary field: pressing it places a caret
|
|
30
|
+
* in it. `true` registers the field and draws its text exactly as before, and
|
|
31
|
+
* refuses the caret, because the value is set by a control of its own.
|
|
32
|
+
*
|
|
33
|
+
* One caller: a link. A link is a text and an address, and only one of the
|
|
34
|
+
* two is on the page — so typing into the visible half would let a candidate
|
|
35
|
+
* write a label with no way to see or reach what it points at. The document
|
|
36
|
+
* still needs the text to BE a field, though: it is what the save collects
|
|
37
|
+
* and what carries the anchor, and a span outside the registry is neither.
|
|
38
|
+
*
|
|
39
|
+
* So it is not "an input that is disabled". It is the document's own text,
|
|
40
|
+
* which happens to be edited somewhere else — and pressing it is how a
|
|
41
|
+
* candidate gets to that somewhere else, which is the wrapper's business and
|
|
42
|
+
* not this component's.
|
|
43
|
+
*/
|
|
44
|
+
readOnly?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* What this text says when the candidate has written nothing — the
|
|
47
|
+
* template's own word, not guidance.
|
|
48
|
+
*
|
|
49
|
+
* Distinct from `placeholder`, and the difference is the whole point: a
|
|
50
|
+
* placeholder is never stored, never exported and never extractable, while
|
|
51
|
+
* this PRINTS. A section heading is the case — "Experience" is on the page of
|
|
52
|
+
* a résumé nobody has renamed — and declaring it keeps merely opening the
|
|
53
|
+
* document from reading as an edit. See `FieldRegistry.defaults`.
|
|
54
|
+
*/
|
|
55
|
+
defaultValue?: string;
|
|
56
|
+
/**
|
|
57
|
+
* How the printed text is divided into spans a stylesheet can set apart — a
|
|
58
|
+
* surname in bold, a heading's first letters in the accent (`kit/textShapes`).
|
|
59
|
+
*
|
|
60
|
+
* Applied wherever the text is drawn, so the editor and the page agree; not
|
|
61
|
+
* while the field is being typed into, where it is one plain run in the
|
|
62
|
+
* field's own style. The characters never change.
|
|
63
|
+
*/
|
|
64
|
+
shape?: TextShape;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* One editable string in a template.
|
|
68
|
+
*
|
|
69
|
+
* Unselected it is ordinary document text — semantic, selectable, copyable, and
|
|
70
|
+
* exactly what prints. Selected it becomes a borderless field **in the same
|
|
71
|
+
* box**: `font`, `line-height`, `padding` and `border` are all inherited or
|
|
72
|
+
* zeroed, so nothing on the page moves when the candidate clicks into it.
|
|
73
|
+
*
|
|
74
|
+
* The wrapping variant grows with its content through the grid + `::after`
|
|
75
|
+
* mirror in `template-node.css` rather than through measured `scrollHeight`,
|
|
76
|
+
* which means the field cannot be one pixel off from the text it replaced.
|
|
77
|
+
*/
|
|
78
|
+
export declare function EditableText({ path, value: given, placeholder, multiline, href, readOnly, defaultValue, shape, }: EditableTextProps): import("react").JSX.Element;
|
|
79
|
+
//# sourceMappingURL=EditableText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditableText.d.ts","sourceRoot":"","sources":["../../src/nodes/EditableText.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAK,EAAE,KAAK,EACZ,WAAW,EACX,SAAS,EACT,IAAI,EACJ,QAAgB,EAChB,YAAY,EACZ,KAAK,GACN,EAAE,iBAAiB,+BAmKnB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isSafeLinkTarget } from '@resumekit/schema';
|
|
3
|
+
import { useField } from '../fields/field-registry.js';
|
|
4
|
+
import { formatClass, formatInk, inkAttr } from './formatting.js';
|
|
5
|
+
import { useFieldFormat } from '../presentation-context.js';
|
|
6
|
+
import { PlainTextField } from './PlainTextField.js';
|
|
7
|
+
import { useAutosave } from '../autosave-context.js';
|
|
8
|
+
import { useDateIssue } from '../fields/date-issues-context.js';
|
|
9
|
+
import { useEditorText } from '../i18n/index.js';
|
|
10
|
+
import { usePicture } from '../picture-context.js';
|
|
11
|
+
/**
|
|
12
|
+
* One editable string in a template.
|
|
13
|
+
*
|
|
14
|
+
* Unselected it is ordinary document text — semantic, selectable, copyable, and
|
|
15
|
+
* exactly what prints. Selected it becomes a borderless field **in the same
|
|
16
|
+
* box**: `font`, `line-height`, `padding` and `border` are all inherited or
|
|
17
|
+
* zeroed, so nothing on the page moves when the candidate clicks into it.
|
|
18
|
+
*
|
|
19
|
+
* The wrapping variant grows with its content through the grid + `::after`
|
|
20
|
+
* mirror in `template-node.css` rather than through measured `scrollHeight`,
|
|
21
|
+
* which means the field cannot be one pixel off from the text it replaced.
|
|
22
|
+
*/
|
|
23
|
+
export function EditableText({ path, value: given, placeholder, multiline, href, readOnly = false, defaultValue, shape, }) {
|
|
24
|
+
// Read live, so a formatting change shows the instant it is made — a field's
|
|
25
|
+
// value is the text, and only the text.
|
|
26
|
+
const format = useFieldFormat(path);
|
|
27
|
+
const picture = usePicture();
|
|
28
|
+
/*
|
|
29
|
+
* The field, by its path in the résumé.
|
|
30
|
+
*
|
|
31
|
+
* `editing` decides what a click on a link means. In the editor a click must
|
|
32
|
+
* select the field — following the link would navigate away from the document
|
|
33
|
+
* the candidate is working on. In a read-only preview there is nothing to
|
|
34
|
+
* select, so the link behaves like a link. The anchor is in the DOM either
|
|
35
|
+
* way, which is what matters for the export: printing emits a Link annotation
|
|
36
|
+
* from the markup, not from the click handler.
|
|
37
|
+
*/
|
|
38
|
+
const { value, editing, selected, select, set } = useField(path, given, defaultValue);
|
|
39
|
+
/*
|
|
40
|
+
* Typing, so the DEFERRED request: this fires per character, and a field that
|
|
41
|
+
* stored itself on every keystroke would send one write per letter of a job
|
|
42
|
+
* title. `saveSoon` coalesces the burst into the one write the candidate
|
|
43
|
+
* actually meant — the sentence they finished.
|
|
44
|
+
*/
|
|
45
|
+
const { saveSoon } = useAutosave();
|
|
46
|
+
/*
|
|
47
|
+
* Whether this field's date disagrees with the résumé's chronological order.
|
|
48
|
+
*
|
|
49
|
+
* Asked BY PATH, which is the address the field already knows itself by — so
|
|
50
|
+
* no template passes anything, and a template added later is covered without
|
|
51
|
+
* being told. Undefined everywhere the provider is not mounted, which is the
|
|
52
|
+
* read-only preview and the export renderer: the marker is editor chrome and
|
|
53
|
+
* must never print.
|
|
54
|
+
*/
|
|
55
|
+
const dateIssue = useDateIssue(path);
|
|
56
|
+
const { t } = useEditorText();
|
|
57
|
+
const dateWarning = dateIssue ? t.dateIssues[dateIssue] : undefined;
|
|
58
|
+
const change = (next) => {
|
|
59
|
+
// A line stays a line. Pasting three lines of a signature block into a job
|
|
60
|
+
// title should give a job title, not a résumé with a hole in it.
|
|
61
|
+
set(multiline ? next : next.replace(/\s*\n\s*/g, ' '));
|
|
62
|
+
saveSoon();
|
|
63
|
+
};
|
|
64
|
+
/*
|
|
65
|
+
* A press selects the field. Craft's `connect` used to attach this; without
|
|
66
|
+
* it the element is ordinary markup and has to say so itself.
|
|
67
|
+
*
|
|
68
|
+
* `mousedown` rather than `click`, and NOT prevented: the browser places the
|
|
69
|
+
* caret where the candidate pressed, and this puts the field in the state
|
|
70
|
+
* where that caret is inside a real editable box.
|
|
71
|
+
*/
|
|
72
|
+
const onMouseDown = editing && !readOnly ? () => select() : undefined;
|
|
73
|
+
/*
|
|
74
|
+
* A read-only field never enters the typing state, even if something else
|
|
75
|
+
* selected it. Checked here rather than trusted to the handler above: the
|
|
76
|
+
* selection is document-wide and settable by any caller, and "this text is
|
|
77
|
+
* not typed into" is a property of the field rather than of one press.
|
|
78
|
+
*/
|
|
79
|
+
if (!selected || readOnly) {
|
|
80
|
+
/*
|
|
81
|
+
* The value, and ONLY the value.
|
|
82
|
+
*
|
|
83
|
+
* The placeholder used to stand in here when the field was empty, and it
|
|
84
|
+
* was a real text node — so "Degree", "Field of study" and "YYYY-MM" were
|
|
85
|
+
* painted into the exported PDF and extracted by anything reading it. A
|
|
86
|
+
* résumé that tells a screening system the candidate's degree is "Degree"
|
|
87
|
+
* is worse than one that omits the line.
|
|
88
|
+
*
|
|
89
|
+
* It is drawn by CSS now instead: guidance for a candidate looking at an
|
|
90
|
+
* editor, switched off for the read-only document and for paper, and never
|
|
91
|
+
* part of the text at all.
|
|
92
|
+
*/
|
|
93
|
+
const text = shape && value.length > 0 ? shape(value) : value;
|
|
94
|
+
/*
|
|
95
|
+
* The résumé's own link wins over a candidate-applied one: a `links[]` entry
|
|
96
|
+
* IS the address for that field, and a format that disagreed with it would
|
|
97
|
+
* be two answers to one question.
|
|
98
|
+
*/
|
|
99
|
+
const raw = href ?? format?.href;
|
|
100
|
+
const target = raw && isSafeLinkTarget(raw) ? raw : undefined;
|
|
101
|
+
return (_jsx("span", { onMouseDown: onMouseDown, className: formatClass(format, 'tpl-text'), style: formatInk(format), "data-ink": inkAttr(format), "data-empty": value.length === 0 || undefined, "data-placeholder": picture ? undefined : placeholder, "data-path": picture ? undefined : path, "data-issue": dateIssue, title: dateWarning, "aria-description": dateWarning, children: target && picture ? (_jsx("span", { className: "tpl-text__link", children: text })) : target ? (_jsx("a", { className: "tpl-text__link", href: target, rel: "noopener noreferrer", onClick: (e) => {
|
|
102
|
+
if (editing)
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
}, children: text })) : (text) }));
|
|
105
|
+
}
|
|
106
|
+
return (_jsx("span", { onMouseDown: onMouseDown,
|
|
107
|
+
/*
|
|
108
|
+
* A plain inline box, and nothing more. The field inside it flows and
|
|
109
|
+
* wraps on its own now, so there is no mirror to measure it and no grid
|
|
110
|
+
* to hold the two of them in the same cell.
|
|
111
|
+
*/
|
|
112
|
+
className: formatClass(format, 'tpl-text'), style: formatInk(format), "data-ink": inkAttr(format), "data-path": path, children: _jsx(PlainTextField, { value: value, placeholder: placeholder, multiline: multiline, label: path, onChange: change }) }));
|
|
113
|
+
}
|