@prenta/admin 1.16.0 → 1.17.1

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 (97) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/__tests__/components/faq-proposal-preview.render.test.d.ts +2 -0
  3. package/dist/__tests__/components/faq-proposal-preview.render.test.d.ts.map +1 -0
  4. package/dist/__tests__/components/faq-proposal-preview.render.test.js +97 -0
  5. package/dist/__tests__/components/faq-proposal-preview.render.test.js.map +1 -0
  6. package/dist/__tests__/components/seo-issue-fix-panel.render.test.js +37 -11
  7. package/dist/__tests__/components/seo-issue-fix-panel.render.test.js.map +1 -1
  8. package/dist/__tests__/lib/seo-service-errors.test.js +5 -6
  9. package/dist/__tests__/lib/seo-service-errors.test.js.map +1 -1
  10. package/dist/__tests__/lib/seo-service-proposals.test.js +24 -0
  11. package/dist/__tests__/lib/seo-service-proposals.test.js.map +1 -1
  12. package/dist/__tests__/views/seo-proposals-tab.render.test.js +277 -0
  13. package/dist/__tests__/views/seo-proposals-tab.render.test.js.map +1 -1
  14. package/dist/components/seo/FaqProposalPreview.d.ts +39 -0
  15. package/dist/components/seo/FaqProposalPreview.d.ts.map +1 -0
  16. package/dist/components/seo/FaqProposalPreview.js +62 -0
  17. package/dist/components/seo/FaqProposalPreview.js.map +1 -0
  18. package/dist/components/seo/SeoIssueFixPanel.d.ts.map +1 -1
  19. package/dist/components/seo/SeoIssueFixPanel.js +7 -2
  20. package/dist/components/seo/SeoIssueFixPanel.js.map +1 -1
  21. package/dist/lib/seo-service.d.ts +61 -7
  22. package/dist/lib/seo-service.d.ts.map +1 -1
  23. package/dist/lib/seo-service.js +9 -13
  24. package/dist/lib/seo-service.js.map +1 -1
  25. package/dist/prenta-admin.css +1 -1
  26. package/dist/views/seo/ProposalsTab.d.ts.map +1 -1
  27. package/dist/views/seo/ProposalsTab.js +160 -7
  28. package/dist/views/seo/ProposalsTab.js.map +1 -1
  29. package/dist/views/settings/SeoAutopilotCard.d.ts.map +1 -1
  30. package/dist/views/settings/SeoAutopilotCard.js +6 -0
  31. package/dist/views/settings/SeoAutopilotCard.js.map +1 -1
  32. package/package.json +5 -5
  33. package/src/__tests__/components/faq-proposal-preview.render.test.tsx +137 -0
  34. package/src/__tests__/components/seo-issue-fix-panel.render.test.tsx +42 -11
  35. package/src/__tests__/lib/seo-service-errors.test.ts +5 -9
  36. package/src/__tests__/lib/seo-service-proposals.test.ts +30 -0
  37. package/src/__tests__/views/seo-proposals-tab.render.test.tsx +358 -0
  38. package/src/components/seo/FaqProposalPreview.tsx +134 -0
  39. package/src/components/seo/SeoIssueFixPanel.tsx +7 -2
  40. package/src/lib/seo-service.ts +57 -15
  41. package/src/views/seo/ProposalsTab.tsx +279 -13
  42. package/src/views/settings/SeoAutopilotCard.tsx +6 -0
  43. package/dist/components/ContentOverviewChart.d.ts +0 -8
  44. package/dist/components/ContentOverviewChart.d.ts.map +0 -1
  45. package/dist/components/ContentOverviewChart.js +0 -20
  46. package/dist/components/ContentOverviewChart.js.map +0 -1
  47. package/dist/components/SEOPerformance.d.ts +0 -5
  48. package/dist/components/SEOPerformance.d.ts.map +0 -1
  49. package/dist/components/SEOPerformance.js +0 -29
  50. package/dist/components/SEOPerformance.js.map +0 -1
  51. package/dist/components/ui/Avatar.d.ts +0 -9
  52. package/dist/components/ui/Avatar.d.ts.map +0 -1
  53. package/dist/components/ui/Avatar.js +0 -21
  54. package/dist/components/ui/Avatar.js.map +0 -1
  55. package/dist/components/ui/CommandPalette.d.ts +0 -14
  56. package/dist/components/ui/CommandPalette.d.ts.map +0 -1
  57. package/dist/components/ui/CommandPalette.js +0 -58
  58. package/dist/components/ui/CommandPalette.js.map +0 -1
  59. package/dist/components/ui/DataTable.d.ts +0 -30
  60. package/dist/components/ui/DataTable.d.ts.map +0 -1
  61. package/dist/components/ui/DataTable.js +0 -44
  62. package/dist/components/ui/DataTable.js.map +0 -1
  63. package/dist/components/ui/Pagination.d.ts +0 -9
  64. package/dist/components/ui/Pagination.d.ts.map +0 -1
  65. package/dist/components/ui/Pagination.js +0 -26
  66. package/dist/components/ui/Pagination.js.map +0 -1
  67. package/dist/components/ui/Select.d.ts +0 -16
  68. package/dist/components/ui/Select.d.ts.map +0 -1
  69. package/dist/components/ui/Select.js +0 -24
  70. package/dist/components/ui/Select.js.map +0 -1
  71. package/dist/components/ui/Toast.d.ts +0 -18
  72. package/dist/components/ui/Toast.d.ts.map +0 -1
  73. package/dist/components/ui/Toast.js +0 -29
  74. package/dist/components/ui/Toast.js.map +0 -1
  75. package/dist/components/ui/index.d.ts +0 -46
  76. package/dist/components/ui/index.d.ts.map +0 -1
  77. package/dist/components/ui/index.js +0 -24
  78. package/dist/components/ui/index.js.map +0 -1
  79. package/dist/hooks/useContentLock.d.ts +0 -12
  80. package/dist/hooks/useContentLock.d.ts.map +0 -1
  81. package/dist/hooks/useContentLock.js +0 -38
  82. package/dist/hooks/useContentLock.js.map +0 -1
  83. package/dist/hooks/useDebounce.d.ts +0 -2
  84. package/dist/hooks/useDebounce.d.ts.map +0 -1
  85. package/dist/hooks/useDebounce.js +0 -11
  86. package/dist/hooks/useDebounce.js.map +0 -1
  87. package/src/components/ContentOverviewChart.tsx +0 -75
  88. package/src/components/SEOPerformance.tsx +0 -163
  89. package/src/components/ui/Avatar.tsx +0 -42
  90. package/src/components/ui/CommandPalette.tsx +0 -133
  91. package/src/components/ui/DataTable.tsx +0 -204
  92. package/src/components/ui/Pagination.tsx +0 -94
  93. package/src/components/ui/Select.tsx +0 -53
  94. package/src/components/ui/Toast.tsx +0 -72
  95. package/src/components/ui/index.ts +0 -61
  96. package/src/hooks/useContentLock.ts +0 -55
  97. package/src/hooks/useDebounce.ts +0 -14
@@ -1,72 +0,0 @@
1
- 'use client'
2
-
3
- import { useState, useCallback } from 'react'
4
-
5
- type ToastType = 'success' | 'error' | 'warning' | 'info'
6
-
7
- interface Toast {
8
- id: string
9
- type: ToastType
10
- message: string
11
- }
12
-
13
- const typeClasses: Record<ToastType, string> = {
14
- success: 'border-success bg-success/10 text-success',
15
- error: 'border-destructive bg-destructive/10 text-destructive',
16
- warning: 'border-warning bg-warning/10 text-warning',
17
- info: 'border-info bg-info/10 text-info',
18
- }
19
-
20
- export function useToast() {
21
- const [toasts, setToasts] = useState<Toast[]>([])
22
-
23
- const addToast = useCallback((type: ToastType, message: string) => {
24
- const id = crypto.randomUUID()
25
- setToasts((prev) => [...prev, { id, type, message }])
26
- setTimeout(() => {
27
- setToasts((prev) => prev.filter((t) => t.id !== id))
28
- }, 5000)
29
- }, [])
30
-
31
- const dismissToast = useCallback((id: string) => {
32
- setToasts((prev) => prev.filter((t) => t.id !== id))
33
- }, [])
34
-
35
- return { toasts, addToast, dismissToast }
36
- }
37
-
38
- export interface ToastContainerProps {
39
- toasts: Toast[]
40
- onDismiss: (id: string) => void
41
- }
42
-
43
- export function ToastContainer({ toasts, onDismiss }: ToastContainerProps) {
44
- if (toasts.length === 0) return null
45
-
46
- return (
47
- <div className="fixed right-4 bottom-4 z-[100] flex flex-col gap-2">
48
- {toasts.map((toast) => (
49
- <div
50
- key={toast.id}
51
- className={`flex items-center gap-3 rounded-md border-l-4 px-4 py-3 shadow-lg ${typeClasses[toast.type]}`}
52
- >
53
- <p className="flex-1 text-sm">{toast.message}</p>
54
- <button
55
- onClick={() => onDismiss(toast.id)}
56
- className="shrink-0 opacity-60 hover:opacity-100"
57
- >
58
- <svg
59
- className="h-4 w-4"
60
- fill="none"
61
- viewBox="0 0 24 24"
62
- stroke="currentColor"
63
- strokeWidth={2}
64
- >
65
- <path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
66
- </svg>
67
- </button>
68
- </div>
69
- ))}
70
- </div>
71
- )
72
- }
@@ -1,61 +0,0 @@
1
- export { Button, buttonVariants } from './Button.js'
2
- export type { ButtonProps, ButtonVariants } from './Button.js'
3
- export { Badge, badgeVariants, STATUS_TONE, STATUS_LABEL } from './Badge.js'
4
- export type { BadgeProps, BadgeVariants, DocumentStatus } from './Badge.js'
5
- export {
6
- Card,
7
- CardHeader,
8
- CardTitle,
9
- CardDescription,
10
- CardContent,
11
- CardFooter,
12
- cardVariants,
13
- } from './Card.js'
14
- export type { CardProps, CardVariants } from './Card.js'
15
- export { Input, inputVariants } from './Input.js'
16
- export type { InputProps, InputVariants } from './Input.js'
17
- export { Select, selectVariants } from './Select.js'
18
- export type { SelectProps, SelectVariants } from './Select.js'
19
- export { Avatar } from './Avatar.js'
20
- export type { AvatarProps } from './Avatar.js'
21
- export { EmptyState } from './EmptyState.js'
22
- export type { EmptyStateProps } from './EmptyState.js'
23
- export { Skeleton } from './Skeleton.js'
24
- export type { SkeletonProps } from './Skeleton.js'
25
- export { useToast, ToastContainer } from './Toast.js'
26
- export type { ToastContainerProps } from './Toast.js'
27
- export { Modal } from './Modal.js'
28
- export type { ModalProps } from './Modal.js'
29
- export { ConfirmDialog } from './ConfirmDialog.js'
30
- export type { ConfirmDialogProps } from './ConfirmDialog.js'
31
- export { ReauthDialog } from './ReauthDialog.js'
32
- export type { ReauthDialogProps } from './ReauthDialog.js'
33
- export { DataTable } from './DataTable.js'
34
- export type { DataTableProps } from './DataTable.js'
35
- export { Pagination } from './Pagination.js'
36
- export type { PaginationProps } from './Pagination.js'
37
- export { SearchInput } from './SearchInput.js'
38
- export type { SearchInputProps } from './SearchInput.js'
39
- export { Toggle, toggleTrackVariants, toggleThumbVariants } from './Toggle.js'
40
- export type { ToggleProps, ToggleVariants } from './Toggle.js'
41
- export { StatusBadge, statusBadgeVariants } from './StatusBadge.js'
42
- export type { StatusBadgeProps, StatusBadgeVariants, StatusBadgeTone } from './StatusBadge.js'
43
- export { FilterPill } from './FilterPill.js'
44
- export type { FilterPillProps } from './FilterPill.js'
45
- export { StatPill } from './StatPill.js'
46
- export type { StatPillProps } from './StatPill.js'
47
- export { RowActions, RowActionButton } from './RowActions.js'
48
- export type { RowActionButtonProps } from './RowActions.js'
49
- export {
50
- SplitPaneLayout,
51
- SplitPaneList,
52
- InspectorPane,
53
- InspectorPaneHeader,
54
- InspectorPaneBody,
55
- InspectorPaneSection,
56
- InspectorPaneFooter,
57
- } from './InspectorPane.js'
58
- export type { InspectorPaneProps } from './InspectorPane.js'
59
- export { formControlBase, formControlState } from './form-control.js'
60
- export { CommandPalette } from './CommandPalette.js'
61
- export type { CommandPaletteProps } from './CommandPalette.js'
@@ -1,55 +0,0 @@
1
- 'use client'
2
-
3
- import { useState, useEffect, useCallback } from 'react'
4
-
5
- interface ContentLock {
6
- lockedBy: string | null
7
- lockedAt: Date | null
8
- isLocked: boolean
9
- isLockedByMe: boolean
10
- }
11
-
12
- export function useContentLock(
13
- documentId: string | undefined,
14
- userId: string,
15
- ): ContentLock & {
16
- acquireLock: () => Promise<boolean>
17
- releaseLock: () => Promise<void>
18
- } {
19
- const [lock, setLock] = useState<ContentLock>({
20
- lockedBy: null,
21
- lockedAt: null,
22
- isLocked: false,
23
- isLockedByMe: false,
24
- })
25
-
26
- const acquireLock = useCallback(async () => {
27
- if (!documentId) return false
28
- setLock({
29
- lockedBy: userId,
30
- lockedAt: new Date(),
31
- isLocked: true,
32
- isLockedByMe: true,
33
- })
34
- return true
35
- }, [documentId, userId])
36
-
37
- const releaseLock = useCallback(async () => {
38
- setLock({
39
- lockedBy: null,
40
- lockedAt: null,
41
- isLocked: false,
42
- isLockedByMe: false,
43
- })
44
- }, [])
45
-
46
- useEffect(() => {
47
- return () => {
48
- if (lock.isLockedByMe) {
49
- releaseLock()
50
- }
51
- }
52
- }, [lock.isLockedByMe, releaseLock])
53
-
54
- return { ...lock, acquireLock, releaseLock }
55
- }
@@ -1,14 +0,0 @@
1
- 'use client'
2
-
3
- import { useState, useEffect } from 'react'
4
-
5
- export function useDebounce<T>(value: T, delayMs: number): T {
6
- const [debouncedValue, setDebouncedValue] = useState(value)
7
-
8
- useEffect(() => {
9
- const timer = setTimeout(() => setDebouncedValue(value), delayMs)
10
- return () => clearTimeout(timer)
11
- }, [value, delayMs])
12
-
13
- return debouncedValue
14
- }