diff --git a/.circleci/config.yml b/.circleci/config.yml index e1a6e629febfc56a5f554ccb5945c8816330505c..09cc658e4354f927a25f0dc4f0eb27668831550b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,52 +22,53 @@ jobs: # Download and cache dependencies - restore_cache: - keys: - - v1-dependencies-{{ checksum "backend/deps.edn" }}-{{ checksum "frontend/deps.edn"}}-{{ checksum "common/deps.edn"}} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- + keys: + - v1-dependencies-{{ checksum "backend/deps.edn" }}-{{ checksum "frontend/deps.edn"}}-{{ checksum "common/deps.edn"}} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- - run: cd .clj-kondo && cat config.edn - run: cat .cljfmt.edn - run: clj-kondo --version - run: - name: "fmt check backend [clj]" + name: "backend fmt check" working_directory: "./backend" command: | yarn install yarn run fmt:clj:check - run: - name: "fmt check exporter [clj]" + name: "exporter fmt check" working_directory: "./exporter" command: | yarn install yarn run fmt:clj:check - run: - name: "fmt check common [clj]" + name: "common fmt check" working_directory: "./common" command: | yarn install yarn run fmt:clj:check - run: - name: "fmt check frontend [clj]" + name: "frontend fmt check" working_directory: "./frontend" command: | yarn install yarn run fmt:clj:check + yarn run fmt:js:check - run: - name: common lint + name: "common linter check" working_directory: "./common" command: | yarn install yarn run lint:clj - run: - name: frontend lint + name: "frontend linter check" working_directory: "./frontend" command: | yarn install @@ -75,14 +76,14 @@ jobs: yarn run lint:clj - run: - name: backend lint + name: "backend linter check" working_directory: "./backend" command: | yarn install yarn run lint:clj - run: - name: exporter lint + name: "exporter linter check" working_directory: "./exporter" command: | yarn install @@ -93,7 +94,7 @@ jobs: working_directory: "./common" command: | yarn test - clojure -X:dev:test :patterns '["common-tests.*-test"]' + clojure -M:dev:test - run: name: "frontend tests" @@ -102,11 +103,21 @@ jobs: yarn install yarn test + - run: + name: "frontend integration tests" + working_directory: "./frontend" + command: | + yarn install + yarn run build:app:assets + clojure -M:dev:shadow-cljs release main + yarn playwright install --with-deps chromium + yarn e2e:test + - run: name: "backend tests" working_directory: "./backend" command: | - clojure -X:dev:test :patterns '["backend-tests.*-test"]' + clojure -M:dev:test environment: PENPOT_TEST_DATABASE_URI: "postgresql://localhost/penpot_test" @@ -115,7 +126,6 @@ jobs: PENPOT_TEST_REDIS_URI: "redis://localhost/1" - save_cache: - paths: - - ~/.m2 - key: v1-dependencies-{{ checksum "backend/deps.edn" }}-{{ checksum "frontend/deps.edn"}}-{{ checksum "common/deps.edn"}} - + paths: + - ~/.m2 + key: v1-dependencies-{{ checksum "backend/deps.edn" }}-{{ checksum "frontend/deps.edn"}}-{{ checksum "common/deps.edn"}} diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn index fe1d14d908e73a2b12619f85294600199cfc9d84..5675b9d5d328421c6b734c85bdc58b2b082161b9 100644 --- a/.clj-kondo/config.edn +++ b/.clj-kondo/config.edn @@ -3,7 +3,6 @@ promesa.core/->> clojure.core/->> promesa.core/-> clojure.core/-> promesa.exec.csp/go-loop clojure.core/loop - rumext.v2/defc clojure.core/defn promesa.util/with-open clojure.core/with-open app.common.schema.generators/let clojure.core/let app.common.data/export clojure.core/def @@ -20,6 +19,7 @@ app.db/with-atomic hooks.export/penpot-with-atomic potok.v2.core/reify hooks.export/potok-reify rumext.v2/fnc hooks.export/rumext-fnc + rumext.v2/defc hooks.export/rumext-defc rumext.v2/lazy-component hooks.export/rumext-lazycomponent shadow.lazy/loadable hooks.export/rumext-lazycomponent }} diff --git a/.clj-kondo/hooks/export.clj b/.clj-kondo/hooks/export.clj index a209cf018fc0e3766c11f8f4623821f131629944..50e617de55144f569bb06df52fb14cb2344aa18c 100644 --- a/.clj-kondo/hooks/export.clj +++ b/.clj-kondo/hooks/export.clj @@ -12,6 +12,7 @@ (def registry (atom {})) + (defn potok-reify [{:keys [:node :filename] :as params}] (let [[rnode rtype & other] (:children node) @@ -66,12 +67,86 @@ (let [[cname mdata params & body] (rest (:children node)) [params body] (if (api/vector-node? mdata) [mdata (cons params body)] - [params body])] - (let [result (api/list-node - (into [(api/token-node 'fn) - params] - (cons mdata body)))] - {:node result}))) + [params body]) + + result (api/list-node + (into [(api/token-node 'fn) params] + (cons mdata body)))] + + {:node result})) + + +(defn- parse-defc + [{:keys [children] :as node}] + (let [args (rest children) + + [cname args] + (if (api/token-node? (first args)) + [(first args) (rest args)] + (throw (ex-info "unexpected1" {}))) + + [docs args] + (if (api/string-node? (first args)) + [(first args) (rest args)] + ["" args]) + + [mdata args] + (if (api/map-node? (first args)) + [(first args) (rest args)] + [(api/map-node []) args]) + + [params body] + (if (api/vector-node? (first args)) + [(first args) (rest args)] + (throw (ex-info "unexpected2" {})))] + + [cname docs mdata params body])) + +(defn rumext-defc + [{:keys [node]}] + (let [[cname docs mdata params body] (parse-defc node) + + param1 (first (:children params)) + paramN (rest (:children params)) + + param1 (if (api/map-node? param1) + (let [param1 (into {} (comp + (partition-all 2) + (map (fn [[k v]] + [(if (api/keyword-node? k) + (:k k) + k) + (if (api/vector-node? v) + (vec (:children v)) + v)]))) + (:children param1)) + + binding (:rest param1) + param1 (if binding + (if (contains? param1 :as) + (update param1 :keys (fnil conj []) binding) + (assoc param1 :as binding)) + param1)] + (->> (dissoc param1 :rest) + (mapcat (fn [[k v]] + [(if (keyword? k) + (api/keyword-node k) + k) + (if (vector? v) + (api/vector-node v) + v)])) + (api/map-node))) + param1) + + result (api/list-node + (into [(api/token-node 'defn) + cname + (api/vector-node (filter some? (cons param1 paramN)))] + (cons mdata body)))] + + ;; (prn (api/sexpr result)) + + {:node result})) (defn rumext-lazycomponent diff --git a/.cljfmt.edn b/.cljfmt.edn index 38cfeb89b649d71b1c504ac395e44e3dc91773d1..02c567b2e34ddf6d46230487ed51f1c966f4d638 100644 --- a/.cljfmt.edn +++ b/.cljfmt.edn @@ -4,6 +4,7 @@ :remove-consecutive-blank-lines? false :extra-indents {rumext.v2/fnc [[:inner 0]] cljs.test/async [[:inner 0]] + app.common.schema/register! [[:inner 0] [:inner 1]] promesa.exec/thread [[:inner 0]] specify! [[:inner 0] [:inner 1]]} } diff --git a/.gitignore b/.gitignore index 0e271d1257a553db15dcf56936377adac53b15b5..b0b2074d8d4310cc087865378ded8da4f3ef9983 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,8 @@ /deploy /docker/images/bundle* /exporter/target +/frontend/.storybook/preview-body.html +/frontend/.storybook/preview-head.html /frontend/cypress/fixtures/validuser.json /frontend/cypress/videos/*/ /frontend/cypress/videos/*/ @@ -57,6 +59,7 @@ /frontend/package-lock.json /frontend/resources/fonts/experiments /frontend/resources/public/* +/frontend/storybook-static/ /frontend/target/ /other/ /scripts/ @@ -67,4 +70,7 @@ /web clj-profiler/ node_modules -frontend/.storybook/preview-body.html +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ diff --git a/.yarnrc.yml b/.yarnrc.yml index 896c0eefc0f033cf2d39b43614e5769fc5f7e458..5a0ce9a8b33b26df1f12b7e659377847d760911b 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -6,4 +6,6 @@ enableImmutableInstalls: false enableTelemetry: false +httpTimeout: 600000 + nodeLinker: node-modules diff --git a/CHANGES.md b/CHANGES.md index f80e9724571c9e98c4bd528b3d87962f05f95c13..57a907f6f4ffb7cbe33a52769f351dd69071b1c7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,221 @@ # CHANGELOG +## 2.3.0 + +### :rocket: Epics and highlights + +### :boom: Breaking changes & Deprecations + +### :heart: Community contributions (Thank you!) + +### :sparkles: New features + +### :bug: Bugs fixed + +## 2.2.0 + +### :rocket: Epics and highlights + +### :boom: Breaking changes & Deprecations + +### :heart: Community contributions (Thank you!) + +- Set proper default tenant on exporter (by @june128) [#4946](https://github.com/penpot/penpot/pull/4946) +- Correct a spelling in onboarding.edn (by @n-stha) [#4936](https://github.com/penpot/penpot/pull/4936) + +### :sparkles: New features + +- **Tiered File Data Storage** [Taiga #8376](https://tree.taiga.io/project/penpot/us/8376) + + This feature allows offloading file data that is not actively used + from the database to object storage (e.g., filesystem, S3), thereby + freeing up space in the database. It can be enabled with the + `enable-enable-tiered-file-data-storage` flag. + + *(On-Premise feature, EXPERIMENTAL).* + +- **JSON Interoperability for HTTP API** [Taiga #8372](https://tree.taiga.io/project/penpot/us/8372) + + Enables full JSON interoperability for our HTTP API. Previously, + JSON was only barely supported for output when the + `application/json` media type was specified in the `Accept` header, + or when `_fmt=json` was passed as a query parameter. With this + update, we now offer proper bi-directional support for using our API + with plain JSON, instead of Transit. + +- **Automatic File Snapshotting** + + Adds the ability to automatically take and maintain a limited set of + snapshots of active files without explicit user intervention. This + feature allows on-premise administrators to recover the state of a + file from a past point in time in a limited manner. + + It can be enabled with the `enable-auto-file-snapshot` flag and + configured with the following settings: + + ```bash + # Take snapshots every 10 update operations + PENPOT_AUTO_FILE_SNAPSHOT_EVERY=10 + + # Take a snapshot if it has been more than 3 hours since the file was last modified + PENPOT_AUTO_FILE_SNAPSHOT_TIMEOUT=3h + + # The total number of snapshots to keep + PENPOT_AUTO_FILE_SNAPSHOT_TOTAL=10 + ``` + + Snapshots are only taken during update operations; there is NO + active background process for this. + +- Add separated flag `enable-oidc-registration` for enable the + registration only for OIDC authentication backend [Github + #4882](https://github.com/penpot/penpot/issues/4882) + +- Update templates in libraries & templates in dashboard modal [Taiga #8145](https://tree.taiga.io/project/penpot/us/8145) + +- **Design System** + + We implemented and subbed in new components from our Design System: `loader*` ([Taiga #8355](https://tree.taiga.io/project/penpot/task/8355)) and `tab-switcher*` ([Taiga #8518](https://tree.taiga.io/project/penpot/task/8518)). + +- **Storybook** [Taiga #6329](https://tree.taiga.io/project/penpot/us/6329) + + The Design System components are now published in a Storybook, available at `/storybook`. + +### :bug: Bugs fixed + +- Fix webhook checkbox position [Taiga #8634](https://tree.taiga.io/project/penpot/issue/8634) +- Fix wrong props on padding input [Taiga #8254](https://tree.taiga.io/project/penpot/issue/8254) +- Fix fill collapsed options [Taiga #8351](https://tree.taiga.io/project/penpot/issue/8351) +- Fix scroll on color picker modal [Taiga #8353](https://tree.taiga.io/project/penpot/issue/8353) +- Fix components are not dragged from the group to the assets tab [Taiga #8273](https://tree.taiga.io/project/penpot/issue/8273) +- Fix problem with SVG import [Github #4888](https://github.com/penpot/penpot/issues/4888) +- Fix problem with overlay positions in viewer [Taiga #8464](https://tree.taiga.io/project/penpot/issue/8464) +- Fix layer panel overflowing [Taiga #8665](https://tree.taiga.io/project/penpot/issue/8665) +- Fix problem when creating a component instance from grid layout [Github #4881](https://github.com/penpot/penpot/issues/4881) +- Fix problem when dismissing shared library update [Taiga #8669](https://tree.taiga.io/project/penpot/issue/8669) + +## 2.1.5 + +### :bug: Bugs fixed + +- Fix broken webhooks [Taiga #8370](https://tree.taiga.io/project/penpot/issue/8370) + +## 2.1.4 + +### :bug: Bugs fixed + +- Fix json encoding on zip encoding decoding. +- Add schema validation for color changes. +- Fix render of some texts without position data. + +## 2.1.3 + +- Don't allow registration when registration is disabled and invitation token is used [Github #4975](https://github.com/penpot/penpot/issues/4975) + +## 2.1.2 + +### :bug: Bugs fixed + +- User switch language to "zh_hant" will get 400 [Github #4884](https://github.com/penpot/penpot/issues/4884) +- Smtp config ignoring port if ssl is set [Github #4872](https://github.com/penpot/penpot/issues/4872) +- Ability to let users to authenticate with a private oidc provider only [Github #4963](https://github.com/penpot/penpot/issues/4963) + +## 2.1.1 + +### :sparkles: New features + +- Consolidate templates new order and naming [Taiga #8392](https://tree.taiga.io/project/penpot/task/8392) + +### :bug: Bugs fixed + +- Fix the “search” label in translations [Taiga #8402](https://tree.taiga.io/project/penpot/issue/8402) +- Fix pencil loader [Taiga #8348](https://tree.taiga.io/project/penpot/issue/8348) +- Fix several issues on the OIDC. +- Fix regression on the `email-verification` flag [Taiga #8398](https://tree.taiga.io/project/penpot/issue/8398) + +## 2.1.0 - Things can only get better! + +### :rocket: Epics and highlights + +### :boom: Breaking changes & Deprecations + +### :heart: Community contributions (Thank you!) + +### :sparkles: New features + +- Improve auth process [Taiga #7094](https://tree.taiga.io/project/penpot/us/7094) +- Add locking degrees increment (hold shift) on path edition [Taiga #7761](https://tree.taiga.io/project/penpot/issue/7761) +- Persistence & Concurrent Edition Enhancements [Taiga #5657](https://tree.taiga.io/project/penpot/us/5657) +- Allow library colors as recent colors [Taiga #7640](https://tree.taiga.io/project/penpot/issue/7640) +- Missing scroll in viewmode comments [Taiga #7427](https://tree.taiga.io/project/penpot/issue/7427) +- Comments in View mode should mimic the positioning behavior of the Workspace [Taiga #7346](https://tree.taiga.io/project/penpot/issue/7346) +- Misaligned input on comments [Taiga #7461](https://tree.taiga.io/project/penpot/issue/7461) + +### :bug: Bugs fixed + +- Fix selection rectangle appears on scroll [Taiga #7525](https://tree.taiga.io/project/penpot/issue/7525) +- Fix layer tree not expanding to the bottom edge [Taiga #7466](https://tree.taiga.io/project/penpot/issue/7466) +- Fix guides move when board is moved by inputs [Taiga #8010](https://tree.taiga.io/project/penpot/issue/8010) +- Fix clickable area of Penptot logo in the viewer [Taiga #7988](https://tree.taiga.io/project/penpot/issue/7988) +- Fix constraints dropdown when selecting multiple shapes [Taiga #7686](https://tree.taiga.io/project/penpot/issue/7686) +- Layout and scrollign fixes for the bottom palette [Taiga #7559](https://tree.taiga.io/project/penpot/issue/7559) +- Fix expand libraries when search results are present [Taiga #7876](https://tree.taiga.io/project/penpot/issue/7876) +- Fix color palette default library [Taiga #8029](https://tree.taiga.io/project/penpot/issue/8029) +- Component Library is lost after exporting/importing in .zip format [Github #4672](https://github.com/penpot/penpot/issues/4672) +- Fix problem with moving+selection not working properly [Taiga #7943](https://tree.taiga.io/project/penpot/issue/7943) +- Fix problem with flex layout fit to content not positioning correctly children [Taiga #7537](https://tree.taiga.io/project/penpot/issue/7537) +- Fix black line is displaying after show main [Taiga #7653](https://tree.taiga.io/project/penpot/issue/7653) +- Fix "Share prototypes" modal remains open [Taiga #7442](https://tree.taiga.io/project/penpot/issue/7442) +- Fix "Components visibility and opacity" [#4694](https://github.com/penpot/penpot/issues/4694) +- Fix "Attribute overrides in copies are not exported in zip file" [Taiga #8072](https://tree.taiga.io/project/penpot/issue/8072) +- Fix group not automatically selected in the Layers panel after creation [Taiga #8078](https://tree.taiga.io/project/penpot/issue/8078) +- Fix export boards loses opacity [Taiga #7592](https://tree.taiga.io/project/penpot/issue/7592) +- Fix change color on imported svg also changes the stroke alignment[Taiga #7673](https://github.com/penpot/penpot/pull/7673) +- Fix show in view mode and interactions workflow [Taiga #4711](https://github.com/penpot/penpot/pull/4711) +- Fix internal error when I set up a stroke for some objects without and with stroke [Taiga #7558](https://tree.taiga.io/project/penpot/issue/7558) +- Toolbar keeps toggling on and off on spacebar press [Taiga #7654](https://github.com/penpot/penpot/pull/7654) +- Fix toolbar keeps hiding when click outside workspace [Taiga #7776](https://tree.taiga.io/project/penpot/issue/7776) +- Fix open overlay relative to a frame [Taiga #7563](https://tree.taiga.io/project/penpot/issue/7563) +- Workspace-palette items stay hidden when opening with keyboard-shortcut [Taiga #7489](https://tree.taiga.io/project/penpot/issue/7489) +- Fix SVG attrs are not handled correctly when exporting/importing in .zip [Taiga #7920](https://tree.taiga.io/project/penpot/issue/7920) +- Fix validation error when detaching with two nested copies and a swap [Taiga #8095](https://tree.taiga.io/project/penpot/issue/8095) +- Export shapes that are rotated act a bit strange when reimported [Taiga #7585](https://tree.taiga.io/project/penpot/issue/7585) +- Penpot crashes when a new colorpicker is created while uploading an image to another instance [Taiga #8119](https://tree.taiga.io/project/penpot/issue/8119) +- Removing Underline and Strikethrough Affects the Previous Text Object [Taiga #8103](https://tree.taiga.io/project/penpot/issue/8103) +- Color library loses association with shapes when exporting/importing the document [Taiga #8132](https://tree.taiga.io/project/penpot/issue/8132) +- Fix can't collapse groups when searching in the assets tab [Taiga #8125](https://tree.taiga.io/project/penpot/issue/8125) +- Fix 'Detach instance' shortcut is not working [Taiga #8102](https://tree.taiga.io/project/penpot/issue/8102) +- Fix import file message does not detect 0 as error [Taiga #6824](https://tree.taiga.io/project/penpot/issue/6824) +- Image Color Library is not persisted when exporting/importing in .zip [Taiga #8131](https://tree.taiga.io/project/penpot/issue/8131) +- Fix export files including libraries [Taiga #8266](https://tree.taiga.io/project/penpot/issue/8266) + +## 2.0.3 + +### :bug: Bugs fixed + +- Fix chrome scrollbar styling [Taiga #7852](https://tree.taiga.io/project/penpot/issue/7852) +- Fix incorrect password encoding on create-profile manage scritp [Github #3651](https://github.com/penpot/penpot/issues/3651) + +## 2.0.2 + +### :sparkles: Enhancements + +- Fix locking contention on cron subsystem (causes backend start blocking) +- Fix locking contention on file object thumbails backend RPC calls + +### :bug: Bugs fixed + +- Fix color palette sorting [Taiga #7458](https://tree.taiga.io/project/penpot/issue/7458) +- Fix style scoping problem with imported SVG [Taiga #7671](https://tree.taiga.io/project/penpot/issue/7671) + + +## 2.0.1 + +### :bug: Bugs fixed + +- Fix different issues related to components v2 migrations including [Github #4443](https://github.com/penpot/penpot/issues/4443) + + ## 2.0.0 - I Just Can't Get Enough ### :rocket: Epics and highlights @@ -14,6 +230,8 @@ ### :boom: Breaking changes & Deprecations - New strokes default to inside border [Taiga #6847](https://tree.taiga.io/project/penpot/issue/6847) +- Change default z ordering on layers in flex layout. The previous behavior was inconsistent with how HTML works and we changed it to be more consistent. Previous layers that overlapped could be hidden, the fastest way to fix this is changing the z-index property but a better way is to change the order of your layers. + ### :heart: Community contributions (Thank you!) - New Hausa, Yoruba and Igbo translations and update translation files (by All For Tech Empowerment Foundation) [Taiga #6950](https://tree.taiga.io/project/penpot/us/6950), [Taiga #6534](https://tree.taiga.io/project/penpot/us/6534) @@ -91,7 +309,7 @@ - [REDESIGN] Panels visual separations [Taiga #6692](https://tree.taiga.io/project/penpot/us/6692) - [REDESIGN] Onboarding slides [Taiga #6678](https://tree.taiga.io/project/penpot/us/6678) -### :bug Bugs fixed +### :bug: Bugs fixed - Fix pixelated thumbnails [Github #3681](https://github.com/penpot/penpot/issues/3681), [Github #3661](https://github.com/penpot/penpot/issues/3661) - Fix problem with not applying colors to boards [Github #3941](https://github.com/penpot/penpot/issues/3941) - Fix problem with path editor undoing changes [Github #3998](https://github.com/penpot/penpot/issues/3998) @@ -130,7 +348,9 @@ - Fix problem with hand tool stuck [Github #3318](https://github.com/penpot/penpot/issues/3318) - Fix problem with fix scrolling on nested elements [Github #3508](https://github.com/penpot/penpot/issues/3508) - Fix problem when changing typography assets [Github #3683](https://github.com/penpot/penpot/issues/3683) - +- Internal error when you copy and paste some main components between files [Taiga #7397](https://tree.taiga.io/project/penpot/issue/7397) +- Fix toolbar disappearing [Taiga #7411](https://tree.taiga.io/project/penpot/issue/7411) +- Fix long text on tab breaks UI [Taiga #7421](https://tree.taiga.io/project/penpot/issue/7421) ## 1.19.5 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae27a013537105b1a7c13b2252a51bc4ab5d8029..9e2091679b9ded22559cf4a8c9e6ade4cc61f6b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ quick win. If is going to be your first pull request, You can learn how from this free video series: -https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github +https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github We will use the `easy fix` mark for tag for indicate issues that are easy for beginners. diff --git a/README.md b/README.md index 0b662801767711cd87214b2f9e4782178afd333d..848b3efd18ad11b8c88e6a76b39888c77a67bc64 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,11 @@ [uri_license]: https://www.mozilla.org/en-US/MPL/2.0 [uri_license_image]: https://img.shields.io/badge/MPL-2.0-blue.svg -
-
+- Website • - Getting Started • - User Guide • - Tutorials & Info • - Community • - Twitter • - Instagram • - Mastodon • - Youtube + Website • + Getting Started • + User Guide • + Tutorials & Info • + Community
++ Youtube • + Peertube • + Linkedin • + Instagram • + Mastodon • + X + +
+ +
-
+
-
+
-
+
-
+
|
- Hello {{name}}!
+ Hello {{name|abbreviate:25}}!
|