From 3136ce7dc28c2906748c7023bb72ca409c4ec9b8 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 9 Sep 2021 11:07:47 +0200 Subject: [PATCH 1/6] :sparkles: Add missing frame index on viewer. --- frontend/src/app/main/ui/viewer.cljs | 1 + frontend/src/app/main/ui/viewer/header.cljs | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/main/ui/viewer.cljs b/frontend/src/app/main/ui/viewer.cljs index 36e6c5fc0..c3b54d8bb 100644 --- a/frontend/src/app/main/ui/viewer.cljs +++ b/frontend/src/app/main/ui/viewer.cljs @@ -86,6 +86,7 @@ :handoff-layout (= section :handoff))} [:& header {:project project + :index index :file file :page page :frame frame diff --git a/frontend/src/app/main/ui/viewer/header.cljs b/frontend/src/app/main/ui/viewer/header.cljs index 52377fa4c..b0c869f90 100644 --- a/frontend/src/app/main/ui/viewer/header.cljs +++ b/frontend/src/app/main/ui/viewer/header.cljs @@ -71,11 +71,12 @@ [:span.btn-text-dark {:on-click go-to-workspace} (tr "labels.edit-file")])])) (mf/defc header-sitemap - [{:keys [project file page frame] :as props}] + [{:keys [project file page frame index] :as props}] (let [project-name (:name project) file-name (:name file) page-name (:name page) frame-name (:name frame) + total (count (:frames page)) toggle-thumbnails (fn [] @@ -111,10 +112,12 @@ {:on-click toggle-thumbnails} [:span.label "/"] [:span.label frame-name] - [:span.icon i/arrow-down]]])) + [:span.icon i/arrow-down] + [:span.counters (str (inc index) " / " total)]]])) + (mf/defc header - [{:keys [project file page frame zoom section permissions]}] + [{:keys [project file page frame zoom section permissions index]}] (let [go-to-dashboard (st/emitf (dv/go-to-dashboard)) @@ -129,7 +132,7 @@ ;; If the user doesn't have permission we disable the link :style {:pointer-events (when-not permissions "none")}} i/logo-icon]] - [:& header-sitemap {:project project :file file :page page :frame frame}] + [:& header-sitemap {:project project :file file :page page :frame frame :index index}] [:div.mode-zone [:button.mode-zone-button.tooltip.tooltip-bottom From f3bfa4e58713bfb7c442ef31fcd701d3f6233ba3 Mon Sep 17 00:00:00 2001 From: elhombretecla Date: Thu, 9 Sep 2021 09:28:38 +0200 Subject: [PATCH 2/6] Update CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 364d8ce8d..44f251ba8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ ### :sparkles: New features - Add tooltips to color picker tabs [Taiga #1814](https://tree.taiga.io/project/penpot/us/1814). +- Add styling to the end point of any open paths [Taiga #1107](https://tree.taiga.io/project/penpot/us/1107). - Allow to zoom with ctrl + middle button [Taiga #1428](https://tree.taiga.io/project/penpot/us/1428). - Auto placement of duplicated objects [Taiga #1386](https://tree.taiga.io/project/penpot/us/1386). - Enable penpot SVG metadata only when exporting complete files [Taiga #1914](https://tree.taiga.io/project/penpot/us/1914?milestone=295883). From 34885b64bd03cefd9718d12388edd267a1618459 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 9 Sep 2021 11:41:18 +0200 Subject: [PATCH 3/6] :bug: Fix style on viewer header. --- frontend/resources/styles/main/partials/viewer-header.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/resources/styles/main/partials/viewer-header.scss b/frontend/resources/styles/main/partials/viewer-header.scss index 7aa002565..448096237 100644 --- a/frontend/resources/styles/main/partials/viewer-header.scss +++ b/frontend/resources/styles/main/partials/viewer-header.scss @@ -123,7 +123,7 @@ } } - .breadcrumb { + .breadcrumb, .current-frame { display: flex; position: relative; From f03a74abc70082e9f0fb0bf5fde9c932a6ec4714 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 9 Sep 2021 12:05:15 +0200 Subject: [PATCH 4/6] :bug: Fix next frame shortcut on viewer. --- frontend/resources/styles/main/partials/viewer-header.scss | 4 ++++ frontend/src/app/main/data/viewer.cljs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/resources/styles/main/partials/viewer-header.scss b/frontend/resources/styles/main/partials/viewer-header.scss index 448096237..24b9d802b 100644 --- a/frontend/resources/styles/main/partials/viewer-header.scss +++ b/frontend/resources/styles/main/partials/viewer-header.scss @@ -148,6 +148,10 @@ color: $color-white; margin-right: $x-small; } + + .counters { + color: $color-gray-20; + } } } diff --git a/frontend/src/app/main/data/viewer.cljs b/frontend/src/app/main/data/viewer.cljs index 7f8b0c14b..fde18c31d 100644 --- a/frontend/src/app/main/data/viewer.cljs +++ b/frontend/src/app/main/data/viewer.cljs @@ -240,7 +240,7 @@ pparams (:path-params route) qparams (:query-params route) - page-id (:page-id pparams) + page-id (:page-id qparams) index (:index qparams) total (count (get-in state [:viewer :pages page-id :frames]))] From 60cb358ccee52eae62b3207090d5c5f09c60b4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 9 Sep 2021 14:11:50 +0200 Subject: [PATCH 5/6] :bug: Fix extra blank pages when exporting to PDF --- frontend/src/app/main/ui/render.cljs | 4 ++-- frontend/src/app/util/dom.cljs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/render.cljs b/frontend/src/app/main/ui/render.cljs index 59a31d16a..9cea9c60a 100644 --- a/frontend/src/app/main/ui/render.cljs +++ b/frontend/src/app/main/ui/render.cljs @@ -80,8 +80,8 @@ (mf/use-effect (mf/deps width height) - #(dom/set-page-style {:size (str (mth/round width) "px " - (mth/round height) "px")})) + #(dom/set-page-style {:size (str (mth/ceil (+ width padding padding)) "px " + (mth/ceil (+ height padding padding)) "px")})) [:& (mf/provider embed/context) {:value true} [:svg {:id "screenshot" diff --git a/frontend/src/app/util/dom.cljs b/frontend/src/app/util/dom.cljs index 91ff3ab2e..5c3074e14 100644 --- a/frontend/src/app/util/dom.cljs +++ b/frontend/src/app/util/dom.cljs @@ -55,6 +55,10 @@ (.insertAdjacentHTML head "beforeend" (str "")))) (defn get-element-by-class From 22b45266bf8eefe577bf70ac358e4ea4a20cf1b8 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 9 Sep 2021 15:08:47 +0200 Subject: [PATCH 6/6] :bug: Fix problem with path not closing on escape --- frontend/src/app/main/data/workspace/path/helpers.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/path/helpers.cljs b/frontend/src/app/main/data/workspace/path/helpers.cljs index deff63dce..9b36e4099 100644 --- a/frontend/src/app/main/data/workspace/path/helpers.cljs +++ b/frontend/src/app/main/data/workspace/path/helpers.cljs @@ -18,7 +18,7 @@ (defn end-path-event? [event] (or (= (ptk/type event) ::common/finish-path) - (= (ptk/type event) :esc-pressed) + (= (ptk/type event) :app.main.data.workspace.path.shortcuts/esc-pressed) (= :app.main.data.workspace.common/clear-edition-mode (ptk/type event)) (= :app.main.data.workspace/finalize-page (ptk/type event)) (= event :interrupt) ;; ESC