0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

Adds internationalization to typography

This commit is contained in:
alonso.torres 2020-10-01 14:31:30 +02:00 committed by Hirunatan
parent bd92936a64
commit f45845cf85
11 changed files with 230 additions and 175 deletions

View file

@ -294,7 +294,7 @@
} }
}, },
"dashboard.grid.add-shared" : { "dashboard.grid.add-shared" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:210", "src/app/main/ui/dashboard/grid.cljs:165" ], "used-in" : [ "src/app/main/ui/workspace/header.cljs:210", "src/app/main/ui/dashboard/grid.cljs:167" ],
"translations" : { "translations" : {
"en" : "Add as Shared Library", "en" : "Add as Shared Library",
"fr" : "", "fr" : "",
@ -303,7 +303,7 @@
} }
}, },
"dashboard.grid.add-shared-accept" : { "dashboard.grid.add-shared-accept" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:104", "src/app/main/ui/dashboard/grid.cljs:94" ], "used-in" : [ "src/app/main/ui/workspace/header.cljs:104", "src/app/main/ui/dashboard/grid.cljs:95" ],
"translations" : { "translations" : {
"en" : "Add as Shared Library", "en" : "Add as Shared Library",
"fr" : "", "fr" : "",
@ -312,7 +312,7 @@
} }
}, },
"dashboard.grid.add-shared-hint" : { "dashboard.grid.add-shared-hint" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:103", "src/app/main/ui/dashboard/grid.cljs:93" ], "used-in" : [ "src/app/main/ui/workspace/header.cljs:103", "src/app/main/ui/dashboard/grid.cljs:94" ],
"translations" : { "translations" : {
"en" : "Once added as Shared Library, the assets of this file library will be available to be used among the rest of your files.", "en" : "Once added as Shared Library, the assets of this file library will be available to be used among the rest of your files.",
"fr" : "", "fr" : "",
@ -321,7 +321,7 @@
} }
}, },
"dashboard.grid.add-shared-message" : { "dashboard.grid.add-shared-message" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:102", "src/app/main/ui/dashboard/grid.cljs:92" ], "used-in" : [ "src/app/main/ui/workspace/header.cljs:102", "src/app/main/ui/dashboard/grid.cljs:93" ],
"translations" : { "translations" : {
"en" : "Add “%s” as Shared Library", "en" : "Add “%s” as Shared Library",
"fr" : "", "fr" : "",
@ -330,7 +330,7 @@
} }
}, },
"dashboard.grid.delete" : { "dashboard.grid.delete" : {
"used-in" : [ "src/app/main/ui/dashboard/project.cljs:61", "src/app/main/ui/dashboard/grid.cljs:162" ], "used-in" : [ "src/app/main/ui/dashboard/files.cljs:87", "src/app/main/ui/dashboard/grid.cljs:164" ],
"translations" : { "translations" : {
"en" : "Delete", "en" : "Delete",
"fr" : "Supprimer", "fr" : "Supprimer",
@ -339,7 +339,7 @@
} }
}, },
"dashboard.grid.empty-files" : { "dashboard.grid.empty-files" : {
"used-in" : [ "src/app/main/ui/dashboard/grid.cljs:189" ], "used-in" : [ "src/app/main/ui/dashboard/grid.cljs:174" ],
"translations" : { "translations" : {
"en" : "You still have no files here", "en" : "You still have no files here",
"fr" : "Vous n'avez encore aucun fichier ici", "fr" : "Vous n'avez encore aucun fichier ici",
@ -348,7 +348,7 @@
} }
}, },
"dashboard.grid.remove-shared" : { "dashboard.grid.remove-shared" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:208", "src/app/main/ui/dashboard/grid.cljs:164" ], "used-in" : [ "src/app/main/ui/workspace/header.cljs:208", "src/app/main/ui/dashboard/grid.cljs:166" ],
"translations" : { "translations" : {
"en" : "Remove as Shared Library", "en" : "Remove as Shared Library",
"fr" : "", "fr" : "",
@ -357,7 +357,7 @@
} }
}, },
"dashboard.grid.remove-shared-accept" : { "dashboard.grid.remove-shared-accept" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:113", "src/app/main/ui/dashboard/grid.cljs:113" ], "used-in" : [ "src/app/main/ui/workspace/header.cljs:113", "src/app/main/ui/dashboard/grid.cljs:114" ],
"translations" : { "translations" : {
"en" : "Remove as Shared Library", "en" : "Remove as Shared Library",
"fr" : "", "fr" : "",
@ -366,7 +366,7 @@
} }
}, },
"dashboard.grid.remove-shared-hint" : { "dashboard.grid.remove-shared-hint" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:112", "src/app/main/ui/dashboard/grid.cljs:112" ], "used-in" : [ "src/app/main/ui/workspace/header.cljs:112", "src/app/main/ui/dashboard/grid.cljs:113" ],
"translations" : { "translations" : {
"en" : "Once removed as Shared Library, the File Library of this file will stop being available to be used among the rest of your files.", "en" : "Once removed as Shared Library, the File Library of this file will stop being available to be used among the rest of your files.",
"fr" : "", "fr" : "",
@ -375,7 +375,7 @@
} }
}, },
"dashboard.grid.remove-shared-message" : { "dashboard.grid.remove-shared-message" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:111", "src/app/main/ui/dashboard/grid.cljs:111" ], "used-in" : [ "src/app/main/ui/workspace/header.cljs:111", "src/app/main/ui/dashboard/grid.cljs:112" ],
"translations" : { "translations" : {
"en" : "Remove “%s” as Shared Library", "en" : "Remove “%s” as Shared Library",
"fr" : "", "fr" : "",
@ -384,7 +384,7 @@
} }
}, },
"dashboard.grid.rename" : { "dashboard.grid.rename" : {
"used-in" : [ "src/app/main/ui/dashboard/project.cljs:60", "src/app/main/ui/dashboard/grid.cljs:161" ], "used-in" : [ "src/app/main/ui/dashboard/files.cljs:86", "src/app/main/ui/dashboard/grid.cljs:163" ],
"translations" : { "translations" : {
"en" : "Rename", "en" : "Rename",
"fr" : "Renommer", "fr" : "Renommer",
@ -393,7 +393,7 @@
} }
}, },
"dashboard.header.draft" : { "dashboard.header.draft" : {
"used-in" : [ "src/app/main/ui/dashboard/project.cljs:54" ], "used-in" : [ "src/app/main/ui/dashboard/files.cljs:80" ],
"translations" : { "translations" : {
"en" : "Draft", "en" : "Draft",
"fr" : "Brouillon", "fr" : "Brouillon",
@ -402,7 +402,7 @@
} }
}, },
"dashboard.header.libraries" : { "dashboard.header.libraries" : {
"used-in" : [ "src/app/main/ui/dashboard/libraries.cljs:40" ], "used-in" : [ "src/app/main/ui/dashboard/libraries.cljs:39" ],
"translations" : { "translations" : {
"en" : "Shared Libraries", "en" : "Shared Libraries",
"fr" : "", "fr" : "",
@ -410,17 +410,8 @@
"es" : "Bibliotecas Compartidas" "es" : "Bibliotecas Compartidas"
} }
}, },
"dashboard.sidebar.projects" : {
"translations" : {
"en" : "Projects",
"fr" : "Projetes",
"ru" : "Проекты",
"es" : "Proyectos"
}
},
"dashboard.header.new-project" : { "dashboard.header.new-project" : {
"used-in" : [ "src/app/main/ui/dashboard/recent_files.cljs:46" ], "used-in" : [ "src/app/main/ui/dashboard/projects.cljs:36" ],
"translations" : { "translations" : {
"en" : "+ New project", "en" : "+ New project",
"fr" : "+ Nouveau projet", "fr" : "+ Nouveau projet",
@ -429,7 +420,7 @@
} }
}, },
"dashboard.header.profile-menu.logout" : { "dashboard.header.profile-menu.logout" : {
"used-in" : [ "src/app/main/ui/dashboard/profile.cljs:57" ], "used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:376" ],
"translations" : { "translations" : {
"en" : "Exit", "en" : "Exit",
"fr" : "Quitter", "fr" : "Quitter",
@ -438,7 +429,7 @@
} }
}, },
"dashboard.header.profile-menu.password" : { "dashboard.header.profile-menu.password" : {
"used-in" : [ "src/app/main/ui/dashboard/profile.cljs:54" ], "used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:372" ],
"translations" : { "translations" : {
"en" : "Password", "en" : "Password",
"fr" : "Mot de passe", "fr" : "Mot de passe",
@ -447,7 +438,7 @@
} }
}, },
"dashboard.header.profile-menu.profile" : { "dashboard.header.profile-menu.profile" : {
"used-in" : [ "src/app/main/ui/dashboard/profile.cljs:51" ], "used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:368" ],
"translations" : { "translations" : {
"en" : "Profile", "en" : "Profile",
"fr" : "Profil", "fr" : "Profil",
@ -456,7 +447,7 @@
} }
}, },
"dashboard.header.project" : { "dashboard.header.project" : {
"used-in" : [ "src/app/main/ui/dashboard/project.cljs:56" ], "used-in" : [ "src/app/main/ui/dashboard/files.cljs:82" ],
"translations" : { "translations" : {
"en" : "Project %s", "en" : "Project %s",
"fr" : "Projet %s", "fr" : "Projet %s",
@ -545,8 +536,17 @@
}, },
"unused" : true "unused" : true
}, },
"dashboard.new-file" : {
"used-in" : [ "src/app/main/ui/dashboard/projects.cljs:110", "src/app/main/ui/dashboard/files.cljs:101" ],
"translations" : {
"en" : "+ New File",
"fr" : "+ Nouveau fichier",
"ru" : "+ Новый файл",
"es" : "+ Nuevo Archivo"
}
},
"dashboard.search.no-matches-for" : { "dashboard.search.no-matches-for" : {
"used-in" : [ "src/app/main/ui/dashboard/search.cljs:47" ], "used-in" : [ "src/app/main/ui/dashboard/search.cljs:50" ],
"translations" : { "translations" : {
"en" : "No matches found for “%s“", "en" : "No matches found for “%s“",
"fr" : "Aucune correspondance pour “%s“", "fr" : "Aucune correspondance pour “%s“",
@ -555,7 +555,7 @@
} }
}, },
"dashboard.search.searching-for" : { "dashboard.search.searching-for" : {
"used-in" : [ "src/app/main/ui/dashboard/search.cljs:43" ], "used-in" : [ "src/app/main/ui/dashboard/search.cljs:45" ],
"translations" : { "translations" : {
"en" : "Searching for “%s“...", "en" : "Searching for “%s“...",
"fr" : "Recherche de “%s“...", "fr" : "Recherche de “%s“...",
@ -564,7 +564,7 @@
} }
}, },
"dashboard.search.type-something" : { "dashboard.search.type-something" : {
"used-in" : [ "src/app/main/ui/dashboard/search.cljs:39" ], "used-in" : [ "src/app/main/ui/dashboard/search.cljs:40" ],
"translations" : { "translations" : {
"en" : "Type to search results", "en" : "Type to search results",
"fr" : "Écrivez pour rechercher", "fr" : "Écrivez pour rechercher",
@ -573,7 +573,7 @@
} }
}, },
"dashboard.sidebar.drafts" : { "dashboard.sidebar.drafts" : {
"used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:127" ], "used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:319" ],
"translations" : { "translations" : {
"en" : "Drafts", "en" : "Drafts",
"fr" : "Brouillons", "fr" : "Brouillons",
@ -582,7 +582,7 @@
} }
}, },
"dashboard.sidebar.libraries" : { "dashboard.sidebar.libraries" : {
"used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:133" ], "used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:325" ],
"translations" : { "translations" : {
"en" : "Shared Libraries", "en" : "Shared Libraries",
"fr" : "", "fr" : "",
@ -590,14 +590,23 @@
"es" : "Bibliotecas Compartidas" "es" : "Bibliotecas Compartidas"
} }
}, },
"dashboard.sidebar.projects" : {
"used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:314" ],
"translations" : {
"en" : "Projects",
"fr" : "Projetes",
"ru" : "Проекты",
"es" : "Proyectos"
}
},
"dashboard.sidebar.recent" : { "dashboard.sidebar.recent" : {
"used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:120" ],
"translations" : { "translations" : {
"en" : "Recent", "en" : "Recent",
"fr" : "Récent", "fr" : "Récent",
"ru" : "Недавние", "ru" : "Недавние",
"es" : "Reciente" "es" : "Reciente"
} },
"unused" : true
}, },
"ds.accept" : { "ds.accept" : {
"translations" : { "translations" : {
@ -689,17 +698,8 @@
}, },
"unused" : true "unused" : true
}, },
"dashboard.new-file" : {
"used-in" : [ "src/app/main/ui/dashboard/grid.cljs:179", "src/app/main/ui/dashboard/grid.cljs:191" ],
"translations" : {
"en" : "+ New File",
"fr" : "+ Nouveau fichier",
"ru" : "+ Новый файл",
"es" : "+ Nuevo Archivo"
}
},
"ds.search.placeholder" : { "ds.search.placeholder" : {
"used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:186" ], "used-in" : [ "src/app/main/ui/dashboard/sidebar.cljs:151" ],
"translations" : { "translations" : {
"en" : "Search...", "en" : "Search...",
"fr" : "Rechercher...", "fr" : "Rechercher...",
@ -717,7 +717,7 @@
"unused" : true "unused" : true
}, },
"ds.updated-at" : { "ds.updated-at" : {
"used-in" : [ "src/app/main/ui/dashboard/grid.cljs:57" ], "used-in" : [ "src/app/main/ui/dashboard/grid.cljs:58" ],
"translations" : { "translations" : {
"en" : "Updated: %s", "en" : "Updated: %s",
"fr" : "Mis à jour: %s", "fr" : "Mis à jour: %s",
@ -888,7 +888,7 @@
"unused" : true "unused" : true
}, },
"media.loading" : { "media.loading" : {
"used-in" : [ "src/app/main/data/media.cljs:43", "src/app/main/data/workspace/persistence.cljs:395" ], "used-in" : [ "src/app/main/data/media.cljs:43", "src/app/main/data/workspace/persistence.cljs:394" ],
"translations" : { "translations" : {
"en" : "Loading image...", "en" : "Loading image...",
"fr" : "Chargement de l'image...", "fr" : "Chargement de l'image...",
@ -1059,7 +1059,7 @@
} }
}, },
"settings.multiple" : { "settings.multiple" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs:138", "src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs:147", "src/app/main/ui/workspace/sidebar/options/text.cljs:124", "src/app/main/ui/workspace/sidebar/options/text.cljs:219", "src/app/main/ui/workspace/sidebar/options/text.cljs:232", "src/app/main/ui/workspace/sidebar/options/stroke.cljs:156" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs:138", "src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs:147", "src/app/main/ui/workspace/sidebar/options/typography.cljs:98", "src/app/main/ui/workspace/sidebar/options/typography.cljs:148", "src/app/main/ui/workspace/sidebar/options/typography.cljs:161", "src/app/main/ui/workspace/sidebar/options/stroke.cljs:156" ],
"translations" : { "translations" : {
"en" : "Mixed", "en" : "Mixed",
"fr" : null, "fr" : null,
@ -1446,7 +1446,7 @@
} }
}, },
"workspace.assets.assets" : { "workspace.assets.assets" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:477" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:613" ],
"translations" : { "translations" : {
"en" : "Assets", "en" : "Assets",
"fr" : "", "fr" : "",
@ -1455,7 +1455,7 @@
} }
}, },
"workspace.assets.box-filter-all" : { "workspace.assets.box-filter-all" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:497" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:633" ],
"translations" : { "translations" : {
"en" : "All assets", "en" : "All assets",
"fr" : "", "fr" : "",
@ -1464,25 +1464,25 @@
} }
}, },
"workspace.assets.box-filter-colors" : { "workspace.assets.box-filter-colors" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:499" ],
"translations" : { "translations" : {
"en" : "Colors", "en" : "Colors",
"fr" : "", "fr" : "",
"ru" : "", "ru" : "",
"es" : "Colores" "es" : "Colores"
} },
"unused" : true
}, },
"workspace.assets.box-filter-graphics" : { "workspace.assets.box-filter-graphics" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:498" ],
"translations" : { "translations" : {
"en" : "Graphics", "en" : "Graphics",
"fr" : "", "fr" : "",
"ru" : "", "ru" : "",
"es" : "Gráficos" "es" : "Gráficos"
} },
"unused" : true
}, },
"workspace.assets.colors" : { "workspace.assets.colors" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:316" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:320", "src/app/main/ui/workspace/sidebar/assets.cljs:636" ],
"translations" : { "translations" : {
"en" : "Colors", "en" : "Colors",
"fr" : "", "fr" : "",
@ -1491,7 +1491,7 @@
} }
}, },
"workspace.assets.components" : { "workspace.assets.components" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:79" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:82", "src/app/main/ui/workspace/sidebar/assets.cljs:634" ],
"translations" : { "translations" : {
"en" : "Components", "en" : "Components",
"fr" : "", "fr" : "",
@ -1500,7 +1500,7 @@
} }
}, },
"workspace.assets.delete" : { "workspace.assets.delete" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:98", "src/app/main/ui/workspace/sidebar/assets.cljs:186", "src/app/main/ui/workspace/sidebar/assets.cljs:292" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:102", "src/app/main/ui/workspace/sidebar/assets.cljs:190", "src/app/main/ui/workspace/sidebar/assets.cljs:296", "src/app/main/ui/workspace/sidebar/assets.cljs:419" ],
"translations" : { "translations" : {
"en" : "Delete", "en" : "Delete",
"fr" : "", "fr" : "",
@ -1509,7 +1509,7 @@
} }
}, },
"workspace.assets.edit" : { "workspace.assets.edit" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:291" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:295", "src/app/main/ui/workspace/sidebar/assets.cljs:418" ],
"translations" : { "translations" : {
"en" : "Edit", "en" : "Edit",
"fr" : "", "fr" : "",
@ -1518,7 +1518,7 @@
} }
}, },
"workspace.assets.file-library" : { "workspace.assets.file-library" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:397" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:517" ],
"translations" : { "translations" : {
"en" : "File library", "en" : "File library",
"fr" : "", "fr" : "",
@ -1527,7 +1527,7 @@
} }
}, },
"workspace.assets.graphics" : { "workspace.assets.graphics" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:159" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:163", "src/app/main/ui/workspace/sidebar/assets.cljs:635" ],
"translations" : { "translations" : {
"en" : "Graphics", "en" : "Graphics",
"fr" : "", "fr" : "",
@ -1536,7 +1536,7 @@
} }
}, },
"workspace.assets.libraries" : { "workspace.assets.libraries" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:480" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:616" ],
"translations" : { "translations" : {
"en" : "Libraries", "en" : "Libraries",
"fr" : "", "fr" : "",
@ -1545,7 +1545,7 @@
} }
}, },
"workspace.assets.not-found" : { "workspace.assets.not-found" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:441" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:577" ],
"translations" : { "translations" : {
"en" : "No assets found", "en" : "No assets found",
"fr" : "", "fr" : "",
@ -1554,7 +1554,7 @@
} }
}, },
"workspace.assets.rename" : { "workspace.assets.rename" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:290" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:294", "src/app/main/ui/workspace/sidebar/assets.cljs:417" ],
"translations" : { "translations" : {
"en" : "Rename", "en" : "Rename",
"fr" : "", "fr" : "",
@ -1563,7 +1563,7 @@
} }
}, },
"workspace.assets.search" : { "workspace.assets.search" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:484" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:620" ],
"translations" : { "translations" : {
"en" : "Search assets", "en" : "Search assets",
"fr" : "", "fr" : "",
@ -1572,7 +1572,7 @@
} }
}, },
"workspace.assets.shared" : { "workspace.assets.shared" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:399" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:519" ],
"translations" : { "translations" : {
"en" : "SHARED", "en" : "SHARED",
"fr" : "", "fr" : "",
@ -1580,6 +1580,12 @@
"es" : "COMPARTIDA" "es" : "COMPARTIDA"
} }
}, },
"workspace.assets.typography" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/assets.cljs:406", "src/app/main/ui/workspace/sidebar/assets.cljs:637" ],
"translations" : {
"en" : "Typographies"
}
},
"workspace.header.menu.disable-dynamic-alignment" : { "workspace.header.menu.disable-dynamic-alignment" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:202" ], "used-in" : [ "src/app/main/ui/workspace/header.cljs:202" ],
"translations" : { "translations" : {
@ -1740,7 +1746,7 @@
} }
}, },
"workspace.libraries.add" : { "workspace.libraries.add" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:111" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:115" ],
"translations" : { "translations" : {
"en" : "Add", "en" : "Add",
"fr" : "", "fr" : "",
@ -1749,7 +1755,7 @@
} }
}, },
"workspace.libraries.colors" : { "workspace.libraries.colors" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:42" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:43" ],
"translations" : { "translations" : {
"en" : "%s colors", "en" : "%s colors",
"fr" : "", "fr" : "",
@ -1758,19 +1764,19 @@
} }
}, },
"workspace.libraries.colors.big-thumbnails" : { "workspace.libraries.colors.big-thumbnails" : {
"used-in" : [ "src/app/main/ui/workspace/colorpalette.cljs:172" ], "used-in" : [ "src/app/main/ui/workspace/colorpalette.cljs:171" ],
"translations" : { "translations" : {
"en" : "Big thumbnails" "en" : "Big thumbnails"
} }
}, },
"workspace.libraries.colors.file-library" : { "workspace.libraries.colors.file-library" : {
"used-in" : [ "src/app/main/ui/workspace/colorpicker.cljs:338", "src/app/main/ui/workspace/colorpalette.cljs:150" ], "used-in" : [ "src/app/main/ui/workspace/colorpicker.cljs:338", "src/app/main/ui/workspace/colorpalette.cljs:149" ],
"translations" : { "translations" : {
"en" : "File library" "en" : "File library"
} }
}, },
"workspace.libraries.colors.recent-colors" : { "workspace.libraries.colors.recent-colors" : {
"used-in" : [ "src/app/main/ui/workspace/colorpicker.cljs:337", "src/app/main/ui/workspace/colorpalette.cljs:160" ], "used-in" : [ "src/app/main/ui/workspace/colorpicker.cljs:337", "src/app/main/ui/workspace/colorpalette.cljs:159" ],
"translations" : { "translations" : {
"en" : "Recent colors" "en" : "Recent colors"
} }
@ -1782,13 +1788,13 @@
} }
}, },
"workspace.libraries.colors.small-thumbnails" : { "workspace.libraries.colors.small-thumbnails" : {
"used-in" : [ "src/app/main/ui/workspace/colorpalette.cljs:177" ], "used-in" : [ "src/app/main/ui/workspace/colorpalette.cljs:176" ],
"translations" : { "translations" : {
"en" : "Small thumbnails" "en" : "Small thumbnails"
} }
}, },
"workspace.libraries.components" : { "workspace.libraries.components" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:36" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:37" ],
"translations" : { "translations" : {
"en" : "%s components", "en" : "%s components",
"fr" : "", "fr" : "",
@ -1797,7 +1803,7 @@
} }
}, },
"workspace.libraries.file-library" : { "workspace.libraries.file-library" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:80" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:84" ],
"translations" : { "translations" : {
"en" : "File library", "en" : "File library",
"fr" : "", "fr" : "",
@ -1806,7 +1812,7 @@
} }
}, },
"workspace.libraries.graphics" : { "workspace.libraries.graphics" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:39" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:40" ],
"translations" : { "translations" : {
"en" : "%s graphics", "en" : "%s graphics",
"fr" : "", "fr" : "",
@ -1815,7 +1821,7 @@
} }
}, },
"workspace.libraries.in-this-file" : { "workspace.libraries.in-this-file" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:77" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:81" ],
"translations" : { "translations" : {
"en" : "LIBRARIES IN THIS FILE", "en" : "LIBRARIES IN THIS FILE",
"fr" : "", "fr" : "",
@ -1824,7 +1830,7 @@
} }
}, },
"workspace.libraries.libraries" : { "workspace.libraries.libraries" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:171" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:175" ],
"translations" : { "translations" : {
"en" : "LIBRARIES", "en" : "LIBRARIES",
"fr" : "", "fr" : "",
@ -1833,7 +1839,7 @@
} }
}, },
"workspace.libraries.library" : { "workspace.libraries.library" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:131" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:135" ],
"translations" : { "translations" : {
"en" : "LIBRARY", "en" : "LIBRARY",
"fr" : "", "fr" : "",
@ -1842,7 +1848,7 @@
} }
}, },
"workspace.libraries.no-libraries-need-sync" : { "workspace.libraries.no-libraries-need-sync" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:129" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:133" ],
"translations" : { "translations" : {
"en" : "There are no Shared Libraries that need update", "en" : "There are no Shared Libraries that need update",
"fr" : "", "fr" : "",
@ -1851,7 +1857,7 @@
} }
}, },
"workspace.libraries.no-matches-for" : { "workspace.libraries.no-matches-for" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:117" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:121" ],
"translations" : { "translations" : {
"en" : "No matches found for “%s“", "en" : "No matches found for “%s“",
"fr" : "Aucune correspondance pour “%s“", "fr" : "Aucune correspondance pour “%s“",
@ -1860,7 +1866,7 @@
} }
}, },
"workspace.libraries.no-shared-libraries-available" : { "workspace.libraries.no-shared-libraries-available" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:116" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:120" ],
"translations" : { "translations" : {
"en" : "There are no Shared Libraries available", "en" : "There are no Shared Libraries available",
"fr" : "", "fr" : "",
@ -1869,7 +1875,7 @@
} }
}, },
"workspace.libraries.remove" : { "workspace.libraries.remove" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:87" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:91" ],
"translations" : { "translations" : {
"en" : "Remove", "en" : "Remove",
"fr" : "", "fr" : "",
@ -1878,7 +1884,7 @@
} }
}, },
"workspace.libraries.search-shared-libraries" : { "workspace.libraries.search-shared-libraries" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:94" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:98" ],
"translations" : { "translations" : {
"en" : "Search shared libraries", "en" : "Search shared libraries",
"fr" : "", "fr" : "",
@ -1887,7 +1893,7 @@
} }
}, },
"workspace.libraries.shared-libraries" : { "workspace.libraries.shared-libraries" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:91" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:95" ],
"translations" : { "translations" : {
"en" : "SHARED LIBRARIES", "en" : "SHARED LIBRARIES",
"fr" : "", "fr" : "",
@ -1895,8 +1901,26 @@
"es" : "BIBLIOTECAS COMPARTIDAS" "es" : "BIBLIOTECAS COMPARTIDAS"
} }
}, },
"workspace.libraries.text.multiple-typography" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:264" ],
"translations" : {
"en" : "Multiple typographies"
}
},
"workspace.libraries.text.multiple-typography-tooltip" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:266" ],
"translations" : {
"en" : "Unlink all typographies"
}
},
"workspace.libraries.typography" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:46" ],
"translations" : {
"en" : "%s typographies"
}
},
"workspace.libraries.update" : { "workspace.libraries.update" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:138" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:142" ],
"translations" : { "translations" : {
"en" : "Update", "en" : "Update",
"fr" : "", "fr" : "",
@ -1905,7 +1929,7 @@
} }
}, },
"workspace.libraries.updates" : { "workspace.libraries.updates" : {
"used-in" : [ "src/app/main/ui/workspace/libraries.cljs:175" ], "used-in" : [ "src/app/main/ui/workspace/libraries.cljs:179" ],
"translations" : { "translations" : {
"en" : "UPDATES", "en" : "UPDATES",
"fr" : "", "fr" : "",
@ -2445,7 +2469,7 @@
} }
}, },
"workspace.options.text-options.align-bottom" : { "workspace.options.text-options.align-bottom" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:270" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:118" ],
"translations" : { "translations" : {
"en" : "Align bottom", "en" : "Align bottom",
"fr" : "Aligner en bas", "fr" : "Aligner en bas",
@ -2454,7 +2478,7 @@
} }
}, },
"workspace.options.text-options.align-center" : { "workspace.options.text-options.align-center" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:175" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:71" ],
"translations" : { "translations" : {
"en" : "Align center", "en" : "Align center",
"fr" : "Aligner au centre", "fr" : "Aligner au centre",
@ -2463,7 +2487,7 @@
} }
}, },
"workspace.options.text-options.align-justify" : { "workspace.options.text-options.align-justify" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:185" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:81" ],
"translations" : { "translations" : {
"en" : "Justify", "en" : "Justify",
"fr" : "Justifier", "fr" : "Justifier",
@ -2472,7 +2496,7 @@
} }
}, },
"workspace.options.text-options.align-left" : { "workspace.options.text-options.align-left" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:170" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:66" ],
"translations" : { "translations" : {
"en" : "Align left", "en" : "Align left",
"fr" : "Aligner à gauche", "fr" : "Aligner à gauche",
@ -2481,7 +2505,7 @@
} }
}, },
"workspace.options.text-options.align-middle" : { "workspace.options.text-options.align-middle" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:265" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:113" ],
"translations" : { "translations" : {
"en" : "Align middle", "en" : "Align middle",
"fr" : "Aligner au milieu", "fr" : "Aligner au milieu",
@ -2490,7 +2514,7 @@
} }
}, },
"workspace.options.text-options.align-right" : { "workspace.options.text-options.align-right" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:180" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:76" ],
"translations" : { "translations" : {
"en" : "Align right", "en" : "Align right",
"fr" : "Aligner à droite", "fr" : "Aligner à droite",
@ -2499,7 +2523,7 @@
} }
}, },
"workspace.options.text-options.align-top" : { "workspace.options.text-options.align-top" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:260" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:108" ],
"translations" : { "translations" : {
"en" : "Align top", "en" : "Align top",
"fr" : "Aligner en haut", "fr" : "Aligner en haut",
@ -2508,7 +2532,7 @@
} }
}, },
"workspace.options.text-options.decoration" : { "workspace.options.text-options.decoration" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:306" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:150" ],
"translations" : { "translations" : {
"en" : "Decoration", "en" : "Decoration",
"fr" : "Décoration", "fr" : "Décoration",
@ -2517,25 +2541,25 @@
} }
}, },
"workspace.options.text-options.grow-auto-height" : { "workspace.options.text-options.grow-auto-height" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:287" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:135" ],
"translations" : { "translations" : {
"en" : "Auto height" "en" : "Auto height"
} }
}, },
"workspace.options.text-options.grow-auto-width" : { "workspace.options.text-options.grow-auto-width" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:282" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:130" ],
"translations" : { "translations" : {
"en" : "Auto width" "en" : "Auto width"
} }
}, },
"workspace.options.text-options.grow-fixed" : { "workspace.options.text-options.grow-fixed" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:277" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:125" ],
"translations" : { "translations" : {
"en" : "Fixed" "en" : "Fixed"
} }
}, },
"workspace.options.text-options.letter-spacing" : { "workspace.options.text-options.letter-spacing" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:224" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/typography.cljs:153" ],
"translations" : { "translations" : {
"en" : "Letter Spacing", "en" : "Letter Spacing",
"fr" : "Espacement de caractères", "fr" : "Espacement de caractères",
@ -2544,7 +2568,7 @@
} }
}, },
"workspace.options.text-options.line-height" : { "workspace.options.text-options.line-height" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:211" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/typography.cljs:140" ],
"translations" : { "translations" : {
"en" : "Line height", "en" : "Line height",
"fr" : "Hauteur de ligne", "fr" : "Hauteur de ligne",
@ -2553,7 +2577,7 @@
} }
}, },
"workspace.options.text-options.lowercase" : { "workspace.options.text-options.lowercase" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:353" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/typography.cljs:187" ],
"translations" : { "translations" : {
"en" : "Lowercase", "en" : "Lowercase",
"fr" : "Minuscule", "fr" : "Minuscule",
@ -2562,7 +2586,7 @@
} }
}, },
"workspace.options.text-options.none" : { "workspace.options.text-options.none" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:309", "src/app/main/ui/workspace/sidebar/options/text.cljs:343" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/typography.cljs:177", "src/app/main/ui/workspace/sidebar/options/text.cljs:153" ],
"translations" : { "translations" : {
"en" : "None", "en" : "None",
"fr" : "Aucune", "fr" : "Aucune",
@ -2571,7 +2595,7 @@
} }
}, },
"workspace.options.text-options.strikethrough" : { "workspace.options.text-options.strikethrough" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:321" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:165" ],
"translations" : { "translations" : {
"en" : "Strikethrough", "en" : "Strikethrough",
"fr" : "Barré", "fr" : "Barré",
@ -2580,7 +2604,7 @@
} }
}, },
"workspace.options.text-options.text-case" : { "workspace.options.text-options.text-case" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:340" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/typography.cljs:174" ],
"translations" : { "translations" : {
"en" : "Case", "en" : "Case",
"fr" : "Casse", "fr" : "Casse",
@ -2589,7 +2613,7 @@
} }
}, },
"workspace.options.text-options.title" : { "workspace.options.text-options.title" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:379" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:189" ],
"translations" : { "translations" : {
"en" : "Text", "en" : "Text",
"fr" : "Texte", "fr" : "Texte",
@ -2598,7 +2622,7 @@
} }
}, },
"workspace.options.text-options.title-group" : { "workspace.options.text-options.title-group" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:378" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:188" ],
"translations" : { "translations" : {
"en" : "Group text", "en" : "Group text",
"ru" : "Текст группы", "ru" : "Текст группы",
@ -2606,7 +2630,7 @@
} }
}, },
"workspace.options.text-options.title-selection" : { "workspace.options.text-options.title-selection" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:377" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:187" ],
"translations" : { "translations" : {
"en" : "Selection text", "en" : "Selection text",
"ru" : "Выбранный текст", "ru" : "Выбранный текст",
@ -2614,7 +2638,7 @@
} }
}, },
"workspace.options.text-options.titlecase" : { "workspace.options.text-options.titlecase" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:358" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/typography.cljs:192" ],
"translations" : { "translations" : {
"en" : "Titlecase", "en" : "Titlecase",
"fr" : "Titre", "fr" : "Titre",
@ -2623,7 +2647,7 @@
} }
}, },
"workspace.options.text-options.underline" : { "workspace.options.text-options.underline" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:315" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:159" ],
"translations" : { "translations" : {
"en" : "Underline", "en" : "Underline",
"fr" : "Souligner", "fr" : "Souligner",
@ -2632,7 +2656,7 @@
} }
}, },
"workspace.options.text-options.uppercase" : { "workspace.options.text-options.uppercase" : {
"used-in" : [ "src/app/main/ui/workspace/sidebar/options/text.cljs:348" ], "used-in" : [ "src/app/main/ui/workspace/sidebar/options/typography.cljs:182" ],
"translations" : { "translations" : {
"en" : "Uppercase", "en" : "Uppercase",
"fr" : "Majuscule", "fr" : "Majuscule",
@ -2767,7 +2791,7 @@
} }
}, },
"workspace.updates.dismiss" : { "workspace.updates.dismiss" : {
"used-in" : [ "src/app/main/data/workspace/libraries.cljs:488" ], "used-in" : [ "src/app/main/data/workspace/libraries.cljs:519" ],
"translations" : { "translations" : {
"en" : "Dismiss", "en" : "Dismiss",
"fr" : "", "fr" : "",
@ -2776,7 +2800,7 @@
} }
}, },
"workspace.updates.there-are-updates" : { "workspace.updates.there-are-updates" : {
"used-in" : [ "src/app/main/data/workspace/libraries.cljs:484" ], "used-in" : [ "src/app/main/data/workspace/libraries.cljs:515" ],
"translations" : { "translations" : {
"en" : "There are updates in shared libraries", "en" : "There are updates in shared libraries",
"fr" : "", "fr" : "",
@ -2785,7 +2809,7 @@
} }
}, },
"workspace.updates.update" : { "workspace.updates.update" : {
"used-in" : [ "src/app/main/data/workspace/libraries.cljs:486" ], "used-in" : [ "src/app/main/data/workspace/libraries.cljs:517" ],
"translations" : { "translations" : {
"en" : "Update", "en" : "Update",
"fr" : "", "fr" : "",
@ -2803,6 +2827,12 @@
} }
}, },
"workspace.assets.typography": "Typographies", "workspace.assets.typography.sample": "Ag",
"workspace.libraries.typography": "%s typographies" "workspace.assets.typography.font-id": "Font",
"workspace.assets.typography.font-size": "Size",
"workspace.assets.typography.font-variant-id": "Variant",
"workspace.assets.typography.line-height": "Line Height",
"workspace.assets.typography.letter-spacing": "Letter Spacing",
"workspace.assets.typography.text-transform": "Text Transform",
"workspace.assets.typography.go-to-edit": "Go to style library file to edit"
} }

View file

@ -73,10 +73,9 @@
(s/def ::layout-flags (s/coll-of ::layout-flag)) (s/def ::layout-flags (s/coll-of ::layout-flag))
(def default-layout (def default-layout
#{;; :sitemap #{:sitemap
;; :sitemap-pages :sitemap-pages
;; :layers :layers
:assets
:element-options :element-options
:rules :rules
:display-grid :display-grid

View file

@ -520,19 +520,6 @@
:callback do-dismiss}] :callback do-dismiss}]
:sync-dialog)))))) :sync-dialog))))))
(def default-typography
{:name "Source Sans Pro Regular"
:font-id "sourcesanspro"
:font-family "sourcesanspro"
:font-variant-id "regular"
:font-size "14"
:font-weight "400"
:font-style "normal"
:line-height "1.2"
:letter-spacing "0"
:text-transform "none"})
(defn add-typography (defn add-typography
[typography] [typography]
(let [typography (update typography :id #(or % (uuid/next)))] (let [typography (update typography :id #(or % (uuid/next)))]

View file

@ -19,7 +19,8 @@
[app.common.geom.shapes :as geom] [app.common.geom.shapes :as geom]
[app.main.data.workspace.common :as dwc] [app.main.data.workspace.common :as dwc]
[app.main.fonts :as fonts] [app.main.fonts :as fonts]
[app.util.object :as obj])) [app.util.object :as obj]
[app.util.text :as ut]))
(defn create-editor (defn create-editor
[] []
@ -117,26 +118,12 @@
(->> (tree-seq map? :children node) (->> (tree-seq map? :children node)
(filter match?))) (filter match?)))
(defonce default-text-attrs
{:name "Source Sans Pro Regular"
:font-id "sourcesanspro"
:font-family "sourcesanspro"
:font-variant-id "regular"
:font-size "14"
:font-weight "400"
:font-style "normal"
:line-height "1.2"
:letter-spacing "0"
:text-transform "none"
:text-align "left"
:text-decoration "none"})
(defn- shape-current-values (defn- shape-current-values
[shape pred attrs] [shape pred attrs]
(let [root (:content shape) (let [root (:content shape)
nodes (->> (nodes-seq pred root) nodes (->> (nodes-seq pred root)
(map #(if (is-text-node? %) (map #(if (is-text-node? %)
(merge default-text-attrs %) (merge ut/default-text-attrs %)
%)))] %)))]
(geom/get-attrs-multi nodes attrs))) (geom/get-attrs-multi nodes attrs)))

View file

@ -21,8 +21,6 @@
[clojure.set :as set] [clojure.set :as set]
[app.util.object :as obj])) [app.util.object :as obj]))
(defonce default-font "sourcesanspro")
(def google-fonts (def google-fonts
(preload-gfonts "fonts/gfonts.2020.04.23.json")) (preload-gfonts "fonts/gfonts.2020.04.23.json"))

View file

@ -16,7 +16,8 @@
[app.common.data :as d] [app.common.data :as d]
[app.common.geom.shapes :as geom] [app.common.geom.shapes :as geom]
[app.common.geom.matrix :as gmt] [app.common.geom.matrix :as gmt]
[app.util.object :as obj])) [app.util.object :as obj]
[app.util.text :as ut]))
;; --- Text Editor Rendering ;; --- Text Editor Rendering
@ -54,7 +55,7 @@
text-transform (obj/get data "text-transform") text-transform (obj/get data "text-transform")
line-height (obj/get data "line-height") line-height (obj/get data "line-height")
font-id (obj/get data "font-id" fonts/default-font) font-id (obj/get data "font-id" (:font-id ut/default-text-attrs))
font-variant-id (obj/get data "font-variant-id") font-variant-id (obj/get data "font-variant-id")
font-family (obj/get data "font-family") font-family (obj/get data "font-family")
@ -149,7 +150,7 @@
(fn [] (fn []
(when (and embed-resources? (= type "root")) (when (and embed-resources? (= type "root"))
(let [font-to-embed (get-all-fonts node) (let [font-to-embed (get-all-fonts node)
font-to-embed (if (empty? font-to-embed) #{{:font-id fonts/default-font}} font-to-embed) font-to-embed (if (empty? font-to-embed) #{ut/default-text-attrs} font-to-embed)
embeded (map embed-font font-to-embed)] embeded (map embed-font font-to-embed)]
(-> (p/all embeded) (-> (p/all embeded)
(p/then (fn [result] (reset! embeded-fonts (str/join "\n" result))))))))) (p/then (fn [result] (reset! embeded-fonts (str/join "\n" result)))))))))

View file

@ -28,6 +28,7 @@
[app.main.fonts :as fonts] [app.main.fonts :as fonts]
[app.util.color :as color] [app.util.color :as color]
[app.util.dom :as dom] [app.util.dom :as dom]
[app.util.text :as ut]
[app.common.geom.shapes :as geom] [app.common.geom.shapes :as geom]
[app.util.object :as obj] [app.util.object :as obj]
[app.util.timers :as timers] [app.util.timers :as timers]
@ -135,7 +136,7 @@
text-transform (obj/get data "text-transform") text-transform (obj/get data "text-transform")
line-height (obj/get data "line-height") line-height (obj/get data "line-height")
font-id (obj/get data "font-id" fonts/default-font) font-id (obj/get data "font-id" (:font-id ut/default-text-attrs))
font-variant-id (obj/get data "font-variant-id") font-variant-id (obj/get data "font-variant-id")
font-family (obj/get data "font-family") font-family (obj/get data "font-family")
@ -296,9 +297,9 @@
self (mf/ref-val self-ref) self (mf/ref-val self-ref)
target (dom/get-target event) target (dom/get-target event)
selecting? (mf/ref-val selecting-ref)] selecting? (mf/ref-val selecting-ref)]
(when-not (or (.contains sidebar target) (when-not (or (and sidebar (.contains sidebar target))
(.contains assets target) (and assets (.contains assets target))
(.contains self target) (and self (.contains self target))
(and cpicker (.contains cpicker target))) (and cpicker (.contains cpicker target)))
(if selecting? (if selecting?
(mf/set-ref-val! selecting-ref false) (mf/set-ref-val! selecting-ref false)

View file

@ -38,6 +38,7 @@
[app.util.i18n :as i18n :refer [tr t]] [app.util.i18n :as i18n :refer [tr t]]
[app.util.router :as rt] [app.util.router :as rt]
[app.util.timers :as timers] [app.util.timers :as timers]
[app.util.text :as ut]
[cuerdas.core :as str] [cuerdas.core :as str]
[okulary.core :as l] [okulary.core :as l]
[rumext.alpha :as mf])) [rumext.alpha :as mf]))
@ -330,7 +331,7 @@
:locale locale}])])])) :locale locale}])])]))
(mf/defc typography-box (mf/defc typography-box
[{:keys [file-id local? typographies locale open? on-open on-close] :as props}] [{:keys [file file-id local? typographies locale open? on-open on-close] :as props}]
(let [state (mf/use-state {:detail-open? false (let [state (mf/use-state {:detail-open? false
:menu-open? false :menu-open? false
@ -344,7 +345,7 @@
(mf/use-callback (mf/use-callback
(mf/deps file-id) (mf/deps file-id)
(fn [value opacity] (fn [value opacity]
(st/emit! (dwl/add-typography dwl/default-typography)))) (st/emit! (dwl/add-typography ut/default-typography))))
handle-change handle-change
(mf/use-callback (mf/use-callback
@ -402,7 +403,7 @@
[:div.asset-group [:div.asset-group
[:div.group-title {:class (when (not open?) "closed")} [:div.group-title {:class (when (not open?) "closed")}
[:span {:on-click #(if open? (on-close) (on-open))} i/arrow-slide "Typography" #_(t locale "workspace.assets.typography")] [:span {:on-click #(if open? (on-close) (on-open))} i/arrow-slide (t locale "workspace.assets.typography")]
[:span.num-assets (str "\u00A0(") (count typographies) ")"] ;; Unicode 00A0 is non-breaking space [:span.num-assets (str "\u00A0(") (count typographies) ")"] ;; Unicode 00A0 is non-breaking space
(when local? (when local?
[:div.group-button {:on-click add-typography} i/plus])] [:div.group-button {:on-click add-typography} i/plus])]
@ -422,6 +423,7 @@
[:& typography-entry [:& typography-entry
{:key (:id typography) {:key (:id typography)
:typography typography :typography typography
:file file
:read-only? (not local?) :read-only? (not local?)
:on-context-menu #(on-context-menu (:id typography) %) :on-context-menu #(on-context-menu (:id typography) %)
:on-change #(handle-change typography %) :on-change #(handle-change typography %)
@ -563,7 +565,8 @@
:on-close #(swap! toggles disj :colors)}]) :on-close #(swap! toggles disj :colors)}])
(when show-typography? (when show-typography?
[:& typography-box {:file-id (:id file) [:& typography-box {:file file
:file-id (:id file)
:local? local? :local? local?
:locale locale :locale locale
:typographies typographies :typographies typographies

View file

@ -28,6 +28,7 @@
[app.util.dom :as dom] [app.util.dom :as dom]
[app.main.fonts :as fonts] [app.main.fonts :as fonts]
[app.util.i18n :as i18n :refer [tr t]] [app.util.i18n :as i18n :refer [tr t]]
[app.util.text :as ut]
["slate" :refer [Transforms]])) ["slate" :refer [Transforms]]))
(def text-typography-attrs [:typography-ref-id :typography-ref-file]) (def text-typography-attrs [:typography-ref-id :typography-ref-file])
@ -223,7 +224,7 @@
(d/concat text-font-attrs (d/concat text-font-attrs
text-spacing-attrs text-spacing-attrs
text-transform-attrs))) text-transform-attrs)))
typography (merge dwl/default-typography setted-values) typography (merge ut/default-typography setted-values)
typography (generate-typography-name typography)] typography (generate-typography-name typography)]
(let [id (uuid/next)] (let [id (uuid/next)]
(st/emit! (dwl/add-typography (assoc typography :id id))) (st/emit! (dwl/add-typography (assoc typography :id id)))
@ -255,14 +256,16 @@
(cond (cond
typography typography
[:& typography-entry {:typography typography [:& typography-entry {:typography typography
:read-only? (some? (:typography-ref-file values))
:file (get shared-libs (:typography-ref-file values))
:on-deattach handle-deattach-typography :on-deattach handle-deattach-typography
:on-change handle-change-typography}] :on-change handle-change-typography}]
(= (:typography-ref-id values) :multiple) (= (:typography-ref-id values) :multiple)
[:div.multiple-typography [:div.multiple-typography
[:div.multiple-typography-text "Multiple typographies"] [:div.multiple-typography-text (t locale "workspace.libraries.text.multiple-typography")]
[:div.multiple-typography-button {:on-click handle-deattach-typography [:div.multiple-typography-button {:on-click handle-deattach-typography
:title "Unlink all typographies"} i/unchain]] :title (t locale "workspace.libraries.text.multiple-typography-tooltip")} i/unchain]]
:else :else
[:> typography-options opts]) [:> typography-options opts])

View file

@ -20,8 +20,10 @@
[app.main.ui.workspace.sidebar.options.common :refer [advanced-options]] [app.main.ui.workspace.sidebar.options.common :refer [advanced-options]]
[app.main.fonts :as fonts] [app.main.fonts :as fonts]
[app.util.dom :as dom] [app.util.dom :as dom]
[app.util.text :as ut]
[app.util.timers :as ts] [app.util.timers :as ts]
[app.util.i18n :as i18n :refer [t]])) [app.util.i18n :as i18n :refer [t]]
[app.util.router :as rt]))
(defn- attr->string [value] (defn- attr->string [value]
(if (= value :multiple) (if (= value :multiple)
@ -49,9 +51,9 @@
font-size font-size
font-variant-id]} values font-variant-id]} values
font-id (or font-id "sourcesanspro") font-id (or font-id (:font-id ut/default-text-attrs))
font-size (or font-size "14") font-size (or font-size (:font-size ut/default-text-attrs))
font-variant-id (or font-variant-id "regular") font-variant-id (or font-variant-id (:font-variant-id ut/default-text-attrs))
fonts (mf/deref fonts/fontsdb) fonts (mf/deref fonts/fontsdb)
font (get fonts font-id) font (get fonts font-id)
@ -209,11 +211,21 @@
(mf/defc typography-entry (mf/defc typography-entry
[{:keys [typography read-only? on-select on-change on-deattach on-context-menu editting? focus-name?]}] [{:keys [typography read-only? on-select on-change on-deattach on-context-menu editting? focus-name? file]}]
(let [open? (mf/use-state editting?) (let [locale (mf/deref i18n/locale)
open? (mf/use-state editting?)
selected (mf/deref refs/selected-shapes) selected (mf/deref refs/selected-shapes)
hover-deattach (mf/use-state false) hover-deattach (mf/use-state false)
name-input-ref (mf/use-ref nil)] name-input-ref (mf/use-ref nil)
#_(rt/resolve router :workspace
{:project-id (:project-id file)
:file-id (:id file)}
{:page-id (get-in file [:data :pages 0])})
handle-go-to-edit
(fn [] (st/emit! (rt/nav :workspace {:project-id (:project-id file)
:file-id (:id file)}
{:page-id (get-in file [:data :pages 0])})))]
(mf/use-effect (mf/use-effect
(mf/deps editting?) (mf/deps editting?)
@ -240,7 +252,7 @@
{:style {:font-family (:font-family typography) {:style {:font-family (:font-family typography)
:font-weight (:font-weight typography) :font-weight (:font-weight typography)
:font-style (:font-style typography)}} :font-style (:font-style typography)}}
"Ag"] (t locale "workspace.assets.typography.sample")]
[:div.typography-name (:name typography)]] [:div.typography-name (:name typography)]]
[:div.element-set-actions [:div.element-set-actions
(when on-deattach (when on-deattach
@ -262,27 +274,32 @@
[:spang (:name typography)]] [:spang (:name typography)]]
[:div.row-flex [:div.row-flex
[:span.label "Font"] [:span.label (t locale "workspace.assets.typography.font-id")]
[:span (:font-id typography)]] [:span (:font-id typography)]]
[:div.row-flex [:div.row-flex
[:span.label "Size"] [:span.label (t locale "workspace.assets.typography.font-variant-id")]
[:span (:font-variant-id typography)]]
[:div.row-flex
[:span.label (t locale "workspace.assets.typography.font-size")]
[:span (:font-size typography)]] [:span (:font-size typography)]]
[:div.row-flex [:div.row-flex
[:span.label "Line Height"] [:span.label (t locale "workspace.assets.typography.line-height")]
[:span (:line-height typography)]] [:span (:line-height typography)]]
[:div.row-flex [:div.row-flex
[:span.label "Letter spacing"] [:span.label (t locale "workspace.assets.typography.letter-spacing")]
[:span (:letter-spacing typography)]] [:span (:letter-spacing typography)]]
[:div.row-flex [:div.row-flex
[:span.label "Text transform"] [:span.label (t locale "workspace.assets.typography.text-transform")]
[:span (:text-transform typography)]] [:span (:text-transform typography)]]
[:div.go-to-lib-button [:div.go-to-lib-button
"Go to style library file to edit"]] {:on-click handle-go-to-edit}
(t locale "workspace.assets.typography.go-to-edit")]]
[:* [:*
[:div.element-set-content [:div.element-set-content

View file

@ -1,5 +1,34 @@
(ns app.util.text) (ns app.util.text)
(defonce default-text-attrs
{:font-id "sourcesanspro"
:font-family "sourcesanspro"
:font-variant-id "regular"
:font-size "14"
:font-weight "400"
:font-style "normal"
:line-height "1.2"
:letter-spacing "0"
:text-transform "none"
:text-align "left"
:text-decoration "none"})
(def typography-fields
[:font-id
:font-family
:font-variant-id
:font-size
:font-weight
:font-style
:line-height
:letter-spacing
:text-transform])
(def default-typography
(merge
{:name "Source Sans Pro Regular"}
(select-keys default-text-attrs typography-fields)))
(defn some-node (defn some-node
[predicate node] [predicate node]
(or (predicate node) (or (predicate node)