-
Notifications
You must be signed in to change notification settings - Fork 221
feat: modernize angular split #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f36da15
45db74b
5fc3aa9
b06ea6d
15f2f11
28002a2
cedf889
2f30982
bff7d73
f55e174
fe906b4
8d6d10d
4ee3e27
19502de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,10 +39,6 @@ | |
| "zone.js": "~0.14.2" | ||
| }, | ||
| "devDependencies": { | ||
| "lint-staged": "^14.0.1", | ||
| "angular-cli-ghpages": "^2.0.0-beta.2", | ||
| "husky": "^8.0.3", | ||
| "prettier": "^3.0.2", | ||
| "@angular-devkit/architect": "^0.1701.0", | ||
| "@angular-devkit/build-angular": "^17.1.0", | ||
| "@angular-devkit/core": "^17.1.0", | ||
|
|
@@ -62,10 +58,14 @@ | |
| "@types/node": "20.5.4", | ||
| "@typescript-eslint/eslint-plugin": "6.19.0", | ||
| "@typescript-eslint/parser": "6.19.0", | ||
| "cypress": "12.17.4", | ||
| "angular-cli-ghpages": "^2.0.0-beta.2", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use a none beta version or is there a issue with this version?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a great question. I don't know why this is beta. If you look at line 43 before my changes it was beta to begin with. The cypress update just moved those dependencies around (ABC order) |
||
| "cypress": "^13.10.0", | ||
| "eslint": "^8.56.0", | ||
| "husky": "^8.0.3", | ||
| "lint-staged": "^14.0.1", | ||
| "ng-packagr": "^17.0.0", | ||
| "postcss": "8.4.28", | ||
| "prettier": "^3.0.2", | ||
| "serve": "^14.2.1", | ||
| "ts-node": "10.9.1", | ||
| "tslib": "^2.6.2", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,47 @@ | ||
| import { InjectionToken } from '@angular/core' | ||
| import { IDefaultOptions } from './interface' | ||
| import { InjectionToken, Provider, inject } from '@angular/core' | ||
| import { SplitDir, SplitDirection, SplitUnit } from './models' | ||
|
|
||
| export const ANGULAR_SPLIT_DEFAULT_OPTIONS = new InjectionToken<Partial<IDefaultOptions>>('angular-split-global-config') | ||
| export interface AngularSplitDefaultOptions { | ||
| dir: SplitDir | ||
| direction: SplitDirection | ||
| disabled: boolean | ||
| gutterDblClickDuration: number | ||
| gutterSize: number | ||
| gutterStep: number | ||
| gutterClickDeltaPx: number | ||
| restrictMove: boolean | ||
| unit: SplitUnit | ||
| useTransition: boolean | ||
| } | ||
|
|
||
| const defaultOptions: AngularSplitDefaultOptions = { | ||
| dir: 'ltr', | ||
| direction: 'horizontal', | ||
| disabled: false, | ||
| gutterDblClickDuration: 0, | ||
| gutterSize: 11, | ||
| gutterStep: 1, | ||
| gutterClickDeltaPx: 2, | ||
| restrictMove: false, | ||
| unit: 'percent', | ||
| useTransition: false, | ||
| } | ||
|
|
||
| export const ANGULAR_SPLIT_DEFAULT_OPTIONS = new InjectionToken<AngularSplitDefaultOptions>( | ||
| 'angular-split-global-config', | ||
| { providedIn: 'root', factory: () => defaultOptions }, | ||
| ) | ||
|
|
||
| /** | ||
| * Provides default options for angular split. The options object has hierarchical inheritance | ||
| * which means only the declared properties will be overridden | ||
| */ | ||
| export function provideAngularSplitOptions(options: Partial<AngularSplitDefaultOptions>): Provider { | ||
| return { | ||
| provide: ANGULAR_SPLIT_DEFAULT_OPTIONS, | ||
| useFactory: (): AngularSplitDefaultOptions => ({ | ||
| ...inject(ANGULAR_SPLIT_DEFAULT_OPTIONS, { skipSelf: true }), | ||
| ...options, | ||
| }), | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHy is this change needed for cypress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't seem to figure out how it worked before. The transition is 1.5s and the delay is 1.5s. When running live it works well but fails in CI run.
At 1500 it fails on 9 pixels instead of 0
At 1600 it fails on 5 pixels instead of 0
At 2000 it passes
Not sure what to do about it...