@demos-europe/demosplan-ui 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@ Since v0.0.10, this Changelog is formatted according to the [Common Changelog][c
4
4
 
5
5
  ## UNRELEASED
6
6
 
7
+ ## v0.25.0 - 2026-07-10
8
+
9
+ ### Fixed
10
+ - ([#1515](https://github.com/demos-europe/demosplan-ui/pull/1515)) DpNotification: Vertically align icon with notification text ([@hwiem](https://github.com/hwiem))
11
+ - ([#1516](https://github.com/demos-europe/demosplan-ui/pull/1516)) prefixClass: Ensure tailwind utility classes containing arbitrary values are prefixed ([@hwiem](https://github.com/hwiem))
12
+
13
+ ### Changed
14
+ - ([#1533](https://github.com/demos-europe/demosplan-ui/pull/1533)) DpApi: `dpApi.delete` accepts an optional request body for JSON:API relationship endpoints ([@riechedemos](https://github.com/riechedemos))
15
+
7
16
  ## v0.24.0 - 2026-06-12
8
17
 
9
18
  ### Added
@@ -19722,7 +19722,7 @@ Un.post = (t, e = {}, n = {}, r = {}) => ii({ method: "POST", url: t, data: n, p
19722
19722
  Un.get = (t, e = {}, n = {}) => ii({ method: "GET", url: t, params: e, options: n });
19723
19723
  Un.put = (t, e = {}, n = {}, r = {}) => ii({ method: "PUT", url: t, data: n, params: e, options: r });
19724
19724
  Un.patch = (t, e = {}, n = {}, r = {}) => ii({ method: "PATCH", url: t, data: n, params: e, options: r });
19725
- Un.delete = (t, e = {}, n = {}) => ii({ method: "DELETE", url: t, params: e, options: n });
19725
+ Un.delete = (t, e = {}, n = {}, r = {}) => ii({ method: "DELETE", url: t, data: r, params: e, options: n });
19726
19726
  const FX = function(t, e, n = null) {
19727
19727
  const r = {
19728
19728
  jsonrpc: "2.0",
@@ -21313,7 +21313,7 @@ function Yt(t = "") {
21313
21313
  return t;
21314
21314
  if (typeof t != "string")
21315
21315
  throw new Error("classList is an" + typeof t + ". should be String.", t);
21316
- return /[.#[]/gi.test(t) ? n = t.replace(/(\.)(\S+)/gi, (i, s, o) => `.${e}${o}`) : n = t.replace(/(\S+)/gi, (i) => `${e}${i}`), n;
21316
+ return /(?:^|\s)[.#[]|[a-zA-Z][.#[]/.test(t) ? n = t.replace(/(\.)(\S+)/gi, (i, s, o) => `.${e}${o}`) : n = t.replace(/(\S+)/gi, (i) => `${e}${i}`), n;
21317
21317
  }
21318
21318
  function nQ(t) {
21319
21319
  const e = document.createElement("canvas"), n = e.getContext("2d");
@@ -37434,16 +37434,16 @@ function qJ(t, e, n, r, i, s) {
37434
37434
  }, null, 8, ["class"])
37435
37435
  ], 42, FJ),
37436
37436
  b("div", {
37437
- class: H(t.prefixClass("flow-root"))
37437
+ class: H(t.prefixClass("flex items-start gap-1"))
37438
37438
  }, [
37439
37439
  oe(o, {
37440
- class: H(t.prefixClass("c-notify__icon mt-px mr-1 float-left")),
37440
+ class: H(t.prefixClass("c-notify__icon shrink-0 mt-[2px]")),
37441
37441
  icon: s.messageIcon,
37442
37442
  "aria-hidden": "true",
37443
37443
  weight: "fill"
37444
37444
  }, null, 8, ["class", "icon"]),
37445
37445
  b("div", {
37446
- class: H(t.prefixClass("c-notify__text u-ml mt-2 break-words"))
37446
+ class: H(t.prefixClass("c-notify__text break-words"))
37447
37447
  }, [
37448
37448
  st(ee(n.message.text) + " ", 1),
37449
37449
  n.message.linkUrl ? (m(), y("a", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@demos-europe/demosplan-ui",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "license": "MIT",
5
5
  "description": "Vue components, Vue directives, Design Token and Scss files to build interfaces for demosPlan.",
6
6
  "main": "./dist/demosplan-ui.mjs",
@@ -20,14 +20,14 @@
20
20
  />
21
21
  </button>
22
22
 
23
- <div :class="prefixClass('flow-root')">
23
+ <div :class="prefixClass('flex items-start gap-1')">
24
24
  <dp-icon
25
- :class="prefixClass('c-notify__icon mt-px mr-1 float-left')"
25
+ :class="prefixClass('c-notify__icon shrink-0 mt-[2px]')"
26
26
  :icon="messageIcon"
27
27
  aria-hidden="true"
28
28
  weight="fill"
29
29
  />
30
- <div :class="prefixClass('c-notify__text u-ml mt-2 break-words')">
30
+ <div :class="prefixClass('c-notify__text break-words')">
31
31
  {{ message.text }}
32
32
  <a
33
33
  v-if="message.linkUrl"
package/src/lib/DpApi.js CHANGED
@@ -123,7 +123,15 @@ dpApi.post = (url, params = {}, data = {}, options = {}) => doRequest({ method:
123
123
  dpApi.get = (url, params = {}, options = {}) => doRequest({ method: 'GET', url, params, options })
124
124
  dpApi.put = (url, params = {}, data = {}, options = {}) => doRequest({ method: 'PUT', url, data, params, options })
125
125
  dpApi.patch = (url, params = {}, data = {}, options = {}) => doRequest({ method: 'PATCH', url, data, params, options })
126
- dpApi.delete = (url, params = {}, options = {}) => doRequest({ method: 'DELETE', url, params, options })
126
+ /*
127
+ * `data` is intentionally the 4th param here (after `options`), unlike post/put/patch where it is the 3rd. A DELETE
128
+ * normally has no request body, so this method originally had no `data` param. JSON:API relationship endpoints,
129
+ * however, remove linkage by sending a body even on DELETE, e.g. DELETE /StatementGroup/{id}/relationships/statements
130
+ * { "data": [ { "type": "Statement", "id": "…" } ] } so a body is needed. Keeping `data` last preserves existing
131
+ * callers that pass `options` as the 3rd argument (e.g. store/map/Layers.js). For consistency with the other post/put/patch
132
+ * `data` should eventually move to the 3rd position — a breaking change that requires updating every such caller.
133
+ */
134
+ dpApi.delete = (url, params = {}, options = {}, data = {}) => doRequest({ method: 'DELETE', url, data, params, options })
127
135
 
128
136
  /**
129
137
  * Submit a request to the rpc_generic_post API, which implements JSON-RPC 2.0.
@@ -7,6 +7,7 @@
7
7
  */
8
8
  export default function prefixClass (classList = '') {
9
9
  let prefix = ''
10
+
10
11
  if (typeof dplan !== 'undefined' && dplan.settings && dplan.settings.publicCSSClassPrefix) {
11
12
  prefix = dplan.settings.publicCSSClassPrefix
12
13
  }
@@ -24,10 +25,19 @@ export default function prefixClass (classList = '') {
24
25
  }
25
26
 
26
27
  /*
27
- * Assuming that a querySelector is passed when classList contains a dot, only the class selector parts are prefixed.
28
- * In the unlikely case that classes contain dots as part of their names, they will not be prefixed.
28
+ * Assume a querySelector is passed when a `.`, `#` or `[` either starts a token (string start or after whitespace,
29
+ * e.g. `.foo`, `#id`, `[data-x]`) or attaches directly to a type selector, i.e. follows a letter (e.g. `div.foo`,
30
+ * `div#main`, `a[href]`). In that case only the class selector parts are prefixed.
31
+ * The "follows a letter" rule is what tells selectors apart from tailwind utility classes: a tailwind utility class
32
+ * never has a letter immediately before `.`/`#`/`[` - it's always a `-` or a digit (`mt-[2px]`, `grid-cols-[1fr]`,
33
+ * `mb-0.5`), or `[` itself for hex colors (`bg-[#fff]`).
34
+ *
35
+ * Known limitation: a token that *starts* with `[` is always treated as a selector, so tailwind arbitrary variants/properties
36
+ * (`[&>svg]:size-4`, `[mask-type:luminance]`) are not prefixed. They are indistinguishable from a real attribute
37
+ * selector by position alone and are currently not supported by prefixClass
29
38
  */
30
- const checkClassList = /[.#[]/gi
39
+ const checkClassList = /(?:^|\s)[.#[]|[a-zA-Z][.#[]/
40
+
31
41
  if (checkClassList.test(classList)) {
32
42
  prefixed = classList.replace(/(\.)(\S+)/gi, (cl, m1, m2) => `.${prefix}${m2}`)
33
43
  } else {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ * Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
  */
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-box-shadow-xl: 0 0 16px rgb(0 0 0 / 20%), 0 0 3px rgb(0 0 0 / 50%) !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-breakpoints-xl: 1400px;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-color-highlight-contrast: $dp-color-white !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-color-11-11: #313695;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-color-magenta-dark-2: #650324 !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-color-background-medium: $dp-color-neutral-light-3 !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-font-size-7: 50px !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-rounded-full: 9999px;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-space-1_5: 9px;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Fri, 12 Jun 2026 14:00:08 GMT
3
+ // Generated on Fri, 10 Jul 2026 09:21:07 GMT
4
4
 
5
5
 
6
6
  $dp-z-ultimate: 10000;