@molecule/app-angular 3.14.0 → 3.18.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/README.md +267 -323
- package/dist/ai-models.d.ts +2 -0
- package/dist/ai-models.d.ts.map +1 -0
- package/dist/ai-models.js +2 -0
- package/dist/ai-models.js.map +1 -0
- package/dist/chat/index.d.ts +5 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +5 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat-context.d.ts +7 -0
- package/dist/chat-context.d.ts.map +1 -0
- package/dist/chat-context.js +6 -0
- package/dist/chat-context.js.map +1 -0
- package/dist/chat-provider.d.ts +10 -0
- package/dist/chat-provider.d.ts.map +1 -0
- package/dist/chat-provider.js +12 -0
- package/dist/chat-provider.js.map +1 -0
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/dom-placement.d.ts.map +1 -1
- package/dist/dom-placement.js +5 -1
- package/dist/dom-placement.js.map +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-native.d.ts +1 -93
- package/dist/hooks/use-native.d.ts.map +1 -1
- package/dist/hooks/use-native.js +2 -87
- package/dist/hooks/use-native.js.map +1 -1
- package/dist/hooks/use-push.d.ts +99 -0
- package/dist/hooks/use-push.d.ts.map +1 -0
- package/dist/hooks/use-push.js +92 -0
- package/dist/hooks/use-push.js.map +1 -0
- package/dist/hooks/use-router.d.ts +45 -2
- package/dist/hooks/use-router.d.ts.map +1 -1
- package/dist/hooks/use-router.js +43 -7
- package/dist/hooks/use-router.js.map +1 -1
- package/dist/hooks/use-translation.d.ts +9 -4
- package/dist/hooks/use-translation.d.ts.map +1 -1
- package/dist/hooks/use-translation.js +10 -1
- package/dist/hooks/use-translation.js.map +1 -1
- package/dist/i18n-reactive.d.ts +2 -2
- package/dist/i18n-reactive.d.ts.map +1 -1
- package/dist/i18n-reactive.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy-ai-models.d.ts +17 -0
- package/dist/legacy-ai-models.d.ts.map +1 -0
- package/dist/legacy-ai-models.js +12 -0
- package/dist/legacy-ai-models.js.map +1 -0
- package/dist/legacy-chat.d.ts +72 -0
- package/dist/legacy-chat.d.ts.map +1 -0
- package/dist/legacy-chat.js +52 -0
- package/dist/legacy-chat.js.map +1 -0
- package/dist/legacy-push.d.ts +27 -0
- package/dist/legacy-push.d.ts.map +1 -0
- package/dist/legacy-push.js +12 -0
- package/dist/legacy-push.js.map +1 -0
- package/dist/link.d.ts +24 -4
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +34 -10
- package/dist/link.js.map +1 -1
- package/dist/providers.d.ts +0 -8
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +2 -10
- package/dist/providers.js.map +1 -1
- package/dist/push.d.ts +3 -0
- package/dist/push.d.ts.map +1 -0
- package/dist/push.js +3 -0
- package/dist/push.js.map +1 -0
- package/dist/services/index.d.ts +0 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +0 -1
- package/dist/services/index.js.map +1 -1
- package/dist/tokens.d.ts +0 -5
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +0 -4
- package/dist/tokens.js.map +1 -1
- package/package.json +17 -5
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-27T22:16:36.936Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-angular
|
|
@@ -875,7 +875,7 @@ interface I18nProvider {
|
|
|
875
875
|
*
|
|
876
876
|
* @returns The translated string, or the default value / key if not found.
|
|
877
877
|
*/
|
|
878
|
-
t
|
|
878
|
+
t: TranslateFunction
|
|
879
879
|
|
|
880
880
|
/**
|
|
881
881
|
* Checks if a translation key exists.
|
|
@@ -1660,31 +1660,6 @@ interface SlotReader {
|
|
|
1660
1660
|
|
|
1661
1661
|
**Returns:** Whether the slot has content.
|
|
1662
1662
|
|
|
1663
|
-
#### `UseAIModelsResult`
|
|
1664
|
-
|
|
1665
|
-
Result returned by {@link useAIModels}: every field as a signal.
|
|
1666
|
-
|
|
1667
|
-
```typescript
|
|
1668
|
-
interface UseAIModelsResult {
|
|
1669
|
-
/**
|
|
1670
|
-
* Available models, or an empty array while loading or after a failed fetch. The list keeps its identity
|
|
1671
|
-
* until the catalog changes, the empty one included, so it can key a computed or an effect.
|
|
1672
|
-
*/
|
|
1673
|
-
readonly models: Signal<AppModelDefinition[]>
|
|
1674
|
-
/**
|
|
1675
|
-
* Per-mode server default model ids for the requester's tier, or `undefined`
|
|
1676
|
-
* while loading or on servers that don't provide them.
|
|
1677
|
-
*/
|
|
1678
|
-
readonly defaults: Signal<AppModeModelDefaults | undefined>
|
|
1679
|
-
/** The single model marked `freeTier: true`, or `undefined`. */
|
|
1680
|
-
readonly freeTierModel: Signal<AppModelDefinition | undefined>
|
|
1681
|
-
/** `true` while the initial fetch is in flight. */
|
|
1682
|
-
readonly loading: Signal<boolean>
|
|
1683
|
-
/** Error from the initial fetch, or `null`. */
|
|
1684
|
-
readonly error: Signal<Error | null>
|
|
1685
|
-
}
|
|
1686
|
-
```
|
|
1687
|
-
|
|
1688
1663
|
#### `UsePromiseState`
|
|
1689
1664
|
|
|
1690
1665
|
The state of the latest {@link usePromise} call.
|
|
@@ -2431,90 +2406,6 @@ interface UseCapacitorAppResult {
|
|
|
2431
2406
|
}
|
|
2432
2407
|
```
|
|
2433
2408
|
|
|
2434
|
-
#### `UsePushOptions`
|
|
2435
|
-
|
|
2436
|
-
Options for {@link usePush} (e.g. check permission on mount).
|
|
2437
|
-
|
|
2438
|
-
```typescript
|
|
2439
|
-
interface UsePushOptions {
|
|
2440
|
-
/** Whether to check permission status on mount. */
|
|
2441
|
-
checkOnMount?: boolean
|
|
2442
|
-
}
|
|
2443
|
-
```
|
|
2444
|
-
|
|
2445
|
-
#### `UsePushResult`
|
|
2446
|
-
|
|
2447
|
-
What {@link usePush} returns: the permission and token as signals and every
|
|
2448
|
-
action as a plain function.
|
|
2449
|
-
|
|
2450
|
-
```typescript
|
|
2451
|
-
interface UsePushResult {
|
|
2452
|
-
/** The known permission status, `null` until one is read. */
|
|
2453
|
-
readonly permission: Signal<PermissionStatus | null>
|
|
2454
|
-
/** The registered token, `null` while unregistered. */
|
|
2455
|
-
readonly token: Signal<PushToken | null>
|
|
2456
|
-
/**
|
|
2457
|
-
* Reads the permission status and stores it.
|
|
2458
|
-
*
|
|
2459
|
-
* @returns The status.
|
|
2460
|
-
*/
|
|
2461
|
-
checkPermission: () => Promise<PermissionStatus>
|
|
2462
|
-
/**
|
|
2463
|
-
* Asks for permission and stores the status.
|
|
2464
|
-
*
|
|
2465
|
-
* @returns The status.
|
|
2466
|
-
*/
|
|
2467
|
-
requestPermission: () => Promise<PermissionStatus>
|
|
2468
|
-
/**
|
|
2469
|
-
* Registers for push notifications and stores the token.
|
|
2470
|
-
*
|
|
2471
|
-
* @param options - Registration options.
|
|
2472
|
-
* @returns The token.
|
|
2473
|
-
*/
|
|
2474
|
-
register: (options?: PushRegisterOptions) => Promise<PushToken>
|
|
2475
|
-
/**
|
|
2476
|
-
* Unregisters and clears the token.
|
|
2477
|
-
*
|
|
2478
|
-
* @returns Resolves once unregistered.
|
|
2479
|
-
*/
|
|
2480
|
-
unregister: () => Promise<void>
|
|
2481
|
-
/**
|
|
2482
|
-
* Subscribes to received notifications.
|
|
2483
|
-
*
|
|
2484
|
-
* @param listener - Called for every notification.
|
|
2485
|
-
* @returns A function that removes the listener.
|
|
2486
|
-
*/
|
|
2487
|
-
onNotificationReceived: (listener: NotificationReceivedListener) => () => void
|
|
2488
|
-
/**
|
|
2489
|
-
* Subscribes to notification actions.
|
|
2490
|
-
*
|
|
2491
|
-
* @param listener - Called for every action.
|
|
2492
|
-
* @returns A function that removes the listener.
|
|
2493
|
-
*/
|
|
2494
|
-
onNotificationAction: (listener: NotificationActionListener) => () => void
|
|
2495
|
-
/**
|
|
2496
|
-
* Subscribes to token changes.
|
|
2497
|
-
*
|
|
2498
|
-
* @param listener - Called for every new token.
|
|
2499
|
-
* @returns A function that removes the listener.
|
|
2500
|
-
*/
|
|
2501
|
-
onTokenChange: (listener: TokenChangeListener) => () => void
|
|
2502
|
-
/**
|
|
2503
|
-
* Sets the badge count.
|
|
2504
|
-
*
|
|
2505
|
-
* @param count - The count to set.
|
|
2506
|
-
* @returns Resolves once set.
|
|
2507
|
-
*/
|
|
2508
|
-
setBadge: (count: number) => Promise<void>
|
|
2509
|
-
/**
|
|
2510
|
-
* Clears the badge count.
|
|
2511
|
-
*
|
|
2512
|
-
* @returns Resolves once cleared.
|
|
2513
|
-
*/
|
|
2514
|
-
clearBadge: () => Promise<void>
|
|
2515
|
-
}
|
|
2516
|
-
```
|
|
2517
|
-
|
|
2518
2409
|
#### `UseOptimisticToggleOptions`
|
|
2519
2410
|
|
|
2520
2411
|
Options for {@link useOptimisticToggle}.
|
|
@@ -3217,29 +3108,6 @@ interface PromiseStateManager<T, Args extends unknown[] = unknown[]> {
|
|
|
3217
3108
|
}
|
|
3218
3109
|
```
|
|
3219
3110
|
|
|
3220
|
-
#### `PushService`
|
|
3221
|
-
|
|
3222
|
-
Push service interface.
|
|
3223
|
-
|
|
3224
|
-
```typescript
|
|
3225
|
-
interface PushService {
|
|
3226
|
-
permission$: Observable<PermissionStatus | null>
|
|
3227
|
-
token$: Observable<PushToken | null>
|
|
3228
|
-
getPermission: () => PermissionStatus | null
|
|
3229
|
-
getToken: () => PushToken | null
|
|
3230
|
-
checkPermission: () => Promise<PermissionStatus>
|
|
3231
|
-
requestPermission: () => Promise<PermissionStatus>
|
|
3232
|
-
register: (options?: PushRegisterOptions) => Promise<PushToken>
|
|
3233
|
-
unregister: () => Promise<void>
|
|
3234
|
-
onNotificationReceived: (listener: NotificationReceivedListener) => () => void
|
|
3235
|
-
onNotificationAction: (listener: NotificationActionListener) => () => void
|
|
3236
|
-
onTokenChange: (listener: TokenChangeListener) => () => void
|
|
3237
|
-
setBadge: (count: number) => Promise<void>
|
|
3238
|
-
clearBadge: () => Promise<void>
|
|
3239
|
-
destroy: () => void
|
|
3240
|
-
}
|
|
3241
|
-
```
|
|
3242
|
-
|
|
3243
3111
|
#### `SignupStateManager`
|
|
3244
3112
|
|
|
3245
3113
|
Signup state manager.
|
|
@@ -3380,44 +3248,6 @@ URL query string parameter map (single values or arrays for repeated keys).
|
|
|
3380
3248
|
type QueryParams = Record<string, string | string[] | undefined>
|
|
3381
3249
|
```
|
|
3382
3250
|
|
|
3383
|
-
#### `AgentIdentity`
|
|
3384
|
-
|
|
3385
|
-
Display identity for the AI coding agent and the host product, used to
|
|
3386
|
-
interpolate the `{{agentName}}` / `{{productName}}` tokens in shared chat/IDE
|
|
3387
|
-
copy. A consuming app sets these to its own agent + product brand names; the
|
|
3388
|
-
shared packages fall back to {@link DEFAULT_AGENT_IDENTITY} when it does not.
|
|
3389
|
-
|
|
3390
|
-
```typescript
|
|
3391
|
-
type AgentIdentity = ChatAgentIdentity
|
|
3392
|
-
```
|
|
3393
|
-
|
|
3394
|
-
#### `UseChatOptions`
|
|
3395
|
-
|
|
3396
|
-
Options for {@link useChat} (the shared chat session's options).
|
|
3397
|
-
|
|
3398
|
-
```typescript
|
|
3399
|
-
type UseChatOptions = ChatSessionOptions
|
|
3400
|
-
```
|
|
3401
|
-
|
|
3402
|
-
#### `SendMessageOptions`
|
|
3403
|
-
|
|
3404
|
-
Options for one `sendMessage` call.
|
|
3405
|
-
|
|
3406
|
-
```typescript
|
|
3407
|
-
type SendMessageOptions = ChatSendOptions
|
|
3408
|
-
```
|
|
3409
|
-
|
|
3410
|
-
#### `UseChatResult`
|
|
3411
|
-
|
|
3412
|
-
What {@link useChat} returns: each chat state field as a signal, and the
|
|
3413
|
-
session's controls as plain functions (stable for the component's life).
|
|
3414
|
-
|
|
3415
|
-
```typescript
|
|
3416
|
-
type UseChatResult = {
|
|
3417
|
-
readonly [K in keyof ChatSessionState]: Signal<ChatSessionState[K]>
|
|
3418
|
-
} & ChatSessionControls
|
|
3419
|
-
```
|
|
3420
|
-
|
|
3421
3251
|
#### `AsyncSetState`
|
|
3422
3252
|
|
|
3423
3253
|
An async-capable setState function: a value, an updater receiving the
|
|
@@ -3469,9 +3299,7 @@ Two compatible call forms:
|
|
|
3469
3299
|
English `defaultValue`, with optional `count` for pluralization.
|
|
3470
3300
|
|
|
3471
3301
|
```typescript
|
|
3472
|
-
type UseTFunction =
|
|
3473
|
-
(key: string, fallback: string, options?: UseTShorthandOptions): string
|
|
3474
|
-
}
|
|
3302
|
+
type UseTFunction = TranslateFunctionWithFallback
|
|
3475
3303
|
```
|
|
3476
3304
|
|
|
3477
3305
|
#### `VerifyPaymentReturnStatus`
|
|
@@ -3482,6 +3310,86 @@ How far the return-page verification has got.
|
|
|
3482
3310
|
type VerifyPaymentReturnStatus = 'idle' | 'verifying' | 'verified' | 'failed'
|
|
3483
3311
|
```
|
|
3484
3312
|
|
|
3313
|
+
#### `UseAIModelsResult` _(deprecated)_
|
|
3314
|
+
|
|
3315
|
+
> **Deprecated:** Import UseAIModelsResult from `@molecule/app-angular/ai-models`.
|
|
3316
|
+
|
|
3317
|
+
Compatibility alias for `UseAIModelsResult`.
|
|
3318
|
+
|
|
3319
|
+
```typescript
|
|
3320
|
+
type UseAIModelsResult = feature.UseAIModelsResult
|
|
3321
|
+
```
|
|
3322
|
+
|
|
3323
|
+
#### `AgentIdentity` _(deprecated)_
|
|
3324
|
+
|
|
3325
|
+
> **Deprecated:** Import AgentIdentity from `@molecule/app-ai-chat`.
|
|
3326
|
+
|
|
3327
|
+
Compatibility alias for `AgentIdentity`.
|
|
3328
|
+
|
|
3329
|
+
```typescript
|
|
3330
|
+
type AgentIdentity = feature.AgentIdentity
|
|
3331
|
+
```
|
|
3332
|
+
|
|
3333
|
+
#### `SendMessageOptions` _(deprecated)_
|
|
3334
|
+
|
|
3335
|
+
> **Deprecated:** Import SendMessageOptions from `@molecule/app-angular/chat`.
|
|
3336
|
+
|
|
3337
|
+
Compatibility alias for `SendMessageOptions`.
|
|
3338
|
+
|
|
3339
|
+
```typescript
|
|
3340
|
+
type SendMessageOptions = feature.SendMessageOptions
|
|
3341
|
+
```
|
|
3342
|
+
|
|
3343
|
+
#### `UseChatOptions` _(deprecated)_
|
|
3344
|
+
|
|
3345
|
+
> **Deprecated:** Import UseChatOptions from `@molecule/app-angular/chat`.
|
|
3346
|
+
|
|
3347
|
+
Compatibility alias for `UseChatOptions`.
|
|
3348
|
+
|
|
3349
|
+
```typescript
|
|
3350
|
+
type UseChatOptions = feature.UseChatOptions
|
|
3351
|
+
```
|
|
3352
|
+
|
|
3353
|
+
#### `UseChatResult` _(deprecated)_
|
|
3354
|
+
|
|
3355
|
+
> **Deprecated:** Import UseChatResult from `@molecule/app-angular/chat`.
|
|
3356
|
+
|
|
3357
|
+
Compatibility alias for `UseChatResult`.
|
|
3358
|
+
|
|
3359
|
+
```typescript
|
|
3360
|
+
type UseChatResult = feature.UseChatResult
|
|
3361
|
+
```
|
|
3362
|
+
|
|
3363
|
+
#### `PushService` _(deprecated)_
|
|
3364
|
+
|
|
3365
|
+
> **Deprecated:** Import PushService from `@molecule/app-angular/push`.
|
|
3366
|
+
|
|
3367
|
+
Compatibility alias for `PushService`.
|
|
3368
|
+
|
|
3369
|
+
```typescript
|
|
3370
|
+
type PushService = feature.PushService
|
|
3371
|
+
```
|
|
3372
|
+
|
|
3373
|
+
#### `UsePushOptions` _(deprecated)_
|
|
3374
|
+
|
|
3375
|
+
> **Deprecated:** Import UsePushOptions from `@molecule/app-angular/push`.
|
|
3376
|
+
|
|
3377
|
+
Compatibility alias for `UsePushOptions`.
|
|
3378
|
+
|
|
3379
|
+
```typescript
|
|
3380
|
+
type UsePushOptions = feature.UsePushOptions
|
|
3381
|
+
```
|
|
3382
|
+
|
|
3383
|
+
#### `UsePushResult` _(deprecated)_
|
|
3384
|
+
|
|
3385
|
+
> **Deprecated:** Import UsePushResult from `@molecule/app-angular/push`.
|
|
3386
|
+
|
|
3387
|
+
Compatibility alias for `UsePushResult`.
|
|
3388
|
+
|
|
3389
|
+
```typescript
|
|
3390
|
+
type UsePushResult = feature.UsePushResult
|
|
3391
|
+
```
|
|
3392
|
+
|
|
3485
3393
|
#### `MaybeSignal`
|
|
3486
3394
|
|
|
3487
3395
|
A hook argument: the plain value, or a signal holding the value the hook
|
|
@@ -3705,6 +3613,13 @@ navigates without a page load; a ctrl/cmd, shift or alt click, a `target`
|
|
|
3705
3613
|
other than `_self`, a click the template's own `(click)` handler prevented,
|
|
3706
3614
|
and a URL on another origin are left to the browser.
|
|
3707
3615
|
|
|
3616
|
+
A link to a URL outside the app (another origin, `mailto:`, `//host`) needs
|
|
3617
|
+
no router: the browser, or on a device the URL handler, opens it. It renders
|
|
3618
|
+
with no router registered, the URL as its `href`, and a click is left to the
|
|
3619
|
+
browser (the template's own `(click)` handler still runs). A link to an app
|
|
3620
|
+
path needs a router, and fails without one with the error `useRouterInstance`
|
|
3621
|
+
throws.
|
|
3622
|
+
|
|
3708
3623
|
Inputs: `molLink` (the destination: an app path or a URL), `replace` (replace
|
|
3709
3624
|
the current history entry; when unset, a link to the location already shown
|
|
3710
3625
|
replaces it and any other link pushes, as with react-router's `<Link>`), and
|
|
@@ -3724,7 +3639,8 @@ that calls `navigate()`. Needs the router from `provideMolecule({ router })`.
|
|
|
3724
3639
|
export class Link implements OnInit, LinkProps {
|
|
3725
3640
|
/**
|
|
3726
3641
|
* The destination: an app path (`/settings?tab=billing#plan`) or a URL. An app path's `href` is
|
|
3727
|
-
* the one the router writes for it (`routerLinkHref`), base path included
|
|
3642
|
+
* the one the router writes for it (`routerLinkHref`), base path included; a URL's is the URL as
|
|
3643
|
+
* written.
|
|
3728
3644
|
*/
|
|
3729
3645
|
molLink = ''
|
|
3730
3646
|
/** Replace the current history entry instead of pushing one. */
|
|
@@ -3732,11 +3648,22 @@ export class Link implements OnInit, LinkProps {
|
|
|
3732
3648
|
/** State stored with the new history entry. */
|
|
3733
3649
|
state?: unknown
|
|
3734
3650
|
|
|
3735
|
-
|
|
3651
|
+
/**
|
|
3652
|
+
* Reads the registered router once, here in the field initializer's injection context, and
|
|
3653
|
+
* answers for each destination this link shows: an app path fails with the no-router error
|
|
3654
|
+
* when none is registered. It takes the hook's function form because `molLink` is not set
|
|
3655
|
+
* when a field initializer runs.
|
|
3656
|
+
*/
|
|
3657
|
+
private readonly linkRouter = useLinkRouter()
|
|
3736
3658
|
|
|
3737
|
-
/**
|
|
3659
|
+
/**
|
|
3660
|
+
* The anchor's `href`: the URL as written for a URL outside the app with no router registered,
|
|
3661
|
+
* else the one the router writes for an app path, base path included. An app path with no
|
|
3662
|
+
* router fails here with the no-router error.
|
|
3663
|
+
*/
|
|
3738
3664
|
get href(): string {
|
|
3739
|
-
|
|
3665
|
+
const router = this.linkRouter(this.molLink)
|
|
3666
|
+
return router === null ? this.molLink : routerLinkHref(this.molLink, router)
|
|
3740
3667
|
}
|
|
3741
3668
|
private readonly element = inject<ElementRef<HTMLAnchorElement>>(ElementRef)
|
|
3742
3669
|
private readonly renderer = inject(Renderer2)
|
|
@@ -3745,14 +3672,18 @@ export class Link implements OnInit, LinkProps {
|
|
|
3745
3672
|
/**
|
|
3746
3673
|
* Starts handling clicks. The listener is added here, after the template
|
|
3747
3674
|
* created this anchor's own `(click)` listeners, so those run first and can
|
|
3748
|
-
* prevent the navigation (react-router calls `onClick` first too).
|
|
3675
|
+
* prevent the navigation (react-router calls `onClick` first too). With no
|
|
3676
|
+
* router (a URL outside the app) the browser follows the anchor instead.
|
|
3749
3677
|
*/
|
|
3750
3678
|
ngOnInit(): void {
|
|
3751
3679
|
const stop = this.renderer.listen(this.element.nativeElement, 'click', (event: MouseEvent) => {
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3680
|
+
const router = this.linkRouter(this.molLink)
|
|
3681
|
+
if (router !== null) {
|
|
3682
|
+
followRouterLink(event, this.molLink, router, {
|
|
3683
|
+
replace: this.replace,
|
|
3684
|
+
state: this.state,
|
|
3685
|
+
})
|
|
3686
|
+
}
|
|
3756
3687
|
})
|
|
3757
3688
|
this.destroyRef.onDestroy(stop)
|
|
3758
3689
|
}
|
|
@@ -5105,35 +5036,6 @@ copy.view.destroy() else (copy.node as ChildNode).remove() } }
|
|
|
5105
5036
|
|
|
5106
5037
|
### Functions
|
|
5107
5038
|
|
|
5108
|
-
#### `useChatProvider()`
|
|
5109
|
-
|
|
5110
|
-
The chat provider registered by `provideMolecule({ chat })` or `provideChat`.
|
|
5111
|
-
Call it in an injection context.
|
|
5112
|
-
|
|
5113
|
-
```typescript
|
|
5114
|
-
function useChatProvider(): ChatProvider
|
|
5115
|
-
```
|
|
5116
|
-
|
|
5117
|
-
**Returns:** The chat provider.
|
|
5118
|
-
|
|
5119
|
-
#### `useChat(options)`
|
|
5120
|
-
|
|
5121
|
-
AI chat with streaming: the transcript, loading and error state, mode, and
|
|
5122
|
-
the controls (send, abort, queue edits, history). Call it in an injection
|
|
5123
|
-
context (a component field initializer or constructor).
|
|
5124
|
-
|
|
5125
|
-
The options may be a signal: a new `endpoint` switches conversation and a
|
|
5126
|
-
new `projectId` moves to that project's transcript, on the same component,
|
|
5127
|
-
the way React re-renders `useChat`.
|
|
5128
|
-
|
|
5129
|
-
```typescript
|
|
5130
|
-
function useChat(options: UseChatOptions | Signal<UseChatOptions>): UseChatResult
|
|
5131
|
-
```
|
|
5132
|
-
|
|
5133
|
-
- `options` — Chat options (or a signal of them): endpoint, project id, history loading, callbacks.
|
|
5134
|
-
|
|
5135
|
-
**Returns:** Each state field as a signal, and the chat controls.
|
|
5136
|
-
|
|
5137
5039
|
#### `setHostRoot(host, root, options)`
|
|
5138
5040
|
|
|
5139
5041
|
Names the element that stands for the calling component's host: React's
|
|
@@ -5442,34 +5344,6 @@ function useExternalStore<T>(
|
|
|
5442
5344
|
|
|
5443
5345
|
**Returns:** A signal of the store's current snapshot.
|
|
5444
5346
|
|
|
5445
|
-
#### `resetAIModelsCache()`
|
|
5446
|
-
|
|
5447
|
-
Test-only: drops every cached model list so the next {@link useAIModels}
|
|
5448
|
-
call refetches. Exposed for unit tests; do not call from production code.
|
|
5449
|
-
|
|
5450
|
-
```typescript
|
|
5451
|
-
function resetAIModelsCache(): void
|
|
5452
|
-
```
|
|
5453
|
-
|
|
5454
|
-
#### `useAIModels(projectId)`
|
|
5455
|
-
|
|
5456
|
-
Subscribes to the cached AI model catalog. The first mount of a scope
|
|
5457
|
-
triggers a single `GET /ai/models` fetch; subsequent mounts return the
|
|
5458
|
-
cached result. Call it in an injection context.
|
|
5459
|
-
|
|
5460
|
-
The project id may be a signal: the hook then switches to that project's
|
|
5461
|
-
scope on the same component — resubscribing, resyncing from the new scope's
|
|
5462
|
-
cache and fetching it when it is not cached — the way React re-renders
|
|
5463
|
-
`useAIModels` with a new `projectId`.
|
|
5464
|
-
|
|
5465
|
-
```typescript
|
|
5466
|
-
function useAIModels(projectId?: MaybeSignal<string | undefined>): UseAIModelsResult
|
|
5467
|
-
```
|
|
5468
|
-
|
|
5469
|
-
- `projectId` — Optional project scope: includes that project's custom ("bring your own AI") models on servers that support them (or a signal of it).
|
|
5470
|
-
|
|
5471
|
-
**Returns:** Models, free-tier model, loading flag, and error as signals.
|
|
5472
|
-
|
|
5473
5347
|
#### `usePromise(asyncFn)`
|
|
5474
5348
|
|
|
5475
5349
|
Wraps an async function with the state of its latest call. Call it in an
|
|
@@ -6032,25 +5906,6 @@ function useCapacitorApp(options?: CapacitorAppOptions): UseCapacitorAppResult
|
|
|
6032
5906
|
|
|
6033
5907
|
**Returns:** The current app state as signals and an `initialize` function.
|
|
6034
5908
|
|
|
6035
|
-
#### `usePush(options)`
|
|
6036
|
-
|
|
6037
|
-
Push notification state and actions. Call it in an injection context.
|
|
6038
|
-
|
|
6039
|
-
Uses module-level `getProvider()` — push is a singleton, not
|
|
6040
|
-
registration-provided.
|
|
6041
|
-
|
|
6042
|
-
The options may be a signal: `checkOnMount` turning on through it checks the
|
|
6043
|
-
permission once more (when it was off before), the way React re-renders
|
|
6044
|
-
`usePush` with the new option.
|
|
6045
|
-
|
|
6046
|
-
```typescript
|
|
6047
|
-
function usePush(options?: MaybeSignal<UsePushOptions>): UsePushResult
|
|
6048
|
-
```
|
|
6049
|
-
|
|
6050
|
-
- `options` — Hook options (or a signal of them).
|
|
6051
|
-
|
|
6052
|
-
**Returns:** The permission and token as signals and the action functions.
|
|
6053
|
-
|
|
6054
5909
|
#### `useOptimisticToggle(options)`
|
|
6055
5910
|
|
|
6056
5911
|
Owns the state and save ordering of a follow, favorite, star or subscription control
|
|
@@ -6110,6 +5965,29 @@ function useRouterInstance(): Router
|
|
|
6110
5965
|
|
|
6111
5966
|
**Returns:** The router instance.
|
|
6112
5967
|
|
|
5968
|
+
#### `useLinkRouter(to)`
|
|
5969
|
+
|
|
5970
|
+
The router a link navigates through, React's `useLinkRouter` in Angular's
|
|
5971
|
+
idiom: the registered router, or `null` for a URL outside the app when none
|
|
5972
|
+
is. The browser, or on a device the URL handler, opens such a URL, so a link
|
|
5973
|
+
to it renders in an app with no router (a widget, a static page). A link to
|
|
5974
|
+
an app path still fails without one: that is how an app that forgot to
|
|
5975
|
+
register its router finds out.
|
|
5976
|
+
|
|
5977
|
+
The `Link` directive uses it. With a destination it answers for that one and
|
|
5978
|
+
follows it while the injector's host lives. Without one (a directive's input
|
|
5979
|
+
is not set when its field initializers run) it returns a function to call
|
|
5980
|
+
with the destination wherever it is known. Call it in an injection context
|
|
5981
|
+
(a constructor or a field initializer), which reads the injector once.
|
|
5982
|
+
|
|
5983
|
+
```typescript
|
|
5984
|
+
function useLinkRouter(to: MaybeSignal<string>): Signal<Router | null>
|
|
5985
|
+
```
|
|
5986
|
+
|
|
5987
|
+
- `to` — The link's destination: an app path or a URL, or a signal of one.
|
|
5988
|
+
|
|
5989
|
+
**Returns:** A signal of the router the link navigates through, or `null` for a URL outside the app with no router registered.
|
|
5990
|
+
|
|
6113
5991
|
#### `useRouter()`
|
|
6114
5992
|
|
|
6115
5993
|
Routing state and actions. Call it in an injection context (a component
|
|
@@ -6446,6 +6324,17 @@ function useThemeColors(): Signal<Theme['colors']>
|
|
|
6446
6324
|
|
|
6447
6325
|
**Returns:** A signal of the current theme's colors.
|
|
6448
6326
|
|
|
6327
|
+
#### `useRichTranslation()`
|
|
6328
|
+
|
|
6329
|
+
Reads rich catalog messages from the active provider. Call the returned
|
|
6330
|
+
translation function in render so it follows locale and catalog changes.
|
|
6331
|
+
|
|
6332
|
+
```typescript
|
|
6333
|
+
function useRichTranslation(): RichTranslateFunction
|
|
6334
|
+
```
|
|
6335
|
+
|
|
6336
|
+
**Returns:** The locale-reactive rich translation function.
|
|
6337
|
+
|
|
6449
6338
|
#### `useI18nProvider()`
|
|
6450
6339
|
|
|
6451
6340
|
The i18n provider registered by `provideMolecule({ i18n })` or
|
|
@@ -6600,7 +6489,11 @@ dependency, so template bindings that call this function will be
|
|
|
6600
6489
|
re-evaluated when the locale changes.
|
|
6601
6490
|
|
|
6602
6491
|
```typescript
|
|
6603
|
-
function t(
|
|
6492
|
+
function t(
|
|
6493
|
+
key: string,
|
|
6494
|
+
values: InterpolationValues | undefined,
|
|
6495
|
+
options: TranslateOptions | undefined,
|
|
6496
|
+
): string
|
|
6604
6497
|
```
|
|
6605
6498
|
|
|
6606
6499
|
- `key` — Translation key
|
|
@@ -6820,18 +6713,6 @@ function provideLogger(provider: LoggerProvider): EnvironmentProviders
|
|
|
6820
6713
|
|
|
6821
6714
|
**Returns:** Environment providers
|
|
6822
6715
|
|
|
6823
|
-
#### `provideChat(provider)`
|
|
6824
|
-
|
|
6825
|
-
Registers the AI chat provider useChat and useChatProvider use.
|
|
6826
|
-
|
|
6827
|
-
```typescript
|
|
6828
|
-
function provideChat(provider: ChatProvider): EnvironmentProviders
|
|
6829
|
-
```
|
|
6830
|
-
|
|
6831
|
-
- `provider` — Chat provider
|
|
6832
|
-
|
|
6833
|
-
**Returns:** Environment providers
|
|
6834
|
-
|
|
6835
6716
|
#### `provideWorkspace(provider)`
|
|
6836
6717
|
|
|
6837
6718
|
Registers the IDE workspace provider useWorkspace and useWorkspaceProvider use.
|
|
@@ -6999,16 +6880,6 @@ function createPromiseState<Args extends unknown[], T>(
|
|
|
6999
6880
|
|
|
7000
6881
|
**Returns:** Promise state manager with observable state
|
|
7001
6882
|
|
|
7002
|
-
#### `createPushService()`
|
|
7003
|
-
|
|
7004
|
-
Creates an Angular push notifications service with reactive state.
|
|
7005
|
-
|
|
7006
|
-
```typescript
|
|
7007
|
-
function createPushService(): PushService
|
|
7008
|
-
```
|
|
7009
|
-
|
|
7010
|
-
**Returns:** Push service with observables and action methods
|
|
7011
|
-
|
|
7012
6883
|
#### `createSignupState(client)`
|
|
7013
6884
|
|
|
7014
6885
|
Creates a signup state manager with async state tracking.
|
|
@@ -7033,67 +6904,144 @@ function createVersionService(): VersionService
|
|
|
7033
6904
|
|
|
7034
6905
|
### Constants
|
|
7035
6906
|
|
|
7036
|
-
#### `
|
|
6907
|
+
#### `resetAIModelsCache` _(deprecated)_
|
|
6908
|
+
|
|
6909
|
+
> **Deprecated:** Import resetAIModelsCache from `@molecule/app-angular/ai-models`.
|
|
6910
|
+
|
|
6911
|
+
Compatibility alias for `resetAIModelsCache`.
|
|
6912
|
+
|
|
6913
|
+
```typescript
|
|
6914
|
+
const resetAIModelsCache: typeof feature.resetAIModelsCache
|
|
6915
|
+
```
|
|
6916
|
+
|
|
6917
|
+
#### `useAIModels` _(deprecated)_
|
|
6918
|
+
|
|
6919
|
+
> **Deprecated:** Import useAIModels from `@molecule/app-angular/ai-models`.
|
|
6920
|
+
|
|
6921
|
+
Compatibility alias for `useAIModels`.
|
|
6922
|
+
|
|
6923
|
+
```typescript
|
|
6924
|
+
const useAIModels: typeof feature.useAIModels
|
|
6925
|
+
```
|
|
6926
|
+
|
|
6927
|
+
#### `CHAT_PROVIDER` _(deprecated)_
|
|
6928
|
+
|
|
6929
|
+
> **Deprecated:** Import CHAT_PROVIDER from `@molecule/app-angular/chat`.
|
|
6930
|
+
|
|
6931
|
+
Compatibility alias for `CHAT_PROVIDER`.
|
|
6932
|
+
|
|
6933
|
+
```typescript
|
|
6934
|
+
const CHAT_PROVIDER: typeof feature.CHAT_PROVIDER
|
|
6935
|
+
```
|
|
6936
|
+
|
|
6937
|
+
#### `DEFAULT_AGENT_IDENTITY` _(deprecated)_
|
|
6938
|
+
|
|
6939
|
+
> **Deprecated:** Import DEFAULT_AGENT_IDENTITY from `@molecule/app-ai-chat`.
|
|
6940
|
+
|
|
6941
|
+
Compatibility alias for `DEFAULT_AGENT_IDENTITY`.
|
|
6942
|
+
|
|
6943
|
+
```typescript
|
|
6944
|
+
const DEFAULT_AGENT_IDENTITY: typeof feature.DEFAULT_AGENT_IDENTITY
|
|
6945
|
+
```
|
|
6946
|
+
|
|
6947
|
+
#### `DEFAULT_AGENT_NAME` _(deprecated)_
|
|
7037
6948
|
|
|
7038
|
-
|
|
6949
|
+
> **Deprecated:** Import DEFAULT_AGENT_NAME from `@molecule/app-ai-chat`.
|
|
6950
|
+
|
|
6951
|
+
Compatibility alias for `DEFAULT_AGENT_NAME`.
|
|
6952
|
+
|
|
6953
|
+
```typescript
|
|
6954
|
+
const DEFAULT_AGENT_NAME: typeof feature.DEFAULT_AGENT_NAME
|
|
6955
|
+
```
|
|
6956
|
+
|
|
6957
|
+
#### `DEFAULT_PRODUCT_NAME` _(deprecated)_
|
|
6958
|
+
|
|
6959
|
+
> **Deprecated:** Import DEFAULT_PRODUCT_NAME from `@molecule/app-ai-chat`.
|
|
6960
|
+
|
|
6961
|
+
Compatibility alias for `DEFAULT_PRODUCT_NAME`.
|
|
6962
|
+
|
|
6963
|
+
```typescript
|
|
6964
|
+
const DEFAULT_PRODUCT_NAME: typeof feature.DEFAULT_PRODUCT_NAME
|
|
6965
|
+
```
|
|
6966
|
+
|
|
6967
|
+
#### `convergeHistory` _(deprecated)_
|
|
6968
|
+
|
|
6969
|
+
> **Deprecated:** Import convergeHistory from `@molecule/app-angular/chat`.
|
|
6970
|
+
|
|
6971
|
+
Compatibility alias for `convergeHistory`.
|
|
7039
6972
|
|
|
7040
6973
|
```typescript
|
|
7041
|
-
const
|
|
6974
|
+
const convergeHistory: typeof feature.convergeHistory
|
|
7042
6975
|
```
|
|
7043
6976
|
|
|
7044
|
-
#### `
|
|
6977
|
+
#### `localOnlyMessages` _(deprecated)_
|
|
6978
|
+
|
|
6979
|
+
> **Deprecated:** Import localOnlyMessages from `@molecule/app-angular/chat`.
|
|
7045
6980
|
|
|
7046
|
-
|
|
6981
|
+
Compatibility alias for `localOnlyMessages`.
|
|
7047
6982
|
|
|
7048
6983
|
```typescript
|
|
7049
|
-
const
|
|
6984
|
+
const localOnlyMessages: typeof feature.localOnlyMessages
|
|
7050
6985
|
```
|
|
7051
6986
|
|
|
7052
|
-
#### `
|
|
6987
|
+
#### `provideChat` _(deprecated)_
|
|
7053
6988
|
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
6989
|
+
> **Deprecated:** Import provideChat from `@molecule/app-angular/chat`.
|
|
6990
|
+
|
|
6991
|
+
Compatibility alias for `provideChat`.
|
|
7057
6992
|
|
|
7058
6993
|
```typescript
|
|
7059
|
-
const
|
|
6994
|
+
const provideChat: typeof feature.provideChat
|
|
7060
6995
|
```
|
|
7061
6996
|
|
|
7062
|
-
#### `
|
|
6997
|
+
#### `resetChatStoresForTests` _(deprecated)_
|
|
6998
|
+
|
|
6999
|
+
> **Deprecated:** Import resetChatStoresForTests from `@molecule/app-angular/chat`.
|
|
7063
7000
|
|
|
7064
|
-
|
|
7065
|
-
`convergeHistory` in `@molecule/app-ai-chat`.
|
|
7001
|
+
Compatibility alias for `resetChatStoresForTests`.
|
|
7066
7002
|
|
|
7067
7003
|
```typescript
|
|
7068
|
-
const
|
|
7004
|
+
const resetChatStoresForTests: typeof feature.resetChatStoresForTests
|
|
7069
7005
|
```
|
|
7070
7006
|
|
|
7071
|
-
|
|
7072
|
-
- `history` — The server's history.
|
|
7007
|
+
#### `useChat` _(deprecated)_
|
|
7073
7008
|
|
|
7074
|
-
**
|
|
7009
|
+
> **Deprecated:** Import useChat from `@molecule/app-angular/chat`.
|
|
7075
7010
|
|
|
7076
|
-
|
|
7011
|
+
Compatibility alias for `useChat`.
|
|
7077
7012
|
|
|
7078
|
-
|
|
7079
|
-
|
|
7013
|
+
```typescript
|
|
7014
|
+
const useChat: typeof feature.useChat
|
|
7015
|
+
```
|
|
7016
|
+
|
|
7017
|
+
#### `useChatProvider` _(deprecated)_
|
|
7018
|
+
|
|
7019
|
+
> **Deprecated:** Import useChatProvider from `@molecule/app-angular/chat`.
|
|
7020
|
+
|
|
7021
|
+
Compatibility alias for `useChatProvider`.
|
|
7080
7022
|
|
|
7081
7023
|
```typescript
|
|
7082
|
-
const
|
|
7024
|
+
const useChatProvider: typeof feature.useChatProvider
|
|
7083
7025
|
```
|
|
7084
7026
|
|
|
7085
|
-
|
|
7086
|
-
|
|
7027
|
+
#### `createPushService` _(deprecated)_
|
|
7028
|
+
|
|
7029
|
+
> **Deprecated:** Import createPushService from `@molecule/app-angular/push`.
|
|
7030
|
+
|
|
7031
|
+
Compatibility alias for `createPushService`.
|
|
7032
|
+
|
|
7033
|
+
```typescript
|
|
7034
|
+
const createPushService: typeof feature.createPushService
|
|
7035
|
+
```
|
|
7087
7036
|
|
|
7088
|
-
|
|
7037
|
+
#### `usePush` _(deprecated)_
|
|
7089
7038
|
|
|
7090
|
-
|
|
7039
|
+
> **Deprecated:** Import usePush from `@molecule/app-angular/push`.
|
|
7091
7040
|
|
|
7092
|
-
|
|
7093
|
-
transcript, queue or stream left by the previous one.
|
|
7041
|
+
Compatibility alias for `usePush`.
|
|
7094
7042
|
|
|
7095
7043
|
```typescript
|
|
7096
|
-
const
|
|
7044
|
+
const usePush: typeof feature.usePush
|
|
7097
7045
|
```
|
|
7098
7046
|
|
|
7099
7047
|
#### `STATE_PROVIDER`
|
|
@@ -7160,14 +7108,6 @@ Injection token for logger provider.
|
|
|
7160
7108
|
const LOGGER_PROVIDER: InjectionToken<LoggerProvider>
|
|
7161
7109
|
```
|
|
7162
7110
|
|
|
7163
|
-
#### `CHAT_PROVIDER`
|
|
7164
|
-
|
|
7165
|
-
Injection token for the AI chat provider.
|
|
7166
|
-
|
|
7167
|
-
```typescript
|
|
7168
|
-
const CHAT_PROVIDER: InjectionToken<ChatProvider>
|
|
7169
|
-
```
|
|
7170
|
-
|
|
7171
7111
|
#### `WORKSPACE_PROVIDER`
|
|
7172
7112
|
|
|
7173
7113
|
Injection token for the IDE workspace provider.
|
|
@@ -7206,8 +7146,8 @@ Peer dependencies:
|
|
|
7206
7146
|
- `@molecule/app-device` ^1.0.1
|
|
7207
7147
|
- `@molecule/app-forms` ^2.4.0
|
|
7208
7148
|
- `@molecule/app-http` ^1.0.1
|
|
7209
|
-
- `@molecule/app-i18n` ^1.0
|
|
7210
|
-
- `@molecule/app-ide` ^1.0
|
|
7149
|
+
- `@molecule/app-i18n` ^1.4.0
|
|
7150
|
+
- `@molecule/app-ide` ^1.1.0 _(optional)_
|
|
7211
7151
|
- `@molecule/app-live-preview` ^1.0.1 _(optional)_
|
|
7212
7152
|
- `@molecule/app-logger` ^1.0.1
|
|
7213
7153
|
- `@molecule/app-platform` ^1.0.1
|
|
@@ -7216,7 +7156,7 @@ Peer dependencies:
|
|
|
7216
7156
|
- `@molecule/app-routing-angular-router` >=1.4.0 _(optional)_
|
|
7217
7157
|
- `@molecule/app-state` ^1.2.0
|
|
7218
7158
|
- `@molecule/app-storage` ^1.1.1
|
|
7219
|
-
- `@molecule/app-theme` ^1.0.
|
|
7159
|
+
- `@molecule/app-theme` ^1.0.2
|
|
7220
7160
|
- `@molecule/app-ui` ^1.0.1
|
|
7221
7161
|
- `@molecule/app-utilities` ^1.0.1
|
|
7222
7162
|
- `@molecule/app-version` ^1.0.1
|
|
@@ -7274,6 +7214,10 @@ Peer dependencies:
|
|
|
7274
7214
|
`<a href>` reloads the page; a hand-written `(click)` handler that calls `navigate()`
|
|
7275
7215
|
breaks ctrl/cmd-click (new tab) unless it repeats those rules.
|
|
7276
7216
|
|
|
7217
|
+
Use `@molecule/app-angular/chat`, `@molecule/app-angular/ai-models`, and
|
|
7218
|
+
`@molecule/app-angular/push` for those features. The corresponding exports at the
|
|
7219
|
+
package root are deprecated.
|
|
7220
|
+
|
|
7277
7221
|
## Translations
|
|
7278
7222
|
|
|
7279
7223
|
Translation strings are provided by `@molecule/app-locales-angular`.
|