@endge/core 1.2.13 → 2.0.1

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.
Files changed (63) hide show
  1. package/dist/core.cjs +323 -295
  2. package/dist/core.js +30689 -26344
  3. package/dist/domain/entities/reflect/RAuthProfile.d.ts +3 -3
  4. package/dist/domain/entities/runtime/ComponentSFCEventBoundary.d.ts +2 -0
  5. package/dist/domain/entities/runtime/hosts/ComponentSFCRuntimeHost.d.ts +1 -1
  6. package/dist/domain/types/auth/auth-profile.types.d.ts +93 -28
  7. package/dist/domain/types/auth/auth-runtime.types.d.ts +0 -23
  8. package/dist/domain/types/component/sfc/ast.types.d.ts +2 -0
  9. package/dist/domain/types/component/sfc/intrinsic-events.types.d.ts +6 -0
  10. package/dist/domain/types/component/sfc/ir.types.d.ts +96 -1
  11. package/dist/domain/types/component/sfc/visual-projection.types.d.ts +130 -5
  12. package/dist/domain/types/configuration/configuration.type.d.ts +13 -7
  13. package/dist/domain/types/document/domain-export.type.d.ts +1 -0
  14. package/dist/domain/types/document/query.types.d.ts +1 -1
  15. package/dist/domain/types/document/workspace.types.d.ts +1 -3
  16. package/dist/domain/types/i18n.types.d.ts +2 -0
  17. package/dist/domain/types/kernel/bootstrap.types.d.ts +1 -1
  18. package/dist/domain/types/kernel/events.types.d.ts +0 -3
  19. package/dist/domain/types/runtime/action.types.d.ts +1 -0
  20. package/dist/domain/types/runtime/context-persistence.types.d.ts +1 -0
  21. package/dist/domain/types/source/source-engine.types.d.ts +26 -1
  22. package/dist/domain/types/source/stream-source.types.d.ts +2 -1
  23. package/dist/main.d.ts +4 -0
  24. package/dist/model/config/kernel.config.d.ts +0 -1
  25. package/dist/model/config/sfc-editing.config.d.ts +3 -0
  26. package/dist/model/config/ui-composition.config.d.ts +10 -10
  27. package/dist/model/kernel/endge.d.ts +0 -5
  28. package/dist/model/modules/context/endge-vars.d.ts +4 -2
  29. package/dist/model/modules/context/endge-workspace.d.ts +1 -3
  30. package/dist/model/modules/context/persistence/RuntimeStateController.d.ts +7 -4
  31. package/dist/model/modules/domain/endge-domain.d.ts +6 -0
  32. package/dist/model/modules/program/endge-source.d.ts +3 -1
  33. package/dist/model/modules/runtime/execution/computation/ComputationResourceRegistry.d.ts +2 -0
  34. package/dist/model/modules/security/auth/AuthInteractionRequiredError.d.ts +6 -0
  35. package/dist/model/modules/security/auth/AuthProfileRegistry.d.ts +4 -4
  36. package/dist/model/modules/security/auth/AuthRequestResolver.d.ts +6 -1
  37. package/dist/model/modules/security/auth/AuthSessionManager.d.ts +2 -6
  38. package/dist/model/modules/security/auth/adapters/BasicAuthAdapter.d.ts +10 -0
  39. package/dist/model/modules/security/auth/adapters/BearerAuthAdapter.d.ts +1 -1
  40. package/dist/model/modules/security/auth/adapters/OAuth2ClientCredentialsAuthAdapter.d.ts +8 -0
  41. package/dist/model/modules/security/auth/adapters/OAuth2PasswordAuthAdapter.d.ts +11 -0
  42. package/dist/model/modules/security/auth/adapters/OidcAuthAdapter.d.ts +8 -0
  43. package/dist/model/modules/security/endge-auth.d.ts +12 -2
  44. package/dist/model/services/auth/OidcBrowserSession_Service.d.ts +26 -0
  45. package/dist/model/services/compiler/component-sfc/component-sfc-compile.d.ts +3 -0
  46. package/dist/model/services/compiler/component-sfc/component-sfc-interactions.d.ts +12 -0
  47. package/dist/model/services/compiler/component-sfc/component-sfc-template.d.ts +3 -0
  48. package/dist/model/services/i18n/composition-i18n-catalog-projection.d.ts +19 -0
  49. package/dist/model/services/i18n/i18n-catalog.d.ts +3 -1
  50. package/dist/model/services/source-engine/component-sfc/component-sfc-table-source-patch.d.ts +2 -2
  51. package/dist/model/services/source-engine/composition-source-i18n-hints.d.ts +5 -0
  52. package/dist/model/services/source-engine/strategies/CompositionSourceLanguageStrategy.d.ts +1 -0
  53. package/dist/test/component-sfc-interactions.bench.d.ts +1 -0
  54. package/dist/test/component-sfc-interactions.test.d.ts +1 -0
  55. package/dist/test/security/auth-profile-serializer.test.d.ts +1 -0
  56. package/dist/test/security/auth-test-helpers.d.ts +0 -1
  57. package/dist/test/security/oidc-browser-session.test.d.ts +1 -0
  58. package/dist/test/tools/component-sfc-edit-trigger.test.d.ts +1 -0
  59. package/dist/tools/component-sfc-edit-trigger.d.ts +11 -0
  60. package/package.json +6 -4
  61. package/dist/model/modules/runtime/input/endge-sse.d.ts +0 -46
  62. package/dist/model/modules/security/auth/adapters/KeycloakAuthAdapter.d.ts +0 -25
  63. package/dist/model/services/auth/KeycloakAuthClient.d.ts +0 -21
@@ -1,12 +1,12 @@
1
- import { AuthProfileAdapterId, AuthProfileConfig, AuthProfileCredentialRefs, AuthProfilePersist } from '../../types/auth/auth-profile.types';
1
+ import { AuthProfileAdapterId, AuthProfileConfig, AuthProfileCredentials, AuthSessionPolicy } from '../../types/auth/auth-profile.types';
2
2
  import { DuplicateOptions, REntity } from './REntity';
3
3
  export declare class RAuthProfile extends REntity {
4
4
  displayName: string;
5
5
  description: string | null;
6
6
  adapterId: AuthProfileAdapterId;
7
7
  config: AuthProfileConfig;
8
- credentialRefs: AuthProfileCredentialRefs;
9
- persist: AuthProfilePersist;
8
+ credentials: AuthProfileCredentials;
9
+ session: AuthSessionPolicy | undefined;
10
10
  active: boolean;
11
11
  static fromPlain(raw: any): RAuthProfile;
12
12
  toPlain(): Record<string, unknown>;
@@ -21,6 +21,8 @@ export declare class ComponentSFCEventBoundary {
21
21
  } | null): ComponentSFCEventBoundary;
22
22
  /** True when the current public manifest observes one Event of this child source. */
23
23
  observesChild(source: ComponentSFCEventRuntimeSource, event: string): boolean;
24
+ /** Claims a mount-scoped logical `.once` rule after it has matched. */
25
+ claimLocalOnce(key: string): boolean;
24
26
  /** Runs local `@event` reactions, then routes the occurrence unless `.stop` is present. */
25
27
  routeChild(source: ComponentSFCEventRuntimeSource, event: string, payload: unknown, bindings?: readonly RComponentSFC_IR_EventBinding[], trace?: string[], depth?: number, scope?: Record<string, unknown>): Promise<void>;
26
28
  /** Receives an intrinsic or nested child occurrence and resolves public ports by origin. */
@@ -81,7 +81,7 @@ export declare class ComponentSFCRuntimeHost extends RuntimeHostBase<'component-
81
81
  /** Emits an own/public Event through the root Component SFC boundary. */
82
82
  emitEventPort(name: string, payload: unknown, source?: ComponentSFCEventRuntimeSource): Promise<void>;
83
83
  /** Executes one compiler-linked Event reaction for a renderer boundary. */
84
- executeEventPortAction(ownerIdentity: string, port: ComponentSFCEventPort, payload: unknown, source: ComponentSFCEventRuntimeSource | undefined, emitOwn: (name: string, payload: unknown, trace: string[], depth: number) => Promise<void>, trace?: string[], depth?: number, scope?: Record<string, unknown>): Promise<void>;
84
+ executeEventPortAction(ownerIdentity: string, port: ComponentSFCEventPort, payload: unknown, source: ComponentSFCEventRuntimeSource | undefined, emitOwn: (name: string, payload: unknown, trace: string[], depth: number) => Promise<void>, trace?: string[], depth?: number, scope?: Record<string, unknown>): Promise<boolean>;
85
85
  /** Publishes an already routed root Event without using the global Endge.events bus. */
86
86
  publishEventPort(name: string, payload: unknown, source?: ComponentSFCEventRuntimeSource): void;
87
87
  /** Возвращает активную host-owned edit-сессию конкретного renderer consumer. */
@@ -1,12 +1,81 @@
1
- export type AuthProfileAdapterId = 'keycloak' | 'bearer' | (string & {});
2
- export type AuthProfilePersist = 'localStorage' | 'sessionStorage' | 'memory';
3
- export type AuthLoginMode = 'interactive' | 'service';
1
+ export type AuthProfileAdapterId = 'oidc' | 'oauth2-client-credentials' | 'oauth2-password' | 'basic' | 'bearer' | (string & {});
2
+ export type AuthSessionStorage = 'localStorage' | 'sessionStorage' | 'memory';
3
+ export interface AuthSessionPolicy {
4
+ storage: AuthSessionStorage;
5
+ persistRefreshToken: boolean;
6
+ }
4
7
  export interface AuthProfileConfig {
5
8
  [key: string]: unknown;
6
9
  }
7
- export interface AuthProfileCredentialRefs {
8
- [key: string]: string | undefined;
10
+ export interface AuthProfileCredentials {
11
+ [key: string]: string;
9
12
  }
13
+ /** Persisted discriminated contract of the built-in adapters. */
14
+ export interface AuthProfileBase {
15
+ id: string;
16
+ identity: string;
17
+ name: string;
18
+ description?: string;
19
+ active: boolean;
20
+ adapterId: string;
21
+ config: Record<string, unknown>;
22
+ credentials: Record<string, string>;
23
+ }
24
+ export interface OidcAuthProfile extends AuthProfileBase {
25
+ adapterId: 'oidc';
26
+ config: {
27
+ issuer: string;
28
+ clientId: string;
29
+ scopes: string[];
30
+ };
31
+ credentials: Record<string, never>;
32
+ session: AuthSessionPolicy;
33
+ }
34
+ export interface OAuth2ClientCredentialsProfile extends AuthProfileBase {
35
+ adapterId: 'oauth2-client-credentials';
36
+ config: {
37
+ tokenEndpoint: string;
38
+ clientId: string;
39
+ scopes: string[];
40
+ clientAuthentication: 'client_secret_basic' | 'client_secret_post';
41
+ };
42
+ credentials: {
43
+ clientSecret: string;
44
+ };
45
+ session: AuthSessionPolicy;
46
+ }
47
+ export interface OAuth2PasswordProfile extends AuthProfileBase {
48
+ adapterId: 'oauth2-password';
49
+ config: {
50
+ tokenEndpoint: string;
51
+ clientId: string;
52
+ scopes: string[];
53
+ };
54
+ credentials: {
55
+ username: string;
56
+ password: string;
57
+ };
58
+ session: AuthSessionPolicy;
59
+ }
60
+ export interface BasicAuthProfile extends AuthProfileBase {
61
+ adapterId: 'basic';
62
+ config: Record<string, never>;
63
+ credentials: {
64
+ username: string;
65
+ password: string;
66
+ };
67
+ session?: never;
68
+ }
69
+ export interface BearerAuthProfile extends AuthProfileBase {
70
+ adapterId: 'bearer';
71
+ config: Record<string, never>;
72
+ credentials: {
73
+ token: string;
74
+ };
75
+ session?: never;
76
+ }
77
+ export type AuthProfile = OidcAuthProfile | OAuth2ClientCredentialsProfile | OAuth2PasswordProfile | BasicAuthProfile | BearerAuthProfile;
78
+ /** Runtime projection also accepts structurally validated registry extensions and legacy numeric IDs. */
10
79
  export interface AuthProfileSchema {
11
80
  id: string | number;
12
81
  identity: string;
@@ -15,8 +84,8 @@ export interface AuthProfileSchema {
15
84
  description?: string | null;
16
85
  adapterId: AuthProfileAdapterId;
17
86
  config: AuthProfileConfig;
18
- credentialRefs: AuthProfileCredentialRefs;
19
- persist: AuthProfilePersist;
87
+ credentials: AuthProfileCredentials;
88
+ session?: AuthSessionPolicy;
20
89
  folderId?: string | number | null;
21
90
  active: boolean;
22
91
  deletedAt?: string | null;
@@ -29,6 +98,7 @@ export interface AuthTokenSet {
29
98
  sessionState?: string;
30
99
  accessExpiresAt: number | null;
31
100
  refreshExpiresAt?: number | null;
101
+ headers?: Record<string, string>;
32
102
  }
33
103
  export interface AuthResolvedSession {
34
104
  profileIdentity: string | null;
@@ -44,25 +114,19 @@ export type AuthRequestPolicy = {
44
114
  mode: 'inherit';
45
115
  } | {
46
116
  mode: 'profile';
47
- profileIdentity: string;
117
+ profile: string;
48
118
  };
49
119
  export interface AuthResolveOptions {
50
120
  forceRefresh?: boolean;
51
121
  }
52
- export interface AuthLoginCredentials {
53
- username: string;
54
- password: string;
55
- }
56
122
  export interface AuthEnsureOptions {
57
123
  forceRefresh?: boolean;
58
- /** Запрещает первичный auto-login service-профиля, сохраняя restore и refresh. */
59
- allowServiceLogin?: boolean;
60
124
  }
61
125
  export interface AuthSessionSourceResolveOptions {
62
126
  forceRefresh: boolean;
63
127
  minValiditySeconds: number;
64
128
  }
65
- /** Host-owned источник session для внешнего Authorization Code/PKCE flow. */
129
+ /** Host-owned источник session для внешнего Authorization Code + PKCE flow. */
66
130
  export interface AuthSessionSource {
67
131
  resolveToken: (options: AuthSessionSourceResolveOptions) => Promise<AuthTokenSet | null>;
68
132
  logout?: () => Promise<void>;
@@ -75,23 +139,15 @@ export interface EndgeAuthContext {
75
139
  sessionId?: string;
76
140
  profileIdentity?: string;
77
141
  }
78
- export interface AuthCredentialResolveInput {
79
- ref: string;
80
- profileIdentity: string;
81
- credential: string;
82
- signal?: AbortSignal;
83
- }
84
- export type EndgeAuthCredentialResolver = (input: AuthCredentialResolveInput) => string | undefined | Promise<string | undefined>;
85
142
  export interface EndgeAuthBootOptions {
86
- resolveCredential?: EndgeAuthCredentialResolver;
87
- /** Host-owned namespace isolates persisted sessions of identical Workspaces across backends. */
143
+ /** Host-owned namespace isolates sessions одинаковых Workspaces across backends. */
88
144
  storageNamespace?: string;
89
145
  }
90
146
  export interface AuthAdapterContext {
91
147
  profile: AuthProfileSchema;
92
- credentials?: Record<string, string>;
93
148
  token?: AuthTokenSet;
94
149
  signal?: AbortSignal;
150
+ resolveValue: (value: unknown) => string;
95
151
  resolveCredential: (credential: string) => Promise<string>;
96
152
  }
97
153
  /** Контракт расширяемого auth adapter. Storage и application state остаются в EndgeAuth. */
@@ -104,9 +160,6 @@ export interface AuthProfileAdapter {
104
160
  logout?(context: AuthAdapterContext): Promise<void>;
105
161
  loadUserInfo?(context: AuthAdapterContext): Promise<Record<string, unknown> | null>;
106
162
  }
107
- export interface AuthProfileTestOptions {
108
- credentials?: Record<string, string>;
109
- }
110
163
  export interface AuthProfileTestResult {
111
164
  authenticated: boolean;
112
165
  profileIdentity: string;
@@ -114,3 +167,15 @@ export interface AuthProfileTestResult {
114
167
  context: EndgeAuthContext;
115
168
  userInfo: Record<string, unknown> | null;
116
169
  }
170
+ export interface OidcBrowserSessionOptions {
171
+ issuer: string;
172
+ clientId: string;
173
+ scopes: string[];
174
+ redirectUri: string;
175
+ popupRedirectUri?: string;
176
+ postLogoutRedirectUri?: string;
177
+ session: AuthSessionPolicy;
178
+ storageNamespace: string;
179
+ profileIdentity: string;
180
+ flow: 'popup' | 'redirect';
181
+ }
@@ -10,26 +10,3 @@ export interface AuthSessionState {
10
10
  token: AuthTokenSet;
11
11
  userInfo: Record<string, unknown> | null;
12
12
  }
13
- export interface KeycloakTokenResponse {
14
- access_token: string;
15
- expires_in?: number;
16
- refresh_expires_in?: number;
17
- refresh_token?: string;
18
- token_type?: string;
19
- id_token?: string;
20
- session_state?: string;
21
- scope?: string;
22
- }
23
- export interface KeycloakTransportConfig {
24
- baseUrl: string;
25
- tokenPath: string;
26
- logoutPath: string;
27
- userinfoPath: string;
28
- }
29
- export interface KeycloakAuthTransport {
30
- passwordGrant(payload: Record<string, string>, signal?: AbortSignal): Promise<KeycloakTokenResponse>;
31
- refreshGrant(payload: Record<string, string>, signal?: AbortSignal): Promise<KeycloakTokenResponse>;
32
- logout(payload: Record<string, string>, signal?: AbortSignal): Promise<void>;
33
- getUserInfo(accessToken: string, signal?: AbortSignal): Promise<Record<string, unknown>>;
34
- }
35
- export type KeycloakAuthTransportFactory = (config: KeycloakTransportConfig) => KeycloakAuthTransport;
@@ -115,6 +115,8 @@ export interface RComponentSFC_AST_Attribute {
115
115
  value: string | null;
116
116
  /** Флаг динамического binding через :name. */
117
117
  dynamic: boolean;
118
+ /** Static modifiers of a dynamic binding, for example `:on.stop.capture`. */
119
+ modifiers: string[];
118
120
  /** Позиция атрибута в полном source. */
119
121
  range: RComponentSFC_SourceRange;
120
122
  }
@@ -1,6 +1,7 @@
1
1
  import { RComponentSFC_IR_Tag } from './ir.types';
2
2
  export interface ComponentSFCEventModifiersState {
3
3
  alt: boolean;
4
+ altGraph: boolean;
4
5
  ctrl: boolean;
5
6
  meta: boolean;
6
7
  shift: boolean;
@@ -8,6 +9,10 @@ export interface ComponentSFCEventModifiersState {
8
9
  export interface ComponentSFCInteractionEventPayload {
9
10
  type: string;
10
11
  modifiers: ComponentSFCEventModifiersState;
12
+ held: {
13
+ key: string[];
14
+ code: string[];
15
+ };
11
16
  }
12
17
  export interface ComponentSFCPointerEventPayload extends ComponentSFCInteractionEventPayload {
13
18
  x: number;
@@ -20,6 +25,7 @@ export interface ComponentSFCKeyboardEventPayload extends ComponentSFCInteractio
20
25
  key: string;
21
26
  code: string;
22
27
  repeat: boolean;
28
+ composing: boolean;
23
29
  }
24
30
  export interface ComponentSFCInputEventPayload extends ComponentSFCInteractionEventPayload {
25
31
  value: unknown;
@@ -59,18 +59,88 @@ export interface ComponentSFCVariant {
59
59
  nodeId: string;
60
60
  }
61
61
  /** Декларативный триггер входа в edit-вариант. */
62
- export interface ComponentSFCEditTrigger {
62
+ export interface ComponentSFCInteractionTriggerModifiers {
63
+ /** Физическая клавиша Control на любой платформе. */
64
+ ctrl?: boolean;
65
+ /** Физическая клавиша Shift. */
66
+ shift?: boolean;
67
+ /** Физическая клавиша Alt/Option. */
68
+ alt?: boolean;
69
+ /** Физическая клавиша Meta: Command на macOS, Windows/Super на других платформах. */
70
+ meta?: boolean;
71
+ /** Основной shortcut modifier: Command на macOS, Control на Windows/Linux. */
72
+ mod?: boolean;
73
+ /** AltGraph, когда браузер предоставляет его через getModifierState(). */
74
+ altGraph?: boolean;
75
+ /** Запрещает дополнительные физические ctrl/shift/alt/meta modifiers. */
76
+ exact?: boolean;
77
+ }
78
+ /** Обычные немодификаторные клавиши, удерживаемые во время trigger event. */
79
+ export interface ComponentSFCInteractionTriggerHeldKeys {
80
+ /** Логические KeyboardEvent.key с учётом раскладки. */
81
+ key?: string[];
82
+ /** Физические KeyboardEvent.code без зависимости от раскладки. */
83
+ code?: string[];
84
+ /** all требует все перечисленные клавиши, any — хотя бы одну. */
85
+ match?: 'all' | 'any';
86
+ /** Запрещает другие удерживаемые обычные клавиши. */
87
+ exact?: boolean;
88
+ }
89
+ export interface ComponentSFCInteractionTrigger {
63
90
  event: string;
64
91
  key?: string[];
92
+ code?: string[];
93
+ held?: ComponentSFCInteractionTriggerHeldKeys;
94
+ modifiers?: ComponentSFCInteractionTriggerModifiers;
95
+ repeat?: boolean;
96
+ composing?: boolean;
65
97
  button?: number;
66
98
  stop?: boolean;
67
99
  prevent?: boolean;
68
100
  self?: boolean;
101
+ once?: boolean;
102
+ capture?: boolean;
103
+ passive?: boolean;
69
104
  }
105
+ export type ComponentSFCInteractionTriggerPlatform = 'macos' | 'windows' | 'linux' | 'unknown';
106
+ /** Renderer-neutral snapshot нативного события для проверки edit trigger. */
107
+ export interface ComponentSFCInteractionTriggerEvent {
108
+ key?: string;
109
+ code?: string;
110
+ repeat?: boolean;
111
+ composing?: boolean;
112
+ button?: number;
113
+ targetIsCurrentTarget: boolean;
114
+ held?: {
115
+ key: string[];
116
+ code: string[];
117
+ };
118
+ modifiers: {
119
+ ctrl: boolean;
120
+ shift: boolean;
121
+ alt: boolean;
122
+ meta: boolean;
123
+ altGraph: boolean;
124
+ };
125
+ }
126
+ /** Backward-compatible editable names for the shared interaction contract. */
127
+ export type ComponentSFCEditTriggerModifiers = ComponentSFCInteractionTriggerModifiers;
128
+ export type ComponentSFCEditTriggerHeldKeys = ComponentSFCInteractionTriggerHeldKeys;
129
+ export type ComponentSFCEditTrigger = ComponentSFCInteractionTrigger;
130
+ export type ComponentSFCEditTriggerPlatform = ComponentSFCInteractionTriggerPlatform;
131
+ export type ComponentSFCEditTriggerEvent = ComponentSFCInteractionTriggerEvent;
70
132
  /** Renderer-neutral поведение редактируемого template-узла. */
71
133
  export interface ComponentSFCEditableBehavior {
72
134
  value: RComponentSFC_IR_Value;
73
135
  triggers: RComponentSFC_IR_Value;
136
+ /** Triggers that discard the active draft. Defaults to Escape and focus leaving Editable. */
137
+ cancelTriggers: RComponentSFC_IR_Value;
138
+ /** Triggers that commit the active draft. Defaults to Enter. */
139
+ commitTriggers: RComponentSFC_IR_Value;
140
+ /** Static suffix modifiers declared on `:edit-on`. */
141
+ modifiers?: RComponentSFC_IR_EventModifier[];
142
+ cancelModifiers?: RComponentSFC_IR_EventModifier[];
143
+ commitModifiers?: RComponentSFC_IR_EventModifier[];
74
144
  }
75
145
  /** Нормализованное публичное событие завершённого редактирования. */
76
146
  export interface ComponentSFCEditedEventPayload<T = unknown> {
@@ -97,6 +167,8 @@ export interface RComponentSFC_IR_ElementNode {
97
167
  directives: RComponentSFC_IR_Directives;
98
168
  /** Local renderer Event reactions declared through `@event` attributes. */
99
169
  events?: RComponentSFC_IR_EventBinding[];
170
+ /** Conditional local reactions declared through the renderer-neutral `:on` annotation. */
171
+ interactions?: RComponentSFC_IR_InteractionGroup[];
100
172
  /** Compiler-owned edit behavior; editable/edit-on не передаются visual adapter-у как props. */
101
173
  editable?: ComponentSFCEditableBehavior;
102
174
  /** Дочерние IR-узлы. */
@@ -149,6 +221,29 @@ export interface RComponentSFC_IR_EventBinding {
149
221
  name: string;
150
222
  modifiers: RComponentSFC_IR_EventModifier[];
151
223
  action: ComponentSFCEventAction;
224
+ /** Ordered reactions. `action` remains as a compatibility view of the first item. */
225
+ actions?: ComponentSFCEventAction[];
226
+ sourceRange?: RComponentSFC_SourceRange;
227
+ }
228
+ export interface RComponentSFC_IR_InteractionRule {
229
+ /** Static event name required to install the adapter listener. */
230
+ event: string;
231
+ /** Runtime-evaluated trigger descriptor without `reaction`. */
232
+ trigger: RComponentSFC_IR_Value;
233
+ /** Suffix modifiers applied to this rule after evaluating `trigger`. */
234
+ modifiers: RComponentSFC_IR_EventModifier[];
235
+ /** Listener options known at compile time. */
236
+ listener: {
237
+ capture: boolean;
238
+ passive: boolean;
239
+ };
240
+ /** Reactions executed sequentially in Source order. */
241
+ reactions: ComponentSFCEventAction[];
242
+ sourceRange?: RComponentSFC_SourceRange;
243
+ }
244
+ /** One `:on` annotation. Rules inside the group use first-match-wins semantics. */
245
+ export interface RComponentSFC_IR_InteractionGroup {
246
+ rules: RComponentSFC_IR_InteractionRule[];
152
247
  sourceRange?: RComponentSFC_SourceRange;
153
248
  }
154
249
  /** IR текстовый узел. */
@@ -1,5 +1,6 @@
1
1
  import { RComponentDiagnostic } from '../component-core.types';
2
2
  import { TypeSourceDefinition } from '../../source/type-source.types';
3
+ import { EndgeSFCEditingConfiguration } from '../../configuration/configuration.type';
3
4
  import { RComponentSFC_IR_Tag } from './ir.types';
4
5
  import { RComponentSFC_SourceRange } from './location.types';
5
6
  /** Значение SFC source, подготовленное для безопасного отображения в visual editor. */
@@ -21,19 +22,96 @@ export interface ComponentSFCVisualAttribute {
21
22
  }
22
23
  /** Редактируемый prop binding единственного управляемого элемента колонки Table. */
23
24
  export type ComponentSFCTableCellBindingProjection = ComponentSFCVisualAttribute;
25
+ export type ComponentSFCTableCellInteractionModifier = 'ctrl' | 'shift' | 'alt' | 'meta' | 'mod' | 'altGraph' | 'exact';
26
+ export type ComponentSFCTableCellInteractionFlag = 'stop' | 'prevent' | 'self' | 'once' | 'capture' | 'passive';
27
+ /** UI-neutral projection одного статически разбираемого trigger взаимодействия. */
28
+ export interface ComponentSFCInteractionTriggerProjection {
29
+ event: string;
30
+ key: string[];
31
+ code: string[];
32
+ held: {
33
+ key: string[];
34
+ code: string[];
35
+ match: 'all' | 'any';
36
+ exact: boolean;
37
+ } | null;
38
+ modifiers: Partial<Record<ComponentSFCTableCellInteractionModifier, boolean>>;
39
+ repeat: boolean | null;
40
+ composing: boolean | null;
41
+ button: number | null;
42
+ flags: Partial<Record<ComponentSFCTableCellInteractionFlag, boolean>>;
43
+ }
44
+ /** UI-neutral projection одного статически разбираемого правила Cell `:on`. */
45
+ export interface ComponentSFCTableCellInteractionRuleProjection extends ComponentSFCInteractionTriggerProjection {
46
+ reactionSource: string;
47
+ }
48
+ /** Source-preserving read-model взаимодействий Cell для visual editor таблицы. */
49
+ export interface ComponentSFCTableCellInteractionsProjection {
50
+ editable: boolean;
51
+ rules: ComponentSFCTableCellInteractionRuleProjection[];
52
+ suffixes: ComponentSFCTableCellInteractionFlag[];
53
+ sourceRange?: RComponentSFC_SourceRange;
54
+ message?: string;
55
+ }
56
+ /** Source-backed локальная reaction одного semantic Event. */
57
+ export interface ComponentSFCEventReactionProjection {
58
+ editable: boolean;
59
+ source: string | null;
60
+ suffixes: ComponentSFCTableCellInteractionFlag[];
61
+ sourceRange?: RComponentSFC_SourceRange;
62
+ message?: string;
63
+ }
64
+ export interface ComponentSFCEditOutcomeProjection {
65
+ editable: boolean;
66
+ triggers: ComponentSFCInteractionTriggerProjection[];
67
+ usesDefault: boolean;
68
+ suffixes: ComponentSFCTableCellInteractionFlag[];
69
+ message?: string;
70
+ }
71
+ export type ComponentSFCTableVisualCellSyntax = 'cell' | 'direct' | 'editable-default' | 'editable-edit';
72
+ export type ComponentSFCTableEditableElementProjection = {
73
+ kind: 'component';
74
+ identity: string | null;
75
+ syntax: ComponentSFCTableVisualCellSyntax;
76
+ bindings: ComponentSFCTableCellBindingProjection[];
77
+ } | {
78
+ kind: 'tag';
79
+ tag: ComponentSFCTableVisualCellTag;
80
+ syntax: ComponentSFCTableVisualCellSyntax;
81
+ bindings: ComponentSFCTableCellBindingProjection[];
82
+ } | {
83
+ kind: 'source';
84
+ };
85
+ /** Source-backed editable-поведение единственного управляемого корня ячейки Table. */
86
+ export interface ComponentSFCTableCellEditingProjection {
87
+ editable: boolean;
88
+ enabled: boolean;
89
+ mode: 'primitive' | 'custom' | 'component' | 'source' | 'unavailable';
90
+ tag: string | null;
91
+ triggers: ComponentSFCInteractionTriggerProjection[];
92
+ usesDefaultTrigger: boolean;
93
+ suffixes: ComponentSFCTableCellInteractionFlag[];
94
+ reaction: ComponentSFCEventReactionProjection;
95
+ cancel: ComponentSFCEditOutcomeProjection;
96
+ commit: ComponentSFCEditOutcomeProjection;
97
+ editor: ComponentSFCTableEditableElementProjection | null;
98
+ editorImplicit: boolean;
99
+ sourceRange?: RComponentSFC_SourceRange;
100
+ message?: string;
101
+ }
24
102
  /** Способ, которым содержимое ячейки представлено в простом visual editor. */
25
- export type ComponentSFCTableVisualCellTag = Exclude<RComponentSFC_IR_Tag, 'Component' | 'Table' | 'Column' | 'Cell' | 'ColumnMenu' | 'RowMenu' | 'MenuItem' | 'MenuSeparator'>;
103
+ export type ComponentSFCTableVisualCellTag = Exclude<RComponentSFC_IR_Tag, 'Component' | 'Table' | 'Column' | 'Cell' | 'ColumnMenu' | 'RowMenu' | 'MenuItem' | 'MenuSeparator' | 'Editable' | 'Variant'>;
26
104
  export type ComponentSFCTableCellProjection = {
27
105
  kind: 'default';
28
106
  } | {
29
107
  kind: 'component';
30
108
  identity: string | null;
31
- syntax: 'cell' | 'direct';
109
+ syntax: ComponentSFCTableVisualCellSyntax;
32
110
  bindings: ComponentSFCTableCellBindingProjection[];
33
111
  } | {
34
112
  kind: 'tag';
35
113
  tag: ComponentSFCTableVisualCellTag;
36
- syntax: 'cell' | 'direct';
114
+ syntax: ComponentSFCTableVisualCellSyntax;
37
115
  bindings: ComponentSFCTableCellBindingProjection[];
38
116
  } | {
39
117
  kind: 'source';
@@ -44,6 +122,8 @@ export interface ComponentSFCVisualInspectionOptions {
44
122
  resolveTypeDefinition?: (identity: string) => TypeSourceDefinition | null;
45
123
  /** Direct Action identities available to source-authored MenuItem bindings. */
46
124
  actionIdentities?: Iterable<string>;
125
+ /** Effective editing defaults текущего compiler context. */
126
+ sfcEditing?: EndgeSFCEditingConfiguration;
47
127
  }
48
128
  /** Visual read-model одной прямой Column внутри корневого Table. */
49
129
  export interface ComponentSFCTableColumnProjection {
@@ -58,6 +138,8 @@ export interface ComponentSFCTableColumnProjection {
58
138
  pinnable: ComponentSFCVisualSourceValue | null;
59
139
  attributes: ComponentSFCVisualAttribute[];
60
140
  cell: ComponentSFCTableCellProjection;
141
+ editing: ComponentSFCTableCellEditingProjection;
142
+ interactions: ComponentSFCTableCellInteractionsProjection;
61
143
  hasCustomCell: boolean;
62
144
  cellSource: string | null;
63
145
  sourceRange: RComponentSFC_SourceRange;
@@ -114,18 +196,61 @@ export type ComponentSFCTableSourcePatch = {
114
196
  type: 'set-column-component';
115
197
  columnIndex: number;
116
198
  identity: string | null;
117
- syntax?: 'cell' | 'direct';
199
+ syntax?: ComponentSFCTableVisualCellSyntax;
118
200
  } | {
119
201
  type: 'set-column-tag';
120
202
  columnIndex: number;
121
203
  tag: ComponentSFCTableVisualCellTag | null;
122
- syntax?: 'cell' | 'direct';
204
+ syntax?: ComponentSFCTableVisualCellSyntax;
123
205
  } | {
124
206
  type: 'set-column-cell-attribute';
125
207
  columnIndex: number;
126
208
  name: string;
127
209
  value: string | null;
128
210
  valueKind: 'expression' | 'literal';
211
+ } | {
212
+ type: 'set-column-cell-on';
213
+ columnIndex: number;
214
+ /** Complete object/array expression, or null to remove the annotation. */
215
+ value: string | null;
216
+ } | {
217
+ type: 'set-column-cell-editable';
218
+ columnIndex: number;
219
+ enabled: boolean;
220
+ } | {
221
+ type: 'set-column-cell-edit-triggers';
222
+ columnIndex: number;
223
+ /** Empty list restores the implicit click trigger and removes edit-on from Source. */
224
+ triggers: ComponentSFCInteractionTriggerProjection[];
225
+ } | {
226
+ type: 'set-column-cell-edited-reaction';
227
+ columnIndex: number;
228
+ /** Complete local reaction expression, or null to remove @edited. */
229
+ value: string | null;
230
+ } | {
231
+ type: 'set-column-cell-cancel-triggers';
232
+ columnIndex: number;
233
+ /** Null inherits effective configuration; an empty list explicitly disables automatic cancellation. */
234
+ triggers: ComponentSFCInteractionTriggerProjection[] | null;
235
+ } | {
236
+ type: 'set-column-cell-commit-triggers';
237
+ columnIndex: number;
238
+ /** Null inherits effective configuration; an empty list explicitly disables automatic commit. */
239
+ triggers: ComponentSFCInteractionTriggerProjection[] | null;
240
+ } | {
241
+ type: 'set-column-cell-editor-component';
242
+ columnIndex: number;
243
+ identity: string;
244
+ } | {
245
+ type: 'set-column-cell-editor-tag';
246
+ columnIndex: number;
247
+ tag: ComponentSFCTableVisualCellTag;
248
+ } | {
249
+ type: 'set-column-cell-editor-attribute';
250
+ columnIndex: number;
251
+ name: string;
252
+ value: string | null;
253
+ valueKind: 'expression' | 'literal';
129
254
  } | {
130
255
  type: 'set-menu-mode';
131
256
  menu: ComponentSFCTableVisualMenuKind;
@@ -1,3 +1,4 @@
1
+ import { ComponentSFCInteractionTrigger } from '../component/sfc/ir.types';
1
2
  import { DiagnosticsSeverityNumber, DiagnosticsSignal, EndgeDiagnosticsOutputConfiguration, EndgeDiagnosticsConfiguration, EndgeDiagnosticsRoute } from '../diagnostics/diagnostics.types';
2
3
  import { EndgeExecutionContext } from '../runtime/execution-context.types';
3
4
  export interface EndgeLocaleDefinition {
@@ -10,20 +11,18 @@ export interface EndgeThemeDefinition {
10
11
  identity: string;
11
12
  displayName: string;
12
13
  }
13
- export type EndgeSSEAuthMode = 'inherit' | 'profile' | 'none';
14
14
  export interface EndgeVariableDefinition {
15
15
  name: string;
16
16
  defaultValue: string;
17
17
  }
18
- export interface EndgeSSEConfiguration {
19
- url: string;
20
- authMode?: EndgeSSEAuthMode;
21
- authProfileIdentity?: string | null;
18
+ /** Effective defaults завершения одной SFC edit session. */
19
+ export interface EndgeSFCEditingConfiguration {
20
+ cancelOn: ComponentSFCInteractionTrigger[];
21
+ commitOn: ComponentSFCInteractionTrigger[];
22
22
  }
23
23
  /** Полная конфигурация, с которой компилируется один Endge context. */
24
24
  export interface EndgeConfiguration {
25
25
  vars: EndgeVariableDefinition[];
26
- sse?: EndgeSSEConfiguration;
27
26
  locales: EndgeLocaleDefinition[];
28
27
  defaultLocale: string;
29
28
  fallbackLocale: string;
@@ -32,6 +31,8 @@ export interface EndgeConfiguration {
32
31
  defaultAuthProfileIdentity: string | null;
33
32
  sfcAdapterIds: string[];
34
33
  defaultSfcAdapterId: string;
34
+ /** Effective triggers, которые наследуют editable-узлы без локальных атрибутов. */
35
+ sfcEditing: EndgeSFCEditingConfiguration;
35
36
  /** Настройки telemetry, output adapters, routing и snapshots. */
36
37
  diagnostics: EndgeDiagnosticsConfiguration;
37
38
  }
@@ -41,6 +42,11 @@ export type EndgeValueOverride<T> = {
41
42
  } | {
42
43
  op: 'remove';
43
44
  };
45
+ /** Независимые override-операции SFC editing для одного configuration layer. */
46
+ export interface EndgeSFCEditingConfigurationPatch {
47
+ cancelOn?: EndgeValueOverride<ComponentSFCInteractionTrigger[]>;
48
+ commitOn?: EndgeValueOverride<ComponentSFCInteractionTrigger[]>;
49
+ }
44
50
  export type EndgeCollectionPatchEntry<T> = {
45
51
  key: string;
46
52
  op: 'upsert';
@@ -55,7 +61,6 @@ export interface EndgeCollectionPatch<T> {
55
61
  /** Локальные операции inherit-слоя. Отсутствующее поле наследуется без изменений. */
56
62
  export interface EndgeConfigurationPatch {
57
63
  vars?: EndgeCollectionPatch<EndgeVariableDefinition>;
58
- sse?: EndgeValueOverride<EndgeSSEConfiguration>;
59
64
  locales?: EndgeCollectionPatch<EndgeLocaleDefinition>;
60
65
  defaultLocale?: EndgeValueOverride<string>;
61
66
  fallbackLocale?: EndgeValueOverride<string>;
@@ -64,6 +69,7 @@ export interface EndgeConfigurationPatch {
64
69
  defaultAuthProfileIdentity?: EndgeValueOverride<string>;
65
70
  sfcAdapterIds?: EndgeCollectionPatch<string>;
66
71
  defaultSfcAdapterId?: EndgeValueOverride<string>;
72
+ sfcEditing?: EndgeSFCEditingConfigurationPatch;
67
73
  /** Локальный contribution diagnostics для текущего configuration layer. */
68
74
  diagnostics?: EndgeDiagnosticsConfigurationPatch;
69
75
  }