@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,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
modelValue?: number;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
step?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: number) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { SliderRange, SliderRoot, SliderThumb, SliderTrack } from "reka-ui";
|
|
3
|
+
import { computed } from "vue";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
id: { type: String, required: false },
|
|
6
|
+
label: { type: String, required: false },
|
|
7
|
+
modelValue: { type: Number, required: false },
|
|
8
|
+
min: { type: Number, required: false },
|
|
9
|
+
max: { type: Number, required: false },
|
|
10
|
+
step: { type: Number, required: false },
|
|
11
|
+
disabled: { type: Boolean, required: false }
|
|
12
|
+
});
|
|
13
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
14
|
+
const minValue = computed(() => props.min ?? 0);
|
|
15
|
+
const maxValue = computed(() => props.max ?? 100);
|
|
16
|
+
const stepValue = computed(() => props.step ?? 1);
|
|
17
|
+
const value = computed(() => Math.min(maxValue.value, Math.max(minValue.value, props.modelValue ?? minValue.value)));
|
|
18
|
+
function update(values) {
|
|
19
|
+
const next = values?.[0];
|
|
20
|
+
if (next !== void 0) emit("update:modelValue", next);
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div class="ep:flex ep:items-center ep:gap-4">
|
|
26
|
+
<SliderRoot
|
|
27
|
+
:model-value="[value]"
|
|
28
|
+
:min="minValue"
|
|
29
|
+
:max="maxValue"
|
|
30
|
+
:step="stepValue"
|
|
31
|
+
:disabled="disabled"
|
|
32
|
+
class="ep:relative ep:flex ep:h-10 ep:flex-1 ep:touch-none ep:items-center ep:select-none ep:data-[disabled]:cursor-not-allowed ep:data-[disabled]:opacity-50"
|
|
33
|
+
@update:model-value="update"
|
|
34
|
+
>
|
|
35
|
+
<SliderTrack class="ep:relative ep:h-2 ep:flex-1 ep:overflow-hidden ep:rounded-full ep:border ep:border-border-ep ep:bg-selected-ep">
|
|
36
|
+
<SliderRange class="ep:absolute ep:h-full ep:bg-white" />
|
|
37
|
+
</SliderTrack>
|
|
38
|
+
<SliderThumb
|
|
39
|
+
:id="id"
|
|
40
|
+
:aria-label="label"
|
|
41
|
+
class="ep:block ep:h-5 ep:w-5 ep:cursor-grab ep:rounded-full ep:border-2 ep:border-white ep:bg-theme-ep ep:outline-none ep:transition-colors ep:hover:bg-text-ep ep:focus-visible:ring-2 ep:focus-visible:ring-white/30 ep:active:cursor-grabbing"
|
|
42
|
+
/>
|
|
43
|
+
</SliderRoot>
|
|
44
|
+
<output
|
|
45
|
+
:for="id"
|
|
46
|
+
class="ep:min-w-12 ep:rounded-lg ep:bg-selected-ep ep:px-2.5 ep:py-1.5 ep:text-center ep:font-sans ep:text-sm ep:font-medium ep:text-white"
|
|
47
|
+
>
|
|
48
|
+
{{ value }}
|
|
49
|
+
</output>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
modelValue?: number;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
step?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: number) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: boolean;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: boolean) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { SwitchRoot, SwitchThumb } from "reka-ui";
|
|
3
|
+
defineProps({
|
|
4
|
+
modelValue: { type: Boolean, required: false },
|
|
5
|
+
disabled: { type: Boolean, required: false }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<SwitchRoot
|
|
12
|
+
:model-value="modelValue"
|
|
13
|
+
:disabled="disabled"
|
|
14
|
+
class="eponyme-switch ep:relative ep:inline-flex ep:h-6 ep:w-11 ep:shrink-0 ep:cursor-pointer ep:items-center ep:rounded-full ep:border ep:border-border-ep ep:bg-selected-ep ep:p-0.5 ep:outline-none ep:focus-visible:ring-2 ep:focus-visible:ring-white/20 ep:data-[state=checked]:border-white ep:data-[state=checked]:bg-white ep:disabled:cursor-not-allowed ep:disabled:opacity-50"
|
|
15
|
+
@update:model-value="emit('update:modelValue', $event)"
|
|
16
|
+
>
|
|
17
|
+
<SwitchThumb class="eponyme-switch-thumb ep:block ep:h-[18px] ep:w-[18px] ep:rounded-full ep:bg-muted-ep ep:data-[state=checked]:bg-theme-ep" />
|
|
18
|
+
</SwitchRoot>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<style scoped>
|
|
22
|
+
.eponyme-switch{transition:background-color .26s ease-in-out,border-color .26s ease-in-out}.eponyme-switch-thumb{transform:translateX(0);transition:transform .28s cubic-bezier(.4,0,.2,1),background-color .26s ease-in-out;will-change:transform}.eponyme-switch-thumb[data-state=checked]{transform:translateX(20px)}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: boolean;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: boolean) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: string;
|
|
3
|
+
invalid?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: string) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
modelValue: { type: String, required: false, default: "" },
|
|
4
|
+
invalid: { type: Boolean, required: false },
|
|
5
|
+
disabled: { type: Boolean, required: false }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<textarea
|
|
12
|
+
:value="modelValue"
|
|
13
|
+
:disabled="disabled"
|
|
14
|
+
:aria-invalid="invalid || void 0"
|
|
15
|
+
class="ep:block ep:min-h-36 ep:w-full ep:min-w-0 ep:resize-none ep:rounded-xl ep:border ep:border-border-ep ep:bg-selected-ep ep:px-4 ep:py-3 ep:font-sans ep:text-sm ep:text-white ep:outline-none ep:transition ep:placeholder:text-muted-ep ep:focus:border-muted-ep ep:focus:ring-2 ep:focus:ring-white/10 ep:aria-invalid:border-danger-ep ep:disabled:cursor-not-allowed ep:disabled:opacity-50"
|
|
16
|
+
@input="emit('update:modelValue', $event.target.value)"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: string;
|
|
3
|
+
invalid?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: string) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
variant?: 'success' | 'error';
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:open": (open: boolean) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import {
|
|
3
|
+
ToastClose,
|
|
4
|
+
ToastDescription,
|
|
5
|
+
ToastProvider,
|
|
6
|
+
ToastRoot,
|
|
7
|
+
ToastTitle,
|
|
8
|
+
ToastViewport
|
|
9
|
+
} from "reka-ui";
|
|
10
|
+
defineProps({
|
|
11
|
+
open: { type: Boolean, required: true },
|
|
12
|
+
title: { type: String, required: true },
|
|
13
|
+
description: { type: String, required: false, default: void 0 },
|
|
14
|
+
variant: { type: String, required: false, default: "success" }
|
|
15
|
+
});
|
|
16
|
+
const emit = defineEmits(["update:open"]);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<ToastProvider
|
|
21
|
+
:duration="4e3"
|
|
22
|
+
label="Notification"
|
|
23
|
+
swipe-direction="right"
|
|
24
|
+
>
|
|
25
|
+
<ToastRoot
|
|
26
|
+
:open="open"
|
|
27
|
+
class="eponyme-toast eponyme-portal ep:grid ep:w-full ep:grid-cols-[auto_1fr_auto] ep:items-start ep:gap-3 ep:rounded-xl ep:border ep:border-border-ep ep:bg-selected-ep ep:p-4 ep:font-sans ep:text-text-ep ep:outline-none"
|
|
28
|
+
@update:open="emit('update:open', $event)"
|
|
29
|
+
>
|
|
30
|
+
<span
|
|
31
|
+
class="ep:mt-1.5 ep:h-2 ep:w-2 ep:rounded-full"
|
|
32
|
+
:class="variant === 'error' ? 'ep:bg-danger-ep' : 'ep:bg-success-ep'"
|
|
33
|
+
aria-hidden="true"
|
|
34
|
+
/>
|
|
35
|
+
<div class="ep:min-w-0">
|
|
36
|
+
<ToastTitle class="ep:m-0 ep:text-sm ep:font-semibold ep:text-white">
|
|
37
|
+
{{ title }}
|
|
38
|
+
</ToastTitle>
|
|
39
|
+
<ToastDescription
|
|
40
|
+
v-if="description"
|
|
41
|
+
class="ep:mt-1 ep:mb-0 ep:text-xs ep:leading-relaxed ep:text-muted-ep"
|
|
42
|
+
>
|
|
43
|
+
{{ description }}
|
|
44
|
+
</ToastDescription>
|
|
45
|
+
</div>
|
|
46
|
+
<ToastClose
|
|
47
|
+
aria-label="Close notification"
|
|
48
|
+
class="ep:-mt-1 ep:-mr-1 ep:inline-flex ep:h-7 ep:w-7 ep:cursor-pointer ep:items-center ep:justify-center ep:rounded-md ep:border-0 ep:bg-transparent ep:text-lg ep:leading-none ep:text-muted-ep ep:transition ep:hover:bg-white/5 ep:hover:text-white ep:focus-visible:outline-none ep:focus-visible:ring-2 ep:focus-visible:ring-white/20"
|
|
49
|
+
>
|
|
50
|
+
<span aria-hidden="true">×</span>
|
|
51
|
+
</ToastClose>
|
|
52
|
+
</ToastRoot>
|
|
53
|
+
|
|
54
|
+
<ToastViewport class="ep:fixed ep:right-4 ep:bottom-4 ep:z-50 ep:flex ep:w-[calc(100vw-2rem)] ep:max-w-sm ep:list-none ep:flex-col ep:gap-2 ep:p-0 ep:outline-none ep:sm:right-6 ep:sm:bottom-6" />
|
|
55
|
+
</ToastProvider>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<style>
|
|
59
|
+
.eponyme-toast[data-state=open]{animation:eponyme-toast-lift .36s cubic-bezier(.16,1,.3,1) both;will-change:opacity,transform}.eponyme-toast[data-state=closed]{animation:eponyme-toast-out .18s ease-in both}.eponyme-toast[data-swipe=move]{transform:translateX(var(--reka-toast-swipe-move-x))}.eponyme-toast[data-swipe=cancel]{transform:translateX(0);transition:transform .18s ease-out}.eponyme-toast[data-swipe=end]{animation:eponyme-toast-swipe-out .12s ease-out}@keyframes eponyme-toast-lift{0%{opacity:0;transform:translateY(36px) scale(.96)}75%{opacity:1;transform:translateY(-4px) scale(1)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes eponyme-toast-out{to{opacity:0;transform:translateY(4px) scale(.98)}}@keyframes eponyme-toast-swipe-out{to{transform:translateX(calc(var(--reka-toast-swipe-end-x) + 2rem))}}@media (prefers-reduced-motion:reduce){.eponyme-toast{animation-duration:1ms!important}}
|
|
60
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
variant?: 'success' | 'error';
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:open": (open: boolean) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
content: string;
|
|
3
|
+
delay?: number;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_20: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_20) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: 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>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import {
|
|
3
|
+
TooltipContent,
|
|
4
|
+
TooltipPortal,
|
|
5
|
+
TooltipProvider,
|
|
6
|
+
TooltipRoot,
|
|
7
|
+
TooltipTrigger
|
|
8
|
+
} from "reka-ui";
|
|
9
|
+
defineProps({
|
|
10
|
+
content: { type: String, required: true },
|
|
11
|
+
delay: { type: Number, required: false, default: 300 }
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<TooltipProvider :delay-duration="delay">
|
|
17
|
+
<TooltipRoot>
|
|
18
|
+
<TooltipTrigger
|
|
19
|
+
as="span"
|
|
20
|
+
class="ep:inline-flex"
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</TooltipTrigger>
|
|
24
|
+
<TooltipPortal>
|
|
25
|
+
<TooltipContent
|
|
26
|
+
:side-offset="6"
|
|
27
|
+
class="eponyme-portal ep:z-50 ep:whitespace-nowrap ep:rounded-lg ep:border ep:border-border-ep ep:bg-black ep:px-2.5 ep:py-1.5 ep:font-sans ep:text-xs ep:font-medium ep:text-white"
|
|
28
|
+
>
|
|
29
|
+
{{ content }}
|
|
30
|
+
</TooltipContent>
|
|
31
|
+
</TooltipPortal>
|
|
32
|
+
</TooltipRoot>
|
|
33
|
+
</TooltipProvider>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
content: string;
|
|
3
|
+
delay?: number;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_20: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_20) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: 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>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Lets a renderer tell the `EPFormField` instances below it how to present themselves —
|
|
4
|
+
* without every field component having to declare and forward the same two props.
|
|
5
|
+
*/
|
|
6
|
+
export interface FormFieldContext {
|
|
7
|
+
/** The parent already shows the label, so the field renders the control only. */
|
|
8
|
+
hideLabel?: boolean;
|
|
9
|
+
/** Nested inside an array item: smaller label. */
|
|
10
|
+
compact?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const formFieldContextKey: InjectionKey<FormFieldContext>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const formFieldContextKey = Symbol("eponyme-form-field");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type eponymeConfig from '#eponyme/config';
|
|
3
|
+
import type { EponymeDataByName, EponymeName } from '../types/index.js';
|
|
4
|
+
import type { EponymeAction, EponymeStatus, EponymeVersionSelector } from '../server/services/eponyme-store.js';
|
|
5
|
+
import type { ValidationErrors } from '../utils/validate-eponyme-data.js';
|
|
6
|
+
type ConfigEponymeName = EponymeName<typeof eponymeConfig>;
|
|
7
|
+
export interface UseEponymeOptions {
|
|
8
|
+
version?: EponymeVersionSelector;
|
|
9
|
+
}
|
|
10
|
+
/** Read and save a configured eponyme through the public or draft API. */
|
|
11
|
+
export declare function useEponyme<const Name extends ConfigEponymeName>(name: Name, options?: UseEponymeOptions): {
|
|
12
|
+
data: Ref<EponymeDataByName<any, Name> | undefined>;
|
|
13
|
+
status: import("vue").ComputedRef<EponymeStatus>;
|
|
14
|
+
publishedAt: import("vue").ComputedRef<string | null>;
|
|
15
|
+
pending: import("vue").ComputedRef<boolean>;
|
|
16
|
+
error: Ref<import("nuxt/app").NuxtError<unknown> | undefined, import("nuxt/app").NuxtError<unknown> | undefined>;
|
|
17
|
+
errors: Ref<ValidationErrors, ValidationErrors>;
|
|
18
|
+
refresh: () => Promise<void>;
|
|
19
|
+
save: {
|
|
20
|
+
(): Promise<EponymeDataByName<any, Name> | undefined>;
|
|
21
|
+
(patch: Partial<EponymeDataByName<any, Name>>, action?: EponymeAction): Promise<EponymeDataByName<any, Name> | undefined>;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { clearNuxtData, useAsyncData, useRequestFetch, useRoute } from "#app";
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import { readPreviewQuery, readPreviewVersion } from "../utils/preview.js";
|
|
4
|
+
export function useEponyme(name, options = {}) {
|
|
5
|
+
const route = useRoute();
|
|
6
|
+
const preview = readPreviewQuery(route.query);
|
|
7
|
+
const version = options.version ?? (preview.entry === name ? readPreviewVersion(preview.version) : "published");
|
|
8
|
+
const errors = ref({});
|
|
9
|
+
const saving = ref(false);
|
|
10
|
+
const requestFetch = useRequestFetch();
|
|
11
|
+
const { data: response, pending: loading, error, refresh: load } = useAsyncData(
|
|
12
|
+
`eponyme:${name}:${version}`,
|
|
13
|
+
() => requestFetch(`/api/eponyme/${name}`, { query: { version }, cache: "no-store" }),
|
|
14
|
+
{ getCachedData: () => void 0 }
|
|
15
|
+
);
|
|
16
|
+
const data = computed(() => response.value?.data);
|
|
17
|
+
const status = computed(() => response.value?.status ?? "published");
|
|
18
|
+
const publishedAt = computed(() => response.value?.publishedAt ?? null);
|
|
19
|
+
async function refresh() {
|
|
20
|
+
errors.value = {};
|
|
21
|
+
await load();
|
|
22
|
+
}
|
|
23
|
+
async function save(patch, action = "publish") {
|
|
24
|
+
saving.value = true;
|
|
25
|
+
errors.value = {};
|
|
26
|
+
try {
|
|
27
|
+
const next = await requestFetch(`/api/eponyme/${name}`, {
|
|
28
|
+
method: "PATCH",
|
|
29
|
+
query: { action },
|
|
30
|
+
body: patch ?? data.value
|
|
31
|
+
});
|
|
32
|
+
response.value = next;
|
|
33
|
+
if (action === "publish") {
|
|
34
|
+
clearNuxtData((key) => key.startsWith(`eponyme:${name}:`) && key !== `eponyme:${name}:${version}`);
|
|
35
|
+
const parts = String(name).split("/");
|
|
36
|
+
const slug = parts.pop();
|
|
37
|
+
const collectionName = parts.join("/");
|
|
38
|
+
if (collectionName && slug) {
|
|
39
|
+
clearNuxtData(`eponyme:collection:public:${collectionName}`);
|
|
40
|
+
clearNuxtData((key) => key.startsWith(`eponyme:collection-entry:${collectionName}:${slug}:`));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return next.data;
|
|
44
|
+
} catch (error2) {
|
|
45
|
+
const fetchError = error2;
|
|
46
|
+
if (fetchError.statusCode === 422)
|
|
47
|
+
errors.value = fetchError.data?.errors ?? {};
|
|
48
|
+
throw error2;
|
|
49
|
+
} finally {
|
|
50
|
+
saving.value = false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
data,
|
|
55
|
+
status,
|
|
56
|
+
publishedAt,
|
|
57
|
+
pending: computed(() => loading.value || saving.value),
|
|
58
|
+
error,
|
|
59
|
+
errors,
|
|
60
|
+
refresh,
|
|
61
|
+
save
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EponymeAuthUser } from '../types/index.js';
|
|
2
|
+
export declare function useEponymeAuth(): {
|
|
3
|
+
user: import("vue").Ref<EponymeAuthUser | null, EponymeAuthUser | null>;
|
|
4
|
+
loaded: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
pending: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
role: import("vue").ComputedRef<"viewer" | "editor" | "owner" | undefined>;
|
|
7
|
+
isViewer: import("vue").ComputedRef<boolean>;
|
|
8
|
+
canEdit: import("vue").ComputedRef<boolean>;
|
|
9
|
+
isOwner: import("vue").ComputedRef<boolean>;
|
|
10
|
+
mustChangePassword: import("vue").ComputedRef<boolean>;
|
|
11
|
+
ensureLoaded: () => Promise<EponymeAuthUser | null>;
|
|
12
|
+
refresh: () => Promise<EponymeAuthUser | null>;
|
|
13
|
+
login: (username: string, password: string) => Promise<EponymeAuthUser>;
|
|
14
|
+
logout: () => Promise<void>;
|
|
15
|
+
changePassword: (currentPassword: string, newPassword: string) => Promise<EponymeAuthUser>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useRequestFetch, useState } from "#app";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
export function useEponymeAuth() {
|
|
4
|
+
const user = useState("eponyme:auth-user", () => null);
|
|
5
|
+
const loaded = useState("eponyme:auth-loaded", () => false);
|
|
6
|
+
const pending = useState("eponyme:auth-pending", () => false);
|
|
7
|
+
const requestFetch = useRequestFetch();
|
|
8
|
+
async function refresh() {
|
|
9
|
+
pending.value = true;
|
|
10
|
+
try {
|
|
11
|
+
const response = await requestFetch("/api/eponyme-auth/session", {
|
|
12
|
+
cache: "no-store"
|
|
13
|
+
});
|
|
14
|
+
user.value = response.user;
|
|
15
|
+
loaded.value = true;
|
|
16
|
+
return response.user;
|
|
17
|
+
} catch {
|
|
18
|
+
user.value = null;
|
|
19
|
+
loaded.value = true;
|
|
20
|
+
return null;
|
|
21
|
+
} finally {
|
|
22
|
+
pending.value = false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function ensureLoaded() {
|
|
26
|
+
return loaded.value ? user.value : await refresh();
|
|
27
|
+
}
|
|
28
|
+
async function login(username, password) {
|
|
29
|
+
pending.value = true;
|
|
30
|
+
try {
|
|
31
|
+
const response = await requestFetch("/api/eponyme-auth/login", {
|
|
32
|
+
method: "POST",
|
|
33
|
+
body: { username, password }
|
|
34
|
+
});
|
|
35
|
+
user.value = response.user;
|
|
36
|
+
loaded.value = true;
|
|
37
|
+
return response.user;
|
|
38
|
+
} finally {
|
|
39
|
+
pending.value = false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function logout() {
|
|
43
|
+
pending.value = true;
|
|
44
|
+
try {
|
|
45
|
+
await requestFetch("/api/eponyme-auth/logout", { method: "POST" });
|
|
46
|
+
} finally {
|
|
47
|
+
user.value = null;
|
|
48
|
+
loaded.value = true;
|
|
49
|
+
pending.value = false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function changePassword(currentPassword, newPassword) {
|
|
53
|
+
pending.value = true;
|
|
54
|
+
try {
|
|
55
|
+
const response = await requestFetch("/api/eponyme-auth/change-password", {
|
|
56
|
+
method: "POST",
|
|
57
|
+
body: { currentPassword, newPassword }
|
|
58
|
+
});
|
|
59
|
+
user.value = response.user;
|
|
60
|
+
loaded.value = true;
|
|
61
|
+
return response.user;
|
|
62
|
+
} finally {
|
|
63
|
+
pending.value = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
user,
|
|
68
|
+
loaded,
|
|
69
|
+
pending,
|
|
70
|
+
role: computed(() => user.value?.role),
|
|
71
|
+
isViewer: computed(() => user.value?.role === "viewer"),
|
|
72
|
+
canEdit: computed(() => user.value?.role === "editor" || user.value?.role === "owner"),
|
|
73
|
+
isOwner: computed(() => user.value?.role === "owner"),
|
|
74
|
+
mustChangePassword: computed(() => Boolean(user.value?.mustChangePassword)),
|
|
75
|
+
ensureLoaded,
|
|
76
|
+
refresh,
|
|
77
|
+
login,
|
|
78
|
+
logout,
|
|
79
|
+
changePassword
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import type eponymeConfig from '#eponyme/config';
|
|
3
|
+
import type { EponymeCollectionDataByName, EponymeCollectionName } from '../types/index.js';
|
|
4
|
+
import type { EponymeCollectionEntry, EponymeStatus, EponymeVersionSelector } from '../server/services/eponyme-store.js';
|
|
5
|
+
type ConfigCollectionName = EponymeCollectionName<typeof eponymeConfig>;
|
|
6
|
+
export interface UseEponymeCollectionResult<Data extends Record<string, unknown>> {
|
|
7
|
+
entries: ComputedRef<EponymeCollectionEntry<Data>[]>;
|
|
8
|
+
pending: Ref<boolean>;
|
|
9
|
+
error: Ref<Error | null | undefined>;
|
|
10
|
+
refresh: () => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export interface UseEponymeCollectionEntryOptions {
|
|
13
|
+
version?: EponymeVersionSelector;
|
|
14
|
+
}
|
|
15
|
+
export interface UseEponymeCollectionEntryResult<Data extends Record<string, unknown>> {
|
|
16
|
+
data: Ref<{
|
|
17
|
+
data: Data;
|
|
18
|
+
} | undefined>;
|
|
19
|
+
status: ComputedRef<EponymeStatus>;
|
|
20
|
+
publishedAt: ComputedRef<string | null>;
|
|
21
|
+
pending: Ref<boolean>;
|
|
22
|
+
error: Ref<Error | null | undefined>;
|
|
23
|
+
refresh: () => Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare function useEponymeCollection<const Name extends ConfigCollectionName>(name: Name): UseEponymeCollectionResult<EponymeCollectionDataByName<typeof eponymeConfig, Name>>;
|
|
26
|
+
export declare function useEponymeCollectionEntry<const Name extends ConfigCollectionName>(name: Name, slug: string, options?: UseEponymeCollectionEntryOptions): UseEponymeCollectionEntryResult<EponymeCollectionDataByName<typeof eponymeConfig, Name>>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useAsyncData, useRequestFetch, useRoute } from "#app";
|
|
2
|
+
import { useEventListener } from "@vueuse/core";
|
|
3
|
+
import { computed } from "vue";
|
|
4
|
+
import { readPreviewQuery, readPreviewVersion } from "../utils/preview.js";
|
|
5
|
+
export function useEponymeCollection(name) {
|
|
6
|
+
const requestFetch = useRequestFetch();
|
|
7
|
+
const result = useAsyncData(
|
|
8
|
+
`eponyme:collection:public:${name}`,
|
|
9
|
+
() => requestFetch(`/api/eponyme-collections/${name}`, { cache: "no-store" }),
|
|
10
|
+
{ getCachedData: () => void 0 }
|
|
11
|
+
);
|
|
12
|
+
const entries = computed(() => result.data.value?.entries ?? []);
|
|
13
|
+
if (import.meta.client) useEventListener(window, "focus", () => void result.refresh());
|
|
14
|
+
return {
|
|
15
|
+
entries,
|
|
16
|
+
pending: result.pending,
|
|
17
|
+
error: result.error,
|
|
18
|
+
refresh: async () => {
|
|
19
|
+
await result.refresh();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function useEponymeCollectionEntry(name, slug, options = {}) {
|
|
24
|
+
const route = useRoute();
|
|
25
|
+
const preview = readPreviewQuery(route.query);
|
|
26
|
+
const version = options.version ?? (preview.entry === `${name}/${slug}` ? readPreviewVersion(preview.version) : "published");
|
|
27
|
+
const requestFetch = useRequestFetch();
|
|
28
|
+
const result = useAsyncData(
|
|
29
|
+
`eponyme:collection-entry:${name}:${slug}:${version}`,
|
|
30
|
+
() => requestFetch(`/api/eponyme/${name}/${encodeURIComponent(slug)}`, { query: { version }, cache: "no-store" }),
|
|
31
|
+
{ getCachedData: () => void 0 }
|
|
32
|
+
);
|
|
33
|
+
if (import.meta.client) useEventListener(window, "focus", () => void result.refresh());
|
|
34
|
+
return {
|
|
35
|
+
data: result.data,
|
|
36
|
+
status: computed(() => result.data.value?.status ?? "published"),
|
|
37
|
+
publishedAt: computed(() => result.data.value?.publishedAt ?? null),
|
|
38
|
+
pending: result.pending,
|
|
39
|
+
error: result.error,
|
|
40
|
+
refresh: async () => {
|
|
41
|
+
await result.refresh();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ColorPreset } from '../types/index.js';
|
|
2
|
+
/** Accepts both `'#171714'` and `{ label, value }`, and drops anything that is not a colour. */
|
|
3
|
+
export declare function normalizeColorPresets(presets: ReadonlyArray<string | ColorPreset> | undefined): ColorPreset[];
|
|
4
|
+
/** Palette declared once in `nuxt.config.ts` under `eponyme.colorPresets`. */
|
|
5
|
+
export declare function useEponymeColorPresets(): ColorPreset[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useRuntimeConfig } from "#app";
|
|
2
|
+
import { humanizeLabel } from "../utils/humanize-label.js";
|
|
3
|
+
import { normalizeHexColor } from "../utils/normalize-hex-color.js";
|
|
4
|
+
export function normalizeColorPresets(presets) {
|
|
5
|
+
return (presets ?? []).flatMap((preset) => {
|
|
6
|
+
const value = typeof preset === "string" ? preset : preset.value;
|
|
7
|
+
if (!normalizeHexColor(value)) return [];
|
|
8
|
+
const label = typeof preset === "string" ? humanizeLabel(value) : preset.label;
|
|
9
|
+
return [{ label, value }];
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function useEponymeColorPresets() {
|
|
13
|
+
const runtimeConfig = useRuntimeConfig();
|
|
14
|
+
const eponyme = runtimeConfig.public.eponyme;
|
|
15
|
+
return normalizeColorPresets(eponyme?.colorPresets);
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useEponymeConfig(): any;
|