@se-studio/core-data-types 1.0.144 → 1.0.147

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @se-studio/core-data-types
2
2
 
3
+ ## 1.0.147
4
+
5
+ ### Patch Changes
6
+
7
+ - Version bump: patch for changed packages
8
+
9
+ ## 1.0.146
10
+
11
+ ### Patch Changes
12
+
13
+ - Version bump: patch for changed packages
14
+
15
+ ## 1.0.145
16
+
17
+ ### Patch Changes
18
+
19
+ - Version bump: patch for changed packages
20
+
3
21
  ## 1.0.144
4
22
 
5
23
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -39,7 +39,7 @@ export { isCustomType } from './types/customType';
39
39
  export type { IBasePage } from './types/page';
40
40
  export { isPage } from './types/page';
41
41
  export type { ISchema } from './types/schema';
42
- export type { IBaseTag, IBaseTags } from './types/tag';
42
+ export type { IBaseTag, IBaseTags, IBaseTagType } from './types/tag';
43
43
  export { isTag, isTags, } from './types/tag';
44
44
  export type { Horizontal, IAnimation, IExternalVideo, IFullVideo, IImage, ILocalVideo, IOptimisedSvg, IPicture, IResponsiveVisual, ISvgData, ISvgImage, IVideo, IVideoDetails, IVideoEmbed, IVisual, IVisualCommon, IVisualSizes, Vertical, } from './types/visual';
45
45
  export { getVisualHorizontalPosition, getVisualWidthPercent, isAnimation, isExternalVideo, isFullVideo, isImage, isLocalVideo, isPicture, isResponsiveVisual, isSvgData, isSvgImage, isVideo, isVisual, isVisualAnimation, isVisualImage, isVisualVideo, processSizes, } from './types/visual';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,aAAa,EA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EACX,aAAa,EACb,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,aAAa,EACb,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,WAAW,EACX,OAAO,EACP,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,UAAU,EACV,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,cAAc,EACd,MAAM,EACN,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,KAAK,EACL,MAAM,GACP,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,MAAM,EACN,WAAW,EACX,aAAa,EACb,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,aAAa,EACb,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,WAAW,EACX,OAAO,EACP,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC"}
@@ -1,8 +1,15 @@
1
1
  import type { IBaseModel, ITyped } from './common';
2
2
  import type { ISchema } from './schema';
3
+ export interface IBaseTagType {
4
+ id: string;
5
+ name: string;
6
+ slug?: string | null;
7
+ /** Resolved indexPageTopContent merged with template — for tag type index pages */
8
+ contents?: ReadonlyArray<ITyped>;
9
+ }
3
10
  export interface IBaseTag extends IBaseModel {
4
11
  type: 'Tag';
5
- tagType?: string | null;
12
+ tagType?: IBaseTagType | null;
6
13
  structuredData?: ReadonlyArray<ISchema>;
7
14
  contents?: ReadonlyArray<ITyped>;
8
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/types/tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,IAAI,QAAQ,CAE9D;AAED,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,IAAI,SAAS,CAEhE"}
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/types/tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,IAAI,QAAQ,CAE9D;AAED,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,IAAI,SAAS,CAEhE"}
@@ -1 +1 @@
1
- {"version":3,"file":"tag.js","sourceRoot":"","sources":["../../src/types/tag.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,KAAK,CAAC,OAAmB;IACvC,OAAO,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC;AAChC,CAAC;AAMD,MAAM,UAAU,MAAM,CAAC,OAAmB;IACxC,OAAO,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC;AACjC,CAAC"}
1
+ {"version":3,"file":"tag.js","sourceRoot":"","sources":["../../src/types/tag.ts"],"names":[],"mappings":"AAkBA,MAAM,UAAU,KAAK,CAAC,OAAmB;IACvC,OAAO,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC;AAChC,CAAC;AAMD,MAAM,UAAU,MAAM,CAAC,OAAmB;IACxC,OAAO,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC;AACjC,CAAC"}
package/docs/llms.md ADDED
@@ -0,0 +1,169 @@
1
+ # @se-studio/core-data-types — LLM Reference
2
+
3
+ Pure TypeScript type definitions for SE Studio content models. No runtime dependencies. Used by all other `@se-studio` packages and consuming apps.
4
+
5
+ > **Note:** Consuming projects use `noUncheckedIndexedAccess` — array/object index access returns `T | undefined`. Always null-check index results.
6
+
7
+ ## Content Types
8
+
9
+ ### Page
10
+ ```ts
11
+ import type { IBasePage } from '@se-studio/core-data-types';
12
+ import { isPage } from '@se-studio/core-data-types';
13
+
14
+ interface IBasePage {
15
+ id: string;
16
+ slug: string;
17
+ title: string;
18
+ description?: string;
19
+ content: unknown[]; // array of components/collections
20
+ // ... more fields
21
+ }
22
+ ```
23
+
24
+ ### Article
25
+ ```ts
26
+ import type { IBaseArticle, IBaseArticleType } from '@se-studio/core-data-types';
27
+ import { isArticle, isArticleType } from '@se-studio/core-data-types';
28
+ ```
29
+
30
+ ### Tag
31
+ ```ts
32
+ import type { IBaseTag, IBaseTags, IBaseTagType } from '@se-studio/core-data-types';
33
+ import { isTag, isTags } from '@se-studio/core-data-types';
34
+ ```
35
+
36
+ ### Component & Collection
37
+ ```ts
38
+ import type { IBaseComponent, IBaseCollection, IBaseExternalComponent } from '@se-studio/core-data-types';
39
+ import { isComponent, isCollection, isExternalComponent } from '@se-studio/core-data-types';
40
+ ```
41
+
42
+ ### Person
43
+ ```ts
44
+ import type { IBasePerson } from '@se-studio/core-data-types';
45
+ import { isPerson } from '@se-studio/core-data-types';
46
+ ```
47
+
48
+ ### Banner
49
+ ```ts
50
+ import type { IBanner } from '@se-studio/core-data-types';
51
+ import { isBanner } from '@se-studio/core-data-types';
52
+ ```
53
+
54
+ ### Custom Type
55
+ ```ts
56
+ import type { IBaseCustomType } from '@se-studio/core-data-types';
57
+ import { isCustomType } from '@se-studio/core-data-types';
58
+ ```
59
+
60
+ ## Link Types
61
+
62
+ All internal/external link variants share the `ILinkProps` base.
63
+
64
+ ```ts
65
+ import type {
66
+ IInternalLink, // link to internal page (has slug + href)
67
+ IExternalLink, // link to external URL
68
+ IDownloadLink, // link to downloadable asset
69
+ IBlankLink, // blank/empty link
70
+ IPageLink, // lightweight page reference (id + slug + title)
71
+ IArticleLink, // lightweight article reference
72
+ IArticleTypeLink,
73
+ ITagLink,
74
+ IPersonLink,
75
+ INavigationItem,
76
+ INavigation,
77
+ } from '@se-studio/core-data-types';
78
+
79
+ import {
80
+ isInternalLink,
81
+ isExternalLink,
82
+ isDownloadLink,
83
+ isBlankLink,
84
+ isPageLink,
85
+ isArticleLink,
86
+ isArticleTypeLink,
87
+ isTagLink,
88
+ isPersonLink,
89
+ isLink, // any link type
90
+ } from '@se-studio/core-data-types';
91
+ ```
92
+
93
+ ## Visual / Media Types
94
+
95
+ ```ts
96
+ import type {
97
+ IVisual, // union of all visual types
98
+ IResponsiveVisual, // { desktop: IVisual; mobile?: IVisual }
99
+ IImage, // { url, width, height, alt, ... }
100
+ IPicture, // responsive image with multiple sources
101
+ IVideo, // union of video types
102
+ IFullVideo, // self-hosted video
103
+ ILocalVideo, // local video file
104
+ IExternalVideo, // YouTube / Vimeo embed
105
+ IAnimation, // Lottie / SVG animation
106
+ ISvgImage, // inline SVG
107
+ IOptimisedSvg,
108
+ } from '@se-studio/core-data-types';
109
+
110
+ import {
111
+ isVisual, isImage, isPicture,
112
+ isVideo, isFullVideo, isLocalVideo, isExternalVideo,
113
+ isAnimation, isSvgImage, isSvgData,
114
+ isResponsiveVisual,
115
+ isVisualImage, isVisualVideo, isVisualAnimation,
116
+ } from '@se-studio/core-data-types';
117
+ ```
118
+
119
+ ## Context Types
120
+
121
+ ```ts
122
+ import type {
123
+ IPageContext, // current page info passed through renderer
124
+ IAnalyticsContext, // analytics tracking context
125
+ IContentContext, // content rendering context
126
+ IPageLink, // minimal page reference { slug, title, href? }
127
+ } from '@se-studio/core-data-types';
128
+ ```
129
+
130
+ ## Utility Types
131
+
132
+ ```ts
133
+ import type {
134
+ IBaseModel, // { id: string; type: string }
135
+ ITyped, // { type: string }
136
+ InternalType, // discriminated union helper
137
+ } from '@se-studio/core-data-types';
138
+ ```
139
+
140
+ ## Visual Helpers
141
+
142
+ ```ts
143
+ import {
144
+ getVisualHorizontalPosition, // returns Tailwind object-position class
145
+ getVisualWidthPercent,
146
+ processSizes, // compute Next.js Image sizes string
147
+ } from '@se-studio/core-data-types';
148
+ ```
149
+
150
+ ## Ordering Helpers
151
+
152
+ ```ts
153
+ import { orderContentWithHtmlHeroFirst } from '@se-studio/core-data-types';
154
+ // Reorders a content array so HTML hero components appear first
155
+ ```
156
+
157
+ ## Usage Pattern
158
+
159
+ Apps extend base types with project-specific fields:
160
+
161
+ ```ts
162
+ // In your app's types
163
+ import type { IBasePage } from '@se-studio/core-data-types';
164
+
165
+ export interface IPage extends IBasePage {
166
+ heroImage?: IImage;
167
+ themeColor?: string;
168
+ }
169
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/core-data-types",
3
- "version": "1.0.144",
3
+ "version": "1.0.147",
4
4
  "description": "Core TypeScript type definitions for SE Studio content models",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,8 @@
19
19
  },
20
20
  "files": [
21
21
  "dist",
22
- "*.md"
22
+ "*.md",
23
+ "docs"
23
24
  ],
24
25
  "keywords": [
25
26
  "typescript",