@karibsen/eponyme 0.6.0 → 0.8.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.
Files changed (74) hide show
  1. package/README.md +109 -45
  2. package/dist/eponyme.mjs +2 -3
  3. package/dist/module.d.mts +109 -13
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +19 -6
  6. package/dist/runtime/components/editor/EponymeFolderNav.vue +1 -8
  7. package/dist/runtime/components/editor/EponymeFormPage.vue +2 -2
  8. package/dist/runtime/components/editor/EponymeSidebar.vue +7 -2
  9. package/dist/runtime/components/fields/FieldRenderer.vue +22 -0
  10. package/dist/runtime/components/fields/PhoneField.d.vue.ts +22 -0
  11. package/dist/runtime/components/fields/PhoneField.vue +61 -0
  12. package/dist/runtime/components/fields/PhoneField.vue.d.ts +22 -0
  13. package/dist/runtime/components/fields/RichTextField.vue +37 -1
  14. package/dist/runtime/components/fields/TagsField.d.vue.ts +21 -0
  15. package/dist/runtime/components/fields/TagsField.vue +55 -0
  16. package/dist/runtime/components/fields/TagsField.vue.d.ts +21 -0
  17. package/dist/runtime/components/ui/EPAlertDialog.d.vue.ts +37 -0
  18. package/dist/runtime/components/ui/EPAlertDialog.vue +66 -0
  19. package/dist/runtime/components/ui/EPAlertDialog.vue.d.ts +37 -0
  20. package/dist/runtime/components/ui/EPDialog.d.vue.ts +1 -0
  21. package/dist/runtime/components/ui/EPDialog.vue +6 -2
  22. package/dist/runtime/components/ui/EPDialog.vue.d.ts +1 -0
  23. package/dist/runtime/components/ui/EPLinkEditor.vue +2 -1
  24. package/dist/runtime/components/ui/EPTagsInput.d.vue.ts +27 -0
  25. package/dist/runtime/components/ui/EPTagsInput.vue +101 -0
  26. package/dist/runtime/components/ui/EPTagsInput.vue.d.ts +27 -0
  27. package/dist/runtime/composables/useEponymeCollection.d.ts +13 -1
  28. package/dist/runtime/composables/useEponymeCollection.js +29 -4
  29. package/dist/runtime/composables/useEponymeForm.d.ts +0 -4
  30. package/dist/runtime/composables/useEponymeForm.js +1 -8
  31. package/dist/runtime/fields/index.d.ts +4 -0
  32. package/dist/runtime/fields/index.js +3 -1
  33. package/dist/runtime/fields/phone.d.ts +2 -0
  34. package/dist/runtime/fields/phone.js +3 -0
  35. package/dist/runtime/fields/tags.d.ts +6 -0
  36. package/dist/runtime/fields/tags.js +3 -0
  37. package/dist/runtime/middleware/eponyme-auth.d.ts +1 -1
  38. package/dist/runtime/middleware/eponyme-owner.d.ts +1 -1
  39. package/dist/runtime/pages/EponymeIndexPage.vue +0 -3
  40. package/dist/runtime/server/api/eponyme-collections/[path].get.js +40 -1
  41. package/dist/runtime/server/api/eponyme-forms/[path].post.js +0 -15
  42. package/dist/runtime/server/plugins/eponyme-sync.js +11 -1
  43. package/dist/runtime/server/services/eponyme-form-store.d.ts +1 -0
  44. package/dist/runtime/server/services/eponyme-form-store.js +4 -3
  45. package/dist/runtime/server/services/eponyme-store.d.ts +289 -30
  46. package/dist/runtime/server/services/eponyme-store.js +405 -73
  47. package/dist/runtime/server/utils/eponyme-reindex.d.ts +13 -0
  48. package/dist/runtime/server/utils/eponyme-reindex.js +4 -0
  49. package/dist/runtime/types/eponyme-config.d.ts +0 -7
  50. package/dist/runtime/types/eponyme.d.ts +54 -6
  51. package/dist/runtime/types/field.d.ts +82 -4
  52. package/dist/runtime/types/index.d.ts +0 -1
  53. package/dist/runtime/types/index.js +0 -1
  54. package/dist/runtime/utils/eponyme-entry-index.d.ts +39 -0
  55. package/dist/runtime/utils/eponyme-entry-index.js +51 -0
  56. package/dist/runtime/utils/get-field-default-value.js +2 -0
  57. package/dist/runtime/utils/middle-ellipsis.d.ts +1 -0
  58. package/dist/runtime/utils/middle-ellipsis.js +8 -0
  59. package/dist/runtime/utils/normalize-eponyme-values.d.ts +13 -0
  60. package/dist/runtime/utils/normalize-eponyme-values.js +40 -0
  61. package/dist/runtime/utils/normalize-phone.d.ts +26 -0
  62. package/dist/runtime/utils/normalize-phone.js +17 -0
  63. package/dist/runtime/utils/normalize-tags.d.ts +10 -0
  64. package/dist/runtime/utils/normalize-tags.js +17 -0
  65. package/dist/runtime/utils/validate-eponyme-data.js +45 -3
  66. package/dist/runtime/utils/variables.d.ts +4 -0
  67. package/dist/runtime/utils/variables.js +8 -1
  68. package/package.json +4 -2
  69. package/dist/runtime/server/utils/eponyme-captcha.d.ts +0 -6
  70. package/dist/runtime/server/utils/eponyme-captcha.js +0 -14
  71. package/dist/runtime/types/captcha.d.ts +0 -16
  72. package/dist/runtime/types/captcha.js +0 -0
  73. package/dist/runtime/utils/no-captcha.d.ts +0 -7
  74. package/dist/runtime/utils/no-captcha.js +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karibsen/eponyme",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "A lightweight, type-safe content manager for Nuxt.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -60,18 +60,20 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@iconify-json/mingcute": "^1.2.7",
63
+ "@karibsen/ui": "^1.0.1",
63
64
  "@nuxt/icon": "^2.3.1",
64
65
  "@nuxt/kit": "^4.4.8",
65
- "@karibsen/ui": "latest",
66
66
  "@tailwindcss/vite": "^4.1.12",
67
67
  "@tanstack/vue-table": "^8.21.3",
68
68
  "@tiptap/extension-image": "^3.29.2",
69
69
  "@tiptap/extension-placeholder": "^3.28.0",
70
+ "@tiptap/pm": "^3.28.0",
70
71
  "@tiptap/starter-kit": "^3.28.0",
71
72
  "@tiptap/vue-3": "^3.28.0",
72
73
  "@vueuse/core": "^14.3.0",
73
74
  "@vueuse/integrations": "^14.3.0",
74
75
  "fuse.js": "^7.5.0",
76
+ "libphonenumber-js": "^1.13.9",
75
77
  "picocolors": "^1.1.1",
76
78
  "reka-ui": "^2.10.1",
77
79
  "slugify": "^1.6.9",
@@ -1,6 +0,0 @@
1
- import type { H3Event } from 'h3';
2
- import type { EponymeCaptchaResult, EponymeCaptchaVerifier } from '../../types/captcha.js';
3
- export declare const CAPTCHA_TOKEN_KEY = "_eponyme_captcha";
4
- export declare function eponymeCaptchaVerifier(): EponymeCaptchaVerifier;
5
- export declare function isEponymeCaptchaConfigured(): boolean;
6
- export declare function verifyEponymeCaptcha(event: H3Event, token: unknown): Promise<EponymeCaptchaResult>;
@@ -1,14 +0,0 @@
1
- import { getRequestIP } from "h3";
2
- import captchaVerifier from "#eponyme/captcha";
3
- export const CAPTCHA_TOKEN_KEY = "_eponyme_captcha";
4
- export function eponymeCaptchaVerifier() {
5
- return captchaVerifier;
6
- }
7
- export function isEponymeCaptchaConfigured() {
8
- return eponymeCaptchaVerifier().name !== "none";
9
- }
10
- export async function verifyEponymeCaptcha(event, token) {
11
- if (typeof token !== "string" || !token.trim())
12
- return { success: false, reason: "Missing captcha token." };
13
- return eponymeCaptchaVerifier().verify(token, { ip: getRequestIP(event, { xForwardedFor: true }) });
14
- }
@@ -1,16 +0,0 @@
1
- export interface EponymeCaptchaResult {
2
- success: boolean;
3
- /** Provider-specific reason, surfaced in server logs rather than to the visitor. */
4
- reason?: string;
5
- }
6
- /**
7
- * Verifies the token a visitor's captcha widget produced. Implemented by an adapter
8
- * package such as `@karibsen/eponyme-captcha`; the core ships none, so a project
9
- * without an adapter simply has no captcha.
10
- */
11
- export interface EponymeCaptchaVerifier {
12
- name: string;
13
- verify: (token: string, context: {
14
- ip?: string;
15
- }) => Promise<EponymeCaptchaResult>;
16
- }
File without changes
@@ -1,7 +0,0 @@
1
- import type { EponymeCaptchaVerifier } from '../types/captcha.js';
2
- /**
3
- * Stands in when no adapter is installed. It never claims success, so a form that
4
- * requires a captcha refuses submissions rather than silently accepting them all.
5
- */
6
- declare const verifier: EponymeCaptchaVerifier;
7
- export default verifier;
@@ -1,5 +0,0 @@
1
- const verifier = {
2
- name: "none",
3
- verify: async () => ({ success: false, reason: "No captcha adapter is installed." })
4
- };
5
- export default verifier;