Repository: primefaces/primefaces (java)

Issue:
Galleria: thumbnails are shifted even if number of items <= numVisible
### Describe the bug

The shifting seems to only occur in some conditions, eg when using the p:galleria with 5 photo's and the numVisible attribute set to "6"

I would suggest to not shift when number of items <= numVisible

Relevant file:
https://github.com/primefaces/primefaces/blob/master/primefaces/src/main/resources/META-INF/resources/primefaces/galleria/0-galleriathumbnail.js

It seems that the block in `updated`:
```
else if (this.thumbnailItems.length - this.state.numVisible + this.getMedianIndex() < this.options.activeIndex) {
  totalShiftedItems = this.state.numVisible - this.thumbnailItems.length;
}
```
is executed, and sets the `totalShiftedItems` to 1.


### Reproducer

[primefaces-test-galleria.tar.gz](https://github.com/primefaces/primefaces/files/11947970/primefaces-test-galleria.tar.gz)


### Expected behavior

The banner containing the thumbnails should stay static when the number of images is smaller than the number of thumbs one wants to show

### PrimeFaces edition

Community + Elite

### PrimeFaces version

12.0.0 + 12.0.4

### Theme

_No response_

### JSF implementation

All

### JSF version

2.2 + 2.3

### Java version

1.8

### Browser(s)

_No response_

Pull request description:
Fix #10292: Galleria thumbnail don't shift if items <= visible
Fix #10292: Galleria thumbnail don't shift if items <= visible

Patch:
diff --git a/docs/13_0_0/components/colorpicker.md b/docs/13_0_0/components/colorpicker.md
index cd7a385abd..33ccafa5c3 100644
--- a/docs/13_0_0/components/colorpicker.md
+++ b/docs/13_0_0/components/colorpicker.md
@@ -135,10 +135,46 @@ ColorPicker has two modes, default mode is _popup_ and other available option is
 
 !> Inline mode only allows 1 instance of the inline ColorPicker on the page and you cannot mix Inline and Popup on the same page.  It is a limitation of Coloris.
 
+## Legacy Hex Color Handling
+Prior to 13.0.0 the ColorPicker only returned the 6 digit hex code without the `#` like `ffffff`.  Now by default it includes the hex code `#ffffff`.
+If `alpha=true` for alpha blends it will now be an 8 digit hex code like `#c71c1cff`.  If you prefer to have the ColorPicker act like it has before
+13.0.0 then make the following changes.
+
+```xhtml
+<p:colorPicker value="#{colorView.value}" alpha="false" converter="#{hexColorConverter}">
+```
+
+Using the following HexColorConverter to strip out the `#`.
+
+```java
+@Named
+@FacesConverter(value = "hexColorConverter", managed = true)
+public class HexColorConverter implements Converter<String> {
+
+    @Override
+    public String getAsObject(FacesContext context, UIComponent component, String value) {
+        if (LangUtils.isBlank(value)) {
+            return null;
+        }
+
+        return value.startsWith("#") ? value.substring(1) : value;
+    }
+
+    @Override
+    public String getAsString(FacesContext context, UIComponent component, String value) {
+        if (LangUtils.isBlank(value)) {
+            return null;
+        }
+
+        return value.startsWith("#") ? value : "#" + value;
+    }
+}
+```
+
 
 ## Localization and Accessibility
 ColorPicker is fully accessible both by keyboard and for visually impaired with proper ARIA screen reader support.
-To customize for your language you simplly need to update your `local-XX.js` file.  The subset of values respected
+To customize for your language you simply need to update your `local-XX.js` file.  The subset of values respected
 are below.  For full localization see the [localization documentation](/core/localization.md?id=client-localization).
 
 ```js
diff --git a/docs/migrationguide/13_0_0.md b/docs/migrationguide/13_0_0.md
index e7a151eacb..ef1ad7586d 100644
--- a/docs/migrationguide/13_0_0.md
+++ b/docs/migrationguide/13_0_0.md
@@ -31,6 +31,7 @@
 ## Color Picker
   * Library changed from legacy jQuery ColorPicker to Coloris. A lightweight and elegant JavaScript color picker written in vanilla ES6.
   * Value used to be hex only without the `#` like `ffffff` but now if using hex it includes the `#fffffff` because the new picker supports Hex, RGB, HSL color values.
+  * If you prefer the legacy hex behavior you will need to implement a [HexColorConverter](../13_0_0/components/colorpicker.md) to strip the `#`.
 
 ## Dashboard
   * Adding `responsive` mode has caused some re-factoring of the model specifically `DashboardColumn` to `DashboardWidget`.
diff --git a/pom.xml b/pom.xml
index 8d320b960d..ff855d03b3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
     <groupId>org.primefaces</groupId>
     <artifactId>primefaces-parent</artifactId>
     <packaging>pom</packaging>
-    <version>13.0.0-RC2</version>
+    <version>13.0.0-SNAPSHOT</version>
 
     <name>PrimeFaces Parent</name>
     <url>https://www.primefaces.org</url>
diff --git a/primefaces-cli/pom.xml b/primefaces-cli/pom.xml
index 717ab7dc40..7d8bcd7a1d 100644
--- a/primefaces-cli/pom.xml
+++ b/primefaces-cli/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>13.0.0-RC2</version>
+        <version>13.0.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-selenium/pom.xml b/primefaces-selenium/pom.xml
index 0ba50f1492..2e0c4794e6 100644
--- a/primefaces-selenium/pom.xml
+++ b/primefaces-selenium/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>13.0.0-RC2</version>
+        <version>13.0.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-selenium/primefaces-selenium-components/pom.xml b/primefaces-selenium/primefaces-selenium-components/pom.xml
index 8105df03de..17d19fa23e 100644
--- a/primefaces-selenium/primefaces-selenium-components/pom.xml
+++ b/primefaces-selenium/primefaces-selenium-components/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-selenium</artifactId>
-        <version>13.0.0-RC2</version>
+        <version>13.0.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-selenium/primefaces-selenium-core/pom.xml b/primefaces-selenium/primefaces-selenium-core/pom.xml
index af40bbadd2..4c70aa0575 100644
--- a/primefaces-selenium/primefaces-selenium-core/pom.xml
+++ b/primefaces-selenium/primefaces-selenium-core/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-selenium</artifactId>
-        <version>13.0.0-RC2</version>
+        <version>13.0.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-showcase/pom.xml b/primefaces-showcase/pom.xml
index cf529b3491..74d887e1fa 100644
--- a/primefaces-showcase/pom.xml
+++ b/primefaces-showcase/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>13.0.0-RC2</version>
+        <version>13.0.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces/pom.xml b/primefaces/pom.xml
index 8246d52dac..684a07d12c 100644
--- a/primefaces/pom.xml
+++ b/primefaces/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>13.0.0-RC2</version>
+        <version>13.0.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces/src/main/java/org/primefaces/component/tree/TreeRenderer.java b/primefaces/src/main/java/org/primefaces/component/tree/TreeRenderer.java
index a316cee602..c1cad35306 100644
--- a/primefaces/src/main/java/org/primefaces/component/tree/TreeRenderer.java
+++ b/primefaces/src/main/java/org/primefaces/component/tree/TreeRenderer.java
@@ -77,8 +77,10 @@ public class TreeRenderer extends CoreRenderer {
     public void decodeSelection(FacesContext context, Tree tree, TreeNode root) {
         boolean multiple = tree.isMultipleSelectionMode();
         Class<?> selectionType = tree.getSelectionType();
+        boolean hasSelectionType = selectionType != null;
 
-        if (multiple && !selectionType.isArray() && !List.class.isAssignableFrom(selectionType)) {
+        if ((multiple && !hasSelectionType) ||
+                (multiple && hasSelectionType && !selectionType.isArray()) && !List.class.isAssignableFrom(selectionType)) {
             throw new FacesException("Multiple selection reference must be an Array or a List for Tree " + tree.getClientId());
         }
 
diff --git a/primefaces/src/main/resources/META-INF/resources/primefaces/galleria/0-galleriathumbnail.js b/primefaces/src/main/resources/META-INF/resources/primefaces/galleria/0-galleriathumbnail.js
index 2511f765b5..dd8bf9c5f9 100644
--- a/primefaces/src/main/resources/META-INF/resources/primefaces/galleria/0-galleriathumbnail.js
+++ b/primefaces/src/main/resources/META-INF/resources/primefaces/galleria/0-galleriathumbnail.js
@@ -328,7 +328,7 @@
             var totalShiftedItems = this.state.totalShiftedItems;
 
             if (prevState.numVisible !== this.state.numVisible || prevOptions.activeIndex !== this.options.activeIndex) {
-                if (this.options.activeIndex <= this.getMedianIndex()) {
+                if (this.options.activeIndex <= this.getMedianIndex() || this.thumbnailItems.length <= this.state.numVisible) {
                     totalShiftedItems = 0;
                 }
                 else if (this.thumbnailItems.length - this.state.numVisible + this.getMedianIndex() < this.options.activeIndex) {


Test patch:
diff --git a/primefaces-integration-tests-jakarta/pom.xml b/primefaces-integration-tests-jakarta/pom.xml
index 42de32dd40..8e15dc2939 100644
--- a/primefaces-integration-tests-jakarta/pom.xml
+++ b/primefaces-integration-tests-jakarta/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>13.0.0-RC2</version>
+        <version>13.0.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-integration-tests/pom.xml b/primefaces-integration-tests/pom.xml
index 368b0e0eda..03833c9aae 100644
--- a/primefaces-integration-tests/pom.xml
+++ b/primefaces-integration-tests/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>13.0.0-RC2</version>
+        <version>13.0.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>