@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,37 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How a document says it has changed enough to be worth storing.
|
|
4
|
+
*
|
|
5
|
+
* The candidate no longer presses anything: there is no save control, so the
|
|
6
|
+
* document is responsible for knowing when it has become worth writing down.
|
|
7
|
+
* That knowledge is genuinely per-component and cannot be recovered from the
|
|
8
|
+
* outside — a surface watching the overlay sees only "something differs", and
|
|
9
|
+
* cannot tell a keystroke mid-word from a role the candidate just deleted. So
|
|
10
|
+
* each component says which of the two it just did, and the host decides what
|
|
11
|
+
* that costs in requests.
|
|
12
|
+
*
|
|
13
|
+
* Two verbs, and the difference between them is the only decision a component
|
|
14
|
+
* makes:
|
|
15
|
+
*
|
|
16
|
+
* - `saveNow` — a discrete act that is finished the moment it happens. Adding a
|
|
17
|
+
* bullet, removing a role, reordering. There is no "rest of it" coming, and
|
|
18
|
+
* waiting would only mean the candidate watching an unsaved document.
|
|
19
|
+
* - `saveSoon` — one keystroke of something still being typed. The host
|
|
20
|
+
* coalesces these, so a sentence is one write rather than forty.
|
|
21
|
+
*
|
|
22
|
+
* Both end in the same call — the one the save button used to make. Nothing
|
|
23
|
+
* here saves anything; this is a way to ASK, and the host owns the answer.
|
|
24
|
+
*/
|
|
25
|
+
export interface AutosaveContextValue {
|
|
26
|
+
/** Store the document as soon as the change has landed. */
|
|
27
|
+
saveNow: () => void;
|
|
28
|
+
/** Store the document once the typing it belongs to has settled. */
|
|
29
|
+
saveSoon: () => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function DocumentAutosaveProvider({ value, children, }: {
|
|
32
|
+
value: AutosaveContextValue;
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}): import("react").JSX.Element;
|
|
35
|
+
/** How this component reports that it changed the document. */
|
|
36
|
+
export declare function useAutosave(): AutosaveContextValue;
|
|
37
|
+
//# sourceMappingURL=autosave-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autosave-context.d.ts","sourceRoot":"","sources":["../src/autosave-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAmBD,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAMA;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,IAAI,oBAAoB,CAElD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* What a document that is only being read does when it is asked to save:
|
|
5
|
+
* nothing.
|
|
6
|
+
*
|
|
7
|
+
* A default rather than a `null` for the same reason `useFieldFormat` has one —
|
|
8
|
+
* a component must render identically whether or not it can be edited, and a
|
|
9
|
+
* component that had to ask which mode it was in before it could report a
|
|
10
|
+
* change would be two components. The read-only document, the saved-résumé view
|
|
11
|
+
* and the export renderer mount no provider and therefore never write.
|
|
12
|
+
*/
|
|
13
|
+
const NEVER = {
|
|
14
|
+
saveNow: () => undefined,
|
|
15
|
+
saveSoon: () => undefined,
|
|
16
|
+
};
|
|
17
|
+
const AutosaveContext = createContext(NEVER);
|
|
18
|
+
export function DocumentAutosaveProvider({ value, children, }) {
|
|
19
|
+
return (_jsx(AutosaveContext.Provider, { value: value, children: children }));
|
|
20
|
+
}
|
|
21
|
+
/** How this component reports that it changed the document. */
|
|
22
|
+
export function useAutosave() {
|
|
23
|
+
return useContext(AutosaveContext);
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CollectionItemsProps } from './CollectionItems.js';
|
|
2
|
+
/** The items of a collection, drawn with their controls. */
|
|
3
|
+
export default function AuthoredItems<T>({ collection, basePath, noun, label, gap, ids, sortable, children, }: Pick<CollectionItemsProps<T>, 'collection' | 'basePath' | 'noun' | 'label'> & {
|
|
4
|
+
gap: boolean;
|
|
5
|
+
ids: readonly string[];
|
|
6
|
+
sortable: boolean;
|
|
7
|
+
children: CollectionItemsProps<T>['children'];
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=AuthoredItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthoredItems.d.ts","sourceRoot":"","sources":["../../src/collections/AuthoredItems.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,oBAAoB,EAGrB,MAAM,sBAAsB,CAAC;AA0I9B,4DAA4D;AAC5D,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,CAAC,EAAE,EACvC,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,GAAG,EACH,GAAG,EACH,QAAQ,EACR,QAAQ,GACT,EAAE,IAAI,CACL,oBAAoB,CAAC,CAAC,CAAC,EACvB,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAC7C,GAAG;IACF,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;CAC/C,+BA2BA"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement } from 'react';
|
|
3
|
+
import { COLLECTIONS } from '@resumekit/schema';
|
|
4
|
+
import { EntryOverlay } from './EntryOverlay.js';
|
|
5
|
+
import { SortableItems, useDragHandle } from './SortableItems.js';
|
|
6
|
+
import { useEntrySelection } from './selection-context.js';
|
|
7
|
+
import { useSpaceSlot } from '../spacing/useSpaceSlot.js';
|
|
8
|
+
import { ContainerRail } from '../rail/ContainerRail.js';
|
|
9
|
+
import { EntryActions } from '../rail/EntryActions.js';
|
|
10
|
+
import { RAIL_KEY } from '../rail/rail-store.js';
|
|
11
|
+
import { useItemName } from './entry-text.js';
|
|
12
|
+
import { useEditorText } from '../i18n/index.js';
|
|
13
|
+
/**
|
|
14
|
+
* Everything an authorable document needs, and nothing a readable one does.
|
|
15
|
+
*
|
|
16
|
+
* Split into its own module so that the drag-and-drop library is reached only
|
|
17
|
+
* through a dynamic import. `template-rendering` requires that the read-only
|
|
18
|
+
* document and the export renderer load no editing code, and an import at the
|
|
19
|
+
* top of a shared file would have made that untrue however carefully the
|
|
20
|
+
* component was guarded — the requirement is about the bundle, not the render.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* An item on a document that is being AUTHORED.
|
|
24
|
+
*
|
|
25
|
+
* A component rather than a loop body, because the drag handle is a hook and a
|
|
26
|
+
* hook cannot be called per iteration of a map.
|
|
27
|
+
*/
|
|
28
|
+
function AuthoredItem({ collection, index, path, id, noun, label, gap, sortable, children, }) {
|
|
29
|
+
const { handleProps, setNodeRef, style } = useDragHandle(id, !sortable);
|
|
30
|
+
const { active, select } = useEntrySelection();
|
|
31
|
+
const selected = active === id;
|
|
32
|
+
/*
|
|
33
|
+
* The gap above this entry — how one role is separated from the one before
|
|
34
|
+
* it. Addressed by the entry's own PATH, so the space follows the job through
|
|
35
|
+
* a reorder rather than staying at the position it was set in.
|
|
36
|
+
*/
|
|
37
|
+
const itemName = useItemName(noun, index);
|
|
38
|
+
const space = useSpaceSlot({ path }, itemName);
|
|
39
|
+
const { t, format, noun: forms } = useEditorText();
|
|
40
|
+
/*
|
|
41
|
+
* A CONTAINER — a role, a school, a skills group, a custom section — carries
|
|
42
|
+
* one rail beside the sheet with the space above it and its own actions. A
|
|
43
|
+
* bullet or an inline item sits inside a line of the document, where a rail in
|
|
44
|
+
* the margin could not point at it, so it keeps its compact toolbar.
|
|
45
|
+
*/
|
|
46
|
+
const shape = COLLECTIONS[collection.id].shape;
|
|
47
|
+
const container = shape === 'entry' || shape === 'section';
|
|
48
|
+
const railKey = `e:${id}`;
|
|
49
|
+
const itemLabel = format(t.entry.name, {
|
|
50
|
+
...forms(noun),
|
|
51
|
+
section: label,
|
|
52
|
+
position: index + 1,
|
|
53
|
+
});
|
|
54
|
+
const element = children({
|
|
55
|
+
item: collection.items[index],
|
|
56
|
+
path,
|
|
57
|
+
index,
|
|
58
|
+
/*
|
|
59
|
+
* Chrome, absolutely positioned, no layout. A container's rail exists only
|
|
60
|
+
* while it is pointed at, focused or selected; a line item's toolbar only
|
|
61
|
+
* while it is selected — or the page would be a wall of controls.
|
|
62
|
+
*/
|
|
63
|
+
chrome: container ? (_jsx(ContainerRail, { railKey: railKey, toolbarLabel: format(t.entry.toolbar, { name: itemLabel }), selected: selected, space: gap ? { target: { path }, label: itemName } : null, children: _jsx(EntryActions, { collection: collection, index: index, noun: noun, path: path, handleProps: sortable ? handleProps : undefined }) })) : selected ? (_jsx(EntryOverlay, { collection: collection, index: index, noun: noun, label: label, handleProps: sortable ? handleProps : undefined })) : null,
|
|
64
|
+
/* Whether this is the entry the candidate just asked for — see
|
|
65
|
+
`SectionCollectionHandle.justAdded`. */
|
|
66
|
+
justAdded: collection.justAdded?.(index) ?? false,
|
|
67
|
+
itemProps: {
|
|
68
|
+
/*
|
|
69
|
+
* The marker every editing affordance hangs off: the outline that shows
|
|
70
|
+
* the entry can be acted on, the positioning context its controls need,
|
|
71
|
+
* and the name the guide label reads. Written for every authored item —
|
|
72
|
+
* not only a draggable one — so an entry in a collection of one is still
|
|
73
|
+
* visibly an entry.
|
|
74
|
+
*
|
|
75
|
+
* Its VALUE is the collection's own shape, because how much room the ring
|
|
76
|
+
* may take beside an item is a property of what the item is. A block
|
|
77
|
+
* entry has a page margin to spend and nothing to collide with, which is
|
|
78
|
+
* what the 24px default is for; an item that sits INSIDE a line of the
|
|
79
|
+
* document has the rest of that line on both sides of it, and the same
|
|
80
|
+
* ring reached across the separator and over the phone number next to it.
|
|
81
|
+
* Every rule that already existed matches on the attribute's presence, so
|
|
82
|
+
* naming it costs nothing and `collection.css` gains one rule.
|
|
83
|
+
*/
|
|
84
|
+
'data-entry': COLLECTIONS[collection.id].shape,
|
|
85
|
+
'data-entry-label': itemName,
|
|
86
|
+
...(container ? { [RAIL_KEY]: railKey } : {}),
|
|
87
|
+
...(selected ? { 'data-selected': '' } : {}),
|
|
88
|
+
/*
|
|
89
|
+
* Selecting on click and NOT stopping the event. A click on a job title
|
|
90
|
+
* both selects the field to type in and selects the entry it belongs to,
|
|
91
|
+
* which is what a candidate means by it — the formatting rail acts on the
|
|
92
|
+
* field, this overlay acts on the entry, and neither has to win.
|
|
93
|
+
*/
|
|
94
|
+
onClick: () => select(id),
|
|
95
|
+
...(gap ? space.rootProps : {}),
|
|
96
|
+
/*
|
|
97
|
+
* Merged rather than spread over: the sortable transform and the recorded
|
|
98
|
+
* step count are both styles on this one element, and whichever was
|
|
99
|
+
* written second would otherwise delete the other.
|
|
100
|
+
*/
|
|
101
|
+
...(sortable
|
|
102
|
+
? {
|
|
103
|
+
ref: setNodeRef,
|
|
104
|
+
style: { ...(gap ? space.rootProps.style : {}), ...style },
|
|
105
|
+
}
|
|
106
|
+
: {}),
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
return isValidElement(element) ? element : null;
|
|
110
|
+
}
|
|
111
|
+
/** The items of a collection, drawn with their controls. */
|
|
112
|
+
export default function AuthoredItems({ collection, basePath, noun, label, gap, ids, sortable, children, }) {
|
|
113
|
+
const rendered = collection.items.map((_, index) => (_jsx(AuthoredItem, { id: ids[index], collection: collection, index: index, noun: noun, label: label, gap: gap, sortable: sortable, path: collection.pathOf?.(index) ??
|
|
114
|
+
`${basePath ?? ''}.${index}`.replace(/^\./, ''), children: children }, ids[index])));
|
|
115
|
+
return sortable ? (_jsx(SortableItems, { ids: ids, onMove: collection.move, children: rendered })) : (_jsx(_Fragment, { children: rendered }));
|
|
116
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type AppendableSection } from '@resumekit/schema';
|
|
2
|
+
import { type EntryRenderProps } from './CollectionItems.js';
|
|
3
|
+
import type { ReactElement } from 'react';
|
|
4
|
+
export type { EntryRenderProps };
|
|
5
|
+
export interface CollectionProps<T> {
|
|
6
|
+
section: AppendableSection;
|
|
7
|
+
items: readonly T[];
|
|
8
|
+
children: (props: EntryRenderProps<T>) => ReactElement | null;
|
|
9
|
+
/**
|
|
10
|
+
* What to call one of these. Defaults to the domain's own word for it, so a
|
|
11
|
+
* template never names a thing differently from the rest of the product.
|
|
12
|
+
*/
|
|
13
|
+
noun?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether these items may carry structural space above them. The template
|
|
16
|
+
* decides — see `CollectionItems`. Defaults to on.
|
|
17
|
+
*/
|
|
18
|
+
gap?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* How the empty-state add control sits in the document.
|
|
21
|
+
*
|
|
22
|
+
* `block` — the default — is a control on a line of its own, which is right
|
|
23
|
+
* for a SECTION a template omits when it has no data: there is no line below
|
|
24
|
+
* it to push.
|
|
25
|
+
*
|
|
26
|
+
* `inline` is for a collection that renders inside a line of the document,
|
|
27
|
+
* where a block control is a second line the preview does not have. It draws
|
|
28
|
+
* an empty field with a placeholder instead, sized like the items beside it,
|
|
29
|
+
* so the line keeps its shape.
|
|
30
|
+
*/
|
|
31
|
+
emptyAdd?: 'block' | 'inline';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A repeatable section of the résumé: its items, and everything that may be
|
|
35
|
+
* done to them.
|
|
36
|
+
*
|
|
37
|
+
* The behaviour lives in `useSectionCollection` and the markup in
|
|
38
|
+
* `CollectionItems`; this is the seam between them. A template passes what an
|
|
39
|
+
* item looks like and receives no way to change the list — which is what stops
|
|
40
|
+
* "just this one button, just here" from becoming four divergent
|
|
41
|
+
* implementations of add.
|
|
42
|
+
*
|
|
43
|
+
* With no authoring context — the read-only document, the saved-résumé view,
|
|
44
|
+
* the export renderer — this renders the items and nothing else, so a printed
|
|
45
|
+
* page cannot carry a control and no consumer has to remember to turn one off.
|
|
46
|
+
*/
|
|
47
|
+
export declare function Collection<T>({ section, items, children, noun, gap, emptyAdd, }: CollectionProps<T>): import("react").JSX.Element;
|
|
48
|
+
//# sourceMappingURL=Collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../../src/collections/Collection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,YAAY,GAAG,IAAI,CAAC;IAC9D;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAC5B,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,QAAQ,GACT,EAAE,eAAe,CAAC,CAAC,CAAC,+BAcpB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { COLLECTIONS } from '@resumekit/schema';
|
|
3
|
+
import { useSectionCollection } from './useSectionCollection.js';
|
|
4
|
+
import { CollectionItems } from './CollectionItems.js';
|
|
5
|
+
import { useEditorText } from '../i18n/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* A repeatable section of the résumé: its items, and everything that may be
|
|
8
|
+
* done to them.
|
|
9
|
+
*
|
|
10
|
+
* The behaviour lives in `useSectionCollection` and the markup in
|
|
11
|
+
* `CollectionItems`; this is the seam between them. A template passes what an
|
|
12
|
+
* item looks like and receives no way to change the list — which is what stops
|
|
13
|
+
* "just this one button, just here" from becoming four divergent
|
|
14
|
+
* implementations of add.
|
|
15
|
+
*
|
|
16
|
+
* With no authoring context — the read-only document, the saved-résumé view,
|
|
17
|
+
* the export renderer — this renders the items and nothing else, so a printed
|
|
18
|
+
* page cannot carry a control and no consumer has to remember to turn one off.
|
|
19
|
+
*/
|
|
20
|
+
export function Collection({ section, items, children, noun, gap, emptyAdd, }) {
|
|
21
|
+
const collection = useSectionCollection(section, items);
|
|
22
|
+
const { sectionName } = useEditorText();
|
|
23
|
+
return (_jsx(CollectionItems, { collection: collection, noun: noun ?? COLLECTIONS[section].noun, label: sectionName(section), gap: gap, emptyAdd: emptyAdd, children: children }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import type { ItemOrigin } from './EntryOverlay.js';
|
|
3
|
+
import type { CollectionHandle } from './useCollection.js';
|
|
4
|
+
/**
|
|
5
|
+
* What a template's root element must carry for the item to be movable.
|
|
6
|
+
*
|
|
7
|
+
* Opaque on purpose. A template spreads it and reads nothing out of it, so the
|
|
8
|
+
* drag implementation — or its removal — is not a change to any template.
|
|
9
|
+
*/
|
|
10
|
+
export type ItemRootProps = HTMLAttributes<HTMLElement> & {
|
|
11
|
+
ref?: (node: HTMLElement | null) => void;
|
|
12
|
+
/** Marks the element as one item of a collection. See `collection.css`. */
|
|
13
|
+
'data-entry'?: string;
|
|
14
|
+
/** What to call it in the overlay's label — the collection's own noun. */
|
|
15
|
+
'data-entry-label'?: string;
|
|
16
|
+
/** Present on the one entry the candidate is working on. */
|
|
17
|
+
'data-selected'?: string;
|
|
18
|
+
};
|
|
19
|
+
/** What a template's entry component is given. Values and a path; no verbs. */
|
|
20
|
+
export interface EntryRenderProps<T> {
|
|
21
|
+
item: T;
|
|
22
|
+
/** Where this item lives in the résumé — `experience.2`, never `experience.0`. */
|
|
23
|
+
path: string;
|
|
24
|
+
/** Where it is DRAWN. For keys and labels only; never for a field path. */
|
|
25
|
+
index: number;
|
|
26
|
+
/**
|
|
27
|
+
* The item's controls, which the entry component MUST render inside its own
|
|
28
|
+
* root element.
|
|
29
|
+
*
|
|
30
|
+
* Handed over rather than injected, because an entry component is a component
|
|
31
|
+
* and appending a child to one only sets a prop it ignores. The template
|
|
32
|
+
* therefore decides WHERE the controls sit in its markup — which is right,
|
|
33
|
+
* since it owns the layout — and it cannot decide WHAT they are: `chrome` is
|
|
34
|
+
* opaque, and no template can reach the operations behind it.
|
|
35
|
+
*
|
|
36
|
+
* `null` when the document is only being read, so a template renders the same
|
|
37
|
+
* markup either way without asking which mode it is in.
|
|
38
|
+
*/
|
|
39
|
+
chrome: ReactNode;
|
|
40
|
+
/** Spread onto the entry's root element. Opaque; see {@link ItemRootProps}. */
|
|
41
|
+
itemProps: ItemRootProps;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the candidate has just added THIS item, in this session.
|
|
44
|
+
*
|
|
45
|
+
* For a control that opens itself on arrival — a link's popover, which has
|
|
46
|
+
* nowhere else to put the address. Deliberately an ACT and not a property of
|
|
47
|
+
* the item: keyed off "this entry is still empty" instead, every empty entry
|
|
48
|
+
* in the document opened one, every time it was drawn.
|
|
49
|
+
*
|
|
50
|
+
* `false` on a document being read, which adds nothing.
|
|
51
|
+
*/
|
|
52
|
+
justAdded: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface CollectionItemsProps<T> {
|
|
55
|
+
collection: CollectionHandle<T> & {
|
|
56
|
+
originOf?: (index: number) => ItemOrigin;
|
|
57
|
+
justAdded?: (index: number) => boolean;
|
|
58
|
+
pathOf?: (index: number) => string;
|
|
59
|
+
keyOf?: (index: number) => string;
|
|
60
|
+
};
|
|
61
|
+
/** The path prefix, when the collection does not supply one of its own. */
|
|
62
|
+
basePath?: string;
|
|
63
|
+
noun: string;
|
|
64
|
+
/** The section's own name, for the overlay's label. */
|
|
65
|
+
label: string;
|
|
66
|
+
/**
|
|
67
|
+
* Whether these items may carry structural space above them.
|
|
68
|
+
*
|
|
69
|
+
* The TEMPLATE decides, because only the template knows what it renders an
|
|
70
|
+
* item as. Structural space is held by a wrapper element around the item, and
|
|
71
|
+
* a wrapper is not valid around every item: a skills group is an `<li>` in a
|
|
72
|
+
* `<ul>`, and a `<div>` between them is not a list. It is not wanted there
|
|
73
|
+
* either — nobody needs to push two lines of keywords apart. Defaults to on,
|
|
74
|
+
* so a template that renders entries gets its gaps by saying nothing.
|
|
75
|
+
*/
|
|
76
|
+
gap?: boolean;
|
|
77
|
+
/** Where the empty-state add sits — see `Collection`. Defaults to `block`. */
|
|
78
|
+
emptyAdd?: 'block' | 'inline';
|
|
79
|
+
/** The template's entry component. MUST return a single element. */
|
|
80
|
+
children: (props: EntryRenderProps<T>) => ReactElement | null;
|
|
81
|
+
}
|
|
82
|
+
/** What every item render needs, however it is being drawn. */
|
|
83
|
+
export interface ItemProps<T> {
|
|
84
|
+
collection: CollectionItemsProps<T>['collection'];
|
|
85
|
+
index: number;
|
|
86
|
+
path: string;
|
|
87
|
+
noun: string;
|
|
88
|
+
label: string;
|
|
89
|
+
/** Whether this item may carry structural space above it. See `gap`. */
|
|
90
|
+
gap: boolean;
|
|
91
|
+
children: CollectionItemsProps<T>['children'];
|
|
92
|
+
}
|
|
93
|
+
export declare function CollectionItems<T>({ collection, basePath, noun, label, gap, emptyAdd, children, }: CollectionItemsProps<T>): import("react").JSX.Element;
|
|
94
|
+
//# sourceMappingURL=CollectionItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionItems.d.ts","sourceRoot":"","sources":["../../src/collections/CollectionItems.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,kBAAkB,CAAC;AAI1B;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IAQxD,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,4DAA4D;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC;IACR,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;OAYG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB,+EAA+E;IAC/E,SAAS,EAAE,aAAa,CAAC;IACzB;;;;;;;;;OASG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;QAChC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,UAAU,CAAC;QACzC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QACvC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;QACnC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;KACnC,CAAC;IACF,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;OASG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC9B,oEAAoE;IACpE,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,YAAY,GAAG,IAAI,CAAC;CAC/D;AAED,+DAA+D;AAC/D,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;CAC/C;AA8DD,wBAAgB,eAAe,CAAC,CAAC,EAAE,EACjC,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,GAAU,EACV,QAAkB,EAClB,QAAQ,GACT,EAAE,oBAAoB,CAAC,CAAC,CAAC,+BAoIzB"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, isValidElement, lazy, } from 'react';
|
|
3
|
+
import { isUnfilled } from '@resumekit/schema';
|
|
4
|
+
import { useAuthoring } from './authoring-context.js';
|
|
5
|
+
import { useSpaceSlot } from '../spacing/useSpaceSlot.js';
|
|
6
|
+
import './collection.css';
|
|
7
|
+
import { useItemName } from './entry-text.js';
|
|
8
|
+
import { useEditorText } from '../i18n/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* An item on a document that is being READ.
|
|
11
|
+
*
|
|
12
|
+
* No controls, no drag hook, and an empty `itemProps` — so the markup a
|
|
13
|
+
* template produces here is exactly the markup it produced before collections
|
|
14
|
+
* existed, and the printed page and the export renderer cannot carry chrome
|
|
15
|
+
* they never asked to be free of.
|
|
16
|
+
*/
|
|
17
|
+
function ReadOnlyItem({ collection, index, path, noun, gap, children, }) {
|
|
18
|
+
/*
|
|
19
|
+
* The SPACE, but never the handle: `useSpaceSlot` yields no control without
|
|
20
|
+
* an authoring context, so a read item sits below the space its owner
|
|
21
|
+
* recorded and offers nothing to change it with. Which is the point — the
|
|
22
|
+
* space is the document and prints; the control is chrome and does not.
|
|
23
|
+
*/
|
|
24
|
+
const space = useSpaceSlot({ path }, useItemName(noun, index));
|
|
25
|
+
const element = children({
|
|
26
|
+
item: collection.items[index],
|
|
27
|
+
path,
|
|
28
|
+
index,
|
|
29
|
+
chrome: null,
|
|
30
|
+
itemProps: gap ? { ...space.rootProps } : {},
|
|
31
|
+
justAdded: false,
|
|
32
|
+
});
|
|
33
|
+
return isValidElement(element) ? element : null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The items of a collection, with their controls, from any store.
|
|
37
|
+
*
|
|
38
|
+
* The rendering lives here so that a section backed by the overlay and a custom
|
|
39
|
+
* section backed by its own declaring edit produce identical markup and
|
|
40
|
+
* identical affordances — the two would otherwise be two implementations of the
|
|
41
|
+
* same screen, which is the duplication this whole change exists to remove.
|
|
42
|
+
*/
|
|
43
|
+
/*
|
|
44
|
+
* Loaded on demand, and that is the whole point: this is where `@dnd-kit` and
|
|
45
|
+
* the authoring controls live, so a document that is only being read — the
|
|
46
|
+
* saved-résumé view, and the server-side renderer that produces the PDF — never
|
|
47
|
+
* fetches either. Asserted in `collections.spec.tsx`.
|
|
48
|
+
*/
|
|
49
|
+
const AuthoredItems = lazy(() => import('./AuthoredItems.js'));
|
|
50
|
+
export function CollectionItems({ collection, basePath, noun, label, gap = true, emptyAdd = 'block', children, }) {
|
|
51
|
+
const authoring = useAuthoring();
|
|
52
|
+
const { t, format, noun: forms } = useEditorText();
|
|
53
|
+
/*
|
|
54
|
+
* Unique across the whole DOCUMENT, not just within this collection: the
|
|
55
|
+
* selection is document-wide, so two collections whose items were keyed by
|
|
56
|
+
* position alone would select together.
|
|
57
|
+
*/
|
|
58
|
+
const ids = collection.items.map((_, index) => collection.keyOf?.(index) ?? `${basePath ?? noun}:${index}`);
|
|
59
|
+
const sortable = Boolean(authoring) && collection.canMove;
|
|
60
|
+
/*
|
|
61
|
+
* An UNFILLED item is not drawn on a document being read.
|
|
62
|
+
*
|
|
63
|
+
* "A placeholder is an absence" is already the domain's rule — `renderText`
|
|
64
|
+
* omits an unfilled entry from the text export and reports it as omitted —
|
|
65
|
+
* and this is the same rule for the rendered document. In the editor an
|
|
66
|
+
* entry the candidate has added and not yet typed into is guidance they are
|
|
67
|
+
* about to fill in; in the preview, the printed page and the exported file it
|
|
68
|
+
* is nothing at all, and it must LOOK like nothing.
|
|
69
|
+
*
|
|
70
|
+
* That last part is why this is a filter and not a style. A blank item still
|
|
71
|
+
* has a separator: Harvard draws one between contact items with
|
|
72
|
+
* `.tpl-harvard__contact-item + .tpl-harvard__contact-item::before`, so a
|
|
73
|
+
* résumé carrying blank links printed a run of bare `|` bars with nothing
|
|
74
|
+
* between them. The separator belongs to the element, so the only way to
|
|
75
|
+
* remove it is not to render the element.
|
|
76
|
+
*/
|
|
77
|
+
const drawn = collection.items
|
|
78
|
+
.map((item, index) => ({ item, index }))
|
|
79
|
+
.filter(({ item }) => Boolean(authoring) || !isUnfilled(item));
|
|
80
|
+
const rendered = drawn.map(({ index }) => (_jsx(ReadOnlyItem, { collection: collection, index: index, noun: noun, label: label, gap: gap, path: collection.pathOf?.(index) ??
|
|
81
|
+
`${basePath ?? ''}.${index}`.replace(/^\./, ''), children: children }, ids[index])));
|
|
82
|
+
/*
|
|
83
|
+
* An empty collection has no item to hang "add below" on. A BLOCK control
|
|
84
|
+
* here moves nothing, because a template omits a section it has no data for —
|
|
85
|
+
* there is no line below it to push. Inside a line of the document that is
|
|
86
|
+
* false, and `emptyAdd` is how a template says so.
|
|
87
|
+
*/
|
|
88
|
+
const empty = authoring && collection.canAdd && collection.items.length === 0;
|
|
89
|
+
return (_jsxs(_Fragment, { children: [authoring ? (_jsx(Suspense, { fallback: rendered, children: _jsx(AuthoredItems, { collection: collection, basePath: basePath, noun: noun, label: label, gap: gap, ids: ids, sortable: sortable, children: children }) })) : (rendered), empty &&
|
|
90
|
+
(emptyAdd === 'inline' ? (_jsx("button", { type: "button", className: "tpl-collection__add-inline", "data-chrome": true, contentEditable: false, "data-placeholder": format(t.entry.addFirstPlaceholder, forms(noun)), "aria-label": format(t.entry.addFirstLabel, forms(noun)), onClick: () => collection.add() })) : (_jsx("div", { className: "tpl-collection__add", "data-chrome": true, contentEditable: false, children: _jsx("button", { type: "button", className: "tpl-collection__add-btn", onClick: () => collection.add(), children: format(t.entry.addFirst, forms(noun)) }) })))] }));
|
|
91
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CollectionHandle } from './useCollection.js';
|
|
2
|
+
/** Where an item came from, which decides what removing it means. */
|
|
3
|
+
export type ItemOrigin = 'added' | 'written';
|
|
4
|
+
/**
|
|
5
|
+
* The overlay for the entry the candidate has selected: what this region is,
|
|
6
|
+
* and everything that can be done to it.
|
|
7
|
+
*
|
|
8
|
+
* Two things it is NOT allowed to be. It is not in the document's flow — it is
|
|
9
|
+
* absolutely positioned above the entry, so appearing cannot move a line and the
|
|
10
|
+
* page break stays where the print stylesheet puts it. And it is not on paper —
|
|
11
|
+
* it is `data-chrome`, hidden by the print rules, and the selection is cleared
|
|
12
|
+
* on `beforeprint` besides.
|
|
13
|
+
*
|
|
14
|
+
* Every action here is also on the keyboard: the buttons are buttons, they are
|
|
15
|
+
* in the tab order, and `move` is the same call the drag handle makes. The
|
|
16
|
+
* overlay is how the operations are DISCOVERED, never the only way to reach
|
|
17
|
+
* them — `editor-usability` (#35) names mouse-only editing as a defect, and an
|
|
18
|
+
* affordance that fixed discoverability by making everything a drag would be
|
|
19
|
+
* trading one for the other.
|
|
20
|
+
*/
|
|
21
|
+
export declare function EntryOverlay<T>({ collection, index, noun, label: section, handleProps, }: {
|
|
22
|
+
collection: CollectionHandle<T> & {
|
|
23
|
+
originOf?: (i: number) => ItemOrigin;
|
|
24
|
+
};
|
|
25
|
+
index: number;
|
|
26
|
+
noun: string;
|
|
27
|
+
/** Which section this is in, so the bar says where it is acting. */
|
|
28
|
+
label: string;
|
|
29
|
+
/**
|
|
30
|
+
* What makes this item draggable, when dragging is offered at all.
|
|
31
|
+
*
|
|
32
|
+
* A HANDLE rather than the whole entry: the entry is full of live text
|
|
33
|
+
* fields, and a drag that begins anywhere inside one would be competing with
|
|
34
|
+
* selecting a word.
|
|
35
|
+
*/
|
|
36
|
+
handleProps?: Record<string, unknown>;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=EntryOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntryOverlay.d.ts","sourceRoot":"","sources":["../../src/collections/EntryOverlay.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,kBAAkB,CAAC;AAK1B,qEAAqE;AACrE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,UAAU,EACV,KAAK,EACL,IAAI,EACJ,KAAK,EAAE,OAAO,EACd,WAAW,GACZ,EAAE;IACD,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;QAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,UAAU,CAAA;KAAE,CAAC;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC,+BA4GA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowDownIcon, ArrowUpIcon, GripIcon, PlusIcon, TrashIcon, } from './icons.js';
|
|
3
|
+
import './collection.css';
|
|
4
|
+
import { useEntryText } from './entry-text.js';
|
|
5
|
+
import { useEditorText } from '../i18n/index.js';
|
|
6
|
+
import { LibraryAction } from './library/LibraryAction.js';
|
|
7
|
+
/**
|
|
8
|
+
* The overlay for the entry the candidate has selected: what this region is,
|
|
9
|
+
* and everything that can be done to it.
|
|
10
|
+
*
|
|
11
|
+
* Two things it is NOT allowed to be. It is not in the document's flow — it is
|
|
12
|
+
* absolutely positioned above the entry, so appearing cannot move a line and the
|
|
13
|
+
* page break stays where the print stylesheet puts it. And it is not on paper —
|
|
14
|
+
* it is `data-chrome`, hidden by the print rules, and the selection is cleared
|
|
15
|
+
* on `beforeprint` besides.
|
|
16
|
+
*
|
|
17
|
+
* Every action here is also on the keyboard: the buttons are buttons, they are
|
|
18
|
+
* in the tab order, and `move` is the same call the drag handle makes. The
|
|
19
|
+
* overlay is how the operations are DISCOVERED, never the only way to reach
|
|
20
|
+
* them — `editor-usability` (#35) names mouse-only editing as a defect, and an
|
|
21
|
+
* affordance that fixed discoverability by making everything a drag would be
|
|
22
|
+
* trading one for the other.
|
|
23
|
+
*/
|
|
24
|
+
export function EntryOverlay({ collection, index, noun, label: section, handleProps, }) {
|
|
25
|
+
const origin = collection.originOf?.(index) ?? 'added';
|
|
26
|
+
const refusal = collection.removeReason(index);
|
|
27
|
+
const last = collection.items.length - 1;
|
|
28
|
+
/*
|
|
29
|
+
* "Experience · Role 2" — where, then which.
|
|
30
|
+
*
|
|
31
|
+
* Sentence case, because it is read as a name rather than as a heading; and
|
|
32
|
+
* the section first, because a candidate with six sections and eleven bullets
|
|
33
|
+
* needs to know which document they are in before which item.
|
|
34
|
+
*/
|
|
35
|
+
const text = useEntryText(noun, index, origin);
|
|
36
|
+
const editor = useEditorText();
|
|
37
|
+
const label = editor.format(editor.t.entry.name, {
|
|
38
|
+
...editor.noun(noun),
|
|
39
|
+
section,
|
|
40
|
+
position: index + 1,
|
|
41
|
+
});
|
|
42
|
+
return (_jsxs("span", { className: "tpl-entry-overlay", "data-chrome": true, contentEditable: false, role: "toolbar", "aria-label": editor.format(editor.t.entry.toolbar, { name: label }), children: [handleProps ? (_jsxs("span", { className: "tpl-entry-overlay__grip", title: text.drag, ...handleProps, children: [_jsx(GripIcon, {}), _jsx("span", { className: "tpl-entry-overlay__label", children: label })] })) : (_jsx("span", { className: "tpl-entry-overlay__grip", "data-static": true, children: _jsx("span", { className: "tpl-entry-overlay__label", children: label }) })), _jsx("span", { className: "tpl-entry-overlay__divider", "aria-hidden": "true" }), collection.canMove && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "tpl-entry-overlay__btn", title: text.moveUp, "aria-label": text.moveUpLabel, disabled: index === 0, onClick: () => collection.move(index, index - 1), children: _jsx(ArrowUpIcon, {}) }), _jsx("button", { type: "button", className: "tpl-entry-overlay__btn", title: text.moveDown, "aria-label": text.moveDownLabel, disabled: index === last, onClick: () => collection.move(index, index + 1), children: _jsx(ArrowDownIcon, {}) })] })), collection.canAdd && (_jsx("button", { type: "button", className: "tpl-entry-overlay__btn", title: text.addBelow, "aria-label": text.addAfterLabel, onClick: () => collection.add(index), children: _jsx(PlusIcon, {}) })), _jsx(LibraryAction, { collection: collection, index: index, noun: noun, className: "tpl-entry-overlay__btn" }), _jsx("button", { type: "button", className: "tpl-entry-overlay__btn", "data-tone": "danger", disabled: refusal !== undefined,
|
|
43
|
+
/*
|
|
44
|
+
* The word is the honest one for what actually happens. Removing an
|
|
45
|
+
* addition deletes it; "removing" a writer-produced entry HIDES it, and
|
|
46
|
+
* a control that said delete would be describing an operation the
|
|
47
|
+
* product refuses to perform — the score and the requirement audit are
|
|
48
|
+
* derived against that content.
|
|
49
|
+
*/
|
|
50
|
+
title: refusal ?? text.remove, "aria-label": text.removeLabel, onClick: () => collection.remove(index), children: _jsx(TrashIcon, {}) })] }));
|
|
51
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Dragging, as ONE presentation over `move(from, to)`.
|
|
4
|
+
*
|
|
5
|
+
* Everything here is optional by construction: the same operation is on the
|
|
6
|
+
* keyboard and on the ↑/↓ controls, the document is fully authorable without a
|
|
7
|
+
* pointer, and removing this file would cost the product a convenience rather
|
|
8
|
+
* than a capability. That is the test for whether a drag library has been let
|
|
9
|
+
* too far in.
|
|
10
|
+
*
|
|
11
|
+
* `@dnd-kit` and not the lighter `@atlaskit/pragmatic-drag-and-drop`, for two
|
|
12
|
+
* reasons that are properties of THIS document rather than of the libraries:
|
|
13
|
+
* a selected editable field is a live `<textarea>`, and the native HTML5 drag
|
|
14
|
+
* API the lighter library builds on fights text selection inside one; and dnd-kit
|
|
15
|
+
* never re-parents a node — it transforms, and the array is reordered in state —
|
|
16
|
+
* where a DOM-mutating sortable would fight both React and the paginator, which
|
|
17
|
+
* is what `resume-document-formatting` (#30) refused when it chose to paginate by
|
|
18
|
+
* pushing blocks rather than by re-parenting them.
|
|
19
|
+
*/
|
|
20
|
+
export interface SortableItemsProps {
|
|
21
|
+
/** The stable key per position, in order. Supplied by the collection. */
|
|
22
|
+
ids: readonly string[];
|
|
23
|
+
onMove: (from: number, to: number) => void;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A handle for one item, for the template's chrome to render.
|
|
29
|
+
*
|
|
30
|
+
* Returned as props rather than as an element so the handle sits wherever the
|
|
31
|
+
* controls sit, in the margin, and inherits their positioning.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useDragHandle(id: string, disabled?: boolean): {
|
|
34
|
+
handleProps: {
|
|
35
|
+
role: string;
|
|
36
|
+
tabIndex: number;
|
|
37
|
+
'aria-disabled': boolean;
|
|
38
|
+
'aria-pressed': boolean | undefined;
|
|
39
|
+
'aria-roledescription': string;
|
|
40
|
+
'aria-describedby': string;
|
|
41
|
+
};
|
|
42
|
+
setNodeRef: (node: HTMLElement | null) => void;
|
|
43
|
+
style: {
|
|
44
|
+
transform: string | undefined;
|
|
45
|
+
transition: string | undefined;
|
|
46
|
+
zIndex: number | undefined;
|
|
47
|
+
opacity: number | undefined;
|
|
48
|
+
};
|
|
49
|
+
isDragging: boolean;
|
|
50
|
+
};
|
|
51
|
+
export declare function SortableItems({ ids, onMove, disabled, children, }: SortableItemsProps): import("react").JSX.Element;
|
|
52
|
+
//# sourceMappingURL=SortableItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortableItems.d.ts","sourceRoot":"","sources":["../../src/collections/SortableItems.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAsBvC;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;EA8B3D;AAED,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,MAAM,EACN,QAAQ,EACR,QAAQ,GACT,EAAE,kBAAkB,+BA0EpB"}
|