From 59e4683d6a96019f5ec8f1c914170a0ba430abce Mon Sep 17 00:00:00 2001 From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com> Date: Thu, 10 Jul 2025 16:35:21 -0300 Subject: [PATCH 1/3] refactor: update sharee version to 1.1.23 --- .../com/flowingcode/vaadin/addons/shareeasy/BaseShareEasy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/flowingcode/vaadin/addons/shareeasy/BaseShareEasy.java b/src/main/java/com/flowingcode/vaadin/addons/shareeasy/BaseShareEasy.java index 54227e4..14ec869 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/shareeasy/BaseShareEasy.java +++ b/src/main/java/com/flowingcode/vaadin/addons/shareeasy/BaseShareEasy.java @@ -39,7 +39,7 @@ * * @author Paola De Bartolo / Flowing Code */ -@NpmPackage(value = "sharee", version = "1.1.20") +@NpmPackage(value = "sharee", version = "1.1.23") @JsModule("./src/fc-sharee-connector.js") @CssImport("./styles/fc-share-easy/style.css") class BaseShareEasy> { From 871d47eabce3ba19629eb14c59647afafba6c173 Mon Sep 17 00:00:00 2001 From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com> Date: Fri, 18 Jul 2025 16:19:28 -0300 Subject: [PATCH 2/3] feat(demo): remove custom twitter driver --- .../shareeasy/NewTwitterDriverOptions.java | 47 ------------------- .../shareeasy/SpecialCustomizationsDemo.java | 36 ++++---------- 2 files changed, 9 insertions(+), 74 deletions(-) delete mode 100644 src/test/java/com/flowingcode/vaadin/addons/shareeasy/NewTwitterDriverOptions.java diff --git a/src/test/java/com/flowingcode/vaadin/addons/shareeasy/NewTwitterDriverOptions.java b/src/test/java/com/flowingcode/vaadin/addons/shareeasy/NewTwitterDriverOptions.java deleted file mode 100644 index 4d8af47..0000000 --- a/src/test/java/com/flowingcode/vaadin/addons/shareeasy/NewTwitterDriverOptions.java +++ /dev/null @@ -1,47 +0,0 @@ -/*- -* #%L - * Share Easy Add-on - * %% - * Copyright (C) 2023 - 2025 Flowing Code - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ -package com.flowingcode.vaadin.addons.shareeasy; - -import com.flowingcode.vaadin.addons.shareeasy.util.CustomDriverOptions; - -/** - * Custom driver option for X (ex Twitter) app. - * - * X Logo PNG Vector (SVG) Free Download from https://about.twitter.com/en/who-we-are/brand-toolkit - */ -public class NewTwitterDriverOptions extends CustomDriverOptions { - - public NewTwitterDriverOptions() { - this.setButtonText("X"); ; - this.setBackgroundColor("#0f1419"); - this.setBackgroundHoverColor("#0f1419"); - this.setTextColor("#fff"); - this.setTextHoverColor("#fff"); - this.setLink("https://twitter.com/intent/tweet"); - this.setShareLinkParam("url"); - this.setShareTextParam("text"); - this.setName("x"); - this.setIconSvg( - "\r\n" - + "\r\n" - + ""); - } - -} diff --git a/src/test/java/com/flowingcode/vaadin/addons/shareeasy/SpecialCustomizationsDemo.java b/src/test/java/com/flowingcode/vaadin/addons/shareeasy/SpecialCustomizationsDemo.java index c8f89b8..c118a95 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/shareeasy/SpecialCustomizationsDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/shareeasy/SpecialCustomizationsDemo.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -46,8 +46,8 @@ public SpecialCustomizationsDemo() { NormalShareEasy.create().withDrivers(Driver.WHATSAPP, Driver.TWITTER, Driver.TELEGRAM, Driver.LINKEDIN, Driver.FACEBOOK, Driver.COPY).forComponent(normalDiv1); // #if vaadin eq 0 - Div example1 = createContainerDivWithInfo("Default drivers with different order", normalDiv1, - "Use 'withDrivers' method to list the default drivers in the wanted order"); + Div example1 = createContainerDivWithInfo("Default drivers with different order", normalDiv1, + "Use 'withDrivers' method to list the default drivers in the wanted order"); SourceCodeViewer.highlightOnHover(example1, "example1"); add(example1); addSeparator(); @@ -58,40 +58,22 @@ public SpecialCustomizationsDemo() { // begin-block example2 Div normalDiv2 = new Div(); Map customDrivers2 = new HashMap<>(); - NewTwitterDriverOptions newTwitterDriver = new NewTwitterDriverOptions(); - customDrivers2.put("X", newTwitterDriver); + TrelloDriverOptions trelloDriver = new TrelloDriverOptions(); + customDrivers2.put("trello", trelloDriver); NormalShareEasy .create().withCustomDrivers(customDrivers2).withDrivers(Driver.COPY, - Driver.TELEGRAM, Driver.FACEBOOK, Driver.WHATSAPP, newTwitterDriver, Driver.LINKEDIN) + Driver.TELEGRAM, Driver.FACEBOOK, trelloDriver, Driver.WHATSAPP, Driver.LINKEDIN) .forComponent(normalDiv2); // #if vaadin eq 0 - Div example2 = createContainerDivWithInfo("Custom driver definition to replace old Twitter option with new X option", + Div example2 = createContainerDivWithInfo("Custom driver definition", normalDiv2, - "Use 'witCustomDrivers' method to add the new custom driver for X and then call 'withDrivers' to list the drivers in the wanted order."); + "Use 'withCustomDrivers' method to add the new custom drivers and then call 'withDrivers' to list the wanted drivers in the wanted order."); SourceCodeViewer.highlightOnHover(example2, "example2"); add(example2); addSeparator(); // #endif // show-source add(normalDiv2); // end-block - - // begin-block example3 - Div normalDiv3 = new Div(); - Map customDrivers3 = new HashMap<>(); - NewTwitterDriverOptions xDriver = new NewTwitterDriverOptions(); - customDrivers3.put("X", xDriver); - TrelloDriverOptions trelloDriver = new TrelloDriverOptions(); - customDrivers3.put("trello", trelloDriver); - NormalShareEasy.create().withCustomDrivers(customDrivers3) - .withDrivers(trelloDriver, xDriver).forComponent(normalDiv3); - // #if vaadin eq 0 - Div example3 = createContainerDivWithInfo("Custom drivers only", normalDiv3, - "Use 'witCustomDrivers' method to add the new custom drivers and then call 'withDrivers' to list the wanted drivers in the wanted order."); - SourceCodeViewer.highlightOnHover(example3, "example3"); - add(example3); - // #endif - // show-source add(normalDiv3); - // end-block } } From bbe8ecfa88399c92b3f6f3d98b9ba160514752f4 Mon Sep 17 00:00:00 2001 From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com> Date: Fri, 18 Jul 2025 16:42:48 -0300 Subject: [PATCH 3/3] fix: implement hasLink method in custom driver --- .../META-INF/resources/frontend/src/fc-sharee-connector.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/META-INF/resources/frontend/src/fc-sharee-connector.js b/src/main/resources/META-INF/resources/frontend/src/fc-sharee-connector.js index 2af0d53..ce1983d 100644 --- a/src/main/resources/META-INF/resources/frontend/src/fc-sharee-connector.js +++ b/src/main/resources/META-INF/resources/frontend/src/fc-sharee-connector.js @@ -78,6 +78,7 @@ window.fcShareeConnector = { this.getName = () => { return driverOptions.name; } + this.hasLink = () => !!driverOptions.link; }; Object.defineProperty(f, 'name', { value: name });