@bygghammar/cms-platform 0.1.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.
Files changed (36) hide show
  1. package/README.md +36 -0
  2. package/package.json +39 -0
  3. package/src/backoffice/inspectors/blocks.tsx +2318 -0
  4. package/src/backoffice/inspectors/fields.tsx +436 -0
  5. package/src/blocks/block-props-context.tsx +36 -0
  6. package/src/blocks/components/CabinTabsBlock.tsx +167 -0
  7. package/src/blocks/components/ChecklistBlock.tsx +68 -0
  8. package/src/blocks/components/CtaBannerBlock.tsx +65 -0
  9. package/src/blocks/components/FaqBlock.tsx +62 -0
  10. package/src/blocks/components/HeroFullBlock.tsx +201 -0
  11. package/src/blocks/components/IconGridBlock.tsx +125 -0
  12. package/src/blocks/components/ImageMarqueeBlock.tsx +209 -0
  13. package/src/blocks/components/InstagramBlock.tsx +160 -0
  14. package/src/blocks/components/LinkTilesBlock.tsx +182 -0
  15. package/src/blocks/components/MediaSplitBlock.tsx +427 -0
  16. package/src/blocks/components/PriceTableBlock.tsx +166 -0
  17. package/src/blocks/components/ProseBlock.tsx +77 -0
  18. package/src/blocks/components/RichTextBlock.tsx +79 -0
  19. package/src/blocks/icons.ts +63 -0
  20. package/src/blocks/index.ts +13 -0
  21. package/src/blocks/registry.tsx +322 -0
  22. package/src/blocks/types.ts +470 -0
  23. package/src/host/index.tsx +134 -0
  24. package/src/html/sanitize-html.ts +175 -0
  25. package/src/i18n/context.tsx +44 -0
  26. package/src/i18n/index.ts +6 -0
  27. package/src/i18n/locales.ts +24 -0
  28. package/src/i18n/resolve.ts +82 -0
  29. package/src/i18n/translations-registry.ts +26 -0
  30. package/src/i18n/types.ts +22 -0
  31. package/src/i18n/video.ts +36 -0
  32. package/src/index.ts +5 -0
  33. package/src/theme.css +53 -0
  34. package/src/ui/Lightbox.tsx +69 -0
  35. package/src/ui/Reveal.tsx +47 -0
  36. package/src/util/scroll-lock.ts +32 -0
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @bygghammar/cms-platform
2
+
3
+ Shared CMS platform code for every site in this workspace (Voyara, barskola and
4
+ future sites). **Code only** — no content, no data, no secrets, no theme.
5
+
6
+ ## What lives here
7
+
8
+ - `src/blocks/types.ts` — block prop types and the JSON contract for block props
9
+ - `src/blocks/icons.ts` — the icon set blocks may reference
10
+ - `src/blocks/block-props-context.tsx` — block prop plumbing for inline editing
11
+ - `src/i18n/*` — the localization core (locales, types, resolver, context)
12
+ - `src/theme.css` — the design-token contract + neutral starter theme
13
+
14
+ ## What must never live here
15
+
16
+ - colours, fonts or spacing values used by a specific site (see `theme.css`)
17
+ - page content, SEO copy, media, CMS page JSON
18
+ - Supabase generated types, auth users, secrets, API keys
19
+ - route files and per-site deployment config
20
+
21
+ ## Per-site wiring
22
+
23
+ Translation data is per-site content, so each site registers its own maps once
24
+ at startup:
25
+
26
+ ```ts
27
+ import { registerTranslations } from "@bygghammar/cms-platform/i18n";
28
+ registerTranslations({ generated: TRANSLATIONS, overrides: TRANSLATION_OVERRIDES });
29
+ ```
30
+
31
+ ## Consuming
32
+
33
+ Today the package is linked through the Bun workspace (`workspace:*`), so edits
34
+ are picked up instantly with no publish step. When the workspace managed npm
35
+ registry is enabled, the same source publishes under the `@ws-` scope and sites
36
+ switch `workspace:*` for a version range — no code changes.
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@bygghammar/cms-platform",
3
+ "version": "0.1.0",
4
+ "description": "Shared CMS platform: blocks, block types, i18n core, UI primitives and design-token contract used by every Bygghammar/Voyara site.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "license": "UNLICENSED",
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "registry": "https://registry.npmjs.org/"
11
+ },
12
+ "files": [
13
+ "src",
14
+ "README.md"
15
+ ],
16
+ "exports": {
17
+ ".": "./src/index.ts",
18
+ "./i18n": "./src/i18n/index.ts",
19
+ "./host": "./src/host/index.tsx",
20
+ "./blocks": "./src/blocks/index.ts",
21
+ "./blocks/types": "./src/blocks/types.ts",
22
+ "./blocks/icons": "./src/blocks/icons.ts",
23
+ "./blocks/block-props-context": "./src/blocks/block-props-context.tsx",
24
+ "./blocks/components/*": "./src/blocks/components/*.tsx",
25
+ "./ui/Reveal": "./src/ui/Reveal.tsx",
26
+ "./ui/Lightbox": "./src/ui/Lightbox.tsx",
27
+ "./util/scroll-lock": "./src/util/scroll-lock.ts",
28
+ "./html/sanitize-html": "./src/html/sanitize-html.ts",
29
+ "./backoffice/inspectors/fields": "./src/backoffice/inspectors/fields.tsx",
30
+ "./theme.css": "./src/theme.css",
31
+ "./backoffice/inspectors/blocks": "./src/backoffice/inspectors/blocks.tsx",
32
+ "./blocks/registry": "./src/blocks/registry.tsx"
33
+ },
34
+ "peerDependencies": {
35
+ "lucide-react": ">=0.5.0",
36
+ "react": ">=19",
37
+ "react-dom": ">=19"
38
+ }
39
+ }