@karibsen/eponyme 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 +609 -0
- package/dist/eponyme.d.mts +15 -0
- package/dist/eponyme.mjs +38 -0
- package/dist/module.d.mts +26 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +154 -0
- package/dist/runtime/assets/dashboard.css +1 -0
- package/dist/runtime/components/editor/EponymeCollectionPage.d.vue.ts +9 -0
- package/dist/runtime/components/editor/EponymeCollectionPage.vue +238 -0
- package/dist/runtime/components/editor/EponymeCollectionPage.vue.d.ts +9 -0
- package/dist/runtime/components/editor/EponymeCopy.d.vue.ts +7 -0
- package/dist/runtime/components/editor/EponymeCopy.vue +28 -0
- package/dist/runtime/components/editor/EponymeCopy.vue.d.ts +7 -0
- package/dist/runtime/components/editor/EponymeFolderNav.d.vue.ts +7 -0
- package/dist/runtime/components/editor/EponymeFolderNav.vue +146 -0
- package/dist/runtime/components/editor/EponymeFolderNav.vue.d.ts +7 -0
- package/dist/runtime/components/editor/EponymeFolderPage.d.vue.ts +7 -0
- package/dist/runtime/components/editor/EponymeFolderPage.vue +62 -0
- package/dist/runtime/components/editor/EponymeFolderPage.vue.d.ts +7 -0
- package/dist/runtime/components/editor/EponymeForm.d.vue.ts +9 -0
- package/dist/runtime/components/editor/EponymeForm.vue +309 -0
- package/dist/runtime/components/editor/EponymeForm.vue.d.ts +9 -0
- package/dist/runtime/components/editor/EponymeFormPage.d.vue.ts +8 -0
- package/dist/runtime/components/editor/EponymeFormPage.vue +288 -0
- package/dist/runtime/components/editor/EponymeFormPage.vue.d.ts +8 -0
- package/dist/runtime/components/editor/EponymeHistoryDialog.d.vue.ts +14 -0
- package/dist/runtime/components/editor/EponymeHistoryDialog.vue +97 -0
- package/dist/runtime/components/editor/EponymeHistoryDialog.vue.d.ts +14 -0
- package/dist/runtime/components/editor/EponymeNavigationLink.d.vue.ts +14 -0
- package/dist/runtime/components/editor/EponymeNavigationLink.vue +80 -0
- package/dist/runtime/components/editor/EponymeNavigationLink.vue.d.ts +14 -0
- package/dist/runtime/components/editor/EponymePageNavigation.d.vue.ts +8 -0
- package/dist/runtime/components/editor/EponymePageNavigation.vue +58 -0
- package/dist/runtime/components/editor/EponymePageNavigation.vue.d.ts +8 -0
- package/dist/runtime/components/editor/EponymePreviewPanel.d.vue.ts +16 -0
- package/dist/runtime/components/editor/EponymePreviewPanel.vue +100 -0
- package/dist/runtime/components/editor/EponymePreviewPanel.vue.d.ts +16 -0
- package/dist/runtime/components/editor/EponymeSidebar.d.vue.ts +6 -0
- package/dist/runtime/components/editor/EponymeSidebar.vue +244 -0
- package/dist/runtime/components/editor/EponymeSidebar.vue.d.ts +6 -0
- package/dist/runtime/components/editor/EponymeSidebarTree.d.vue.ts +18 -0
- package/dist/runtime/components/editor/EponymeSidebarTree.vue +84 -0
- package/dist/runtime/components/editor/EponymeSidebarTree.vue.d.ts +18 -0
- package/dist/runtime/components/fields/ArrayField.d.vue.ts +19 -0
- package/dist/runtime/components/fields/ArrayField.vue +198 -0
- package/dist/runtime/components/fields/ArrayField.vue.d.ts +19 -0
- package/dist/runtime/components/fields/BooleanField.d.vue.ts +16 -0
- package/dist/runtime/components/fields/BooleanField.vue +36 -0
- package/dist/runtime/components/fields/BooleanField.vue.d.ts +16 -0
- package/dist/runtime/components/fields/CheckboxGroupField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/CheckboxGroupField.vue +52 -0
- package/dist/runtime/components/fields/CheckboxGroupField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/ColorField.d.vue.ts +19 -0
- package/dist/runtime/components/fields/ColorField.vue +39 -0
- package/dist/runtime/components/fields/ColorField.vue.d.ts +19 -0
- package/dist/runtime/components/fields/DateField.d.vue.ts +18 -0
- package/dist/runtime/components/fields/DateField.vue +39 -0
- package/dist/runtime/components/fields/DateField.vue.d.ts +18 -0
- package/dist/runtime/components/fields/FieldRenderer.d.vue.ts +24 -0
- package/dist/runtime/components/fields/FieldRenderer.vue +135 -0
- package/dist/runtime/components/fields/FieldRenderer.vue.d.ts +24 -0
- package/dist/runtime/components/fields/NumberField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/NumberField.vue +58 -0
- package/dist/runtime/components/fields/NumberField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/RadioField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/RadioField.vue +44 -0
- package/dist/runtime/components/fields/RadioField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/RichTextField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/RichTextField.vue +176 -0
- package/dist/runtime/components/fields/RichTextField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/SectionField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/SectionField.vue +127 -0
- package/dist/runtime/components/fields/SectionField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/SelectField.d.vue.ts +21 -0
- package/dist/runtime/components/fields/SelectField.vue +42 -0
- package/dist/runtime/components/fields/SelectField.vue.d.ts +21 -0
- package/dist/runtime/components/fields/SlugField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/SlugField.vue +35 -0
- package/dist/runtime/components/fields/SlugField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/TabsField.d.vue.ts +19 -0
- package/dist/runtime/components/fields/TabsField.vue +109 -0
- package/dist/runtime/components/fields/TabsField.vue.d.ts +19 -0
- package/dist/runtime/components/fields/TextField.d.vue.ts +22 -0
- package/dist/runtime/components/fields/TextField.vue +56 -0
- package/dist/runtime/components/fields/TextField.vue.d.ts +22 -0
- package/dist/runtime/components/fields/TextareaField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/TextareaField.vue +47 -0
- package/dist/runtime/components/fields/TextareaField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/UrlField.d.vue.ts +17 -0
- package/dist/runtime/components/fields/UrlField.vue +35 -0
- package/dist/runtime/components/fields/UrlField.vue.d.ts +17 -0
- package/dist/runtime/components/ui/EPAccordion.d.vue.ts +26 -0
- package/dist/runtime/components/ui/EPAccordion.vue +64 -0
- package/dist/runtime/components/ui/EPAccordion.vue.d.ts +26 -0
- package/dist/runtime/components/ui/EPAvatar.d.vue.ts +9 -0
- package/dist/runtime/components/ui/EPAvatar.vue +25 -0
- package/dist/runtime/components/ui/EPAvatar.vue.d.ts +9 -0
- package/dist/runtime/components/ui/EPBadge.d.vue.ts +16 -0
- package/dist/runtime/components/ui/EPBadge.vue +17 -0
- package/dist/runtime/components/ui/EPBadge.vue.d.ts +16 -0
- package/dist/runtime/components/ui/EPButton.d.vue.ts +22 -0
- package/dist/runtime/components/ui/EPButton.vue +55 -0
- package/dist/runtime/components/ui/EPButton.vue.d.ts +22 -0
- package/dist/runtime/components/ui/EPCheckbox.d.vue.ts +11 -0
- package/dist/runtime/components/ui/EPCheckbox.vue +21 -0
- package/dist/runtime/components/ui/EPCheckbox.vue.d.ts +11 -0
- package/dist/runtime/components/ui/EPColorPicker.d.vue.ts +19 -0
- package/dist/runtime/components/ui/EPColorPicker.vue +63 -0
- package/dist/runtime/components/ui/EPColorPicker.vue.d.ts +19 -0
- package/dist/runtime/components/ui/EPDialog.d.vue.ts +24 -0
- package/dist/runtime/components/ui/EPDialog.vue +54 -0
- package/dist/runtime/components/ui/EPDialog.vue.d.ts +24 -0
- package/dist/runtime/components/ui/EPDropdownMenu.d.vue.ts +25 -0
- package/dist/runtime/components/ui/EPDropdownMenu.vue +40 -0
- package/dist/runtime/components/ui/EPDropdownMenu.vue.d.ts +25 -0
- package/dist/runtime/components/ui/EPFormField.d.vue.ts +24 -0
- package/dist/runtime/components/ui/EPFormField.vue +62 -0
- package/dist/runtime/components/ui/EPFormField.vue.d.ts +24 -0
- package/dist/runtime/components/ui/EPInputText.d.vue.ts +17 -0
- package/dist/runtime/components/ui/EPInputText.vue +33 -0
- package/dist/runtime/components/ui/EPInputText.vue.d.ts +17 -0
- package/dist/runtime/components/ui/EPLinkEditor.d.vue.ts +16 -0
- package/dist/runtime/components/ui/EPLinkEditor.vue +169 -0
- package/dist/runtime/components/ui/EPLinkEditor.vue.d.ts +16 -0
- package/dist/runtime/components/ui/EPRadioButton.d.vue.ts +16 -0
- package/dist/runtime/components/ui/EPRadioButton.vue +34 -0
- package/dist/runtime/components/ui/EPRadioButton.vue.d.ts +16 -0
- package/dist/runtime/components/ui/EPSelect.d.vue.ts +21 -0
- package/dist/runtime/components/ui/EPSelect.vue +73 -0
- package/dist/runtime/components/ui/EPSelect.vue.d.ts +21 -0
- package/dist/runtime/components/ui/EPSlider.d.vue.ts +16 -0
- package/dist/runtime/components/ui/EPSlider.vue +51 -0
- package/dist/runtime/components/ui/EPSlider.vue.d.ts +16 -0
- package/dist/runtime/components/ui/EPSwitch.d.vue.ts +11 -0
- package/dist/runtime/components/ui/EPSwitch.vue +23 -0
- package/dist/runtime/components/ui/EPSwitch.vue.d.ts +11 -0
- package/dist/runtime/components/ui/EPTextarea.d.vue.ts +12 -0
- package/dist/runtime/components/ui/EPTextarea.vue +18 -0
- package/dist/runtime/components/ui/EPTextarea.vue.d.ts +12 -0
- package/dist/runtime/components/ui/EPToast.d.vue.ts +13 -0
- package/dist/runtime/components/ui/EPToast.vue +60 -0
- package/dist/runtime/components/ui/EPToast.vue.d.ts +13 -0
- package/dist/runtime/components/ui/EPTooltip.d.vue.ts +17 -0
- package/dist/runtime/components/ui/EPTooltip.vue +34 -0
- package/dist/runtime/components/ui/EPTooltip.vue.d.ts +17 -0
- package/dist/runtime/components/ui/form-field-context.d.ts +12 -0
- package/dist/runtime/components/ui/form-field-context.js +1 -0
- package/dist/runtime/composables/useEponyme.d.ts +24 -0
- package/dist/runtime/composables/useEponyme.js +63 -0
- package/dist/runtime/composables/useEponymeAuth.d.ts +16 -0
- package/dist/runtime/composables/useEponymeAuth.js +81 -0
- package/dist/runtime/composables/useEponymeCollection.d.ts +27 -0
- package/dist/runtime/composables/useEponymeCollection.js +44 -0
- package/dist/runtime/composables/useEponymeColorPresets.d.ts +5 -0
- package/dist/runtime/composables/useEponymeColorPresets.js +16 -0
- package/dist/runtime/composables/useEponymeConfig.d.ts +1 -0
- package/dist/runtime/composables/useEponymeConfig.js +4 -0
- package/dist/runtime/composables/useEponymeForm.d.ts +35 -0
- package/dist/runtime/composables/useEponymeForm.js +75 -0
- package/dist/runtime/composables/useEponymeHistory.d.ts +26 -0
- package/dist/runtime/composables/useEponymeHistory.js +24 -0
- package/dist/runtime/composables/useEponymeValidation.d.ts +21 -0
- package/dist/runtime/composables/useEponymeValidation.js +34 -0
- package/dist/runtime/fields/array.d.ts +2 -0
- package/dist/runtime/fields/array.js +3 -0
- package/dist/runtime/fields/boolean.d.ts +2 -0
- package/dist/runtime/fields/boolean.js +3 -0
- package/dist/runtime/fields/checkbox-group.d.ts +2 -0
- package/dist/runtime/fields/checkbox-group.js +3 -0
- package/dist/runtime/fields/color.d.ts +2 -0
- package/dist/runtime/fields/color.js +3 -0
- package/dist/runtime/fields/date.d.ts +3 -0
- package/dist/runtime/fields/date.js +6 -0
- package/dist/runtime/fields/email.d.ts +2 -0
- package/dist/runtime/fields/email.js +3 -0
- package/dist/runtime/fields/image.d.ts +2 -0
- package/dist/runtime/fields/image.js +3 -0
- package/dist/runtime/fields/index.d.ts +37 -0
- package/dist/runtime/fields/index.js +19 -0
- package/dist/runtime/fields/number.d.ts +2 -0
- package/dist/runtime/fields/number.js +3 -0
- package/dist/runtime/fields/radio.d.ts +2 -0
- package/dist/runtime/fields/radio.js +3 -0
- package/dist/runtime/fields/rich-text.d.ts +2 -0
- package/dist/runtime/fields/rich-text.js +3 -0
- package/dist/runtime/fields/section.d.ts +2 -0
- package/dist/runtime/fields/section.js +3 -0
- package/dist/runtime/fields/select.d.ts +2 -0
- package/dist/runtime/fields/select.js +3 -0
- package/dist/runtime/fields/slug.d.ts +2 -0
- package/dist/runtime/fields/slug.js +3 -0
- package/dist/runtime/fields/string.d.ts +2 -0
- package/dist/runtime/fields/string.js +3 -0
- package/dist/runtime/fields/tab.d.ts +2 -0
- package/dist/runtime/fields/tab.js +3 -0
- package/dist/runtime/fields/textarea.d.ts +2 -0
- package/dist/runtime/fields/textarea.js +3 -0
- package/dist/runtime/fields/url.d.ts +2 -0
- package/dist/runtime/fields/url.js +3 -0
- package/dist/runtime/middleware/eponyme-auth.d.ts +2 -0
- package/dist/runtime/middleware/eponyme-auth.js +13 -0
- package/dist/runtime/middleware/eponyme-owner.d.ts +2 -0
- package/dist/runtime/middleware/eponyme-owner.js +7 -0
- package/dist/runtime/pages/EponymeChangePasswordPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeChangePasswordPage.vue +118 -0
- package/dist/runtime/pages/EponymeChangePasswordPage.vue.d.ts +3 -0
- package/dist/runtime/pages/EponymeDetailPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeDetailPage.vue +83 -0
- package/dist/runtime/pages/EponymeDetailPage.vue.d.ts +3 -0
- package/dist/runtime/pages/EponymeIndexPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeIndexPage.vue +51 -0
- package/dist/runtime/pages/EponymeIndexPage.vue.d.ts +3 -0
- package/dist/runtime/pages/EponymeLoginPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeLoginPage.vue +102 -0
- package/dist/runtime/pages/EponymeLoginPage.vue.d.ts +3 -0
- package/dist/runtime/pages/EponymeUsersPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeUsersPage.vue +261 -0
- package/dist/runtime/pages/EponymeUsersPage.vue.d.ts +3 -0
- package/dist/runtime/server/api/eponyme/[name].get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme/[name].get.js +20 -0
- package/dist/runtime/server/api/eponyme/[name].patch.d.ts +11 -0
- package/dist/runtime/server/api/eponyme/[name].patch.js +20 -0
- package/dist/runtime/server/api/eponyme-auth/change-password.post.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-auth/change-password.post.js +21 -0
- package/dist/runtime/server/api/eponyme-auth/login.post.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-auth/login.post.js +12 -0
- package/dist/runtime/server/api/eponyme-auth/logout.post.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-auth/logout.post.js +13 -0
- package/dist/runtime/server/api/eponyme-auth/session.get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-auth/session.get.js +5 -0
- package/dist/runtime/server/api/eponyme-collections/[path].delete.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-collections/[path].delete.js +11 -0
- package/dist/runtime/server/api/eponyme-collections/[path].get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-collections/[path].get.js +11 -0
- package/dist/runtime/server/api/eponyme-collections/[path].post.d.ts +7 -0
- package/dist/runtime/server/api/eponyme-collections/[path].post.js +16 -0
- package/dist/runtime/server/api/eponyme-forms/[path].delete.d.ts +6 -0
- package/dist/runtime/server/api/eponyme-forms/[path].delete.js +19 -0
- package/dist/runtime/server/api/eponyme-forms/[path].get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-forms/[path].get.js +22 -0
- package/dist/runtime/server/api/eponyme-forms/[path].post.d.ts +19 -0
- package/dist/runtime/server/api/eponyme-forms/[path].post.js +36 -0
- package/dist/runtime/server/api/eponyme-history/[path].get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-history/[path].get.js +11 -0
- package/dist/runtime/server/api/eponyme-history/[path].patch.d.ts +2 -0
- package/dist/runtime/server/api/eponyme-history/[path].patch.js +18 -0
- package/dist/runtime/server/api/eponyme-sitemap.get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-sitemap.get.js +5 -0
- package/dist/runtime/server/api/eponyme-statuses.get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-statuses.get.js +7 -0
- package/dist/runtime/server/api/eponyme-users/[id]/reset-password.post.d.ts +5 -0
- package/dist/runtime/server/api/eponyme-users/[id]/reset-password.post.js +12 -0
- package/dist/runtime/server/api/eponyme-users/[id].patch.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-users/[id].patch.js +14 -0
- package/dist/runtime/server/api/eponyme-users/index.get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-users/index.get.js +7 -0
- package/dist/runtime/server/api/eponyme-users/index.post.d.ts +5 -0
- package/dist/runtime/server/api/eponyme-users/index.post.js +13 -0
- package/dist/runtime/server/plugins/eponyme-sync.d.ts +2 -0
- package/dist/runtime/server/plugins/eponyme-sync.js +14 -0
- package/dist/runtime/server/services/eponyme-auth-service.d.ts +2 -0
- package/dist/runtime/server/services/eponyme-auth-service.js +15 -0
- package/dist/runtime/server/services/eponyme-auth-store.d.ts +119 -0
- package/dist/runtime/server/services/eponyme-auth-store.js +227 -0
- package/dist/runtime/server/services/eponyme-form-service.d.ts +3 -0
- package/dist/runtime/server/services/eponyme-form-service.js +8 -0
- package/dist/runtime/server/services/eponyme-form-store.d.ts +100 -0
- package/dist/runtime/server/services/eponyme-form-store.js +109 -0
- package/dist/runtime/server/services/eponyme-service.d.ts +3 -0
- package/dist/runtime/server/services/eponyme-service.js +8 -0
- package/dist/runtime/server/services/eponyme-store.d.ts +202 -0
- package/dist/runtime/server/services/eponyme-store.js +338 -0
- package/dist/runtime/server/utils/auth.d.ts +11 -0
- package/dist/runtime/server/utils/auth.js +41 -0
- package/dist/runtime/server/utils/eponyme-form.d.ts +14 -0
- package/dist/runtime/server/utils/eponyme-form.js +6 -0
- package/dist/runtime/server/utils/eponyme-sitemap.d.ts +7 -0
- package/dist/runtime/server/utils/eponyme-sitemap.js +7 -0
- package/dist/runtime/server/utils/form-route.d.ts +14 -0
- package/dist/runtime/server/utils/form-route.js +14 -0
- package/dist/runtime/server/utils/password.d.ts +4 -0
- package/dist/runtime/server/utils/password.js +30 -0
- package/dist/runtime/types/auth.d.ts +20 -0
- package/dist/runtime/types/auth.js +7 -0
- package/dist/runtime/types/eponyme-config.d.ts +11 -0
- package/dist/runtime/types/eponyme-navigation.d.ts +6 -0
- package/dist/runtime/types/eponyme-navigation.js +0 -0
- package/dist/runtime/types/eponyme.d.ts +87 -0
- package/dist/runtime/types/eponyme.js +0 -0
- package/dist/runtime/types/field.d.ts +203 -0
- package/dist/runtime/types/field.js +0 -0
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/index.js +3 -0
- package/dist/runtime/types/nuxt.d.ts +11 -0
- package/dist/runtime/utils/as-record.d.ts +1 -0
- package/dist/runtime/utils/as-record.js +3 -0
- package/dist/runtime/utils/build-eponyme-schema.d.ts +22 -0
- package/dist/runtime/utils/build-eponyme-schema.js +42 -0
- package/dist/runtime/utils/changed-paths.d.ts +6 -0
- package/dist/runtime/utils/changed-paths.js +25 -0
- package/dist/runtime/utils/create-default-eponyme-data.d.ts +5 -0
- package/dist/runtime/utils/create-default-eponyme-data.js +12 -0
- package/dist/runtime/utils/field-path.d.ts +14 -0
- package/dist/runtime/utils/field-path.js +23 -0
- package/dist/runtime/utils/get-eponyme-schemas.d.ts +7 -0
- package/dist/runtime/utils/get-eponyme-schemas.js +33 -0
- package/dist/runtime/utils/get-field-default-value.d.ts +4 -0
- package/dist/runtime/utils/get-field-default-value.js +56 -0
- package/dist/runtime/utils/humanize-label.d.ts +6 -0
- package/dist/runtime/utils/humanize-label.js +3 -0
- package/dist/runtime/utils/initials.d.ts +1 -0
- package/dist/runtime/utils/initials.js +3 -0
- package/dist/runtime/utils/is-field-visible.d.ts +2 -0
- package/dist/runtime/utils/is-field-visible.js +14 -0
- package/dist/runtime/utils/normalize-hex-color.d.ts +8 -0
- package/dist/runtime/utils/normalize-hex-color.js +11 -0
- package/dist/runtime/utils/normalize-slug.d.ts +1 -0
- package/dist/runtime/utils/normalize-slug.js +4 -0
- package/dist/runtime/utils/preview.d.ts +30 -0
- package/dist/runtime/utils/preview.js +30 -0
- package/dist/runtime/utils/validate-eponyme-data.d.ts +10 -0
- package/dist/runtime/utils/validate-eponyme-data.js +204 -0
- package/dist/types.d.mts +11 -0
- package/package.json +96 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useAsyncData, useRequestFetch } from "#app";
|
|
3
|
+
import { FlexRender, createColumnHelper, getCoreRowModel, getSortedRowModel, useVueTable } from "@tanstack/vue-table";
|
|
4
|
+
import { computed, ref, watch } from "vue";
|
|
5
|
+
import { humanizeLabel } from "../../utils/humanize-label";
|
|
6
|
+
import { useEponymeAuth } from "../../composables/useEponymeAuth";
|
|
7
|
+
import EPBadge from "../ui/EPBadge.vue";
|
|
8
|
+
import EPButton from "../ui/EPButton.vue";
|
|
9
|
+
import EPDialog from "../ui/EPDialog.vue";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
name: { type: String, required: true },
|
|
12
|
+
definition: { type: Object, required: true }
|
|
13
|
+
});
|
|
14
|
+
const requestFetch = useRequestFetch();
|
|
15
|
+
const auth = useEponymeAuth();
|
|
16
|
+
const managed = computed(() => props.definition.submission.mode === "managed");
|
|
17
|
+
const page = ref(1);
|
|
18
|
+
const sorting = ref([{ id: "createdAt", desc: true }]);
|
|
19
|
+
const selected = ref();
|
|
20
|
+
const clearing = ref(false);
|
|
21
|
+
const label = computed(() => props.definition.label || humanizeLabel(props.name.split("/").at(-1) || props.name));
|
|
22
|
+
const { data: response, pending, refresh } = useAsyncData(
|
|
23
|
+
() => `eponyme:form:${props.name}:${page.value}`,
|
|
24
|
+
() => managed.value ? requestFetch(`/api/eponyme-forms/${props.name}/submissions`, { query: { page: page.value } }) : Promise.resolve(void 0),
|
|
25
|
+
{ watch: [page, () => props.name] }
|
|
26
|
+
);
|
|
27
|
+
const submissions = computed(() => response.value?.submissions ?? []);
|
|
28
|
+
const total = computed(() => response.value?.total ?? 0);
|
|
29
|
+
const perPage = computed(() => response.value?.perPage ?? 25);
|
|
30
|
+
const pageCount = computed(() => Math.max(1, Math.ceil(total.value / perPage.value)));
|
|
31
|
+
const columnHelper = createColumnHelper();
|
|
32
|
+
const columns = computed(() => [
|
|
33
|
+
...Object.entries(props.definition.fields).map(([fieldName, field]) => columnHelper.accessor(
|
|
34
|
+
(row) => formatValue(row.data[fieldName]),
|
|
35
|
+
{
|
|
36
|
+
id: fieldName,
|
|
37
|
+
header: humanizeLabel(fieldName, field.options.label),
|
|
38
|
+
cell: (info) => truncate(info.getValue())
|
|
39
|
+
}
|
|
40
|
+
)),
|
|
41
|
+
columnHelper.accessor((row) => row.createdAt, {
|
|
42
|
+
id: "createdAt",
|
|
43
|
+
header: "Received",
|
|
44
|
+
cell: (info) => formatDate(info.getValue())
|
|
45
|
+
})
|
|
46
|
+
]);
|
|
47
|
+
const table = useVueTable({
|
|
48
|
+
get data() {
|
|
49
|
+
return submissions.value;
|
|
50
|
+
},
|
|
51
|
+
get columns() {
|
|
52
|
+
return columns.value;
|
|
53
|
+
},
|
|
54
|
+
state: {
|
|
55
|
+
get sorting() {
|
|
56
|
+
return sorting.value;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
onSortingChange: (updater) => {
|
|
60
|
+
sorting.value = typeof updater === "function" ? updater(sorting.value) : updater;
|
|
61
|
+
},
|
|
62
|
+
getCoreRowModel: getCoreRowModel(),
|
|
63
|
+
// Sorting is client-side, so it only reorders the page currently loaded.
|
|
64
|
+
getSortedRowModel: getSortedRowModel()
|
|
65
|
+
});
|
|
66
|
+
watch(() => props.name, () => {
|
|
67
|
+
page.value = 1;
|
|
68
|
+
selected.value = void 0;
|
|
69
|
+
});
|
|
70
|
+
function formatValue(value) {
|
|
71
|
+
if (value == null) return "";
|
|
72
|
+
if (Array.isArray(value)) return value.map((item) => formatValue(item)).join(", ");
|
|
73
|
+
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
74
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
75
|
+
return String(value);
|
|
76
|
+
}
|
|
77
|
+
function truncate(value, maxLength = 60) {
|
|
78
|
+
const characters = [...value];
|
|
79
|
+
return characters.length <= maxLength ? value : `${characters.slice(0, maxLength - 1).join("")}\u2026`;
|
|
80
|
+
}
|
|
81
|
+
function formatDate(value) {
|
|
82
|
+
return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(new Date(value));
|
|
83
|
+
}
|
|
84
|
+
async function clearAll() {
|
|
85
|
+
if (!confirm(`Delete all ${total.value} submissions of \u201C${label.value}\u201D? This cannot be undone.`)) return;
|
|
86
|
+
clearing.value = true;
|
|
87
|
+
try {
|
|
88
|
+
await requestFetch(`/api/eponyme-forms/${props.name}/submissions`, { method: "DELETE" });
|
|
89
|
+
selected.value = void 0;
|
|
90
|
+
page.value = 1;
|
|
91
|
+
await refresh();
|
|
92
|
+
} finally {
|
|
93
|
+
clearing.value = false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function deleteSubmission(submission) {
|
|
97
|
+
if (!confirm("Delete this submission? This cannot be undone.")) return;
|
|
98
|
+
await requestFetch(`/api/eponyme-forms/${props.name}/submissions/${submission.id}`, { method: "DELETE" });
|
|
99
|
+
if (selected.value?.id === submission.id) selected.value = void 0;
|
|
100
|
+
if (submissions.value.length === 1 && page.value > 1) page.value -= 1;
|
|
101
|
+
else await refresh();
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<template>
|
|
106
|
+
<section class="ep:mx-auto ep:w-full ep:max-w-5xl ep:px-6 ep:py-8 ep:md:px-10 ep:md:py-12">
|
|
107
|
+
<header class="ep:flex ep:flex-wrap ep:items-start ep:justify-between ep:gap-4">
|
|
108
|
+
<div>
|
|
109
|
+
<p class="ep:m-0 ep:text-[11px] ep:font-semibold ep:tracking-widest ep:text-muted-ep ep:uppercase">
|
|
110
|
+
Form
|
|
111
|
+
</p>
|
|
112
|
+
<h1 class="ep:mt-2 ep:mb-0 ep:text-3xl ep:font-semibold ep:tracking-tight ep:text-white">
|
|
113
|
+
{{ label }}
|
|
114
|
+
</h1>
|
|
115
|
+
<p
|
|
116
|
+
v-if="definition.description"
|
|
117
|
+
class="ep:mt-2 ep:mb-0 ep:text-sm ep:text-muted-ep"
|
|
118
|
+
>
|
|
119
|
+
{{ definition.description }}
|
|
120
|
+
</p>
|
|
121
|
+
</div>
|
|
122
|
+
<div class="ep:flex ep:items-center ep:gap-3">
|
|
123
|
+
<EPBadge :variant="managed ? 'success' : 'neutral'">
|
|
124
|
+
{{ definition.submission.mode }}
|
|
125
|
+
</EPBadge>
|
|
126
|
+
<EPButton
|
|
127
|
+
v-if="managed && auth.canEdit.value && total > 0"
|
|
128
|
+
size="sm"
|
|
129
|
+
variant="danger"
|
|
130
|
+
:loading="clearing"
|
|
131
|
+
@click="clearAll"
|
|
132
|
+
>
|
|
133
|
+
Clear all
|
|
134
|
+
</EPButton>
|
|
135
|
+
</div>
|
|
136
|
+
</header>
|
|
137
|
+
|
|
138
|
+
<div
|
|
139
|
+
v-if="!managed"
|
|
140
|
+
class="ep:mt-8 ep:rounded-xl ep:border ep:border-dashed ep:border-border-ep ep:p-8 ep:text-center"
|
|
141
|
+
>
|
|
142
|
+
<p class="ep:m-0 ep:text-sm ep:text-muted-ep">
|
|
143
|
+
This form uses the custom submission mode, so Eponyme does not store its submissions.
|
|
144
|
+
</p>
|
|
145
|
+
<p class="ep:mt-2 ep:mb-0 ep:text-xs ep:text-muted-ep">
|
|
146
|
+
Switch it to <code>submission: {{ "{" }} mode: 'managed' {{ "}" }}</code> to collect them here.
|
|
147
|
+
</p>
|
|
148
|
+
</div>
|
|
149
|
+
<p
|
|
150
|
+
v-else-if="pending"
|
|
151
|
+
class="ep:mt-8 ep:text-sm ep:text-muted-ep"
|
|
152
|
+
>
|
|
153
|
+
Loading…
|
|
154
|
+
</p>
|
|
155
|
+
<div
|
|
156
|
+
v-else-if="submissions.length"
|
|
157
|
+
class="ep:mt-8"
|
|
158
|
+
>
|
|
159
|
+
<div class="ep:overflow-x-auto ep:rounded-xl ep:bg-selected-ep/50">
|
|
160
|
+
<table class="ep:w-full ep:border-collapse ep:text-left ep:text-sm">
|
|
161
|
+
<thead>
|
|
162
|
+
<tr
|
|
163
|
+
v-for="headerGroup in table.getHeaderGroups()"
|
|
164
|
+
:key="headerGroup.id"
|
|
165
|
+
>
|
|
166
|
+
<th
|
|
167
|
+
v-for="header in headerGroup.headers"
|
|
168
|
+
:key="header.id"
|
|
169
|
+
scope="col"
|
|
170
|
+
class="ep:border-b ep:border-border-ep ep:p-3 ep:text-[11px] ep:font-semibold ep:tracking-widest ep:text-muted-ep ep:uppercase"
|
|
171
|
+
>
|
|
172
|
+
<button
|
|
173
|
+
type="button"
|
|
174
|
+
class="ep:flex ep:cursor-pointer ep:items-center ep:gap-1 ep:border-0 ep:bg-transparent ep:p-0 ep:text-inherit ep:uppercase"
|
|
175
|
+
:aria-sort="header.column.getIsSorted() === 'asc' ? 'ascending' : header.column.getIsSorted() === 'desc' ? 'descending' : 'none'"
|
|
176
|
+
@click="header.column.toggleSorting()"
|
|
177
|
+
>
|
|
178
|
+
<FlexRender
|
|
179
|
+
:render="header.column.columnDef.header"
|
|
180
|
+
:props="header.getContext()"
|
|
181
|
+
/>
|
|
182
|
+
<span aria-hidden="true">{{ header.column.getIsSorted() === "asc" ? "\u2191" : header.column.getIsSorted() === "desc" ? "\u2193" : "" }}</span>
|
|
183
|
+
</button>
|
|
184
|
+
</th>
|
|
185
|
+
<th
|
|
186
|
+
scope="col"
|
|
187
|
+
class="ep:border-b ep:border-border-ep ep:p-3"
|
|
188
|
+
>
|
|
189
|
+
<span class="ep:sr-only">Actions</span>
|
|
190
|
+
</th>
|
|
191
|
+
</tr>
|
|
192
|
+
</thead>
|
|
193
|
+
<tbody>
|
|
194
|
+
<tr
|
|
195
|
+
v-for="row in table.getRowModel().rows"
|
|
196
|
+
:key="row.id"
|
|
197
|
+
class="ep:group ep:border-b ep:border-border-ep/50 ep:last:border-0"
|
|
198
|
+
>
|
|
199
|
+
<td
|
|
200
|
+
v-for="cell in row.getVisibleCells()"
|
|
201
|
+
:key="cell.id"
|
|
202
|
+
class="ep:p-3 ep:align-top ep:text-white"
|
|
203
|
+
>
|
|
204
|
+
<button
|
|
205
|
+
type="button"
|
|
206
|
+
class="ep:cursor-pointer ep:border-0 ep:bg-transparent ep:p-0 ep:text-left ep:text-inherit"
|
|
207
|
+
@click="selected = row.original"
|
|
208
|
+
>
|
|
209
|
+
<FlexRender
|
|
210
|
+
:render="cell.column.columnDef.cell"
|
|
211
|
+
:props="cell.getContext()"
|
|
212
|
+
/>
|
|
213
|
+
</button>
|
|
214
|
+
</td>
|
|
215
|
+
<td class="ep:p-3 ep:text-right ep:align-top">
|
|
216
|
+
<EPButton
|
|
217
|
+
v-if="auth.canEdit.value"
|
|
218
|
+
size="sm"
|
|
219
|
+
variant="danger"
|
|
220
|
+
class="ep:opacity-0 ep:group-hover:opacity-100 ep:focus-visible:opacity-100"
|
|
221
|
+
@click="deleteSubmission(row.original)"
|
|
222
|
+
>
|
|
223
|
+
Delete
|
|
224
|
+
</EPButton>
|
|
225
|
+
</td>
|
|
226
|
+
</tr>
|
|
227
|
+
</tbody>
|
|
228
|
+
</table>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<div class="ep:mt-4 ep:flex ep:flex-wrap ep:items-center ep:justify-between ep:gap-3">
|
|
232
|
+
<p class="ep:m-0 ep:text-xs ep:text-muted-ep">
|
|
233
|
+
{{ total }} submission{{ total === 1 ? "" : "s" }} · page {{ page }} of {{ pageCount }}
|
|
234
|
+
</p>
|
|
235
|
+
<div class="ep:flex ep:gap-2">
|
|
236
|
+
<EPButton
|
|
237
|
+
size="sm"
|
|
238
|
+
:disabled="page <= 1"
|
|
239
|
+
@click="page -= 1"
|
|
240
|
+
>
|
|
241
|
+
Previous
|
|
242
|
+
</EPButton>
|
|
243
|
+
<EPButton
|
|
244
|
+
size="sm"
|
|
245
|
+
:disabled="page >= pageCount"
|
|
246
|
+
@click="page += 1"
|
|
247
|
+
>
|
|
248
|
+
Next
|
|
249
|
+
</EPButton>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
<div
|
|
254
|
+
v-else
|
|
255
|
+
class="ep:mt-8 ep:rounded-xl ep:border ep:border-dashed ep:border-border-ep ep:p-8 ep:text-center"
|
|
256
|
+
>
|
|
257
|
+
<p class="ep:m-0 ep:text-sm ep:text-muted-ep">
|
|
258
|
+
No submissions yet.
|
|
259
|
+
</p>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<EPDialog
|
|
263
|
+
:open="Boolean(selected)"
|
|
264
|
+
title="Submission"
|
|
265
|
+
:description="selected ? formatDate(selected.createdAt) : ''"
|
|
266
|
+
@update:open="(value) => {
|
|
267
|
+
if (!value) selected = void 0;
|
|
268
|
+
}"
|
|
269
|
+
>
|
|
270
|
+
<dl
|
|
271
|
+
v-if="selected"
|
|
272
|
+
class="ep:m-0 ep:grid ep:gap-4"
|
|
273
|
+
>
|
|
274
|
+
<div
|
|
275
|
+
v-for="(field, fieldName) in definition.fields"
|
|
276
|
+
:key="fieldName"
|
|
277
|
+
>
|
|
278
|
+
<dt class="ep:text-[11px] ep:font-semibold ep:tracking-widest ep:text-muted-ep ep:uppercase">
|
|
279
|
+
{{ humanizeLabel(String(fieldName), field.options.label) }}
|
|
280
|
+
</dt>
|
|
281
|
+
<dd class="ep:m-0 ep:mt-1 ep:whitespace-pre-wrap ep:text-sm ep:text-white">
|
|
282
|
+
{{ formatValue(selected.data[fieldName]) || "\u2014" }}
|
|
283
|
+
</dd>
|
|
284
|
+
</div>
|
|
285
|
+
</dl>
|
|
286
|
+
</EPDialog>
|
|
287
|
+
</section>
|
|
288
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EponymeFormDefinitionBase } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
name: string;
|
|
4
|
+
definition: EponymeFormDefinitionBase;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
name: string;
|
|
4
|
+
canRestore?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:open": (value: boolean) => any;
|
|
8
|
+
restored: () => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
onRestored?: (() => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useRequestFetch } from "#app";
|
|
3
|
+
import { ref, watch } from "vue";
|
|
4
|
+
import EPBadge from "../ui/EPBadge.vue";
|
|
5
|
+
import EPButton from "../ui/EPButton.vue";
|
|
6
|
+
import EPDialog from "../ui/EPDialog.vue";
|
|
7
|
+
import { formatVersionDate, useEponymeHistory } from "../../composables/useEponymeHistory";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
open: { type: Boolean, required: true },
|
|
10
|
+
name: { type: String, required: true },
|
|
11
|
+
canRestore: { type: Boolean, required: false, default: false }
|
|
12
|
+
});
|
|
13
|
+
const emit = defineEmits(["update:open", "restored"]);
|
|
14
|
+
const requestFetch = useRequestFetch();
|
|
15
|
+
const { history, pending, error, load } = useEponymeHistory(() => props.name);
|
|
16
|
+
const restoring = ref();
|
|
17
|
+
async function restore(version) {
|
|
18
|
+
if (!confirm(`Restore the version from ${formatVersionDate(version.createdAt)}?`)) return;
|
|
19
|
+
restoring.value = version.id;
|
|
20
|
+
error.value = "";
|
|
21
|
+
try {
|
|
22
|
+
await requestFetch(`/api/eponyme-history/${props.name}/${version.id}`, { method: "PATCH" });
|
|
23
|
+
emit("restored");
|
|
24
|
+
emit("update:open", false);
|
|
25
|
+
} catch {
|
|
26
|
+
error.value = "Unable to restore this version.";
|
|
27
|
+
} finally {
|
|
28
|
+
restoring.value = void 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
watch(() => props.open, (open) => open && void load());
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<EPDialog
|
|
36
|
+
:open="open"
|
|
37
|
+
title="Version history"
|
|
38
|
+
description="Restore an earlier draft or published version of this entry."
|
|
39
|
+
@update:open="emit('update:open', $event)"
|
|
40
|
+
>
|
|
41
|
+
<p
|
|
42
|
+
v-if="pending"
|
|
43
|
+
class="ep:text-sm ep:text-muted-ep"
|
|
44
|
+
>
|
|
45
|
+
Loading versions…
|
|
46
|
+
</p>
|
|
47
|
+
<p
|
|
48
|
+
v-else-if="error"
|
|
49
|
+
class="ep:text-sm ep:text-danger-ep"
|
|
50
|
+
>
|
|
51
|
+
{{ error }}
|
|
52
|
+
</p>
|
|
53
|
+
<p
|
|
54
|
+
v-else-if="!history.length"
|
|
55
|
+
class="ep:text-sm ep:text-muted-ep"
|
|
56
|
+
>
|
|
57
|
+
No saved versions yet.
|
|
58
|
+
</p>
|
|
59
|
+
<ol
|
|
60
|
+
v-else
|
|
61
|
+
class="ep:m-0 ep:grid ep:max-h-[55vh] ep:list-none ep:gap-2 ep:overflow-y-auto ep:p-0"
|
|
62
|
+
>
|
|
63
|
+
<li
|
|
64
|
+
v-for="version in history"
|
|
65
|
+
:key="version.id"
|
|
66
|
+
class="ep:flex ep:items-center ep:justify-between ep:gap-4 ep:rounded-xl ep:bg-selected-ep/40 ep:p-3"
|
|
67
|
+
>
|
|
68
|
+
<div class="ep:min-w-0">
|
|
69
|
+
<div class="ep:flex ep:flex-wrap ep:items-center ep:gap-2">
|
|
70
|
+
<EPBadge :variant="version.status === 'published' ? 'success' : 'warning'">
|
|
71
|
+
{{ version.action }}
|
|
72
|
+
</EPBadge>
|
|
73
|
+
<span class="ep:text-sm ep:font-medium ep:text-white">{{ formatVersionDate(version.createdAt) }}</span>
|
|
74
|
+
</div>
|
|
75
|
+
<p class="ep:mt-1 ep:mb-0 ep:text-xs ep:text-muted-ep">
|
|
76
|
+
Version #{{ version.id }} ·
|
|
77
|
+
<template v-if="version.user">
|
|
78
|
+
by {{ version.user.username }}
|
|
79
|
+
</template>
|
|
80
|
+
<template v-else>
|
|
81
|
+
author unknown
|
|
82
|
+
</template>
|
|
83
|
+
</p>
|
|
84
|
+
</div>
|
|
85
|
+
<EPButton
|
|
86
|
+
v-if="canRestore"
|
|
87
|
+
size="sm"
|
|
88
|
+
:loading="restoring === version.id"
|
|
89
|
+
:disabled="restoring !== void 0"
|
|
90
|
+
@click="restore(version)"
|
|
91
|
+
>
|
|
92
|
+
Restore
|
|
93
|
+
</EPButton>
|
|
94
|
+
</li>
|
|
95
|
+
</ol>
|
|
96
|
+
</EPDialog>
|
|
97
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
name: string;
|
|
4
|
+
canRestore?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:open": (value: boolean) => any;
|
|
8
|
+
restored: () => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
onRestored?: (() => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
to: string;
|
|
3
|
+
label: string;
|
|
4
|
+
variant?: 'sidebar' | 'breadcrumb' | 'card';
|
|
5
|
+
active?: boolean;
|
|
6
|
+
depth?: number;
|
|
7
|
+
folder?: boolean;
|
|
8
|
+
description?: string;
|
|
9
|
+
draft?: boolean;
|
|
10
|
+
collection?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import EPButton from "../ui/EPButton.vue";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
to: { type: String, required: true },
|
|
6
|
+
label: { type: String, required: true },
|
|
7
|
+
variant: { type: String, required: false, default: "sidebar" },
|
|
8
|
+
active: { type: Boolean, required: false, default: false },
|
|
9
|
+
depth: { type: Number, required: false, default: 0 },
|
|
10
|
+
folder: { type: Boolean, required: false, default: false },
|
|
11
|
+
description: { type: String, required: false, default: void 0 },
|
|
12
|
+
draft: { type: Boolean, required: false, default: false },
|
|
13
|
+
collection: { type: Boolean, required: false, default: false }
|
|
14
|
+
});
|
|
15
|
+
const sidebarLabel = computed(() => {
|
|
16
|
+
const maxLength = Math.max(18, 30 - props.depth * 3);
|
|
17
|
+
const characters = [...props.label];
|
|
18
|
+
if (characters.length <= maxLength) return props.label;
|
|
19
|
+
return `${characters.slice(0, maxLength - 1).join("")}\u2026`;
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div
|
|
25
|
+
v-if="variant === 'sidebar'"
|
|
26
|
+
class="ep:relative ep:w-full ep:min-w-0"
|
|
27
|
+
>
|
|
28
|
+
<NuxtLink
|
|
29
|
+
:to="to"
|
|
30
|
+
:aria-current="active ? 'page' : void 0"
|
|
31
|
+
class="eponyme-sidebar-link ep:flex ep:w-full ep:max-w-full ep:min-w-0 ep:items-center ep:rounded-lg ep:py-2 ep:text-sm ep:no-underline"
|
|
32
|
+
:title="label"
|
|
33
|
+
:class="[
|
|
34
|
+
folder ? collection ? 'ep:pr-20 ep:font-medium' : 'ep:pr-10 ep:font-medium' : 'ep:pr-3',
|
|
35
|
+
active ? 'ep:bg-selected-ep ep:text-white ep:hover:bg-selected-ep' : folder ? 'ep:text-text-ep ep:hover:bg-selected-ep/50 ep:hover:text-white' : 'ep:text-muted-ep ep:hover:bg-selected-ep/50 ep:hover:text-white'
|
|
36
|
+
]"
|
|
37
|
+
:style="{ paddingLeft: `${12 + depth * 14}px` }"
|
|
38
|
+
>
|
|
39
|
+
<span class="ep:flex ep:w-full ep:min-w-0 ep:items-center ep:gap-2 ep:overflow-hidden">
|
|
40
|
+
<span class="ep:block ep:min-w-0 ep:flex-1 ep:overflow-hidden ep:text-ellipsis ep:whitespace-nowrap">{{ sidebarLabel }}</span>
|
|
41
|
+
<span
|
|
42
|
+
v-if="draft"
|
|
43
|
+
class="ep:h-1.5 ep:w-1.5 ep:shrink-0 ep:rounded-full ep:bg-warning-ep"
|
|
44
|
+
title="Draft"
|
|
45
|
+
aria-label="Draft"
|
|
46
|
+
/>
|
|
47
|
+
</span>
|
|
48
|
+
</NuxtLink>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<NuxtLink
|
|
52
|
+
v-else-if="variant === 'breadcrumb'"
|
|
53
|
+
:to="to"
|
|
54
|
+
class="ep:rounded-md ep:px-2 ep:py-1.5 ep:font-medium ep:text-muted-ep ep:no-underline ep:transition ep:hover:bg-selected-ep ep:hover:text-white"
|
|
55
|
+
>{{ label }}</NuxtLink>
|
|
56
|
+
|
|
57
|
+
<NuxtLink
|
|
58
|
+
v-else
|
|
59
|
+
:to="to"
|
|
60
|
+
:title="label"
|
|
61
|
+
class="ep:group ep:flex ep:min-h-4 ep:min-w-0 ep:items-center ep:justify-between ep:rounded-xl ep:bg-selected-ep ep:px-5 ep:py-4 ep:font-semibold ep:text-text-ep ep:no-underline ep:transition ep:hover:border-muted-ep ep:hover:bg-selected-ep/80"
|
|
62
|
+
>
|
|
63
|
+
<span class="ep:min-w-0 ep:flex-1">
|
|
64
|
+
<span class="ep:block ep:truncate ep:text-sm ep:text-white">{{ label }}</span>
|
|
65
|
+
<span
|
|
66
|
+
v-if="description"
|
|
67
|
+
class="ep:mt-1 ep:block ep:text-xs ep:font-medium ep:text-muted-ep"
|
|
68
|
+
>{{ description }}</span>
|
|
69
|
+
</span>
|
|
70
|
+
<EPButton
|
|
71
|
+
class="ep:group-hover:translate-x-1 ep:hover:bg-transparent ep:group-hover:text-white"
|
|
72
|
+
variant="ghost"
|
|
73
|
+
icon="mingcute:arrow-right-line"
|
|
74
|
+
/>
|
|
75
|
+
</NuxtLink>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<style scoped>
|
|
79
|
+
.eponyme-sidebar-link{transition:color .2s ease-out,background-color .2s ease-out}
|
|
80
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
to: string;
|
|
3
|
+
label: string;
|
|
4
|
+
variant?: 'sidebar' | 'breadcrumb' | 'card';
|
|
5
|
+
active?: boolean;
|
|
6
|
+
depth?: number;
|
|
7
|
+
folder?: boolean;
|
|
8
|
+
description?: string;
|
|
9
|
+
draft?: boolean;
|
|
10
|
+
collection?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
basePath: string;
|
|
3
|
+
current: string;
|
|
4
|
+
entries: string[];
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
basePath: { type: String, required: true },
|
|
5
|
+
current: { type: String, required: true },
|
|
6
|
+
entries: { type: Array, required: true }
|
|
7
|
+
});
|
|
8
|
+
const currentIndex = computed(() => props.entries.indexOf(props.current));
|
|
9
|
+
const previous = computed(() => currentIndex.value > 0 ? props.entries[currentIndex.value - 1] : void 0);
|
|
10
|
+
const next = computed(() => currentIndex.value >= 0 ? props.entries[currentIndex.value + 1] : void 0);
|
|
11
|
+
function path(name) {
|
|
12
|
+
return `${props.basePath.replace(/\/$/, "")}/${name}`;
|
|
13
|
+
}
|
|
14
|
+
function label(name) {
|
|
15
|
+
return (name.split("/").at(-1) ?? name).replace(/[-_]/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<nav
|
|
21
|
+
v-if="previous || next"
|
|
22
|
+
class="ep:mx-auto ep:grid ep:max-w-3xl ep:grid-cols-1 ep:gap-3 ep:px-6 ep:pb-10 ep:md:grid-cols-2 ep:md:px-10 ep:md:pb-12"
|
|
23
|
+
aria-label="Entry pagination"
|
|
24
|
+
>
|
|
25
|
+
<NuxtLink
|
|
26
|
+
v-if="previous"
|
|
27
|
+
:to="path(previous)"
|
|
28
|
+
class="ep:group ep:flex ep:min-w-0 ep:items-center ep:gap-3 ep:rounded-xl ep:bg-selected-ep/40 ep:px-5 ep:py-4 ep:text-left ep:no-underline ep:transition ep:hover:border-muted-ep ep:hover:bg-selected-ep"
|
|
29
|
+
>
|
|
30
|
+
<span
|
|
31
|
+
class="ep:text-lg ep:text-muted-ep ep:transition ep:group-hover:-translate-x-1 ep:group-hover:text-white"
|
|
32
|
+
aria-hidden="true"
|
|
33
|
+
>←</span>
|
|
34
|
+
<span class="ep:min-w-0">
|
|
35
|
+
<span class="ep:block ep:text-[10px] ep:font-semibold ep:tracking-widest ep:text-muted-ep ep:uppercase">Previous</span>
|
|
36
|
+
<span class="ep:mt-1 ep:block ep:truncate ep:text-sm ep:font-semibold ep:text-white">{{ label(previous) }}</span>
|
|
37
|
+
</span>
|
|
38
|
+
</NuxtLink>
|
|
39
|
+
<span
|
|
40
|
+
v-else
|
|
41
|
+
class="ep:hidden ep:md:block"
|
|
42
|
+
/>
|
|
43
|
+
<NuxtLink
|
|
44
|
+
v-if="next"
|
|
45
|
+
:to="path(next)"
|
|
46
|
+
class="ep:group ep:flex ep:min-w-0 ep:items-center ep:justify-end ep:gap-3 ep:rounded-xl ep:bg-selected-ep/40 ep:px-5 ep:py-4 ep:text-right ep:no-underline ep:transition ep:hover:border-muted-ep ep:hover:bg-selected-ep"
|
|
47
|
+
>
|
|
48
|
+
<span class="ep:min-w-0">
|
|
49
|
+
<span class="ep:block ep:text-[10px] ep:font-semibold ep:tracking-widest ep:text-muted-ep ep:uppercase">Next</span>
|
|
50
|
+
<span class="ep:mt-1 ep:block ep:truncate ep:text-sm ep:font-semibold ep:text-white">{{ label(next) }}</span>
|
|
51
|
+
</span>
|
|
52
|
+
<span
|
|
53
|
+
class="ep:text-lg ep:text-muted-ep ep:transition ep:group-hover:translate-x-1 ep:group-hover:text-white"
|
|
54
|
+
aria-hidden="true"
|
|
55
|
+
>→</span>
|
|
56
|
+
</NuxtLink>
|
|
57
|
+
</nav>
|
|
58
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
basePath: string;
|
|
3
|
+
current: string;
|
|
4
|
+
entries: string[];
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
name: string;
|
|
3
|
+
/** Public route of the site rendering this entry, from `eponyme.previewPaths`. */
|
|
4
|
+
path: string;
|
|
5
|
+
open: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function reload(): Promise<void>;
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
9
|
+
reload: typeof reload;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:open": (value: boolean) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|