@cntrl-site/sdk 1.28.0-4 → 1.28.0-6

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/lib/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export type { StructuredBlock, ComponentStructuredBlock, RichTextStructuredBlock
17
17
  export type { RichTextBlock, RichTextEntity, RichTextStyle } from './types/article/RichText';
18
18
  export type { ItemArea } from './types/article/ItemArea';
19
19
  export type { ItemState, ItemStateParams, StateParams, ItemStatesMap } from './types/article/ItemState';
20
- export type { Interaction, InteractionItemTrigger, InteractionScrollTrigger, InteractionState } from './types/article/Interaction';
20
+ export type { Interaction, InteractionItemTrigger, InteractionScrollTrigger, InteractionState, InteractionItemScrollTrigger } from './types/article/Interaction';
21
21
  export type { Layout } from './types/project/Layout';
22
22
  export type { Project } from './types/project/Project';
23
23
  export type { Meta } from './types/project/Meta';
@@ -41,26 +41,19 @@ const SectionBaseSchema = zod_1.z.object({
41
41
  position: zod_1.z.record(zod_1.z.number()),
42
42
  color: zod_1.z.record(zod_1.z.nullable(zod_1.z.string())),
43
43
  hidden: zod_1.z.record(zod_1.z.boolean()),
44
- media: zod_1.z.record(exports.SectionMediaSchema).optional()
45
- });
46
- const FreehandSectionSchema = SectionBaseSchema.extend({
47
- type: zod_1.z.literal('freehand'),
48
- height: zod_1.z.record(exports.SectionHeightSchema),
49
- });
50
- const ComponentBasedSectionSchema = SectionBaseSchema.extend({
51
- type: zod_1.z.literal('component-based'),
52
44
  minHeight: zod_1.z.record(exports.SectionHeightSchema),
53
45
  structuredContent: zod_1.z.array(StructuredBlock_schema_1.StructuredBlockSchema),
54
- structuredContentSettings: exports.ComponentBasedSectionSettingsSchema
46
+ media: zod_1.z.record(exports.SectionMediaSchema).optional()
47
+ });
48
+ const DefaultSectionSchema = SectionBaseSchema.extend({
49
+ type: zod_1.z.literal('default'),
50
+ structuredContentSettings: exports.ComponentBasedSectionSettingsSchema,
55
51
  });
56
52
  const ContentBasedSectionSchema = SectionBaseSchema.extend({
57
53
  type: zod_1.z.literal('content-based'),
58
- minHeight: zod_1.z.record(exports.SectionHeightSchema),
59
- structuredContent: zod_1.z.array(StructuredBlock_schema_1.StructuredBlockSchema),
60
54
  structuredContentSettings: exports.ContentBasedSectionSettingsSchema
61
55
  });
62
56
  exports.SectionSchema = zod_1.z.discriminatedUnion('type', [
63
- FreehandSectionSchema,
64
- ComponentBasedSectionSchema,
57
+ DefaultSectionSchema,
65
58
  ContentBasedSectionSchema
66
59
  ]);
@@ -25,11 +25,11 @@ export type SectionImage = {
25
25
  position: string;
26
26
  offsetX: number | null;
27
27
  };
28
- interface ContentBasedSectionSettings {
29
- defaultWidth: Record<string, number>;
28
+ export interface ContentBasedSectionSettings {
30
29
  paddingBottom: Record<string, number>;
30
+ defaultWidth: Record<string, number>;
31
31
  }
32
- interface ComponentBasedSectionSettings {
32
+ export interface DefaultSectionSettings {
33
33
  paddingBottom: Record<string, number>;
34
34
  }
35
35
  export type SectionMedia = SectionVideo | SectionImage;
@@ -38,25 +38,19 @@ type SectionBase = {
38
38
  name?: string;
39
39
  items: ItemAny[];
40
40
  position: Record<string, number>;
41
+ minHeight: Record<string, SectionHeight>;
41
42
  color: Record<string, string | null>;
42
43
  media?: Record<string, SectionMedia>;
43
44
  hidden: Record<string, boolean>;
44
- };
45
- export type FreehandSection = SectionBase & {
46
- type: 'freehand';
47
- height: Record<string, SectionHeight>;
48
- };
49
- export type ComponentBasedSection = SectionBase & {
50
- type: 'component-based';
51
- minHeight: Record<string, SectionHeight>;
52
45
  structuredContent: StructuredBlockAny[];
53
- structuredContentSettings: ComponentBasedSectionSettings;
46
+ };
47
+ export type DefaultSection = SectionBase & {
48
+ type: 'default';
49
+ structuredContentSettings: DefaultSectionSettings;
54
50
  };
55
51
  export type ContentBasedSection = SectionBase & {
56
52
  type: 'content-based';
57
- minHeight: Record<string, SectionHeight>;
58
- structuredContent: StructuredBlockAny[];
59
53
  structuredContentSettings: ContentBasedSectionSettings;
60
54
  };
61
- export type Section = FreehandSection | ComponentBasedSection | ContentBasedSection;
55
+ export type Section = DefaultSection | ContentBasedSection;
62
56
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.28.0-4",
3
+ "version": "1.28.0-6",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",