@terrafirmagreg-team/kit 1.2.4 → 1.2.5

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 (2) hide show
  1. package/package.json +6 -6
  2. package/src/lib/embeds.ts +20 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terrafirmagreg-team/kit",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "type": "module",
5
5
  "description": "Fumadocs content engine",
6
6
  "license": "LGPL-3.0-only",
@@ -25,12 +25,12 @@
25
25
  "@base-ui/react": "^1.9.0",
26
26
  "@icons-pack/react-simple-icons": "13.15.1",
27
27
  "@terrafirmagreg-team/data": "1.2.1",
28
- "@terrafirmagreg-team/mdx": "1.2.1",
28
+ "@terrafirmagreg-team/mdx": "1.2.2",
29
29
  "@terrafirmagreg-team/sites": "1.2.1",
30
- "@terrafirmagreg-team/translate": "1.2.3",
31
- "@terrafirmagreg-team/ui": "1.2.2",
32
- "fumadocs-core": "16.17.8",
33
- "lucide-react": "^0.577.0",
30
+ "@terrafirmagreg-team/translate": "1.2.4",
31
+ "@terrafirmagreg-team/ui": "1.2.4",
32
+ "fumadocs-core": "16.17.10",
33
+ "lucide-react": "^1.63.0",
34
34
  "server-only": "^0.0.1",
35
35
  "zod": "4.6.7"
36
36
  },
@@ -0,0 +1,20 @@
1
+ import type { SectionEmbeds } from '@terrafirmagreg-team/kit/types/embeds';
2
+
3
+ export type SectionEmbedId = keyof SectionEmbeds;
4
+
5
+ type EmbedOf<K extends SectionEmbedId> = NonNullable<SectionEmbeds[K]>;
6
+
7
+ const registry = ((globalThis as Record<symbol, unknown>)[
8
+ Symbol.for('terrafirmagreg.embeds')
9
+ ] ??= new Map<SectionEmbedId, unknown>()) as Map<SectionEmbedId, unknown>;
10
+
11
+ export function registerSectionEmbed<K extends SectionEmbedId>(
12
+ id: K,
13
+ embed: EmbedOf<K>,
14
+ ): void {
15
+ registry.set(id, embed);
16
+ }
17
+
18
+ export function sectionEmbeds(): SectionEmbeds {
19
+ return Object.fromEntries(registry) as SectionEmbeds;
20
+ }