@scion/workbench 20.0.0-beta.5 → 20.0.0-beta.6

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/index.d.ts CHANGED
@@ -385,7 +385,6 @@ type NavigateFn = (layout: WorkbenchLayout) => Promise<WorkbenchLayout | null> |
385
385
  * Signature of a function to provide texts to the SCION Workbench.
386
386
  *
387
387
  * Texts starting with the percent symbol (`%`) are passed to the text provider for translation, with the percent symbol omitted.
388
- * Otherwise, the text is returned as is.
389
388
  *
390
389
  * A text provider can be registered via configuration passed to the {@link provideWorkbench} function.
391
390
  *
@@ -393,9 +392,10 @@ type NavigateFn = (layout: WorkbenchLayout) => Promise<WorkbenchLayout | null> |
393
392
  * - Can call `inject` to get any required dependencies.
394
393
  * - Can call `toSignal` to convert an Observable to a Signal.
395
394
  *
396
- * @param key - Key for which to provide the text.
397
- * @param params - Parameters associated with the translation key.
398
- * @return The text associated with the provided key, or `undefined` if not found.
395
+ * @param key - Translation key of the text.
396
+ * @param params - Parameters used for text interpolation.
397
+ * @return Text associated with the key, or `undefined` if not found.
398
+ * Localized applications should return the text in the current language, and update the signal with the translated text each time when the language changes.
399
399
  */
400
400
  type WorkbenchTextProviderFn = (key: string, params: {
401
401
  [name: string]: string;
@@ -403,14 +403,14 @@ type WorkbenchTextProviderFn = (key: string, params: {
403
403
  /**
404
404
  * Represents either a text or a key for translation.
405
405
  *
406
- * A translation key starts with the percent symbol (`%`) and can include parameters in matrix notation.
406
+ * A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
407
407
  * Key and parameters are passed to {@link WorkbenchConfig.textProvider} for translation.
408
408
  *
409
409
  * Examples:
410
- * - `text`: no translatable text
411
410
  * - `%key`: translation key
412
- * - `%key;param=value`: translation key with a single param
413
- * - `%key;param1=value1;param2=value2`: translation key with multiple parameters
411
+ * - `%key;param=value`: translation key with a single interpolation parameter
412
+ * - `%key;param1=value1;param2=value2`: translation key with multiple interpolation parameters
413
+ * - `text`: no translation key, text is returned as is
414
414
  */
415
415
  type Translatable = string | `%${string}`;
416
416
 
@@ -690,6 +690,8 @@ interface ReferencePart {
690
690
  interface PartExtras {
691
691
  /**
692
692
  * Title displayed in the part bar.
693
+ *
694
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
693
695
  */
694
696
  title?: Translatable;
695
697
  /**
@@ -726,16 +728,22 @@ interface DockedPartExtras {
726
728
  icon: string;
727
729
  /**
728
730
  * Label of the toggle button in the sidebar.
731
+ *
732
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
729
733
  */
730
734
  label: Translatable;
731
735
  /**
732
736
  * Tooltip displayed when hovering over the toggle button in the sidebar.
737
+ *
738
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
733
739
  */
734
740
  tooltip?: Translatable;
735
741
  /**
736
742
  * Title displayed in the part bar.
737
743
  *
738
744
  * If not provided, defaults to {@link DockedPartExtras.label}. Set to `false` to not display a title.
745
+ *
746
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
739
747
  */
740
748
  title?: Translatable | false;
741
749
  /**
@@ -1075,7 +1083,6 @@ declare abstract class WorkbenchConfig {
1075
1083
  * A text provider is a function that returns the text for a translation key.
1076
1084
  *
1077
1085
  * Texts starting with the percent symbol (`%`) are passed to the text provider for translation, with the percent symbol omitted.
1078
- * Otherwise, the text is returned as is.
1079
1086
  *
1080
1087
  * The SCION Workbench uses the following translation keys for built-in texts:
1081
1088
  * - workbench.clear.tooltip
@@ -1508,9 +1515,11 @@ declare abstract class WorkbenchPart {
1508
1515
  * Title displayed in the part bar.
1509
1516
  *
1510
1517
  * Note that the title of the top-leftmost part of a docked part cannot be changed.
1518
+ *
1519
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
1511
1520
  */
1512
- abstract get title(): Signal<string | undefined>;
1513
- abstract set title(title: string | undefined);
1521
+ abstract get title(): Signal<Translatable | undefined>;
1522
+ abstract set title(title: Translatable | undefined);
1514
1523
  /**
1515
1524
  * Indicates whether this part is located in the workbench main area.
1516
1525
  */
@@ -1661,11 +1670,15 @@ declare abstract class WorkbenchView {
1661
1670
  abstract readonly part: Signal<WorkbenchPart>;
1662
1671
  /**
1663
1672
  * Title displayed in the view tab.
1673
+ *
1674
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
1664
1675
  */
1665
1676
  abstract get title(): Signal<Translatable | null>;
1666
1677
  abstract set title(title: Translatable | null);
1667
1678
  /**
1668
1679
  * Subtitle displayed in the view tab.
1680
+ *
1681
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
1669
1682
  */
1670
1683
  abstract get heading(): Signal<Translatable | null>;
1671
1684
  abstract set heading(heading: Translatable | null);
@@ -1830,6 +1843,8 @@ declare abstract class WorkbenchDialog<R = unknown> {
1830
1843
  abstract readonly id: DialogId;
1831
1844
  /**
1832
1845
  * Sets the title of the dialog.
1846
+ *
1847
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
1833
1848
  */
1834
1849
  abstract get title(): Signal<Translatable | undefined>;
1835
1850
  abstract set title(title: Translatable | undefined);
@@ -2623,7 +2638,7 @@ declare class MPart {
2623
2638
  readonly type = "MPart";
2624
2639
  id: PartId;
2625
2640
  alternativeId?: string;
2626
- title?: string;
2641
+ title?: Translatable;
2627
2642
  parent?: MTreeNode;
2628
2643
  views: MView[];
2629
2644
  activeViewId?: ViewId;
@@ -4189,9 +4204,9 @@ declare class ɵWorkbenchPart implements WorkbenchPart {
4189
4204
  */
4190
4205
  get injector(): Injector;
4191
4206
  /** @inheritDoc */
4192
- get title(): Signal<string | undefined>;
4207
+ get title(): Signal<Translatable | undefined>;
4193
4208
  /** @inheritDoc */
4194
- set title(title: string | undefined);
4209
+ set title(title: Translatable | undefined);
4195
4210
  /** @inheritDoc */
4196
4211
  set cssClass(cssClass: string | string[]);
4197
4212
  /** @inheritDoc */
@@ -5277,6 +5292,8 @@ declare function canMatchWorkbenchPerspective(id: string): CanMatchFn;
5277
5292
  interface WorkbenchMessageBoxOptions {
5278
5293
  /**
5279
5294
  * Specifies the title of the message box.
5295
+ *
5296
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
5280
5297
  */
5281
5298
  title?: Translatable;
5282
5299
  /**
@@ -5411,11 +5428,12 @@ declare abstract class WorkbenchMessageBoxService {
5411
5428
  * });
5412
5429
  * ```
5413
5430
  *
5414
- * @param message - Specifies the text to display.
5431
+ * @param message - Specifies the text to display, if any.
5432
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
5415
5433
  * @param options - Controls the appearance and behavior of the message box.
5416
5434
  * @return Promise that resolves to the key of the action button that the user clicked to close the message box.
5417
5435
  */
5418
- abstract open(message: Translatable, options?: WorkbenchMessageBoxOptions): Promise<string>;
5436
+ abstract open(message: Translatable | null, options?: WorkbenchMessageBoxOptions): Promise<string>;
5419
5437
  /**
5420
5438
  * Displays the specified component in a message box.
5421
5439
  *
@@ -5569,9 +5587,15 @@ declare abstract class Notification<T = any> {
5569
5587
  */
5570
5588
  readonly input: T | undefined;
5571
5589
  /**
5572
- * Sets the title of the notification; can be a string literal or an Observable.
5590
+ * Sets the title of the notification.
5591
+ */
5592
+ abstract setTitle(title: Translatable | undefined): void;
5593
+ /**
5594
+ * Sets the title of the notification.
5595
+ *
5596
+ * @deprecated since version 20.0.0-beta.6. To migrate, pass a translatable and provide the text using a text provider registered in `WorkbenchClient.registerTextProvider`.
5573
5597
  */
5574
- abstract setTitle(title: Translatable | undefined | Observable<string | undefined>): void;
5598
+ abstract setTitle(title: Observable<Translatable | undefined>): void;
5575
5599
  /**
5576
5600
  * Sets the severity of the notification.
5577
5601
  */
@@ -5598,9 +5622,13 @@ declare abstract class Notification<T = any> {
5598
5622
  */
5599
5623
  interface NotificationConfig {
5600
5624
  /**
5601
- * Optional title of the notification; can be a string literal or an Observable.
5625
+ * Optional title of the notification.
5626
+ *
5627
+ * Can be a text or a translation key. A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
5628
+ *
5629
+ * TODO [Angular 21] Passing an Observable is deprecated. To migrate, pass a translatable and provide the text using a text provider registered in `WorkbenchClient.registerTextProvider`. API will be removed in version 21.
5602
5630
  */
5603
- title?: Translatable | Observable<string>;
5631
+ title?: Translatable | Observable<Translatable | undefined>;
5604
5632
  /**
5605
5633
  * Content of the notification, can be either a plain text message or a component.
5606
5634
  *
@@ -6050,6 +6078,12 @@ declare module '@scion/microfrontend-platform' {
6050
6078
  * @see WorkbenchPopupCapability.properties.showSplash
6051
6079
  */
6052
6080
  splash?: ComponentType<unknown>;
6081
+ /**
6082
+ * Controls whether to preload inactive microfrontend views not defining the `lazy` property to maintain compatibility with applications setting view titles and headings in view microfrontends. Defaults to `false`.
6083
+ *
6084
+ * @deprecated since version 20.0.0-beta.6. Introduced in 20.0.0-beta.6 to maintain compatibility with applications setting view titles and headings in view microfrontends. View capabilities can now define localized titles with optional interpolation parameters using resolvers. Applications should migrate to lazy view capabilities by setting 'lazy' in capability properties and define titles in the manifest. API will be removed in version 22.
6085
+ */
6086
+ preloadInactiveViews?: true;
6053
6087
  }
6054
6088
  }
6055
6089
 
@@ -6114,13 +6148,13 @@ declare abstract class WorkbenchLauncher {
6114
6148
  * Enables the translation of a given {@link Translatable}.
6115
6149
  *
6116
6150
  * A {@link Translatable} is a string that, if starting with the percent symbol (`%`), is passed to the text provider for translation, with the percent symbol omitted.
6117
- * Otherwise, the text is returned as is. A translation key can include parameters in matrix notation.
6151
+ * Otherwise, the text is returned as is. A translation key may include parameters in matrix notation for text interpolation.
6118
6152
  *
6119
6153
  * Examples:
6120
- * - `text`: no translatable text
6121
6154
  * - `%key`: translation key
6122
- * - `%key;param=value`: translation key with a single param
6123
- * - `%key;param1=value1;param2=value2`: translation key with multiple parameters
6155
+ * - `%key;param=value`: translation key with a single interpolation parameter
6156
+ * - `%key;param1=value1;param2=value2`: translation key with multiple interpolation parameters
6157
+ * - `text`: no translation key, text is returned as is
6124
6158
  *
6125
6159
  * @experimental since 20.0.0-beta.3; API and behavior may change in any version without notice.
6126
6160
  */
@@ -6138,13 +6172,13 @@ declare class TextPipe implements PipeTransform {
6138
6172
  * Provides the text for the given {@link Translatable} based on registered text providers.
6139
6173
  *
6140
6174
  * A {@link Translatable} is a string that, if starting with the percent symbol (`%`), is passed to the text provider for translation, with the percent symbol omitted.
6141
- * Otherwise, the text is returned as is. A translation key can include parameters in matrix notation.
6175
+ * Otherwise, the text is returned as is. A translation key may include parameters in matrix notation for text interpolation.
6142
6176
  *
6143
6177
  * Examples:
6144
- * - `text`: no translatable text
6145
6178
  * - `%key`: translation key
6146
- * - `%key;param=value`: translation key with a single param
6147
- * - `%key;param1=value1;param2=value2`: translation key with multiple parameters
6179
+ * - `%key;param=value`: translation key with a single interpolation parameter
6180
+ * - `%key;param1=value1;param2=value2`: translation key with multiple interpolation parameters
6181
+ * - `text`: no translation key, text is returned as is
6148
6182
  *
6149
6183
  * The function:
6150
6184
  * - Must be called within an injection context, or an explicit {@link Injector} passed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scion/workbench",
3
- "version": "20.0.0-beta.5",
3
+ "version": "20.0.0-beta.6",
4
4
  "description": "SCION Workbench enables the creation of Angular web applications that require a flexible layout to display content side-by-side or stacked, all personalizable by the user via drag & drop. This type of layout is ideal for applications with non-linear workflows, enabling users to work on content in parallel.",
5
5
  "license": "EPL-2.0",
6
6
  "private": false,
@@ -37,7 +37,7 @@
37
37
  "@scion/components": "^20.0.0",
38
38
  "@scion/toolkit": "^1.6.0 || ^2.0.0",
39
39
  "@scion/microfrontend-platform": "^1.4.0",
40
- "@scion/workbench-client": "^1.0.0-beta.30",
40
+ "@scion/workbench-client": "^1.0.0-beta.31",
41
41
  "rxjs": "^7.8.0"
42
42
  },
43
43
  "peerDependenciesMeta": {