0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-15 17:21:17 -05:00

Merge pull request #228 from uxbox/wip/notifications

Notifications
This commit is contained in:
Hirunatan 2020-05-27 11:47:41 +02:00 committed by GitHub
commit dc135aa890
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 691 additions and 1374 deletions

View file

@ -9,7 +9,7 @@ We received a request to change your current email to {{ pendingEmail }}.
Click to the link below to confirm the change: Click to the link below to confirm the change:
{{ publicUrl }}/#/auth/verify-token?token={{token}} {{ publicUri }}/#/auth/verify-token?token={{token}}
If you received this email by mistake, please consider changing your password If you received this email by mistake, please consider changing your password
for security reasons. for security reasons.

View file

@ -8,7 +8,7 @@ Hello {{name}}!
We received a request to reset your password. Click the link below to choose a We received a request to reset your password. Click the link below to choose a
new one: new one:
{{ publicUrl }}/#/auth/recovery?token={{token}} {{ publicUri }}/#/auth/recovery?token={{token}}
If you received this email by mistake, you can safely ignore it. Your password If you received this email by mistake, you can safely ignore it. Your password
won't be changed. won't be changed.

View file

@ -8,7 +8,7 @@ Hello {{name}}!
Thanks for signing up for your UXBOX account! Please verify your email using the Thanks for signing up for your UXBOX account! Please verify your email using the
link below adn get started building mockups and prototypes today! link below adn get started building mockups and prototypes today!
{{ publicUrl }}/#/auth/verify-token?token={{token}} {{ publicUri }}/#/auth/verify-token?token={{token}}
Enjoy! Enjoy!
The UXBOX team. The UXBOX team.

View file

@ -22,9 +22,11 @@
;; --- Defaults ;; --- Defaults
(def default-context (defn default-context
[]
{:static media/resolve-asset {:static media/resolve-asset
:comment (constantly nil)}) :comment (constantly nil)
:public-uri (:public-uri cfg/config)})
;; --- Public API ;; --- Public API

View file

@ -220,7 +220,7 @@
(let [owner-id (:id owner) (let [owner-id (:id owner)
id (mk-uuid "file" "draft" owner-id index) id (mk-uuid "file" "draft" owner-id index)
name (str "file" index) name (str "file" index)
project-id (:default-project owner)] project-id (:default-project-id owner)]
(log/info "create draft file" id) (log/info "create draft file" id)
(db/insert! conn :file (db/insert! conn :file
{:id id {:id id

View file

@ -156,6 +156,9 @@
(sm/defmutation ::login (sm/defmutation ::login
[{:keys [email password scope] :as params}] [{:keys [email password scope] :as params}]
(letfn [(check-password [profile password] (letfn [(check-password [profile password]
(when (= (:password profile) "!")
(ex/raise :type :validation
:code ::account-without-password))
(let [result (sodi.pwhash/verify password (:password profile))] (let [result (sodi.pwhash/verify password (:password profile))]
(:valid result))) (:valid result)))

View file

@ -95,7 +95,10 @@
(when-let [spec (s/get-spec id)] (when-let [spec (s/get-spec id)]
(s/assert spec context)) (s/assert spec context))
(let [context (merge extra-context context) (let [context (merge (if (fn? extra-context)
(extra-context)
extra-context)
context)
email (impl-build-email id context)] email (impl-build-email id context)]
(when-not email (when-not email
(ex/raise :type :internal (ex/raise :type :internal

View file

@ -2,6 +2,9 @@
;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;; ;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL ;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.tests.test-common-pages (ns uxbox.tests.test-common-pages

View file

@ -1,3 +1,12 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.tests.test-services-colors (ns uxbox.tests.test-services-colors
(:require (:require
[clojure.test :as t] [clojure.test :as t]
@ -16,7 +25,7 @@
(t/deftest color-libraries-crud (t/deftest color-libraries-crud
(let [id (uuid/next) (let [id (uuid/next)
prof (th/create-profile db/pool 2) prof (th/create-profile db/pool 2)
team-id (:default-team prof)] team-id (:default-team-id prof)]
(t/testing "create library" (t/testing "create library"
(let [data {::sm/type :create-color-library (let [data {::sm/type :create-color-library
@ -72,7 +81,7 @@
(t/deftest colors-crud (t/deftest colors-crud
(let [prof (th/create-profile db/pool 1) (let [prof (th/create-profile db/pool 1)
team-id (:default-team prof) team-id (:default-team-id prof)
coll (th/create-color-library db/pool team-id 1) coll (th/create-color-library db/pool team-id 1)
color-id (uuid/next)] color-id (uuid/next)]

View file

@ -1,3 +1,12 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.tests.test-services-files (ns uxbox.tests.test-services-files
(:require (:require
[clojure.test :as t] [clojure.test :as t]
@ -16,8 +25,8 @@
(t/deftest files-crud (t/deftest files-crud
(let [prof (th/create-profile db/pool 1) (let [prof (th/create-profile db/pool 1)
team-id (:default-team prof) team-id (:default-team-id prof)
proj-id (:default-project prof) proj-id (:default-project-id prof)
file-id (uuid/next) file-id (uuid/next)
page-id (uuid/next)] page-id (uuid/next)]
@ -122,8 +131,8 @@
(t/deftest file-images-crud (t/deftest file-images-crud
(let [prof (th/create-profile db/pool 1) (let [prof (th/create-profile db/pool 1)
team-id (:default-team prof) team-id (:default-team-id prof)
proj-id (:default-project prof) proj-id (:default-project-id prof)
file (th/create-file db/pool (:id prof) proj-id 1)] file (th/create-file db/pool (:id prof) proj-id 1)]
(t/testing "upload file image" (t/testing "upload file image"

View file

@ -1,3 +1,12 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.tests.test-services-icons (ns uxbox.tests.test-services-icons
(:require (:require
[clojure.java.io :as io] [clojure.java.io :as io]
@ -16,7 +25,7 @@
(t/deftest icon-libraries-crud (t/deftest icon-libraries-crud
(let [id (uuid/next) (let [id (uuid/next)
prof (th/create-profile db/pool 2) prof (th/create-profile db/pool 2)
team-id (:default-team prof)] team-id (:default-team-id prof)]
(t/testing "create library" (t/testing "create library"
(let [data {::sm/type :create-icon-library (let [data {::sm/type :create-icon-library
@ -89,7 +98,7 @@
(t/deftest icons-crud (t/deftest icons-crud
(let [prof (th/create-profile db/pool 1) (let [prof (th/create-profile db/pool 1)
team-id (:default-team prof) team-id (:default-team-id prof)
coll (th/create-icon-library db/pool team-id 1) coll (th/create-icon-library db/pool team-id 1)
icon-id (uuid/next)] icon-id (uuid/next)]

View file

@ -1,3 +1,12 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.tests.test-services-images (ns uxbox.tests.test-services-images
(:require (:require
[clojure.test :as t] [clojure.test :as t]
@ -15,7 +24,7 @@
(t/deftest image-libraries-crud (t/deftest image-libraries-crud
(let [id (uuid/next) (let [id (uuid/next)
prof (th/create-profile db/pool 2) prof (th/create-profile db/pool 2)
team-id (:default-team prof)] team-id (:default-team-id prof)]
(t/testing "create library" (t/testing "create library"
(let [data {::sm/type :create-image-library (let [data {::sm/type :create-image-library
@ -96,7 +105,7 @@
(t/deftest images-crud (t/deftest images-crud
(let [prof (th/create-profile db/pool 1) (let [prof (th/create-profile db/pool 1)
team-id (:default-team prof) team-id (:default-team-id prof)
lib (th/create-image-library db/pool team-id 1) lib (th/create-image-library db/pool team-id 1)
image-id (uuid/next)] image-id (uuid/next)]

View file

@ -1,3 +1,12 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.tests.test-services-pages (ns uxbox.tests.test-services-pages
(:require (:require
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
@ -16,8 +25,8 @@
(t/deftest pages-crud (t/deftest pages-crud
(let [prof (th/create-profile db/pool 1) (let [prof (th/create-profile db/pool 1)
team-id (:default-team prof) team-id (:default-team-id prof)
proj-id (:default-project prof) proj-id (:default-project-id prof)
file (th/create-file db/pool (:id prof) proj-id 1) file (th/create-file db/pool (:id prof) proj-id 1)
page-id (uuid/next)] page-id (uuid/next)]
@ -93,8 +102,8 @@
(t/deftest update-page-data (t/deftest update-page-data
(let [prof (th/create-profile db/pool 1) (let [prof (th/create-profile db/pool 1)
team-id (:default-team prof) team-id (:default-team-id prof)
proj-id (:default-project prof) proj-id (:default-project-id prof)
file (th/create-file db/pool (:id prof) proj-id 1) file (th/create-file db/pool (:id prof) proj-id 1)
page-id (uuid/next)] page-id (uuid/next)]
@ -169,8 +178,8 @@
(t/deftest update-page-data-2 (t/deftest update-page-data-2
(let [prof (th/create-profile db/pool 1) (let [prof (th/create-profile db/pool 1)
team-id (:default-team prof) team-id (:default-team-id prof)
proj-id (:default-project prof) proj-id (:default-project-id prof)
file (th/create-file db/pool (:id prof) proj-id 1) file (th/create-file db/pool (:id prof) proj-id 1)
page (th/create-page db/pool (:id prof) (:id file) 1)] page (th/create-page db/pool (:id prof) (:id file) 1)]
(t/testing "lagging changes" (t/testing "lagging changes"

View file

@ -1,3 +1,12 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.tests.test-services-viewer (ns uxbox.tests.test-services-viewer
(:require (:require
[clojure.test :as t] [clojure.test :as t]
@ -17,8 +26,8 @@
(t/deftest retrieve-bundle (t/deftest retrieve-bundle
(let [prof (th/create-profile db/pool 1) (let [prof (th/create-profile db/pool 1)
prof2 (th/create-profile db/pool 2) prof2 (th/create-profile db/pool 2)
team-id (:default-team prof) team-id (:default-team-id prof)
proj-id (:default-project prof) proj-id (:default-project-id prof)
file (th/create-file db/pool (:id prof) proj-id 1) file (th/create-file db/pool (:id prof) proj-id 1)
page (th/create-page db/pool (:id prof) (:id file) 1) page (th/create-page db/pool (:id prof) (:id file) 1)

View file

@ -0,0 +1,3 @@
<svg width="40" height="40">
<path d="M0 0v40h40V0H0zm2.928 2.932h34.144v34.136H2.928V2.932zM9.726 8.36v3.631h-3.63v3.492h3.63v3.631h3.492v-3.63h3.631V11.99h-3.63v-3.63H9.725zm17.6 0v3.631h-3.63v3.492h3.63v3.631h3.492v-3.63h3.631V11.99h-3.63v-3.63h-3.493zm2.87 18.031H9.843v2.88h-2.72v3.012h5.434v-2.88h14.886v2.88h5.434v-3.012h-2.68v-2.88z"/>
</svg>

After

Width:  |  Height:  |  Size: 353 B

View file

@ -0,0 +1,3 @@
<svg width="40" height="40">
<path d="M0 0v40h40V0H0zm2.928 2.932h34.144v34.136H2.928V2.932zm15.36 4.131v3.626h3.424V7.063h-3.424zm0 6.4v19.474h3.424V13.463h-3.424z"/>
</svg>

After

Width:  |  Height:  |  Size: 177 B

View file

@ -0,0 +1,3 @@
<svg width="40" height="40">
<path d="M0 0v40h40V0H0zm2.928 2.932h34.144v34.136H2.928V2.932zm27.762 7.553L16.273 24.902 9.31 17.939l-2.306 2.306 9.27 9.27 16.722-16.723-2.306-2.307z"/>
</svg>

After

Width:  |  Height:  |  Size: 194 B

View file

@ -0,0 +1,3 @@
<svg width="40" height="40">
<path d="M0 0v40h40V0H0zm2.928 2.932h34.144v34.136H2.928V2.932zm15.36 4.131v19.474h3.424V7.063h-3.424zm0 22.248v3.626h3.424V29.31h-3.424z"/>
</svg>

After

Width:  |  Height:  |  Size: 179 B

View file

@ -1,54 +1,60 @@
{ {
"auth.already-have-account" : { "auth.already-have-account" : {
"used-in" : [ "src/uxbox/main/ui/auth/register.cljs:111" ], "used-in" : [ "src/uxbox/main/ui/auth/register.cljs:107" ],
"translations" : { "translations" : {
"en" : "Already have an account?", "en" : "Already have an account?",
"fr" : "Vous avez déjà un compte ?" "fr" : "Vous avez déjà un compte ?"
} }
}, },
"auth.confirm-password-label" : { "auth.confirm-password-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:78" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:77" ],
"translations" : { "translations" : {
"en" : "Confirm password", "en" : "Confirm password",
"fr" : "Confirmez mot de passe" "fr" : "Confirmez mot de passe"
} }
}, },
"auth.create-demo-profile" : { "auth.create-demo-profile" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:90", "src/uxbox/main/ui/auth/register.cljs:120" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:114", "src/uxbox/main/ui/auth/register.cljs:116" ],
"translations" : { "translations" : {
"en" : "Create demo account", "en" : "Create demo account",
"fr" : null "fr" : null
} }
}, },
"auth.create-demo-profile-label" : { "auth.create-demo-profile-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:87", "src/uxbox/main/ui/auth/register.cljs:117" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:111", "src/uxbox/main/ui/auth/register.cljs:113" ],
"translations" : { "translations" : {
"en" : "Just wanna try it?" "en" : "Just wanna try it?"
} }
}, },
"auth.demo-warning" : {
"used-in" : [ "src/uxbox/main/ui/auth/register.cljs:33" ],
"translations" : {
"en" : "This is a DEMO service, DO NOT USE for real work, the projects will be periodicaly wiped."
}
},
"auth.email-label" : { "auth.email-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:55", "src/uxbox/main/ui/auth/register.cljs:86", "src/uxbox/main/ui/auth/recovery_request.cljs:47" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:73", "src/uxbox/main/ui/auth/recovery_request.cljs:45", "src/uxbox/main/ui/auth/register.cljs:82" ],
"translations" : { "translations" : {
"en" : "Email", "en" : "Email",
"fr" : "adresse email" "fr" : "adresse email"
} }
}, },
"auth.forgot-password" : { "auth.forgot-password" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:78" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:102" ],
"translations" : { "translations" : {
"en" : "Forgot your password?", "en" : "Forgot your password?",
"fr" : "Mot de passe oublié ?" "fr" : "Mot de passe oublié ?"
} }
}, },
"auth.fullname-label" : { "auth.fullname-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/register.cljs:80" ], "used-in" : [ "src/uxbox/main/ui/auth/register.cljs:76" ],
"translations" : { "translations" : {
"en" : "Full Name", "en" : "Full Name",
"fr" : "Nom complet" "fr" : "Nom complet"
} }
}, },
"auth.go-back-to-login" : { "auth.go-back-to-login" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:67" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:66" ],
"translations" : { "translations" : {
"en" : "Go back!", "en" : "Go back!",
"fr" : "Retour!" "fr" : "Retour!"
@ -61,126 +67,126 @@
} }
}, },
"auth.login-here" : { "auth.login-here" : {
"used-in" : [ "src/uxbox/main/ui/auth/register.cljs:114" ], "used-in" : [ "src/uxbox/main/ui/auth/register.cljs:110" ],
"translations" : { "translations" : {
"en" : "Login here" "en" : "Login here"
} }
}, },
"auth.login-submit-label" : { "auth.login-submit-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:63" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:81" ],
"translations" : { "translations" : {
"en" : "Sign in", "en" : "Sign in",
"fr" : "Se connecter" "fr" : "Se connecter"
} }
}, },
"auth.login-subtitle" : { "auth.login-subtitle" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:70" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:89" ],
"translations" : { "translations" : {
"en" : "Enter your details below" "en" : "Enter your details below"
} }
}, },
"auth.login-title" : { "auth.login-title" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:69" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:88" ],
"translations" : { "translations" : {
"en" : "Great to see you again!" "en" : "Great to see you again!"
} }
}, },
"auth.new-password-label" : { "auth.new-password-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:74" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:73" ],
"translations" : { "translations" : {
"en" : "Type a new password", "en" : "Type a new password",
"fr" : null "fr" : null
} }
}, },
"auth.notifications.invalid-token-error" : { "auth.notifications.invalid-token-error" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:50" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:49" ],
"translations" : { "translations" : {
"en" : "The recovery token is invalid.", "en" : "The recovery token is invalid.",
"fr" : "Le jeton de récupération n'est pas valide." "fr" : "Le jeton de récupération n'est pas valide."
} }
}, },
"auth.notifications.password-changed-succesfully" : { "auth.notifications.password-changed-succesfully" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:54" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:53" ],
"translations" : { "translations" : {
"en" : "Password successfully changed" "en" : "Password successfully changed"
} }
}, },
"auth.notifications.recovery-token-sent" : { "auth.notifications.recovery-token-sent" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:34" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:32" ],
"translations" : { "translations" : {
"en" : "Password recovery link sent to your inbox.", "en" : "Password recovery link sent to your inbox.",
"fr" : "Lien de récupération de mot de passe envoyé." "fr" : "Lien de récupération de mot de passe envoyé."
} }
}, },
"auth.password-label" : { "auth.password-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:61", "src/uxbox/main/ui/auth/register.cljs:90" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:79", "src/uxbox/main/ui/auth/register.cljs:86" ],
"translations" : { "translations" : {
"en" : "Password", "en" : "Password",
"fr" : "Mot de passe" "fr" : "Mot de passe"
} }
}, },
"auth.password-length-hint" : { "auth.password-length-hint" : {
"used-in" : [ "src/uxbox/main/ui/auth/register.cljs:89" ], "used-in" : [ "src/uxbox/main/ui/auth/register.cljs:85" ],
"translations" : { "translations" : {
"en" : "At least 8 characters" "en" : "At least 8 characters"
} }
}, },
"auth.recovery-request-submit-label" : { "auth.recovery-request-submit-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:51" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:50" ],
"translations" : { "translations" : {
"en" : "Recover Password" "en" : "Recover Password"
} }
}, },
"auth.recovery-request-subtitle" : { "auth.recovery-request-subtitle" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:60" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:59" ],
"translations" : { "translations" : {
"en" : "We'll send you an email with instructions" "en" : "We'll send you an email with instructions"
} }
}, },
"auth.recovery-request-title" : { "auth.recovery-request-title" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:59" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery_request.cljs:58" ],
"translations" : { "translations" : {
"en" : "Forgot your password?" "en" : "Forgot your password?"
} }
}, },
"auth.recovery-submit-label" : { "auth.recovery-submit-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:81" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:80" ],
"translations" : { "translations" : {
"en" : "Change your password" "en" : "Change your password"
} }
}, },
"auth.register" : { "auth.register" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:84" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:108" ],
"translations" : { "translations" : {
"en" : "Sign up here" "en" : "Sign up here"
} }
}, },
"auth.register-label" : { "auth.register-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:81" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:105" ],
"translations" : { "translations" : {
"en" : "No account yet?" "en" : "No account yet?"
} }
}, },
"auth.register-submit-label" : { "auth.register-submit-label" : {
"used-in" : [ "src/uxbox/main/ui/auth/register.cljs:94" ], "used-in" : [ "src/uxbox/main/ui/auth/register.cljs:90" ],
"translations" : { "translations" : {
"en" : "Create an account" "en" : "Create an account"
} }
}, },
"auth.register-subtitle" : { "auth.register-subtitle" : {
"used-in" : [ "src/uxbox/main/ui/auth/register.cljs:103" ], "used-in" : [ "src/uxbox/main/ui/auth/register.cljs:99" ],
"translations" : { "translations" : {
"en" : "It's free, it's Open Source" "en" : "It's free, it's Open Source"
} }
}, },
"auth.register-title" : { "auth.register-title" : {
"used-in" : [ "src/uxbox/main/ui/auth/register.cljs:102" ], "used-in" : [ "src/uxbox/main/ui/auth/register.cljs:98" ],
"translations" : { "translations" : {
"en" : "Create an account" "en" : "Create an account"
} }
}, },
"auth.sidebar-tagline" : { "auth.sidebar-tagline" : {
"used-in" : [ "src/uxbox/main/ui/auth.cljs:44" ], "used-in" : [ "src/uxbox/main/ui/auth.cljs:42" ],
"translations" : { "translations" : {
"en" : "The open-source solution for design and prototyping." "en" : "The open-source solution for design and prototyping."
} }
@ -228,21 +234,21 @@
} }
}, },
"dashboard.header.profile-menu.logout" : { "dashboard.header.profile-menu.logout" : {
"used-in" : [ "src/uxbox/main/ui/dashboard/profile.cljs:59" ], "used-in" : [ "src/uxbox/main/ui/dashboard/profile.cljs:58" ],
"translations" : { "translations" : {
"en" : "Exit", "en" : "Exit",
"fr" : "Quitter" "fr" : "Quitter"
} }
}, },
"dashboard.header.profile-menu.password" : { "dashboard.header.profile-menu.password" : {
"used-in" : [ "src/uxbox/main/ui/dashboard/profile.cljs:56" ], "used-in" : [ "src/uxbox/main/ui/dashboard/profile.cljs:55" ],
"translations" : { "translations" : {
"en" : "Password", "en" : "Password",
"fr" : "Mot de passe" "fr" : "Mot de passe"
} }
}, },
"dashboard.header.profile-menu.profile" : { "dashboard.header.profile-menu.profile" : {
"used-in" : [ "src/uxbox/main/ui/dashboard/profile.cljs:53" ], "used-in" : [ "src/uxbox/main/ui/dashboard/profile.cljs:52" ],
"translations" : { "translations" : {
"en" : "Profile", "en" : "Profile",
"fr" : "Profil" "fr" : "Profil"
@ -478,7 +484,7 @@
"unused" : true "unused" : true
}, },
"ds.store-images-title" : { "ds.store-images-title" : {
"used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:181" ], "used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:183" ],
"translations" : { "translations" : {
"en" : "IMAGES STORE", "en" : "IMAGES STORE",
"fr" : "BOUTIQUE" "fr" : "BOUTIQUE"
@ -499,7 +505,7 @@
"unused" : true "unused" : true
}, },
"ds.your-images-title" : { "ds.your-images-title" : {
"used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:178" ], "used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:180" ],
"translations" : { "translations" : {
"en" : "YOUR IMAGES", "en" : "YOUR IMAGES",
"fr" : "VOS IMAGES" "fr" : "VOS IMAGES"
@ -520,27 +526,27 @@
"unused" : true "unused" : true
}, },
"errors.auth.unauthorized" : { "errors.auth.unauthorized" : {
"used-in" : [ "src/uxbox/main/ui/auth/login.cljs:37" ], "used-in" : [ "src/uxbox/main/ui/auth/login.cljs:62" ],
"translations" : { "translations" : {
"en" : "Username or password seems to be wrong.", "en" : "Username or password seems to be wrong.",
"fr" : "Le nom d'utilisateur ou le mot de passe semble être faux." "fr" : "Le nom d'utilisateur ou le mot de passe semble être faux."
} }
}, },
"errors.email-already-exists" : { "errors.email-already-exists" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:38", "src/uxbox/main/ui/auth.cljs:84" ], "used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:38", "src/uxbox/main/ui/auth.cljs:87" ],
"translations" : { "translations" : {
"en" : "Email already used" "en" : "Email already used"
} }
}, },
"errors.generic" : { "errors.generic" : {
"used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:37", "src/uxbox/main/ui/auth.cljs:88", "src/uxbox/main/ui.cljs:179" ], "used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:37", "src/uxbox/main/ui/auth.cljs:91", "src/uxbox/main/ui.cljs:184" ],
"translations" : { "translations" : {
"en" : "Something wrong has happened.", "en" : "Something wrong has happened.",
"fr" : "Quelque chose c'est mal passé." "fr" : "Quelque chose c'est mal passé."
} }
}, },
"errors.network" : { "errors.network" : {
"used-in" : [ "src/uxbox/main/ui.cljs:173" ], "used-in" : [ "src/uxbox/main/ui.cljs:178" ],
"translations" : { "translations" : {
"en" : "Unable to connect to backend server.", "en" : "Unable to connect to backend server.",
"fr" : "Impossible de se connecter au serveur principal." "fr" : "Impossible de se connecter au serveur principal."
@ -560,14 +566,14 @@
} }
}, },
"errors.registration-disabled" : { "errors.registration-disabled" : {
"used-in" : [ "src/uxbox/main/ui/auth/register.cljs:52" ], "used-in" : [ "src/uxbox/main/ui/auth/register.cljs:48" ],
"translations" : { "translations" : {
"en" : "The registration is currently disabled.", "en" : "The registration is currently disabled.",
"fr" : "L'enregistrement est actuellement désactivé." "fr" : "L'enregistrement est actuellement désactivé."
} }
}, },
"errors.unexpected-error" : { "errors.unexpected-error" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:44", "src/uxbox/main/ui/auth/register.cljs:58" ], "used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:42", "src/uxbox/main/ui/auth/register.cljs:54" ],
"translations" : { "translations" : {
"en" : "An unexpected error occurred.", "en" : "An unexpected error occurred.",
"fr" : "Une erreur inattendue c'est produite" "fr" : "Une erreur inattendue c'est produite"
@ -601,28 +607,28 @@
} }
}, },
"image.import-library" : { "image.import-library" : {
"used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:170" ], "used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:172" ],
"translations" : { "translations" : {
"en" : "Import image from library", "en" : "Import image from library",
"fr" : "Importer une image depuis une librairie" "fr" : "Importer une image depuis une librairie"
} }
}, },
"image.new" : { "image.new" : {
"used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:84" ], "used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:86" ],
"translations" : { "translations" : {
"en" : "New image", "en" : "New image",
"fr" : "Nouvelle image" "fr" : "Nouvelle image"
} }
}, },
"image.select" : { "image.select" : {
"used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:90", "src/uxbox/main/ui/workspace/images.cljs:95" ], "used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:92", "src/uxbox/main/ui/workspace/images.cljs:97" ],
"translations" : { "translations" : {
"en" : "Select from library", "en" : "Select from library",
"fr" : "Choisir depuis une librairie" "fr" : "Choisir depuis une librairie"
} }
}, },
"image.upload" : { "image.upload" : {
"used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:102" ], "used-in" : [ "src/uxbox/main/ui/workspace/images.cljs:104" ],
"translations" : { "translations" : {
"en" : "Upload file", "en" : "Upload file",
"fr" : "Envoyer un fichier" "fr" : "Envoyer un fichier"
@ -635,7 +641,7 @@
} }
}, },
"profile.recovery.go-to-login" : { "profile.recovery.go-to-login" : {
"used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:97" ], "used-in" : [ "src/uxbox/main/ui/auth/recovery.cljs:96" ],
"translations" : { "translations" : {
"en" : null, "en" : null,
"fr" : null "fr" : null
@ -647,6 +653,30 @@
"en" : "Cancel and keep my account" "en" : "Cancel and keep my account"
} }
}, },
"settings.cancel-email-change" : {
"used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:81" ],
"translations" : {
"en" : "Cancel"
}
},
"settings.change-email-info" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:58" ],
"translations" : {
"en" : "We'll send you an email to your current email “%s” to verify your identity."
}
},
"settings.change-email-info2" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:82" ],
"translations" : {
"en" : "We have sent you an email to “%s”. Please follow the instructions to verify the email."
}
},
"settings.change-email-info3" : {
"used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:78" ],
"translations" : {
"en" : "There is a pending change of your email to “%s”."
}
},
"settings.change-email-label" : { "settings.change-email-label" : {
"used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:73" ], "used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:73" ],
"translations" : { "translations" : {
@ -654,25 +684,25 @@
} }
}, },
"settings.change-email-submit-label" : { "settings.change-email-submit-label" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:76" ], "used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:72" ],
"translations" : { "translations" : {
"en" : "Change email" "en" : "Change email"
} }
}, },
"settings.change-email-title" : { "settings.change-email-title" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:56" ], "used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:54" ],
"translations" : { "translations" : {
"en" : "Change your email" "en" : "Change your email"
} }
}, },
"settings.close-modal-label" : { "settings.close-modal-label" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:92" ], "used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:86" ],
"translations" : { "translations" : {
"en" : "Close" "en" : "Close"
} }
}, },
"settings.confirm-email-label" : { "settings.confirm-email-label" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:73" ], "used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:69" ],
"translations" : { "translations" : {
"en" : "Verify new email" "en" : "Verify new email"
} }
@ -702,6 +732,12 @@
"en" : "Email" "en" : "Email"
} }
}, },
"settings.email-verification-pending" : {
"used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:86" ],
"translations" : {
"en" : "There is a pending email validation."
}
},
"settings.fullname-label" : { "settings.fullname-label" : {
"used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:60" ], "used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:60" ],
"translations" : { "translations" : {
@ -722,7 +758,7 @@
} }
}, },
"settings.new-email-label" : { "settings.new-email-label" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:69" ], "used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:65" ],
"translations" : { "translations" : {
"en" : "New email" "en" : "New email"
} }
@ -734,53 +770,24 @@
"fr" : "Nouveau mot de passe" "fr" : "Nouveau mot de passe"
} }
}, },
"settings.notifications.description" : {
"translations" : {
"en" : null,
"fr" : null
},
"unused" : true
},
"settings.notifications.email-changed-successfully" : { "settings.notifications.email-changed-successfully" : {
"used-in" : [ "src/uxbox/main/ui/auth.cljs:64" ], "used-in" : [ "src/uxbox/main/ui/auth.cljs:62" ],
"translations" : { "translations" : {
"en" : "Your email address has been updated successfully" "en" : "Your email address has been updated successfully"
} }
}, },
"settings.notifications.email-not-verified" : {
"used-in" : [ "src/uxbox/main/ui/dashboard.cljs:109" ],
"translations" : {
"en" : "Your email address has not been verified yet. Please check your inbox at “%s” for a confirmation email."
}
},
"settings.notifications.email-verified-successfully" : { "settings.notifications.email-verified-successfully" : {
"used-in" : [ "src/uxbox/main/ui/auth.cljs:57" ], "used-in" : [ "src/uxbox/main/ui/auth.cljs:55" ],
"translations" : { "translations" : {
"en" : "Your email address has been verified successfully" "en" : "Your email address has been verified successfully"
} }
}, },
"settings.notifications.every-day" : {
"translations" : {
"en" : null,
"fr" : null
},
"unused" : true
},
"settings.notifications.every-hour" : {
"translations" : {
"en" : null,
"fr" : null
},
"unused" : true
},
"settings.notifications.none" : {
"translations" : {
"en" : null,
"fr" : null
},
"unused" : true
},
"settings.notifications.notifications-saved" : {
"translations" : {
"en" : null,
"fr" : null
},
"unused" : true
},
"settings.notifications.password-saved" : { "settings.notifications.password-saved" : {
"used-in" : [ "src/uxbox/main/ui/settings/password.cljs:36" ], "used-in" : [ "src/uxbox/main/ui/settings/password.cljs:36" ],
"translations" : { "translations" : {
@ -789,11 +796,10 @@
} }
}, },
"settings.notifications.profile-deletion-not-allowed" : { "settings.notifications.profile-deletion-not-allowed" : {
"used-in" : [ "src/uxbox/main/data/auth.cljs:136" ],
"translations" : { "translations" : {
"en" : null, "en" : "You can't delete you profile. Reasign your teams before proceed."
"fr" : null }
},
"used-in" : [ "src/uxbox/main/data/auth.cljs:121" ]
}, },
"settings.notifications.profile-saved" : { "settings.notifications.profile-saved" : {
"used-in" : [ "src/uxbox/main/ui/settings/options.cljs:37", "src/uxbox/main/ui/settings/profile.cljs:42" ], "used-in" : [ "src/uxbox/main/ui/settings/options.cljs:37", "src/uxbox/main/ui/settings/profile.cljs:42" ],
@ -810,13 +816,13 @@
} }
}, },
"settings.options" : { "settings.options" : {
"used-in" : [ "src/uxbox/main/ui/settings/header.cljs:52" ], "used-in" : [ "src/uxbox/main/ui/settings/header.cljs:54" ],
"translations" : { "translations" : {
"en" : "OPTIONS" "en" : "OPTIONS"
} }
}, },
"settings.password" : { "settings.password" : {
"used-in" : [ "src/uxbox/main/ui/settings/header.cljs:47" ], "used-in" : [ "src/uxbox/main/ui/settings/header.cljs:49" ],
"translations" : { "translations" : {
"en" : "PASSWORD", "en" : "PASSWORD",
"fr" : "MOT DE PASSE" "fr" : "MOT DE PASSE"
@ -830,27 +836,27 @@
} }
}, },
"settings.profile" : { "settings.profile" : {
"used-in" : [ "src/uxbox/main/ui/settings/header.cljs:42" ], "used-in" : [ "src/uxbox/main/ui/settings/header.cljs:44" ],
"translations" : { "translations" : {
"en" : "PROFILE", "en" : "PROFILE",
"fr" : "PROFIL" "fr" : "PROFIL"
} }
}, },
"settings.profile-submit-label" : { "settings.profile-submit-label" : {
"used-in" : [ "src/uxbox/main/ui/settings/options.cljs:65", "src/uxbox/main/ui/settings/password.cljs:94", "src/uxbox/main/ui/settings/profile.cljs:92" ], "used-in" : [ "src/uxbox/main/ui/settings/options.cljs:65", "src/uxbox/main/ui/settings/password.cljs:94", "src/uxbox/main/ui/settings/profile.cljs:89" ],
"translations" : { "translations" : {
"en" : "Update settings", "en" : "Update settings",
"fr" : "Mettre à jour les paramètres" "fr" : "Mettre à jour les paramètres"
} }
}, },
"settings.remove-account-label" : { "settings.remove-account-label" : {
"used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:97" ], "used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:94" ],
"translations" : { "translations" : {
"en" : "Want to remove your account?" "en" : "Want to remove your account?"
} }
}, },
"settings.teams" : { "settings.teams" : {
"used-in" : [ "src/uxbox/main/ui/settings/header.cljs:57" ], "used-in" : [ "src/uxbox/main/ui/settings/header.cljs:59" ],
"translations" : { "translations" : {
"en" : "TEAMS" "en" : "TEAMS"
} }
@ -868,7 +874,7 @@
} }
}, },
"settings.update-photo-label" : { "settings.update-photo-label" : {
"used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:119" ], "used-in" : [ "src/uxbox/main/ui/settings/profile.cljs:116" ],
"translations" : { "translations" : {
"en" : "UPDATE" "en" : "UPDATE"
} }
@ -881,7 +887,7 @@
"unused" : true "unused" : true
}, },
"settings.verification-sent-title" : { "settings.verification-sent-title" : {
"used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:81" ], "used-in" : [ "src/uxbox/main/ui/settings/change_email.cljs:77" ],
"translations" : { "translations" : {
"en" : "Verification email sent" "en" : "Verification email sent"
} }
@ -893,13 +899,13 @@
} }
}, },
"viewer.empty-state" : { "viewer.empty-state" : {
"used-in" : [ "src/uxbox/main/ui/viewer.cljs:44" ], "used-in" : [ "src/uxbox/main/ui/viewer.cljs:43" ],
"translations" : { "translations" : {
"en" : "No frames found on the page." "en" : "No frames found on the page."
} }
}, },
"viewer.frame-not-found" : { "viewer.frame-not-found" : {
"used-in" : [ "src/uxbox/main/ui/viewer.cljs:48" ], "used-in" : [ "src/uxbox/main/ui/viewer.cljs:47" ],
"translations" : { "translations" : {
"en" : "Frame not found." "en" : "Frame not found."
} }
@ -1467,7 +1473,7 @@
"unused" : true "unused" : true
}, },
"workspace.options.position" : { "workspace.options.position" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame.cljs:127", "src/uxbox/main/ui/workspace/sidebar/options/measures.cljs:138" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame.cljs:127", "src/uxbox/main/ui/workspace/sidebar/options/measures.cljs:134" ],
"translations" : { "translations" : {
"en" : "Position", "en" : "Position",
"fr" : "Position" "fr" : "Position"
@ -1480,14 +1486,14 @@
} }
}, },
"workspace.options.radius" : { "workspace.options.radius" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/measures.cljs:179" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/measures.cljs:175" ],
"translations" : { "translations" : {
"en" : "Radius", "en" : "Radius",
"fr" : "TODO" "fr" : "TODO"
} }
}, },
"workspace.options.rotation" : { "workspace.options.rotation" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/measures.cljs:154" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/measures.cljs:150" ],
"translations" : { "translations" : {
"en" : "Rotation", "en" : "Rotation",
"fr" : "TODO" "fr" : "TODO"
@ -1513,7 +1519,7 @@
} }
}, },
"workspace.options.size" : { "workspace.options.size" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame.cljs:102", "src/uxbox/main/ui/workspace/sidebar/options/measures.cljs:110" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame.cljs:102", "src/uxbox/main/ui/workspace/sidebar/options/measures.cljs:106" ],
"translations" : { "translations" : {
"en" : "Size", "en" : "Size",
"fr" : "Taille" "fr" : "Taille"
@ -1599,7 +1605,7 @@
} }
}, },
"workspace.sidebar.icons" : { "workspace.sidebar.icons" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/icons.cljs:88" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/icons.cljs:89" ],
"translations" : { "translations" : {
"en" : "Icons", "en" : "Icons",
"fr" : "Icône" "fr" : "Icône"
@ -1717,7 +1723,7 @@
} }
}, },
"workspace.viewport.click-to-close-path" : { "workspace.viewport.click-to-close-path" : {
"used-in" : [ "src/uxbox/main/ui/workspace/drawarea.cljs:363" ], "used-in" : [ "src/uxbox/main/ui/workspace/drawarea.cljs:373" ],
"translations" : { "translations" : {
"en" : "Click to close the path" "en" : "Click to close the path"
} }

View file

@ -14,7 +14,7 @@ $color-canvas: #E8E9EA;
$color-primary: #31EFB8; $color-primary: #31EFB8;
// Secondary colors // Secondary colors
$color-success: #49D793; $color-success: #58C35C;
$color-complete : #a599c6; $color-complete : #a599c6;
$color-warning: #FC8802; $color-warning: #FC8802;
$color-danger: #E65244; $color-danger: #E65244;

View file

@ -994,50 +994,205 @@ input[type=range]:focus::-ms-fill-upper {
white-space: normal; white-space: normal;
width: 100%; width: 100%;
} }
} }
} }
} }
.message-version { // Messages
align-items: center;
background-color: rgba(27, 170, 214, .6); // Banner top
border-radius: $br-small;
color: $color-white; .banner {
top: 0;
left: 0px;
width: 100%;
height: 40px;
z-index: 13;
display: flex; display: flex;
flex-direction: column;
justify-content: center; justify-content: center;
padding: $small; align-items: center;
position: absolute;
right: 250px;
top: 40px;
@include animation(0, 1s, fadeInDown);
span { .btn-close {
font-size: $fs13; position: absolute;
font-weight: bold; right: 0px;
} top: 0px;
width: 40px;
height: 40px;
.message-action {
align-items: center;
display: flex; display: flex;
justify-content: space-around; justify-content: center;
margin-top: $small; align-items: center;
width: 100%; cursor: pointer;
opacity: .35;
.btn-transparent { svg {
font-size: $fs12; fill: $color-black;
padding: .3rem .5rem; height: 18px;
width: 18px;
transform: rotate(45deg);
} }
&:hover {
opacity: .8;
}
} }
&.hide-message { .content {
align-items: center;
color: $color-white;
display: flex;
justify-content: center;
max-width: 60%;
.icon {
display: flex;
margin-right: $medium;
svg {
fill: $color-white;
height: 20px;
width: 20px;
}
}
span {
font-size: $fs15;
}
}
&.fixed {
position: fixed;
}
&.error {
background-color: $color-danger;
}
&.success {
background-color: $color-success;
}
&.warning {
background-color: $color-warning;
}
&.info {
background-color: $color-info;
}
&.quick {
.btn-close {
display: none;
}
}
&.hide {
@include animation(0, .6s, fadeOutUp); @include animation(0, .6s, fadeOutUp);
} }
}
.inline-banner {
display: flex;
margin-bottom: $big;
min-height: 40px;
width: 100%;
.icon {
display: flex;
flex-shrink: 0;
justify-content: center;
margin-right: $small;
padding: $small;
width: 40px;
svg {
fill: $color-white;
height: 20px;
width: 20px;
}
}
.content {
display: flex;
flex-direction: column;
}
.main {
display: flex;
}
.extra {
display: flex;
justify-content: flex-end;
padding: $small;
> div:not(:last-child) {
margin-right: $small;
}
}
.text {
display: flex;
font-size: $fs14;
color: $color-black;
padding: $small;
}
&.error {
background-color: lighten($color-danger,30%);
.icon {
background-color: $color-danger;
}
}
&.success {
background-color: lighten($color-success,30%);
.icon {
background-color: $color-success;
}
}
&.warning {
background-color: lighten($color-warning,30%);
.icon {
background-color: $color-warning;
}
}
&.info {
background-color: lighten($color-info,30%);
.icon {
background-color: $color-info;
}
}
.btn-close {
width: 40px;
height: 40px;
flex-shrink: 0;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
opacity: .35;
svg {
fill: $color-black;
height: 18px;
width: 18px;
transform: rotate(45deg);
}
&:hover {
opacity: .8;
}
}
&.quick {
.btn-close {
display: none;
}
}
} }
.close-bezier { .close-bezier {

View file

@ -42,7 +42,6 @@
//################################################# //#################################################
@import "main/partials/login"; @import "main/partials/login";
@import "main/partials/messages";
@import "main/partials/texts"; @import "main/partials/texts";
@import "main/partials/viewer"; @import "main/partials/viewer";
@import "main/partials/viewer-header"; @import "main/partials/viewer-header";

View file

@ -1,74 +0,0 @@
// Messages
.message {
position: fixed;
top: 0;
left: 0px;
width: 100%;
height: 40px;
z-index: 13;
display: flex;
justify-content: center;
align-items: center;
.close-button {
position: absolute;
right: 0px;
top: 0px;
width: 40px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
svg {
fill: $color-black;
height: 18px;
width: 18px;
transform: rotate(45deg);
}
&:hover {
opacity: .8;
}
}
.message-content {
color: $color-white;
span {
font-size: $fs18;
max-width: 60%;
}
}
&.error {
background-color: $color-danger;
border-color: $color-danger-dark;
}
&.success {
background-color: $color-success;
border-color: $color-success-dark;
}
&.info {
background-color: $color-info;
border-color: $color-info-dark;
}
&.quick {
.close-button {
display: none;
}
}
&.hide-message {
@include animation(0, .6s, fadeOutUp);
}
}

View file

@ -145,7 +145,9 @@
.profile-form { .profile-form {
flex-grow: 1; flex-grow: 1;
flex-basis: 390px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.change-email { .change-email {

View file

@ -57,7 +57,8 @@
params {:email email params {:email email
:password password :password password
:scope "webapp"}] :scope "webapp"}]
(->> (rp/mutation :login params) (->> (rx/timer 100)
(rx/mapcat #(rp/mutation :login params))
(rx/tap on-success) (rx/tap on-success)
(rx/catch (fn [err] (rx/catch (fn [err]
(on-error err) (on-error err)

View file

@ -1,53 +0,0 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.main.data.lightbox
(:require [beicon.core :as rx]
[lentes.core :as l]
[potok.core :as ptk]
[uxbox.main.store :as st]))
;; --- Show Lightbox
(defrecord ShowLightbox [name params]
ptk/UpdateEvent
(update [_ state]
(let [data (merge {:name name} params)]
(assoc state :lightbox data))))
(defn show-lightbox
([name]
(ShowLightbox. name nil))
([name params]
(ShowLightbox. name params)))
;; --- Hide Lightbox
(defrecord HideLightbox []
ptk/UpdateEvent
(update [_ state]
(dissoc state :lightbox)))
;; TODO: revemo this alias
(defn hide-lightbox
[]
(HideLightbox.))
(defn close-lightbox
[]
(HideLightbox.))
;; --- Direct Call Api
(defn open!
[& args]
(st/emit! (apply show-lightbox args)))
(defn close!
{:deperecated true}
[& args]
(st/emit! (apply hide-lightbox args)))

View file

@ -9,13 +9,13 @@
(ns uxbox.main.data.messages (ns uxbox.main.data.messages
(:require (:require
[beicon.core :as rx]
[cljs.spec.alpha :as s] [cljs.spec.alpha :as s]
[potok.core :as ptk] [potok.core :as ptk]
[beicon.core :as rx]
[uxbox.common.data :as d] [uxbox.common.data :as d]
[uxbox.common.exceptions :as ex]
[uxbox.common.pages :as cp] [uxbox.common.pages :as cp]
[uxbox.common.spec :as us] [uxbox.common.spec :as us]
[uxbox.common.exceptions :as ex]
[uxbox.config :as cfg])) [uxbox.config :as cfg]))
(declare hide) (declare hide)
@ -33,10 +33,11 @@
ptk/WatchEvent ptk/WatchEvent
(watch [_ state stream] (watch [_ state stream]
(let [stoper (rx/filter (ptk/type? ::show) stream)] (when (:timeout data)
(->> (rx/of hide) (let [stoper (rx/filter (ptk/type? ::show) stream)]
(rx/delay (:timeout data)) (->> (rx/of hide)
(rx/take-until stoper)))))) (rx/delay (:timeout data))
(rx/take-until stoper)))))))
(def hide (def hide
(ptk/reify ::hide (ptk/reify ::hide
@ -51,19 +52,29 @@
(defn error (defn error
[message & {:keys [timeout] :or {timeout 3000}}] ([content] (error content {}))
(show {:content message ([content {:keys [timeout] :or {timeout 3000}}]
:type :error (show {:content content
:timeout timeout})) :type :error
:timeout timeout})))
(defn info (defn info
[message & {:keys [timeout] :or {timeout 3000}}] ([content] (info content {}))
(show {:content message ([content {:keys [timeout] :or {timeout 3000}}]
:type :info (show {:content content
:timeout timeout})) :type :info
:timeout timeout})))
(defn success (defn success
[message & {:keys [timeout] :or {timeout 3000}}] ([content] (success content {}))
(show {:content message ([content {:keys [timeout] :or {timeout 3000}}]
:type :info (show {:content content
:timeout timeout})) :type :success
:timeout timeout})))
(defn warn
([content] (warn content {}))
([content {:keys [timeout] :or {timeout 3000}}]
(show {:content content
:type :warning
:timeout timeout})))

View file

@ -13,20 +13,22 @@
[cuerdas.core :as str] [cuerdas.core :as str]
[potok.core :as ptk] [potok.core :as ptk]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.icons :as i]
[uxbox.common.data :as d] [uxbox.common.data :as d]
[uxbox.common.exceptions :as ex] [uxbox.common.exceptions :as ex]
[uxbox.common.uuid :as uuid]
[uxbox.main.data.auth :refer [logout]] [uxbox.main.data.auth :refer [logout]]
[uxbox.main.data.messages :as dm] [uxbox.main.data.messages :as dm]
[uxbox.main.refs :as refs] [uxbox.main.refs :as refs]
[uxbox.main.store :as st] [uxbox.main.store :as st]
[uxbox.main.ui.dashboard :refer [dashboard]]
[uxbox.main.ui.static :refer [not-found-page not-authorized-page]]
[uxbox.main.ui.auth :refer [auth verify-token]] [uxbox.main.ui.auth :refer [auth verify-token]]
[uxbox.main.ui.dashboard :refer [dashboard]]
[uxbox.main.ui.icons :as i]
[uxbox.main.ui.messages :as msgs]
[uxbox.main.ui.settings :as settings] [uxbox.main.ui.settings :as settings]
[uxbox.main.ui.static :refer [not-found-page not-authorized-page]]
[uxbox.main.ui.viewer :refer [viewer-page]] [uxbox.main.ui.viewer :refer [viewer-page]]
[uxbox.main.ui.workspace :as workspace] [uxbox.main.ui.workspace :as workspace]
[uxbox.util.i18n :refer [tr]] [uxbox.util.i18n :as i18n :refer [tr t]]
[uxbox.util.timers :as ts])) [uxbox.util.timers :as ts]))
;; --- Routes ;; --- Routes
@ -84,62 +86,63 @@
(mf/defc app-container (mf/defc app-container
{::mf/wrap [#(mf/catch % {:fallback app-error})]} {::mf/wrap [#(mf/catch % {:fallback app-error})]}
[{:keys [route] :as props}] [{:keys [route] :as props}]
(case (get-in route [:data :name]) [:*
[:& msgs/notifications]
(case (get-in route [:data :name])
(:auth-login
:auth-register
:auth-goodbye
:auth-recovery-request
:auth-recovery)
[:& auth {:route route}]
(:auth-login :auth-verify-token
:auth-register [:& verify-token {:route route}]
:auth-goodbye
:auth-recovery-request
:auth-recovery)
[:& auth {:route route}]
:auth-verify-token (:settings-profile
[:& verify-token {:route route}] :settings-password
:settings-options)
[:& settings/settings {:route route}]
(:settings-profile :debug-icons-preview
:settings-password (when *assert*
:settings-options) [:& i/debug-icons-preview])
[:& settings/settings {:route route}]
:debug-icons-preview (:dashboard-search
(when *assert* :dashboard-team
[:& i/debug-icons-preview]) :dashboard-project
:dashboard-library-icons
:dashboard-library-icons-index
:dashboard-library-images
:dashboard-library-images-index
:dashboard-library-palettes
:dashboard-library-palettes-index)
[:& dashboard {:route route}]
(:dashboard-search :viewer
:dashboard-team (let [index (d/parse-integer (get-in route [:params :query :index]))
:dashboard-project token (get-in route [:params :query :token])
:dashboard-library-icons page-id (uuid (get-in route [:params :path :page-id]))]
:dashboard-library-icons-index [:& viewer-page {:page-id page-id
:dashboard-library-images :index index
:dashboard-library-images-index :token token}])
:dashboard-library-palettes
:dashboard-library-palettes-index)
[:& dashboard {:route route}]
:viewer :workspace
(let [index (d/parse-integer (get-in route [:params :query :index])) (let [project-id (uuid (get-in route [:params :path :project-id]))
token (get-in route [:params :query :token]) file-id (uuid (get-in route [:params :path :file-id]))
page-id (uuid (get-in route [:params :path :page-id]))] page-id (uuid (get-in route [:params :query :page-id]))]
[:& viewer-page {:page-id page-id [:& workspace/workspace {:project-id project-id
:index index :file-id file-id
:token token}]) :page-id page-id
:key file-id}])
:workspace :not-authorized
(let [project-id (uuid (get-in route [:params :path :project-id])) [:& not-authorized-page]
file-id (uuid (get-in route [:params :path :file-id]))
page-id (uuid (get-in route [:params :query :page-id]))]
[:& workspace/workspace {:project-id project-id
:file-id file-id
:page-id page-id
:key file-id}])
:not-authorized :not-found
[:& not-authorized-page] [:& not-found-page]
:not-found nil)])
[:& not-found-page]
nil))
(mf/defc app (mf/defc app
[] []

View file

@ -17,7 +17,6 @@
[uxbox.main.data.users :as du] [uxbox.main.data.users :as du]
[uxbox.main.data.messages :as dm] [uxbox.main.data.messages :as dm]
[uxbox.main.store :as st] [uxbox.main.store :as st]
[uxbox.main.ui.messages :refer [messages]]
[uxbox.main.ui.auth.login :refer [login-page]] [uxbox.main.ui.auth.login :refer [login-page]]
[uxbox.main.ui.auth.recovery :refer [recovery-page]] [uxbox.main.ui.auth.recovery :refer [recovery-page]]
[uxbox.main.ui.auth.recovery-request :refer [recovery-request-page]] [uxbox.main.ui.auth.recovery-request :refer [recovery-request-page]]
@ -37,21 +36,19 @@
[{:keys [route] :as props}] [{:keys [route] :as props}]
(let [section (get-in route [:data :name]) (let [section (get-in route [:data :name])
locale (mf/deref i18n/locale)] locale (mf/deref i18n/locale)]
[:* [:div.auth
[:& messages] [:section.auth-sidebar
[:div.auth [:a.logo {:href "/#/"} i/logo]
[:section.auth-sidebar [:span.tagline (t locale "auth.sidebar-tagline")]]
[:a.logo {:href "/#/"} i/logo]
[:span.tagline (t locale "auth.sidebar-tagline")]]
[:section.auth-content [:section.auth-content
(case section (case section
:auth-register [:& register-page {:locale locale}] :auth-register [:& register-page {:locale locale}]
:auth-login [:& login-page {:locale locale}] :auth-login [:& login-page {:locale locale}]
:auth-goodbye [:& goodbye-page {:locale locale}] :auth-goodbye [:& goodbye-page {:locale locale}]
:auth-recovery-request [:& recovery-request-page {:locale locale}] :auth-recovery-request [:& recovery-request-page {:locale locale}]
:auth-recovery [:& recovery-page {:locale locale :auth-recovery [:& recovery-page {:locale locale
:params (:query-params route)}])]]])) :params (:query-params route)}])]]))
(defn- handle-email-verified (defn- handle-email-verified
[data] [data]

View file

@ -18,6 +18,7 @@
[uxbox.main.data.auth :as da] [uxbox.main.data.auth :as da]
[uxbox.main.repo :as rp] [uxbox.main.repo :as rp]
[uxbox.main.store :as st] [uxbox.main.store :as st]
[uxbox.main.ui.messages :as msgs]
[uxbox.main.data.messages :as dm] [uxbox.main.data.messages :as dm]
[uxbox.main.ui.components.forms :refer [input submit-button form]] [uxbox.main.ui.components.forms :refer [input submit-button form]]
[uxbox.util.object :as obj] [uxbox.util.object :as obj]
@ -32,16 +33,6 @@
(s/def ::login-form (s/def ::login-form
(s/keys :req-un [::email ::password])) (s/keys :req-un [::email ::password]))
(defn- on-error
[form error]
(st/emit! (dm/error (tr "errors.auth.unauthorized"))))
(defn- on-submit
[form event]
(let [params (with-meta (:clean-data form)
{:on-error (partial on-error form)})]
(st/emit! (da/login params))))
(defn- login-with-google (defn- login-with-google
[event] [event]
(dom/prevent-default event) (dom/prevent-default event)
@ -51,23 +42,43 @@
(mf/defc login-form (mf/defc login-form
[{:keys [locale] :as props}] [{:keys [locale] :as props}]
[:& form {:on-submit on-submit (let [error? (mf/use-state false)
:spec ::login-form
:initial {}} on-error
[:& input (fn [form event]
{:name :email (reset! error? true))
:type "text"
:tab-index "2" on-submit
:help-icon i/at (fn [form event]
:label (t locale "auth.email-label")}] (reset! error? false)
[:& input (let [params (with-meta (:clean-data form)
{:type "password" {:on-error on-error})]
:name :password (st/emit! (da/login params))))]
:tab-index "3"
:help-icon i/eye [:*
:label (t locale "auth.password-label")}] (when @error?
[:& submit-button [:& msgs/inline-banner
{:label (t locale "auth.login-submit-label")}]]) {:type :warning
:content (t locale "errors.auth.unauthorized")
:on-close #(reset! error? false)}])
[:& form {:on-submit on-submit
:spec ::login-form
:initial {}}
[:& input
{:name :email
:type "text"
:tab-index "2"
:help-icon i/at
:label (t locale "auth.email-label")}]
[:& input
{:type "password"
:name :password
:tab-index "3"
:help-icon i/eye
:label (t locale "auth.password-label")}]
[:& submit-button
{:label (t locale "auth.login-submit-label")}]]]))
(mf/defc login-page (mf/defc login-page
[{:keys [locale] :as props}] [{:keys [locale] :as props}]

View file

@ -18,7 +18,6 @@
[uxbox.main.data.messages :as dm] [uxbox.main.data.messages :as dm]
[uxbox.main.store :as st] [uxbox.main.store :as st]
[uxbox.main.ui.components.forms :refer [input submit-button form]] [uxbox.main.ui.components.forms :refer [input submit-button form]]
[uxbox.main.ui.messages :refer [messages]]
[uxbox.main.ui.navigation :as nav] [uxbox.main.ui.navigation :as nav]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]
[uxbox.util.forms :as fm] [uxbox.util.forms :as fm]

View file

@ -11,7 +11,6 @@
(:require (:require
[cljs.spec.alpha :as s] [cljs.spec.alpha :as s]
[cuerdas.core :as str] [cuerdas.core :as str]
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.icons :as i] [uxbox.main.ui.icons :as i]
[uxbox.common.spec :as us] [uxbox.common.spec :as us]
@ -19,7 +18,6 @@
[uxbox.main.data.messages :as dm] [uxbox.main.data.messages :as dm]
[uxbox.main.store :as st] [uxbox.main.store :as st]
[uxbox.main.ui.components.forms :refer [input submit-button form]] [uxbox.main.ui.components.forms :refer [input submit-button form]]
[uxbox.main.ui.messages :refer [messages]]
[uxbox.main.ui.navigation :as nav] [uxbox.main.ui.navigation :as nav]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]
[uxbox.util.forms :as fm] [uxbox.util.forms :as fm]

View file

@ -11,16 +11,15 @@
(:require (:require
[cljs.spec.alpha :as s] [cljs.spec.alpha :as s]
[cuerdas.core :as str] [cuerdas.core :as str]
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.config :as cfg] [uxbox.config :as cfg]
[uxbox.main.ui.icons :as i] [uxbox.main.ui.icons :as i]
[uxbox.main.data.auth :as uda] [uxbox.main.data.auth :as uda]
[uxbox.main.store :as st] [uxbox.main.store :as st]
[uxbox.main.data.auth :as da] [uxbox.main.data.auth :as da]
[uxbox.main.ui.messages :refer [messages]]
[uxbox.main.ui.components.forms :refer [input submit-button form]] [uxbox.main.ui.components.forms :refer [input submit-button form]]
[uxbox.main.ui.navigation :as nav] [uxbox.main.ui.navigation :as nav]
[uxbox.main.ui.messages :as msgs]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]
[uxbox.util.forms :as fm] [uxbox.util.forms :as fm]
[uxbox.util.i18n :refer [tr t]] [uxbox.util.i18n :refer [tr t]]
@ -29,12 +28,9 @@
(mf/defc demo-warning (mf/defc demo-warning
[_] [_]
[:div.featured-note.warning [:& msgs/inline-banner
[:span {:type :warning
[:strong "WARNING: "] :content (tr "auth.demo-warning")}])
"This is a " [:strong "demo"] " service, "
[:strong "DO NOT USE"] " for real work, "
" the projects will be periodicaly wiped."]])
(s/def ::fullname ::fm/not-empty-string) (s/def ::fullname ::fm/not-empty-string)
(s/def ::password ::fm/not-empty-string) (s/def ::password ::fm/not-empty-string)

View file

@ -13,6 +13,7 @@
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.icons :as i] [uxbox.main.ui.icons :as i]
[uxbox.common.exceptions :as ex] [uxbox.common.exceptions :as ex]
[uxbox.common.uuid :as uuid]
[uxbox.common.spec :as us] [uxbox.common.spec :as us]
[uxbox.main.refs :as refs] [uxbox.main.refs :as refs]
[uxbox.main.ui.dashboard.sidebar :refer [sidebar]] [uxbox.main.ui.dashboard.sidebar :refer [sidebar]]
@ -21,7 +22,7 @@
[uxbox.main.ui.dashboard.recent-files :refer [recent-files-page]] [uxbox.main.ui.dashboard.recent-files :refer [recent-files-page]]
[uxbox.main.ui.dashboard.library :refer [library-page]] [uxbox.main.ui.dashboard.library :refer [library-page]]
[uxbox.main.ui.dashboard.profile :refer [profile-section]] [uxbox.main.ui.dashboard.profile :refer [profile-section]]
[uxbox.main.ui.messages :refer [messages]])) [uxbox.util.i18n :as i18n :refer [t]]))
(defn ^boolean uuid-str? (defn ^boolean uuid-str?
[s] [s]
@ -53,6 +54,8 @@
(uuid-str? library-id) (uuid-str? library-id)
(assoc :library-id (uuid library-id))))) (assoc :library-id (uuid library-id)))))
(declare global-notifications)
(mf/defc dashboard (mf/defc dashboard
[{:keys [route] :as props}] [{:keys [route] :as props}]
@ -61,7 +64,7 @@
{:keys [search-term team-id project-id library-id library-section] :as params} {:keys [search-term team-id project-id library-id library-section] :as params}
(parse-params route profile)] (parse-params route profile)]
[:* [:*
[:& messages] [:& global-notifications {:profile profile}]
[:section.dashboard-layout [:section.dashboard-layout
[:div.main-logo i/logo-icon] [:div.main-logo i/logo-icon]
[:& profile-section {:profile profile}] [:& profile-section {:profile profile}]
@ -91,3 +94,17 @@
:dashboard-project :dashboard-project
[:& project-page {:team-id team-id [:& project-page {:team-id team-id
:project-id project-id}])]]])) :project-id project-id}])]]]))
(mf/defc global-notifications
[{:keys [profile] :as props}]
(let [locale (mf/deref i18n/locale)]
(when (and profile
(not= uuid/zero (:id profile))
(= (:pending-email profile)
(:email profile)))
[:section.banner.error.quick
[:div.content
[:div.icon i/msg-warning]
[:span (t locale "settings.notifications.email-not-verified" (:email profile))]]])))

View file

@ -1,295 +0,0 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2015-2017 Juan de la Cruz <delacruzgarciajuan@gmail.com>
;; Copyright (c) 2015-2019 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.main.ui.dashboard.colors
(:require
[cuerdas.core :as str]
[lentes.core :as l]
[rumext.alpha :as mf]
[uxbox.main.ui.icons :as i]
[uxbox.main.data.colors :as dc]
[uxbox.main.store :as st]
[uxbox.main.ui.dashboard.common :as common]
[uxbox.main.ui.colorpicker :refer [colorpicker]]
[uxbox.main.ui.confirm :refer [confirm-dialog]]
[uxbox.main.ui.keyboard :as k]
[uxbox.main.ui.modal :as modal]
[uxbox.util.color :refer [hex->rgb]]
[uxbox.util.data :refer [seek]]
[uxbox.util.dom :as dom]
[uxbox.util.i18n :as t :refer [tr]]
[uxbox.util.router :as rt]))
;; ;; --- Refs
;;
;; (def collections-iref
;; (-> (l/key :colors-collections)
;; (l/derive st/state)))
;;
;; (def selected-colors-iref
;; (-> (l/in [:dashboard :colors :selected])
;; (l/derive st/state)))
;;
;; ;; --- Colors Modal (Component)
;;
;; (mf/defc color-modal
;; [{:keys [on-submit value] :as props}]
;; (let [local (mf/use-var value)]
;; [:div.lightbox-body
;; [:h3 (tr "ds.color-lightbox.title" )]
;; [:form
;; [:div.row-flex.center
;; [:& colorpicker {:value (or @local "#00ccff")
;; :on-change #(reset! local %)}]]
;; [:input#project-btn.btn-primary
;; {:value (tr "ds.color-lightbox.add")
;; :on-click #(on-submit @local)
;; :type "button"}]]]))
;;
;; ;; --- Page Title
;;
;;
;; (mf/defc grid-header
;; [{:keys [coll] :as props}]
;; (letfn [(on-change [name]
;; (st/emit! (dc/rename-collection (:id coll) name)))
;;
;; (delete []
;; (st/emit!
;; (dc/delete-collection (:id coll))
;; (rt/nav :dashboard-colors nil {:type (:type coll)})))
;;
;; (on-delete []
;; (modal/show! confirm-dialog {:on-accept delete}))]
;; [:& common/grid-header {:value (:name coll)
;; :on-change on-change
;; :on-delete on-delete}]))
;;
;; ;; --- Nav
;;
;; (mf/defc nav-item
;; [{:keys [coll selected?] :as props}]
;; (let [local (mf/use-state {})
;; {:keys [id type name]} coll
;; colors (count (:colors coll))
;; editable? (= type :own)]
;; (letfn [(on-click [event]
;; (let [type (or type :own)]
;; (st/emit! (rt/nav :dashboard-colors nil {:type type :id id}))))
;; (on-input-change [event]
;; (let [value (dom/get-target event)
;; value (dom/get-value value)]
;; (swap! local assoc :name value)))
;; (on-cancel [event]
;; (swap! local dissoc :name)
;; (swap! local dissoc :edit))
;; (on-double-click [event]
;; (when editable?
;; (swap! local assoc :edit true)))
;; (on-input-keyup [event]
;; (when (k/enter? event)
;; (let [value (dom/get-target event)
;; value (dom/get-value value)]
;; (st/emit! (dc/rename-collection id (str/trim (:name @local))))
;; (swap! local assoc :edit false))))]
;; [:li {:on-click on-click
;; :on-double-click on-double-click
;; :class-name (when selected? "current")}
;; (if (:edit @local)
;; [:div
;; [:input.element-title
;; {:value (if (:name @local) (:name @local) name)
;; :on-change on-input-change
;; :on-key-down on-input-keyup}]
;; [:span.close {:on-click on-cancel} i/close]]
;; [:span.element-title name])
;; #_[:span.element-subtitle
;; (tr "ds.num-elements" (t/c colors))]])))
;;
;; (mf/defc nav
;; [{:keys [id type colls selected-coll] :as props}]
;; (let [own? (= type :own)
;; builtin? (= type :builtin)
;; select-tab #(st/emit! (rt/nav :dashboard-colors nil {:type %}))]
;; [:div.library-bar
;; [:div.library-bar-inside
;; [:ul.library-tabs
;; [:li {:class-name (when own? "current")
;; :on-click (partial select-tab :own)}
;; (tr "ds.your-colors-title")]
;; [:li {:class-name (when builtin? "current")
;; :on-click (partial select-tab :builtin)}
;; (tr "ds.store-colors-title")]]
;; [:ul.library-elements
;; (when own?
;; [:li
;; [:a.btn-primary {:on-click #(st/emit! (dc/create-collection))}
;; (tr "ds.colors-collection.new")]])
;; (for [item colls]
;; (let [selected? (= (:id item) (:id selected-coll))]
;; [:& nav-item {:coll item :selected? selected? :key (:id item)}]))]]]))
;;
;; ;; --- Grid
;;
;; (mf/defc grid-form
;; [{:keys [id] :as props}]
;; (letfn [(on-submit [val]
;; (st/emit! (dc/add-color id val))
;; (modal/hide!))
;; (on-click [event]
;; (modal/show! color-modal {:on-submit on-submit}))]
;; [:div.grid-item.small-item.add-project {:on-click on-click}
;; [:span (tr "ds.color-new")]]))
;;
;; (mf/defc grid-options-tooltip
;; [{:keys [selected on-select title] :as props}]
;; {:pre [(uuid? selected)
;; (fn? on-select)
;; (string? title)]}
;; (let [colls (mf/deref collections-iref)
;; colls (->> (vals colls)
;; (filter #(= :own (:type %)))
;; (remove #(= selected (:id %)))
;; (sort-by :name colls))
;; on-select (fn [event id]
;; (dom/prevent-default event)
;; (dom/stop-propagation event)
;; (on-select id))]
;; [:ul.move-list
;; [:li.title title]
;; (for [{:keys [id name] :as coll} colls]
;; [:li {:key (str id)}
;; [:a {:on-click #(on-select % id)} name]])]))
;;
;; (mf/defc grid-options
;; [{:keys [id type coll selected] :as props}]
;; (let [local (mf/use-state {})]
;; (letfn [(delete [event]
;; (st/emit! (dc/delete-colors id selected)))
;; (on-delete [event]
;; (modal/show! confirm-dialog {:on-accept delete}))
;; (on-toggle-copy [event]
;; (swap! local update :show-copy-tooltip not)
;; (swap! local assoc :show-move-tooltip false))
;; (on-toggle-move [event]
;; (swap! local update :show-move-tooltip not)
;; (swap! local assoc :show-copy-tooltip false))
;; (on-copy [selected]
;; (swap! local assoc
;; :show-move-tooltip false
;; :show-copy-tooltip false)
;; (st/emit! (dc/copy-selected selected)))
;; (on-move [selected]
;; (swap! local assoc
;; :show-move-tooltip false
;; :show-copy-tooltip false)
;; (st/emit! (dc/move-selected id selected)))]
;;
;; ;; MULTISELECT OPTIONS BAR
;; [:div.multiselect-bar
;; (if (or (= type :own) (nil? id))
;; ;; if editable
;; [:div.multiselect-nav
;; [:span.move-item.tooltip.tooltip-top
;; {:alt (tr "ds.multiselect-bar.copy")
;; :on-click on-toggle-copy}
;; (when (:show-copy-tooltip @local)
;; [:& grid-options-tooltip {:selected id
;; :title (tr "ds.multiselect-bar.copy-to-library")
;; :on-select on-copy}])
;; i/copy]
;; [:span.move-item.tooltip.tooltip-top
;; {:alt (tr "ds.multiselect-bar.move")
;; :on-click on-toggle-move}
;; (when (:show-move-tooltip @local)
;; [:& grid-options-tooltip {:selected id
;; :title (tr "ds.multiselect-bar.move-to-library")
;; :on-select on-move}])
;; i/move]
;; [:span.delete.tooltip.tooltip-top
;; {:alt (tr "ds.multiselect-bar.delete")
;; :on-click on-delete}
;; i/trash]]
;;
;; ;; if not editable
;; [:div.multiselect-nav
;; [:span.move-item.tooltip.tooltip-top
;; {:alt (tr "ds.multiselect-bar.copy")
;; :on-click on-toggle-copy}
;; (when (:show-copy-tooltip @local)
;; [:& grid-options-tooltip {:selected id
;; :title (tr "ds.multiselect-bar.copy-to-library")
;; :on-select on-copy}])
;; i/organize]])])))
;;
;; (mf/defc grid-item
;; [{:keys [color selected?] :as props}]
;; (letfn [(toggle-selection [event]
;; (st/emit! (dc/toggle-color-selection color)))]
;; [:div.grid-item.small-item.project-th {:on-click toggle-selection}
;; [:span.color-swatch {:style {:background-color color}}]
;; [:div.input-checkbox.check-primary
;; [:input {:type "checkbox"
;; :id color
;; :on-change toggle-selection
;; :checked selected?}]
;; [:label {:for color}]]
;; [:span.color-data color]
;; [:span.color-data (apply str "RGB " (interpose ", " (hex->rgb color)))]]))
;;
;; (mf/defc grid
;; [{:keys [id type coll selected] :as props}]
;; (let [{:keys [colors]} coll
;; editable? (= :own type)
;; colors (->> (remove nil? colors)
;; (sort-by identity))]
;; [:div.dashboard-grid-content
;; [:div.dashboard-grid-row
;; (when (and editable? id)
;; [:& grid-form {:id id}])
;; (for [color colors]
;; (let [selected? (contains? selected color)]
;; [:& grid-item {:color color :selected? selected? :key color}]))]]))
;;
;; (mf/defc content
;; [{:keys [id type coll] :as props}]
;; (let [selected (mf/deref selected-colors-iref)]
;; [:section.dashboard-grid.library
;; (when coll
;; [:& grid-header {:coll coll}])
;; [:& grid {:coll coll :id id :type type :selected selected}]
;; (when (seq selected)
;; [:& grid-options {:id id :type type
;; :selected selected
;; :coll coll}])]))
;;
;; ;; --- Colors Page
;;
;; (mf/defc colors-page
;; [{:keys [id type] :as props}]
;; (let [type (or type :own)
;;
;; colls (mf/deref collections-iref)
;; colls (cond->> (vals colls)
;; (= type :own) (filter #(= :own (:type %)))
;; (= type :builtin) (filter #(= :builtin (:type %)))
;; true (sort-by :created-at))
;; selected-coll (if id
;; (seek #(= id (:id %)) colls)
;; (first colls))
;; id (:id selected-coll)]
;;
;; (mf/use-effect #(st/emit! (dc/fetch-collections)))
;;
;; [:section.dashboard-content
;; [:& nav {:type type
;; :id id
;; :colls colls}]
;; [:& content {:type type
;; :id id
;; :coll selected-coll}]]))
;;

View file

@ -1,387 +0,0 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2015-2020 Andrey Antukh <niwi@niwi.nz>
;; Copyright (c) 2015-2020 Juan de la Cruz <delacruzgarciajuan@gmail.com>
(ns uxbox.main.ui.dashboard.images
(:require
[cljs.spec.alpha :as s]
[cuerdas.core :as str]
[lentes.core :as l]
[rumext.alpha :as mf]
[uxbox.main.ui.icons :as i]
[uxbox.common.data :as d]
[uxbox.common.spec :as us]
[uxbox.main.data.images :as di]
[uxbox.main.store :as st]
[uxbox.main.ui.confirm :refer [confirm-dialog]]
[uxbox.main.ui.dashboard.common :as common]
[uxbox.main.ui.keyboard :as kbd]
[uxbox.main.ui.modal :as modal]
[uxbox.util.dom :as dom]
[uxbox.util.i18n :as i18n :refer [t tr]]
[uxbox.util.router :as rt]
[uxbox.util.time :as dt]))
;; ;; --- Page Title
;;
;; (mf/defc grid-header
;; [{:keys [collection] :as props}]
;; (let [{:keys [id type]} collection
;; on-change #(st/emit! (di/rename-collection id %))
;; on-deleted #(st/emit! (rt/nav :dashboard-images nil {:type type}))
;; delete #(st/emit! (di/delete-collection id on-deleted))
;; on-delete #(modal/show! confirm-dialog {:on-accept delete})]
;; [:& common/grid-header {:value (:name collection)
;; :on-change on-change
;; :on-delete on-delete}]))
;;
;; ;; --- Nav
;;
;; (mf/defc nav-item
;; [{:keys [coll selected?] :as props}]
;; (let [local (mf/use-state {})
;; {:keys [id type name num-images]} coll
;; editable? (= type :own)
;;
;; on-click
;; (fn [event]
;; (let [type (or type :own)]
;; (st/emit! (rt/nav :dashboard-images {} {:type type :id id}))))
;;
;; on-cancel-edition #(swap! local dissoc :edit)
;; on-double-click #(when editable? (swap! local assoc :edit true))
;;
;; on-input-keyup
;; (fn [event]
;; (when (kbd/enter? event)
;; (let [value (-> (dom/get-target event)
;; (dom/get-value)
;; (str/trim))]
;; (st/emit! (di/rename-collection id value))
;; (swap! local assoc :edit false))))]
;;
;; [:li {:on-click on-click
;; :on-double-click on-double-click
;; :class-name (when selected? "current")}
;; (if (:edit @local)
;; [:div
;; [:input.element-title {:default-value name
;; :on-key-down on-input-keyup}]
;; [:span.close {:on-click on-cancel-edition} i/close]]
;; [:span.element-title (if id name "Storage")])]))
;;
;; (mf/defc nav
;; [{:keys [id type collections] :as props}]
;; (let [locale (i18n/use-locale)
;; own? (= type :own)
;; builtin? (= type :builtin)
;; create-collection #(st/emit! di/create-collection)
;; select-own-tab #(st/emit! (rt/nav :dashboard-images nil {:type :own}))
;; select-buitin-tab #(st/emit! (rt/nav :dashboard-images nil {:type :builtin}))]
;; [:div.library-bar
;; [:div.library-bar-inside
;;
;; ;; Tabs
;; [:ul.library-tabs
;; [:li {:class (when own? "current")
;; :on-click select-own-tab}
;; (t locale "ds.your-images-title")]
;;
;; [:li {:class (when builtin? "current")
;; :on-click select-buitin-tab}
;; (t locale "ds.store-images-title")]]
;;
;; ;; Collections List
;; [:ul.library-elements
;; (when own?
;; [:li
;; [:a.btn-primary {:on-click create-collection}
;; (t locale "ds.images-collection.new")]])
;;
;; (for [item collections]
;; [:& nav-item {:coll item
;; :selected? (= (:id item) id)
;; :key (:id item)}])]]]))
;;
;; ;; --- Grid
;;
;; ;; (mf/defc grid-options-tooltip
;; ;; [{:keys [selected on-select title] :as props}]
;; ;; {:pre [(uuid? selected)
;; ;; (fn? on-select)
;; ;; (string? title)]}
;; ;; (let [colls (mf/deref collections-iref)
;; ;; colls (->> (vals colls)
;; ;; (filter #(= :own (:type %)))
;; ;; (remove #(= selected (:id %)))
;; ;; #_(sort-by :name colls))
;; ;; on-select (fn [event id]
;; ;; (dom/prevent-default event)
;; ;; (dom/stop-propagation event)
;; ;; (on-select id))]
;; ;; [:ul.move-list
;; ;; [:li.title title]
;; ;; [:li
;; ;; (when (not (nil? selected))
;; ;; [:a {:href "#" :on-click #(on-select % nil)} "Storage"])]
;; ;; (for [{:keys [id name] :as coll} colls]
;; ;; [:li {:key (pr-str id)}
;; ;; [:a {:on-click #(on-select % id)} name]])]))
;;
;; (mf/defc grid-options
;; [{:keys [id type selected] :as props}]
;; (let [local (mf/use-state {})
;; delete #(st/emit! di/delete-selected)
;; on-delete #(modal/show! confirm-dialog {:on-accept delete})
;;
;; ;; (on-toggle-copy [event]
;; ;; (swap! local update :show-copy-tooltip not))
;; ;; (on-toggle-move [event]
;; ;; (swap! local update :show-move-tooltip not))
;; ;; (on-copy [selected]
;; ;; (swap! local assoc
;; ;; :show-move-tooltip false
;; ;; :show-copy-tooltip false)
;; ;; (st/emit! (di/copy-selected selected)))
;; ;; (on-move [selected]
;; ;; (swap! local assoc
;; ;; :show-move-tooltip false
;; ;; :show-copy-tooltip false)
;; ;; (st/emit! (di/move-selected selected)))
;; ;; (on-rename [event]
;; ;; (let [selected (first selected)]
;; ;; (st/emit! (di/update-opts :edition selected))))
;; ]
;; ;; MULTISELECT OPTIONS BAR
;; [:div.multiselect-bar
;; (when (= type :own)
;; ;; If editable
;; [:div.multiselect-nav
;; ;; [:span.move-item.tooltip.tooltip-top
;; ;; {:alt (tr "ds.multiselect-bar.copy")
;; ;; :on-click on-toggle-copy}
;; ;; (when (:show-copy-tooltip @local)
;; ;; [:& grid-options-tooltip {:selected id
;; ;; :title (tr "ds.multiselect-bar.copy-to-library")
;; ;; :on-select on-copy}])
;; ;; i/copy]
;; ;; [:span.move-item.tooltip.tooltip-top
;; ;; {:alt (tr "ds.multiselect-bar.move")
;; ;; :on-click on-toggle-move}
;; ;; (when (:show-move-tooltip @local)
;; ;; [:& grid-options-tooltip {:selected id
;; ;; :title (tr "ds.multiselect-bar.move-to-library")
;; ;; :on-select on-move}])
;; ;; i/move]
;; ;; (when (= 1 (count selected))
;; ;; [:span.move-item.tooltip.tooltip-top {:alt (tr "ds.multiselect-bar.rename")
;; ;; :on-click on-rename}
;; ;; i/pencil])
;; [:span.delete.tooltip.tooltip-top
;; {:alt (tr "ds.multiselect-bar.delete")
;; :on-click on-delete}
;; i/trash]]
;;
;; ;; If not editable
;; ;; [:div.multiselect-nav
;; ;; [:span.move-item.tooltip.tooltip-top {:alt (tr "ds.multiselect-bar.copy")
;; ;; :on-click on-toggle-copy}
;; ;; (when (:show-copy-tooltip @local)
;; ;; [:& grid-options-tooltip {:selected id
;; ;; :title (tr "ds.multiselect-bar.copy-to-library")
;; ;; :on-select on-copy}])
;; ;; i/organize]]
;; )]))
;;
;;
;; ;; --- Grid Form
;;
;; (mf/defc grid-form
;; [{:keys [id type uploading?] :as props}]
;; (let [input (mf/use-ref nil)
;; on-click #(dom/click (mf/ref-node input))
;; on-select #(st/emit! (->> (dom/get-target %)
;; (dom/get-files)
;; (array-seq)
;; (di/create-images id)))]
;; [:div.grid-item.add-project {:on-click on-click}
;; (if uploading?
;; [:div i/loader-pencil]
;; [:span (tr "ds.image-new")])
;; [:input.upload-image-input
;; {:style {:display "none"}
;; :multiple true
;; :ref input
;; :value ""
;; :accept "image/jpeg,image/png,image/webp"
;; :type "file"
;; :on-change on-select}]]))
;;
;; ;; --- Grid Item
;;
;; (mf/defc grid-item
;; [{:keys [image selected? edition?] :as props}]
;; (let [toggle-selection #(st/emit! (if selected?
;; (di/deselect-image (:id image))
;; (di/select-image (:id image))))
;; on-blur
;; (fn [event]
;; (let [target (dom/get-target event)
;; name (dom/get-value target)]
;; (st/emit! (di/update-opts :edition false)
;; (di/rename-image (:id image) name))))
;;
;; on-key-down
;; (fn [event]
;; (when (kbd/enter? event)
;; (on-blur event)))
;;
;; on-edit
;; (fn [event]
;; (dom/stop-propagation event)
;; (dom/prevent-default event)
;; (st/emit! (di/update-opts :edition (:id image))))
;;
;; background (str "url('" (:thumb-uri image) "')")]
;;
;; [:div.grid-item.images-th
;; [:div.grid-item-th {:style {:background-image background}}
;; [:div.input-checkbox.check-primary
;; [:input {:type "checkbox"
;; :id (:id image)
;; :on-change toggle-selection
;; :checked selected?}]
;; [:label {:for (:id image)}]]]
;;
;; [:div.item-info
;; (if edition?
;; [:input.element-name {:type "text"
;; :auto-focus true
;; :on-key-down on-key-down
;; :on-blur on-blur
;; :on-click on-edit
;; :default-value (:name image)}]
;; [:h3 {:on-double-click on-edit} (:name image)])
;; [:span.date (tr "ds.uploaded-at" (dt/format (:created-at image) "dd/MM/yyyy"))]]]))
;;
;; ;; --- Grid
;;
;; ;; (defn- make-images-iref
;; ;; [collection-id]
;; ;; (letfn [(selector [state]
;; ;; (->> (vals (:images state))
;; ;; (filterv #(= (:collection-id %) collection-id))))]
;; ;; (-> (l/lens selector)
;; ;; (l/derive st/state))))
;;
;; (def images-iref
;; (-> (comp (l/key :images) (l/lens vals))
;; (l/derive st/state)))
;;
;; (mf/defc grid
;; [{:keys [id type collection opts] :as props}]
;; (let [editable? (= type :own)
;; ;; images-iref (mf/use-memo {:fn #(make-images-iref id)
;; ;; :deps (mf/deps id)})
;; images (->> (mf/deref images-iref)
;; (sort-by :created-at))]
;; [:div.dashboard-grid-content
;; [:div.dashboard-grid-row
;; (when editable?
;; [:& grid-form {:id id :type type :uploading? (:uploading opts)}])
;; (for [item images]
;; [:& grid-item {:image item
;; :key (:id item)
;; :selected? (contains? (:selected opts) (:id item))
;; :edition? (= (:edition opts) (:id item))}])]]))
;;
;; ;; --- Menu
;;
;; ;; (mf/defc menu
;; ;; [{:keys [opts coll] :as props}]
;; ;; (let [ordering (:order opts :name)
;; ;; filtering (:filter opts "")
;; ;; icount (count (:images coll))]
;; ;; (letfn [(on-term-change [event]
;; ;; (let [term (-> (dom/get-target event)
;; ;; (dom/get-value))]
;; ;; (st/emit! (di/update-opts :filter term))))
;; ;; (on-ordering-change [event]
;; ;; (let [value (dom/event->value event)
;; ;; value (read-string value)]
;; ;; (st/emit! (di/update-opts :order value))))
;; ;; (on-clear [event]
;; ;; (st/emit! (di/update-opts :filter "")))]
;; ;; [:section.dashboard-bar.library-gap
;; ;; [:div.dashboard-info
;;
;; ;; ;; Counter
;; ;; [:span.dashboard-images (tr "ds.num-images" (t/c icount))]
;;
;; ;; ;; Sorting
;; ;; [:div
;; ;; [:span (tr "ds.ordering")]
;; ;; [:select.input-select {:on-change on-ordering-change
;; ;; :value (pr-str ordering)}
;; ;; (for [[key value] (seq +ordering-options+)]
;; ;; [:option {:key key :value (pr-str key)} (tr value)])]]
;;
;; ;; ;; Search
;; ;; [:form.dashboard-search
;; ;; [:input.input-text {:key :images-search-box
;; ;; :type "text"
;; ;; :on-change on-term-change
;; ;; :auto-focus true
;; ;; :placeholder (tr "ds.search.placeholder")
;; ;; :value filtering}]
;; ;; [:div.clear-search {:on-click on-clear} i/close]]]])))
;;
;; (def opts-iref
;; (-> (l/key :dashboard-images)
;; (l/derive st/state)))
;;
;; (mf/defc content
;; [{:keys [id type collection] :as props}]
;; (let [{:keys [selected] :as opts} (mf/deref opts-iref)]
;; [:section.dashboard-grid.library
;; (when collection
;; [:& grid-header {:collection collection}])
;; (if collection
;; [:& grid {:id id :type type :collection collection :opts opts}]
;; [:span "EMPTY STATE TODO"])
;; (when-not (empty? selected)
;; [:& grid-options {:id id :type type :selected selected}])]))
;;
;; ;; --- Images Page
;;
;; (def collections-iref
;; (-> (l/key :images-collections)
;; (l/derive st/state)))
;;
;; (mf/defc images-page
;; [{:keys [id type] :as props}]
;; (let [collections (mf/deref collections-iref)
;; collections (cond->> (vals collections)
;; (= type :own) (filter #(= :own (:type %)))
;; (= type :builtin) (filter #(= :builtin (:type %)))
;; true (sort-by :created-at))
;;
;; collection (cond
;; (uuid? id) (d/seek #(= id (:id %)) collections)
;; :else (first collections))
;; id (:id collection)]
;;
;; (mf/use-effect #(st/emit! di/fetch-collections))
;; (mf/use-effect
;; {:fn #(when id (st/emit! (di/initialize id)))
;; :deps (mf/deps id)})
;;
;; [:section.dashboard-content
;; [:& nav {:type type :id id :collections collections}]
;; [:& content {:type type :id id :collection collection}]]))

View file

@ -11,15 +11,14 @@
(ns uxbox.main.ui.dashboard.profile (ns uxbox.main.ui.dashboard.profile
(:require (:require
[cuerdas.core :as str] [cuerdas.core :as str]
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.icons :as i]
[uxbox.main.data.auth :as da] [uxbox.main.data.auth :as da]
[uxbox.main.store :as st]
[uxbox.main.refs :as refs] [uxbox.main.refs :as refs]
[uxbox.main.store :as st]
[uxbox.main.ui.components.dropdown :refer [dropdown]]
[uxbox.main.ui.icons :as i]
[uxbox.main.ui.navigation :as nav] [uxbox.main.ui.navigation :as nav]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]
[uxbox.main.ui.components.dropdown :refer [dropdown]]
[uxbox.util.i18n :as i18n :refer [t]] [uxbox.util.i18n :as i18n :refer [t]]
[uxbox.util.router :as rt])) [uxbox.util.router :as rt]))

View file

@ -67,6 +67,10 @@
(def mail (icon-xref :mail)) (def mail (icon-xref :mail))
(def minus (icon-xref :minus)) (def minus (icon-xref :minus))
(def move (icon-xref :move)) (def move (icon-xref :move))
(def msg-error (icon-xref :msg-error))
(def msg-success (icon-xref :msg-success))
(def msg-warning (icon-xref :msg-warning))
(def msg-info (icon-xref :msg-info))
(def navigate (icon-xref :navigate)) (def navigate (icon-xref :navigate))
(def options (icon-xref :options)) (def options (icon-xref :options))
(def organize (icon-xref :organize)) (def organize (icon-xref :organize))

View file

@ -1,3 +1,12 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.main.ui.messages (ns uxbox.main.ui.messages
(:require (:require
[rumext.alpha :as mf] [rumext.alpha :as mf]
@ -10,41 +19,56 @@
[uxbox.util.i18n :as i18n :refer [t]] [uxbox.util.i18n :as i18n :refer [t]]
[uxbox.util.timers :as ts])) [uxbox.util.timers :as ts]))
;; --- Main Component (entry point) (defn- type->icon
[type]
(case type
:warning i/msg-warning
:error i/msg-error
:success i/msg-success
:info i/msg-info))
(declare notification) (mf/defc notification-item
[{:keys [type status on-close quick? content] :as props}]
(mf/defc messages (let [klass (dom/classnames
[] :fixed true
(let [message (mf/deref refs/message)]
(when message
[:& notification {:type (:type message)
:status (:status message)
:content (:content message)}])))
(mf/defc messages-widget
[]
(let [message (mf/deref refs/message)
message {:type :error
:content "Hello world!"}]
[:& notification {:type (:type message)
:status (:status message)
:content (:content message)}]))
;; --- Notification Component
(mf/defc notification
[{:keys [type status content] :as props}]
(let [on-close #(st/emit! dm/hide)
klass (classnames
:error (= type :error)
:info (= type :info)
:hide-message (= status :hide)
:success (= type :success) :success (= type :success)
:quick false)] :error (= type :error)
[:div.message {:class klass} :info (= type :info)
[:a.close-button {:on-click on-close} i/close] :warning (= type :warning)
[:div.message-content :hide (= status :hide)
[:span content]]])) :quick quick?)]
[:section.banner {:class klass}
[:div.content
[:div.icon (type->icon type)]
[:span content]]
[:div.btn-close {:on-click on-close} i/close]]))
(mf/defc notifications
[]
(let [message (mf/deref refs/message)
on-close #(st/emit! dm/hide)]
(when message
[:& notification-item {:type (:type message)
:quick? (boolean (:timeout message))
:status (:status message)
:content (:content message)
:on-close on-close}])))
(mf/defc inline-banner
{::mf/wrap [mf/memo]}
[{:keys [type on-close content children] :as props}]
[:div.inline-banner {:class (dom/classnames
:warning (= type :warning)
:error (= type :error)
:success (= type :success)
:info (= type :info)
:quick (not on-close))}
[:div.icon (type->icon type)]
[:div.content
[:div.main
[:span.text content]
[:div.btn-close {:on-click on-close} i/close]]
(when children
[:div.extra
children])]])

View file

@ -1,7 +1,6 @@
(ns uxbox.main.ui.modal (ns uxbox.main.ui.modal
(:require (:require
[goog.events :as events] [goog.events :as events]
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.store :as st] [uxbox.main.store :as st]
[uxbox.main.ui.keyboard :as k] [uxbox.main.ui.keyboard :as k]

View file

@ -17,7 +17,6 @@
[uxbox.main.store :as st] [uxbox.main.store :as st]
[uxbox.util.router :as rt] [uxbox.util.router :as rt]
[uxbox.main.ui.dashboard.profile :refer [profile-section]] [uxbox.main.ui.dashboard.profile :refer [profile-section]]
[uxbox.main.ui.messages :refer [messages]]
[uxbox.main.ui.settings.header :refer [header]] [uxbox.main.ui.settings.header :refer [header]]
[uxbox.main.ui.settings.password :refer [password-page]] [uxbox.main.ui.settings.password :refer [password-page]]
[uxbox.main.ui.settings.options :refer [options-page]] [uxbox.main.ui.settings.options :refer [options-page]]
@ -28,7 +27,6 @@
(let [section (get-in route [:data :name]) (let [section (get-in route [:data :name])
profile (mf/deref refs/profile)] profile (mf/deref refs/profile)]
[:main.settings-main [:main.settings-main
[:& messages]
[:div.settings-content [:div.settings-content
[:& header {:section section :profile profile}] [:& header {:section section :profile profile}]
(case section (case section

View file

@ -11,18 +11,18 @@
(:require (:require
[cljs.spec.alpha :as s] [cljs.spec.alpha :as s]
[cuerdas.core :as str] [cuerdas.core :as str]
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.icons :as i]
[uxbox.main.data.auth :as da] [uxbox.main.data.auth :as da]
[uxbox.main.data.users :as du]
[uxbox.main.ui.components.forms :refer [input submit-button form]]
[uxbox.main.data.messages :as dm] [uxbox.main.data.messages :as dm]
[uxbox.main.store :as st] [uxbox.main.data.users :as du]
[uxbox.main.refs :as refs] [uxbox.main.refs :as refs]
[uxbox.main.store :as st]
[uxbox.main.ui.components.forms :refer [input submit-button form]]
[uxbox.main.ui.icons :as i]
[uxbox.main.ui.messages :as msgs]
[uxbox.main.ui.modal :as modal]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]
[uxbox.util.forms :as fm] [uxbox.util.forms :as fm]
[uxbox.main.ui.modal :as modal]
[uxbox.util.i18n :as i18n :refer [tr t]])) [uxbox.util.i18n :as i18n :refer [tr t]]))
(s/def ::email-1 ::fm/email) (s/def ::email-1 ::fm/email)
@ -36,9 +36,7 @@
(= (:code error) :uxbox.services.mutations.profile/email-already-exists) (= (:code error) :uxbox.services.mutations.profile/email-already-exists)
(swap! form (fn [data] (swap! form (fn [data]
(let [error {:message (tr "errors.email-already-exists")}] (let [error {:message (tr "errors.email-already-exists")}]
(-> data (assoc-in data [:errors :email-1] error))))
(assoc-in [:errors :email-1] error)
(assoc-in [:errors :email-2] error)))))
:else :else
(let [msg (tr "errors.unexpected-error")] (let [msg (tr "errors.unexpected-error")]
@ -55,11 +53,9 @@
[:section.modal-content.generic-form [:section.modal-content.generic-form
[:h2 (t locale "settings.change-email-title")] [:h2 (t locale "settings.change-email-title")]
[:span.featured-note [:& msgs/inline-banner
[:span.text {:type :info
[:span "Well send you an email to your current email "] :content (t locale "settings.change-email-info" (:email profile))}]
[:strong (:email profile)]
[:span " to verify your identity."]]]
[:& form {:on-submit on-submit [:& form {:on-submit on-submit
:spec ::email-change-form :spec ::email-change-form
@ -80,12 +76,10 @@
[:section.modal-content.generic-form.confirmation [:section.modal-content.generic-form.confirmation
[:h2 (t locale "settings.verification-sent-title")] [:h2 (t locale "settings.verification-sent-title")]
[:span.featured-note
[:span.icon i/trash] [:& msgs/inline-banner
[:span.text {:type :info
[:span (str/format "We have sent you an email to “")] :content (t locale "settings.change-email-info2" (:email profile))}]
[:strong (:email profile)]
[:span "” Please follow the instructions to verify the email."]]]
[:button.btn-primary.btn-large [:button.btn-primary.btn-large
{:on-click #(modal/hide!)} {:on-click #(modal/hide!)}

View file

@ -9,7 +9,6 @@
(ns uxbox.main.ui.settings.header (ns uxbox.main.ui.settings.header
(:require (:require
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.icons :as i] [uxbox.main.ui.icons :as i]
[uxbox.main.data.auth :as da] [uxbox.main.data.auth :as da]

View file

@ -11,17 +11,17 @@
(:require (:require
[cljs.spec.alpha :as s] [cljs.spec.alpha :as s]
[cuerdas.core :as str] [cuerdas.core :as str]
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.icons :as i] [uxbox.main.data.messages :as dm]
[uxbox.main.data.users :as udu] [uxbox.main.data.users :as udu]
[uxbox.main.refs :as refs]
[uxbox.main.store :as st]
[uxbox.main.ui.components.forms :refer [input submit-button form]] [uxbox.main.ui.components.forms :refer [input submit-button form]]
[uxbox.main.ui.icons :as i]
[uxbox.main.ui.messages :as msgs]
[uxbox.main.ui.modal :as modal]
[uxbox.main.ui.settings.change-email :refer [change-email-modal]] [uxbox.main.ui.settings.change-email :refer [change-email-modal]]
[uxbox.main.ui.settings.delete-account :refer [delete-account-modal]] [uxbox.main.ui.settings.delete-account :refer [delete-account-modal]]
[uxbox.main.ui.modal :as modal]
[uxbox.main.data.messages :as dm]
[uxbox.main.store :as st]
[uxbox.main.refs :as refs]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]
[uxbox.util.forms :as fm] [uxbox.util.forms :as fm]
[uxbox.util.i18n :as i18n :refer [tr t]])) [uxbox.util.i18n :as i18n :refer [tr t]]))
@ -73,20 +73,17 @@
(t locale "settings.change-email-label")]] (t locale "settings.change-email-label")]]
(not= (:pending-email prof) (:email prof)) (not= (:pending-email prof) (:email prof))
[:span.featured-note [:& msgs/inline-banner
[:span.icon i/trash] {:type :info
[:span.text :content (t locale "settings.change-email-info3" (:pending-email prof))}
[:span "There is a pending change of your email to "] [:div.btn-secondary.btn-small
[:strong (:pending-email prof)] {:on-click #(st/emit! udu/cancel-email-change)}
[:span "."] [:br] (t locale "settings.cancel-email-change")]]
[:a {:on-click #(st/emit! udu/cancel-email-change)}
"Dismiss"]]]
:else :else
[:span.featured-note.warning [:& msgs/inline-banner
[:span.text {:type :info
[:span "There is a pending email validation."]]]) :content (t locale "settings.email-verification-pending")}])
[:& submit-button [:& submit-button
{:label (t locale "settings.profile-submit-label")}] {:label (t locale "settings.profile-submit-label")}]

View file

@ -22,7 +22,6 @@
[uxbox.main.ui.components.dropdown :refer [dropdown]] [uxbox.main.ui.components.dropdown :refer [dropdown]]
[uxbox.main.ui.hooks :as hooks] [uxbox.main.ui.hooks :as hooks]
[uxbox.main.ui.keyboard :as kbd] [uxbox.main.ui.keyboard :as kbd]
[uxbox.main.ui.messages :refer [messages]]
[uxbox.main.ui.viewer.header :refer [header]] [uxbox.main.ui.viewer.header :refer [header]]
[uxbox.main.ui.viewer.thumbnails :refer [thumbnails-panel]] [uxbox.main.ui.viewer.thumbnails :refer [thumbnails-panel]]
[uxbox.main.ui.viewer.shapes :refer [frame-svg]] [uxbox.main.ui.viewer.shapes :refer [frame-svg]]
@ -87,23 +86,21 @@
(mf/use-effect on-mount) (mf/use-effect on-mount)
(hooks/use-shortcuts dv/shortcuts) (hooks/use-shortcuts dv/shortcuts)
[:* [:div.viewer-layout {:class (classnames :fullscreen fullscreen?)
[:& messages] :ref container}
[:div.viewer-layout {:class (classnames :fullscreen fullscreen?)
:ref container}
[:& header {:data data [:& header {:data data
:toggle-fullscreen toggle-fullscreen :toggle-fullscreen toggle-fullscreen
:fullscreen? fullscreen? :fullscreen? fullscreen?
:local local :local local
:index index}] :index index}]
[:div.viewer-content {:on-click on-click} [:div.viewer-content {:on-click on-click}
(when (:show-thumbnails local) (when (:show-thumbnails local)
[:& thumbnails-panel {:index index [:& thumbnails-panel {:index index
:data data}]) :data data}])
[:& main-panel {:data data [:& main-panel {:data data
:local local :local local
:index index}]]]])) :index index}]]]))
;; --- Component: Viewer Page ;; --- Component: Viewer Page

View file

@ -11,7 +11,6 @@
(:require (:require
[goog.events :as events] [goog.events :as events]
[goog.object :as gobj] [goog.object :as gobj]
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.icons :as i] [uxbox.main.ui.icons :as i]
[uxbox.common.data :as d] [uxbox.common.data :as d]

View file

@ -10,7 +10,6 @@
(ns uxbox.main.ui.workspace (ns uxbox.main.ui.workspace
(:require (:require
[beicon.core :as rx] [beicon.core :as rx]
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.main.ui.icons :as i] [uxbox.main.ui.icons :as i]
[uxbox.main.constants :as c] [uxbox.main.constants :as c]
@ -22,7 +21,6 @@
[uxbox.main.ui.confirm] [uxbox.main.ui.confirm]
[uxbox.main.ui.keyboard :as kbd] [uxbox.main.ui.keyboard :as kbd]
[uxbox.main.ui.hooks :as hooks] [uxbox.main.ui.hooks :as hooks]
[uxbox.main.ui.messages :refer [messages]]
[uxbox.main.ui.workspace.viewport :refer [viewport coordinates]] [uxbox.main.ui.workspace.viewport :refer [viewport coordinates]]
[uxbox.main.ui.workspace.colorpalette :refer [colorpalette]] [uxbox.main.ui.workspace.colorpalette :refer [colorpalette]]
[uxbox.main.ui.workspace.context-menu :refer [context-menu]] [uxbox.main.ui.workspace.context-menu :refer [context-menu]]
@ -117,12 +115,11 @@
(let [file (mf/deref refs/workspace-file) (let [file (mf/deref refs/workspace-file)
project (mf/deref refs/workspace-project) project (mf/deref refs/workspace-project)
layout (mf/deref refs/workspace-layout)] layout (mf/deref refs/workspace-layout)]
[:* [:section
[:& header {:file file [:& header {:file file
:project project :project project
:layout layout}] :layout layout}]
[:& messages]
[:& context-menu] [:& context-menu]
(if (and (and file project) (if (and (and file project)

View file

@ -1,141 +0,0 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
;; Copyright (c) 2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>
(ns uxbox.main.ui.workspace.download
#_(:require [cuerdas.core :as str]
[beicon.core :as rx]
[potok.core :as ptk]
[lentes.core :as l]
[uxbox.main.ui.icons :as i]
[uxbox.main.store :as st]
[uxbox.main.refs :as refs]
[uxbox.main.data.lightbox :as udl]
;; [uxbox.main.exports :as exports]
[uxbox.util.blob :as blob]
[uxbox.util.data :refer (read-string)]
[uxbox.util.time :as dt]
[uxbox.util.dom :as dom]
[uxbox.util.zip :as zip]))
;; --- Refs
;; (defn- resolve-pages
;; [state]
;; (let [project (get-in state [:workspace :project])]
;; (->> (vals (:pages state))
;; (filter #(= project (:project %)))
;; (sort-by :created-at))))
;; (def pages-ref
;; (-> (l/lens resolve-pages)
;; (l/derive st/state)))
;; (def current-page-ref
;; (-> (l/in [:workspace :page])
;; (l/derive st/state)))
;; ;; --- Download Lightbox (Component)
;; (defn- download-page-svg
;; [{:keys [name id] :as page}]
;; (let [content (or #_(exports/render-page id) "")
;; blob (blob/create content "image/svg+xml")
;; uri (blob/create-uri blob)
;; link (.createElement js/document "a")
;; event (js/MouseEvent. "click")
;; now (dt/now)]
;; (.setAttribute link "href" uri)
;; (.setAttribute link "download" (str (str/uslug name) "_"
;; (dt/format now :unix)
;; ".svg"))
;; (.appendChild (.-body js/document) link)
;; (.dispatchEvent link event)
;; (blob/revoke-uri uri)
;; (.removeChild (.-body js/document) link)))
;; (defn- generate-files
;; [pages]
;; (reduce (fn [acc {:keys [id name]}]
;; (let [content (or #_(exports/render-page id) "")]
;; (conj acc [(str (str/uslug name) ".svg")
;; (blob/create content "image/svg+xml")])))
;; []
;; pages))
;; (defn- download-project-zip
;; [{:keys [name] :as project} pages]
;; (let [event (js/MouseEvent. "click")
;; link (.createElement js/document "a")
;; now (dt/now)
;; stream (->> (rx/from (generate-files pages))
;; (rx/reduce conj [])
;; (rx/mapcat zip/build)
;; (rx/map blob/create-uri)
;; (rx/take 1))
;; download (str (str/uslug name) "_" (dt/format now :unix) ".zip")]
;; (rx/subscribe stream (fn [uri]
;; (.setAttribute link "download" download)
;; (.setAttribute link "href" uri)
;; (.appendChild (.-body js/document) link)
;; (.dispatchEvent link event)
;; (blob/revoke-uri uri)
;; (.removeChild (.-body js/document) link)))))
;; (mx/defcs download-dialog
;; {:mixins [mx/static mx/reactive]}
;; [own]
;; #_(let [project (mx/react refs/selected-project)
;; pages (mx/react pages-ref)
;; current (mx/react current-page-ref)]
;; (letfn [(on-close [event]
;; (dom/prevent-default event)
;; (udl/close!))
;; (download-page [event]
;; (dom/prevent-default event)
;; (let [id (-> (mx/ref-node own "page")
;; (dom/get-value)
;; (read-string))
;; page (->> pages
;; (filter #(= id (:id %)))
;; (first))]
;; (download-page-svg page)
;; (udl/close!)))
;; (download-zip [event]
;; (dom/prevent-default event)
;; (download-project-zip project pages)
;; (udl/close!))
;; (download-html [event]
;; (dom/prevent-default event))]
;; [:div.lightbox-body.export-dialog {}
;; [:h3 {} "Download options"]
;; [:div.row-flex {}
;; [:div.content-col {}
;; [:span.icon {} i/file-svg]
;; [:span.title {} "Download page"]
;; [:p.info {} "Download a single page of your project in SVG."]
;; [:select.input-select {:ref "page" :default-value (pr-str current)}
;; (for [{:keys [id name]} pages]
;; [:option {:value (pr-str id) :key (pr-str id)} name])]
;; [:a.btn-primary {:href "#" :on-click download-page} "Download page"]]
;; [:div.content-col {}
;; [:span.icon {} i/folder-zip]
;; [:span.title {} "Download project"]
;; [:p.info {} "Download all pages as svg in a zip file."]
;; [:a.btn-primary {:href "#" :on-click download-zip} "Download project"]]
;; ; [:div.content-col
;; ; [:span.icon i/file-html]
;; ; [:span.title "Download as HTML"]
;; ; [:p.info "Download your project as HTML files."]
;; ; [:a.btn-primary {:href "#" :on-click download-html} "Download HTML"]]
;; ]
;; [:a.close {:href "#" :on-click on-close} i/close]])))
;; (defmethod lbx/render-lightbox :download
;; [_]
;; (download-dialog))

View file

@ -2,8 +2,10 @@
;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;; ;;
;; Copyright (c) 2015-2017 Juan de la Cruz <delacruzgarciajuan@gmail.com> ;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; Copyright (c) 2015-2019 Andrey Antukh <niwi@niwi.nz> ;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.main.ui.workspace.images (ns uxbox.main.ui.workspace.images
(:require (:require

View file

@ -2,14 +2,15 @@
;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;; ;;
;; Copyright (c) 2015-2020 Juan de la Cruz <delacruzgarciajuan@gmail.com> ;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; Copyright (c) 2015-2020 Andrey Antukh <niwi@niwi.nz> ;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.main.ui.workspace.selection (ns uxbox.main.ui.workspace.selection
"Selection handlers component." "Selection handlers component."
(:require (:require
[beicon.core :as rx] [beicon.core :as rx]
[lentes.core :as l]
[cuerdas.core :as str] [cuerdas.core :as str]
[potok.core :as ptk] [potok.core :as ptk]
[rumext.alpha :as mf] [rumext.alpha :as mf]

View file

@ -2,14 +2,16 @@
;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;; ;;
;; Copyright (c) 2016-2019 Andrey Antukh <niwi@niwi.nz> ;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.main.ui.workspace.shapes.text (ns uxbox.main.ui.workspace.shapes.text
(:require (:require
[cuerdas.core :as str] [cuerdas.core :as str]
[goog.events :as events] [goog.events :as events]
[goog.object :as gobj] [goog.object :as gobj]
[lentes.core :as l]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.common.data :as d] [uxbox.common.data :as d]
[uxbox.main.data.workspace :as dw] [uxbox.main.data.workspace :as dw]

View file

@ -5,15 +5,13 @@
;; This Source Code Form is "Incompatible With Secondary Licenses", as ;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0. ;; defined by the Mozilla Public License, v. 2.0.
;; ;;
;; Copyright (c) 2015-2017 Andrey Antukh <niwi@niwi.nz> ;; Copyright (c) 2020 UXBOX Labs SL
;; Copyright (c) 2015-2017 Juan de la Cruz <delacruzgarciajuan@gmail.com>
(ns uxbox.main.ui.workspace.sidebar (ns uxbox.main.ui.workspace.sidebar
(:require (:require
[rumext.alpha :as mf] [rumext.alpha :as mf]
[cuerdas.core :as str] [cuerdas.core :as str]
[uxbox.main.ui.workspace.sidebar.history :refer [history-toolbox]] [uxbox.main.ui.workspace.sidebar.history :refer [history-toolbox]]
[uxbox.main.ui.workspace.sidebar.icons :refer [icons-toolbox]]
[uxbox.main.ui.workspace.sidebar.layers :refer [layers-toolbox]] [uxbox.main.ui.workspace.sidebar.layers :refer [layers-toolbox]]
[uxbox.main.ui.workspace.sidebar.options :refer [options-toolbox]] [uxbox.main.ui.workspace.sidebar.options :refer [options-toolbox]]
[uxbox.main.ui.workspace.sidebar.sitemap :refer [sitemap-toolbox]] [uxbox.main.ui.workspace.sidebar.sitemap :refer [sitemap-toolbox]]
@ -45,6 +43,4 @@
[:aside#settings-bar.settings-bar [:aside#settings-bar.settings-bar
[:div.settings-bar-inside [:div.settings-bar-inside
(when (contains? layout :element-options) (when (contains? layout :element-options)
[:& options-toolbox {:page page}]) [:& options-toolbox {:page page}])]])
(when (contains? layout :icons)
[:& icons-toolbox])]])

View file

@ -2,20 +2,21 @@
;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;; ;;
;; Copyright (c) 2015-2016 Andrey Antukh <niwi@niwi.nz> ;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com> ;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.main.ui.workspace.sidebar.icons (ns uxbox.main.ui.workspace.sidebar.icons
(:require (:require
[lentes.core :as l] #_[uxbox.main.ui.dashboard.icons :as icons]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.common.data :as d] [uxbox.common.data :as d]
[uxbox.main.ui.icons :as i]
[uxbox.main.data.icons :as di] [uxbox.main.data.icons :as di]
[uxbox.main.data.workspace :as dw] [uxbox.main.data.workspace :as dw]
[uxbox.main.refs :as refs] [uxbox.main.refs :as refs]
[uxbox.main.store :as st] [uxbox.main.store :as st]
#_[uxbox.main.ui.dashboard.icons :as icons] [uxbox.main.ui.icons :as i]
[uxbox.main.ui.shapes.icon :as icon] [uxbox.main.ui.shapes.icon :as icon]
[uxbox.util.data :refer [read-string]] [uxbox.util.data :refer [read-string]]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]

View file

@ -2,7 +2,10 @@
;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;; ;;
;; Copyright (c) 2015-2017 Andrey Antukh <niwi@niwi.nz> ;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.util.forms (ns uxbox.util.forms
(:refer-clojure :exclude [uuid]) (:refer-clojure :exclude [uuid])
@ -10,7 +13,6 @@
[beicon.core :as rx] [beicon.core :as rx]
[cljs.spec.alpha :as s] [cljs.spec.alpha :as s]
[cuerdas.core :as str] [cuerdas.core :as str]
[lentes.core :as l]
[potok.core :as ptk] [potok.core :as ptk]
[rumext.alpha :as mf] [rumext.alpha :as mf]
[uxbox.common.spec :as us] [uxbox.common.spec :as us]

View file

@ -1,16 +0,0 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2015-2016 Andrey Antukh <niwi@niwi.nz>
;; Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>
(ns uxbox.util.lens
(:refer-clojure :exclude [merge])
(:require [lentes.core :as l]))
(defn merge
[data]
(l/lens
(fn [s] (cljs.core/merge s data))
#(throw (ex-info "Not implemented" {}))))