@umbraco-ai/core 18.4.0-rc.4 → 18.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ai/core",
3
- "version": "18.4.0-rc.4",
3
+ "version": "18.4.0",
4
4
  "type": "module",
5
5
  "types": "./types/umbraco-ai-public-types.d.ts",
6
6
  "files": [
@@ -5,6 +5,7 @@ import type { ManifestApi } from '@umbraco-cms/backoffice/extension-api';
5
5
  import type { ManifestBase } from '@umbraco-cms/backoffice/extension-api';
6
6
  import type { ManifestMenuItem } from '@umbraco-cms/backoffice/menu';
7
7
  import type { ManifestRepository } from '@umbraco-cms/backoffice/extension-registry';
8
+ import { nothing } from '@umbraco-cms/backoffice/external/lit';
8
9
  import { Observable } from '@umbraco-cms/backoffice/external/rxjs';
9
10
  import { Observable as Observable_2 } from 'rxjs';
10
11
  import { TemplateResult } from 'lit-html';
@@ -691,6 +692,8 @@ export declare const UAI_CONFIGURATION_MENU_ALIAS = "Uai.Menu.Configuration";
691
692
  */
692
693
  export declare const UAI_CORE_MENU_ALIAS = "Uai.Menu.Configuration";
693
694
 
695
+ export declare const UAI_DISCLOSURE_CONTEXT: UmbContextToken<UaiDisclosureContext, UaiDisclosureContext>;
696
+
694
697
  /**
695
698
  * A constant representing an empty GUID.
696
699
  * @public
@@ -1009,6 +1012,78 @@ export declare interface UaiDetectedEntity {
1009
1012
  workspaceContext: object;
1010
1013
  }
1011
1014
 
1015
+ /**
1016
+ * Global context providing the AI disclosure notice state.
1017
+ * Registered as a globalContext manifest - auto-instantiated at backoffice root.
1018
+ */
1019
+ export declare class UaiDisclosureContext extends UmbControllerBase {
1020
+ #private;
1021
+ /** Type guard marker for context resolution. */
1022
+ readonly IS_DISCLOSURE_CONTEXT = true;
1023
+ /** The configured notice mode, or undefined while loading. */
1024
+ readonly mode: Observable<UaiDisclosureNoticeMode | undefined>;
1025
+ /** Whether the notice can be dismissed by the user. */
1026
+ readonly canDismiss: Observable<boolean>;
1027
+ /**
1028
+ * Whether the notice should be shown right now at the given location.
1029
+ * @param location A short key for the AI surface, e.g. "chat" or "prompt".
1030
+ */
1031
+ showNoticeFor(location: string): Observable<boolean>;
1032
+ constructor(host: UmbControllerHost);
1033
+ /**
1034
+ * Updates the mode without a reload, e.g. straight after the AI settings are saved.
1035
+ */
1036
+ setMode(mode: UaiDisclosureNoticeMode): void;
1037
+ /**
1038
+ * Hides the notice at the given location for this browser. Other locations are unaffected.
1039
+ * Only has an effect when the mode is Dismissible.
1040
+ * @param location A short key for the AI surface, e.g. "chat" or "prompt" (letters, digits, dashes).
1041
+ */
1042
+ dismiss(location: string): void;
1043
+ }
1044
+
1045
+ /**
1046
+ * The "Responses are AI-generated" notice, shown next to AI output.
1047
+ *
1048
+ * Follows the global AI Disclosure Notice setting: always shown, dismissible (per location,
1049
+ * remembered per browser) or never shown. Renders nothing while hidden, so hosts can place
1050
+ * it unconditionally.
1051
+ *
1052
+ * Styling hooks for hosts:
1053
+ * - `--uai-disclosure-notice-background` (default: transparent)
1054
+ * - `--uai-disclosure-notice-padding` (default: 0)
1055
+ * - `--uai-disclosure-notice-border-radius` (default: 0)
1056
+ *
1057
+ * @example
1058
+ * ```html
1059
+ * <uai-disclosure-notice location="chat"></uai-disclosure-notice>
1060
+ * ```
1061
+ */
1062
+ export declare class UaiDisclosureNoticeElement extends UmbLitElement {
1063
+ #private;
1064
+ /**
1065
+ * A short key for where the notice is shown, e.g. "chat" or "prompt" (letters, digits, dashes).
1066
+ * Dismissing the notice only hides it at this location.
1067
+ */
1068
+ location: string;
1069
+ /** Reflected so hosts can style around the notice, and so it takes no space while hidden. */
1070
+ visible: boolean;
1071
+ private _canDismiss;
1072
+ constructor();
1073
+ updated(changed: Map<PropertyKey, unknown>): void;
1074
+ render(): TemplateResult<1> | typeof nothing;
1075
+ static styles: CSSResult;
1076
+ }
1077
+
1078
+ /**
1079
+ * How the backoffice shows the notice that tells users a response is AI-generated.
1080
+ *
1081
+ * - `Always`: always shown.
1082
+ * - `Dismissible`: shown until the user dismisses it; the dismissal is remembered per browser.
1083
+ * - `Off`: never shown.
1084
+ */
1085
+ export declare type UaiDisclosureNoticeMode = "Always" | "Dismissible" | "Off";
1086
+
1012
1087
  /**
1013
1088
  * Adapter for Umbraco document entities.
1014
1089
  */