Skip to content

Commit

Permalink
Merge pull request #1560 from TouK/dev
Browse files Browse the repository at this point in the history
dev -> master
  • Loading branch information
JulianWielga authored Sep 16, 2024
2 parents a3fc1f5 + 3fd339e commit 2d7feb2
Show file tree
Hide file tree
Showing 34 changed files with 2,820 additions and 1,332 deletions.
39 changes: 34 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@ jobs:
docs:
runs-on: ubuntu-latest
needs: [ "build", "release" ]
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: dev
- uses: actions/setup-node@v3
with:
node-version: 20
Expand All @@ -135,6 +138,32 @@ jobs:
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run deploy-storybook -- --ci --host-token-env-variable=GITHUB_TOKEN
env:
GITHUB_TOKEN: JulianWielga:${{ secrets.GITHUB_TOKEN }}
- run: |
VERSION=$(npm pkg get version | tr -d '"')
echo "version=$VERSION" >> $GITHUB_ENV
- run: npm run build-storybook -- -o docs
- name: publish version
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
destination_dir: v${{ env.version }}
- name: publish latest
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
destination_dir: latest
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: gh-pages
- name: generate index.html
run: node .scripts/generateIndex.js
- name: update index.html
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.out
keep_files: true
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
# [1.9.0-beta.9](https://github.com/touk/nk-windows/compare/v1.9.0-beta.8...v1.9.0-beta.9) (2024-09-03)


### Bug Fixes

* safari pinch-to-zoom crash ([1ebc843](https://github.com/touk/nk-windows/commit/1ebc843ad318166d2558672de67c223818408901))

# [1.9.0-beta.8](https://github.com/touk/nk-windows/compare/v1.9.0-beta.7...v1.9.0-beta.8) (2024-08-14)


### Bug Fixes

* type definitions ([e30bbc9](https://github.com/touk/nk-windows/commit/e30bbc92122706996bbfe0dbb0a21f3ab7f96e47))

# [1.9.0-beta.7](https://github.com/touk/nk-windows/compare/v1.9.0-beta.6...v1.9.0-beta.7) (2024-08-14)


### Bug Fixes

* support keyboard in header buttons ([66755de](https://github.com/touk/nk-windows/commit/66755de530939e7b7820b14adcc841dc2337ec42))

# [1.9.0-beta.6](https://github.com/touk/nk-windows/compare/v1.9.0-beta.5...v1.9.0-beta.6) (2024-08-13)


### Features

* moved window size props to layoutData ([d2e94c7](https://github.com/touk/nk-windows/commit/d2e94c7f4931b4ffa5ba5c49a7124805552d6088))
* set initial position with layoutData ([c59adf7](https://github.com/touk/nk-windows/commit/c59adf7fa5631e85730a4f8e3d92873e4eba3573))

# [1.9.0-beta.5](https://github.com/touk/nk-windows/compare/v1.9.0-beta.4...v1.9.0-beta.5) (2024-08-12)


### Bug Fixes

* clicking outside when modal mode is disabled ([7ed67fb](https://github.com/touk/nk-windows/commit/7ed67fb7d20a653a3d2b725567829e8557049360))

# [1.9.0-beta.4](https://github.com/touk/nk-windows/compare/v1.9.0-beta.3...v1.9.0-beta.4) (2024-07-25)


### Bug Fixes

* window lazy loading animation ([5a14fcf](https://github.com/touk/nk-windows/commit/5a14fcf478d55f9cbbb2c8e2d974dbad0c57aceb))

# [1.9.0-beta.3](https://github.com/touk/nk-windows/compare/v1.9.0-beta.2...v1.9.0-beta.3) (2024-07-23)


### Bug Fixes

* window move issue ([2f3bde5](https://github.com/touk/nk-windows/commit/2f3bde55a27ceca59bd8e0b031a3a9375cea2c6b))

# [1.9.0-beta.2](https://github.com/touk/nk-windows/compare/v1.9.0-beta.1...v1.9.0-beta.2) (2024-07-19)


### Bug Fixes

* Add nodeRef and fix Warning: findDOMNode is deprecated and will be removed for react-transition-group ([6683e24](https://github.com/touk/nk-windows/commit/6683e24558307003cf839eb48c58662773848b4e))
* position when a window is full height ([b822c7b](https://github.com/touk/nk-windows/commit/b822c7b832210b02d0631c11ec774368a932ca3e))

# [1.9.0-beta.1](https://github.com/touk/nk-windows/compare/v1.8.0...v1.9.0-beta.1) (2024-06-17)


### Bug Fixes

* position of a window after full-screen zoom via title double click and zoom out via header icon ([1d4b2e1](https://github.com/touk/nk-windows/commit/1d4b2e1c1b19e12a23ced0bb22703e055de923ad))


### Features

* react 18 support ([d4ad55d](https://github.com/touk/nk-windows/commit/d4ad55d918ed73e039ae28edeb670b50860af691))

# [1.8.0](https://github.com/touk/nk-windows/compare/v1.7.1...v1.8.0) (2024-05-15)


Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 25 additions & 11 deletions cypress/e2e/demo.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
context("WM", () => {
const screenshotConfig = { blackout: ["ol[role='tree']"] };
const defaultWait = 800;

beforeEach(() => {
cy.visit("iframe.html?args=&id=demo--defult&viewMode=story");
Expand All @@ -14,7 +15,6 @@ context("WM", () => {
it("should maximize/restore window", () => {
cy.contains("with title").click();
cy.get("[data-testid='window-frame']").should("be.visible").as("window");
cy.get("@window").contains("scroll to bottom").should("be.enabled");
cy.document().matchImage({ screenshotConfig });
cy.get("@window").contains("with title").dblclick();
cy.document().matchImage({ screenshotConfig });
Expand All @@ -26,14 +26,14 @@ context("WM", () => {
it("should prevent window from going offscreen", () => {
cy.contains("danger").click();
cy.get("[data-testid='window-frame']").should("be.visible").as("window");
cy.contains("to bottom").should("be.enabled");
cy.contains("to bottom").should("be.disabled");
cy.document().matchImage({ screenshotConfig });
cy.viewport(500, 500);
cy.wait(300);
cy.document().matchImage({ screenshotConfig });
cy.wait(defaultWait);
cy.get("[data-testid='window-frame']").matchImage({ screenshotConfig });
cy.contains("to bottom").should("be.enabled");
cy.viewport("macbook-13");
cy.wait(300);
cy.viewport(1280, 720);
cy.wait(defaultWait);
cy.contains("to bottom").should("be.disabled");
cy.contains("add line").should("be.visible").click().click().click();
cy.contains("to bottom").should("be.enabled");
Expand All @@ -43,14 +43,14 @@ context("WM", () => {
it("should prevent window from going offscreen (minimal size)", () => {
cy.contains("minimal size").click();
cy.get("[data-testid='window-frame']").should("be.visible").as("window");
cy.contains("to bottom").should("be.enabled");
cy.contains("to bottom").should("be.disabled");
cy.document().matchImage({ screenshotConfig });
cy.viewport(500, 500);
cy.wait(300);
cy.document().matchImage({ screenshotConfig });
cy.wait(defaultWait);
cy.get("[data-testid='window-frame']").matchImage({ screenshotConfig });
cy.contains("to bottom").should("be.enabled");
cy.viewport("macbook-13");
cy.wait(300);
cy.viewport(1280, 720);
cy.wait(defaultWait);
cy.contains("to bottom").should("be.disabled");
cy.contains("add line").should("be.visible").click().click().click();
cy.contains("to bottom").should("be.enabled");
Expand All @@ -67,4 +67,18 @@ context("WM", () => {
expect(left).to.eq(Math.round(left));
});
});

it("should respect layoutData position", () => {
cy.viewport(1000, 1000);
cy.contains("left").click();
cy.get("[data-testid='window-frame']")
.should("be.visible")
.should(($el) => {
const { top, left, right, bottom } = $el[0].getBoundingClientRect();
expect(top).to.eq(50);
expect(left).to.eq(200);
expect(right).to.eq(950);
expect(bottom).to.eq(800);
});
});
});
Loading

0 comments on commit 2d7feb2

Please sign in to comment.