@nextblock-cms/db 0.11.2 → 0.11.3
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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
-- Swap the home HERO media from the static NBcover image to an embedded YouTube video.
|
|
2
|
+
--
|
|
3
|
+
-- The seeded home hero (migration 010) renders a "Why teams switch / 100% Lighthouse"
|
|
4
|
+
-- card in its right column whose last element is an <img src="/images/NBcover.webp" />.
|
|
5
|
+
-- This replaces just that <img> with a responsive 16:9 YouTube <iframe>, keeping the
|
|
6
|
+
-- surrounding card, its rounded/border/shadow wrapper, and every other block intact.
|
|
7
|
+
--
|
|
8
|
+
-- Rendering path: the hero right column is a 'text' block; TextBlockRenderer feeds the
|
|
9
|
+
-- html_content through html-react-parser, which preserves <iframe> (it only strips on*
|
|
10
|
+
-- handlers and swaps known CMS <img> for next/image). The proxy.ts CSP frame-src already
|
|
11
|
+
-- allows https://www.youtube.com, so the embed is not blocked.
|
|
12
|
+
--
|
|
13
|
+
-- Forward-only and idempotent:
|
|
14
|
+
-- * Each UPDATE matches the language-specific <img> alt text, so a second run finds no
|
|
15
|
+
-- match and is a no-op (the alt text no longer exists once swapped).
|
|
16
|
+
-- * String replace on content::text mirrors migration 042; the img markup is unique to
|
|
17
|
+
-- the home hero, so exactly the EN and FR home hero blocks are touched.
|
|
18
|
+
--
|
|
19
|
+
-- The NBcover.webp media row is left untouched — it is still the feature image for the
|
|
20
|
+
-- "how-nextblock-works" post; only the inline hero usage changes.
|
|
21
|
+
|
|
22
|
+
-- ---------------------------------------------------------------------------
|
|
23
|
+
-- 1. EN home hero: replace NBcover <img> with a YouTube <iframe>
|
|
24
|
+
-- ---------------------------------------------------------------------------
|
|
25
|
+
UPDATE public.blocks
|
|
26
|
+
SET content = replace(
|
|
27
|
+
content::text,
|
|
28
|
+
'<img src=''/images/NBcover.webp'' alt=''Nextblock cover showcasing dashboards and blocks'' class=''w-full h-auto object-cover transform group-hover:scale-105 transition-transform duration-700'' fetchpriority=''high'' />',
|
|
29
|
+
'<div class=''relative w-full aspect-video''><iframe class=''absolute inset-0 h-full w-full border-0'' src=''https://www.youtube.com/embed/71MyfoL4YVM?si=jtlDXV6cSC8rDgz0'' title=''NextBlock demo video'' allow=''accelerated-motion; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'' referrerpolicy=''strict-origin-when-cross-origin'' loading=''lazy'' allowfullscreen></iframe></div>'
|
|
30
|
+
)::jsonb
|
|
31
|
+
WHERE content::text LIKE '%Nextblock cover showcasing dashboards and blocks%';
|
|
32
|
+
|
|
33
|
+
-- ---------------------------------------------------------------------------
|
|
34
|
+
-- 2. FR home hero: replace NBcover <img> with a YouTube <iframe>
|
|
35
|
+
-- ---------------------------------------------------------------------------
|
|
36
|
+
UPDATE public.blocks
|
|
37
|
+
SET content = replace(
|
|
38
|
+
content::text,
|
|
39
|
+
'<img src=''/images/NBcover.webp'' alt=''Couverture Nextblock'' class=''w-full h-auto object-cover transform group-hover:scale-105 transition-transform duration-700'' fetchpriority=''high'' />',
|
|
40
|
+
'<div class=''relative w-full aspect-video''><iframe class=''absolute inset-0 h-full w-full border-0'' src=''https://www.youtube.com/embed/71MyfoL4YVM?si=jtlDXV6cSC8rDgz0'' title=''Vidéo de démonstration NextBlock'' allow=''accelerated-motion; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'' referrerpolicy=''strict-origin-when-cross-origin'' loading=''lazy'' allowfullscreen></iframe></div>'
|
|
41
|
+
)::jsonb
|
|
42
|
+
WHERE content::text LIKE '%Couverture Nextblock%';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
-- Swap the Nx-graph image in the "How NextBlock™ Works" article for an embedded
|
|
2
|
+
-- YouTube video, and rebalance that two-column section to an even 50/50 split.
|
|
3
|
+
--
|
|
4
|
+
-- Targets the post-body 'text' block (dollar-quoted html_content seeded in migration
|
|
5
|
+
-- 010) for both language variants of the same post:
|
|
6
|
+
-- * EN slug how-nextblock-works (img alt "Nx project graph preview ...")
|
|
7
|
+
-- * FR slug comment-nextblock-fonctionne (img alt "Apercu du graphe Nx ...")
|
|
8
|
+
--
|
|
9
|
+
-- Three forward-only, idempotent edits:
|
|
10
|
+
-- 1. Column widths md:w-3/5 (text) and md:w-2/5 (media) -> md:w-1/2 each, and the
|
|
11
|
+
-- flex row switches items-start -> items-center so the shorter media column sits
|
|
12
|
+
-- centered against the taller text column. These class fragments occur only in
|
|
13
|
+
-- this one section (EN + FR), so a single UPDATE rebalances both languages.
|
|
14
|
+
-- 2/3. Replace the <img src="/images/nx-graph.webp" ...> with a responsive 16:9
|
|
15
|
+
-- YouTube <iframe>, kept inside the existing white aside card above its caption.
|
|
16
|
+
--
|
|
17
|
+
-- Rendering/CSP identical to migration 043: TextBlockRenderer -> html-react-parser
|
|
18
|
+
-- preserves the <iframe>; proxy.ts CSP frame-src allows www.youtube.com; every utility
|
|
19
|
+
-- class used here lives in this .sql file, which Tailwind's content scanner
|
|
20
|
+
-- (libs/**/*.sql) compiles into the bundle. The nx-graph.webp media row is left intact.
|
|
21
|
+
--
|
|
22
|
+
-- Each UPDATE is guarded by a substring that only exists pre-swap, so a second run is a
|
|
23
|
+
-- no-op. Dollar-quoted string literals ($old$/$new$) avoid escaping the single-quoted
|
|
24
|
+
-- HTML attributes; the sandbox reset runs this via postgres db.unsafe() (no outer
|
|
25
|
+
-- dollar-quote wrapper), same as migration 010's dollar-quoted seed content.
|
|
26
|
+
|
|
27
|
+
-- ---------------------------------------------------------------------------
|
|
28
|
+
-- 1. Both languages: 3/5 + 2/5 columns -> 50/50, and vertical-center the row
|
|
29
|
+
-- ---------------------------------------------------------------------------
|
|
30
|
+
UPDATE public.blocks
|
|
31
|
+
SET content = replace(
|
|
32
|
+
replace(
|
|
33
|
+
replace(
|
|
34
|
+
content::text,
|
|
35
|
+
'flex flex-col md:flex-row gap-8 items-start my-12',
|
|
36
|
+
'flex flex-col md:flex-row gap-8 items-center my-12'
|
|
37
|
+
),
|
|
38
|
+
'w-full md:w-3/5 space-y-4',
|
|
39
|
+
'w-full md:w-1/2 space-y-4'
|
|
40
|
+
),
|
|
41
|
+
'md:w-2/5 rounded-[2rem]',
|
|
42
|
+
'md:w-1/2 rounded-[2rem]'
|
|
43
|
+
)::jsonb
|
|
44
|
+
WHERE content::text LIKE '%w-full md:w-3/5 space-y-4%';
|
|
45
|
+
|
|
46
|
+
-- ---------------------------------------------------------------------------
|
|
47
|
+
-- 2. EN post body: nx-graph <img> -> responsive YouTube <iframe>
|
|
48
|
+
-- ---------------------------------------------------------------------------
|
|
49
|
+
UPDATE public.blocks
|
|
50
|
+
SET content = replace(
|
|
51
|
+
content::text,
|
|
52
|
+
$old$<img src='/images/nx-graph.webp' alt='Nx project graph preview showing apps and shared libraries linked together' class='w-full h-auto rounded-2xl object-cover' />$old$,
|
|
53
|
+
$new$<div class='relative aspect-video overflow-hidden rounded-2xl'><iframe class='absolute inset-0 h-full w-full border-0' src='https://www.youtube.com/embed/DNqU8ez9qjs?si=p2oIy0f-n7wiaBmO' title='How NextBlock™ Works' allow='accelerated-motion; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' loading='lazy' allowfullscreen></iframe></div>$new$
|
|
54
|
+
)::jsonb
|
|
55
|
+
WHERE content::text LIKE '%Nx project graph preview showing apps and shared libraries linked together%';
|
|
56
|
+
|
|
57
|
+
-- ---------------------------------------------------------------------------
|
|
58
|
+
-- 3. FR post body: nx-graph <img> -> responsive YouTube <iframe>
|
|
59
|
+
-- ---------------------------------------------------------------------------
|
|
60
|
+
UPDATE public.blocks
|
|
61
|
+
SET content = replace(
|
|
62
|
+
content::text,
|
|
63
|
+
$old$<img src='/images/nx-graph.webp' alt='Apercu du graphe Nx montrant les applications et librairies partagees' class='w-full h-auto rounded-2xl object-cover' />$old$,
|
|
64
|
+
$new$<div class='relative aspect-video overflow-hidden rounded-2xl'><iframe class='absolute inset-0 h-full w-full border-0' src='https://www.youtube.com/embed/DNqU8ez9qjs?si=p2oIy0f-n7wiaBmO' title='Comment NextBlock™ fonctionne' allow='accelerated-motion; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' loading='lazy' allowfullscreen></iframe></div>$new$
|
|
65
|
+
)::jsonb
|
|
66
|
+
WHERE content::text LIKE '%Apercu du graphe Nx montrant les applications et librairies partagees%';
|