@engagently/types 7.2.0 → 7.3.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/dist/common/_types/ConfigDefinition.d.ts +2 -2
- package/dist/common/_types/WidgetDefinitions.d.ts +70 -16
- package/dist/common/lib/api/enums.d.ts +5 -0
- package/dist/i18n/i18n.d.ts +815 -799
- package/dist/main/lib/engagently.d.ts +1 -0
- package/dist/types/engagently.d.ts +5 -0
- package/dist/ui/themes/config/_types.d.ts +3 -3
- package/package.json +11 -11
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { DsmCommentariesSort, DsmFeatureName } from '../lib/api/enums';
|
|
2
|
+
import type { AdSlotProps, AdSlots } from '../lib/components/AdSlot';
|
|
1
3
|
import type { defaultResources } from '../../i18n/i18n';
|
|
2
4
|
import type { AvailableThemes, ColorSchemesConfig } from '../../ui/themes/_types';
|
|
3
5
|
import type { ThemeSettings } from '../../ui/themes/config';
|
|
4
6
|
import type { CombinedError, Operation } from '@urql/preact';
|
|
5
7
|
import type { EgyEntities, MessageEvents } from './WidgetDefinitions';
|
|
6
|
-
import type { DsmFeatureName, DsmCommentariesSort } from '../lib/api/enums';
|
|
7
|
-
import type { AdSlotProps, AdSlots } from '../lib/components/AdSlot';
|
|
8
8
|
export declare enum ExperienceCallBackNames {
|
|
9
9
|
POLL_BAR = "POLL_BAR",
|
|
10
10
|
POLL_GRID = "POLL_GRID",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VNode } from 'preact';
|
|
2
|
-
import type { ExperienceParticipationFragment } from '../../widgets/src/poll/data/ExperienceFragments.generated';
|
|
3
1
|
import type { ExmParticipationFragment } from '../../widgets/src/debate/data/ParticipationFragment.generated';
|
|
4
|
-
import type {
|
|
2
|
+
import type { ExperienceParticipationFragment } from '../../widgets/src/poll/data/ExperienceFragments.generated';
|
|
3
|
+
import type { ChartData, DebatePollData, DebateStats, PollBarData, PollGridData, PollStats, QuizBarData, QuizQuestionStats, QuizStats } from '../../ui/core/_types';
|
|
4
|
+
import type { VNode } from 'preact';
|
|
5
5
|
/**
|
|
6
6
|
* Type Definitions for all available entities
|
|
7
7
|
*
|
|
@@ -30,7 +30,7 @@ export type EgyEntitiesValues = `${EgyEntities}`;
|
|
|
30
30
|
export declare enum SharedSlots {
|
|
31
31
|
CTA_HEADER = "ctaHeader"
|
|
32
32
|
}
|
|
33
|
-
export declare enum
|
|
33
|
+
export declare enum CommentaryActionIconSlots {
|
|
34
34
|
BOOKMARK_ICON = "bookmarkIcon",
|
|
35
35
|
BOOKMARK_ICON_ACTIVE = "bookmarkIconActive",
|
|
36
36
|
DELETE_ICON = "deleteIcon",
|
|
@@ -44,6 +44,10 @@ export declare enum CommentaryActionsSlots {
|
|
|
44
44
|
REACTION2_active = "reaction2_active",
|
|
45
45
|
REACTION3 = "reaction3",
|
|
46
46
|
REACTION3_active = "reaction3_active",
|
|
47
|
+
REACTION_AGREE = "reactionAgree",
|
|
48
|
+
REACTION_DISAGREE = "reactionDisagree",
|
|
49
|
+
REACTION_AGREE_active = "reactionAgree_active",
|
|
50
|
+
REACTION_DISAGREE_active = "reactionDisagree_active",
|
|
47
51
|
REPLY_ICON = "replyIcon",
|
|
48
52
|
REPORT_ICON = "reportIcon",
|
|
49
53
|
REPORT_ICON_ACTIVE = "reportIconActive",
|
|
@@ -98,15 +102,13 @@ export declare enum DiscussionMessagesSlots {
|
|
|
98
102
|
}
|
|
99
103
|
export declare enum DiscussionIconSlots {
|
|
100
104
|
LIVE_MODE_ICON = "liveModeIcon",
|
|
101
|
-
SETTINGS_ICON = "settingsIcon",
|
|
102
|
-
USER_ICON = "userIcon",
|
|
103
105
|
REPLIES_TOGGLE_ICON_open = "repliesToggleIcon_open",
|
|
104
106
|
REPLIES_TOGGLE_ICON_closed = "repliesToggleIcon_closed"
|
|
105
107
|
}
|
|
106
108
|
export declare enum DiscussionSlots {
|
|
107
109
|
CUSTOM_CALL_TO_ACTION = "customCallToAction"
|
|
108
110
|
}
|
|
109
|
-
export type DiscussionSlotValues = `${SharedSlots}` | `${
|
|
111
|
+
export type DiscussionSlotValues = `${SharedSlots}` | `${CommentaryActionIconSlots}` | `${UserIconSlots}` | `${DiscussionSlots}` | `${DiscussionIconSlots}` | `${DiscussionMessagesSlots}`;
|
|
110
112
|
export interface DiscussionWidget {
|
|
111
113
|
name: EgyEntities.EGY_DISCUSSION;
|
|
112
114
|
slots: Array<DiscussionSlotValues>;
|
|
@@ -135,15 +137,21 @@ export declare enum UserAttributes {
|
|
|
135
137
|
INITIAL_VIEW = "initialView"
|
|
136
138
|
}
|
|
137
139
|
export type UserAttributesHTMLElement = {
|
|
138
|
-
'initial-view'
|
|
140
|
+
'initial-view'?: string;
|
|
139
141
|
};
|
|
140
142
|
export type UserAttributesComponent = {
|
|
141
143
|
initialView: string;
|
|
142
144
|
};
|
|
143
|
-
export declare enum
|
|
145
|
+
export declare enum InitialViews {
|
|
146
|
+
USER_COMMENTS = "user-comments",
|
|
147
|
+
USER_BOOKMARKS = "user-bookmarks",
|
|
148
|
+
USER_SETTINGS = "user-settings"
|
|
149
|
+
}
|
|
150
|
+
export declare enum UserIconSlots {
|
|
144
151
|
SETTINGS_ICON = "settingsIcon",
|
|
145
|
-
USER_ICON = "userIcon"
|
|
146
|
-
|
|
152
|
+
USER_ICON = "userIcon"
|
|
153
|
+
}
|
|
154
|
+
export declare enum UserSlots {
|
|
147
155
|
ACTION_ELEMENT = "actionElement"
|
|
148
156
|
}
|
|
149
157
|
export declare enum UserMessagesSlots {
|
|
@@ -154,7 +162,7 @@ export declare enum UserMessagesSlots {
|
|
|
154
162
|
USERNAME_CHANGE = "messages_usernameChange",
|
|
155
163
|
USERNAME_CHANGE_PRESCRIBED = "messages_usernameChangePrescribed"
|
|
156
164
|
}
|
|
157
|
-
export type UserSlotValues = `${SharedSlots}` | `${
|
|
165
|
+
export type UserSlotValues = `${SharedSlots}` | `${CommentaryActionIconSlots}` | `${UserIconSlots}` | `${UserSlots}` | `${UserMessagesSlots}`;
|
|
158
166
|
export interface UserWidget {
|
|
159
167
|
name: EgyEntities.EGY_USER;
|
|
160
168
|
attributes: Array<`${UserAttributes}`>;
|
|
@@ -172,8 +180,6 @@ export type DebateAttributesComponent = {
|
|
|
172
180
|
export declare enum DebateIconSlots {
|
|
173
181
|
VISITS_ICON = "visitsIcon",
|
|
174
182
|
PARTICIPATIONS_ICON = "participationsIcon",
|
|
175
|
-
USER_ICON = "userIcon",
|
|
176
|
-
SETTINGS_ICON = "settingsIcon",
|
|
177
183
|
REPLIES_TOGGLE_ICON_open = "repliesToggleIcon_open",
|
|
178
184
|
REPLIES_TOGGLE_ICON_closed = "repliesToggleIcon_closed"
|
|
179
185
|
}
|
|
@@ -193,7 +199,7 @@ export declare enum DebateMessagesSlots {
|
|
|
193
199
|
USERNAME_CHANGE_PRESCRIBED = "messages_usernameChangePrescribed",
|
|
194
200
|
VOTE_TO_DEBATE = "messages_voteToDebate"
|
|
195
201
|
}
|
|
196
|
-
export type DebateSlotValues = `${SharedSlots}` | `${
|
|
202
|
+
export type DebateSlotValues = `${SharedSlots}` | `${CommentaryActionIconSlots}` | `${UserIconSlots}` | `${DebateIconSlots}` | `${DebateSlots}` | `${DebateMessagesSlots}`;
|
|
197
203
|
export interface DebateWidget {
|
|
198
204
|
name: EgyEntities.EGY_DEBATE;
|
|
199
205
|
attributes: Array<`${DebateAttributes}`>;
|
|
@@ -221,6 +227,48 @@ export interface DebatesWidget {
|
|
|
221
227
|
slots: Array<DebateSlotValues>;
|
|
222
228
|
}
|
|
223
229
|
export type DebatesSlotValues = `${SharedSlots}`;
|
|
230
|
+
export interface DebateTeasersResponse {
|
|
231
|
+
debates: DebateTeaser[];
|
|
232
|
+
/** ISO timestamp string, e.g. "2025-09-18T16:51:35.479659Z" */
|
|
233
|
+
data_at: string;
|
|
234
|
+
}
|
|
235
|
+
export interface DebateTeaser {
|
|
236
|
+
id: string;
|
|
237
|
+
state: 'active' | 'inactive' | 'finished';
|
|
238
|
+
question: {
|
|
239
|
+
text: string;
|
|
240
|
+
/** Current API returns "bar" – keep open for future types */
|
|
241
|
+
type: 'bar' | string;
|
|
242
|
+
choices: Array<{
|
|
243
|
+
id: string;
|
|
244
|
+
label: string;
|
|
245
|
+
explanation: string;
|
|
246
|
+
color: string;
|
|
247
|
+
stats: {
|
|
248
|
+
clicks: number;
|
|
249
|
+
commentaries: number;
|
|
250
|
+
comments: number;
|
|
251
|
+
};
|
|
252
|
+
}>;
|
|
253
|
+
};
|
|
254
|
+
stats: {
|
|
255
|
+
participations: number;
|
|
256
|
+
visits?: number;
|
|
257
|
+
commentaries: number;
|
|
258
|
+
comments: number;
|
|
259
|
+
};
|
|
260
|
+
info: {
|
|
261
|
+
title: string;
|
|
262
|
+
image_url: string;
|
|
263
|
+
image_title?: string | null;
|
|
264
|
+
image_credits: string;
|
|
265
|
+
url: string;
|
|
266
|
+
};
|
|
267
|
+
/** ISO timestamp string */
|
|
268
|
+
published_at: string;
|
|
269
|
+
}
|
|
270
|
+
/** Tiny helper if you still need a numeric epoch from `data_at` */
|
|
271
|
+
export declare const dataAtToEpoch: (r: DebateTeasersResponse) => number;
|
|
224
272
|
export declare enum DebateTeaserTarget {
|
|
225
273
|
BLANK = "_blank",
|
|
226
274
|
SELF = "_self"
|
|
@@ -240,7 +288,9 @@ export declare enum DebateTeaserAttributes {
|
|
|
240
288
|
SORT = "sort",
|
|
241
289
|
TARGET = "target",
|
|
242
290
|
SECTIONS = "sections",
|
|
243
|
-
LABELS = "labels"
|
|
291
|
+
LABELS = "labels",
|
|
292
|
+
CONTROLLED = "controlled",
|
|
293
|
+
DATA = "data"
|
|
244
294
|
}
|
|
245
295
|
export type DebateTeaserAttributesHTMLElement = {
|
|
246
296
|
basis?: string;
|
|
@@ -251,6 +301,8 @@ export type DebateTeaserAttributesHTMLElement = {
|
|
|
251
301
|
target?: string;
|
|
252
302
|
sections?: string;
|
|
253
303
|
labels?: string;
|
|
304
|
+
controlled?: boolean | string;
|
|
305
|
+
data?: string;
|
|
254
306
|
};
|
|
255
307
|
export type DebateTeaserAttributesComponent = {
|
|
256
308
|
basis: string;
|
|
@@ -261,6 +313,8 @@ export type DebateTeaserAttributesComponent = {
|
|
|
261
313
|
target?: DebateTeaserTarget;
|
|
262
314
|
sections?: string[];
|
|
263
315
|
labels?: string[];
|
|
316
|
+
controlled?: boolean;
|
|
317
|
+
data?: DebateTeasersResponse;
|
|
264
318
|
};
|
|
265
319
|
export interface DebateTeaserWidget {
|
|
266
320
|
name: EgyEntities.EGY_DEBATE_TEASER;
|
|
@@ -3,6 +3,11 @@ export declare enum DsmCommentariesSort {
|
|
|
3
3
|
CreatedAtDesc = "CREATED_AT_DESC",
|
|
4
4
|
PopularityDesc = "POPULARITY_DESC"
|
|
5
5
|
}
|
|
6
|
+
export declare enum DsmCommentaryReportDsaReporterType {
|
|
7
|
+
Authority = "AUTHORITY",
|
|
8
|
+
Flagger = "FLAGGER",
|
|
9
|
+
Person = "PERSON"
|
|
10
|
+
}
|
|
6
11
|
export declare enum DsmCommentaryReportReason {
|
|
7
12
|
Behaviour = "BEHAVIOUR",
|
|
8
13
|
Bully = "BULLY",
|