11 Commits

Author SHA1 Message Date
Alex Dunmow
20c67b80ee feat(templates): full bn chrome sync from cms + VersionedAssetURL hook
cms is now the authoring source for the bn chrome (head/toolbar/engagement);
this repo carries a mechanically-synced copy solely for guest-side plugin
templates (cms `make sync-templates`, drift gated by check-safety check 31).
head.templ picks up everything it had drifted behind on (RFG-parity favicon
head, analytics/web-vitals beacons, custom-scripts placement, bnApplyTheme)
and is now SDK-clean: asset versioning goes through the new
bn.VersionedAssetURL hook (identity default; the CMS host wires it to its
internal assets registry). HeadData is shape-compatible with existing plugin
usage; BrandingData/SiteSettingsData internals changed — plugins see that at
compile time on their next core bump.

Spec: cms docs/superpowers/specs/2026-07-07-bn-chrome-single-source-design.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 03:02:34 +08:00
Alex Dunmow
1ee9c280e2 feat(toolbar): theme-mode tester + sync toolbar.templ from cms
Sync the vendored templates/bn/toolbar.templ with the cms copy (entrance
animation, position picker chips, HidePreviewToggle — and the new per-tab
theme tester button). Port themeInitScript to the override-aware
window.bnApplyTheme so jutsu-rendered pages honour the admin's transient
bn-theme-override (sessionStorage) ahead of the visitor bn-theme preference.

Regenerated *_templ.go with templ v0.3.1020 (button/engagement diffs are
generator-version churn only).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 02:20:04 +08:00
Alex Dunmow
d94c979731 chore(templates): migrate pongo2/v6 -> block/ninjatpl v1.0.1
The legacy templates/pongo host runtime now uses the in-house ninjatpl
fork. Mechanical import/ident swap — these files only use NewSet /
TemplateLoader / Context / Must / Template, all identical in ninjatpl;
no custom filters/tags or *Error signatures involved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 12:24:27 +08:00
Alex Dunmow
2b9a65dcca Revert "feat(pongo): non-panicking Engine compile variants + global 'lines' filter (WO-WZ-021)"
Core-dissolution direction (Captain's ruling, WO-WZ-026/027): host-side
machinery must not grow in core — the engine additions now live in cms
as backend/plugin/pongoengine (absorbed copy). Tag v0.19.1 still points
at the reverted commit; nothing consumes it. The v0.19.0 codeless
BUILDER keys stay: the ninja CLI lives here until WO-WZ-023 moves it
into cms.

This reverts commit 630dfc7dd1cd35b46482d81904f77dbbcb01c885.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 14:36:02 +08:00
Alex Dunmow
630dfc72b6 feat(pongo): non-panicking Engine compile variants + global 'lines' filter (WO-WZ-021)
PageTemplate/BlockTemplate/EmailWrapper return errors instead of
panicking so hosts can compile artifact-supplied templates at load time
(codeless themes) without a malformed artifact taking down the process;
Must* variants delegate. The 'lines' filter splits a string into
trimmed non-empty lines — pongo2 string literals cannot express \n, so
multi-line textarea fields (per-line <div> addresses) were previously
inexpressible in templates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 14:31:15 +08:00
Alex Dunmow
7a82028618 feat(captcha): remove Turnstile head-script injection (cms Cap captcha Phase E)
Cap is the sole captcha provider in the CMS; the Cloudflare Turnstile
TurnstileSiteKey field, settings read, and turnstileScript CDN injector are
retired from the shared bn head template.
2026-07-04 11:32:54 +08:00
Alex Dunmow
f4e579ad7a refactor: simplify pongo template context and engine, add private plugins spec
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-08 20:49:18 +08:00
Alex Dunmow
32c6528162 feat(templates): add HTMLComponent interface and first-class pongo2 engine
Decouple TemplateFunc from templ.Component by introducing a generic
HTMLComponent interface that both templ and pongo2 satisfy via Go
structural typing. Add a complete pongo2 rendering engine in
templates/pongo/ with page templates, block templates (with BlockContext
injection and icon processing), template overrides, and email wrappers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-02 23:07:11 +08:00
Alex Dunmow
868df2d761 feat: WO-PS-011 SDK templates/bn shared components
Head, engagement, toolbar templ components and validation helpers
for use by template plugins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-01 09:17:55 +08:00
Alex Dunmow
99fc63ddfd feat: WO-PS-002–008 SDK type packages
- rbac/: Role type, constants, HasPermission, RoleFromString
- blocks/: BlockFunc, BlockMeta, BlockContext, context accessors, BlockRegistry interface
- templates/: TemplateFunc, meta types, TemplateRegistry interface
- auth/: Claims, PublicClaims, context extractors
- content/: Content interface, AuthorProfile/PageInfo/PostInfo types
- settings/: Settings interface, map accessor helpers
- gating/: AccessRule, AccessResult, EvaluateAccess, Gating interface
- crypto/: Crypto interface (Encrypt/Decrypt)
- render/: BlockNoteToHTML standalone renderer
- video/: ParseEmbedURL, EmbedIframeURL
- ai/: ToolDefinition, ToolResult, ToolRegistry interface

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 22:32:29 +08:00
Alex Dunmow
0991b791b1 feat: WO-PS-001 initialize SDK repo
Initialize git.dev.alexdunmow.com/ninja/core with Go 1.26 module,
package directory structure, and README.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 22:25:52 +08:00