From 61fc282ea56579b60f9dc37ef18de32cc8eb25d6 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Fri, 23 Feb 2024 17:33:11 +0100
Subject: [PATCH] fix: path

---
 src/solid-ofn-rpp.js | 10 ----------
 src/utils.js         |  9 +++++----
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/src/solid-ofn-rpp.js b/src/solid-ofn-rpp.js
index 42991b5..eaf1bf5 100644
--- a/src/solid-ofn-rpp.js
+++ b/src/solid-ofn-rpp.js
@@ -221,16 +221,6 @@ import("./utils.js").then((utils) => {
       },
     });
 
-    // Custom widget for select with ofn:label
-    core.Sib.register({
-      name: "custom-label-select",
-      use: [core.TemplatesDependenciesMixins.FormDropdownMixin, core.TemplatesDependenciesMixins.FormMixin, core.TemplatesDependenciesMixins.RangeMixin, core.BaseWidgetMixin],
-      template(value, attributes) {
-        debugger;
-        this.element.innerHTML += ``;
-      },
-    });
-
     customElements.define(
       "solid-ofn-rpp",
       class extends LitElement {
diff --git a/src/utils.js b/src/utils.js
index 0639847..6f0d487 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -5,12 +5,13 @@ export const CLIENT_CONTEXT = {
 };
 
 /**
- * A function that returns the current path.
+ * Generate the path from the target URL.
  *
- * @return {string} the current path
+ * @param {string} target - The target URL to generate the path from. Defaults to current directory.
+ * @return {string} The generated path.
  */
-export function path() {
-  let path = ".";
+export function path(target=".") {
+  let path = new URL(target, import.meta.url).href;
   return path;
 }
 
-- 
GitLab