@elyx-code/project-logic-tree 0.0.6275 → 0.0.6277

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 { ActionDescriptorState, DefinitionEntityState, DataTypeState, InputMapState, OperationState, OutputMapState, ProjectState } from '../../../state';
2
- import { IChangeSet, ChangeSet } from '../../../state/change-set';
2
+ import { IChangeSet, ChangeSet } from '../../../state/change-set/change-set';
3
3
 
4
4
  export declare class ValidateDataOperation extends ActionDescriptorState {
5
5
  readonly autoexecutable = true;
@@ -0,0 +1,95 @@
1
+ import { EntityId, EntityType, UserManagedElementShallowTransfer } from '../../../definitions';
2
+ import { UserManagedEntityState } from '../types';
3
+ import { ProjectState } from '../project';
4
+
5
+ export interface IChangeSet<TSelf extends {
6
+ id: string;
7
+ type: EntityType;
8
+ } | null = UserManagedEntityState, TGeneric extends {
9
+ id: string;
10
+ type: EntityType;
11
+ } = UserManagedEntityState> {
12
+ added: TGeneric[];
13
+ updated: TGeneric[];
14
+ removed: TGeneric[];
15
+ affected: TGeneric[];
16
+ self: TSelf;
17
+ }
18
+ export interface IRecordChangeSet<TSelf extends {
19
+ id: string;
20
+ type: EntityType;
21
+ } | null = UserManagedElementShallowTransfer, TGeneric extends {
22
+ id: string;
23
+ type: EntityType;
24
+ } = UserManagedElementShallowTransfer> {
25
+ added: Record<EntityId, TGeneric>;
26
+ updated: Record<EntityId, TGeneric>;
27
+ removed: Record<EntityId, TGeneric>;
28
+ affected: EntityId[];
29
+ self: TSelf;
30
+ seenEntities: EntityId[];
31
+ }
32
+ export declare enum ChangeSetChangeCaptureType {
33
+ Manual = "manual",
34
+ Automatic = "automatic"
35
+ }
36
+ export declare enum ChangeSetEntityChangeType {
37
+ Added = "added",
38
+ Updated = "updated",
39
+ Removed = "removed",
40
+ Affected = "affected"
41
+ }
42
+ export declare class ChangeSet {
43
+ id: string;
44
+ seenEntities: EntityId[];
45
+ added: Record<EntityId, UserManagedEntityState>;
46
+ updated: Record<EntityId, UserManagedEntityState>;
47
+ removed: Record<EntityId, UserManagedEntityState>;
48
+ affected: Record<EntityId, UserManagedEntityState>;
49
+ self: UserManagedEntityState | null;
50
+ author: string;
51
+ timestamp: string;
52
+ open: boolean;
53
+ dirty: boolean;
54
+ type: ChangeSetChangeCaptureType;
55
+ autoclose: boolean;
56
+ autoCloseActionName: string;
57
+ project: ProjectState;
58
+ constructor(project: ProjectState, author: string, timestamp: string, // ISO 8601 format
59
+ self: UserManagedEntityState | null, autoclose?: boolean, autoCloseActionName?: string);
60
+ get index(): number | null;
61
+ get isEmpty(): boolean;
62
+ get isValid(): boolean;
63
+ get list(): UserManagedEntityState[];
64
+ get listAdded(): UserManagedEntityState[];
65
+ get listUpdated(): UserManagedEntityState[];
66
+ get listRemoved(): UserManagedEntityState[];
67
+ get listAffected(): UserManagedEntityState[];
68
+ get addedIds(): EntityId[];
69
+ get updatedIds(): EntityId[];
70
+ get removedIds(): EntityId[];
71
+ get affectedIds(): EntityId[];
72
+ discardOrphans(): void;
73
+ captureAllChangesInVersionInstances(): void;
74
+ attemptAutocloseAsync(knownAutoCloseActionName: string, closingEntityId: EntityId): Promise<ChangeSet>;
75
+ closeAsync(): Promise<ChangeSet>;
76
+ attemptAutoclose(knownAutoCloseActionName: string, closingEntityId: EntityId): ChangeSet;
77
+ recursiveCaptureUpstreamVersions(): void;
78
+ sanitize(): void;
79
+ beforeClose(): void;
80
+ emitSideEffects(): void;
81
+ close(): ChangeSet;
82
+ addDependentsToAffected(entity: UserManagedEntityState): void;
83
+ get(entityId: EntityId): UserManagedEntityState | null;
84
+ remove(entityId: EntityId): ChangeSet;
85
+ add(entity: UserManagedEntityState, changeType: ChangeSetEntityChangeType, options?: {
86
+ preventRecursion?: boolean;
87
+ }): ChangeSet;
88
+ toJSON(): IRecordChangeSet<UserManagedElementShallowTransfer | null, UserManagedElementShallowTransfer>;
89
+ has(entityId: EntityId): boolean;
90
+ hasAdded(entityId: EntityId): boolean;
91
+ hasUpdated(entityId: EntityId): boolean;
92
+ hasRemoved(entityId: EntityId): boolean;
93
+ hasAffected(entityId: EntityId): boolean;
94
+ }
95
+ export declare function changeSetJSONRecordToUniqueIds(changeSet: IRecordChangeSet): Set<EntityId>;
@@ -1,95 +1,3 @@
1
- import { EntityId, EntityType, UserManagedElementShallowTransfer } from '../../../definitions';
2
- import { UserManagedEntityState } from '../types';
3
- import { ProjectState } from '../project';
4
-
5
- export interface IChangeSet<TSelf extends {
6
- id: string;
7
- type: EntityType;
8
- } | null = UserManagedEntityState, TGeneric extends {
9
- id: string;
10
- type: EntityType;
11
- } = UserManagedEntityState> {
12
- added: TGeneric[];
13
- updated: TGeneric[];
14
- removed: TGeneric[];
15
- affected: TGeneric[];
16
- self: TSelf;
17
- }
18
- export interface IRecordChangeSet<TSelf extends {
19
- id: string;
20
- type: EntityType;
21
- } | null = UserManagedElementShallowTransfer, TGeneric extends {
22
- id: string;
23
- type: EntityType;
24
- } = UserManagedElementShallowTransfer> {
25
- added: Record<EntityId, TGeneric>;
26
- updated: Record<EntityId, TGeneric>;
27
- removed: Record<EntityId, TGeneric>;
28
- affected: EntityId[];
29
- self: TSelf;
30
- seenEntities: EntityId[];
31
- }
32
- export declare enum ChangeSetChangeCaptureType {
33
- Manual = "manual",
34
- Automatic = "automatic"
35
- }
36
- export declare enum ChangeSetEntityChangeType {
37
- Added = "added",
38
- Updated = "updated",
39
- Removed = "removed",
40
- Affected = "affected"
41
- }
42
- export declare class ChangeSet {
43
- id: string;
44
- seenEntities: EntityId[];
45
- added: Record<EntityId, UserManagedEntityState>;
46
- updated: Record<EntityId, UserManagedEntityState>;
47
- removed: Record<EntityId, UserManagedEntityState>;
48
- affected: Record<EntityId, UserManagedEntityState>;
49
- self: UserManagedEntityState | null;
50
- author: string;
51
- timestamp: string;
52
- open: boolean;
53
- dirty: boolean;
54
- type: ChangeSetChangeCaptureType;
55
- autoclose: boolean;
56
- autoCloseActionName: string;
57
- project: ProjectState;
58
- constructor(project: ProjectState, author: string, timestamp: string, // ISO 8601 format
59
- self: UserManagedEntityState | null, autoclose?: boolean, autoCloseActionName?: string);
60
- get index(): number | null;
61
- get isEmpty(): boolean;
62
- get isValid(): boolean;
63
- get list(): UserManagedEntityState[];
64
- get listAdded(): UserManagedEntityState[];
65
- get listUpdated(): UserManagedEntityState[];
66
- get listRemoved(): UserManagedEntityState[];
67
- get listAffected(): UserManagedEntityState[];
68
- get addedIds(): EntityId[];
69
- get updatedIds(): EntityId[];
70
- get removedIds(): EntityId[];
71
- get affectedIds(): EntityId[];
72
- discardOrphans(): void;
73
- captureAllChangesInVersionInstances(): void;
74
- attemptAutocloseAsync(knownAutoCloseActionName: string, closingEntityId: EntityId): Promise<ChangeSet>;
75
- closeAsync(): Promise<ChangeSet>;
76
- attemptAutoclose(knownAutoCloseActionName: string, closingEntityId: EntityId): ChangeSet;
77
- recursiveCaptureUpstreamVersions(): void;
78
- sanitize(): void;
79
- beforeClose(): void;
80
- emitSideEffects(): void;
81
- close(): ChangeSet;
82
- addDependentsToAffected(entity: UserManagedEntityState): void;
83
- get(entityId: EntityId): UserManagedEntityState | null;
84
- remove(entityId: EntityId): ChangeSet;
85
- add(entity: UserManagedEntityState, changeType: ChangeSetEntityChangeType, options?: {
86
- preventRecursion?: boolean;
87
- }): ChangeSet;
88
- toJSON(): IRecordChangeSet<UserManagedElementShallowTransfer | null, UserManagedElementShallowTransfer>;
89
- has(entityId: EntityId): boolean;
90
- hasAdded(entityId: EntityId): boolean;
91
- hasUpdated(entityId: EntityId): boolean;
92
- hasRemoved(entityId: EntityId): boolean;
93
- hasAffected(entityId: EntityId): boolean;
94
- }
95
- export declare function changeSetJSONRecordToUniqueIds(changeSet: IRecordChangeSet): Set<EntityId>;
1
+ export * from './change-set';
2
+ export * from './side-effect-events';
3
+ export * from './versioning';
@@ -1,3 +1,3 @@
1
- import { ChangeSet } from '.';
1
+ import { ChangeSet } from './change-set';
2
2
 
3
3
  export declare function emitSideEffects(changeSet: ChangeSet): ChangeSet;
@@ -0,0 +1,12 @@
1
+ import { ChangeSet } from './change-set';
2
+ import { ProjectState } from '../project';
3
+ import { UserManagedEntityState } from '../types';
4
+
5
+ export interface IProjectVersionTransitionConfig {
6
+ transitionalChangeSet: ChangeSet;
7
+ transitionTime: string;
8
+ timeOfOriginalTargetChanges: string;
9
+ }
10
+ export declare function transitionProjectVersion(from: ChangeSet | 'initial', to: ChangeSet | 'initial', project: ProjectState): IProjectVersionTransitionConfig;
11
+ export declare function traverseChangeSet(changeSet: ChangeSet, onAdded: (entity: UserManagedEntityState) => void, onUpdated: (entity: UserManagedEntityState) => void, onRemoved: (entity: UserManagedEntityState) => void): void;
12
+ export declare function rebaseStack<T = any>(undoableStackValueIndex: number, history: T[], newItem: T): number;
@@ -27,7 +27,7 @@ export * from './built-in-base-entity';
27
27
  export * from './literal-value';
28
28
  export * from './create';
29
29
  export * from './types';
30
- export * from './change-set';
30
+ export * from './change-set/change-set';
31
31
  export * from './error';
32
32
  export * from './store';
33
33
  export * from './validate';
@@ -13,7 +13,7 @@ import { PrimitiveEntityState } from '../primitive-entity';
13
13
  import { DataTypeState } from '../data-type';
14
14
  import { LiteralValueState } from '../literal-value';
15
15
  import { EntityState, EntryPointEntityState, VariableState, EntityWithValueState, IModuleInjection, TerminationState, UserManagedEntityState } from '../types';
16
- import { ChangeSet, IChangeSet } from '../change-set';
16
+ import { ChangeSet, IChangeSet, IProjectVersionTransitionConfig } from '../change-set';
17
17
  import { LoopState } from '../loop';
18
18
  import { SearchState } from '../search';
19
19
  import { VariableInstanceState } from '../variable-instance';
@@ -86,6 +86,7 @@ export declare class ProjectState extends CombinedVersionedEvents implements IPr
86
86
  errors: EntityError[];
87
87
  references: IGenericReference[];
88
88
  history: ChangeSet[];
89
+ undoableStackValueIndex: number;
89
90
  detachedDependents: Record<EntityId, {
90
91
  entity: UserManagedEntityState;
91
92
  field: string;
@@ -134,8 +135,6 @@ export declare class ProjectState extends CombinedVersionedEvents implements IPr
134
135
  self: UserManagedEntityState | null, autoclose?: boolean, autoCloseActionName?: string): ChangeSet;
135
136
  addChangeSet(changeSet: ChangeSet): ChangeSet;
136
137
  discardChangeSet(changeSet: ChangeSet | null): ProjectState;
137
- undo(): IChangeSet<ProjectState>;
138
- redo(): IChangeSet<ProjectState>;
139
138
  inject(...injectedModules: IModuleInjection[]): Promise<ProjectState>;
140
139
  validateGeneratedUpdate(data: Partial<IProjectGenerationTarget>): {
141
140
  errors: EntityGenerationError[];
@@ -257,6 +256,8 @@ export declare class ProjectState extends CombinedVersionedEvents implements IPr
257
256
  attachOrphanReferences(): ProjectState;
258
257
  getBuiltInPersistedEntity(): BuiltInBaseEntityState | null;
259
258
  requestActiveValue(valueOwner: EntityWithValueState): LiteralValueState | null;
259
+ undo(): IProjectVersionTransitionConfig;
260
+ redo(): IProjectVersionTransitionConfig;
260
261
  }
261
262
  export type ProjectPayloadUnion = ProjectState | ProjectTypesUnion;
262
263
  export {};
@@ -1,6 +1,6 @@
1
1
  import { BaseEntityNames, ElementGenerationTarget, ElementShallowTransfer, ElementTransfer, EntityType, Element, IGenericReference, EntityId, ValueReadingEntity, IActionDescriptor, IActionDescriptorTransfer, IArgumentDeclaration, IArgumentDeclarationTransfer, DraggableElement, Reference, IBreakStatement, IBreakStatementTransfer, IBuiltInBaseEntity, IBuiltInBaseEntityTransfer, ICondition, IConditionTransfer, IContinueStatement, IContinueStatementTransfer, CallableEntity, CallableEntityTransfer, CallerEntity, CallerEntityTransfer, IDefinitionEntity, IDefinitionEntityTransfer, IDataType, IDataTypeTransfer, IFunctionCall, IFunctionCallTransfer, IFunctionDeclaration, IFunctionDeclarationTransfer, IGlobalEvent, IGlobalEventTransfer, IInputMap, IInputMapTransfer, IInstalledProject, IInstalledProjectTransfer, IInternalCall, IInternalCallTransfer, ILiteralValue, ILiteralValueTransfer, ILoop, ILoopTransfer, IOperation, IOperationTransfer, IOutputMap, IOutputMapTransfer, IPrimitiveEntity, IPrimitiveEntityTransfer, IProject, IProjectTransfer, IProperty, IPropertyTransfer, IReturnDeclaration, IReturnDeclarationTransfer, IReturnStatement, IReturnStatementTransfer, ISearch, ISearchTransfer, IValueDescriptor, IValueDescriptorTransfer, IVariableDeclarationTransfer, IVariableDeclaration, IVariableInstance, IVariableInstanceTransfer, DraggableElementTransfer, ValueReadingEntityTransfer, IActionDescriptorShallowTransfer, IDataTypeShallowTransfer, IDefinitionEntityShallowTransfer, IFunctionDeclarationShallowTransfer, IInstalledProjectShallowTransfer, ILoopShallowTransfer, IOperationShallowTransfer, ILiteralValueShallowTransfer, IPrimitiveEntityShallowTransfer, IProjectShallowTransfer, IPropertyShallowTransfer, IReturnDeclarationShallowTransfer, IReturnStatementShallowTransfer, ISearchShallowTransfer, IValueDescriptorShallowTransfer, IVariableDeclarationShallowTransfer, IVariableInstanceShallowTransfer, IFunctionCallShallowTransfer, IGlobalEventShallowTransfer, IInputMapShallowTransfer, IInternalCallShallowTransfer, CallableEntityShallowTransfer, IOutputMapShallowTransfer, IConditionShallowTransfer, IContinueStatementShallowTransfer, IBreakStatementShallowTransfer, IArgumentDeclarationShallowTransfer, IBuiltInBaseEntityShallowTransfer, DraggableElementShallowTransfer } from '../../definitions';
2
2
  import { DraggableCallableEntityState, CanvasEntityState, EntityState, EntityWithLogicScopeState, EntryPointEntityState, DraggableExecutableEntityState, DraggablePassThroughCallableEntityState, ValueReadingEntityState, ValueWritingEntityState, EntityWithValueState, VariableState, BuiltInBaseEntityState, TerminationState, ExecutableEntityState, ValueDescriptorState, CallableEntityState, CallerEntityState, PassThroughCallableEntityState, PrimitiveEntityState, InternalCallState } from '../state';
3
- import { IChangeSet, IRecordChangeSet, ChangeSet } from '../state/change-set';
3
+ import { IChangeSet, IRecordChangeSet, ChangeSet } from '../state/change-set/change-set';
4
4
  import { FunctionCallState } from '../state/function-call';
5
5
  import { InputMapState } from '../state/input-map';
6
6
  import { VariableDeclarationState } from '../state/variable-declaration';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyx-code/project-logic-tree",
3
- "version": "0.0.6275",
3
+ "version": "0.0.6277",
4
4
  "author": "Sergio Herrero",
5
5
  "license": "UNLICENSED",
6
6
  "description": "An installable module which contains the type definitions and ephemeral state management for a projects' logic tree data structure",