@messaia/cdk-cms 19.0.0 → 19.0.1-rc01
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/fesm2022/messaia-cdk-cms.mjs +105 -42
- package/fesm2022/messaia-cdk-cms.mjs.map +1 -1
- package/lib/models/content.d.ts +54 -14
- package/package.json +2 -2
|
@@ -176,59 +176,99 @@ __decorate([
|
|
|
176
176
|
|
|
177
177
|
let Content = class Content extends AuditEntity {
|
|
178
178
|
/**
|
|
179
|
-
* @property
|
|
179
|
+
* @property Defines the type of the content.
|
|
180
|
+
* @description Optional enum property indicating the content's type.
|
|
181
|
+
* @type {ContentType}
|
|
180
182
|
*/
|
|
181
183
|
type;
|
|
182
184
|
/**
|
|
183
|
-
* @property
|
|
185
|
+
* @property Identifier for the section the content belongs to.
|
|
186
|
+
* @description Optional number representing the section ID.
|
|
187
|
+
* @type {number}
|
|
184
188
|
*/
|
|
185
189
|
sectionId;
|
|
186
190
|
/**
|
|
187
|
-
* @property
|
|
191
|
+
* @property The title of the content.
|
|
192
|
+
* @description This required property represents the human-readable title displayed in the UI.
|
|
193
|
+
* @type {string}
|
|
188
194
|
*/
|
|
189
195
|
title;
|
|
190
196
|
/**
|
|
191
|
-
* @property
|
|
197
|
+
* @property Internal name of the content.
|
|
198
|
+
* @description This required property is used for internal reference and URLs.
|
|
199
|
+
* @type {string}
|
|
192
200
|
*/
|
|
193
201
|
name;
|
|
194
202
|
/**
|
|
195
|
-
* @property
|
|
203
|
+
* @property Aliases of the content.
|
|
204
|
+
* @description Optional string used to define alternative names or keywords.
|
|
205
|
+
* @type {string}
|
|
196
206
|
*/
|
|
197
207
|
aliases;
|
|
198
208
|
/**
|
|
199
|
-
* @property
|
|
209
|
+
* @property The wrap tag used for HTML structure.
|
|
210
|
+
* @description Optional property that defines how the content is wrapped in the DOM.
|
|
211
|
+
* @type {WrapTag}
|
|
200
212
|
*/
|
|
201
213
|
wrapTag = WrapTag.Section;
|
|
202
214
|
/**
|
|
203
|
-
* @property
|
|
215
|
+
* @property Layout identifier or class name.
|
|
216
|
+
* @description Optional layout style applied to this content block.
|
|
217
|
+
* @type {string}
|
|
204
218
|
*/
|
|
205
219
|
layout;
|
|
206
220
|
/**
|
|
207
|
-
* @property
|
|
221
|
+
* @property Main body of the content.
|
|
222
|
+
* @description Optional HTML or markdown content.
|
|
223
|
+
* @type {string}
|
|
208
224
|
*/
|
|
209
225
|
body;
|
|
210
226
|
/**
|
|
211
|
-
* @property
|
|
227
|
+
* @property Embedded script.
|
|
228
|
+
* @description Optional JavaScript code associated with the content.
|
|
229
|
+
* @type {string}
|
|
212
230
|
*/
|
|
213
231
|
script;
|
|
214
232
|
/**
|
|
215
|
-
* @property
|
|
233
|
+
* @property headScript
|
|
234
|
+
* @description This optional property allows insertion of custom JavaScript code inside the <head> tag of the HTML document.
|
|
235
|
+
* @type {string}
|
|
236
|
+
*/
|
|
237
|
+
headScript;
|
|
238
|
+
/**
|
|
239
|
+
* @property noScript
|
|
240
|
+
* @description This optional property allows inserting content inside a <noscript> tag, which is rendered when JavaScript is disabled.
|
|
241
|
+
* @type {string}
|
|
242
|
+
*/
|
|
243
|
+
noScript;
|
|
244
|
+
/**
|
|
245
|
+
* @property Embedded style.
|
|
246
|
+
* @description Optional CSS styling specific to this content.
|
|
247
|
+
* @type {string}
|
|
216
248
|
*/
|
|
217
249
|
style;
|
|
218
250
|
/**
|
|
219
|
-
* @property
|
|
251
|
+
* @property Indicates whether the title should be shown.
|
|
252
|
+
* @description This optional boolean defaults to true and determines title visibility.
|
|
253
|
+
* @type {boolean}
|
|
220
254
|
*/
|
|
221
255
|
showTitle = true;
|
|
222
256
|
/**
|
|
223
|
-
* @property
|
|
257
|
+
* @property Indicates whether the content is enabled.
|
|
258
|
+
* @description This boolean property enables or disables the content, default is true.
|
|
259
|
+
* @type {boolean}
|
|
224
260
|
*/
|
|
225
261
|
enabled = true;
|
|
226
262
|
/**
|
|
227
|
-
* @property
|
|
263
|
+
* @property Associated clients for this content.
|
|
264
|
+
* @description This required property defines which clients the content is related to.
|
|
265
|
+
* @type {ContentClient[]}
|
|
228
266
|
*/
|
|
229
267
|
clientJoins;
|
|
230
268
|
/**
|
|
231
|
-
* @property
|
|
269
|
+
* @property Associated departments for this content.
|
|
270
|
+
* @description Optional departments related to this content, with visibility based on admin context.
|
|
271
|
+
* @type {ContentDepartment[]}
|
|
232
272
|
*/
|
|
233
273
|
departmentJoins;
|
|
234
274
|
};
|
|
@@ -243,56 +283,84 @@ __decorate([
|
|
|
243
283
|
__decorate([
|
|
244
284
|
required(),
|
|
245
285
|
Column(),
|
|
246
|
-
FormField({ row:
|
|
286
|
+
FormField({ row: 20 }),
|
|
247
287
|
Display($localize `:@@title:Title`),
|
|
248
288
|
__metadata("design:type", String)
|
|
249
289
|
], Content.prototype, "title", void 0);
|
|
250
290
|
__decorate([
|
|
251
291
|
required(),
|
|
252
292
|
Column({ maxWidth: 190, display: Grid.Md }),
|
|
253
|
-
FormField({ row:
|
|
293
|
+
FormField({ row: 30 }),
|
|
254
294
|
Display($localize `:@@name:Name`),
|
|
255
295
|
__metadata("design:type", String)
|
|
256
296
|
], Content.prototype, "name", void 0);
|
|
257
297
|
__decorate([
|
|
258
298
|
prop(),
|
|
259
|
-
FormField({ row:
|
|
299
|
+
FormField({ row: 40, type: FormFieldType.Chips }),
|
|
260
300
|
Display($localize `:@@aliases:Aliases`),
|
|
261
301
|
__metadata("design:type", String)
|
|
262
302
|
], Content.prototype, "aliases", void 0);
|
|
263
303
|
__decorate([
|
|
264
304
|
prop(),
|
|
265
|
-
FormField({ row:
|
|
305
|
+
FormField({ row: 50 }),
|
|
266
306
|
Display($localize `:@@wrap:Wrap`),
|
|
267
307
|
__metadata("design:type", String)
|
|
268
308
|
], Content.prototype, "wrapTag", void 0);
|
|
269
309
|
__decorate([
|
|
270
310
|
prop(),
|
|
271
|
-
FormField({ row:
|
|
311
|
+
FormField({ row: 50 }),
|
|
272
312
|
Display($localize `:@@layout:Layout`),
|
|
273
313
|
__metadata("design:type", String)
|
|
274
314
|
], Content.prototype, "layout", void 0);
|
|
275
315
|
__decorate([
|
|
276
316
|
prop(),
|
|
277
|
-
FormField({ row:
|
|
317
|
+
FormField({ row: 60, type: FormFieldType.Editor }),
|
|
278
318
|
Display($localize `:@@content:Content`),
|
|
279
319
|
__metadata("design:type", String)
|
|
280
320
|
], Content.prototype, "body", void 0);
|
|
281
321
|
__decorate([
|
|
282
322
|
prop(),
|
|
283
|
-
FormField({
|
|
284
|
-
|
|
323
|
+
FormField({
|
|
324
|
+
row: 80,
|
|
325
|
+
type: FormFieldType.TextArea,
|
|
326
|
+
hint: $localize `:@@scriptHint:Do not include <script> tags.`
|
|
327
|
+
}),
|
|
328
|
+
Display($localize `:@@bodyScript:Body Script`),
|
|
285
329
|
__metadata("design:type", String)
|
|
286
330
|
], Content.prototype, "script", void 0);
|
|
287
331
|
__decorate([
|
|
288
332
|
prop(),
|
|
289
|
-
FormField({
|
|
333
|
+
FormField({
|
|
334
|
+
row: 70,
|
|
335
|
+
type: FormFieldType.TextArea,
|
|
336
|
+
hint: $localize `:@@headScriptHint:Do not include <script> tags.`
|
|
337
|
+
}),
|
|
338
|
+
Display($localize `:@@headScript:Head Script`),
|
|
339
|
+
__metadata("design:type", String)
|
|
340
|
+
], Content.prototype, "headScript", void 0);
|
|
341
|
+
__decorate([
|
|
342
|
+
prop(),
|
|
343
|
+
FormField({
|
|
344
|
+
row: 90,
|
|
345
|
+
type: FormFieldType.TextArea,
|
|
346
|
+
hint: $localize `:@@noScriptHint:Do not include <noscript> tags.`
|
|
347
|
+
}),
|
|
348
|
+
Display($localize `:@@noScript:NoScript`),
|
|
349
|
+
__metadata("design:type", String)
|
|
350
|
+
], Content.prototype, "noScript", void 0);
|
|
351
|
+
__decorate([
|
|
352
|
+
prop(),
|
|
353
|
+
FormField({
|
|
354
|
+
row: 100,
|
|
355
|
+
type: FormFieldType.TextArea,
|
|
356
|
+
hint: $localize `:@@styleHint:Do not include <style> or <link> tags.`
|
|
357
|
+
}),
|
|
290
358
|
Display($localize `:@@style:Style`),
|
|
291
359
|
__metadata("design:type", String)
|
|
292
360
|
], Content.prototype, "style", void 0);
|
|
293
361
|
__decorate([
|
|
294
362
|
prop(),
|
|
295
|
-
FormField({ row:
|
|
363
|
+
FormField({ row: 200 }),
|
|
296
364
|
Display($localize `:@@showTitle:Show title`),
|
|
297
365
|
__metadata("design:type", Boolean)
|
|
298
366
|
], Content.prototype, "showTitle", void 0);
|
|
@@ -302,7 +370,7 @@ __decorate([
|
|
|
302
370
|
index: 20,
|
|
303
371
|
event: 'toggle'
|
|
304
372
|
}),
|
|
305
|
-
FormField({ row:
|
|
373
|
+
FormField({ row: 210 }),
|
|
306
374
|
Display($localize `:@@enabled:Enabled`),
|
|
307
375
|
__metadata("design:type", Boolean)
|
|
308
376
|
], Content.prototype, "enabled", void 0);
|
|
@@ -320,16 +388,13 @@ __decorate([
|
|
|
320
388
|
FormField({
|
|
321
389
|
row: 1,
|
|
322
390
|
endpoint: 'client',
|
|
323
|
-
params: () => {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
};
|
|
329
|
-
},
|
|
391
|
+
params: () => ({
|
|
392
|
+
enabled: true,
|
|
393
|
+
projection: 'id,displayName',
|
|
394
|
+
sortBy: 'id'
|
|
395
|
+
}),
|
|
330
396
|
multiple: true,
|
|
331
397
|
triggerMode: 'chip',
|
|
332
|
-
// hide: (_, __, ctx: any) => !ctx.showClientJoins(),
|
|
333
398
|
compareWith: (o, v) => o.clientId === v.clientId,
|
|
334
399
|
mapper: (x) => x.map(y => new ContentClient({ clientId: y.id, clientName: y.displayName })),
|
|
335
400
|
optionTemplate: (x) => x?.clientName,
|
|
@@ -350,16 +415,14 @@ __decorate([
|
|
|
350
415
|
hide: (_, __, ctx) => !ctx.isAdmin || (!ctx.settings?.multitenantable && !ctx.settings?.multiDepartments),
|
|
351
416
|
}),
|
|
352
417
|
FormField({
|
|
353
|
-
row:
|
|
418
|
+
row: 10,
|
|
354
419
|
endpoint: 'department',
|
|
355
|
-
params: (x) => {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
};
|
|
362
|
-
},
|
|
420
|
+
params: (x) => ({
|
|
421
|
+
enabled: true,
|
|
422
|
+
projection: 'id,displayName',
|
|
423
|
+
sortBy: 'id',
|
|
424
|
+
clientId: x.clientJoins?.map(y => y.clientId)
|
|
425
|
+
}),
|
|
363
426
|
multiple: true,
|
|
364
427
|
triggerMode: 'chip',
|
|
365
428
|
hide: (_, __, ctx) => (!ctx.isAdmin && !ctx.isClientAdmin) || (!ctx.settings?.multitenantable && !ctx.settings?.multiDepartments),
|