@duckpic/content-spec 0.2.1 → 0.2.2

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.
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ import type { ComponentSpec } from "./ComponentSpec";
3
+ export declare const VideoPropsSchema: z.ZodObject<{
4
+ title: z.ZodOptional<z.ZodString>;
5
+ link: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export declare const VideoComponentSpec: ComponentSpec;
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export const VideoPropsSchema = z.object({
3
+ title: z.string().optional(),
4
+ link: z.string().optional(),
5
+ });
6
+ export const VideoComponentSpec = {
7
+ type: "Video",
8
+ propsSchema: VideoPropsSchema,
9
+ slots: [],
10
+ ui: {
11
+ label: "Video",
12
+ insertable: true,
13
+ insertMenuOrder: 25,
14
+ }
15
+ };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./components/Quiz";
3
3
  export * from "./components/Layout";
4
4
  export * from "./components/Page";
5
5
  export * from "./components/Multipage";
6
+ export * from "./components/Video";
6
7
  export * from "./schema/PageTree";
7
8
  import type { ComponentSpec, ComponentUiMetadata } from "./components/ComponentSpec.ts";
8
9
  export declare const ComponentRegistry: {
@@ -11,6 +12,7 @@ export declare const ComponentRegistry: {
11
12
  Layout: ComponentSpec;
12
13
  Page: ComponentSpec;
13
14
  Multipage: ComponentSpec;
15
+ Video: ComponentSpec;
14
16
  };
15
17
  export type ComponentType = keyof typeof ComponentRegistry;
16
18
  export declare function getPropsSchema(type: ComponentType): import("zod").ZodType<any, unknown, import("zod/v4/core").$ZodTypeInternals<any, unknown>>;
package/dist/index.js CHANGED
@@ -3,18 +3,21 @@ export * from "./components/Quiz";
3
3
  export * from "./components/Layout";
4
4
  export * from "./components/Page";
5
5
  export * from "./components/Multipage";
6
+ export * from "./components/Video";
6
7
  export * from "./schema/PageTree";
7
8
  import { TextComponentSpec } from "./components/Text";
8
9
  import { QuizComponentSpec } from "./components/Quiz";
9
10
  import { LayoutComponentSpec } from "./components/Layout";
10
11
  import { PageComponentSpec } from "./components/Page";
11
12
  import { MultipageComponentSpec } from "./components/Multipage";
13
+ import { VideoComponentSpec } from "./components/Video";
12
14
  export const ComponentRegistry = {
13
15
  Text: TextComponentSpec,
14
16
  Quiz: QuizComponentSpec,
15
17
  Layout: LayoutComponentSpec,
16
18
  Page: PageComponentSpec,
17
19
  Multipage: MultipageComponentSpec,
20
+ Video: VideoComponentSpec,
18
21
  };
19
22
  // Helper to get a schema by type
20
23
  export function getPropsSchema(type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duckpic/content-spec",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ import type { ComponentSpec } from "./ComponentSpec";
3
+
4
+ export const VideoPropsSchema = z.object({
5
+ title: z.string().optional(),
6
+ link: z.string().optional(),
7
+ });
8
+
9
+ export const VideoComponentSpec: ComponentSpec = {
10
+ type: "Video",
11
+ propsSchema: VideoPropsSchema,
12
+ slots: [],
13
+ ui: {
14
+ label: "Video",
15
+ insertable: true,
16
+ insertMenuOrder: 25,
17
+ }
18
+ };
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./components/Quiz";
3
3
  export * from "./components/Layout";
4
4
  export * from "./components/Page";
5
5
  export * from "./components/Multipage";
6
+ export * from "./components/Video";
6
7
  export * from "./schema/PageTree";
7
8
 
8
9
 
@@ -11,6 +12,7 @@ import { QuizComponentSpec } from "./components/Quiz";
11
12
  import { LayoutComponentSpec } from "./components/Layout";
12
13
  import { PageComponentSpec } from "./components/Page";
13
14
  import { MultipageComponentSpec } from "./components/Multipage";
15
+ import { VideoComponentSpec } from "./components/Video";
14
16
  import type { ComponentSpec, ComponentUiMetadata } from "./components/ComponentSpec.ts";
15
17
 
16
18
  export const ComponentRegistry = {
@@ -19,6 +21,7 @@ export const ComponentRegistry = {
19
21
  Layout: LayoutComponentSpec,
20
22
  Page: PageComponentSpec,
21
23
  Multipage: MultipageComponentSpec,
24
+ Video: VideoComponentSpec,
22
25
  };
23
26
 
24
27
  export type ComponentType = keyof typeof ComponentRegistry;