@smartsoft001-mobilems/models 2.101.0 → 2.103.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.
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ import { Config, Page, MsFile, ArticleWidgetType } from '@smartsoft001-mobilems/
|
|
|
15
15
|
| `ConfigPageType` | Page-type enum used by the config menu |
|
|
16
16
|
| `ConfigMenuItem` | Union of menu-item shapes |
|
|
17
17
|
| `ITheme` | Theme block of `Config` (colours, fonts, per-area flags) |
|
|
18
|
-
| `Page` | CMS page — `IEntity<number>`; optional `slug`, `seo: PageSeo \| null`, `sections: PageSectionRaw[] \| null` (raw API shape — normalize before use) |
|
|
18
|
+
| `Page` | CMS page — `IEntity<number>`; optional `slug`, `seo: PageSeo \| null`, `sections: PageSectionRaw[] \| null` (raw API shape — normalize before use); `slides` may be missing or `null`; `image` / `backgroundImage` (`MsFile \| string \| null`) are the page images `GET page/:id` sends |
|
|
19
19
|
| `PageSlide` | Slide of a CMS page |
|
|
20
20
|
| `MsFile` | Multimedia file — `IEntity<number>` |
|
|
21
21
|
| `MsFileFromFeature` | Enum of file feature sources (image, audio, video, 3d, …) |
|
|
@@ -45,8 +45,8 @@ arrays without `null`s, everything sorted by `position`, `position` always a num
|
|
|
45
45
|
| `PageSectionCta` | `position`, `target` |
|
|
46
46
|
| `PageSectionAppearance` | `margin?`/`padding?: PageSectionSpacing \| null`, `background: PageSectionBackground \| null` |
|
|
47
47
|
| `PageSectionSpacing` | `top?`, `right?`, `bottom?`, `left?` — each `number` (CMS scale 0–12) or `null` |
|
|
48
|
-
| `PageSectionBackground` | `color: string \| null
|
|
49
|
-
| `PageSectionMedia` | `position?`, `file: PageSectionFile \| null`, `type: 'image' \| 'video' \| null`
|
|
48
|
+
| `PageSectionBackground` | `color: string \| null` (only `#rgb`/`#rrggbb`/`#rrggbbaa` is used), `file?: PageSectionFile \| null`, `type?: 'image' \| 'video' \| 'audio' \| 'other' \| string \| null` |
|
|
49
|
+
| `PageSectionMedia` | `position?`, `file: PageSectionFile \| null`, `type: 'image' \| 'video' \| 'audio' \| 'other' \| null` (`null` → kind from the extension) |
|
|
50
50
|
| `PageSectionFile` | `filePath` (relative to the multimedia host, or an absolute CDN URL), `id?`, `extension?`, `altText?`, `fileName?` |
|
|
51
51
|
| `PageSectionWidget` | banner widgets: `search: PageSectionSearchWidget[]`, `counter: PageSectionCounterWidget[]` |
|
|
52
52
|
| `PageSectionSearchWidget` | `position`, `placeholder: string \| null` |
|
|
@@ -54,7 +54,8 @@ arrays without `null`s, everything sorted by `position`, `position` always a num
|
|
|
54
54
|
| `PageSectionTarget` | Union of the targets below, discriminated by `targetType`; every target has `targetLabel?` |
|
|
55
55
|
| `PageSectionLinkTarget` | `targetType: 'link'`, `url` (`http(s)://`, `mailto:`, `tel:`, `#anchor` or internal path) |
|
|
56
56
|
| `PageSectionPageTarget` | `targetType: 'page'`, `page` (CMS page id) |
|
|
57
|
-
| `PageSectionDictionaryTarget` | `targetType: 'dictionary'`, `dictionaryType: PageSectionDictionaryType`, `dictionary: number \| null` — an entry id (selected record)
|
|
57
|
+
| `PageSectionDictionaryTarget` | `targetType: 'dictionary'`, `dictionaryType: PageSectionDictionaryType`, `dictionary: number \| null` — an entry id (selected record); `null`/missing = the whole dictionary (legacy form of `PageSectionDictionaryFilterTarget`, still supported) |
|
|
58
|
+
| `PageSectionDictionaryFilterTarget` | `targetType: 'dictionary_filter'`, `dictionaryType: PageSectionDictionaryType`, `limit?: number \| null` (max blocks, integer `> 0`), `sort?: string \| null` (announced, ignored yet) — the whole dictionary, canonical API shape (expanded by the angular `smart-mobilems-page-sections`; never clickable itself). Future filter fields will be optional |
|
|
58
59
|
| `PageSectionDictionaryType` | `'creator' \| 'department' \| 'tag' \| 'cycle' \| string` |
|
|
59
60
|
| `PageSectionMuseumObjectTarget` | `targetType: 'museum_object'`, `object` (id) |
|
|
60
61
|
| `PageSectionCardTypeCodeTarget` | `targetType: 'card_type_code'`, `cardTypeCodes: number[]` (any matches) |
|
|
@@ -78,7 +79,7 @@ arrays without `null`s, everything sorted by `position`, `position` always a num
|
|
|
78
79
|
widgets: `IArticleWidgetText`, `IArticleWidgetImage`, `IArticleWidgetMedia`, `IArticleWidgetVideo`,
|
|
79
80
|
`IArticleWidgetAudio`, `IArticleWidgetGalleryImage`, `IArticleWidgetGalleryArticle`,
|
|
80
81
|
`IArticleWidgetGalleryObject`
|
|
81
|
-
- Shared descriptors: `IAuthor`, `ICreator`, `IKeyword`, `ICycle`, `ICopyrights`, `MenuItem`, `ITab`
|
|
82
|
+
- Shared descriptors: `IAuthor`, `ICreator`, `IKeyword`, `ICycle`, `ICopyrights`, `MenuItem`, `ITab` (`id`, `label`, optional `count` for search tabs)
|
|
82
83
|
|
|
83
84
|
`WidgetComponent` in [`@smartsoft001-mobilems/angular`](../angular/README.md) maps an
|
|
84
85
|
`ArticleWidgetType` to the component that renders it; a new widget type is an `IArticleWidget`
|
package/package.json
CHANGED
|
@@ -33,10 +33,7 @@ export interface PageSectionPageTarget {
|
|
|
33
33
|
/** CMS page id. */
|
|
34
34
|
page: number;
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Dictionary kinds the CMS offers (`cycle` announced, not in the CMS yet);
|
|
38
|
-
* others may come later.
|
|
39
|
-
*/
|
|
36
|
+
/** Dictionary kinds the CMS offers; others may come later. */
|
|
40
37
|
export type PageSectionDictionaryType = 'creator' | 'department' | 'tag' | 'cycle' | (string & {});
|
|
41
38
|
export interface PageSectionDictionaryTarget {
|
|
42
39
|
targetType: 'dictionary';
|
|
@@ -45,11 +42,40 @@ export interface PageSectionDictionaryTarget {
|
|
|
45
42
|
dictionaryType: PageSectionDictionaryType;
|
|
46
43
|
/**
|
|
47
44
|
* Dictionary entry id (a selected record). `null` — or a missing field —
|
|
48
|
-
* means the whole dictionary
|
|
49
|
-
*
|
|
45
|
+
* means the whole dictionary (legacy form of
|
|
46
|
+
* `PageSectionDictionaryFilterTarget`, still supported):
|
|
47
|
+
* `smart-mobilems-page-sections` expands such a block into one block per
|
|
48
|
+
* entry (`expandDictionaryBlocks`).
|
|
50
49
|
*/
|
|
51
50
|
dictionary: number | null;
|
|
52
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* A whole dictionary (CMS mode "a dictionary" as opposed to "selected
|
|
54
|
+
* records") — the canonical shape sent by the API:
|
|
55
|
+
* `{ targetType: 'dictionary_filter', dictionaryType: 'cycle' }`.
|
|
56
|
+
* `smart-mobilems-page-sections` expands such a block into one block per
|
|
57
|
+
* entry, each with a `PageSectionDictionaryTarget` (`expandDictionaryBlocks`);
|
|
58
|
+
* not expanded it is never clickable.
|
|
59
|
+
*
|
|
60
|
+
* The backend announced a filter configuration for this target; every such
|
|
61
|
+
* field is optional, so new ones do not break the contract.
|
|
62
|
+
*/
|
|
63
|
+
export interface PageSectionDictionaryFilterTarget {
|
|
64
|
+
targetType: 'dictionary_filter';
|
|
65
|
+
targetLabel?: string | null;
|
|
66
|
+
/** Dictionary kind, e.g. `cycle`. */
|
|
67
|
+
dictionaryType: PageSectionDictionaryType;
|
|
68
|
+
/**
|
|
69
|
+
* Max blocks produced from the dictionary — applied when it is an integer
|
|
70
|
+
* `> 0`, otherwise ignored.
|
|
71
|
+
*/
|
|
72
|
+
limit?: number | null;
|
|
73
|
+
/**
|
|
74
|
+
* Announced (e.g. newest/oldest first) — not interpreted yet, entries keep
|
|
75
|
+
* the API order.
|
|
76
|
+
*/
|
|
77
|
+
sort?: string | null;
|
|
78
|
+
}
|
|
53
79
|
export interface PageSectionMuseumObjectTarget {
|
|
54
80
|
targetType: 'museum_object';
|
|
55
81
|
targetLabel?: string | null;
|
|
@@ -72,7 +98,7 @@ export interface PageSectionModuleTarget {
|
|
|
72
98
|
targetLabel?: string | null;
|
|
73
99
|
[field: string]: unknown;
|
|
74
100
|
}
|
|
75
|
-
export type PageSectionTarget = PageSectionLinkTarget | PageSectionPageTarget | PageSectionDictionaryTarget | PageSectionMuseumObjectTarget | PageSectionCardTypeCodeTarget | PageSectionModuleTarget;
|
|
101
|
+
export type PageSectionTarget = PageSectionLinkTarget | PageSectionPageTarget | PageSectionDictionaryTarget | PageSectionDictionaryFilterTarget | PageSectionMuseumObjectTarget | PageSectionCardTypeCodeTarget | PageSectionModuleTarget;
|
|
76
102
|
export interface PageSectionFile {
|
|
77
103
|
id?: number;
|
|
78
104
|
/**
|
|
@@ -87,7 +113,8 @@ export interface PageSectionFile {
|
|
|
87
113
|
export interface PageSectionMedia {
|
|
88
114
|
position?: number;
|
|
89
115
|
file: PageSectionFile | null;
|
|
90
|
-
|
|
116
|
+
/** File kind from the API; `null`/missing → guessed from the extension. */
|
|
117
|
+
type: 'image' | 'video' | 'audio' | 'other' | null;
|
|
91
118
|
}
|
|
92
119
|
/** `media` of a block: the background and an optional audio/video file. */
|
|
93
120
|
export interface PageSectionBlockMedia {
|
|
@@ -127,7 +154,10 @@ export interface PageSectionSpacing {
|
|
|
127
154
|
export interface PageSectionBackground {
|
|
128
155
|
color: string | null;
|
|
129
156
|
file?: PageSectionFile | null;
|
|
130
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* `image`/`video`/`audio`/`other`; only `image`, `null` or an unknown string
|
|
159
|
+
* give a background image.
|
|
160
|
+
*/
|
|
131
161
|
type?: 'image' | 'video' | (string & {}) | null;
|
|
132
162
|
}
|
|
133
163
|
export interface PageSectionAppearance {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { MsFile } from './file.entity';
|
|
2
3
|
import { PageSectionRaw, PageSeo } from './page-section.entity';
|
|
3
4
|
export declare class Page implements IEntity<number> {
|
|
4
5
|
id: number;
|
|
5
6
|
title: string;
|
|
6
7
|
content: any;
|
|
7
|
-
|
|
8
|
+
/** Empty or missing on most pages; the API may also send `null`. */
|
|
9
|
+
slides?: Array<PageSlide> | null;
|
|
8
10
|
slug?: string;
|
|
9
11
|
seo?: PageSeo | null;
|
|
10
12
|
/**
|
|
@@ -13,6 +15,9 @@ export declare class Page implements IEntity<number> {
|
|
|
13
15
|
* `smart-mobilems-page-sections` does it itself.
|
|
14
16
|
*/
|
|
15
17
|
sections?: PageSectionRaw[] | null;
|
|
18
|
+
/** Page image sent by `GET page/:id`, as a file object or a ready path. */
|
|
19
|
+
image?: MsFile | string | null;
|
|
20
|
+
backgroundImage?: MsFile | string | null;
|
|
16
21
|
}
|
|
17
22
|
export declare class PageSlide {
|
|
18
23
|
id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.entity.js","sourceRoot":"","sources":["../../../../../../../packages/shared/models/src/lib/entities/page.entity.ts"],"names":[],"mappings":";;;;AACA,iDAAoD;
|
|
1
|
+
{"version":3,"file":"page.entity.js","sourceRoot":"","sources":["../../../../../../../packages/shared/models/src/lib/entities/page.entity.ts"],"names":[],"mappings":";;;;AACA,iDAAoD;AAM7C,IAAM,IAAI,GAAV,MAAM,IAAI;CAgChB,CAAA;AAhCY,oBAAI;AAIf;IADC,IAAA,cAAK,GAAE;;mCACO;AAGf;IADC,IAAA,cAAK,GAAE;;qCACK;AAIb;IADC,IAAA,cAAK,GAAE;sCACC,KAAK;oCAAmB;eAXtB,IAAI;IADhB,IAAA,cAAK,GAAE;GACK,IAAI,CAgChB;AAGM,IAAM,SAAS,GAAf,MAAM,SAAS;CAkBrB,CAAA;AAlBY,8BAAS;AAEpB;IADC,IAAA,cAAK,GAAE;;qCACI;AAGZ;IADC,IAAA,cAAK,GAAE;;wCACO;AAGf;IADC,IAAA,cAAK,GAAE;;+CACwB;AAGhC;IADC,IAAA,cAAK,GAAE;;+CACc;AAGtB;IADC,IAAA,cAAK,GAAE;;8CACa;AAGrB;IADC,IAAA,cAAK,GAAE;;8CACa;oBAjBV,SAAS;IADrB,IAAA,cAAK,GAAE;GACK,SAAS,CAkBrB"}
|