@soloworks/smking-next 0.12.2 → 0.14.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/CHANGELOG.md +40 -0
- package/package.json +1 -1
- package/src/components/smking-cms.tsx +607 -28
- package/src/lib/smking-cms-styles.ts +569 -0
- package/src/lib/smking-elements-iife.ts +46 -0
- package/src/types.ts +73 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @soloworks/smking-next
|
|
2
2
|
|
|
3
|
+
## 0.14.0 — 2026-05-23
|
|
4
|
+
|
|
5
|
+
**Single-source CSS distribution + theme mode toggle.** `<SmkingCms>` now ships its own polished default styles by default — no customer CSS work needed. Customers who already use Tailwind + `@tailwindcss/typography` can flip to a prose-utility markup variant via the `mode` prop or `SMKING_CMS_THEME` env var.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Mode A (`css`, default)** — `<SmkingCms>` emits a `<style data-smking="cms-styles">` block once per render carrying the canonical SDK stylesheet. Class hooks `.smk-cms` / `.smk-block--*` / `.smk-hero` / `.smk-nav` / `.smk-carousel`. Customer themes via CSS variables on `:root` (`--smk-accent`, `--smk-font-serif`, etc).
|
|
10
|
+
- **Mode B (`tailwind-prose`)** — opt-in via `<SmkingCms mode="tailwind-prose" ... />` or `SMKING_CMS_THEME=tailwind-prose` env var. Wraps the article in `<article class="prose dark:prose-invert">` and emits Tailwind utility classes on every block (`not-prose` resets around hero/nav/carousel/search). Requires the customer's `@tailwindcss/typography` plugin and a tailwind safelist (the `@soloworks/smking-wizard` 0.4+ installs both automatically).
|
|
11
|
+
- **`CmsThemeMode` type export** — discriminated string literal `'css' | 'tailwind-prose'` for typed prop usage.
|
|
12
|
+
- **`SMKING_CMS_STYLES` constant** at `@soloworks/smking-next/lib/smking-cms-styles` — auto-generated from `packages/shared/src/styles/cms-styles.css` via the monorepo `pnpm sync:cms-styles` script. Customers who want to ship the SDK stylesheet as a standalone CSS file (CDN / static asset) can copy this constant verbatim.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- `SmkingCms` props now accept `mode?: CmsThemeMode` alongside the existing `CmsParams`. No breaking change — omitted prop defaults to `'css'` (legacy behavior plus the new inline style block).
|
|
17
|
+
|
|
18
|
+
### Pairs with
|
|
19
|
+
|
|
20
|
+
- `smking/laravel` v0.15.0 — identical theme-mode toggle on the Laravel side. Both SDKs ship byte-identical canonical CSS in Mode A; Mode B markup also mirrors across both runtimes.
|
|
21
|
+
- `@soloworks/smking-wizard` v0.4.0 — install-time Tailwind detect + theme-mode-select TUI step. When Tailwind is detected the wizard offers Mode B and installs `@tailwindcss/typography` + safelist patches automatically.
|
|
22
|
+
|
|
23
|
+
## 0.13.0 — 2026-05-22
|
|
24
|
+
|
|
25
|
+
**Dynamic CMS blocks — `nav-recent-posts`, `nav-taxonomy-list`, `nav-search` now render with real publish-time data.**
|
|
26
|
+
|
|
27
|
+
Customer pages that include any nav-* block on the smking dashboard editor now receive the resolved snapshot baked into `block.props.snapshot` (or `block.props.index` for search). The SDK echoes it directly — zero round-trips back to smking at request time. If smking is down, the customer's page still renders the last published snapshot.
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- **Server-side render of `nav-recent-posts` / `nav-taxonomy-list`** — `<SmkingCms>` now emits a real `<ul>` of cards (slug-linked title + excerpt + featured image + published date) instead of the prior `smk-nav-pending` placeholder. The wrapper carries `data-layout="list|grid|carousel"` so customer CSS can theme each variant.
|
|
32
|
+
- **Server-side render of `nav-search`** — emits an `<input type="search">` plus a results `<ul>`, wired by an inline IIFE that does case-insensitive substring filter against the publish-time index (top 20 matches). Zero React client-component dependency on the customer side; the IIFE is `</`-escaped against `</script>` smuggling.
|
|
33
|
+
- **`NavSnapshotEntry` + `NavSearchIndexEntry` types** added to the package's public type surface. Each nav block's `props` now exposes `snapshot?` (list/taxonomy) or `index?` (search) so customer code that introspects blocks gets full TS support.
|
|
34
|
+
|
|
35
|
+
### Why this is a minor (0.13.0) not a patch
|
|
36
|
+
|
|
37
|
+
Customer pages that previously rendered the empty `smk-nav-pending` placeholder will now show real content. If a customer's stylesheet relied on the placeholder being invisible / empty, this is a visible behavioural change — bumped to minor per semver hygiene. No API surface removals.
|
|
38
|
+
|
|
39
|
+
### Pairs with
|
|
40
|
+
|
|
41
|
+
- smking SaaS atomic publish — `publish-handler.ts` now resolves nav-* snapshots via `materializeBlocks` and cascade-refreshes sibling pages so a freshly published article appears in every other page's `nav-recent-posts` feed within the same webhook tick.
|
|
42
|
+
|
|
3
43
|
## 0.12.2 — 2026-05-21
|
|
4
44
|
|
|
5
45
|
**Fix: `doctor` now auto-loads `.env.local` + `.env` matching Next.js convention.**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soloworks/smking-next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "AI-native SEO (AEO) for Next.js — auto-inject JSON-LD, FAQ, AI summary, and SEO metadata so AI crawlers (ChatGPT, Perplexity, Google AI) can cite your pages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/sillyleo/smking/tree/main/packages/smking-next",
|