@endge/core 1.2.12 → 2.0.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/dist/core.cjs +337 -325
- package/dist/core.js +37069 -33113
- package/dist/domain/entities/reflect/RAuthProfile.d.ts +3 -3
- package/dist/domain/entities/runtime/ComponentSFCEventBoundary.d.ts +2 -0
- package/dist/domain/entities/runtime/hosts/ComponentSFCRuntimeHost.d.ts +3 -2
- package/dist/domain/entities/runtime/hosts/CompositionRuntimeHost.d.ts +4 -0
- package/dist/domain/types/auth/auth-profile.types.d.ts +88 -26
- package/dist/domain/types/auth/auth-runtime.types.d.ts +0 -23
- package/dist/domain/types/component/sfc/ast.types.d.ts +2 -0
- package/dist/domain/types/component/sfc/intrinsic-events.types.d.ts +6 -0
- package/dist/domain/types/component/sfc/ir.types.d.ts +90 -1
- package/dist/domain/types/component/sfc/table-events.types.d.ts +1 -0
- package/dist/domain/types/component/sfc/tag-attribute-contract.types.d.ts +134 -0
- package/dist/domain/types/component/sfc/visual-projection.types.d.ts +39 -2
- package/dist/domain/types/document/document-move.type.d.ts +6 -0
- package/dist/domain/types/document/domain-export.type.d.ts +1 -0
- package/dist/domain/types/document/domain-provider.type.d.ts +24 -0
- package/dist/domain/types/kernel/bootstrap.types.d.ts +1 -1
- package/dist/domain/types/program/program.types.d.ts +4 -0
- package/dist/domain/types/runtime/runtime-host.types.d.ts +23 -1
- package/dist/domain/types/source/composition-source.types.d.ts +6 -0
- package/dist/domain/types/source/data-view-source.types.d.ts +12 -0
- package/dist/domain/types/source/filter-source.types.d.ts +2 -0
- package/dist/domain/types/source/source-expression.types.d.ts +3 -0
- package/dist/domain/types/source/store-source.types.d.ts +1 -0
- package/dist/domain/types/ui/filter-view.type.d.ts +13 -0
- package/dist/main.d.ts +6 -0
- package/dist/model/modules/domain/endge-domain-repository.d.ts +3 -0
- package/dist/model/modules/domain/endge-domain.d.ts +2 -0
- package/dist/model/modules/runtime/execution/endge-data-view.d.ts +8 -6
- package/dist/model/modules/security/auth/AuthInteractionRequiredError.d.ts +6 -0
- package/dist/model/modules/security/auth/AuthProfileRegistry.d.ts +4 -4
- package/dist/model/modules/security/auth/AuthRequestResolver.d.ts +7 -2
- package/dist/model/modules/security/auth/AuthSessionManager.d.ts +19 -21
- package/dist/model/modules/security/auth/adapters/BasicAuthAdapter.d.ts +10 -0
- package/dist/model/modules/security/auth/adapters/BearerAuthAdapter.d.ts +1 -1
- package/dist/model/modules/security/auth/adapters/OAuth2ClientCredentialsAuthAdapter.d.ts +8 -0
- package/dist/model/modules/security/auth/adapters/OidcAuthAdapter.d.ts +8 -0
- package/dist/model/modules/security/endge-auth.d.ts +14 -4
- package/dist/model/services/auth/OidcBrowserSession_Service.d.ts +26 -0
- package/dist/model/services/compiler/component-sfc/component-sfc-attributes.d.ts +9 -0
- package/dist/model/services/compiler/component-sfc/component-sfc-interactions.d.ts +12 -0
- package/dist/model/services/compiler/component-sfc/component-sfc-table-menu.d.ts +5 -0
- package/dist/test/component-sfc-interactions.bench.d.ts +1 -0
- package/dist/test/component-sfc-interactions.test.d.ts +1 -0
- package/dist/test/security/auth-profile-serializer.test.d.ts +1 -0
- package/dist/test/security/auth-test-helpers.d.ts +0 -1
- package/dist/test/security/oidc-browser-session.test.d.ts +1 -0
- package/dist/test/tools/component-sfc-edit-trigger.test.d.ts +1 -0
- package/dist/tools/component-sfc-edit-trigger.d.ts +11 -0
- package/package.json +6 -4
- package/dist/model/modules/security/auth/adapters/KeycloakAuthAdapter.d.ts +0 -25
- package/dist/model/services/auth/KeycloakAuthClient.d.ts +0 -21
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AuthProfileAdapterId, AuthProfileConfig,
|
|
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
|
-
|
|
9
|
-
|
|
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<
|
|
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. */
|
|
@@ -132,8 +132,9 @@ export declare class ComponentSFCRuntimeHost extends RuntimeHostBase<'component-
|
|
|
132
132
|
private _makeBoundaryPatch;
|
|
133
133
|
private _makeTableRowPatch;
|
|
134
134
|
private _makeTableColumnPatch;
|
|
135
|
+
/** Собирает все keyed события frame-а, не теряя соседние SSE-изменения. */
|
|
136
|
+
private _makeCollectionPatch;
|
|
135
137
|
private _resolveBoundarySourcePath;
|
|
136
|
-
private _extractCollectionItemIndex;
|
|
137
138
|
private _extractChangedPath;
|
|
138
139
|
private _makeColumnProjection;
|
|
139
140
|
private _makeObservedRaphPaths;
|
|
@@ -21,6 +21,7 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
|
|
|
21
21
|
private _publicationDisposers;
|
|
22
22
|
private _disposers;
|
|
23
23
|
private _bridgePaths;
|
|
24
|
+
private _bindingDerivedHandles;
|
|
24
25
|
private _dataPaths;
|
|
25
26
|
private _storeRuntimeIds;
|
|
26
27
|
private _storeProviderRuntimeIds;
|
|
@@ -126,6 +127,8 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
|
|
|
126
127
|
private _subscribeBinding;
|
|
127
128
|
private _bindingPath;
|
|
128
129
|
private _materializeBinding;
|
|
130
|
+
/** Материализует parameterized DataView binding без отдельного runtime host. */
|
|
131
|
+
private _materializeDataViewBinding;
|
|
129
132
|
/** Гарантирует, что список outputs для fromOutput(runtime) был связан до запуска runtime. */
|
|
130
133
|
private _requireResolvedOutputs;
|
|
131
134
|
/** Читает и распаковывает один именованный runtime output. */
|
|
@@ -136,6 +139,7 @@ export declare class CompositionRuntimeHost extends RuntimeHostBase<'composition
|
|
|
136
139
|
private _readRuntimeMetadata;
|
|
137
140
|
private _readExpressionSource;
|
|
138
141
|
private _collectExpressionReads;
|
|
142
|
+
private _flattenBindings;
|
|
139
143
|
private _subscribeExpressionRead;
|
|
140
144
|
private _readFilterFieldsBinding;
|
|
141
145
|
isFilterViewRuntime(runtime: RuntimeHost<any, any>): runtime is FilterViewRuntimeHost;
|
|
@@ -1,12 +1,68 @@
|
|
|
1
|
-
export type AuthProfileAdapterId = '
|
|
2
|
-
export type
|
|
3
|
-
export
|
|
1
|
+
export type AuthProfileAdapterId = 'oidc' | 'oauth2-client-credentials' | '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
|
|
8
|
-
[key: string]: string
|
|
10
|
+
export interface AuthProfileCredentials {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
}
|
|
13
|
+
/** Persisted discriminated contract of the four 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 BasicAuthProfile extends AuthProfileBase {
|
|
48
|
+
adapterId: 'basic';
|
|
49
|
+
config: Record<string, never>;
|
|
50
|
+
credentials: {
|
|
51
|
+
username: string;
|
|
52
|
+
password: string;
|
|
53
|
+
};
|
|
54
|
+
session?: never;
|
|
55
|
+
}
|
|
56
|
+
export interface BearerAuthProfile extends AuthProfileBase {
|
|
57
|
+
adapterId: 'bearer';
|
|
58
|
+
config: Record<string, never>;
|
|
59
|
+
credentials: {
|
|
60
|
+
token: string;
|
|
61
|
+
};
|
|
62
|
+
session?: never;
|
|
9
63
|
}
|
|
64
|
+
export type AuthProfile = OidcAuthProfile | OAuth2ClientCredentialsProfile | BasicAuthProfile | BearerAuthProfile;
|
|
65
|
+
/** Runtime projection also accepts structurally validated registry extensions and legacy numeric IDs. */
|
|
10
66
|
export interface AuthProfileSchema {
|
|
11
67
|
id: string | number;
|
|
12
68
|
identity: string;
|
|
@@ -15,8 +71,8 @@ export interface AuthProfileSchema {
|
|
|
15
71
|
description?: string | null;
|
|
16
72
|
adapterId: AuthProfileAdapterId;
|
|
17
73
|
config: AuthProfileConfig;
|
|
18
|
-
|
|
19
|
-
|
|
74
|
+
credentials: AuthProfileCredentials;
|
|
75
|
+
session?: AuthSessionPolicy;
|
|
20
76
|
folderId?: string | number | null;
|
|
21
77
|
active: boolean;
|
|
22
78
|
deletedAt?: string | null;
|
|
@@ -29,6 +85,7 @@ export interface AuthTokenSet {
|
|
|
29
85
|
sessionState?: string;
|
|
30
86
|
accessExpiresAt: number | null;
|
|
31
87
|
refreshExpiresAt?: number | null;
|
|
88
|
+
headers?: Record<string, string>;
|
|
32
89
|
}
|
|
33
90
|
export interface AuthResolvedSession {
|
|
34
91
|
profileIdentity: string | null;
|
|
@@ -49,14 +106,18 @@ export type AuthRequestPolicy = {
|
|
|
49
106
|
export interface AuthResolveOptions {
|
|
50
107
|
forceRefresh?: boolean;
|
|
51
108
|
}
|
|
52
|
-
export interface AuthLoginCredentials {
|
|
53
|
-
username: string;
|
|
54
|
-
password: string;
|
|
55
|
-
}
|
|
56
109
|
export interface AuthEnsureOptions {
|
|
57
110
|
forceRefresh?: boolean;
|
|
58
|
-
|
|
59
|
-
|
|
111
|
+
}
|
|
112
|
+
export interface AuthSessionSourceResolveOptions {
|
|
113
|
+
forceRefresh: boolean;
|
|
114
|
+
minValiditySeconds: number;
|
|
115
|
+
}
|
|
116
|
+
/** Host-owned источник session для внешнего Authorization Code + PKCE flow. */
|
|
117
|
+
export interface AuthSessionSource {
|
|
118
|
+
resolveToken: (options: AuthSessionSourceResolveOptions) => Promise<AuthTokenSet | null>;
|
|
119
|
+
logout?: () => Promise<void>;
|
|
120
|
+
loadUserInfo?: () => Promise<Record<string, unknown> | null>;
|
|
60
121
|
}
|
|
61
122
|
/** Минимальный синхронный auth context без tokens и полного claims payload. */
|
|
62
123
|
export interface EndgeAuthContext {
|
|
@@ -65,23 +126,15 @@ export interface EndgeAuthContext {
|
|
|
65
126
|
sessionId?: string;
|
|
66
127
|
profileIdentity?: string;
|
|
67
128
|
}
|
|
68
|
-
export interface AuthCredentialResolveInput {
|
|
69
|
-
ref: string;
|
|
70
|
-
profileIdentity: string;
|
|
71
|
-
credential: string;
|
|
72
|
-
signal?: AbortSignal;
|
|
73
|
-
}
|
|
74
|
-
export type EndgeAuthCredentialResolver = (input: AuthCredentialResolveInput) => string | undefined | Promise<string | undefined>;
|
|
75
129
|
export interface EndgeAuthBootOptions {
|
|
76
|
-
|
|
77
|
-
/** Host-owned namespace isolates persisted sessions of identical Workspaces across backends. */
|
|
130
|
+
/** Host-owned namespace isolates sessions одинаковых Workspaces across backends. */
|
|
78
131
|
storageNamespace?: string;
|
|
79
132
|
}
|
|
80
133
|
export interface AuthAdapterContext {
|
|
81
134
|
profile: AuthProfileSchema;
|
|
82
|
-
credentials?: Record<string, string>;
|
|
83
135
|
token?: AuthTokenSet;
|
|
84
136
|
signal?: AbortSignal;
|
|
137
|
+
resolveValue: (value: unknown) => string;
|
|
85
138
|
resolveCredential: (credential: string) => Promise<string>;
|
|
86
139
|
}
|
|
87
140
|
/** Контракт расширяемого auth adapter. Storage и application state остаются в EndgeAuth. */
|
|
@@ -94,9 +147,6 @@ export interface AuthProfileAdapter {
|
|
|
94
147
|
logout?(context: AuthAdapterContext): Promise<void>;
|
|
95
148
|
loadUserInfo?(context: AuthAdapterContext): Promise<Record<string, unknown> | null>;
|
|
96
149
|
}
|
|
97
|
-
export interface AuthProfileTestOptions {
|
|
98
|
-
credentials?: Record<string, string>;
|
|
99
|
-
}
|
|
100
150
|
export interface AuthProfileTestResult {
|
|
101
151
|
authenticated: boolean;
|
|
102
152
|
profileIdentity: string;
|
|
@@ -104,3 +154,15 @@ export interface AuthProfileTestResult {
|
|
|
104
154
|
context: EndgeAuthContext;
|
|
105
155
|
userInfo: Record<string, unknown> | null;
|
|
106
156
|
}
|
|
157
|
+
export interface OidcBrowserSessionOptions {
|
|
158
|
+
issuer: string;
|
|
159
|
+
clientId: string;
|
|
160
|
+
scopes: string[];
|
|
161
|
+
redirectUri: string;
|
|
162
|
+
popupRedirectUri?: string;
|
|
163
|
+
postLogoutRedirectUri?: string;
|
|
164
|
+
session: AuthSessionPolicy;
|
|
165
|
+
storageNamespace: string;
|
|
166
|
+
profileIdentity: string;
|
|
167
|
+
flow: 'popup' | 'redirect';
|
|
168
|
+
}
|
|
@@ -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,82 @@ export interface ComponentSFCVariant {
|
|
|
59
59
|
nodeId: string;
|
|
60
60
|
}
|
|
61
61
|
/** Декларативный триггер входа в edit-вариант. */
|
|
62
|
-
export interface
|
|
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
|
+
/** Static suffix modifiers declared on `:edit-on`. */
|
|
137
|
+
modifiers?: RComponentSFC_IR_EventModifier[];
|
|
74
138
|
}
|
|
75
139
|
/** Нормализованное публичное событие завершённого редактирования. */
|
|
76
140
|
export interface ComponentSFCEditedEventPayload<T = unknown> {
|
|
@@ -97,6 +161,8 @@ export interface RComponentSFC_IR_ElementNode {
|
|
|
97
161
|
directives: RComponentSFC_IR_Directives;
|
|
98
162
|
/** Local renderer Event reactions declared through `@event` attributes. */
|
|
99
163
|
events?: RComponentSFC_IR_EventBinding[];
|
|
164
|
+
/** Conditional local reactions declared through the renderer-neutral `:on` annotation. */
|
|
165
|
+
interactions?: RComponentSFC_IR_InteractionGroup[];
|
|
100
166
|
/** Compiler-owned edit behavior; editable/edit-on не передаются visual adapter-у как props. */
|
|
101
167
|
editable?: ComponentSFCEditableBehavior;
|
|
102
168
|
/** Дочерние IR-узлы. */
|
|
@@ -149,6 +215,29 @@ export interface RComponentSFC_IR_EventBinding {
|
|
|
149
215
|
name: string;
|
|
150
216
|
modifiers: RComponentSFC_IR_EventModifier[];
|
|
151
217
|
action: ComponentSFCEventAction;
|
|
218
|
+
/** Ordered reactions. `action` remains as a compatibility view of the first item. */
|
|
219
|
+
actions?: ComponentSFCEventAction[];
|
|
220
|
+
sourceRange?: RComponentSFC_SourceRange;
|
|
221
|
+
}
|
|
222
|
+
export interface RComponentSFC_IR_InteractionRule {
|
|
223
|
+
/** Static event name required to install the adapter listener. */
|
|
224
|
+
event: string;
|
|
225
|
+
/** Runtime-evaluated trigger descriptor without `reaction`. */
|
|
226
|
+
trigger: RComponentSFC_IR_Value;
|
|
227
|
+
/** Suffix modifiers applied to this rule after evaluating `trigger`. */
|
|
228
|
+
modifiers: RComponentSFC_IR_EventModifier[];
|
|
229
|
+
/** Listener options known at compile time. */
|
|
230
|
+
listener: {
|
|
231
|
+
capture: boolean;
|
|
232
|
+
passive: boolean;
|
|
233
|
+
};
|
|
234
|
+
/** Reactions executed sequentially in Source order. */
|
|
235
|
+
reactions: ComponentSFCEventAction[];
|
|
236
|
+
sourceRange?: RComponentSFC_SourceRange;
|
|
237
|
+
}
|
|
238
|
+
/** One `:on` annotation. Rules inside the group use first-match-wins semantics. */
|
|
239
|
+
export interface RComponentSFC_IR_InteractionGroup {
|
|
240
|
+
rules: RComponentSFC_IR_InteractionRule[];
|
|
152
241
|
sourceRange?: RComponentSFC_SourceRange;
|
|
153
242
|
}
|
|
154
243
|
/** IR текстовый узел. */
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/** Статическое значение атрибута, которое можно безопасно предлагать в Source Editor. */
|
|
2
|
+
export type ComponentSFCTagAttributeLiteral = string | number | boolean;
|
|
3
|
+
/** Renderer-neutral контракт атрибута встроенного SFC tag с конечным набором значений. */
|
|
4
|
+
export interface ComponentSFCTagAttributeContract {
|
|
5
|
+
/** Каноническое имя для нового source. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Совместимые имена, которые уже принимает compiler/runtime. */
|
|
8
|
+
aliases?: readonly string[];
|
|
9
|
+
/** Полный набор допустимых статических значений. */
|
|
10
|
+
values: readonly ComponentSFCTagAttributeLiteral[];
|
|
11
|
+
/** Значение, которое применяется при отсутствии атрибута. */
|
|
12
|
+
defaultValue?: ComponentSFCTagAttributeLiteral;
|
|
13
|
+
/** Краткое описание для completion и hover. */
|
|
14
|
+
description: string;
|
|
15
|
+
/** false, когда более контекстная проверка уже выполняется compiler-ом. */
|
|
16
|
+
validate?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Дополнительные контракты tag, например literal-union props пользовательского компонента. */
|
|
19
|
+
export interface ComponentSFCAttributeAnalysisOptions {
|
|
20
|
+
resolveTagAttributeContracts?: (tag: string) => readonly ComponentSFCTagAttributeContract[] | null | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare const ENDGE_SFC_TABLE_SELECTION_MODES: readonly ["none", "single", "multiple"];
|
|
23
|
+
export declare const ENDGE_SFC_TABLE_SELECTION_TRIGGERS: readonly ["auto", "control", "row", "both"];
|
|
24
|
+
export declare const ENDGE_SFC_TABLE_PAGING_MODES: readonly ["pages", "virtual"];
|
|
25
|
+
export declare const ENDGE_SFC_TABLE_SORT_MODES: readonly ["multiple", "single", "fixed", "disabled"];
|
|
26
|
+
export declare const ENDGE_SFC_TABLE_SORT_COMPARATORS: readonly ["natural", "text", "number", "date", "time", "boolean"];
|
|
27
|
+
export declare const ENDGE_SFC_TABLE_COLUMN_PIN_MODES: readonly ["enabled", "disabled"];
|
|
28
|
+
export declare const ENDGE_SFC_TABLE_COLUMN_MENU_MODES: readonly ["default", "disabled"];
|
|
29
|
+
export declare const ENDGE_SFC_TABLE_CELL_ALIGNMENTS: readonly ["left", "center", "right"];
|
|
30
|
+
export declare const ENDGE_SFC_TABLE_CELL_VERTICAL_ALIGNMENTS: readonly ["top", "middle", "bottom"];
|
|
31
|
+
export declare const ENDGE_SFC_GRID_AUTO_FLOWS: readonly ["row", "column", "row dense", "column dense"];
|
|
32
|
+
export declare const ENDGE_SFC_GRID_ALIGNMENTS: readonly ["start", "center", "end", "stretch"];
|
|
33
|
+
export declare const ENDGE_SFC_FLEX_DIRECTIONS: readonly ["row", "column"];
|
|
34
|
+
export declare const ENDGE_SFC_DIVIDER_ORIENTATIONS: readonly ["horizontal", "vertical"];
|
|
35
|
+
export declare const ENDGE_SFC_INPUT_TYPES: readonly ["String", "Number", "Date", "Time", "DateTime"];
|
|
36
|
+
/** Конечные значения встроенных SFC tags. Свободные string/number props сюда не входят. */
|
|
37
|
+
export declare const ENDGE_SFC_TAG_ATTRIBUTE_CONTRACTS: {
|
|
38
|
+
readonly Table: readonly [{
|
|
39
|
+
readonly name: "selection-mode";
|
|
40
|
+
readonly aliases: readonly ["selectionMode"];
|
|
41
|
+
readonly values: readonly ["none", "single", "multiple"];
|
|
42
|
+
readonly defaultValue: "none";
|
|
43
|
+
readonly description: "Допустимое количество выбранных строк.";
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "selection-trigger";
|
|
46
|
+
readonly aliases: readonly ["selectionTrigger"];
|
|
47
|
+
readonly values: readonly ["auto", "control", "row", "both"];
|
|
48
|
+
readonly defaultValue: "auto";
|
|
49
|
+
readonly description: "Действие, которое меняет состояние выбора строки.";
|
|
50
|
+
}, {
|
|
51
|
+
readonly name: "paging";
|
|
52
|
+
readonly values: readonly ["pages", "virtual"];
|
|
53
|
+
readonly defaultValue: "pages";
|
|
54
|
+
readonly description: "Страничное или виртуализированное отображение строк.";
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: "sort-mode";
|
|
57
|
+
readonly aliases: readonly ["sortMode"];
|
|
58
|
+
readonly values: readonly ["multiple", "single", "fixed", "disabled"];
|
|
59
|
+
readonly defaultValue: "multiple";
|
|
60
|
+
readonly description: "Режим пользовательской сортировки Table.";
|
|
61
|
+
readonly validate: false;
|
|
62
|
+
}, {
|
|
63
|
+
readonly name: "column-pin";
|
|
64
|
+
readonly aliases: readonly ["columnPin"];
|
|
65
|
+
readonly values: readonly ["enabled", "disabled"];
|
|
66
|
+
readonly defaultValue: "enabled";
|
|
67
|
+
readonly description: "Разрешает или запрещает runtime-закрепление колонок.";
|
|
68
|
+
readonly validate: false;
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "column-menu";
|
|
71
|
+
readonly aliases: readonly ["columnMenu"];
|
|
72
|
+
readonly values: readonly ["default", "disabled"];
|
|
73
|
+
readonly defaultValue: "default";
|
|
74
|
+
readonly description: "Стандартное или отключённое меню заголовка колонки.";
|
|
75
|
+
readonly validate: false;
|
|
76
|
+
}, {
|
|
77
|
+
readonly name: "cell-align";
|
|
78
|
+
readonly aliases: readonly ["cellAlign"];
|
|
79
|
+
readonly values: readonly ["left", "center", "right"];
|
|
80
|
+
readonly defaultValue: "left";
|
|
81
|
+
readonly description: "Горизонтальное выравнивание содержимого ячеек.";
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "cell-vertical-align";
|
|
84
|
+
readonly aliases: readonly ["cellVerticalAlign"];
|
|
85
|
+
readonly values: readonly ["top", "middle", "bottom"];
|
|
86
|
+
readonly defaultValue: "middle";
|
|
87
|
+
readonly description: "Вертикальное выравнивание содержимого ячеек.";
|
|
88
|
+
}];
|
|
89
|
+
readonly Column: readonly [{
|
|
90
|
+
readonly name: "sort";
|
|
91
|
+
readonly values: readonly ["natural", "text", "number", "date", "time", "boolean"];
|
|
92
|
+
readonly defaultValue: "natural";
|
|
93
|
+
readonly description: "Comparator для значений колонки.";
|
|
94
|
+
readonly validate: false;
|
|
95
|
+
}];
|
|
96
|
+
readonly Grid: readonly [{
|
|
97
|
+
readonly name: "autoFlow";
|
|
98
|
+
readonly values: readonly ["row", "column", "row dense", "column dense"];
|
|
99
|
+
readonly defaultValue: "row";
|
|
100
|
+
readonly description: "Направление автоматического размещения CSS Grid.";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "align";
|
|
103
|
+
readonly values: readonly ["start", "center", "end", "stretch"];
|
|
104
|
+
readonly defaultValue: "stretch";
|
|
105
|
+
readonly description: "Выравнивание элементов по вертикальной оси Grid.";
|
|
106
|
+
}, {
|
|
107
|
+
readonly name: "justify";
|
|
108
|
+
readonly values: readonly ["start", "center", "end", "stretch"];
|
|
109
|
+
readonly defaultValue: "stretch";
|
|
110
|
+
readonly description: "Выравнивание элементов по горизонтальной оси Grid.";
|
|
111
|
+
}];
|
|
112
|
+
readonly Flex: readonly [{
|
|
113
|
+
readonly name: "direction";
|
|
114
|
+
readonly values: readonly ["row", "column"];
|
|
115
|
+
readonly defaultValue: "row";
|
|
116
|
+
readonly description: "Направление основной оси Flex.";
|
|
117
|
+
}];
|
|
118
|
+
readonly Divider: readonly [{
|
|
119
|
+
readonly name: "orientation";
|
|
120
|
+
readonly values: readonly ["horizontal", "vertical"];
|
|
121
|
+
readonly defaultValue: "horizontal";
|
|
122
|
+
readonly description: "Ориентация разделителя.";
|
|
123
|
+
}];
|
|
124
|
+
readonly Input: readonly [{
|
|
125
|
+
readonly name: "type";
|
|
126
|
+
readonly values: readonly ["String", "Number", "Date", "Time", "DateTime"];
|
|
127
|
+
readonly defaultValue: "String";
|
|
128
|
+
readonly description: "Семантический тип значения Input.";
|
|
129
|
+
}];
|
|
130
|
+
};
|
|
131
|
+
/** Возвращает строгие контракты атрибутов одного встроенного SFC tag. */
|
|
132
|
+
export declare function getComponentSFCTagAttributeContracts(tag: string): readonly ComponentSFCTagAttributeContract[];
|
|
133
|
+
/** Находит строгий контракт по каноническому или совместимому имени атрибута. */
|
|
134
|
+
export declare function getComponentSFCTagAttributeContract(tag: string, attributeName: string): ComponentSFCTagAttributeContract | null;
|
|
@@ -21,6 +21,34 @@ export interface ComponentSFCVisualAttribute {
|
|
|
21
21
|
}
|
|
22
22
|
/** Редактируемый prop binding единственного управляемого элемента колонки Table. */
|
|
23
23
|
export type ComponentSFCTableCellBindingProjection = ComponentSFCVisualAttribute;
|
|
24
|
+
export type ComponentSFCTableCellInteractionModifier = 'ctrl' | 'shift' | 'alt' | 'meta' | 'mod' | 'altGraph' | 'exact';
|
|
25
|
+
export type ComponentSFCTableCellInteractionFlag = 'stop' | 'prevent' | 'self' | 'once' | 'capture' | 'passive';
|
|
26
|
+
/** Visual-editor-safe projection of one static Cell `:on` rule. */
|
|
27
|
+
export interface ComponentSFCTableCellInteractionRuleProjection {
|
|
28
|
+
event: string;
|
|
29
|
+
key: string[];
|
|
30
|
+
code: string[];
|
|
31
|
+
held: {
|
|
32
|
+
key: string[];
|
|
33
|
+
code: string[];
|
|
34
|
+
match: 'all' | 'any';
|
|
35
|
+
exact: boolean;
|
|
36
|
+
} | null;
|
|
37
|
+
modifiers: Partial<Record<ComponentSFCTableCellInteractionModifier, boolean>>;
|
|
38
|
+
repeat: boolean | null;
|
|
39
|
+
composing: boolean | null;
|
|
40
|
+
button: number | null;
|
|
41
|
+
flags: Partial<Record<ComponentSFCTableCellInteractionFlag, boolean>>;
|
|
42
|
+
reactionSource: string;
|
|
43
|
+
}
|
|
44
|
+
/** Source-preserving Cell interaction read-model used by the Table visual editor. */
|
|
45
|
+
export interface ComponentSFCTableCellInteractionsProjection {
|
|
46
|
+
editable: boolean;
|
|
47
|
+
rules: ComponentSFCTableCellInteractionRuleProjection[];
|
|
48
|
+
suffixes: ComponentSFCTableCellInteractionFlag[];
|
|
49
|
+
sourceRange?: RComponentSFC_SourceRange;
|
|
50
|
+
message?: string;
|
|
51
|
+
}
|
|
24
52
|
/** Способ, которым содержимое ячейки представлено в простом visual editor. */
|
|
25
53
|
export type ComponentSFCTableVisualCellTag = Exclude<RComponentSFC_IR_Tag, 'Component' | 'Table' | 'Column' | 'Cell' | 'ColumnMenu' | 'RowMenu' | 'MenuItem' | 'MenuSeparator'>;
|
|
26
54
|
export type ComponentSFCTableCellProjection = {
|
|
@@ -42,6 +70,8 @@ export type ComponentSFCTableCellProjection = {
|
|
|
42
70
|
export interface ComponentSFCVisualInspectionOptions {
|
|
43
71
|
resolveComponentTag?: (tag: string) => string | null;
|
|
44
72
|
resolveTypeDefinition?: (identity: string) => TypeSourceDefinition | null;
|
|
73
|
+
/** Direct Action identities available to source-authored MenuItem bindings. */
|
|
74
|
+
actionIdentities?: Iterable<string>;
|
|
45
75
|
}
|
|
46
76
|
/** Visual read-model одной прямой Column внутри корневого Table. */
|
|
47
77
|
export interface ComponentSFCTableColumnProjection {
|
|
@@ -56,6 +86,7 @@ export interface ComponentSFCTableColumnProjection {
|
|
|
56
86
|
pinnable: ComponentSFCVisualSourceValue | null;
|
|
57
87
|
attributes: ComponentSFCVisualAttribute[];
|
|
58
88
|
cell: ComponentSFCTableCellProjection;
|
|
89
|
+
interactions: ComponentSFCTableCellInteractionsProjection;
|
|
59
90
|
hasCustomCell: boolean;
|
|
60
91
|
cellSource: string | null;
|
|
61
92
|
sourceRange: RComponentSFC_SourceRange;
|
|
@@ -64,7 +95,7 @@ export type ComponentSFCTableVisualMenuKind = 'column' | 'row';
|
|
|
64
95
|
export type ComponentSFCTableVisualMenuMode = 'default' | 'disabled' | 'none' | 'custom' | 'source';
|
|
65
96
|
export interface ComponentSFCTableMenuActionOption {
|
|
66
97
|
identity: string;
|
|
67
|
-
source: 'intrinsic' | 'built-in' | 'required' | 'provided' | 'forwarded';
|
|
98
|
+
source: 'intrinsic' | 'built-in' | 'external' | 'required' | 'provided' | 'forwarded';
|
|
68
99
|
}
|
|
69
100
|
export type ComponentSFCTableMenuNodeProjection = {
|
|
70
101
|
kind: 'separator';
|
|
@@ -106,7 +137,7 @@ export type ComponentSFCTableSourcePatch = {
|
|
|
106
137
|
value: string | null;
|
|
107
138
|
} | {
|
|
108
139
|
type: 'set-table-attribute';
|
|
109
|
-
name: 'ref' | 'selection-mode' | 'paging' | 'page-size' | 'page-sizes' | 'default-pin' | 'default-sort' | 'default-hidden';
|
|
140
|
+
name: 'ref' | 'selection-mode' | 'selection-trigger' | 'paging' | 'page-size' | 'page-sizes' | 'default-pin' | 'default-sort' | 'default-hidden';
|
|
110
141
|
value: string | null;
|
|
111
142
|
} | {
|
|
112
143
|
type: 'set-column-component';
|
|
@@ -124,6 +155,11 @@ export type ComponentSFCTableSourcePatch = {
|
|
|
124
155
|
name: string;
|
|
125
156
|
value: string | null;
|
|
126
157
|
valueKind: 'expression' | 'literal';
|
|
158
|
+
} | {
|
|
159
|
+
type: 'set-column-cell-on';
|
|
160
|
+
columnIndex: number;
|
|
161
|
+
/** Complete object/array expression, or null to remove the annotation. */
|
|
162
|
+
value: string | null;
|
|
127
163
|
} | {
|
|
128
164
|
type: 'set-menu-mode';
|
|
129
165
|
menu: ComponentSFCTableVisualMenuKind;
|
|
@@ -163,6 +199,7 @@ export interface ComponentSFCTableVisualProjection {
|
|
|
163
199
|
kind: 'table';
|
|
164
200
|
ref: ComponentSFCVisualSourceValue | null;
|
|
165
201
|
selectionMode: ComponentSFCVisualSourceValue | null;
|
|
202
|
+
selectionTrigger: ComponentSFCVisualSourceValue | null;
|
|
166
203
|
rows: ComponentSFCVisualSourceValue | null;
|
|
167
204
|
rowKey: ComponentSFCVisualSourceValue | null;
|
|
168
205
|
paging: ComponentSFCVisualSourceValue | null;
|