@smartsoft001-mobilems/models 2.95.0 → 2.97.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 +23 -1
- package/package.json +1 -1
- package/src/lib/entities/index.d.ts +1 -0
- package/src/lib/entities/index.js +1 -0
- package/src/lib/entities/index.js.map +1 -1
- package/src/lib/entities/page-section.entity.d.ts +87 -0
- package/src/lib/entities/page-section.entity.js +10 -0
- package/src/lib/entities/page-section.entity.js.map +1 -0
- package/src/lib/entities/page.entity.d.ts +5 -0
- package/src/lib/entities/page.entity.js.map +1 -1
package/README.md
CHANGED
|
@@ -15,11 +15,33 @@ 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
|
|
18
|
+
| `Page` | CMS page — `IEntity<number>`; optional `slug`, `seo: PageSeo \| null`, `sections: PageSection[] \| null` |
|
|
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, …) |
|
|
22
22
|
|
|
23
|
+
## Page sections
|
|
24
|
+
|
|
25
|
+
Dynamic CMS page sections — `Page.sections`, returned by `GET page/<id>` / `GET page/slug/<slug>` and
|
|
26
|
+
rendered by `PageSectionsComponent` (`smart-mobilems-page-sections`) in
|
|
27
|
+
[`@smartsoft001-mobilems/angular`](../angular/README.md). Fields the API may send as `null` are typed
|
|
28
|
+
as such; `grid`, `margin` and `padding` are `unknown` (not interpreted yet).
|
|
29
|
+
|
|
30
|
+
| Export | Shape |
|
|
31
|
+
| ------------------------------- | --------------------------------------------------------------------------------------- |
|
|
32
|
+
| `PageSection` | `type`, `theme` (component key `type/theme`), `position`, `appearance`, `content`, `blocks`, `cta`, `grid?` |
|
|
33
|
+
| `PageSectionContent` | `title?`, `lead?` (HTML), `description?` (HTML) |
|
|
34
|
+
| `PageSectionBlock` | `position`, `content`, `media: { background: PageSectionMedia \| null } \| null`, `target`, `grid?` |
|
|
35
|
+
| `PageSectionCta` | `position`, `target` |
|
|
36
|
+
| `PageSectionAppearance` | `background: { color, file?, type? } \| null`, `margin?`, `padding?` |
|
|
37
|
+
| `PageSectionMedia` | `position?`, `file: PageSectionFile \| null`, `type: 'image' \| 'video' \| null` |
|
|
38
|
+
| `PageSectionFile` | `filePath` (relative to the API host), `id?`, `extension?`, `altText?`, `fileName?` |
|
|
39
|
+
| `PageSectionTarget` | Union of the three targets below, discriminated by `targetType` |
|
|
40
|
+
| `PageSectionLinkTarget` | `targetType: 'link'`, `url` (`http(s)://`, `#anchor` or internal path), `targetLabel?` |
|
|
41
|
+
| `PageSectionDictionaryTarget` | `targetType: 'dictionary'`, `dictionaryType` (e.g. `creator`), `dictionary` (id), `targetLabel?` |
|
|
42
|
+
| `PageSectionMuseumObjectTarget` | `targetType: 'museum_object'`, `object` (id), `targetLabel?` |
|
|
43
|
+
| `PageSeo` | `title?`, `description?` — SEO fields of a `Page` |
|
|
44
|
+
|
|
23
45
|
## User
|
|
24
46
|
|
|
25
47
|
`IUser`, `IUserInfo`, `IUserRegister`, `IUserModify`, `ILoginResponse` — the API-payload shapes.
|
package/package.json
CHANGED
|
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./file.entity"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./page.entity"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./page-section.entity"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./user.entity"), exports);
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/shared/models/src/lib/entities/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,wDAA8B;AAC9B,wDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/shared/models/src/lib/entities/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,wDAA8B;AAC9B,gEAAsC;AACtC,wDAA8B"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamic CMS page sections — `sections` of a `Page` returned by
|
|
3
|
+
* `GET page/<id>` / `GET page/slug/<slug>`.
|
|
4
|
+
*
|
|
5
|
+
* Every field the API may send as `null` is typed as such. `grid`, `margin`
|
|
6
|
+
* and `padding` are not interpreted by the framework yet, hence `unknown`.
|
|
7
|
+
*/
|
|
8
|
+
export interface PageSectionContent {
|
|
9
|
+
title?: string | null;
|
|
10
|
+
/** HTML. */
|
|
11
|
+
lead?: string | null;
|
|
12
|
+
/** HTML. */
|
|
13
|
+
description?: string | null;
|
|
14
|
+
}
|
|
15
|
+
export interface PageSectionLinkTarget {
|
|
16
|
+
targetType: 'link';
|
|
17
|
+
targetLabel?: string | null;
|
|
18
|
+
/** `http(s)://…` (external), `#anchor` or an internal path. */
|
|
19
|
+
url: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface PageSectionDictionaryTarget {
|
|
22
|
+
targetType: 'dictionary';
|
|
23
|
+
targetLabel?: string | null;
|
|
24
|
+
/** Dictionary kind, e.g. `creator`. */
|
|
25
|
+
dictionaryType: string;
|
|
26
|
+
/** Dictionary entry id. */
|
|
27
|
+
dictionary: number;
|
|
28
|
+
}
|
|
29
|
+
export interface PageSectionMuseumObjectTarget {
|
|
30
|
+
targetType: 'museum_object';
|
|
31
|
+
targetLabel?: string | null;
|
|
32
|
+
/** Museum object id. */
|
|
33
|
+
object: number;
|
|
34
|
+
}
|
|
35
|
+
export type PageSectionTarget = PageSectionLinkTarget | PageSectionDictionaryTarget | PageSectionMuseumObjectTarget;
|
|
36
|
+
export interface PageSectionFile {
|
|
37
|
+
id?: number;
|
|
38
|
+
/** Relative to the API host, e.g. `/uploads/media/…`. */
|
|
39
|
+
filePath: string;
|
|
40
|
+
extension?: string | null;
|
|
41
|
+
altText?: string | null;
|
|
42
|
+
fileName?: string | null;
|
|
43
|
+
}
|
|
44
|
+
export interface PageSectionMedia {
|
|
45
|
+
position?: number;
|
|
46
|
+
file: PageSectionFile | null;
|
|
47
|
+
type: 'image' | 'video' | null;
|
|
48
|
+
}
|
|
49
|
+
export interface PageSectionBlock {
|
|
50
|
+
position: number;
|
|
51
|
+
grid?: unknown;
|
|
52
|
+
content: PageSectionContent | null;
|
|
53
|
+
media: {
|
|
54
|
+
background: PageSectionMedia | null;
|
|
55
|
+
} | null;
|
|
56
|
+
target: PageSectionTarget | null;
|
|
57
|
+
}
|
|
58
|
+
export interface PageSectionCta {
|
|
59
|
+
position: number;
|
|
60
|
+
target: PageSectionTarget | null;
|
|
61
|
+
}
|
|
62
|
+
export interface PageSectionAppearance {
|
|
63
|
+
margin?: unknown;
|
|
64
|
+
padding?: unknown;
|
|
65
|
+
background: {
|
|
66
|
+
color: string | null;
|
|
67
|
+
file?: PageSectionFile | null;
|
|
68
|
+
type?: string | null;
|
|
69
|
+
} | null;
|
|
70
|
+
}
|
|
71
|
+
export interface PageSection {
|
|
72
|
+
/** Section kind, e.g. `slider`, `tile_collection`, `banner`. */
|
|
73
|
+
type: string;
|
|
74
|
+
/** Visual variant of the `type`, e.g. `carousel`, `cards`. */
|
|
75
|
+
theme: string;
|
|
76
|
+
appearance: PageSectionAppearance | null;
|
|
77
|
+
position: number;
|
|
78
|
+
grid?: unknown;
|
|
79
|
+
content: PageSectionContent | null;
|
|
80
|
+
blocks: PageSectionBlock[];
|
|
81
|
+
cta: PageSectionCta[];
|
|
82
|
+
}
|
|
83
|
+
/** SEO fields of a CMS page; every field may be `null`. */
|
|
84
|
+
export interface PageSeo {
|
|
85
|
+
title?: string | null;
|
|
86
|
+
description?: string | null;
|
|
87
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Dynamic CMS page sections — `sections` of a `Page` returned by
|
|
4
|
+
* `GET page/<id>` / `GET page/slug/<slug>`.
|
|
5
|
+
*
|
|
6
|
+
* Every field the API may send as `null` is typed as such. `grid`, `margin`
|
|
7
|
+
* and `padding` are not interpreted by the framework yet, hence `unknown`.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
//# sourceMappingURL=page-section.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-section.entity.js","sourceRoot":"","sources":["../../../../../../../packages/shared/models/src/lib/entities/page-section.entity.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { PageSection, PageSeo } from './page-section.entity';
|
|
2
3
|
export declare class Page implements IEntity<number> {
|
|
3
4
|
id: number;
|
|
4
5
|
title: string;
|
|
5
6
|
content: any;
|
|
6
7
|
slides: Array<PageSlide>;
|
|
8
|
+
slug?: string;
|
|
9
|
+
seo?: PageSeo | null;
|
|
10
|
+
/** Dynamic sections, rendered by `smart-mobilems-page-sections`. */
|
|
11
|
+
sections?: PageSection[] | null;
|
|
7
12
|
}
|
|
8
13
|
export declare class PageSlide {
|
|
9
14
|
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;AAK7C,IAAM,IAAI,GAAV,MAAM,IAAI;CAsBhB,CAAA;AAtBY,oBAAI;AAIf;IADC,IAAA,cAAK,GAAE;;mCACO;AAGf;IADC,IAAA,cAAK,GAAE;;qCACK;AAGb;IADC,IAAA,cAAK,GAAE;sCACC,KAAK;oCAAY;eAVf,IAAI;IADhB,IAAA,cAAK,GAAE;GACK,IAAI,CAsBhB;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"}
|