Skip to content

Commit

Permalink
Merge branch 'main' into vite6
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- authored Nov 26, 2024
2 parents d9a646f + 3149de8 commit 24b33d9
Show file tree
Hide file tree
Showing 265 changed files with 3,748 additions and 479 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Flow Validation
on:
push:
branches: [main, '24.5', '24.4', '24.3', '23.5', '9.1']
branches: [main, '24.6', '24.5', '24.4', '23.5']
workflow_dispatch:
pull_request_target:
types: [opened, synchronize, reopened, edited]
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Ask questions about Vaadin Flow in our [forum](https://vaadin.com/forum/c/flow/8

Since [Vaadin platform 23.0](https://github.com/vaadin/platform), Flow major and minor versions are aligned with platform versions:

| Branch | [Platform Version](https://github.com/vaadin/platform/releases) | [Flow Version](https://github.com/vaadin/flow/releases) |
|--------|-----------------------------------------------------------------|---------------------------------------------------------|
| 1.0 | 10 (LTS) | 1.0 |
| 2.10 | 14.11 (LATEST free with Java 8+ support and Servlet) | 2.10 |
| 2.11 | 14.12 (LATEST commercial with Java 8+ support and Servlet 3) | 2.11 |
| 23.4 | 23.4 (LATEST free with Java 11+ support and Servlet 3) | 23.4 |
| 23.5 | 23.5 (LATEST commercial with Java 11+ support and Servlet 3) | 23.5 |
| 24.5 | 24.5 (LATEST release, Java 17+, Jakarta EE 10, Spring-boot 3) | 24.5 |
| main | 24.6 (Vaadin 24.6 preparations) | 24.6 |
| Branch | [Platform Version](https://github.com/vaadin/platform/releases) | [Flow Version](https://github.com/vaadin/flow/releases) |
|--------|-------------------------------------------------------------------------|---------------------------------------------------------|
| 1.0 | 10 (LTS) | 1.0 |
| 2.11 | 14.12 (LATEST commercial with Java 8+ support and Servlet 3) | 2.11 |
| 23.5 | 23.5 (LATEST commercial with Java 11+ support and Servlet 3) | 23.5 |
| 24.4 | 24.4 (maintained minor release, Java 17+, Jakarta EE 10, Spring-boot 3) | 24.4 |
| 24.5 | 24.5 (LATEST release, Java 17+, Jakarta EE 10, Spring-boot 3) | 24.5 |
| 24.6 | 24.6 (Vaadin 24.6 pre-release) | 24.6 |
| main | 24.7 (Vaadin 24.7 preparations) | 24.7 |
2 changes: 1 addition & 1 deletion flow-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>24.6-SNAPSHOT</version>
<version>24.7-SNAPSHOT</version>
</parent>
<artifactId>flow-bom</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion flow-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>24.6-SNAPSHOT</version>
<version>24.7-SNAPSHOT</version>
</parent>
<artifactId>flow-client</artifactId>
<name>Flow Client</name>
Expand Down
4 changes: 2 additions & 2 deletions flow-client/src/main/frontend/Flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class Flow {
script.onload = () => resolve();
script.onerror = reject;
script.src = url;
const nonce = $wnd.Vaadin.Flow.nonce;
const { nonce } = $wnd.Vaadin.Flow;
if (nonce !== undefined) {
script.setAttribute('nonce', nonce);
}
Expand All @@ -376,7 +376,7 @@ export class Flow {
const scriptAppId = document.createElement('script');
scriptAppId.type = 'module';
scriptAppId.setAttribute('data-app-id', appIdWithoutHashCode);
const nonce = $wnd.Vaadin.Flow.nonce;
const { nonce } = $wnd.Vaadin.Flow;
if (nonce !== undefined) {
scriptAppId.setAttribute('nonce', nonce);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public void send(final JsonObject payload) {
pushPendingMessage = payload;
push.push(payload);
} else {
Console.log("send XHR");
Console.debug("send XHR");
registry.getXhrConnection().send(payload);
}
}
Expand Down
2 changes: 1 addition & 1 deletion flow-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>24.6-SNAPSHOT</version>
<version>24.7-SNAPSHOT</version>
</parent>
<artifactId>flow-data</artifactId>
<name>Flow Data</name>
Expand Down
2 changes: 1 addition & 1 deletion flow-dnd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>flow-project</artifactId>
<groupId>com.vaadin</groupId>
<version>24.6-SNAPSHOT</version>
<version>24.7-SNAPSHOT</version>
</parent>

<artifactId>flow-dnd</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import java.util.Locale;

import org.slf4j.LoggerFactory;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.component.ComponentUtil;
Expand All @@ -25,6 +27,7 @@
import com.vaadin.flow.component.dependency.JsModule;
import com.vaadin.flow.component.dnd.internal.DndUtil;
import com.vaadin.flow.dom.Element;
import com.vaadin.flow.dom.Style;
import com.vaadin.flow.internal.nodefeature.VirtualChildrenList;
import com.vaadin.flow.shared.Registration;

Expand Down Expand Up @@ -344,6 +347,10 @@ default void setDragImage(Component dragImage) {
* the y-offset of the drag image
*/
default void setDragImage(Component dragImage, int offsetX, int offsetY) {
if (dragImage != null && !dragImage.isVisible()) {
throw new IllegalStateException(
"Drag image element is not visible and will not show.\nMake element visible to use as drag image!");
}
if (getDragImage() != null && getDragImage() != dragImage) {
// Remove drag image from the virtual children list if it's there.
if (getDraggableElement().getNode()
Expand All @@ -362,14 +369,12 @@ default void setDragImage(Component dragImage, int offsetX, int offsetY) {
getDragSourceComponent().addAttachListener(event -> {
if (!dragImage.isAttached()
&& dragImage.getParent().isEmpty()) {
getDraggableElement()
.appendVirtualChild(dragImage.getElement());
appendDragElement(dragImage.getElement());
}
event.unregisterListener();
});
} else {
getDraggableElement()
.appendVirtualChild(dragImage.getElement());
appendDragElement(dragImage.getElement());
}
}
ComponentUtil.setData(getDragSourceComponent(),
Expand All @@ -380,6 +385,21 @@ default void setDragImage(Component dragImage, int offsetX, int offsetY) {
(dragImage == null ? 0 : offsetY), getDraggableElement());
}

private void appendDragElement(Element dragElement) {
if (dragElement.getTag().equals("img")) {
getDraggableElement().appendVirtualChild(dragElement);
} else {
LoggerFactory.getLogger(DragSource.class).debug(
"Attaching child to dom in position -100,-100. Consider adding the component manually to not get overlapping components on drag for element.");
getDraggableElement().appendChild(dragElement);
Style style = dragElement.getStyle();
style.set("position", "absolute");
style.set("top", "-100px");
style.set("left", "-100px");
style.set("display", "none");
}
}

/**
* Get server side drag image. This image is applied automatically in the
* next drag start event in the browser.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ window.Vaadin.Flow.dndConnector = {
event.currentTarget.classList.add('v-dragged');
}
if(event.currentTarget.__dragImage) {
if(event.currentTarget.__dragImage.style.display === "none") {
event.currentTarget.__dragImage.style.display = "block";
event.currentTarget.classList.add('shown');
}
event.dataTransfer.setDragImage(
event.currentTarget.__dragImage,
event.currentTarget.__dragImageOffsetX,
Expand All @@ -102,6 +106,10 @@ window.Vaadin.Flow.dndConnector = {

__dragendListener: function (event) {
event.currentTarget.classList.remove('v-dragged');
if(event.currentTarget.classList.contains('shown')) {
event.currentTarget.classList.remove('shown');
event.currentTarget.__dragImage.style.display = "none";
}
},

updateDragSource: function (element) {
Expand Down
2 changes: 1 addition & 1 deletion flow-html-components-testbench/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>24.6-SNAPSHOT</version>
<version>24.7-SNAPSHOT</version>
</parent>
<artifactId>flow-html-components-testbench</artifactId>
<name>TestBench elements for Flow HTML Components</name>
Expand Down
2 changes: 1 addition & 1 deletion flow-html-components/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>24.6-SNAPSHOT</version>
<version>24.7-SNAPSHOT</version>
</parent>
<artifactId>flow-html-components</artifactId>
<name>Flow HTML Components</name>
Expand Down
2 changes: 1 addition & 1 deletion flow-jandex/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>24.6-SNAPSHOT</version>
<version>24.7-SNAPSHOT</version>
</parent>

<artifactId>flow-jandex</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion flow-lit-template/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>24.6-SNAPSHOT</version>
<version>24.7-SNAPSHOT</version>
</parent>
<artifactId>flow-lit-template</artifactId>
<name>Flow Lit Templates Support</name>
Expand Down
2 changes: 1 addition & 1 deletion flow-plugins/flow-dev-bundle-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-plugins</artifactId>
<version>24.6-SNAPSHOT</version>
<version>24.7-SNAPSHOT</version>
</parent>
<artifactId>flow-dev-bundle-plugin</artifactId>
<packaging>maven-plugin</packaging>
Expand Down
Loading

0 comments on commit 24b33d9

Please sign in to comment.