mirror of
https://github.com/penpot/penpot.git
synced 2026-01-21 04:40:48 -05:00
Compare commits
20 Commits
niwinz-dev
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4397ede5c1 | ||
|
|
ff25df0457 | ||
|
|
8c7fd0af4b | ||
|
|
cf46051f56 | ||
|
|
6393330ee1 | ||
|
|
8252bc485e | ||
|
|
47775a9e2c | ||
|
|
8191d04114 | ||
|
|
b7c2d9a079 | ||
|
|
aeb34a6f64 | ||
|
|
6fa0c3af0c | ||
|
|
260b9fb040 | ||
|
|
884954f4ff | ||
|
|
88f0f75174 | ||
|
|
1ffa956251 | ||
|
|
31054099ff | ||
|
|
983487d73c | ||
|
|
5c71c57dd9 | ||
|
|
5abc1aafb4 | ||
|
|
935728aa39 |
40
.travis.yml
40
.travis.yml
@@ -1,40 +0,0 @@
|
|||||||
dist: xenial
|
|
||||||
|
|
||||||
language: generic
|
|
||||||
sudo: required
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $HOME/.m2
|
|
||||||
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
|
|
||||||
install:
|
|
||||||
- curl -O https://download.clojure.org/install/linux-install-1.10.1.447.sh
|
|
||||||
- chmod +x linux-install-1.10.1.447.sh
|
|
||||||
- sudo ./linux-install-1.10.1.447.sh
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- env | sort
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./manage.sh build-devenv
|
|
||||||
- ./manage.sh run-frontend-tests
|
|
||||||
- ./manage.sh run-backend-tests
|
|
||||||
- ./manage.sh build-images
|
|
||||||
- ./manage.sh run
|
|
||||||
|
|
||||||
after_script:
|
|
||||||
- docker images
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
||||||
|
|
||||||
env:
|
|
||||||
- NODE_VERSION=10.16.0
|
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
- Fix wrong image in the onboarding invitation block [Taiga #13040](https://tree.taiga.io/project/penpot/issue/13040)
|
- Fix wrong image in the onboarding invitation block [Taiga #13040](https://tree.taiga.io/project/penpot/issue/13040)
|
||||||
- Fix wrong register image [Taiga #12955](https://tree.taiga.io/project/penpot/task/12955)
|
- Fix wrong register image [Taiga #12955](https://tree.taiga.io/project/penpot/task/12955)
|
||||||
- Fix error message on components doesn't close automatically [Taiga #12012](https://tree.taiga.io/project/penpot/issue/12012)
|
- Fix error message on components doesn't close automatically [Taiga #12012](https://tree.taiga.io/project/penpot/issue/12012)
|
||||||
- Fix incorrect handling of input values on layout gap and padding inputs [Github #8113](https://github.com/penpot/penpot/issues/8113)
|
|
||||||
- Fix incorrect default option on tokens import dialog [Github #8051](https://github.com/penpot/penpot/pull/8051)
|
- Fix incorrect default option on tokens import dialog [Github #8051](https://github.com/penpot/penpot/pull/8051)
|
||||||
- Fix unhandled exception tokens creation dialog [Github #8110](https://github.com/penpot/penpot/issues/8110)
|
- Fix unhandled exception tokens creation dialog [Github #8110](https://github.com/penpot/penpot/issues/8110)
|
||||||
|
|
||||||
|
|||||||
@@ -152,9 +152,9 @@ services:
|
|||||||
|
|
||||||
# AWS_ACCESS_KEY_ID: <KEY_ID>
|
# AWS_ACCESS_KEY_ID: <KEY_ID>
|
||||||
# AWS_SECRET_ACCESS_KEY: <ACCESS_KEY>
|
# AWS_SECRET_ACCESS_KEY: <ACCESS_KEY>
|
||||||
# PENPOT_ASSETS_STORAGE_BACKEND: assets-s3
|
# PENPOT_OBJECTS_STORAGE_BACKEND: s3
|
||||||
# PENPOT_STORAGE_ASSETS_S3_ENDPOINT: <ENDPOINT>
|
# PENPOT_OBJECTS_STORAGE_S3_ENDPOINT: <ENDPOINT>
|
||||||
# PENPOT_STORAGE_ASSETS_S3_BUCKET: <BUKET_NAME>
|
# PENPOT_OBJECTS_STORAGE_S3_BUCKET: <BUKET_NAME>
|
||||||
|
|
||||||
## Telemetry. When enabled, a periodical process will send anonymous data about this
|
## Telemetry. When enabled, a periodical process will send anonymous data about this
|
||||||
## instance. Telemetry data will enable us to learn how the application is used,
|
## instance. Telemetry data will enable us to learn how the application is used,
|
||||||
|
|||||||
@@ -114,14 +114,7 @@ configuration.
|
|||||||
The callback has the following format:
|
The callback has the following format:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
https://<your_domain>/api/auth/oauth/<oauth_provider>/callback
|
https://<your_domain>/api/auth/oidc/callback
|
||||||
```
|
|
||||||
|
|
||||||
You will need to change <your_domain> and <oauth_provider> according to your setup.
|
|
||||||
This is how it looks with Gitlab provider:
|
|
||||||
|
|
||||||
```html
|
|
||||||
https://<your_domain>/api/auth/oauth/gitlab/callback
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Google
|
#### Google
|
||||||
|
|||||||
@@ -17,17 +17,18 @@
|
|||||||
<meta name="twitter:site" content="@penpotapp">
|
<meta name="twitter:site" content="@penpotapp">
|
||||||
<meta name="twitter:creator" content="@penpotapp">
|
<meta name="twitter:creator" content="@penpotapp">
|
||||||
<meta name="theme-color" content="#FFFFFF" media="(prefers-color-scheme: light)">
|
<meta name="theme-color" content="#FFFFFF" media="(prefers-color-scheme: light)">
|
||||||
<link id="theme" href="css/main.css?version={{& version}}" rel="stylesheet" type="text/css" />
|
<link id="theme" href="css/main.css?version={{& version_tag}}" rel="stylesheet" type="text/css" />
|
||||||
{{#isDebug}}
|
{{#isDebug}}
|
||||||
<link href="css/debug.css?version={{& version}}" rel="stylesheet" type="text/css" />
|
<link href="css/debug.css?version={{& version_tag}}" rel="stylesheet" type="text/css" />
|
||||||
{{/isDebug}}
|
{{/isDebug}}
|
||||||
|
|
||||||
<link rel="icon" href="images/favicon.png" />
|
<link rel="icon" href="images/favicon.png?version={{& version_tag }}" />
|
||||||
|
|
||||||
<script type="importmap">{{& manifest.importmap }}</script>
|
<script type="importmap">{{& manifest.importmap }}</script>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
globalThis.penpotVersion = "{{& version}}";
|
globalThis.penpotVersion = "{{& version}}";
|
||||||
|
globalThis.penpotVersionTag = "{{& version_tag}}";
|
||||||
globalThis.penpotBuildDate = "{{& build_date}}";
|
globalThis.penpotBuildDate = "{{& build_date}}";
|
||||||
globalThis.penpotWorkerURI = "{{& manifest.worker_main}}";
|
globalThis.penpotWorkerURI = "{{& manifest.worker_main}}";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,10 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Penpot - Rasterizer</title>
|
<title>Penpot - Rasterizer</title>
|
||||||
<link rel="icon" href="images/favicon.png" />
|
<link rel="icon" href="images/favicon.png?version={{& version_tag }}" />
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
globalThis.penpotVersion = "{{& version}}";
|
globalThis.penpotVersion = "{{& version}}";
|
||||||
|
globalThis.penpotVersionTag = "{{& version_tag}}";
|
||||||
globalThis.penpotBuildDate = "{{& build_date}}";
|
globalThis.penpotBuildDate = "{{& build_date}}";
|
||||||
globalThis.penpotWorkerURI = "{{& manifest.worker_main}}";
|
globalThis.penpotWorkerURI = "{{& manifest.worker_main}}";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||||
<title>Penpot - Render</title>
|
<title>Penpot - Render</title>
|
||||||
<link rel="icon" href="images/favicon.png" />
|
|
||||||
|
<link rel="icon" href="images/favicon.png?version={{& version_tag }}" />
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
globalThis.penpotVersion = "{{& version}}";
|
globalThis.penpotVersion = "{{& version}}";
|
||||||
|
globalThis.penpotVersionTag = "{{& version_tag}}";
|
||||||
globalThis.penpotBuildDate = "{{& build_date}}";
|
globalThis.penpotBuildDate = "{{& build_date}}";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,11 @@ export function startWorker() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isDebug = process.env.NODE_ENV !== "production";
|
export const IS_DEBUG = process.env.NODE_ENV !== "production";
|
||||||
export const CURRENT_VERSION = process.env.CURRENT_VERSION || "develop";
|
export const BUILD_DATE = process.env.BUILD_DATE || (new Date().toString()) ;
|
||||||
export const BUILD_DATE = process.env.BUILD_DATE || "" + new Date();
|
export const BUILD_TS = process.env.BUILD_TS || Date.now();
|
||||||
|
export const VERSION = process.env.VERSION || "develop";
|
||||||
|
export const VERSION_TAG = process.env.VERSION_TAG || VERSION;
|
||||||
|
|
||||||
async function findFiles(basePath, predicate, options = {}) {
|
async function findFiles(basePath, predicate, options = {}) {
|
||||||
predicate =
|
predicate =
|
||||||
@@ -193,25 +195,25 @@ async function generateManifest() {
|
|||||||
render_main: "./js/render.js",
|
render_main: "./js/render.js",
|
||||||
rasterizer_main: "./js/rasterizer.js",
|
rasterizer_main: "./js/rasterizer.js",
|
||||||
|
|
||||||
config: "./js/config.js?version=" + CURRENT_VERSION,
|
config: "./js/config.js?version=" + VERSION_TAG,
|
||||||
polyfills: "./js/polyfills.js?version=" + CURRENT_VERSION,
|
polyfills: "./js/polyfills.js?version=" + VERSION_TAG,
|
||||||
libs: "./js/libs.js?version=" + CURRENT_VERSION,
|
libs: "./js/libs.js?version=" + VERSION_TAG,
|
||||||
worker_main: "./js/worker/main.js?version=" + CURRENT_VERSION,
|
worker_main: "./js/worker/main.js?version=" + VERSION_TAG,
|
||||||
default_translations: "./js/translation.en.js?version=" + CURRENT_VERSION,
|
default_translations: "./js/translation.en.js?version=" + VERSION_TAG,
|
||||||
|
|
||||||
importmap: JSON.stringify({
|
importmap: JSON.stringify({
|
||||||
"imports": {
|
"imports": {
|
||||||
"./js/shared.js": "./js/shared.js?version=" + CURRENT_VERSION,
|
"./js/shared.js": "./js/shared.js?version=" + VERSION_TAG,
|
||||||
"./js/main.js": "./js/main.js?version=" + CURRENT_VERSION,
|
"./js/main.js": "./js/main.js?version=" + VERSION_TAG,
|
||||||
"./js/render.js": "./js/render.js?version=" + CURRENT_VERSION,
|
"./js/render.js": "./js/render.js?version=" + VERSION_TAG,
|
||||||
"./js/render-wasm.js": "./js/render-wasm.js?version=" + CURRENT_VERSION,
|
"./js/render-wasm.js": "./js/render-wasm.js?version=" + VERSION_TAG,
|
||||||
"./js/rasterizer.js": "./js/rasterizer.js?version=" + CURRENT_VERSION,
|
"./js/rasterizer.js": "./js/rasterizer.js?version=" + VERSION_TAG,
|
||||||
"./js/main-dashboard.js": "./js/main-dashboard.js?version=" + CURRENT_VERSION,
|
"./js/main-dashboard.js": "./js/main-dashboard.js?version=" + VERSION_TAG,
|
||||||
"./js/main-auth.js": "./js/main-auth.js?version=" + CURRENT_VERSION,
|
"./js/main-auth.js": "./js/main-auth.js?version=" + VERSION_TAG,
|
||||||
"./js/main-viewer.js": "./js/main-viewer.js?version=" + CURRENT_VERSION,
|
"./js/main-viewer.js": "./js/main-viewer.js?version=" + VERSION_TAG,
|
||||||
"./js/main-settings.js": "./js/main-settings.js?version=" + CURRENT_VERSION,
|
"./js/main-settings.js": "./js/main-settings.js?version=" + VERSION_TAG,
|
||||||
"./js/main-workspace.js": "./js/main-workspace.js?version=" + CURRENT_VERSION,
|
"./js/main-workspace.js": "./js/main-workspace.js?version=" + VERSION_TAG,
|
||||||
"./js/util-highlight.js": "./js/util-highlight.js?version=" + CURRENT_VERSION
|
"./js/util-highlight.js": "./js/util-highlight.js?version=" + VERSION_TAG
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
@@ -222,11 +224,12 @@ async function generateManifest() {
|
|||||||
async function renderTemplate(path, context = {}, partials = {}) {
|
async function renderTemplate(path, context = {}, partials = {}) {
|
||||||
const content = await fs.readFile(path, { encoding: "utf-8" });
|
const content = await fs.readFile(path, { encoding: "utf-8" });
|
||||||
|
|
||||||
const ts = Math.floor(new Date());
|
|
||||||
|
|
||||||
context = Object.assign({}, context, {
|
context = Object.assign({}, context, {
|
||||||
ts: ts,
|
isDebug: IS_DEBUG,
|
||||||
isDebug,
|
version: VERSION,
|
||||||
|
version_tag: VERSION_TAG,
|
||||||
|
build_date: BUILD_DATE,
|
||||||
|
build_ts: BUILD_TS,
|
||||||
});
|
});
|
||||||
|
|
||||||
return mustache.render(content, context, partials);
|
return mustache.render(content, context, partials);
|
||||||
@@ -390,7 +393,6 @@ async function generateSvgSprites() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function generateTemplates() {
|
async function generateTemplates() {
|
||||||
const isDebug = process.env.NODE_ENV !== "production";
|
|
||||||
await fs.mkdir("./resources/public/", { recursive: true });
|
await fs.mkdir("./resources/public/", { recursive: true });
|
||||||
|
|
||||||
const manifest = await generateManifest();
|
const manifest = await generateManifest();
|
||||||
@@ -415,10 +417,7 @@ async function generateTemplates() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const context = {
|
const context = {
|
||||||
manifest: manifest,
|
manifest: manifest
|
||||||
version: CURRENT_VERSION,
|
|
||||||
build_date: BUILD_DATE,
|
|
||||||
isDebug,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
content = await renderTemplate(
|
content = await renderTemplate(
|
||||||
@@ -487,7 +486,7 @@ export async function compileStyles() {
|
|||||||
await fs.mkdir("./resources/public/css", { recursive: true });
|
await fs.mkdir("./resources/public/css", { recursive: true });
|
||||||
await fs.writeFile("./resources/public/css/main.css", result);
|
await fs.writeFile("./resources/public/css/main.css", result);
|
||||||
|
|
||||||
if (isDebug) {
|
if (IS_DEBUG) {
|
||||||
let debugCSS = await compileSassDebug(worker);
|
let debugCSS = await compileSassDebug(worker);
|
||||||
await fs.writeFile("./resources/public/css/debug.css", debugCSS);
|
await fs.writeFile("./resources/public/css/debug.css", debugCSS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,26 +2,26 @@
|
|||||||
# NOTE: this script should be called from the parent directory to
|
# NOTE: this script should be called from the parent directory to
|
||||||
# properly work.
|
# properly work.
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
export INCLUDE_STORYBOOK=${BUILD_STORYBOOK:-no};
|
export INCLUDE_STORYBOOK=${BUILD_STORYBOOK:-no};
|
||||||
export INCLUDE_WASM=${BUILD_WASM:-yes};
|
export INCLUDE_WASM=${BUILD_WASM:-yes};
|
||||||
export CURRENT_VERSION=$1;
|
|
||||||
export BUILD_DATE=$(date -R);
|
|
||||||
export CURRENT_HASH=${CURRENT_HASH:-$(git rev-parse --short HEAD)};
|
|
||||||
export EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS;
|
export EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS;
|
||||||
export TS=$(date +%s);
|
|
||||||
|
export BUILD_DATE=$(date -R);
|
||||||
|
export BUILD_TS=$(date +%s);
|
||||||
|
|
||||||
|
export VERSION=${1:-develop};
|
||||||
|
export VERSION_TAG="${VERSION}-${BUILD_TS}";
|
||||||
|
|
||||||
# Some cljs reacts on this environment variable for define more
|
# Some cljs reacts on this environment variable for define more
|
||||||
# performant code on macros (example: rumext)
|
# performant code on macros (example: rumext)
|
||||||
export NODE_ENV=production;
|
export NODE_ENV=production;
|
||||||
|
|
||||||
echo "Current path:"
|
|
||||||
echo $PATH
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
corepack enable;
|
corepack enable;
|
||||||
corepack install;
|
corepack install;
|
||||||
yarn install || exit 1;
|
yarn install;
|
||||||
|
|
||||||
rm -rf target/dist;
|
rm -rf target/dist;
|
||||||
rm -rf resources/public;
|
rm -rf resources/public;
|
||||||
@@ -37,7 +37,7 @@ yarn run build:app:main $EXTRA_PARAMS;
|
|||||||
yarn run build:app:libs;
|
yarn run build:app:libs;
|
||||||
yarn run build:app:assets;
|
yarn run build:app:assets;
|
||||||
|
|
||||||
sed -i "s/\.\/render.js/.\/render.js?version=$CURRENT_VERSION/g" resources/public/js/worker/main*.js
|
sed -i "s/\.\/render.js/.\/render.js?version=$VERSION_TAG/g" resources/public/js/worker/main*.js
|
||||||
|
|
||||||
rsync -avr resources/public/ target/dist/
|
rsync -avr resources/public/ target/dist/
|
||||||
|
|
||||||
|
|||||||
@@ -2,18 +2,16 @@
|
|||||||
# NOTE: this script should be called from the parent directory to
|
# NOTE: this script should be called from the parent directory to
|
||||||
# properly work.
|
# properly work.
|
||||||
|
|
||||||
export CURRENT_VERSION=$1;
|
set -ex
|
||||||
|
|
||||||
|
export BUILD_TS=$(date +%s);
|
||||||
export BUILD_DATE=$(date -R);
|
export BUILD_DATE=$(date -R);
|
||||||
export CURRENT_HASH=${CURRENT_HASH:-$(git rev-parse --short HEAD)};
|
|
||||||
export TS=$(date +%s);
|
export VERSION=${1:-develop};
|
||||||
|
export VERSION_TAG="${VERSION}-${BUILD_TS}";
|
||||||
|
|
||||||
export NODE_ENV=production;
|
export NODE_ENV=production;
|
||||||
|
|
||||||
echo "Current path:"
|
|
||||||
echo $PATH
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
corepack enable;
|
corepack enable;
|
||||||
corepack install || exit 1;
|
corepack install || exit 1;
|
||||||
yarn install || exit 1;
|
yarn install || exit 1;
|
||||||
|
|||||||
@@ -95,6 +95,7 @@
|
|||||||
(def browser (parse-browser))
|
(def browser (parse-browser))
|
||||||
(def platform (parse-platform))
|
(def platform (parse-platform))
|
||||||
|
|
||||||
|
(def version-tag (obj/get global "penpotVersionTag"))
|
||||||
(def terms-of-service-uri (obj/get global "penpotTermsOfServiceURI"))
|
(def terms-of-service-uri (obj/get global "penpotTermsOfServiceURI"))
|
||||||
(def privacy-policy-uri (obj/get global "penpotPrivacyPolicyURI"))
|
(def privacy-policy-uri (obj/get global "penpotPrivacyPolicyURI"))
|
||||||
(def flex-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/"))
|
(def flex-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/"))
|
||||||
@@ -190,9 +191,8 @@
|
|||||||
|
|
||||||
(defn resolve-href
|
(defn resolve-href
|
||||||
[resource]
|
[resource]
|
||||||
(let [version (get version :full)
|
(let [href (-> public-uri
|
||||||
href (-> public-uri
|
(u/ensure-path-slash)
|
||||||
(u/ensure-path-slash)
|
(u/join resource)
|
||||||
(u/join resource)
|
(get :path))]
|
||||||
(get :path))]
|
(str href "?version=" version-tag)))
|
||||||
(str href "?version=" version)))
|
|
||||||
|
|||||||
@@ -27,8 +27,10 @@
|
|||||||
[app.main.data.workspace.colors :as wdc]
|
[app.main.data.workspace.colors :as wdc]
|
||||||
[app.main.data.workspace.shape-layout :as dwsl]
|
[app.main.data.workspace.shape-layout :as dwsl]
|
||||||
[app.main.data.workspace.shapes :as dwsh]
|
[app.main.data.workspace.shapes :as dwsh]
|
||||||
|
[app.main.data.workspace.texts :as dwt]
|
||||||
[app.main.data.workspace.transforms :as dwtr]
|
[app.main.data.workspace.transforms :as dwtr]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
|
[app.main.features :as features]
|
||||||
[app.main.fonts :as fonts]
|
[app.main.fonts :as fonts]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.util.i18n :refer [tr]]
|
[app.util.i18n :refer [tr]]
|
||||||
@@ -300,11 +302,20 @@
|
|||||||
update-fn (fn [node _]
|
update-fn (fn [node _]
|
||||||
(-> node
|
(-> node
|
||||||
(d/txt-merge txt-attrs)
|
(d/txt-merge txt-attrs)
|
||||||
(cty/remove-typography-from-node)))]
|
(cty/remove-typography-from-node)))
|
||||||
(dwsh/update-shapes shape-ids
|
;; Check if any attribute affects text layout (requires resize)
|
||||||
#(txt/update-text-content % update-node? update-fn nil)
|
affects-layout? (some #(contains? txt-attrs %) [:font-size :font-family :font-weight :letter-spacing :line-height])]
|
||||||
{:ignore-touched true
|
(ptk/reify ::generate-text-shape-update
|
||||||
:page-id page-id})))
|
ptk/WatchEvent
|
||||||
|
(watch [_ state _]
|
||||||
|
(cond-> (rx/of (dwsh/update-shapes shape-ids
|
||||||
|
#(txt/update-text-content % update-node? update-fn nil)
|
||||||
|
{:ignore-touched true
|
||||||
|
:page-id page-id}))
|
||||||
|
(and affects-layout?
|
||||||
|
(features/active-feature? state "render-wasm/v1"))
|
||||||
|
(rx/merge
|
||||||
|
(rx/of (dwt/resize-wasm-text-all shape-ids))))))))
|
||||||
|
|
||||||
(defn update-line-height
|
(defn update-line-height
|
||||||
([value shape-ids attributes] (update-line-height value shape-ids attributes nil))
|
([value shape-ids attributes] (update-line-height value shape-ids attributes nil))
|
||||||
@@ -353,11 +364,17 @@
|
|||||||
(-> node
|
(-> node
|
||||||
(d/txt-merge txt-attrs)
|
(d/txt-merge txt-attrs)
|
||||||
(cty/remove-typography-from-node))))]
|
(cty/remove-typography-from-node))))]
|
||||||
(dwsh/update-shapes shape-ids
|
(ptk/reify ::generate-font-family-text-shape-update
|
||||||
(fn [shape]
|
ptk/WatchEvent
|
||||||
(txt/update-text-content shape update-node? #(update-fn %1 (ctst/font-weight-applied? shape)) nil))
|
(watch [_ state _]
|
||||||
{:ignore-touched true
|
(cond-> (rx/of (dwsh/update-shapes shape-ids
|
||||||
:page-id page-id})))
|
(fn [shape]
|
||||||
|
(txt/update-text-content shape update-node? #(update-fn %1 (ctst/font-weight-applied? shape)) nil))
|
||||||
|
{:ignore-touched true
|
||||||
|
:page-id page-id}))
|
||||||
|
(features/active-feature? state "render-wasm/v1")
|
||||||
|
(rx/merge
|
||||||
|
(rx/of (dwt/resize-wasm-text-all shape-ids))))))))
|
||||||
|
|
||||||
(defn- create-font-family-text-attrs
|
(defn- create-font-family-text-attrs
|
||||||
[value]
|
[value]
|
||||||
@@ -425,10 +442,16 @@
|
|||||||
(-> node
|
(-> node
|
||||||
(d/txt-merge txt-attrs)
|
(d/txt-merge txt-attrs)
|
||||||
(cty/remove-typography-from-node))))]
|
(cty/remove-typography-from-node))))]
|
||||||
(dwsh/update-shapes shape-ids
|
(ptk/reify ::generate-font-weight-text-shape-update
|
||||||
#(txt/update-text-content % update-node? update-fn nil)
|
ptk/WatchEvent
|
||||||
{:ignore-touched true
|
(watch [_ state _]
|
||||||
:page-id page-id})))
|
(cond-> (rx/of (dwsh/update-shapes shape-ids
|
||||||
|
#(txt/update-text-content % update-node? update-fn nil)
|
||||||
|
{:ignore-touched true
|
||||||
|
:page-id page-id}))
|
||||||
|
(features/active-feature? state "render-wasm/v1")
|
||||||
|
(rx/merge
|
||||||
|
(rx/of (dwt/resize-wasm-text-all shape-ids))))))))
|
||||||
|
|
||||||
(defn update-font-weight
|
(defn update-font-weight
|
||||||
([value shape-ids attributes] (update-font-weight value shape-ids attributes nil))
|
([value shape-ids attributes] (update-font-weight value shape-ids attributes nil))
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
touched? (and (contains? (:data @form) input-name)
|
touched? (and (contains? (:data @form) input-name)
|
||||||
(get-in @form [:touched input-name]))
|
(get-in @form [:touched input-name]))
|
||||||
|
|
||||||
error (get-in @form [:errors input-name])
|
error (get-in @form [:errors input-name])
|
||||||
|
|
||||||
value (get-in @form [:data input-name] "")
|
value (get-in @form [:data input-name] "")
|
||||||
@@ -52,7 +53,8 @@
|
|||||||
(let [form (mf/use-ctx context)
|
(let [form (mf/use-ctx context)
|
||||||
disabled? (or (and (some? form)
|
disabled? (or (and (some? form)
|
||||||
(or (not (:valid @form))
|
(or (not (:valid @form))
|
||||||
(seq (:external-errors @form))))
|
(seq (:async-errors @form))
|
||||||
|
(seq (:extra-errors @form))))
|
||||||
(true? disabled))
|
(true? disabled))
|
||||||
handle-key-down-save
|
handle-key-down-save
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
|||||||
@@ -366,7 +366,7 @@
|
|||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps on-change ids)
|
(mf/deps on-change ids)
|
||||||
(fn [value attr event]
|
(fn [value attr event]
|
||||||
(if (or (string? value) (number? value))
|
(if (or (string? value) (int? value))
|
||||||
(on-change :simple attr value event)
|
(on-change :simple attr value event)
|
||||||
(do
|
(do
|
||||||
(let [resolved-value (:resolved-value (first value))
|
(let [resolved-value (:resolved-value (first value))
|
||||||
@@ -480,7 +480,7 @@
|
|||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps on-change ids)
|
(mf/deps on-change ids)
|
||||||
(fn [value attr event]
|
(fn [value attr event]
|
||||||
(if (or (string? value) (number? value))
|
(if (or (string? value) (int? value))
|
||||||
(on-change :multiple attr value event)
|
(on-change :multiple attr value event)
|
||||||
(do
|
(do
|
||||||
(let [resolved-value (:resolved-value (first value))]
|
(let [resolved-value (:resolved-value (first value))]
|
||||||
@@ -713,7 +713,7 @@
|
|||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps on-change wrap-type ids)
|
(mf/deps on-change wrap-type ids)
|
||||||
(fn [value event attr]
|
(fn [value event attr]
|
||||||
(if (or (string? value) (number? value))
|
(if (or (string? value) (int? value))
|
||||||
(on-change (= "nowrap" wrap-type) attr value event)
|
(on-change (= "nowrap" wrap-type) attr value event)
|
||||||
(do
|
(do
|
||||||
(let [resolved-value (:resolved-value (first value))]
|
(let [resolved-value (:resolved-value (first value))]
|
||||||
|
|||||||
@@ -236,12 +236,14 @@
|
|||||||
(on-composite-input-change form field value false))
|
(on-composite-input-change form field value false))
|
||||||
([form field value trim?]
|
([form field value trim?]
|
||||||
(letfn [(clean-errors [errors]
|
(letfn [(clean-errors [errors]
|
||||||
(-> errors
|
(some-> errors
|
||||||
(dissoc field)
|
(update :value #(when (map? %) (dissoc % field)))
|
||||||
(not-empty)))]
|
(update :value #(when (seq %) %))
|
||||||
|
(not-empty)))]
|
||||||
(swap! form (fn [state]
|
(swap! form (fn [state]
|
||||||
(-> state
|
(-> state
|
||||||
(assoc-in [:data :value field] (if trim? (str/trim value) value))
|
(assoc-in [:data :value field] (if trim? (str/trim value) value))
|
||||||
|
(assoc-in [:touched :value field] true)
|
||||||
(update :errors clean-errors)
|
(update :errors clean-errors)
|
||||||
(update :extra-errors clean-errors)))))))
|
(update :extra-errors clean-errors)))))))
|
||||||
|
|
||||||
@@ -257,6 +259,9 @@
|
|||||||
value
|
value
|
||||||
(get-in @form [:data :value input-name] "")
|
(get-in @form [:data :value input-name] "")
|
||||||
|
|
||||||
|
touched?
|
||||||
|
(get-in @form [:touched :value input-name])
|
||||||
|
|
||||||
resolve-stream
|
resolve-stream
|
||||||
(mf/with-memo [token]
|
(mf/with-memo [token]
|
||||||
(if-let [value (get-in token [:value input-name])]
|
(if-let [value (get-in token [:value input-name])]
|
||||||
@@ -284,7 +289,7 @@
|
|||||||
:hint-message (:message hint)
|
:hint-message (:message hint)
|
||||||
:hint-type (:type hint)})
|
:hint-type (:type hint)})
|
||||||
props
|
props
|
||||||
(if error
|
(if (and touched? error)
|
||||||
(mf/spread-props props {:hint-type "error"
|
(mf/spread-props props {:hint-type "error"
|
||||||
:hint-message (:message error)})
|
:hint-message (:message error)})
|
||||||
props)
|
props)
|
||||||
@@ -332,6 +337,7 @@
|
|||||||
message (tr "workspace.tokens.resolved-value" (or resolved-value value))]
|
message (tr "workspace.tokens.resolved-value" (or resolved-value value))]
|
||||||
(swap! form update :errors dissoc :value)
|
(swap! form update :errors dissoc :value)
|
||||||
(swap! form update :extra-errors dissoc :value)
|
(swap! form update :extra-errors dissoc :value)
|
||||||
|
(swap! form update :async-errors dissoc :reference)
|
||||||
(if (= input-value (str resolved-value))
|
(if (= input-value (str resolved-value))
|
||||||
(reset! hint* {})
|
(reset! hint* {})
|
||||||
(reset! hint* {:message message :type "hint"})))))))]
|
(reset! hint* {:message message :type "hint"})))))))]
|
||||||
|
|||||||
@@ -105,13 +105,6 @@
|
|||||||
active-tab* (mf/use-state #(if (cft/is-reference? token) :reference :composite))
|
active-tab* (mf/use-state #(if (cft/is-reference? token) :reference :composite))
|
||||||
active-tab (deref active-tab*)
|
active-tab (deref active-tab*)
|
||||||
|
|
||||||
on-toggle-tab
|
|
||||||
(mf/use-fn
|
|
||||||
(mf/deps)
|
|
||||||
(fn [new-tab]
|
|
||||||
(let [new-tab (keyword new-tab)]
|
|
||||||
(reset! active-tab* new-tab))))
|
|
||||||
|
|
||||||
token
|
token
|
||||||
(mf/with-memo [token]
|
(mf/with-memo [token]
|
||||||
(or token {:type token-type}))
|
(or token {:type token-type}))
|
||||||
@@ -151,6 +144,17 @@
|
|||||||
(fm/use-form :schema schema
|
(fm/use-form :schema schema
|
||||||
:initial initial)
|
:initial initial)
|
||||||
|
|
||||||
|
on-toggle-tab
|
||||||
|
(mf/use-fn
|
||||||
|
(mf/deps form)
|
||||||
|
(fn [new-tab]
|
||||||
|
(let [new-tab (keyword new-tab)]
|
||||||
|
(if (= new-tab :reference)
|
||||||
|
(swap! form assoc-in [:async-errors :reference]
|
||||||
|
{:message "Need valid reference"})
|
||||||
|
(swap! form update :async-errors dissoc :reference))
|
||||||
|
(reset! active-tab* new-tab))))
|
||||||
|
|
||||||
on-cancel
|
on-cancel
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(fn [e]
|
(fn [e]
|
||||||
|
|||||||
@@ -291,6 +291,7 @@
|
|||||||
[:color {:optional true} [:maybe :string]]
|
[:color {:optional true} [:maybe :string]]
|
||||||
[:color-result {:optional true} ::sm/any]
|
[:color-result {:optional true} ::sm/any]
|
||||||
[:inset {:optional true} [:maybe :boolean]]]]]
|
[:inset {:optional true} [:maybe :boolean]]]]]
|
||||||
|
|
||||||
(if (= active-tab :reference)
|
(if (= active-tab :reference)
|
||||||
[:reference {:optional false} ::sm/text]
|
[:reference {:optional false} ::sm/text]
|
||||||
[:reference {:optional true} [:maybe :string]])]]
|
[:reference {:optional true} [:maybe :string]])]]
|
||||||
|
|||||||
@@ -1185,7 +1185,6 @@
|
|||||||
{:cmd :export-shapes
|
{:cmd :export-shapes
|
||||||
:profile-id (:profile-id @st/state)
|
:profile-id (:profile-id @st/state)
|
||||||
:wait true
|
:wait true
|
||||||
:skip-children (:skip-children value false)
|
|
||||||
:exports [{:file-id file-id
|
:exports [{:file-id file-id
|
||||||
:page-id page-id
|
:page-id page-id
|
||||||
:object-id id
|
:object-id id
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
|
|
||||||
(defn- load
|
(defn- load
|
||||||
[locale]
|
[locale]
|
||||||
(let [path (str "./translation." locale ".js?version=" (:full cf/version))]
|
(let [path (str "./translation." locale ".js?version=" cf/version-tag)]
|
||||||
(->> (mod/import path)
|
(->> (mod/import path)
|
||||||
(p/fmap (fn [result] (unchecked-get result "default")))
|
(p/fmap (fn [result] (unchecked-get result "default")))
|
||||||
(p/fnly (fn [data cause]
|
(p/fnly (fn [data cause]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
export CURRENT_VERSION=${CURRENT_VERSION:-develop};
|
export VERSION_TAG=${VERSION:-develop};
|
||||||
|
|
||||||
if [ "$NODE_ENV" = "production" ]; then
|
if [ "$NODE_ENV" = "production" ]; then
|
||||||
export BUILD_MODE="release";
|
export BUILD_MODE="release";
|
||||||
@@ -81,7 +81,7 @@ function copy_artifacts {
|
|||||||
cp target/wasm32-unknown-emscripten/$BUILD_MODE/render_wasm.js $DEST/$BUILD_NAME.js;
|
cp target/wasm32-unknown-emscripten/$BUILD_MODE/render_wasm.js $DEST/$BUILD_NAME.js;
|
||||||
cp target/wasm32-unknown-emscripten/$BUILD_MODE/render_wasm.wasm $DEST/$BUILD_NAME.wasm;
|
cp target/wasm32-unknown-emscripten/$BUILD_MODE/render_wasm.wasm $DEST/$BUILD_NAME.wasm;
|
||||||
|
|
||||||
sed -i "s/render_wasm.wasm/$BUILD_NAME.wasm?version=$CURRENT_VERSION/g" $DEST/$BUILD_NAME.js;
|
sed -i "s/render_wasm.wasm/$BUILD_NAME.wasm?version=$VERSION_TAG/g" $DEST/$BUILD_NAME.js;
|
||||||
|
|
||||||
yarn esbuild target/wasm32-unknown-emscripten/$BUILD_MODE/render_wasm.js \
|
yarn esbuild target/wasm32-unknown-emscripten/$BUILD_MODE/render_wasm.js \
|
||||||
--log-level=error \
|
--log-level=error \
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ pub extern "C" fn set_view_end() {
|
|||||||
performance::end_measure!("set_view_end::clear_tile_index");
|
performance::end_measure!("set_view_end::clear_tile_index");
|
||||||
performance::end_timed_log!("clear_tile_index", _clear_start);
|
performance::end_timed_log!("clear_tile_index", _clear_start);
|
||||||
}
|
}
|
||||||
|
state.render_state.sync_cached_viewbox();
|
||||||
performance::end_measure!("set_view_end");
|
performance::end_measure!("set_view_end");
|
||||||
performance::end_timed_log!("set_view_end", _end_start);
|
performance::end_timed_log!("set_view_end", _end_start);
|
||||||
#[cfg(feature = "profile-macros")]
|
#[cfg(feature = "profile-macros")]
|
||||||
|
|||||||
@@ -1136,6 +1136,7 @@ impl RenderState {
|
|||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
let _start = performance::begin_timed_log!("start_render_loop");
|
let _start = performance::begin_timed_log!("start_render_loop");
|
||||||
let scale = self.get_scale();
|
let scale = self.get_scale();
|
||||||
|
|
||||||
self.tile_viewbox.update(self.viewbox, scale);
|
self.tile_viewbox.update(self.viewbox, scale);
|
||||||
|
|
||||||
self.focus_mode.reset();
|
self.focus_mode.reset();
|
||||||
@@ -2292,6 +2293,10 @@ impl RenderState {
|
|||||||
(self.viewbox.zoom - self.cached_viewbox.zoom).abs() > f32::EPSILON
|
(self.viewbox.zoom - self.cached_viewbox.zoom).abs() > f32::EPSILON
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn sync_cached_viewbox(&mut self) {
|
||||||
|
self.cached_viewbox = self.viewbox;
|
||||||
|
}
|
||||||
|
|
||||||
pub fn mark_touched(&mut self, uuid: Uuid) {
|
pub fn mark_touched(&mut self, uuid: Uuid) {
|
||||||
self.touched_ids.insert(uuid);
|
self.touched_ids.insert(uuid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1529,6 +1529,7 @@ impl Shape {
|
|||||||
|| !self.transform.is_identity()
|
|| !self.transform.is_identity()
|
||||||
|| !math::is_close_to(self.rotation, 0.0)
|
|| !math::is_close_to(self.rotation, 0.0)
|
||||||
|| matches!(self.shape_type, Type::Group(_) | Type::Frame(_))
|
|| matches!(self.shape_type, Type::Group(_) | Type::Frame(_))
|
||||||
|
|| matches!(self.shape_type, Type::Text(_))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn count_visible_inner_strokes(&self) -> usize {
|
pub fn count_visible_inner_strokes(&self) -> usize {
|
||||||
|
|||||||
@@ -100,6 +100,16 @@ impl<'a> State<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn start_render_loop(&mut self, timestamp: i32) -> Result<(), String> {
|
pub fn start_render_loop(&mut self, timestamp: i32) -> Result<(), String> {
|
||||||
|
// If zoom changed, we MUST rebuild the tile index before using it.
|
||||||
|
// Otherwise, the index will have tiles from the old zoom level, causing visible
|
||||||
|
// tiles to appear empty. This can happen if start_render_loop() is called before
|
||||||
|
// set_view_end() finishes rebuilding the index, or if set_view_end() hasn't been
|
||||||
|
// called yet.
|
||||||
|
let zoom_changed = self.render_state.zoom_changed();
|
||||||
|
if zoom_changed {
|
||||||
|
self.rebuild_tiles_shallow();
|
||||||
|
}
|
||||||
|
|
||||||
self.render_state
|
self.render_state
|
||||||
.start_render_loop(None, &self.shapes, timestamp, false)?;
|
.start_render_loop(None, &self.shapes, timestamp, false)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user