@forgeroute/ui 0.4.30 → 0.4.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeroute/ui",
3
- "version": "0.4.30",
3
+ "version": "0.4.31",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
@@ -11129,6 +11129,12 @@ export interface SetupStep {
11129
11129
  canContinue?: () => boolean;
11130
11130
  /** `custom`: text of the continue button (default "Save & Continue"). */
11131
11131
  saveLabel?: string;
11132
+ /**
11133
+ * `custom`: the step draws its own continue button (for example in the footer of a `ui-detail-card`), so the wizard does not show its own. The step's
11134
+ * template receives the wizard as `let-wizard` and calls `wizard.saveAndContinue()` (runs `save`, then moves on) and reads `wizard.busy()`.
11135
+ * Back / Skip stay the wizard's.
11136
+ */
11137
+ ownActions?: boolean;
11132
11138
  import?: SetupImportStep;
11133
11139
  integrations?: SetupIntegration[];
11134
11140
  /** `integrations`: runs when the step is left with Continue (e.g. to save sender settings). */
@@ -11136,6 +11142,13 @@ export interface SetupStep {
11136
11142
  /** Called when the step is shown (load data for a custom step). */
11137
11143
  onEnter?: () => void;
11138
11144
  }
11145
+ /** What a custom step's template gets as `let-wizard` when the step draws its own continue button (`ownActions`). */
11146
+ export interface SetupWizardApi {
11147
+ /** Runs the step's `save` hook (and shows its error), then moves to the next step. */
11148
+ saveAndContinue(): Promise<void>;
11149
+ /** True while a save is running. */
11150
+ readonly busy: () => boolean;
11151
+ }
11139
11152
  /**
11140
11153
  * The integrations every app can offer in a setup step. The endpoints follow the convention the apps' backends already use (`GET <x>/status`,
11141
11154
  * `GET <x>/authorize` answering `{ url }`); an app whose routes differ spreads a preset and overrides what differs:
@@ -11150,11 +11163,19 @@ export declare function setupIntegrations(...keys: (keyof typeof SETUP_INTEGRATI
11150
11163
  * <ui-setup-wizard [steps]="steps()">
11151
11164
  * <ng-template uiSetupStep="profile"> …the app's own form… </ng-template>
11152
11165
  * </ui-setup-wizard>
11166
+ *
11167
+ * A step with `ownActions: true` draws its own continue button: `<ng-template uiSetupStep="profile" let-wizard>` … `(click)="wizard.saveAndContinue()"`.
11153
11168
  */
11154
11169
  export declare class SetupWizardStepDirective {
11155
11170
  /** The `key` of the step this template belongs to. */
11156
11171
  readonly key: import("@angular/core").InputSignal<string>;
11157
- readonly template: TemplateRef<unknown>;
11172
+ readonly template: TemplateRef<{
11173
+ $implicit: SetupWizardApi;
11174
+ }>;
11175
+ /** Types `let-wizard` in the step's template as `SetupWizardApi`. */
11176
+ static ngTemplateContextGuard(_dir: SetupWizardStepDirective, _ctx: unknown): _ctx is {
11177
+ $implicit: SetupWizardApi;
11178
+ };
11158
11179
  static ɵfac: i0.ɵɵFactoryDeclaration<SetupWizardStepDirective, never>;
11159
11180
  static ɵdir: i0.ɵɵDirectiveDeclaration<SetupWizardStepDirective, "ng-template[uiSetupStep]", never, {
11160
11181
  "key": {
@@ -11164,6 +11185,11 @@ export declare class SetupWizardStepDirective {
11164
11185
  };
11165
11186
  }, {}, never, never, true, never>;
11166
11187
  }
11188
+ /** Splits a description into its first sentence (title) and the rest (text). A single sentence is all title. */
11189
+ export declare function splitIntro(description: string): {
11190
+ title: string;
11191
+ text: string;
11192
+ };
11167
11193
  /** The key of the summary step the wizard appends to the app's steps. */
11168
11194
  export declare const SETUP_DONE_KEY = "done";
11169
11195
  /**
@@ -11204,7 +11230,9 @@ export declare class SetupWizardComponent {
11204
11230
  private readonly skipped;
11205
11231
  private readonly imports;
11206
11232
  private readonly statuses;
11207
- protected readonly busy: import("@angular/core").WritableSignal<boolean>;
11233
+ readonly busy: import("@angular/core").WritableSignal<boolean>;
11234
+ /** What a custom step's template receives (`let-wizard`). */
11235
+ protected readonly api: SetupWizardApi;
11208
11236
  protected readonly error: import("@angular/core").WritableSignal<string>;
11209
11237
  protected readonly areaCodeOpen: import("@angular/core").WritableSignal<string>;
11210
11238
  protected readonly areaCode: import("@angular/core").WritableSignal<string>;
@@ -11214,12 +11242,19 @@ export declare class SetupWizardComponent {
11214
11242
  protected readonly allSteps: import("@angular/core").Signal<SetupStep[]>;
11215
11243
  protected readonly index: import("@angular/core").Signal<number>;
11216
11244
  protected readonly current: import("@angular/core").Signal<SetupStep>;
11245
+ /** The step's description as a blue header: its first sentence is the title, the rest the text under it. */
11246
+ protected readonly intro: import("@angular/core").Signal<{
11247
+ title: string;
11248
+ text: string;
11249
+ } | null>;
11217
11250
  protected readonly isDone: import("@angular/core").Signal<boolean>;
11218
11251
  protected readonly completedCount: import("@angular/core").Signal<number>;
11219
11252
  protected readonly stepperSteps: import("@angular/core").Signal<StepperStep[]>;
11220
11253
  protected readonly summarySections: import("@angular/core").Signal<PanelInfoSection[]>;
11221
11254
  constructor();
11222
- protected templateFor(key: string): import("@angular/core").TemplateRef<unknown> | null;
11255
+ protected templateFor(key: string): import("@angular/core").TemplateRef<{
11256
+ $implicit: SetupWizardApi;
11257
+ }> | null;
11223
11258
  protected goTo(key: string): void;
11224
11259
  private enter;
11225
11260
  private advanceFrom;
@@ -11227,7 +11262,7 @@ export declare class SetupWizardComponent {
11227
11262
  protected skip(): void;
11228
11263
  private markCompleted;
11229
11264
  /** "Save & Continue" of a custom or integrations step: runs the step's hook, then moves on. */
11230
- protected saveAndContinue(): Promise<void>;
11265
+ saveAndContinue(): Promise<void>;
11231
11266
  private run;
11232
11267
  /** The message to show for a failure: the server's own `{ message }` (or a thrown error's message); never the HTTP client's technical text. */
11233
11268
  private messageOf;