@nextblock-cms/db 0.2.20 → 0.2.22
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/package.json
CHANGED
|
@@ -148,7 +148,7 @@ BEGIN
|
|
|
148
148
|
{
|
|
149
149
|
"block_type": "text",
|
|
150
150
|
"content": {
|
|
151
|
-
"html_content": "<div class='grid gap-8 md:grid-cols-3 mt-12'><div class='p-10 rounded-3xl border border-slate-200 dark:border-white/10 bg-slate-50 dark:bg-white/5 backdrop-blur-sm hover:bg-slate-100 dark:hover:bg-white/10 transition-colors duration-300'><div class='w-12 h-12 rounded-xl flex items-center justify-center mb-6'><svg class='w-6 h-6' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 10V3L4 14h7v7l9-11h-7z'></path></svg></div><h3 class='text-xl font-bold text-slate-900 dark:text-white mb-3'>Built for Speed.</h3><p class='text-sm text-slate-600 dark:text-slate-400 leading-relaxed'>Architected for 100% Lighthouse scores with global delivery and near-instant FCP.</p><ul class='mt-6 space-y-3 text-sm text-slate-600 dark:text-slate-400'><li><strong class='text-slate-800 dark:text-slate-200'>Edge Caching & ISR:</strong> Serve pages worldwide.</li><li><strong class='text-slate-800 dark:text-slate-200'>Critical CSS:</strong> Inline styles to eliminate blocking.</li><li><strong class='text-slate-800 dark:text-slate-200'>Image Opt:</strong> AVIF & blurred placeholders.</li></ul></div><div class='p-10 rounded-3xl border border-slate-200 dark:border-white/10 bg-slate-50 dark:bg-white/5 backdrop-blur-sm hover:bg-slate-100 dark:hover:bg-white/10 transition-colors duration-300'><div class='w-12 h-12
|
|
151
|
+
"html_content": "<div class='grid gap-8 md:grid-cols-3 mt-12'><div class='p-10 rounded-3xl border border-slate-200 dark:border-white/10 bg-slate-50 dark:bg-white/5 backdrop-blur-sm hover:bg-slate-100 dark:hover:bg-white/10 transition-colors duration-300'><div class='w-12 h-12 rounded-xl flex items-center justify-center mb-6'><svg class='w-6 h-6' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 10V3L4 14h7v7l9-11h-7z'></path></svg></div><h3 class='text-xl font-bold text-slate-900 dark:text-white mb-3'>Built for Speed.</h3><p class='text-sm text-slate-600 dark:text-slate-400 leading-relaxed'>Architected for 100% Lighthouse scores with global delivery and near-instant FCP.</p><ul class='mt-6 space-y-3 text-sm text-slate-600 dark:text-slate-400'><li><strong class='text-slate-800 dark:text-slate-200'>Edge Caching & ISR:</strong> Serve pages worldwide.</li><li><strong class='text-slate-800 dark:text-slate-200'>Critical CSS:</strong> Inline styles to eliminate blocking.</li><li><strong class='text-slate-800 dark:text-slate-200'>Image Opt:</strong> AVIF & blurred placeholders.</li></ul></div><div class='p-10 rounded-3xl border border-slate-200 dark:border-white/10 bg-slate-50 dark:bg-white/5 backdrop-blur-sm hover:bg-slate-100 dark:hover:bg-white/10 transition-colors duration-300'><div class='w-12 h-12 rounded-xl flex items-center justify-center mb-6'><svg class='w-6 h-6' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z'></path></svg></div><h3 class='text-xl font-bold text-slate-900 dark:text-white mb-3'>Editor-First Experience.</h3><p class='text-sm text-slate-600 dark:text-slate-400 leading-relaxed'>A low-code, Notion-style block editor empowers teams to ship pages without engineering help.</p><ul class='mt-6 space-y-3 text-sm text-slate-600 dark:text-slate-400'><li><strong class='text-slate-800 dark:text-slate-200'>Notion-Style:</strong> Slash commands & drag-and-drop.</li><li><strong class='text-slate-800 dark:text-slate-200'>Bilingual:</strong> Manage locales from one interface.</li><li><strong class='text-slate-800 dark:text-slate-200'>History:</strong> Restore any version with a click.</li></ul></div><div class='p-10 rounded-3xl border border-slate-200 dark:border-white/10 bg-gradient-to-br from-blue-50 to-purple-50 dark:from-blue-600/20 dark:to-purple-600/20 backdrop-blur-sm hover:from-blue-100 hover:to-purple-100 dark:hover:from-blue-600/30 dark:hover:to-purple-600/30 transition-colors duration-300'><div class='w-12 h-12 bg-white/50 dark:bg-white/10 rounded-xl flex items-center justify-center mb-6'><svg class='w-6 h-6 text-slate-900 dark:text-white' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10'></path></svg></div><h3 class='text-xl font-bold text-slate-900 dark:text-white mb-3'>Infinitely Extensible.</h3><p class='text-sm text-slate-700 dark:text-slate-200 leading-relaxed'>Open-source control with a clean Nx monorepo and a typed SDK for limitless customization.</p><ul class='mt-6 space-y-3 text-sm text-slate-700 dark:text-slate-200'><li><strong class='text-slate-900 dark:text-white'>Open Source:</strong> Own the code & data forever.</li><li><strong class='text-slate-900 dark:text-white'>Nx Monorepo:</strong> Scale confidently.</li><li><strong class='text-slate-900 dark:text-white'>Developer SDK:</strong> Scaffold blocks in minutes.</li></ul></div></div>"
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
BEGIN;
|
|
2
|
+
|
|
3
|
+
-- Drop the existing restrictive policy
|
|
4
|
+
DROP POLICY IF EXISTS "blocks_authenticated_comprehensive_select" ON public.blocks;
|
|
5
|
+
|
|
6
|
+
-- Create the new inclusive policy
|
|
7
|
+
CREATE POLICY "blocks_authenticated_comprehensive_select" ON public.blocks
|
|
8
|
+
FOR SELECT
|
|
9
|
+
TO authenticated
|
|
10
|
+
USING (
|
|
11
|
+
-- 1. Admin/Writer can see everything
|
|
12
|
+
((SELECT public.get_current_user_role()) IN ('ADMIN', 'WRITER'))
|
|
13
|
+
OR
|
|
14
|
+
-- 2. Anyone (including USER or no-role) can see published content
|
|
15
|
+
(
|
|
16
|
+
(page_id IS NOT NULL AND EXISTS(SELECT 1 FROM public.pages p WHERE p.id = blocks.page_id AND p.status = 'published')) OR
|
|
17
|
+
(post_id IS NOT NULL AND EXISTS(SELECT 1 FROM public.posts pt WHERE pt.id = blocks.post_id AND pt.status = 'published' AND (pt.published_at IS NULL OR pt.published_at <= now())))
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
COMMENT ON POLICY "blocks_authenticated_comprehensive_select" ON public.blocks IS 'Comprehensive SELECT policy for authenticated users on the blocks table. Admins/Writers see all. Others (including those with missing profiles) see blocks of published parents.';
|
|
22
|
+
|
|
23
|
+
COMMIT;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
BEGIN;
|
|
2
|
+
|
|
3
|
+
-- ============================================================
|
|
4
|
+
-- 1. Fix Duplicate Policies on public.blocks
|
|
5
|
+
-- ============================================================
|
|
6
|
+
|
|
7
|
+
-- Drop the "extra" policies that were causing duplicates.
|
|
8
|
+
-- These appear to have been introduced in 20250619124100_fix_rls_performance_warnings.sql
|
|
9
|
+
-- but conflict with the standard naming convention used in other migrations.
|
|
10
|
+
|
|
11
|
+
DROP POLICY IF EXISTS "Allow read access to blocks" ON public.blocks;
|
|
12
|
+
DROP POLICY IF EXISTS "Allow insert for admins and writers on blocks" ON public.blocks;
|
|
13
|
+
DROP POLICY IF EXISTS "Allow update for admins and writers on blocks" ON public.blocks;
|
|
14
|
+
DROP POLICY IF EXISTS "Allow delete for admins and writers on blocks" ON public.blocks;
|
|
15
|
+
|
|
16
|
+
-- Ensure the canonical policies are in place (they should be, but good to be safe).
|
|
17
|
+
-- The canonical policies are:
|
|
18
|
+
-- SELECT: "blocks_authenticated_comprehensive_select" (from 20251127110000_fix_blocks_visibility_for_missing_profiles.sql)
|
|
19
|
+
-- INSERT: "blocks_admin_writer_can_insert" (from 20251126133000_fix_blocks_rls.sql)
|
|
20
|
+
-- UPDATE: "blocks_admin_writer_can_update" (from 20251126133000_fix_blocks_rls.sql)
|
|
21
|
+
-- DELETE: "blocks_admin_writer_can_delete" (from 20251126133000_fix_blocks_rls.sql)
|
|
22
|
+
|
|
23
|
+
-- Note: "blocks_anon_can_read_published_blocks" is also a valid policy for anon users.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
-- ============================================================
|
|
27
|
+
-- 2. Fix Duplicate Policies on public.media
|
|
28
|
+
-- ============================================================
|
|
29
|
+
|
|
30
|
+
-- Drop the specific "admin/writer" read policy, as "media_public_can_read" covers everyone.
|
|
31
|
+
DROP POLICY IF EXISTS "media_admin_writer_can_read" ON public.media;
|
|
32
|
+
|
|
33
|
+
-- Ensure "media_public_can_read" exists (it should, from 20250526183746_fix_media_select_rls_v12.sql)
|
|
34
|
+
-- If for some reason it's missing, we can recreate it, but usually dropping the duplicate is enough.
|
|
35
|
+
|
|
36
|
+
COMMIT;
|