@endge/core 2.0.1 → 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.
Files changed (57) hide show
  1. package/dist/core.cjs +361 -296
  2. package/dist/core.js +23365 -21136
  3. package/dist/domain/entities/reflect/RConfiguration.d.ts +11 -0
  4. package/dist/domain/entities/runtime/ComponentSFCEventBoundary.d.ts +5 -3
  5. package/dist/domain/entities/runtime/hosts/ComponentSFCRuntimeHost.d.ts +3 -0
  6. package/dist/domain/types/component/component-core.types.d.ts +2 -2
  7. package/dist/domain/types/component/sfc/dependencies.types.d.ts +14 -2
  8. package/dist/domain/types/component/sfc/intrinsic-events.types.d.ts +2 -0
  9. package/dist/domain/types/component/sfc/ir.types.d.ts +25 -7
  10. package/dist/domain/types/component/sfc/ports.types.d.ts +39 -3
  11. package/dist/domain/types/component/sfc/tag-attribute-contract.types.d.ts +11 -0
  12. package/dist/domain/types/component/sfc/tag-input-contract.types.d.ts +41 -1
  13. package/dist/domain/types/configuration/configuration.type.d.ts +40 -1
  14. package/dist/domain/types/document/document.types.d.ts +4 -2
  15. package/dist/domain/types/document/domain-export.type.d.ts +2 -0
  16. package/dist/domain/types/document/domain-provider.type.d.ts +1 -1
  17. package/dist/domain/types/document/workspace.types.d.ts +2 -1
  18. package/dist/domain/types/program/program.types.d.ts +9 -2
  19. package/dist/domain/types/runtime/context-persistence.types.d.ts +26 -0
  20. package/dist/domain/types/source/configuration-source.types.d.ts +47 -0
  21. package/dist/domain/types/source/query-source.types.d.ts +36 -9
  22. package/dist/domain/types/source/source-engine.types.d.ts +8 -2
  23. package/dist/domain/types/ui/tooltip-markdown.types.d.ts +32 -0
  24. package/dist/main.d.ts +9 -0
  25. package/dist/model/config/kernel.config.d.ts +5 -0
  26. package/dist/model/config/tooltip.config.d.ts +3 -0
  27. package/dist/model/kernel/endge.d.ts +2 -0
  28. package/dist/model/modules/context/endge-configuration-schema.d.ts +24 -0
  29. package/dist/model/modules/context/endge-configuration.d.ts +2 -0
  30. package/dist/model/modules/context/endge-context.d.ts +22 -1
  31. package/dist/model/modules/context/endge-workspace.d.ts +11 -1
  32. package/dist/model/modules/domain/endge-domain.d.ts +16 -0
  33. package/dist/model/modules/program/endge-source.d.ts +1 -1
  34. package/dist/model/modules/runtime/core/endge-runtime.d.ts +3 -2
  35. package/dist/model/modules/ui/endge-ui.d.ts +0 -11
  36. package/dist/model/services/compiler/component-sfc/component-sfc-compile.d.ts +1 -1
  37. package/dist/model/services/compiler/component-sfc/component-sfc-interactions.d.ts +1 -1
  38. package/dist/model/services/compiler/component-sfc/component-sfc-ports.d.ts +2 -2
  39. package/dist/model/services/compiler/component-sfc/component-sfc-template.d.ts +5 -1
  40. package/dist/model/services/configuration/configuration-value.d.ts +20 -0
  41. package/dist/model/services/configuration/endge-configuration.d.ts +3 -1
  42. package/dist/model/services/query/QueryExecutor.d.ts +5 -0
  43. package/dist/model/services/source-engine/compilers/configuration-source-compile.d.ts +4 -0
  44. package/dist/model/services/source-engine/configuration-source-patch.d.ts +16 -0
  45. package/dist/model/services/source-engine/strategies/ConfigurationSourceEngineStrategy.d.ts +7 -0
  46. package/dist/model/services/source-engine/strategies/ConfigurationSourceLanguageStrategy.d.ts +12 -0
  47. package/dist/model/services/source-engine/strategies/QuerySourceLanguageStrategy.d.ts +1 -1
  48. package/dist/model/services/source-engine/templates/configuration.default.source.d.ts +2 -0
  49. package/dist/model/services/source-engine/templates/query.default.source.d.ts +2 -0
  50. package/dist/model/services/source-engine/type-source-references.d.ts +3 -0
  51. package/dist/model/services/source-engine/type-source-serialize.d.ts +2 -1
  52. package/dist/model/services/tooltip/endge-tooltip-markdown.d.ts +5 -0
  53. package/dist/test/model/services/compiler/component-sfc/component-sfc-tooltip.test.d.ts +1 -0
  54. package/dist/test/model/services/source-engine/configuration-source.test.d.ts +1 -0
  55. package/dist/test/tooltip/endge-tooltip-markdown.test.d.ts +1 -0
  56. package/dist/tools/component-sfc-edit-trigger.d.ts +9 -1
  57. package/package.json +4 -4
@@ -0,0 +1,4 @@
1
+ import { ConfigurationSourceCompileResult } from '../../../../domain/types/source/configuration-source.types';
2
+ import { TypeProgramCatalogEntry } from '../../../../domain/types/source/type-source.types';
3
+ /** Parses Configuration Source v1 without executing authored JavaScript. */
4
+ export declare function compileConfigurationSource(source: string, catalog?: readonly TypeProgramCatalogEntry[]): ConfigurationSourceCompileResult;
@@ -0,0 +1,16 @@
1
+ import { ConfigurationSourceValueDefinition } from '../../../domain/types/source/configuration-source.types';
2
+ export type ConfigurationSourcePatch = {
3
+ op: 'upsert';
4
+ value: ConfigurationSourceValueDefinition;
5
+ } | {
6
+ op: 'remove';
7
+ key: string;
8
+ } | {
9
+ op: 'rename';
10
+ key: string;
11
+ nextKey: string;
12
+ };
13
+ /** Applies a narrow property-level patch to canonical defineConfig source. */
14
+ export declare function patchConfigurationSource(source: string, patch: ConfigurationSourcePatch): string;
15
+ /** Deterministic source for one value; visual authoring always writes an explicit default. */
16
+ export declare function serializeConfigurationValue(value: ConfigurationSourceValueDefinition, indent?: number): string;
@@ -0,0 +1,7 @@
1
+ import { SourceEngineCompileResult, SourceEngineStrategy, SourceKind } from '../../../../domain/types/source/source-engine.types';
2
+ export declare class ConfigurationSourceEngineStrategy implements SourceEngineStrategy {
3
+ readonly id = "source:configuration";
4
+ readonly sourceKind: SourceKind;
5
+ supports(sourceKind: SourceKind | string): boolean;
6
+ compile(source: string): SourceEngineCompileResult;
7
+ }
@@ -0,0 +1,12 @@
1
+ import { SourceKind, SourceLanguageCompletion, SourceLanguageContext, SourceLanguageStrategy, SourceLanguageValidationResult } from '../../../../domain/types/source/source-engine.types';
2
+ export declare class ConfigurationSourceLanguageStrategy implements SourceLanguageStrategy {
3
+ readonly id = "source-language:configuration";
4
+ readonly sourceKind: SourceKind;
5
+ readonly syntax: import('../../../../domain/types/source/source-engine.types').SourceLanguageSyntaxDefinition;
6
+ supports(sourceKind: SourceKind | string): boolean;
7
+ createDefaultSource(): string;
8
+ validate(source: string, context?: SourceLanguageContext): SourceLanguageValidationResult;
9
+ completions(context: SourceLanguageContext): SourceLanguageCompletion[];
10
+ resolveReference(context: SourceLanguageContext): import('../../../../domain/types/source/source-engine.types').SourceDocumentReference | null;
11
+ semanticHighlights(context: SourceLanguageContext): import('../../../../domain/types/source/source-engine.types').SourceLanguageSemanticHighlight[];
12
+ }
@@ -7,7 +7,7 @@ export declare class QuerySourceLanguageStrategy implements SourceLanguageStrate
7
7
  /** Проверяет, что стратегия обслуживает query source. */
8
8
  supports(sourceKind: SourceKind | string): boolean;
9
9
  /** Возвращает базовый source новой RQuery. */
10
- createDefaultSource(): string;
10
+ createDefaultSource(variant?: string): string;
11
11
  /** Валидирует query source через текущий compiler pass. */
12
12
  validate(source: string, context?: SourceLanguageContext): SourceLanguageValidationResult;
13
13
  /** Возвращает подсказки source-only Query v2 API. */
@@ -0,0 +1,2 @@
1
+ /** Base source for a new Configuration v1 category. */
2
+ export declare const CONFIGURATION_DEFAULT_SOURCE = "defineConfig({})\n";
@@ -1,2 +1,4 @@
1
1
  /** Базовый canonical source для новой RQuery v2. */
2
2
  export declare const QUERY_DEFAULT_SOURCE = "defineQuery({\n kind: 'rest',\n\n props: defineProps({\n filterPayload: field('Object').optional(),\n }),\n\n request: {\n endpoint: '',\n path: '/search',\n method: 'POST',\n headers: {},\n auth: {\n mode: 'inherit',\n },\n body: body(({ prop }) =>\n merge(\n { limit: 100 },\n prop('filterPayload'),\n ),\n ),\n },\n\n outputs: {\n raw: output()\n .from(response('items')),\n },\n\n mock: {\n enabled: false,\n data: null,\n },\n})\n";
3
+ /** Базовый canonical source для новой GraphQL RQuery v2. */
4
+ export declare const QUERY_GRAPHQL_DEFAULT_SOURCE = "defineQuery({\n kind: 'graphql',\n\n props: defineProps({\n id: field('String'),\n }),\n\n request: {\n endpoint: '',\n operationName: 'LoadItem',\n document: gql`\n query LoadItem($id: ID!) {\n item(id: $id) {\n id\n }\n }\n `,\n variables: variables(({ prop }) => ({\n id: prop('id'),\n })),\n headers: {},\n auth: {\n mode: 'inherit',\n },\n errorPolicy: 'throw',\n },\n\n outputs: {\n item: output()\n .from(data('item')),\n },\n\n mock: {\n enabled: false,\n data: null,\n },\n})\n";
@@ -4,8 +4,11 @@ interface TypeSourceReferenceLocation extends SourceDocumentReference {
4
4
  }
5
5
  /** Собирает ссылки на Type Registry из поддержанных Type Source выражений. */
6
6
  export declare function collectTypeSourceReferences(source: string): TypeSourceReferenceLocation[];
7
+ /** Collects Type Registry references from value(Type, ...) calls in Configuration Source. */
8
+ export declare function collectConfigurationTypeSourceReferences(source: string): TypeSourceReferenceLocation[];
7
9
  /** Переводит ссылки на типы в канонический синтаксис без кавычек. */
8
10
  export declare function normalizeTypeSourceReferences(source: string): string;
9
11
  /** Находит ссылку Type Source в позиции редактора. */
10
12
  export declare function resolveTypeSourceReference(context: SourceLanguageContext): SourceDocumentReference | null;
13
+ export declare function resolveConfigurationTypeSourceReference(context: SourceLanguageContext): SourceDocumentReference | null;
11
14
  export {};
@@ -1,5 +1,6 @@
1
- import { TypeSourceDocument } from '../../../domain/types/source/type-source.types';
1
+ import { TypeSourceDocument, TypeSourceExpression } from '../../../domain/types/source/type-source.types';
2
2
  /** Deterministic serializer for canonical Type Source v1 documents. */
3
3
  export declare function serializeTypeSourceDocument(document: TypeSourceDocument): string;
4
+ export declare function serializeTypeSourceExpression(expression: TypeSourceExpression, indent?: number): string;
4
5
  /** Serializes one named type reference using canonical bare syntax when possible. */
5
6
  export declare function serializeTypeSourceReference(identity: string): string;
@@ -0,0 +1,5 @@
1
+ import { EndgeTooltipMarkdownBlock } from '../../../domain/types/ui/tooltip-markdown.types';
2
+ /** Parses the intentionally small, safe Tooltip Markdown subset without producing HTML. */
3
+ export declare function parseEndgeTooltipMarkdown(source: unknown): EndgeTooltipMarkdownBlock[];
4
+ /** Stable DOM id for one consumer-scoped tooltip without leaking source values into selectors. */
5
+ export declare function createEndgeTooltipDomId(seed: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,18 @@
1
- import { ComponentSFCInteractionTrigger, ComponentSFCInteractionTriggerEvent, ComponentSFCInteractionTriggerPlatform } from '../domain/types/component/sfc/ir.types';
1
+ import { ComponentSFCInteractionTrigger, ComponentSFCInteractionTriggerEvent, ComponentSFCInteractionTriggerHeldKeys, ComponentSFCInteractionKeyboardCondition, ComponentSFCInteractionTriggerModifiers, ComponentSFCInteractionTriggerPlatform } from '../domain/types/component/sfc/ir.types';
2
2
  /** Normalizes the shared `edit-on` / `on` trigger value. */
3
3
  export declare function normalizeComponentSFCInteractionTriggers(value: unknown): ComponentSFCInteractionTrigger[];
4
4
  /** Проверяет один нормализованный trigger без зависимости от DOM и конкретного renderer-а. */
5
5
  export declare function matchesComponentSFCInteractionTrigger(trigger: ComponentSFCInteractionTrigger, event: ComponentSFCInteractionTriggerEvent, platform: ComponentSFCInteractionTriggerPlatform): boolean;
6
6
  /** Приводит browser platform label к стабильным значениям edit-on контракта. */
7
7
  export declare function resolveComponentSFCInteractionTriggerPlatform(value: unknown): ComponentSFCInteractionTriggerPlatform;
8
+ export declare function normalizeComponentSFCInteractionHeldKeys(value: unknown): ComponentSFCInteractionTriggerHeldKeys | undefined;
9
+ /** Normalizes a reusable condition on the current keyboard state. */
10
+ export declare function normalizeComponentSFCInteractionKeyboardCondition(value: unknown): ComponentSFCInteractionKeyboardCondition | undefined;
11
+ export declare function normalizeComponentSFCInteractionModifiers(value: unknown): ComponentSFCInteractionTriggerModifiers | undefined;
12
+ export declare function matchesComponentSFCInteractionHeldKeys(expected: ComponentSFCInteractionTriggerHeldKeys | undefined, actual: ComponentSFCInteractionTriggerEvent['held']): boolean;
13
+ /** Checks modifiers and ordinary held keys against one keyboard snapshot. */
14
+ export declare function matchesComponentSFCInteractionKeyboardCondition(expected: ComponentSFCInteractionKeyboardCondition | undefined, actual: Pick<ComponentSFCInteractionTriggerEvent, 'held' | 'modifiers'>, platform: ComponentSFCInteractionTriggerPlatform): boolean;
15
+ export declare function matchesComponentSFCInteractionModifiers(expected: ComponentSFCInteractionTriggerModifiers | undefined, actual: ComponentSFCInteractionTriggerEvent['modifiers'], platform: ComponentSFCInteractionTriggerPlatform): boolean;
8
16
  /** Backward-compatible editable wrappers. */
9
17
  export declare const normalizeComponentSFCEditTriggers: typeof normalizeComponentSFCInteractionTriggers;
10
18
  export declare const matchesComponentSFCEditTrigger: typeof matchesComponentSFCInteractionTrigger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@endge/core",
3
- "version": "2.0.1",
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.10",
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.8",
50
- "@endge/utils": "^0.24.10",
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",