Foblex / f-flow

Foblex Flow - is an Angular library designed to simplify the creation and manipulation of dynamic flow. Provides components for flows, nodes, and connections, automating node manipulation and inter-node connections.
https://flow.foblex.com/
MIT License
57 stars 11 forks source link

Bug: Cannot get it working #48

Closed cornem closed 4 days ago

cornem commented 4 days ago

Description

I'm trying to add your library to my Angular project, but I'm unable to get it to work. It fails to build.

Steps to Reproduce

version 12.6.1 If I add @foblex/flow (12.6.1) with @foblex/core (1.2.5) it fails to compile with errors (there are many):

./node_modules/@foblex/flow/fesm2022/foblex-flow.mjs:4512:67-85 
- Error: export 'WindowService' (imported as 'i3$1') was not found in '@foblex/core' (possible exports: Arc, BooleanExtensions, DomElementExtensions, EOperationSystem, EventExtensions, GuidExtensions, IDragAndDropBase, IMouseEvent, IPointerEvent, ITouchDownEvent, ITouchMoveEvent, ITouchUpEvent, Line, LineExtensions, MOUSE_EVENT_IGNORE_TIME, MouseEventExtensions, NumberExtensions, PlatformService, Point, PointExtensions, RectExtensions, SizeExtensions, TransformModelExtensions, VectorExtensions, defaultTransformModel, mixinChangePosition, mixinChangeZoom, mixinFitToParent, mixinOneToOneCentering, parseTransformModel, sanitizeElementId)

If I add @foblex/flow (12.6.1) with @foblex/core (1.2.3) it fails to compile with this errors (there are many):

Error: node_modules/@foblex/flow/f-backgroud/f-circle-pattern/f-circle-pattern.component.d.ts:31:96 
- Error TS2344: Type '{ id: { alias: "id"; required: false; }; color: { alias: "color"; required: false; }; radius: { alias: "radius"; required: false; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
  Property '"id"' is incompatible with index signature.
    Type '{ alias: "id"; required: false; }' is not assignable to type 'string'.

Expected Result

A working app.

Actual Result

Compilation errors.

Environment Details

Angular v15

Screenshots or Videos

No response

Additional Context

No response

siarheihuzarevich commented 4 days ago

@cornem Thank you for bringing this issue to our attention. We’ve identified and fixed the problem with the missing WindowService in @foblex/core. To resolve the error, please reinstall @foblex/f-flow in your project:

1.  Remove the existing @foblex/flow and @foblex/core packages from your node_modules directory and package.json.
2.  Run npm install @foblex/flow to install the latest version with the fix.
cornem commented 4 days ago

The latest version doesn't work for me either:

Error: node_modules/@foblex/flow/f-backgroud/f-circle-pattern/f-circle-pattern.component.d.ts:33:96 - error TS2344: Type '{ id: { alias: "id"; required: false; }; color: { alias: "color"; required: false; }; radius: { alias: "radius"; required: false; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
  Property '"id"' is incompatible with index signature.
    Type '{ alias: "id"; required: false; }' is not assignable to type 'string'.

33     static ɵcmp: i0.ɵɵComponentDeclaration<FCirclePatternComponent, "f-circle-pattern", never, { "id": { "alias": "id"; "required": false; }; "color": { "alias": "color"; "required": false; }; "radius": { "alias": "radius"; "required": false; }; }, {}, never, never, false, never>;

Is this library compatible with Angular v15?

siarheihuzarevich commented 4 days ago

Yes, it fully supports versions starting from 12. I will try to investigate your problem

siarheihuzarevich commented 4 days ago

@cornem Yes, we found a bug, we will try to fix it today.

siarheihuzarevich commented 4 days ago

@cornem Fixed. v12.6.3

  1. Remove the existing @foblex/flow and @foblex/core packages from your node_modules directory and package.json.
  2. Run npm install @foblex/flow to install the latest version with the fix.