@selfhelp/shared 1.2.5 → 1.3.1
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 +341 -326
- package/LICENSE +381 -381
- package/README.md +57 -57
- package/dist/index.d.mts +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -0
- package/package.json +102 -102
- package/src/api/__tests__/endpoints.test.ts +45 -0
- package/src/api/endpoints.ts +2 -0
- package/src/api/index.ts +5 -5
- package/src/assets/__tests__/resolveAssetUrl.test.ts +61 -61
- package/src/assets/index.ts +5 -5
- package/src/assets/resolveAssetUrl.ts +44 -44
- package/src/cms-classes/__tests__/classify.test.ts +63 -63
- package/src/cms-classes/allow-list.ts +158 -158
- package/src/cms-classes/classify.ts +90 -90
- package/src/cms-classes/index.ts +7 -7
- package/src/cms-classes/remap.ts +44 -44
- package/src/condition/__tests__/evaluate.test.ts +54 -54
- package/src/condition/evaluate.ts +121 -121
- package/src/condition/index.ts +5 -5
- package/src/index.ts +25 -25
- package/src/interpolation/__tests__/replaceCalcedValues.test.ts +41 -41
- package/src/interpolation/index.ts +5 -5
- package/src/interpolation/replaceCalcedValues.ts +27 -27
- package/src/plugin-sdk/define.ts +89 -89
- package/src/plugin-sdk/index.ts +103 -103
- package/src/plugin-sdk/lock.ts +124 -124
- package/src/plugin-sdk/manifest.ts +307 -307
- package/src/plugin-sdk/realtime.ts +277 -277
- package/src/plugin-sdk/registry.ts +105 -105
- package/src/plugin-sdk/runtime-shim.ts +140 -140
- package/src/plugin-sdk/types.ts +315 -315
- package/src/plugin-sdk/version.ts +209 -209
- package/src/registry/__tests__/registry.test.ts +135 -135
- package/src/registry/index.ts +94 -94
- package/src/registry/styles.registry.ts +295 -295
- package/src/testing/__tests__/testing-kit.test.ts +228 -228
- package/src/testing/index.ts +483 -483
- package/src/theme/index.ts +6 -6
- package/src/theme/tailwind.ts +73 -73
- package/src/theme/tokens.ts +177 -177
- package/src/types/api/auth.ts +22 -0
- package/src/types/api/envelope.ts +34 -34
- package/src/types/api/forms.ts +76 -76
- package/src/types/api/index.ts +9 -9
- package/src/types/api/language.ts +12 -12
- package/src/types/api/page.ts +9 -9
- package/src/types/index.ts +17 -17
- package/src/types/mantine/common.ts +142 -142
- package/src/types/pages.ts +107 -107
- package/src/types/styles/auth.ts +184 -184
- package/src/types/styles/base.ts +72 -72
- package/src/types/styles/composite.ts +131 -131
- package/src/types/styles/forms.ts +439 -439
- package/src/types/styles/interactive.ts +165 -165
- package/src/types/styles/layout.ts +184 -184
- package/src/types/styles/media.ts +68 -68
- package/src/types/styles/typography.ts +118 -118
- package/src/types/styles/unknown.ts +220 -220
- package/src/utils/__tests__/transformPageData.test.ts +69 -69
- package/src/utils/spacing.ts +64 -64
- package/src/utils/transformPageData.ts +99 -99
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
/*
|
|
2
|
-
SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
-
SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
*/
|
|
5
|
-
import type { IBaseStyle, IContentField, IStyleWithSpacing } from './base';
|
|
6
|
-
import type {
|
|
7
|
-
TMantineSize,
|
|
8
|
-
TMantineColor,
|
|
9
|
-
TMantineRadius,
|
|
10
|
-
TMantineTitleOrder,
|
|
11
|
-
TMantineFieldsetVariant,
|
|
12
|
-
TMantineSpoilerMaxHeight,
|
|
13
|
-
} from '../mantine/common';
|
|
14
|
-
|
|
15
|
-
export type TMantineTitleTextWrap = 'wrap' | 'balance' | 'nowrap';
|
|
16
|
-
export type TMantineTitleLineClamp = '1' | '2' | '3' | '4' | '5' | string;
|
|
17
|
-
export type TMantineTextFontWeight = '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
18
|
-
export type TMantineTextFontStyle = 'normal' | 'italic';
|
|
19
|
-
export type TMantineTextDecoration = 'none' | 'underline' | 'line-through';
|
|
20
|
-
export type TMantineTextTransform = 'none' | 'uppercase' | 'capitalize' | 'lowercase';
|
|
21
|
-
export type TMantineTextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
22
|
-
export type TMantineTextVariant = 'default' | 'gradient';
|
|
23
|
-
export type TMantineTextTruncate = 'none' | 'end' | 'start';
|
|
24
|
-
export type TMantineLineClamp = '2' | '3' | '4' | '5' | string;
|
|
25
|
-
export type TMantineTextInherit = '0' | '1';
|
|
26
|
-
export type TMantineTextSpan = '0' | '1';
|
|
27
|
-
export type TMantineIconSize = string;
|
|
28
|
-
|
|
29
|
-
export interface ITitleStyle extends IStyleWithSpacing {
|
|
30
|
-
style_name: 'title';
|
|
31
|
-
content?: IContentField<string>;
|
|
32
|
-
mantine_title_order?: IContentField<TMantineTitleOrder>;
|
|
33
|
-
mantine_size?: IContentField<TMantineSize>;
|
|
34
|
-
mantine_title_text_wrap?: IContentField<TMantineTitleTextWrap>;
|
|
35
|
-
mantine_title_line_clamp?: IContentField<TMantineTitleLineClamp>;
|
|
36
|
-
use_mantine_style?: IContentField<string>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface ITextStyle extends IStyleWithSpacing {
|
|
40
|
-
style_name: 'text';
|
|
41
|
-
text?: IContentField<string>;
|
|
42
|
-
mantine_size?: IContentField<TMantineSize>;
|
|
43
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
44
|
-
mantine_text_font_weight?: IContentField<TMantineTextFontWeight>;
|
|
45
|
-
mantine_text_font_style?: IContentField<TMantineTextFontStyle>;
|
|
46
|
-
mantine_text_text_decoration?: IContentField<TMantineTextDecoration>;
|
|
47
|
-
mantine_text_text_transform?: IContentField<TMantineTextTransform>;
|
|
48
|
-
mantine_text_align?: IContentField<TMantineTextAlign>;
|
|
49
|
-
mantine_text_variant?: IContentField<TMantineTextVariant>;
|
|
50
|
-
mantine_text_gradient?: IContentField<string>;
|
|
51
|
-
mantine_text_truncate?: IContentField<TMantineTextTruncate>;
|
|
52
|
-
mantine_text_line_clamp?: IContentField<TMantineLineClamp>;
|
|
53
|
-
mantine_text_inherit?: IContentField<TMantineTextInherit>;
|
|
54
|
-
mantine_text_span?: IContentField<TMantineTextSpan>;
|
|
55
|
-
use_mantine_style?: IContentField<string>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface ICodeStyle extends IStyleWithSpacing {
|
|
59
|
-
style_name: 'code';
|
|
60
|
-
mantine_code_block?: IContentField<string>;
|
|
61
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
62
|
-
use_mantine_style?: IContentField<string>;
|
|
63
|
-
content?: IContentField<string>;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface IHighlightStyle extends IStyleWithSpacing {
|
|
67
|
-
style_name: 'highlight';
|
|
68
|
-
text?: IContentField<string>;
|
|
69
|
-
mantine_highlight_highlight?: IContentField<string>;
|
|
70
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
71
|
-
use_mantine_style?: IContentField<string>;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface IBlockquoteStyle extends IStyleWithSpacing {
|
|
75
|
-
style_name: 'blockquote';
|
|
76
|
-
content?: IContentField<string>;
|
|
77
|
-
cite?: IContentField<string>;
|
|
78
|
-
mantine_left_icon?: IContentField<string>;
|
|
79
|
-
mantine_icon_size?: IContentField<TMantineIconSize>;
|
|
80
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
81
|
-
use_mantine_style?: IContentField<string>;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface IHtmlTagStyle extends IBaseStyle {
|
|
85
|
-
style_name: 'html-tag';
|
|
86
|
-
html_tag?: IContentField<string>;
|
|
87
|
-
html_tag_content?: IContentField<string>;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface IKbdStyle extends IStyleWithSpacing {
|
|
91
|
-
style_name: 'kbd';
|
|
92
|
-
label?: IContentField<string>;
|
|
93
|
-
mantine_size?: IContentField<TMantineSize>;
|
|
94
|
-
use_mantine_style?: IContentField<string>;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface ITypographyStyle extends IStyleWithSpacing {
|
|
98
|
-
style_name: 'typography';
|
|
99
|
-
use_mantine_style?: IContentField<string>;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export interface IFieldsetStyle extends IStyleWithSpacing {
|
|
103
|
-
style_name: 'fieldset';
|
|
104
|
-
label?: IContentField<string>;
|
|
105
|
-
legend?: IContentField<string>;
|
|
106
|
-
mantine_fieldset_variant?: IContentField<TMantineFieldsetVariant>;
|
|
107
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
108
|
-
use_mantine_style?: IContentField<string>;
|
|
109
|
-
disabled?: IContentField<string>;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface ISpoilerStyle extends IStyleWithSpacing {
|
|
113
|
-
style_name: 'spoiler';
|
|
114
|
-
mantine_height?: IContentField<TMantineSpoilerMaxHeight>;
|
|
115
|
-
mantine_spoiler_show_label?: IContentField<string>;
|
|
116
|
-
mantine_spoiler_hide_label?: IContentField<string>;
|
|
117
|
-
use_mantine_style?: IContentField<string>;
|
|
118
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import type { IBaseStyle, IContentField, IStyleWithSpacing } from './base';
|
|
6
|
+
import type {
|
|
7
|
+
TMantineSize,
|
|
8
|
+
TMantineColor,
|
|
9
|
+
TMantineRadius,
|
|
10
|
+
TMantineTitleOrder,
|
|
11
|
+
TMantineFieldsetVariant,
|
|
12
|
+
TMantineSpoilerMaxHeight,
|
|
13
|
+
} from '../mantine/common';
|
|
14
|
+
|
|
15
|
+
export type TMantineTitleTextWrap = 'wrap' | 'balance' | 'nowrap';
|
|
16
|
+
export type TMantineTitleLineClamp = '1' | '2' | '3' | '4' | '5' | string;
|
|
17
|
+
export type TMantineTextFontWeight = '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
18
|
+
export type TMantineTextFontStyle = 'normal' | 'italic';
|
|
19
|
+
export type TMantineTextDecoration = 'none' | 'underline' | 'line-through';
|
|
20
|
+
export type TMantineTextTransform = 'none' | 'uppercase' | 'capitalize' | 'lowercase';
|
|
21
|
+
export type TMantineTextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
22
|
+
export type TMantineTextVariant = 'default' | 'gradient';
|
|
23
|
+
export type TMantineTextTruncate = 'none' | 'end' | 'start';
|
|
24
|
+
export type TMantineLineClamp = '2' | '3' | '4' | '5' | string;
|
|
25
|
+
export type TMantineTextInherit = '0' | '1';
|
|
26
|
+
export type TMantineTextSpan = '0' | '1';
|
|
27
|
+
export type TMantineIconSize = string;
|
|
28
|
+
|
|
29
|
+
export interface ITitleStyle extends IStyleWithSpacing {
|
|
30
|
+
style_name: 'title';
|
|
31
|
+
content?: IContentField<string>;
|
|
32
|
+
mantine_title_order?: IContentField<TMantineTitleOrder>;
|
|
33
|
+
mantine_size?: IContentField<TMantineSize>;
|
|
34
|
+
mantine_title_text_wrap?: IContentField<TMantineTitleTextWrap>;
|
|
35
|
+
mantine_title_line_clamp?: IContentField<TMantineTitleLineClamp>;
|
|
36
|
+
use_mantine_style?: IContentField<string>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ITextStyle extends IStyleWithSpacing {
|
|
40
|
+
style_name: 'text';
|
|
41
|
+
text?: IContentField<string>;
|
|
42
|
+
mantine_size?: IContentField<TMantineSize>;
|
|
43
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
44
|
+
mantine_text_font_weight?: IContentField<TMantineTextFontWeight>;
|
|
45
|
+
mantine_text_font_style?: IContentField<TMantineTextFontStyle>;
|
|
46
|
+
mantine_text_text_decoration?: IContentField<TMantineTextDecoration>;
|
|
47
|
+
mantine_text_text_transform?: IContentField<TMantineTextTransform>;
|
|
48
|
+
mantine_text_align?: IContentField<TMantineTextAlign>;
|
|
49
|
+
mantine_text_variant?: IContentField<TMantineTextVariant>;
|
|
50
|
+
mantine_text_gradient?: IContentField<string>;
|
|
51
|
+
mantine_text_truncate?: IContentField<TMantineTextTruncate>;
|
|
52
|
+
mantine_text_line_clamp?: IContentField<TMantineLineClamp>;
|
|
53
|
+
mantine_text_inherit?: IContentField<TMantineTextInherit>;
|
|
54
|
+
mantine_text_span?: IContentField<TMantineTextSpan>;
|
|
55
|
+
use_mantine_style?: IContentField<string>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface ICodeStyle extends IStyleWithSpacing {
|
|
59
|
+
style_name: 'code';
|
|
60
|
+
mantine_code_block?: IContentField<string>;
|
|
61
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
62
|
+
use_mantine_style?: IContentField<string>;
|
|
63
|
+
content?: IContentField<string>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface IHighlightStyle extends IStyleWithSpacing {
|
|
67
|
+
style_name: 'highlight';
|
|
68
|
+
text?: IContentField<string>;
|
|
69
|
+
mantine_highlight_highlight?: IContentField<string>;
|
|
70
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
71
|
+
use_mantine_style?: IContentField<string>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface IBlockquoteStyle extends IStyleWithSpacing {
|
|
75
|
+
style_name: 'blockquote';
|
|
76
|
+
content?: IContentField<string>;
|
|
77
|
+
cite?: IContentField<string>;
|
|
78
|
+
mantine_left_icon?: IContentField<string>;
|
|
79
|
+
mantine_icon_size?: IContentField<TMantineIconSize>;
|
|
80
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
81
|
+
use_mantine_style?: IContentField<string>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface IHtmlTagStyle extends IBaseStyle {
|
|
85
|
+
style_name: 'html-tag';
|
|
86
|
+
html_tag?: IContentField<string>;
|
|
87
|
+
html_tag_content?: IContentField<string>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface IKbdStyle extends IStyleWithSpacing {
|
|
91
|
+
style_name: 'kbd';
|
|
92
|
+
label?: IContentField<string>;
|
|
93
|
+
mantine_size?: IContentField<TMantineSize>;
|
|
94
|
+
use_mantine_style?: IContentField<string>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface ITypographyStyle extends IStyleWithSpacing {
|
|
98
|
+
style_name: 'typography';
|
|
99
|
+
use_mantine_style?: IContentField<string>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface IFieldsetStyle extends IStyleWithSpacing {
|
|
103
|
+
style_name: 'fieldset';
|
|
104
|
+
label?: IContentField<string>;
|
|
105
|
+
legend?: IContentField<string>;
|
|
106
|
+
mantine_fieldset_variant?: IContentField<TMantineFieldsetVariant>;
|
|
107
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
108
|
+
use_mantine_style?: IContentField<string>;
|
|
109
|
+
disabled?: IContentField<string>;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface ISpoilerStyle extends IStyleWithSpacing {
|
|
113
|
+
style_name: 'spoiler';
|
|
114
|
+
mantine_height?: IContentField<TMantineSpoilerMaxHeight>;
|
|
115
|
+
mantine_spoiler_show_label?: IContentField<string>;
|
|
116
|
+
mantine_spoiler_hide_label?: IContentField<string>;
|
|
117
|
+
use_mantine_style?: IContentField<string>;
|
|
118
|
+
}
|
|
@@ -1,220 +1,220 @@
|
|
|
1
|
-
/*
|
|
2
|
-
SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
-
SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
*/
|
|
5
|
-
import type { IContentField } from './base';
|
|
6
|
-
import type {
|
|
7
|
-
ILoginStyle,
|
|
8
|
-
IRegisterStyle,
|
|
9
|
-
IValidateStyle,
|
|
10
|
-
IResetPasswordStyle,
|
|
11
|
-
ITwoFactorAuthStyle,
|
|
12
|
-
IProfileStyle,
|
|
13
|
-
} from './auth';
|
|
14
|
-
import type {
|
|
15
|
-
IContainerStyle,
|
|
16
|
-
IBoxStyle,
|
|
17
|
-
IFlexStyle,
|
|
18
|
-
IGroupStyle,
|
|
19
|
-
IStackStyle,
|
|
20
|
-
ISimpleGridStyle,
|
|
21
|
-
IGridStyle,
|
|
22
|
-
IGridColumnStyle,
|
|
23
|
-
ISpaceStyle,
|
|
24
|
-
IDividerStyle,
|
|
25
|
-
IPaperStyle,
|
|
26
|
-
ICenterStyle,
|
|
27
|
-
IScrollAreaStyle,
|
|
28
|
-
ICardStyle,
|
|
29
|
-
ICardSegmentStyle,
|
|
30
|
-
IAspectRatioStyle,
|
|
31
|
-
IBackgroundImageStyle,
|
|
32
|
-
} from './layout';
|
|
33
|
-
import type {
|
|
34
|
-
ITitleStyle,
|
|
35
|
-
ITextStyle,
|
|
36
|
-
ICodeStyle,
|
|
37
|
-
IHighlightStyle,
|
|
38
|
-
IBlockquoteStyle,
|
|
39
|
-
IHtmlTagStyle,
|
|
40
|
-
IKbdStyle,
|
|
41
|
-
ITypographyStyle,
|
|
42
|
-
IFieldsetStyle,
|
|
43
|
-
ISpoilerStyle,
|
|
44
|
-
} from './typography';
|
|
45
|
-
import type {
|
|
46
|
-
IImageStyle,
|
|
47
|
-
IVideoStyle,
|
|
48
|
-
IAudioStyle,
|
|
49
|
-
IFigureStyle,
|
|
50
|
-
ICarouselStyle,
|
|
51
|
-
} from './media';
|
|
52
|
-
import type {
|
|
53
|
-
IButtonStyle,
|
|
54
|
-
ILinkStyle,
|
|
55
|
-
IActionIconStyle,
|
|
56
|
-
IAlertStyle,
|
|
57
|
-
IBadgeStyle,
|
|
58
|
-
IAvatarStyle,
|
|
59
|
-
IChipStyle,
|
|
60
|
-
IIndicatorStyle,
|
|
61
|
-
IThemeIconStyle,
|
|
62
|
-
INotificationStyle,
|
|
63
|
-
} from './interactive';
|
|
64
|
-
import type {
|
|
65
|
-
IFormLogStyle,
|
|
66
|
-
IFormRecordStyle,
|
|
67
|
-
IInputStyle,
|
|
68
|
-
ITextInputStyle,
|
|
69
|
-
ITextareaStyle,
|
|
70
|
-
IRichTextEditorStyle,
|
|
71
|
-
ISelectStyle,
|
|
72
|
-
IRadioStyle,
|
|
73
|
-
ICheckboxStyle,
|
|
74
|
-
ISliderStyle,
|
|
75
|
-
IRangeSliderStyle,
|
|
76
|
-
IDatePickerStyle,
|
|
77
|
-
ISwitchStyle,
|
|
78
|
-
IComboboxStyle,
|
|
79
|
-
IColorInputStyle,
|
|
80
|
-
IColorPickerStyle,
|
|
81
|
-
IFileInputStyle,
|
|
82
|
-
INumberInputStyle,
|
|
83
|
-
ISegmentedControlStyle,
|
|
84
|
-
IRatingStyle,
|
|
85
|
-
IProgressStyle,
|
|
86
|
-
IProgressRootStyle,
|
|
87
|
-
IProgressSectionStyle,
|
|
88
|
-
} from './forms';
|
|
89
|
-
import type {
|
|
90
|
-
IAccordionStyle,
|
|
91
|
-
IAccordionItemStyle,
|
|
92
|
-
ITabsStyle,
|
|
93
|
-
ITabStyle,
|
|
94
|
-
ITimelineStyle,
|
|
95
|
-
IListStyle,
|
|
96
|
-
IListItemStyle,
|
|
97
|
-
IEntryListStyle,
|
|
98
|
-
IEntryRecordStyle,
|
|
99
|
-
IEntryRecordDeleteStyle,
|
|
100
|
-
ILoopStyle,
|
|
101
|
-
} from './composite';
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Discriminated union of every supported user-facing style. Adding a new
|
|
105
|
-
* style means adding its interface AND extending this union AND registering
|
|
106
|
-
* it in `STYLE_REGISTRY`.
|
|
107
|
-
*
|
|
108
|
-
* Admin/CMS-only styles are intentionally NOT in this union — the mobile
|
|
109
|
-
* app does not render them.
|
|
110
|
-
*/
|
|
111
|
-
export type TStyle =
|
|
112
|
-
| ILoginStyle
|
|
113
|
-
| IRegisterStyle
|
|
114
|
-
| IValidateStyle
|
|
115
|
-
| IResetPasswordStyle
|
|
116
|
-
| ITwoFactorAuthStyle
|
|
117
|
-
| IProfileStyle
|
|
118
|
-
| IContainerStyle
|
|
119
|
-
| IBoxStyle
|
|
120
|
-
| IFlexStyle
|
|
121
|
-
| IGroupStyle
|
|
122
|
-
| IStackStyle
|
|
123
|
-
| ISimpleGridStyle
|
|
124
|
-
| IGridStyle
|
|
125
|
-
| IGridColumnStyle
|
|
126
|
-
| ISpaceStyle
|
|
127
|
-
| IDividerStyle
|
|
128
|
-
| IPaperStyle
|
|
129
|
-
| ICenterStyle
|
|
130
|
-
| IScrollAreaStyle
|
|
131
|
-
| ICardStyle
|
|
132
|
-
| ICardSegmentStyle
|
|
133
|
-
| IAspectRatioStyle
|
|
134
|
-
| IBackgroundImageStyle
|
|
135
|
-
| ITitleStyle
|
|
136
|
-
| ITextStyle
|
|
137
|
-
| ICodeStyle
|
|
138
|
-
| IHighlightStyle
|
|
139
|
-
| IBlockquoteStyle
|
|
140
|
-
| IHtmlTagStyle
|
|
141
|
-
| IKbdStyle
|
|
142
|
-
| ITypographyStyle
|
|
143
|
-
| IFieldsetStyle
|
|
144
|
-
| ISpoilerStyle
|
|
145
|
-
| IImageStyle
|
|
146
|
-
| IVideoStyle
|
|
147
|
-
| IAudioStyle
|
|
148
|
-
| IFigureStyle
|
|
149
|
-
| ICarouselStyle
|
|
150
|
-
| IButtonStyle
|
|
151
|
-
| ILinkStyle
|
|
152
|
-
| IActionIconStyle
|
|
153
|
-
| IAlertStyle
|
|
154
|
-
| IBadgeStyle
|
|
155
|
-
| IAvatarStyle
|
|
156
|
-
| IChipStyle
|
|
157
|
-
| IIndicatorStyle
|
|
158
|
-
| IThemeIconStyle
|
|
159
|
-
| INotificationStyle
|
|
160
|
-
| IFormLogStyle
|
|
161
|
-
| IFormRecordStyle
|
|
162
|
-
| IInputStyle
|
|
163
|
-
| ITextInputStyle
|
|
164
|
-
| ITextareaStyle
|
|
165
|
-
| IRichTextEditorStyle
|
|
166
|
-
| ISelectStyle
|
|
167
|
-
| IRadioStyle
|
|
168
|
-
| ICheckboxStyle
|
|
169
|
-
| ISliderStyle
|
|
170
|
-
| IRangeSliderStyle
|
|
171
|
-
| IDatePickerStyle
|
|
172
|
-
| ISwitchStyle
|
|
173
|
-
| IComboboxStyle
|
|
174
|
-
| IColorInputStyle
|
|
175
|
-
| IColorPickerStyle
|
|
176
|
-
| IFileInputStyle
|
|
177
|
-
| INumberInputStyle
|
|
178
|
-
| ISegmentedControlStyle
|
|
179
|
-
| IRatingStyle
|
|
180
|
-
| IProgressStyle
|
|
181
|
-
| IProgressRootStyle
|
|
182
|
-
| IProgressSectionStyle
|
|
183
|
-
| IAccordionStyle
|
|
184
|
-
| IAccordionItemStyle
|
|
185
|
-
| ITabsStyle
|
|
186
|
-
| ITabStyle
|
|
187
|
-
| ITimelineStyle
|
|
188
|
-
| IListStyle
|
|
189
|
-
| IListItemStyle
|
|
190
|
-
| IEntryListStyle
|
|
191
|
-
| IEntryRecordStyle
|
|
192
|
-
| IEntryRecordDeleteStyle
|
|
193
|
-
| ILoopStyle;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Discriminator — name of every supported style. Derived from the
|
|
197
|
-
* `STYLE_REGISTRY` keys (declared in `src/registry/styles.registry.ts`).
|
|
198
|
-
*
|
|
199
|
-
* NOTE: Keep in sync with `STYLE_REGISTRY`. The registry is the source of
|
|
200
|
-
* truth at runtime; this type is the source of truth at compile time.
|
|
201
|
-
*/
|
|
202
|
-
export type TStyleName = TStyle['style_name'];
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Catch-all for styles a renderer doesn't know about (yet). Keeps the
|
|
206
|
-
* tree alive and lets the renderer surface debug info.
|
|
207
|
-
*/
|
|
208
|
-
export interface IUnknownStyle {
|
|
209
|
-
id: number;
|
|
210
|
-
id_styles: number;
|
|
211
|
-
style_name: string;
|
|
212
|
-
can_have_children: number | null;
|
|
213
|
-
position: number;
|
|
214
|
-
path: string;
|
|
215
|
-
children?: TStyle[];
|
|
216
|
-
fields: Record<string, IContentField<unknown>>;
|
|
217
|
-
css?: string;
|
|
218
|
-
css_mobile?: string;
|
|
219
|
-
use_mantine_style?: IContentField<string>;
|
|
220
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import type { IContentField } from './base';
|
|
6
|
+
import type {
|
|
7
|
+
ILoginStyle,
|
|
8
|
+
IRegisterStyle,
|
|
9
|
+
IValidateStyle,
|
|
10
|
+
IResetPasswordStyle,
|
|
11
|
+
ITwoFactorAuthStyle,
|
|
12
|
+
IProfileStyle,
|
|
13
|
+
} from './auth';
|
|
14
|
+
import type {
|
|
15
|
+
IContainerStyle,
|
|
16
|
+
IBoxStyle,
|
|
17
|
+
IFlexStyle,
|
|
18
|
+
IGroupStyle,
|
|
19
|
+
IStackStyle,
|
|
20
|
+
ISimpleGridStyle,
|
|
21
|
+
IGridStyle,
|
|
22
|
+
IGridColumnStyle,
|
|
23
|
+
ISpaceStyle,
|
|
24
|
+
IDividerStyle,
|
|
25
|
+
IPaperStyle,
|
|
26
|
+
ICenterStyle,
|
|
27
|
+
IScrollAreaStyle,
|
|
28
|
+
ICardStyle,
|
|
29
|
+
ICardSegmentStyle,
|
|
30
|
+
IAspectRatioStyle,
|
|
31
|
+
IBackgroundImageStyle,
|
|
32
|
+
} from './layout';
|
|
33
|
+
import type {
|
|
34
|
+
ITitleStyle,
|
|
35
|
+
ITextStyle,
|
|
36
|
+
ICodeStyle,
|
|
37
|
+
IHighlightStyle,
|
|
38
|
+
IBlockquoteStyle,
|
|
39
|
+
IHtmlTagStyle,
|
|
40
|
+
IKbdStyle,
|
|
41
|
+
ITypographyStyle,
|
|
42
|
+
IFieldsetStyle,
|
|
43
|
+
ISpoilerStyle,
|
|
44
|
+
} from './typography';
|
|
45
|
+
import type {
|
|
46
|
+
IImageStyle,
|
|
47
|
+
IVideoStyle,
|
|
48
|
+
IAudioStyle,
|
|
49
|
+
IFigureStyle,
|
|
50
|
+
ICarouselStyle,
|
|
51
|
+
} from './media';
|
|
52
|
+
import type {
|
|
53
|
+
IButtonStyle,
|
|
54
|
+
ILinkStyle,
|
|
55
|
+
IActionIconStyle,
|
|
56
|
+
IAlertStyle,
|
|
57
|
+
IBadgeStyle,
|
|
58
|
+
IAvatarStyle,
|
|
59
|
+
IChipStyle,
|
|
60
|
+
IIndicatorStyle,
|
|
61
|
+
IThemeIconStyle,
|
|
62
|
+
INotificationStyle,
|
|
63
|
+
} from './interactive';
|
|
64
|
+
import type {
|
|
65
|
+
IFormLogStyle,
|
|
66
|
+
IFormRecordStyle,
|
|
67
|
+
IInputStyle,
|
|
68
|
+
ITextInputStyle,
|
|
69
|
+
ITextareaStyle,
|
|
70
|
+
IRichTextEditorStyle,
|
|
71
|
+
ISelectStyle,
|
|
72
|
+
IRadioStyle,
|
|
73
|
+
ICheckboxStyle,
|
|
74
|
+
ISliderStyle,
|
|
75
|
+
IRangeSliderStyle,
|
|
76
|
+
IDatePickerStyle,
|
|
77
|
+
ISwitchStyle,
|
|
78
|
+
IComboboxStyle,
|
|
79
|
+
IColorInputStyle,
|
|
80
|
+
IColorPickerStyle,
|
|
81
|
+
IFileInputStyle,
|
|
82
|
+
INumberInputStyle,
|
|
83
|
+
ISegmentedControlStyle,
|
|
84
|
+
IRatingStyle,
|
|
85
|
+
IProgressStyle,
|
|
86
|
+
IProgressRootStyle,
|
|
87
|
+
IProgressSectionStyle,
|
|
88
|
+
} from './forms';
|
|
89
|
+
import type {
|
|
90
|
+
IAccordionStyle,
|
|
91
|
+
IAccordionItemStyle,
|
|
92
|
+
ITabsStyle,
|
|
93
|
+
ITabStyle,
|
|
94
|
+
ITimelineStyle,
|
|
95
|
+
IListStyle,
|
|
96
|
+
IListItemStyle,
|
|
97
|
+
IEntryListStyle,
|
|
98
|
+
IEntryRecordStyle,
|
|
99
|
+
IEntryRecordDeleteStyle,
|
|
100
|
+
ILoopStyle,
|
|
101
|
+
} from './composite';
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Discriminated union of every supported user-facing style. Adding a new
|
|
105
|
+
* style means adding its interface AND extending this union AND registering
|
|
106
|
+
* it in `STYLE_REGISTRY`.
|
|
107
|
+
*
|
|
108
|
+
* Admin/CMS-only styles are intentionally NOT in this union — the mobile
|
|
109
|
+
* app does not render them.
|
|
110
|
+
*/
|
|
111
|
+
export type TStyle =
|
|
112
|
+
| ILoginStyle
|
|
113
|
+
| IRegisterStyle
|
|
114
|
+
| IValidateStyle
|
|
115
|
+
| IResetPasswordStyle
|
|
116
|
+
| ITwoFactorAuthStyle
|
|
117
|
+
| IProfileStyle
|
|
118
|
+
| IContainerStyle
|
|
119
|
+
| IBoxStyle
|
|
120
|
+
| IFlexStyle
|
|
121
|
+
| IGroupStyle
|
|
122
|
+
| IStackStyle
|
|
123
|
+
| ISimpleGridStyle
|
|
124
|
+
| IGridStyle
|
|
125
|
+
| IGridColumnStyle
|
|
126
|
+
| ISpaceStyle
|
|
127
|
+
| IDividerStyle
|
|
128
|
+
| IPaperStyle
|
|
129
|
+
| ICenterStyle
|
|
130
|
+
| IScrollAreaStyle
|
|
131
|
+
| ICardStyle
|
|
132
|
+
| ICardSegmentStyle
|
|
133
|
+
| IAspectRatioStyle
|
|
134
|
+
| IBackgroundImageStyle
|
|
135
|
+
| ITitleStyle
|
|
136
|
+
| ITextStyle
|
|
137
|
+
| ICodeStyle
|
|
138
|
+
| IHighlightStyle
|
|
139
|
+
| IBlockquoteStyle
|
|
140
|
+
| IHtmlTagStyle
|
|
141
|
+
| IKbdStyle
|
|
142
|
+
| ITypographyStyle
|
|
143
|
+
| IFieldsetStyle
|
|
144
|
+
| ISpoilerStyle
|
|
145
|
+
| IImageStyle
|
|
146
|
+
| IVideoStyle
|
|
147
|
+
| IAudioStyle
|
|
148
|
+
| IFigureStyle
|
|
149
|
+
| ICarouselStyle
|
|
150
|
+
| IButtonStyle
|
|
151
|
+
| ILinkStyle
|
|
152
|
+
| IActionIconStyle
|
|
153
|
+
| IAlertStyle
|
|
154
|
+
| IBadgeStyle
|
|
155
|
+
| IAvatarStyle
|
|
156
|
+
| IChipStyle
|
|
157
|
+
| IIndicatorStyle
|
|
158
|
+
| IThemeIconStyle
|
|
159
|
+
| INotificationStyle
|
|
160
|
+
| IFormLogStyle
|
|
161
|
+
| IFormRecordStyle
|
|
162
|
+
| IInputStyle
|
|
163
|
+
| ITextInputStyle
|
|
164
|
+
| ITextareaStyle
|
|
165
|
+
| IRichTextEditorStyle
|
|
166
|
+
| ISelectStyle
|
|
167
|
+
| IRadioStyle
|
|
168
|
+
| ICheckboxStyle
|
|
169
|
+
| ISliderStyle
|
|
170
|
+
| IRangeSliderStyle
|
|
171
|
+
| IDatePickerStyle
|
|
172
|
+
| ISwitchStyle
|
|
173
|
+
| IComboboxStyle
|
|
174
|
+
| IColorInputStyle
|
|
175
|
+
| IColorPickerStyle
|
|
176
|
+
| IFileInputStyle
|
|
177
|
+
| INumberInputStyle
|
|
178
|
+
| ISegmentedControlStyle
|
|
179
|
+
| IRatingStyle
|
|
180
|
+
| IProgressStyle
|
|
181
|
+
| IProgressRootStyle
|
|
182
|
+
| IProgressSectionStyle
|
|
183
|
+
| IAccordionStyle
|
|
184
|
+
| IAccordionItemStyle
|
|
185
|
+
| ITabsStyle
|
|
186
|
+
| ITabStyle
|
|
187
|
+
| ITimelineStyle
|
|
188
|
+
| IListStyle
|
|
189
|
+
| IListItemStyle
|
|
190
|
+
| IEntryListStyle
|
|
191
|
+
| IEntryRecordStyle
|
|
192
|
+
| IEntryRecordDeleteStyle
|
|
193
|
+
| ILoopStyle;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Discriminator — name of every supported style. Derived from the
|
|
197
|
+
* `STYLE_REGISTRY` keys (declared in `src/registry/styles.registry.ts`).
|
|
198
|
+
*
|
|
199
|
+
* NOTE: Keep in sync with `STYLE_REGISTRY`. The registry is the source of
|
|
200
|
+
* truth at runtime; this type is the source of truth at compile time.
|
|
201
|
+
*/
|
|
202
|
+
export type TStyleName = TStyle['style_name'];
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Catch-all for styles a renderer doesn't know about (yet). Keeps the
|
|
206
|
+
* tree alive and lets the renderer surface debug info.
|
|
207
|
+
*/
|
|
208
|
+
export interface IUnknownStyle {
|
|
209
|
+
id: number;
|
|
210
|
+
id_styles: number;
|
|
211
|
+
style_name: string;
|
|
212
|
+
can_have_children: number | null;
|
|
213
|
+
position: number;
|
|
214
|
+
path: string;
|
|
215
|
+
children?: TStyle[];
|
|
216
|
+
fields: Record<string, IContentField<unknown>>;
|
|
217
|
+
css?: string;
|
|
218
|
+
css_mobile?: string;
|
|
219
|
+
use_mantine_style?: IContentField<string>;
|
|
220
|
+
}
|