From 6bf68e575d5eb5155879d68f8d588bd98109c995 Mon Sep 17 00:00:00 2001 From: Timo Dittmann Date: Tue, 8 Dec 2020 10:37:48 +0100 Subject: [PATCH 1/8] Enhancement: Add text anchor to texts --- badges/coverage-badge.svg | 2 +- badges/tests-badge.svg | 2 +- .../ui/__snapshots__/scenario.js.snap | 408 ++++++++++++++++++ cypress/integration/ui/scenario.js | 18 + src/editor/index.html | 5 +- src/editor/locale.js | 4 + src/editor/locale/lang.af.js | 5 +- src/editor/locale/lang.ar.js | 5 +- src/editor/locale/lang.az.js | 5 +- src/editor/locale/lang.be.js | 5 +- src/editor/locale/lang.bg.js | 5 +- src/editor/locale/lang.ca.js | 5 +- src/editor/locale/lang.cs.js | 5 +- src/editor/locale/lang.cy.js | 5 +- src/editor/locale/lang.da.js | 5 +- src/editor/locale/lang.de.js | 5 +- src/editor/locale/lang.el.js | 5 +- src/editor/locale/lang.en.js | 5 +- src/editor/locale/lang.es.js | 5 +- src/editor/locale/lang.et.js | 5 +- src/editor/locale/lang.fa.js | 5 +- src/editor/locale/lang.fi.js | 5 +- src/editor/locale/lang.fr.js | 5 +- src/editor/locale/lang.fy.js | 5 +- src/editor/locale/lang.ga.js | 5 +- src/editor/locale/lang.gl.js | 5 +- src/editor/locale/lang.he.js | 5 +- src/editor/locale/lang.hi.js | 5 +- src/editor/locale/lang.hr.js | 5 +- src/editor/locale/lang.hu.js | 5 +- src/editor/locale/lang.hy.js | 5 +- src/editor/locale/lang.id.js | 5 +- src/editor/locale/lang.is.js | 5 +- src/editor/locale/lang.it.js | 5 +- src/editor/locale/lang.ja.js | 5 +- src/editor/locale/lang.ko.js | 5 +- src/editor/locale/lang.lt.js | 5 +- src/editor/locale/lang.lv.js | 5 +- src/editor/locale/lang.mk.js | 5 +- src/editor/locale/lang.ms.js | 5 +- src/editor/locale/lang.mt.js | 5 +- src/editor/locale/lang.nl.js | 5 +- src/editor/locale/lang.no.js | 5 +- src/editor/locale/lang.pl.js | 5 +- src/editor/locale/lang.pt-BR.js | 5 +- src/editor/locale/lang.pt-PT.js | 5 +- src/editor/locale/lang.ro.js | 5 +- src/editor/locale/lang.ru.js | 5 +- src/editor/locale/lang.sk.js | 5 +- src/editor/locale/lang.sl.js | 5 +- src/editor/locale/lang.sq.js | 5 +- src/editor/locale/lang.sr.js | 5 +- src/editor/locale/lang.sv.js | 5 +- src/editor/locale/lang.sw.js | 5 +- src/editor/locale/lang.test.js | 5 +- src/editor/locale/lang.th.js | 5 +- src/editor/locale/lang.tl.js | 5 +- src/editor/locale/lang.tr.js | 5 +- src/editor/locale/lang.uk.js | 5 +- src/editor/locale/lang.vi.js | 5 +- src/editor/locale/lang.yi.js | 5 +- src/editor/locale/lang.zh-CN.js | 5 +- src/editor/locale/lang.zh-HK.js | 5 +- src/editor/locale/lang.zh-TW.js | 5 +- src/editor/svgedit.js | 39 +- src/svgcanvas/elem-get-set.js | 19 + src/svgcanvas/svgcanvas.js | 10 +- 67 files changed, 732 insertions(+), 65 deletions(-) diff --git a/badges/coverage-badge.svg b/badges/coverage-badge.svg index c537428e..f106edca 100644 --- a/badges/coverage-badge.svg +++ b/badges/coverage-badge.svg @@ -1 +1 @@ -Statements 52.79%Statements 52.79%Branches 41.6%Branches 41.6%Lines 53.61%Lines 53.61%Functions 60.18%Functions 60.18% +Statements 52.98%Statements 52.98%Branches 41.61%Branches 41.61%Lines 53.81%Lines 53.81%Functions 60.33%Functions 60.33% diff --git a/badges/tests-badge.svg b/badges/tests-badge.svg index 61b3e08c..96979660 100644 --- a/badges/tests-badge.svg +++ b/badges/tests-badge.svg @@ -1 +1 @@ -TestsTests141/141141/141 \ No newline at end of file +TestsTests143/144143/144 \ No newline at end of file diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index 3636cb70..99c631c3 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -649,3 +649,411 @@ exports[`use various parts of svg-edit > check tool_polygon #0`] = ` `; + +exports[`use various parts of svg-edit > check tool_text_anchor_start #0`] = ` + + + Layer 1 + + + B + + + B + + + + + + + + +`; + +exports[`use various parts of svg-edit > check tool_text_anchor_middle #0`] = ` + + + Layer 1 + + + B + + + B + + + + + + + + + +`; + +exports[`use various parts of svg-edit > check tool_text_anchor_end #0`] = ` + + + Layer 1 + + + B + + + B + + + + + + + + + + +`; diff --git a/cypress/integration/ui/scenario.js b/cypress/integration/ui/scenario.js index 1d31b3b6..bdd23209 100644 --- a/cypress/integration/ui/scenario.js +++ b/cypress/integration/ui/scenario.js @@ -88,4 +88,22 @@ describe('use various parts of svg-edit', function () { .trigger('mouseup', {force: true}); cy.get('#svgcontent').toMatchSnapshot(); }); + it('check tool_text_anchor_start', function () { + cy.get('#svg_1').click({force: true}); + cy.get('#tool_text_anchor_start') + .click({force: true}); + testSnapshot(); + }); + it('check tool_text_anchor_middle', function () { + cy.get('#svg_1').click({force: true}); + cy.get('#tool_text_anchor_middle') + .click({force: true}); + testSnapshot(); + }); + it('check tool_text_anchor_end', function () { + cy.get('#svg_1').click({force: true}); + cy.get('#tool_text_anchor_end') + .click({force: true}); + testSnapshot(); + }); }); diff --git a/src/editor/index.html b/src/editor/index.html index 880af11c..1d71bd16 100644 --- a/src/editor/index.html +++ b/src/editor/index.html @@ -309,6 +309,9 @@
+
+
+
B
i
@@ -729,4 +732,4 @@
- \ No newline at end of file + diff --git a/src/editor/locale.js b/src/editor/locale.js index a2c5f315..fec615c1 100644 --- a/src/editor/locale.js +++ b/src/editor/locale.js @@ -288,6 +288,9 @@ export const readLang = function (langData) { tool_angle: properties.angle, tool_blur: properties.blur, tool_bold: properties.bold, + tool_text_anchor_start: properties.text_anchor_start, + tool_text_anchor_middle: properties.text_anchor_middle, + tool_text_anchor_end: properties.text_anchor_end, tool_circle: tools.mode_circle, tool_clone: tools.clone, tool_clone_multi: tools.clone, @@ -303,6 +306,7 @@ export const readLang = function (langData) { tool_link_url: tools.set_link_url, tool_image: tools.mode_image, tool_italic: properties.italic, + tool_line: tools.mode_line, tool_move_bottom: tools.move_bottom, tool_move_top: tools.move_top, diff --git a/src/editor/locale/lang.af.js b/src/editor/locale/lang.af.js index 0cada5d5..0eb3455b 100644 --- a/src/editor/locale/lang.af.js +++ b/src/editor/locale/lang.af.js @@ -70,7 +70,10 @@ export default { font_family: 'Lettertipe verander Familie', font_size: 'Verandering Lettertipe Grootte', bold: 'Vetgedrukte teks', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ar.js b/src/editor/locale/lang.ar.js index 20430852..9a709f34 100644 --- a/src/editor/locale/lang.ar.js +++ b/src/editor/locale/lang.ar.js @@ -70,7 +70,10 @@ export default { font_family: 'تغيير الخط الأسرة', font_size: 'تغيير حجم الخط', bold: 'نص جريء', - italic: 'مائل نص' + italic: 'مائل نص', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.az.js b/src/editor/locale/lang.az.js index c13c47c4..bd386a94 100644 --- a/src/editor/locale/lang.az.js +++ b/src/editor/locale/lang.az.js @@ -70,7 +70,10 @@ export default { font_family: 'Change Font Family', font_size: 'Change Font Size', bold: 'Bold Text', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.be.js b/src/editor/locale/lang.be.js index 79976cb8..8f304e69 100644 --- a/src/editor/locale/lang.be.js +++ b/src/editor/locale/lang.be.js @@ -70,7 +70,10 @@ export default { font_family: 'Змены Сямейства шрыфтоў', font_size: 'Змяніць памер шрыфта', bold: 'Тоўсты тэкст', - italic: 'Нахілены тэкст' + italic: 'Нахілены тэкст', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.bg.js b/src/editor/locale/lang.bg.js index dbf62f8b..c6df7435 100644 --- a/src/editor/locale/lang.bg.js +++ b/src/editor/locale/lang.bg.js @@ -70,7 +70,10 @@ export default { font_family: 'Промяна на шрифта Семейство', font_size: 'Промени размера на буквите', bold: 'Получер текст', - italic: 'Курсив текст' + italic: 'Курсив текст', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ca.js b/src/editor/locale/lang.ca.js index 41102438..ea16f58e 100644 --- a/src/editor/locale/lang.ca.js +++ b/src/editor/locale/lang.ca.js @@ -70,7 +70,10 @@ export default { font_family: 'Canviar la font Família', font_size: 'Change Font Size', bold: 'Text en negreta', - italic: 'Text en cursiva' + italic: 'Text en cursiva', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.cs.js b/src/editor/locale/lang.cs.js index 13a89596..1dd2c4bc 100644 --- a/src/editor/locale/lang.cs.js +++ b/src/editor/locale/lang.cs.js @@ -70,7 +70,10 @@ export default { font_family: 'Změnit font', font_size: 'Změnit velikost písma', bold: 'Tučně', - italic: 'Kurzíva' + italic: 'Kurzíva', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Hlavní menu', diff --git a/src/editor/locale/lang.cy.js b/src/editor/locale/lang.cy.js index 281b258f..fd1da0ae 100644 --- a/src/editor/locale/lang.cy.js +++ b/src/editor/locale/lang.cy.js @@ -70,7 +70,10 @@ export default { font_family: 'Newid Font Teulu', font_size: 'Newid Maint Ffont', bold: 'Testun Bras', - italic: 'Italig Testun' + italic: 'Italig Testun', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.da.js b/src/editor/locale/lang.da.js index 69a0ac79..7f1665bb 100644 --- a/src/editor/locale/lang.da.js +++ b/src/editor/locale/lang.da.js @@ -70,7 +70,10 @@ export default { font_family: 'Skift Font Family', font_size: 'Skift skriftstørrelse', bold: 'Fed tekst', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.de.js b/src/editor/locale/lang.de.js index 867e3fc9..71536806 100644 --- a/src/editor/locale/lang.de.js +++ b/src/editor/locale/lang.de.js @@ -70,7 +70,10 @@ export default { font_family: 'Schriftart wählen', font_size: 'Schriftgröße einstellen', bold: 'Fetter Text', - italic: 'Kursiver Text' + italic: 'Kursiver Text', + text_anchor_start: 'Den Text linksbündig ausrichten', + text_anchor_middle: 'Den Text zentriert ausrichten', + text_anchor_end: 'Den Text rechtsbündig ausrichten' }, tools: { main_menu: 'Hauptmenü', diff --git a/src/editor/locale/lang.el.js b/src/editor/locale/lang.el.js index 72a37906..e00df94f 100644 --- a/src/editor/locale/lang.el.js +++ b/src/editor/locale/lang.el.js @@ -70,7 +70,10 @@ export default { font_family: 'Αλλαγή γραμματοσειράς Οικογένεια', font_size: 'Αλλαγή μεγέθους γραμματοσειράς', bold: 'Bold Text', - italic: 'Πλάγιους' + italic: 'Πλάγιους', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.en.js b/src/editor/locale/lang.en.js index f91f7639..370f1389 100644 --- a/src/editor/locale/lang.en.js +++ b/src/editor/locale/lang.en.js @@ -70,7 +70,10 @@ export default { font_family: 'Change Font Family', font_size: 'Change Font Size', bold: 'Bold Text [B]', - italic: 'Italic Text [I]' + italic: 'Italic Text [I]', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.es.js b/src/editor/locale/lang.es.js index a25916dd..f246949f 100644 --- a/src/editor/locale/lang.es.js +++ b/src/editor/locale/lang.es.js @@ -70,7 +70,10 @@ export default { font_family: 'Tipo de fuente', font_size: 'Tamaño de la fuente', bold: 'Texto en negrita', - italic: 'Texto en cursiva' + italic: 'Texto en cursiva', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Menú principal', diff --git a/src/editor/locale/lang.et.js b/src/editor/locale/lang.et.js index 3fe11c54..d277957a 100644 --- a/src/editor/locale/lang.et.js +++ b/src/editor/locale/lang.et.js @@ -70,7 +70,10 @@ export default { font_family: 'Muutke Kirjasinperhe', font_size: 'Change font size', bold: 'Rasvane kiri', - italic: 'Kursiiv' + italic: 'Kursiiv', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.fa.js b/src/editor/locale/lang.fa.js index a541c2f8..90da7e18 100644 --- a/src/editor/locale/lang.fa.js +++ b/src/editor/locale/lang.fa.js @@ -70,7 +70,10 @@ export default { font_family: '‫تغییر خانواده قلم‬', font_size: '‫تغییر اندازه قلم‬', bold: '‫متن توپر ‬', - italic: '‫متن کج ‬' + italic: '‫متن کج ‬', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.fi.js b/src/editor/locale/lang.fi.js index 1632b803..f8cd3ddc 100644 --- a/src/editor/locale/lang.fi.js +++ b/src/editor/locale/lang.fi.js @@ -70,7 +70,10 @@ export default { font_family: 'Muuta Font Family', font_size: 'Muuta fontin kokoa', bold: 'Lihavoitu teksti', - italic: 'Kursivoitu' + italic: 'Kursivoitu', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.fr.js b/src/editor/locale/lang.fr.js index 776bd8fc..89c430cb 100644 --- a/src/editor/locale/lang.fr.js +++ b/src/editor/locale/lang.fr.js @@ -70,7 +70,10 @@ export default { font_family: 'Changer la famille de police', font_size: 'Changer la taille de la police', bold: 'Texte en gras', - italic: 'Texte en italique' + italic: 'Texte en italique', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Menu principal', diff --git a/src/editor/locale/lang.fy.js b/src/editor/locale/lang.fy.js index fbae581f..bb3de49e 100644 --- a/src/editor/locale/lang.fy.js +++ b/src/editor/locale/lang.fy.js @@ -70,7 +70,10 @@ export default { font_family: 'Lettertype oanpasse', font_size: 'Lettergrutte oanpasse', bold: 'Fet', - italic: 'Skean' + italic: 'Skean', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ga.js b/src/editor/locale/lang.ga.js index 7c814bdb..5cffbbcd 100644 --- a/src/editor/locale/lang.ga.js +++ b/src/editor/locale/lang.ga.js @@ -70,7 +70,10 @@ export default { font_family: 'Athraigh an Cló Teaghlaigh', font_size: 'Athraigh Clómhéid', bold: 'Trom Téacs', - italic: 'Iodálach Téacs' + italic: 'Iodálach Téacs', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.gl.js b/src/editor/locale/lang.gl.js index e50b98c6..6c3355ca 100644 --- a/src/editor/locale/lang.gl.js +++ b/src/editor/locale/lang.gl.js @@ -70,7 +70,10 @@ export default { font_family: 'Cambiar fonte Familia', font_size: 'Mudar tamaño de letra', bold: 'Bold Text', - italic: 'Texto en cursiva' + italic: 'Texto en cursiva', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.he.js b/src/editor/locale/lang.he.js index 5c8c5eed..2f6a7d3f 100755 --- a/src/editor/locale/lang.he.js +++ b/src/editor/locale/lang.he.js @@ -70,7 +70,10 @@ export default { font_family: 'שינוי גופן משפחה', font_size: 'שנה גודל גופן', bold: 'טקסט מודגש', - italic: 'טקסט נטוי' + italic: 'טקסט נטוי', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.hi.js b/src/editor/locale/lang.hi.js index ef5da6a0..2692a7e8 100644 --- a/src/editor/locale/lang.hi.js +++ b/src/editor/locale/lang.hi.js @@ -70,7 +70,10 @@ export default { font_family: 'बदलें फ़ॉन्ट परिवार', font_size: 'फ़ॉन्ट का आकार बदलें', bold: 'मोटा पाठ', - italic: 'इटैलिक पाठ' + italic: 'इटैलिक पाठ', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.hr.js b/src/editor/locale/lang.hr.js index 6df24a24..b81450cc 100644 --- a/src/editor/locale/lang.hr.js +++ b/src/editor/locale/lang.hr.js @@ -70,7 +70,10 @@ export default { font_family: 'Promjena fontova', font_size: 'Change font size', bold: 'Podebljani tekst', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.hu.js b/src/editor/locale/lang.hu.js index 5d022e37..7ac0fe41 100644 --- a/src/editor/locale/lang.hu.js +++ b/src/editor/locale/lang.hu.js @@ -70,7 +70,10 @@ export default { font_family: 'Change Betűcsalád', font_size: 'Change font size', bold: 'Félkövér szöveg', - italic: 'Dőlt szöveg' + italic: 'Dőlt szöveg', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.hy.js b/src/editor/locale/lang.hy.js index 08d6ddf3..3756d9cd 100644 --- a/src/editor/locale/lang.hy.js +++ b/src/editor/locale/lang.hy.js @@ -70,7 +70,10 @@ export default { font_family: 'Change Font Family', font_size: 'Change Font Size', bold: 'Bold Text', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.id.js b/src/editor/locale/lang.id.js index 5d6d1064..d3fef943 100644 --- a/src/editor/locale/lang.id.js +++ b/src/editor/locale/lang.id.js @@ -70,7 +70,10 @@ export default { font_family: 'Ubah Font Keluarga', font_size: 'Ubah Ukuran Font', bold: 'Bold Teks', - italic: 'Italic Teks' + italic: 'Italic Teks', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.is.js b/src/editor/locale/lang.is.js index d659ea1c..f20a5739 100644 --- a/src/editor/locale/lang.is.js +++ b/src/editor/locale/lang.is.js @@ -70,7 +70,10 @@ export default { font_family: 'Change Leturfjölskylda', font_size: 'Breyta leturstærð', bold: 'Bold Text', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.it.js b/src/editor/locale/lang.it.js index baca8758..e6372ee9 100644 --- a/src/editor/locale/lang.it.js +++ b/src/editor/locale/lang.it.js @@ -70,7 +70,10 @@ export default { font_family: 'Cambia il tipo di Font', font_size: 'Modifica dimensione carattere', bold: 'Grassetto', - italic: 'Corsivo' + italic: 'Corsivo', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Menù principale', diff --git a/src/editor/locale/lang.ja.js b/src/editor/locale/lang.ja.js index da9bbb56..dd4f7b75 100644 --- a/src/editor/locale/lang.ja.js +++ b/src/editor/locale/lang.ja.js @@ -70,7 +70,10 @@ export default { font_family: 'フォントファミリーの変更', font_size: '文字サイズの変更', bold: '太字', - italic: 'イタリック体' + italic: 'イタリック体', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ko.js b/src/editor/locale/lang.ko.js index 8239ecd9..cc9f1b2b 100644 --- a/src/editor/locale/lang.ko.js +++ b/src/editor/locale/lang.ko.js @@ -70,7 +70,10 @@ export default { font_family: '글꼴 변경 패밀리', font_size: '글꼴 크기 변경', bold: '굵은 텍스트', - italic: '기울임꼴 텍스트' + italic: '기울임꼴 텍스트', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.lt.js b/src/editor/locale/lang.lt.js index 4ff30991..67ac3cdb 100644 --- a/src/editor/locale/lang.lt.js +++ b/src/editor/locale/lang.lt.js @@ -70,7 +70,10 @@ export default { font_family: 'Pakeistišriftą Šeima', font_size: 'Change font size', bold: 'Pusjuodis', - italic: 'Kursyvas' + italic: 'Kursyvas', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.lv.js b/src/editor/locale/lang.lv.js index f1b3bc66..4b0dadf0 100644 --- a/src/editor/locale/lang.lv.js +++ b/src/editor/locale/lang.lv.js @@ -70,7 +70,10 @@ export default { font_family: 'Mainīt fonta Family', font_size: 'Mainīt fonta izmēru', bold: 'Bold Text', - italic: 'Kursīvs' + italic: 'Kursīvs', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.mk.js b/src/editor/locale/lang.mk.js index 2bc615aa..e29acee7 100644 --- a/src/editor/locale/lang.mk.js +++ b/src/editor/locale/lang.mk.js @@ -70,7 +70,10 @@ export default { font_family: 'Смени фонт Фамилија', font_size: 'Изменифонт Големина', bold: 'Задебелен текст', - italic: 'Italic текст' + italic: 'Italic текст', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ms.js b/src/editor/locale/lang.ms.js index ff888d19..e29aca4e 100644 --- a/src/editor/locale/lang.ms.js +++ b/src/editor/locale/lang.ms.js @@ -70,7 +70,10 @@ export default { font_family: 'Tukar Font Keluarga', font_size: 'Ubah Saiz Font', bold: 'Bold Teks', - italic: 'Italic Teks' + italic: 'Italic Teks', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.mt.js b/src/editor/locale/lang.mt.js index 887556cf..dde0afcb 100644 --- a/src/editor/locale/lang.mt.js +++ b/src/editor/locale/lang.mt.js @@ -70,7 +70,10 @@ export default { font_family: 'Bidla Font Familja', font_size: 'Change font size', bold: 'Bold Test', - italic: 'Test korsiv' + italic: 'Test korsiv', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.nl.js b/src/editor/locale/lang.nl.js index 8a47d270..92527eb9 100644 --- a/src/editor/locale/lang.nl.js +++ b/src/editor/locale/lang.nl.js @@ -70,7 +70,10 @@ export default { font_family: 'Verander lettertype', font_size: 'Verander lettertype grootte', bold: 'Vet', - italic: 'Cursief' + italic: 'Cursief', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Hoofdmenu', diff --git a/src/editor/locale/lang.no.js b/src/editor/locale/lang.no.js index 9466ffdc..6b5ade9c 100644 --- a/src/editor/locale/lang.no.js +++ b/src/editor/locale/lang.no.js @@ -70,7 +70,10 @@ export default { font_family: 'Change Font Family', font_size: 'Endre skriftstørrelse', bold: 'Fet tekst', - italic: 'Kursiv tekst' + italic: 'Kursiv tekst', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.pl.js b/src/editor/locale/lang.pl.js index 1a9bb30a..d4390a1b 100644 --- a/src/editor/locale/lang.pl.js +++ b/src/editor/locale/lang.pl.js @@ -71,7 +71,10 @@ export default { font_family: 'Zmień krój czcionki', font_size: 'Zmień rozmiar czcionki', bold: 'Pogrubienie textu', - italic: 'Kursywa' + italic: 'Kursywa', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Menu główne', diff --git a/src/editor/locale/lang.pt-BR.js b/src/editor/locale/lang.pt-BR.js index 4ea3e734..f1671bf7 100644 --- a/src/editor/locale/lang.pt-BR.js +++ b/src/editor/locale/lang.pt-BR.js @@ -70,7 +70,10 @@ export default { font_family: 'Mudar o estilo da fonte', font_size: 'Mudar o tamanho da fonte', bold: 'Negrito', - italic: 'Italico' + italic: 'Italico', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Menu Principal', diff --git a/src/editor/locale/lang.pt-PT.js b/src/editor/locale/lang.pt-PT.js index c49e7111..a5451387 100644 --- a/src/editor/locale/lang.pt-PT.js +++ b/src/editor/locale/lang.pt-PT.js @@ -70,7 +70,10 @@ export default { font_family: 'Alterar fonte Família', font_size: 'Alterar tamanho de letra', bold: 'Bold Text', - italic: 'Texto em itálico' + italic: 'Texto em itálico', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ro.js b/src/editor/locale/lang.ro.js index 69cfd2c8..25284410 100644 --- a/src/editor/locale/lang.ro.js +++ b/src/editor/locale/lang.ro.js @@ -70,7 +70,10 @@ export default { font_family: 'Modificare familie de fonturi', font_size: 'Schimbă dimensiunea fontului', bold: 'Text Îngroşat', - italic: 'Text Înclinat' + italic: 'Text Înclinat', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Menu Principal', diff --git a/src/editor/locale/lang.ru.js b/src/editor/locale/lang.ru.js index 3f920578..8668ccc4 100644 --- a/src/editor/locale/lang.ru.js +++ b/src/editor/locale/lang.ru.js @@ -70,7 +70,10 @@ export default { font_family: 'Изменить семейство шрифтов', font_size: 'Изменить размер шрифта', bold: 'Жирный', - italic: 'Курсив' + italic: 'Курсив', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Главное меню', diff --git a/src/editor/locale/lang.sk.js b/src/editor/locale/lang.sk.js index 89e3c181..66ddd7a0 100644 --- a/src/editor/locale/lang.sk.js +++ b/src/editor/locale/lang.sk.js @@ -70,7 +70,10 @@ export default { font_family: 'Zmeniť font', font_size: 'Zmeniť veľkosť písma', bold: 'Tučné', - italic: 'Kurzíva' + italic: 'Kurzíva', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Hlavné menu', diff --git a/src/editor/locale/lang.sl.js b/src/editor/locale/lang.sl.js index ac439f07..ccd1312d 100644 --- a/src/editor/locale/lang.sl.js +++ b/src/editor/locale/lang.sl.js @@ -70,7 +70,10 @@ export default { font_family: 'Spremeni tip pisave', font_size: 'Spremeni velikost pisave', bold: 'Krepko', - italic: 'Poševno' + italic: 'Poševno', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Glavni meni', diff --git a/src/editor/locale/lang.sq.js b/src/editor/locale/lang.sq.js index 16d14a3a..8c3c6762 100644 --- a/src/editor/locale/lang.sq.js +++ b/src/editor/locale/lang.sq.js @@ -70,7 +70,10 @@ export default { font_family: 'Ndryshimi Font Family', font_size: 'Ndryshimi Font Size', bold: 'Bold Text', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.sr.js b/src/editor/locale/lang.sr.js index aa5c0295..2b440900 100644 --- a/src/editor/locale/lang.sr.js +++ b/src/editor/locale/lang.sr.js @@ -70,7 +70,10 @@ export default { font_family: 'Цханге фонт породицу', font_size: 'Цханге фонт сизе', bold: 'Подебљан текст', - italic: 'Италиц текст' + italic: 'Италиц текст', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.sv.js b/src/editor/locale/lang.sv.js index f7e3f967..a262bd80 100644 --- a/src/editor/locale/lang.sv.js +++ b/src/editor/locale/lang.sv.js @@ -70,7 +70,10 @@ export default { font_family: 'Ändra Typsnitt', font_size: 'Ändra textstorlek', bold: 'Fet text', - italic: 'Kursiv text' + italic: 'Kursiv text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.sw.js b/src/editor/locale/lang.sw.js index 288b9eab..83b556f6 100644 --- a/src/editor/locale/lang.sw.js +++ b/src/editor/locale/lang.sw.js @@ -70,7 +70,10 @@ export default { font_family: 'Change font Family', font_size: 'Change font Size', bold: 'Bold Nakala', - italic: 'Italiki Nakala' + italic: 'Italiki Nakala', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.test.js b/src/editor/locale/lang.test.js index 45565882..07757884 100644 --- a/src/editor/locale/lang.test.js +++ b/src/editor/locale/lang.test.js @@ -70,7 +70,10 @@ export default { font_family: 'Change Font Family', font_size: 'Change Font Size', bold: 'Bold Text', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.th.js b/src/editor/locale/lang.th.js index fbb455cd..79dab68c 100644 --- a/src/editor/locale/lang.th.js +++ b/src/editor/locale/lang.th.js @@ -70,7 +70,10 @@ export default { font_family: 'ครอบครัว Change Font', font_size: 'เปลี่ยนขนาดตัวอักษร', bold: 'ข้อความตัวหนา', - italic: 'ข้อความตัวเอียง' + italic: 'ข้อความตัวเอียง', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.tl.js b/src/editor/locale/lang.tl.js index aa4c26f4..d353a3aa 100644 --- a/src/editor/locale/lang.tl.js +++ b/src/editor/locale/lang.tl.js @@ -70,7 +70,10 @@ export default { font_family: 'Baguhin ang Pamilya ng Font', font_size: 'Baguhin ang Laki ng Font', bold: 'Bold Text', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.tr.js b/src/editor/locale/lang.tr.js index 0c734275..759e747a 100644 --- a/src/editor/locale/lang.tr.js +++ b/src/editor/locale/lang.tr.js @@ -70,7 +70,10 @@ export default { font_family: 'Font değiştir Aile', font_size: 'Change font size', bold: 'Kalın Yazı', - italic: 'Italik yazı' + italic: 'Italik yazı', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.uk.js b/src/editor/locale/lang.uk.js index 84f1f29a..e47a0a58 100644 --- a/src/editor/locale/lang.uk.js +++ b/src/editor/locale/lang.uk.js @@ -70,7 +70,10 @@ export default { font_family: 'Зміни Сімейство шрифтів', font_size: 'Змінити розмір шрифту', bold: 'Товстий текст', - italic: 'Похилий текст' + italic: 'Похилий текст', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.vi.js b/src/editor/locale/lang.vi.js index 10daf9f8..bcb1f2bf 100644 --- a/src/editor/locale/lang.vi.js +++ b/src/editor/locale/lang.vi.js @@ -70,7 +70,10 @@ export default { font_family: 'Thay đổi Font Gia đình', font_size: 'Thay đổi cỡ chữ', bold: 'Bold Text', - italic: 'Italic Text' + italic: 'Italic Text', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.yi.js b/src/editor/locale/lang.yi.js index 9f6983ea..fd21d6e6 100644 --- a/src/editor/locale/lang.yi.js +++ b/src/editor/locale/lang.yi.js @@ -70,7 +70,10 @@ export default { font_family: 'ענדערן פאָנט פאַמילי', font_size: 'בייטן פאָנט גרייס', bold: 'דרייסט טעקסט', - italic: 'יטאַליק טעקסט' + italic: 'יטאַליק טעקסט', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.zh-CN.js b/src/editor/locale/lang.zh-CN.js index 1accbaba..41cdbf54 100644 --- a/src/editor/locale/lang.zh-CN.js +++ b/src/editor/locale/lang.zh-CN.js @@ -70,7 +70,10 @@ export default { font_family: '更改字体样式', font_size: '更改字体大小', bold: '粗体', - italic: '斜体' + italic: '斜体', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: '主菜单', diff --git a/src/editor/locale/lang.zh-HK.js b/src/editor/locale/lang.zh-HK.js index 4d95992c..cf2cd61b 100644 --- a/src/editor/locale/lang.zh-HK.js +++ b/src/editor/locale/lang.zh-HK.js @@ -70,7 +70,10 @@ export default { font_family: '更改字体家族', font_size: '更改字体大小', bold: '粗体', - italic: '斜体文本' + italic: '斜体文本', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.zh-TW.js b/src/editor/locale/lang.zh-TW.js index f0aebccf..4239ea03 100644 --- a/src/editor/locale/lang.zh-TW.js +++ b/src/editor/locale/lang.zh-TW.js @@ -70,7 +70,10 @@ export default { font_family: '更改字體', font_size: '更改字體大小', bold: '粗體', - italic: '斜體' + italic: '斜體', + text_anchor_start: 'Align the text in start', + text_anchor_middle: 'Align the text in middle', + text_anchor_end: 'Align the text in end' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/svgedit.js b/src/editor/svgedit.js index 662085a7..b20f2ee5 100644 --- a/src/editor/svgedit.js +++ b/src/editor/svgedit.js @@ -1159,9 +1159,9 @@ editor.init = () => { '#tool_ungroup': 'ungroup', '#tool_unlink_use': 'unlink_use', - '#tool_alignleft, #tool_posleft': 'align_left', - '#tool_aligncenter, #tool_poscenter': 'align_center', - '#tool_alignright, #tool_posright': 'align_right', + '#tool_alignleft, #tool_posleft, #tool_text_anchor_start': 'align_left', + '#tool_aligncenter, #tool_poscenter, #tool_text_anchor_middle': 'align_center', + '#tool_alignright, #tool_posright, #tool_text_anchor_end': 'align_right', '#tool_aligntop, #tool_postop': 'align_top', '#tool_alignmiddle, #tool_posmiddle': 'align_middle', '#tool_alignbottom, #tool_posbottom': 'align_bottom', @@ -2246,6 +2246,26 @@ editor.init = () => { } else { $('#tool_bold').removeClass('push_button_pressed').addClass('tool_button'); } + const textAnchorStart = $('#tool_text_anchor_start'); + const textAnchorMiddle = $('#tool_text_anchor_middle'); + const textAnchorEnd = $('#tool_text_anchor_end'); + switch (elem.getAttribute('text-anchor')) { + case 'start': + textAnchorStart.addClass('push_button_pressed').removeClass('tool_button'); + textAnchorMiddle.removeClass('push_button_pressed').addClass('tool_button'); + textAnchorEnd.removeClass('push_button_pressed').addClass('tool_button'); + break; + case 'middle': + textAnchorStart.removeClass('push_button_pressed').addClass('tool_button'); + textAnchorMiddle.addClass('push_button_pressed').removeClass('tool_button'); + textAnchorEnd.removeClass('push_button_pressed').addClass('tool_button'); + break; + case 'end': + textAnchorStart.removeClass('push_button_pressed').addClass('tool_button'); + textAnchorMiddle.removeClass('push_button_pressed').addClass('tool_button'); + textAnchorEnd.addClass('push_button_pressed').removeClass('tool_button'); + break; + } $('#font_family').val(elem.getAttribute('font-family')); $('#font_size').val(elem.getAttribute('font-size')); $('#text').val(elem.textContent); @@ -4258,6 +4278,16 @@ editor.init = () => { return false; }; + /** + * + * @returns {false} + */ + const clickTextAnchor = function (value) { + svgCanvas.setTextAnchor(value); + updateContextPanel(); + return false; + }; + /** * * @returns {void} @@ -5443,6 +5473,9 @@ editor.init = () => { // {sel: '#tools_ellipse_show', fn: clickEllipse, evt: 'click'}, {sel: '#tool_bold', fn: clickBold, evt: 'mousedown'}, {sel: '#tool_italic', fn: clickItalic, evt: 'mousedown'}, + {sel: '#tool_text_anchor_start', fn () { clickTextAnchor('start'); }, evt: 'mousedown'}, + {sel: '#tool_text_anchor_middle', fn () { clickTextAnchor('middle'); }, evt: 'mousedown'}, + {sel: '#tool_text_anchor_end', fn () { clickTextAnchor('end'); }, evt: 'mousedown'}, {sel: '#sidepanel_handle', fn: toggleSidePanel, key: ['X']}, {sel: '#copy_save_done', fn: cancelOverlays, evt: 'click'}, diff --git a/src/svgcanvas/elem-get-set.js b/src/svgcanvas/elem-get-set.js index 0d631a7c..354e3355 100644 --- a/src/svgcanvas/elem-get-set.js +++ b/src/svgcanvas/elem-get-set.js @@ -606,6 +606,25 @@ isNullish(selectedElements[1])) { elemContext_.getCanvas().textActions.setCursor(); } }; + +/** + * Set the new text anchor + * @function module:svgcanvas.SvgCanvas#setTextAnchor + * @param {string} value - The text anchor value (start, middle or end) + * @returns {void} + */ +export const setTextAnchorMethod = function (value) { + const selectedElements = elemContext_.getSelectedElements(); + const selected = selectedElements[0]; + if (!isNullish(selected) && selected.tagName === 'text' && + isNullish(selectedElements[1])) { + elemContext_.getCanvas().changeSelectedAttribute('text-anchor', value); + } + if (!selectedElements[0].textContent) { + elemContext_.getCanvas().textActions.setCursor(); + } +}; + /** * @function module:svgcanvas.SvgCanvas#getFontFamily * @returns {string} The current font family diff --git a/src/svgcanvas/svgcanvas.js b/src/svgcanvas/svgcanvas.js index 9b44a896..f8f67472 100644 --- a/src/svgcanvas/svgcanvas.js +++ b/src/svgcanvas/svgcanvas.js @@ -57,7 +57,7 @@ import { setDocumentTitleMethod, setResolutionMethod, getEditorNSMethod, setBBoxZoomMethod, setZoomMethod, setColorMethod, setGradientMethod, findDuplicateGradient, setPaintMethod, setStrokeWidthMethod, setStrokeAttrMethod, getBoldMethod, setBoldMethod, getItalicMethod, - setItalicMethod, getFontFamilyMethod, setFontFamilyMethod, setFontColorMethod, getFontColorMethod, + setItalicMethod, setTextAnchorMethod, getFontFamilyMethod, setFontFamilyMethod, setFontColorMethod, getFontColorMethod, getFontSizeMethod, setFontSizeMethod, getTextMethod, setTextContentMethod, setImageURLMethod, setLinkURLMethod, setRectRadiusMethod, makeHyperlinkMethod, removeHyperlinkMethod, setSegTypeMethod, setBackgroundMethod @@ -2215,6 +2215,14 @@ class SvgCanvas { */ this.setItalic = setItalicMethod; + /** +* Set the new text anchor. +* @function module:svgcanvas.SvgCanvas#setTextAnchor +* @param {string} textAnchor - The value of the text anchor (start, middle or end) +* @returns {void} +*/ + this.setTextAnchor = setTextAnchorMethod; + /** * @function module:svgcanvas.SvgCanvas#getFontFamily * @returns {string} The current font family From c405bf9334668003fbf29ee75f1a9eac804cef9d Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Sat, 12 Dec 2020 15:34:49 +0100 Subject: [PATCH 2/8] Update bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2adef30a..bf135f4d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,7 +4,7 @@ about: Create a report in case we may be able to help labels: bug - unconfirmed --- -**PLEASE NOTE: This project is not currently being actively developed due to the core developers having moved on, and the only remaining maintainer merely applying occasional minor PRs or tweaks to keep the project alive. While you can file an issue, you should not expect any action, even if we label the issue.** +**PLEASE NOTE: We are trying to make this project live again. While you can file an issue, we will do our best but you should not expect any action, even if we label the issue. However, we are welcoming new contributors ** **Describe the bug** A clear and concise description of what the bug is. From 1fc190678873afead62d2e509429889bd963406d Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Sat, 12 Dec 2020 15:35:42 +0100 Subject: [PATCH 3/8] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 2c9d15d4..9a87a7bb 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -github: [brettz9] # May have up to 4 comma-separated user names +github: [brettz9 , OptimistikSAS] # May have up to 4 comma-separated user names From 384bccdd8b7ba648b1a01021a18ca471966dd2a0 Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Sat, 12 Dec 2020 15:43:27 +0100 Subject: [PATCH 4/8] Update README.md --- README.md | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4dbf4e73..947d1650 100644 --- a/README.md +++ b/README.md @@ -71,21 +71,6 @@ You may also obtain URLs for specific [releases](https://github.com/SVG-Edit/svg width="100%" height="100%"> ``` -Note that if you want support for the following browsers, you will at least -need some polyfills. - -For Android Browser 4.4.3-4.4.4, you will need at least `fetch`. - -For the following, you will need at least `URL`, `Promise`, and `fetch`: - -- IE <= 11 -- IE Mobile -- Opera Mini -- Blackberry Browser <= 10 - -And for still older browsers (e.g., IE 8), you will at minimum need a -`querySelector` polyfill. - ### Integrating SVG-edit into your own npm package These steps are only needed if you wish to set up your own npm package @@ -202,13 +187,15 @@ incorporating SVGEdit. You will need to have Node.js/npm installed. the project team can decide if we should support with the latest version. ## Further reading and more information - + * Participate in [discussions](https://github.com/SVG-Edit/svgedit/discussions) * See [docs](docs/) for more documentation. See the [JSDocs for our latest release](https://svg-edit.github.io/svgedit/releases/latest/docs/jsdoc/index.html). * [Acknowledgements](docs/Acknowledgements.md) lists open source projects used in svg-edit. * See [AUTHORS](AUTHORS) file for authors. * [StackOverflow](https://stackoverflow.com/tags/svg-edit) group. + +## Older references * Join the [svg-edit mailing list](https://groups.google.com/forum/#!forum/svg-edit). * Join us on `#svg-edit` on `freenode.net` (or use the [web client](https://webchat.freenode.net/?channels=svg-edit)). From 615f33b0f9f565535d1d2e2bd7397506e457de36 Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Sun, 13 Dec 2020 19:13:47 +0100 Subject: [PATCH 5/8] new icons for anchors --- badges/coverage-badge.svg | 2 +- src/editor/images/svg_edit_icons.svg | 33 ++++++++++++++++++++++++++++ src/editor/svgedit.js | 10 ++++++--- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/badges/coverage-badge.svg b/badges/coverage-badge.svg index f106edca..fb8e90cc 100644 --- a/badges/coverage-badge.svg +++ b/badges/coverage-badge.svg @@ -1 +1 @@ -Statements 52.98%Statements 52.98%Branches 41.61%Branches 41.61%Lines 53.81%Lines 53.81%Functions 60.33%Functions 60.33% +Statements 52.97%Statements 52.97%Branches 41.93%Branches 41.93%Lines 53.78%Lines 53.78%Functions 60.47%Functions 60.47% diff --git a/src/editor/images/svg_edit_icons.svg b/src/editor/images/svg_edit_icons.svg index 98aa7b8a..e7fac565 100644 --- a/src/editor/images/svg_edit_icons.svg +++ b/src/editor/images/svg_edit_icons.svg @@ -811,6 +811,39 @@ + + + + + Layer 1 + abcd + + + + + + + + + + Layer 1 + abcd + + + + + + + + + + Layer 1 + abcd + + + + + diff --git a/src/editor/svgedit.js b/src/editor/svgedit.js index b20f2ee5..4c02dfe4 100644 --- a/src/editor/svgedit.js +++ b/src/editor/svgedit.js @@ -1159,9 +1159,12 @@ editor.init = () => { '#tool_ungroup': 'ungroup', '#tool_unlink_use': 'unlink_use', - '#tool_alignleft, #tool_posleft, #tool_text_anchor_start': 'align_left', - '#tool_aligncenter, #tool_poscenter, #tool_text_anchor_middle': 'align_center', - '#tool_alignright, #tool_posright, #tool_text_anchor_end': 'align_right', + '#tool_alignleft, #tool_posleft': 'align_left', + '#tool_text_anchor_start': 'anchor_start', + '#tool_text_anchor_middle': 'anchor_middle', + '#tool_text_anchor_end': 'anchor_end', + '#tool_aligncenter, #tool_poscenter': 'align_center', + '#tool_alignright, #tool_posright': 'align_right', '#tool_aligntop, #tool_postop': 'align_top', '#tool_alignmiddle, #tool_posmiddle': 'align_middle', '#tool_alignbottom, #tool_posbottom': 'align_bottom', @@ -4280,6 +4283,7 @@ editor.init = () => { /** * + * @param {string} value "start","end" or "middle" * @returns {false} */ const clickTextAnchor = function (value) { From ba89536f41a149f1a3844ccce3efb2b0e6bc308c Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Sun, 13 Dec 2020 22:35:45 +0100 Subject: [PATCH 6/8] fix test --- badges/coverage-badge.svg | 2 +- badges/tests-badge.svg | 2 +- cypress/integration/ui/accessibility.js | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/badges/coverage-badge.svg b/badges/coverage-badge.svg index fb8e90cc..c3f8392e 100644 --- a/badges/coverage-badge.svg +++ b/badges/coverage-badge.svg @@ -1 +1 @@ -Statements 52.97%Statements 52.97%Branches 41.93%Branches 41.93%Lines 53.78%Lines 53.78%Functions 60.47%Functions 60.47% +Statements 52.95%Statements 52.95%Branches 41.89%Branches 41.89%Lines 53.76%Lines 53.76%Functions 60.47%Functions 60.47% diff --git a/badges/tests-badge.svg b/badges/tests-badge.svg index 96979660..515cd6b9 100644 --- a/badges/tests-badge.svg +++ b/badges/tests-badge.svg @@ -1 +1 @@ -TestsTests143/144143/144 \ No newline at end of file +TestsTests144/144144/144 \ No newline at end of file diff --git a/cypress/integration/ui/accessibility.js b/cypress/integration/ui/accessibility.js index c192d9f8..17c2a3f0 100644 --- a/cypress/integration/ui/accessibility.js +++ b/cypress/integration/ui/accessibility.js @@ -1,9 +1,12 @@ +import { + visitAndApproveStorage +} from '../../support/ui-test-helper.js'; + describe('UI - Accessibility', function () { beforeEach(() => { - cy.visit('/instrumented/editor/index.html'); + visitAndApproveStorage(); cy.injectAxe(); }); - // https://www.npmjs.com/package/cypress-axe it('Has no detectable a11y violations on load', () => { // Configure aXe and test the page at initial load From 1a974384c8ec2aab6502809222f5fb4a8e0b390f Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Tue, 15 Dec 2020 14:03:34 +0100 Subject: [PATCH 7/8] build --- dist/editor/images/svg_edit_icons.svg | 33 +++++++++++++ dist/editor/index.html | 5 +- dist/editor/index.js | 50 +++++++++---------- dist/editor/index.js.map | 2 +- dist/editor/system/images/svg_edit_icons.svg | 33 +++++++++++++ dist/editor/system/index.html | 5 +- dist/editor/system/index.js | 52 ++++++++++---------- dist/editor/xdomain-index.html | 5 +- dist/editor/xdomain-index.js | 50 +++++++++---------- dist/editor/xdomain-index.js.map | 2 +- 10 files changed, 156 insertions(+), 81 deletions(-) diff --git a/dist/editor/images/svg_edit_icons.svg b/dist/editor/images/svg_edit_icons.svg index 98aa7b8a..e7fac565 100644 --- a/dist/editor/images/svg_edit_icons.svg +++ b/dist/editor/images/svg_edit_icons.svg @@ -811,6 +811,39 @@ + + + + + Layer 1 + abcd + + + + + + + + + + Layer 1 + abcd + + + + + + + + + + Layer 1 + abcd + + + + + diff --git a/dist/editor/index.html b/dist/editor/index.html index 880af11c..1d71bd16 100644 --- a/dist/editor/index.html +++ b/dist/editor/index.html @@ -309,6 +309,9 @@
+
+
+
B
i
@@ -729,4 +732,4 @@
- \ No newline at end of file + diff --git a/dist/editor/index.js b/dist/editor/index.js index b83468d4..fae7423b 100644 --- a/dist/editor/index.js +++ b/dist/editor/index.js @@ -1,5 +1,5 @@ -var Tn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(Tn,Un,Qn){return Tn(Qn={path:Un,exports:{},require:function(Tn,Un){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==Un&&Qn.path)}},Qn.exports),Qn.exports}var check=function(Tn){return Tn&&Tn.Math==Math&&Tn},Un=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof Tn&&Tn)||function(){return this}()||Function("return this")(),fails=function(Tn){try{return!!Tn()}catch(Tn){return!0}},Qn=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Dn={}.propertyIsEnumerable,Hn=Object.getOwnPropertyDescriptor,Gn={f:Hn&&!Dn.call({1:2},1)?function propertyIsEnumerable(Tn){var Un=Hn(this,Tn);return!!Un&&Un.enumerable}:Dn},createPropertyDescriptor=function(Tn,Un){return{enumerable:!(1&Tn),configurable:!(2&Tn),writable:!(4&Tn),value:Un}},Vn={}.toString,classofRaw=function(Tn){return Vn.call(Tn).slice(8,-1)},zn="".split,Kn=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(Tn){return"String"==classofRaw(Tn)?zn.call(Tn,""):Object(Tn)}:Object,requireObjectCoercible=function(Tn){if(null==Tn)throw TypeError("Can't call method on "+Tn);return Tn},toIndexedObject=function(Tn){return Kn(requireObjectCoercible(Tn))},isObject=function(Tn){return"object"==typeof Tn?null!==Tn:"function"==typeof Tn},toPrimitive=function(Tn,Un){if(!isObject(Tn))return Tn;var Qn,Dn;if(Un&&"function"==typeof(Qn=Tn.toString)&&!isObject(Dn=Qn.call(Tn)))return Dn;if("function"==typeof(Qn=Tn.valueOf)&&!isObject(Dn=Qn.call(Tn)))return Dn;if(!Un&&"function"==typeof(Qn=Tn.toString)&&!isObject(Dn=Qn.call(Tn)))return Dn;throw TypeError("Can't convert object to primitive value")},Xn={}.hasOwnProperty,has=function(Tn,Un){return Xn.call(Tn,Un)},Wn=Un.document,Yn=isObject(Wn)&&isObject(Wn.createElement),documentCreateElement=function(Tn){return Yn?Wn.createElement(Tn):{}},Jn=!Qn&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),$n=Object.getOwnPropertyDescriptor,Zn={f:Qn?$n:function getOwnPropertyDescriptor(Tn,Un){if(Tn=toIndexedObject(Tn),Un=toPrimitive(Un,!0),Jn)try{return $n(Tn,Un)}catch(Tn){}if(has(Tn,Un))return createPropertyDescriptor(!Gn.f.call(Tn,Un),Tn[Un])}},anObject=function(Tn){if(!isObject(Tn))throw TypeError(String(Tn)+" is not an object");return Tn},er=Object.defineProperty,tr={f:Qn?er:function defineProperty(Tn,Un,Qn){if(anObject(Tn),Un=toPrimitive(Un,!0),anObject(Qn),Jn)try{return er(Tn,Un,Qn)}catch(Tn){}if("get"in Qn||"set"in Qn)throw TypeError("Accessors not supported");return"value"in Qn&&(Tn[Un]=Qn.value),Tn}},nr=Qn?function(Tn,Un,Qn){return tr.f(Tn,Un,createPropertyDescriptor(1,Qn))}:function(Tn,Un,Qn){return Tn[Un]=Qn,Tn},setGlobal=function(Tn,Qn){try{nr(Un,Tn,Qn)}catch(Dn){Un[Tn]=Qn}return Qn},rr=Un["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),ir=Function.toString;"function"!=typeof rr.inspectSource&&(rr.inspectSource=function(Tn){return ir.call(Tn)});var or,ar,sr,lr=rr.inspectSource,cr=Un.WeakMap,ur="function"==typeof cr&&/native code/.test(lr(cr)),dr=createCommonjsModule((function(Tn){(Tn.exports=function(Tn,Un){return rr[Tn]||(rr[Tn]=void 0!==Un?Un:{})})("versions",[]).push({version:"3.7.0",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),hr=0,pr=Math.random(),uid=function(Tn){return"Symbol("+String(void 0===Tn?"":Tn)+")_"+(++hr+pr).toString(36)},Ar=dr("keys"),sharedKey=function(Tn){return Ar[Tn]||(Ar[Tn]=uid(Tn))},fr={},gr=Un.WeakMap;if(ur){var mr=rr.state||(rr.state=new gr),_r=mr.get,vr=mr.has,yr=mr.set;or=function(Tn,Un){return Un.facade=Tn,yr.call(mr,Tn,Un),Un},ar=function(Tn){return _r.call(mr,Tn)||{}},sr=function(Tn){return vr.call(mr,Tn)}}else{var br=sharedKey("state");fr[br]=!0,or=function(Tn,Un){return Un.facade=Tn,nr(Tn,br,Un),Un},ar=function(Tn){return has(Tn,br)?Tn[br]:{}},sr=function(Tn){return has(Tn,br)}}var wr,Sr,xr={set:or,get:ar,has:sr,enforce:function(Tn){return sr(Tn)?ar(Tn):or(Tn,{})},getterFor:function(Tn){return function(Un){var Qn;if(!isObject(Un)||(Qn=ar(Un)).type!==Tn)throw TypeError("Incompatible receiver, "+Tn+" required");return Qn}}},Cr=createCommonjsModule((function(Tn){var Qn=xr.get,Dn=xr.enforce,Hn=String(String).split("String");(Tn.exports=function(Tn,Qn,Gn,Vn){var zn,Kn=!!Vn&&!!Vn.unsafe,Xn=!!Vn&&!!Vn.enumerable,Wn=!!Vn&&!!Vn.noTargetGet;"function"==typeof Gn&&("string"!=typeof Qn||has(Gn,"name")||nr(Gn,"name",Qn),(zn=Dn(Gn)).source||(zn.source=Hn.join("string"==typeof Qn?Qn:""))),Tn!==Un?(Kn?!Wn&&Tn[Qn]&&(Xn=!0):delete Tn[Qn],Xn?Tn[Qn]=Gn:nr(Tn,Qn,Gn)):Xn?Tn[Qn]=Gn:setGlobal(Qn,Gn)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&Qn(this).source||lr(this)}))})),kr=Un,aFunction=function(Tn){return"function"==typeof Tn?Tn:void 0},getBuiltIn=function(Tn,Qn){return arguments.length<2?aFunction(kr[Tn])||aFunction(Un[Tn]):kr[Tn]&&kr[Tn][Qn]||Un[Tn]&&Un[Tn][Qn]},Br=Math.ceil,Er=Math.floor,toInteger=function(Tn){return isNaN(Tn=+Tn)?0:(Tn>0?Er:Br)(Tn)},Nr=Math.min,toLength=function(Tn){return Tn>0?Nr(toInteger(Tn),9007199254740991):0},Lr=Math.max,Tr=Math.min,toAbsoluteIndex=function(Tn,Un){var Qn=toInteger(Tn);return Qn<0?Lr(Qn+Un,0):Tr(Qn,Un)},createMethod=function(Tn){return function(Un,Qn,Dn){var Hn,Gn=toIndexedObject(Un),Vn=toLength(Gn.length),zn=toAbsoluteIndex(Dn,Vn);if(Tn&&Qn!=Qn){for(;Vn>zn;)if((Hn=Gn[zn++])!=Hn)return!0}else for(;Vn>zn;zn++)if((Tn||zn in Gn)&&Gn[zn]===Qn)return Tn||zn||0;return!Tn&&-1}},Pr={includes:createMethod(!0),indexOf:createMethod(!1)},Fr=Pr.indexOf,objectKeysInternal=function(Tn,Un){var Qn,Dn=toIndexedObject(Tn),Hn=0,Gn=[];for(Qn in Dn)!has(fr,Qn)&&has(Dn,Qn)&&Gn.push(Qn);for(;Un.length>Hn;)has(Dn,Qn=Un[Hn++])&&(~Fr(Gn,Qn)||Gn.push(Qn));return Gn},Ur=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ir=Ur.concat("length","prototype"),Rr={f:Object.getOwnPropertyNames||function getOwnPropertyNames(Tn){return objectKeysInternal(Tn,Ir)}},Mr={f:Object.getOwnPropertySymbols},Or=getBuiltIn("Reflect","ownKeys")||function ownKeys(Tn){var Un=Rr.f(anObject(Tn)),Qn=Mr.f;return Qn?Un.concat(Qn(Tn)):Un},copyConstructorProperties=function(Tn,Un){for(var Qn=Or(Un),Dn=tr.f,Hn=Zn.f,Gn=0;Gn=74)&&(wr=Zr.match(/Chrome\/(\d+)/))&&(Sr=wr[1]);var ri=Sr&&+Sr,ii=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(Tn){return ri>=51||!fails((function(){var Un=[];return(Un.constructor={})[ii]=function(){return{foo:1}},1!==Un[Tn](Boolean).foo}))},oi=wellKnownSymbol("isConcatSpreadable"),ai=ri>=51||!fails((function(){var Tn=[];return Tn[oi]=!1,Tn.concat()[0]!==Tn})),si=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(Tn){if(!isObject(Tn))return!1;var Un=Tn[oi];return void 0!==Un?!!Un:Kr(Tn)};_export({target:"Array",proto:!0,forced:!ai||!si},{concat:function concat(Tn){var Un,Qn,Dn,Hn,Gn,Vn=toObject(this),zn=arraySpeciesCreate(Vn,0),Kn=0;for(Un=-1,Dn=arguments.length;Un9007199254740991)throw TypeError("Maximum allowed index exceeded");for(Qn=0;Qn=9007199254740991)throw TypeError("Maximum allowed index exceeded");createProperty(zn,Kn++,Gn)}return zn.length=Kn,zn}});var aFunction$1=function(Tn){if("function"!=typeof Tn)throw TypeError(String(Tn)+" is not a function");return Tn},functionBindContext=function(Tn,Un,Qn){if(aFunction$1(Tn),void 0===Un)return Tn;switch(Qn){case 0:return function(){return Tn.call(Un)};case 1:return function(Qn){return Tn.call(Un,Qn)};case 2:return function(Qn,Dn){return Tn.call(Un,Qn,Dn)};case 3:return function(Qn,Dn,Hn){return Tn.call(Un,Qn,Dn,Hn)}}return function(){return Tn.apply(Un,arguments)}},li=[].push,createMethod$1=function(Tn){var Un=1==Tn,Qn=2==Tn,Dn=3==Tn,Hn=4==Tn,Gn=6==Tn,Vn=5==Tn||Gn;return function(zn,Xn,Wn,Yn){for(var Jn,$n,Zn=toObject(zn),er=Kn(Zn),tr=functionBindContext(Xn,Wn,3),nr=toLength(er.length),rr=0,ir=Yn||arraySpeciesCreate,or=Un?ir(zn,nr):Qn?ir(zn,0):void 0;nr>rr;rr++)if((Vn||rr in er)&&($n=tr(Jn=er[rr],rr,Zn),Tn))if(Un)or[rr]=$n;else if($n)switch(Tn){case 3:return!0;case 5:return Jn;case 6:return rr;case 2:li.call(or,Jn)}else if(Hn)return!1;return Gn?-1:Dn||Hn?Hn:or}},ui={forEach:createMethod$1(0),map:createMethod$1(1),filter:createMethod$1(2),some:createMethod$1(3),every:createMethod$1(4),find:createMethod$1(5),findIndex:createMethod$1(6)},di=Object.defineProperty,hi={},thrower=function(Tn){throw Tn},arrayMethodUsesToLength=function(Tn,Un){if(has(hi,Tn))return hi[Tn];Un||(Un={});var Dn=[][Tn],Hn=!!has(Un,"ACCESSORS")&&Un.ACCESSORS,Gn=has(Un,0)?Un[0]:thrower,Vn=has(Un,1)?Un[1]:void 0;return hi[Tn]=!!Dn&&!fails((function(){if(Hn&&!Qn)return!0;var Tn={length:-1};Hn?di(Tn,1,{enumerable:!0,get:thrower}):Tn[1]=1,Dn.call(Tn,Gn,Vn)}))},pi=ui.filter,Ai=arrayMethodHasSpeciesSupport("filter"),fi=arrayMethodUsesToLength("filter");_export({target:"Array",proto:!0,forced:!Ai||!fi},{filter:function filter(Tn){return pi(this,Tn,arguments.length>1?arguments[1]:void 0)}});var gi,mi=Object.keys||function keys(Tn){return objectKeysInternal(Tn,Ur)},_i=Qn?Object.defineProperties:function defineProperties(Tn,Un){anObject(Tn);for(var Qn,Dn=mi(Un),Hn=Dn.length,Gn=0;Hn>Gn;)tr.f(Tn,Qn=Dn[Gn++],Un[Qn]);return Tn},vi=getBuiltIn("document","documentElement"),yi=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(Tn){return"