@endge/core 2.0.2 → 2.0.3

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.
@@ -1,5 +1,5 @@
1
1
  import { ComponentSFCRuntimeHost } from './hosts/ComponentSFCRuntimeHost';
2
- import { ComponentSFCEventRuntimeSource, ComponentSFCPortManifest } from '../../types/component/sfc/ports.types';
2
+ import { ComponentSFCEventRuntimeSource, ComponentSFCRequiredPortBinding, ComponentSFCPortManifest } from '../../types/component/sfc/ports.types';
3
3
  import { RComponentSFC_IR_EventBinding } from '../../types/component/sfc/ir.types';
4
4
  /** Mount-scoped Event router for one Component SFC artifact boundary. */
5
5
  export declare class ComponentSFCEventBoundary {
@@ -10,15 +10,16 @@ export declare class ComponentSFCEventBoundary {
10
10
  private readonly parentSource?;
11
11
  private readonly parentBindings;
12
12
  private readonly parentEventTransform?;
13
+ private readonly requiredPortBindings;
13
14
  private readonly consumedLocalOnce;
14
15
  constructor(host: ComponentSFCRuntimeHost | null, componentIdentity: string, manifest: ComponentSFCPortManifest, parent?: ComponentSFCEventBoundary | null, parentSource?: ComponentSFCEventRuntimeSource | undefined, parentBindings?: readonly RComponentSFC_IR_EventBinding[], parentEventTransform?: ((event: string, payload: unknown) => {
15
16
  event: string;
16
17
  payload: unknown;
17
- } | null) | undefined);
18
+ } | null) | undefined, requiredPortBindings?: readonly ComponentSFCRequiredPortBinding[]);
18
19
  createChild(componentIdentity: string, manifest: ComponentSFCPortManifest, source: ComponentSFCEventRuntimeSource, bindings?: readonly RComponentSFC_IR_EventBinding[], transform?: (event: string, payload: unknown) => {
19
20
  event: string;
20
21
  payload: unknown;
21
- } | null): ComponentSFCEventBoundary;
22
+ } | null, requiredPortBindings?: readonly ComponentSFCRequiredPortBinding[]): ComponentSFCEventBoundary;
22
23
  /** True when the current public manifest observes one Event of this child source. */
23
24
  observesChild(source: ComponentSFCEventRuntimeSource, event: string): boolean;
24
25
  /** Claims a mount-scoped logical `.once` rule after it has matched. */
@@ -30,5 +31,6 @@ export declare class ComponentSFCEventBoundary {
30
31
  /** Emits an Event declared as own by this component. */
31
32
  emitOwn(name: string, payload: unknown, trace?: string[], depth?: number): Promise<void>;
32
33
  private dispatch;
34
+ private resolveRequiredPortAction;
33
35
  private reportError;
34
36
  }
@@ -11,13 +11,13 @@ export interface RComponentRef {
11
11
  /** Идентификатор компонента внутри выбранного хранилища. */
12
12
  id: string | number;
13
13
  /** Semantic dependency role in the compiled artifact. */
14
- role?: 'child-component' | 'port-default-component';
14
+ role?: 'child-component' | 'port-default-component' | 'port-override-component';
15
15
  }
16
16
  /** Ссылка SFC-компонента на computation provider. */
17
17
  export interface RComputationRef {
18
18
  source: 'computation';
19
19
  id: string | number;
20
- role: 'port-default-computation';
20
+ role: 'port-default-computation' | 'port-override-computation';
21
21
  }
22
22
  /** Описание одного сообщения компилятора или валидатора. */
23
23
  export interface RComponentDiagnostic {
@@ -1,6 +1,6 @@
1
1
  import { RComponentSFC_SourceRange } from './location.types';
2
2
  import { RComponentDiagnostic } from '../component-core.types';
3
- import { ComponentSFCEventAction, ComponentSFCPortForwardOrigin, ComponentSFCPortManifest, RComponentSFC_IR_ComponentPortMarker, RComponentSFC_IR_PortCall } from './ports.types';
3
+ import { ComponentSFCEventAction, ComponentSFCRequiredPortBinding, ComponentSFCPortForwardOrigin, ComponentSFCPortManifest, RComponentSFC_IR_ComponentPortMarker, RComponentSFC_IR_PortCall } from './ports.types';
4
4
  import { EndgeStyleSheetArtifact } from '../../style/style.types';
5
5
  /** Семантическая модель компонента после compiler pipeline, независимая от DOM и Nova. */
6
6
  export interface RComponentSFC_IR {
@@ -178,6 +178,8 @@ export interface RComponentSFC_IR_ElementNode {
178
178
  children: RComponentSFC_IR_Node[];
179
179
  /** Local component port marker retained for future provider overrides. */
180
180
  port?: RComponentSFC_IR_ComponentPortMarker;
181
+ /** Static per-instance bindings for required ports of this child component. */
182
+ portBindings?: ComponentSFCRequiredPortBinding[];
181
183
  /** Compiler-resolved Table menus, including forwarded Action identities and targets. */
182
184
  tableMenus?: RComponentSFC_IR_TableMenus;
183
185
  /** Позиция исходного AST-узла. */
@@ -200,6 +202,8 @@ export interface ComponentSFCTableMenuItemDescriptor {
200
202
  id: string;
201
203
  label: RComponentSFC_IR_Value;
202
204
  action: string;
205
+ /** Required Action port whose mounted provider may replace `action`. */
206
+ requiredPort?: string;
203
207
  input?: RComponentSFC_IR_Value;
204
208
  icon?: string;
205
209
  /** Set only for a provided alias forwarded from this exact Table node. */
@@ -2,7 +2,8 @@ import { RComponentContractInput } from '../component-core.types';
2
2
  import { RComponentSFC_IR_Value } from './ir.types';
3
3
  import { RComponentSFC_SourceRange } from './location.types';
4
4
  export type ComponentSFCPortRole = 'require' | 'provides' | 'emits';
5
- export type ComponentSFCPortKind = 'computation' | 'component' | 'action' | 'event';
5
+ export type ComponentSFCPortKind = 'computation' | 'component' | 'action' | 'query' | 'event';
6
+ export type ComponentSFCRequiredPortKind = Exclude<ComponentSFCPortKind, 'event'>;
6
7
  /** Public child port selected by a compile-time `definePorts.forward` rule. */
7
8
  export interface ComponentSFCPortForwardOrigin {
8
9
  nodeId: string;
@@ -59,6 +60,12 @@ export type ComponentSFCPortProviderDescriptor = {
59
60
  isArray?: boolean;
60
61
  optional?: boolean;
61
62
  } | null;
63
+ } | {
64
+ kind: 'query';
65
+ identity: string;
66
+ active: boolean;
67
+ inputs: RComponentContractInput[];
68
+ outputs: RComponentContractInput[];
62
69
  };
63
70
  /** Computation port declared by `computation<Input, Output>`. */
64
71
  export interface ComponentSFCComputationPort {
@@ -92,6 +99,25 @@ export interface ComponentSFCActionPort {
92
99
  forwardedFrom?: ComponentSFCPortForwardOrigin;
93
100
  sourceRange?: RComponentSFC_SourceRange;
94
101
  }
102
+ /** Callable Query required by a component. */
103
+ export interface ComponentSFCQueryPort {
104
+ kind: 'query';
105
+ name: string;
106
+ defaultIdentity: string;
107
+ inputType: string;
108
+ outputType: string;
109
+ inputs: RComponentContractInput[];
110
+ outputs: RComponentContractInput[];
111
+ forwardedFrom?: ComponentSFCPortForwardOrigin;
112
+ sourceRange?: RComponentSFC_SourceRange;
113
+ }
114
+ /** One static provider override attached to a mounted child Component SFC call. */
115
+ export interface ComponentSFCRequiredPortBinding {
116
+ port: string;
117
+ kind: ComponentSFCRequiredPortKind;
118
+ identity: string;
119
+ sourceRange?: RComponentSFC_SourceRange;
120
+ }
95
121
  /** Multicast notification emitted by this component. */
96
122
  export interface ComponentSFCEventPort {
97
123
  kind: 'event';
@@ -165,7 +191,14 @@ export interface ComponentSFCEventEmitAction {
165
191
  event: string;
166
192
  payload?: ComponentSFCEventInputValue;
167
193
  }
168
- export type ComponentSFCEventAction = ComponentSFCEventDirectAction | ComponentSFCEventDirectQuery | ComponentSFCEventTypescriptAction | ComponentSFCEventEmitAction;
194
+ /** Calls one required executable port through its effective per-instance provider. */
195
+ export interface ComponentSFCEventRequiredPortAction {
196
+ kind: 'required-port';
197
+ portKind: 'action' | 'query';
198
+ port: string;
199
+ input?: ComponentSFCEventInputValue;
200
+ }
201
+ export type ComponentSFCEventAction = ComponentSFCEventDirectAction | ComponentSFCEventDirectQuery | ComponentSFCEventTypescriptAction | ComponentSFCEventEmitAction | ComponentSFCEventRequiredPortAction;
169
202
  export interface ComponentSFCEventRuntimeSource {
170
203
  nodeId: string;
171
204
  ref?: string;
@@ -187,6 +220,7 @@ export interface ComponentSFCRequiredPorts {
187
220
  computations: ComponentSFCComputationPort[];
188
221
  components: ComponentSFCComponentPort[];
189
222
  actions: ComponentSFCActionPort[];
223
+ queries: ComponentSFCQueryPort[];
190
224
  }
191
225
  export interface ComponentSFCProvidedPorts {
192
226
  actions: ComponentSFCActionPort[];
@@ -1,7 +1,10 @@
1
1
  import { RComponentContractInput } from '../component-core.types';
2
2
  import { RComponentSFC_IR_Tag } from './ir.types';
3
3
  /** Публичный входной параметр renderer-neutral встроенного SFC tag. */
4
- export type ComponentSFCTagInputContract = Readonly<RComponentContractInput>;
4
+ export type ComponentSFCTagInputContract = Readonly<RComponentContractInput> & {
5
+ /** Допустимые SFC spelling aliases для одного renderer-facing параметра. */
6
+ aliases?: readonly string[];
7
+ };
5
8
  /**
6
9
  * Data-facing входы встроенных tags для source-aware visual editors.
7
10
  * Presentation-атрибуты остаются в отдельном редакторе атрибутов.
@@ -11,6 +14,11 @@ export declare const ENDGE_SFC_TAG_INPUT_CONTRACTS: {
11
14
  readonly name: "value";
12
15
  readonly type: "string";
13
16
  readonly optional: true;
17
+ }, {
18
+ readonly name: "editorVariant";
19
+ readonly aliases: readonly ["editor-variant"];
20
+ readonly type: "'default' | 'compact'";
21
+ readonly optional: true;
14
22
  }];
15
23
  readonly DateTime: readonly [{
16
24
  readonly name: "value";
@@ -24,6 +32,16 @@ export declare const ENDGE_SFC_TAG_INPUT_CONTRACTS: {
24
32
  readonly name: "timezone";
25
33
  readonly type: "string";
26
34
  readonly optional: true;
35
+ }, {
36
+ readonly name: "editMode";
37
+ readonly aliases: readonly ["edit-mode"];
38
+ readonly type: "'datetime' | 'time'";
39
+ readonly optional: true;
40
+ }, {
41
+ readonly name: "editorVariant";
42
+ readonly aliases: readonly ["editor-variant"];
43
+ readonly type: "'default' | 'compact'";
44
+ readonly optional: true;
27
45
  }, {
28
46
  readonly name: "empty";
29
47
  readonly type: "string";
@@ -33,6 +51,11 @@ export declare const ENDGE_SFC_TAG_INPUT_CONTRACTS: {
33
51
  readonly name: "value";
34
52
  readonly type: "number";
35
53
  readonly optional: false;
54
+ }, {
55
+ readonly name: "editorVariant";
56
+ readonly aliases: readonly ["editor-variant"];
57
+ readonly type: "'default' | 'compact'";
58
+ readonly optional: true;
36
59
  }, {
37
60
  readonly name: "decimals";
38
61
  readonly type: "number";
@@ -42,7 +42,7 @@ export interface ComponentSFCCompileOptions {
42
42
  /** Проверяет существование статической identity из Component is. */
43
43
  hasComponentIdentity?: (identity: string) => boolean;
44
44
  /** Resolves and describes a default port provider for build-time validation. */
45
- resolvePortProvider?: (identity: string, expectedKind: 'computation' | 'component' | 'action') => ComponentSFCPortProviderDescriptor | null;
45
+ resolvePortProvider?: (identity: string, expectedKind: 'computation' | 'component' | 'action' | 'query') => ComponentSFCPortProviderDescriptor | null;
46
46
  /** Resolves the compiled public port manifest of a nested SFC component. */
47
47
  resolveComponentPortManifest?: (identity: string) => ComponentSFCPortManifest | null;
48
48
  /** Resolves explicit root variants of one nested custom component. */
@@ -9,4 +9,4 @@ export interface ComponentSFCInteractionCompileContext {
9
9
  /** Detects statically invalid passive/prevent combinations in shared trigger descriptors. */
10
10
  export declare function hasComponentSFCPassivePreventConflict(source: string, suffixes?: readonly RComponentSFC_IR_EventModifier[]): boolean;
11
11
  /** Compiles one source-owned `:on` annotation into renderer-neutral rules. */
12
- export declare function compileComponentSFCInteractionAnnotation(attribute: RComponentSFC_AST_Attribute, manifest: ComponentSFCPortManifest | null, context: ComponentSFCInteractionCompileContext, dependencies: RComponentDependencies, diagnostics: RComponentDiagnostic[]): RComponentSFC_IR_InteractionGroup | null;
12
+ export declare function compileComponentSFCInteractionAnnotation(attribute: RComponentSFC_AST_Attribute, manifest: ComponentSFCPortManifest | null, context: ComponentSFCInteractionCompileContext, dependencies: RComponentDependencies, diagnostics: RComponentDiagnostic[], ownerPorts?: ComponentSFCPortManifest | null): RComponentSFC_IR_InteractionGroup | null;
@@ -3,11 +3,11 @@ import { TypeSourceDefinition } from '../../../../domain/types/source/type-sourc
3
3
  import { ComponentSFCEventAction, ComponentSFCPortManifest, ComponentSFCPortProviderDescriptor, RComponentSFC_IR_PortCall } from '../../../../domain/types/component/sfc/ports.types';
4
4
  import { RComponentSFC_AST_Script } from '../../../../domain/types/component/sfc/ast.types';
5
5
  export interface ComponentSFCPortAnalysisOptions {
6
- resolveProvider?: (identity: string, expectedKind: 'computation' | 'component' | 'action') => ComponentSFCPortProviderDescriptor | null;
6
+ resolveProvider?: (identity: string, expectedKind: 'computation' | 'component' | 'action' | 'query') => ComponentSFCPortProviderDescriptor | null;
7
7
  resolveTypeDefinition?: (identity: string) => TypeSourceDefinition | null;
8
8
  }
9
9
  /** Compiles the safe reaction grammar used by local `@event` template bindings. */
10
- export declare function compileComponentSFCLocalEventAction(eventName: string, source: string, sourceOffset: number, dependencies: RComponentDependencies, diagnostics: RComponentDiagnostic[]): ComponentSFCEventAction | null;
10
+ export declare function compileComponentSFCLocalEventAction(eventName: string, source: string, sourceOffset: number, dependencies: RComponentDependencies, diagnostics: RComponentDiagnostic[], ownerPorts?: ComponentSFCPortManifest | null): ComponentSFCEventAction | null;
11
11
  export interface ComponentSFCPortAnalysisResult {
12
12
  manifest: ComponentSFCPortManifest;
13
13
  calls: RComponentSFC_IR_PortCall[];
@@ -1,7 +1,7 @@
1
1
  import { RComponentDependencies, RComponentDiagnostic } from '../../../../domain/types/component/component-core.types';
2
2
  import { RComponentSFC_AST_Template } from '../../../../domain/types/component/sfc/ast.types';
3
3
  import { RComponentSFC_IR_Template } from '../../../../domain/types/component/sfc/ir.types';
4
- import { ComponentSFCComponentPort, ComponentSFCPortManifest } from '../../../../domain/types/component/sfc/ports.types';
4
+ import { ComponentSFCComponentPort, ComponentSFCPortProviderDescriptor, ComponentSFCRequiredPortKind, ComponentSFCPortManifest } from '../../../../domain/types/component/sfc/ports.types';
5
5
  import { ProgramNodeMetadata } from '../../../../domain/types/program/program-metadata.types';
6
6
  import { EndgeSFCEditingConfiguration } from '../../../../domain/types/configuration/configuration.type';
7
7
  /** Контекст компиляции template в IR. */
@@ -12,12 +12,16 @@ export interface ComponentSFCTemplateCompileContext {
12
12
  locals: string[];
13
13
  /** Local component ports have priority over the global user tag registry. */
14
14
  componentPorts?: ComponentSFCComponentPort[];
15
+ /** Required ports owned by the Component SFC currently being compiled. */
16
+ ownerPorts?: ComponentSFCPortManifest | null;
15
17
  /** Разрешает зарегистрированный пользовательский tag в identity компонента. */
16
18
  resolveComponentTag?: (tag: string) => string | null;
17
19
  /** Проверяет статическую identity из Component is. */
18
20
  hasComponentIdentity?: (identity: string) => boolean;
19
21
  /** Resolves public Events of a nested user Component for local `@event` bindings. */
20
22
  resolveComponentPortManifest?: (identity: string) => ComponentSFCPortManifest | null;
23
+ /** Resolves static providers used by flat child port bindings. */
24
+ resolvePortProvider?: (identity: string, expectedKind: ComponentSFCRequiredPortKind) => ComponentSFCPortProviderDescriptor | null;
21
25
  /** Resolves explicit root Variant names of a nested custom component. */
22
26
  resolveComponentVariants?: (identity: string) => string[] | null;
23
27
  /** Effective defaults завершения edit session для текущего build context. */
@@ -16,6 +16,8 @@ export declare class QueryExecutor {
16
16
  /** Выполняет REST artifact. */
17
17
  private _runRest;
18
18
  private _throwHttpError;
19
+ /** Пишет краткую transport-индикацию без request body, headers и response payload. */
20
+ private _writeRequestError;
19
21
  /** Публикует runtime warning безопасного expression evaluator. */
20
22
  private _writeExpressionWarning;
21
23
  private _asRecord;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@endge/core",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "@babel/parser": "^7.27.2",
31
31
  "@babel/types": "^7.27.1",
32
- "@endge/utils": "^0.24.11",
32
+ "@endge/utils": "^0.24.12",
33
33
  "@vue/compiler-dom": "^3.5.24",
34
34
  "@vue/compiler-sfc": "^3.5.24",
35
35
  "axios": "^1.13.2",
@@ -46,8 +46,8 @@
46
46
  "yaml": "^2.8.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@endge/raph": "^3.0.9",
50
- "@endge/utils": "^0.24.11",
49
+ "@endge/raph": "^3.0.10",
50
+ "@endge/utils": "^0.24.12",
51
51
  "@primevue/themes": "^4.0.0-rc.1",
52
52
  "class-transformer": "^0.5.1",
53
53
  "class-validator": "^0.14.1",