Skip to content

Commit e09112a

Browse files
committed
feat: update flo legal decision tree client to 1.17.0
1 parent 2a6239e commit e09112a

File tree

11 files changed

+137
-21
lines changed

11 files changed

+137
-21
lines changed

.changeset/tall-queens-beg.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@utrecht/flo-legal-decision-tree-client": patch
3+
"@utrecht/flolegal-decision-tree-css": patch
4+
---
5+
6+
Update de Flo Legal Decision Tree client en CSS naar versie 1.17.0 om bugfixes en verbeteringen door te voeren.

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ packages/web-component-library-vue/src/vue-component-lib/
2424

2525
packages/flolegal-decision-tree-client/assets/flo-client-styles.css
2626
packages/flolegal-decision-tree-client/assets/flo-client-plugin.js
27+
packages/flolegal-decision-tree-client/assets/flo-client-plugin-polyfills.js

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ packages/astro/.astro
3434

3535
packages/flolegal-decision-tree-client/assets/flo-client-styles.css
3636
packages/flolegal-decision-tree-client/assets/flo-client-plugin.js
37+
packages/flolegal-decision-tree-client/assets/flo-client-plugin-polyfills.js

components/flo-legal-decision-tree/src/index.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
/**
1515
* The nesting is intended to make the CSS specificity higher than the CSS in
16-
* /packages/flolegal-decision-tree-client/assets/flo-client-styles.1.13.2.css
16+
* /packages/flolegal-decision-tree-client/assets/flo-client-styles.1.17.0.css
1717
* This allows Utrecht Design System styles to override the default Flo client styles.
1818
*/
1919
.utrecht-flolegal-decision-tree-container {
@@ -60,6 +60,19 @@
6060
}
6161
}
6262

63+
.flo-nav .flo-form-button.flo-form-button-restart {
64+
@include utrecht-button;
65+
@include utrecht-button-appearance-properties("utrecht-button", "primary-action");
66+
67+
&:hover {
68+
@include utrecht-button--hover;
69+
}
70+
71+
&:disabled:hover {
72+
@include utrecht-button--disabled;
73+
}
74+
}
75+
6376
.flo-nav .flo-form-button:disabled {
6477
@include utrecht-button--disabled;
6578
@include utrecht-flo-decision-form-button;

packages/flolegal-decision-tree-client/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# @utrecht/flolegal-decision-tree-client
22

33
Flo client assets and utilities for the Utrecht Design System.
4-
**Compatible with Flo Client Plugin v1.13.2**
4+
**Compatible with Flo Client Plugin v1.17.0**
55

66
## Installation
77

@@ -15,7 +15,7 @@ npm install @utrecht/flolegal-decision-tree-client
1515

1616
```tsx
1717
import { loadFloClientScript } from "@utrecht/flolegal-decision-tree-client";
18-
import "@utrecht/flolegal-decision-tree-client/dist/assets/flo-client-styles.1.13.2.css";
18+
import "@utrecht/flo-legal-decision-tree-client/dist/assets/flo-client-styles.css";
1919

2020
// Load the script
2121
await loadFloClientScript("./");
@@ -79,7 +79,7 @@ For Next.js applications, copy the script to your public directory and use the `
7979
```json
8080
{
8181
"scripts": {
82-
"copy:flo-plugin": "cp node_modules/@utrecht/flolegal-decision-tree-client/assets/flo-client-plugin.1.13.2.js ./public",
82+
"copy-flo-legal-decision-tree-client-script": "cp ../../node_modules/@utrecht/flo-legal-decision-tree-client/dist/assets/flo-client-plugin.js ../../node_modules/@utrecht/flo-legal-decision-tree-client/dist/assets/flo-client-plugin-polyfills.js ./public",
8383
"postinstall": "yarn copy:flo-plugin"
8484
}
8585
}
@@ -101,7 +101,8 @@ import Script from "next/script";
101101
export default function MyPage() {
102102
return (
103103
<>
104-
<Script src="/flo-client-plugin.1.23.2.js" nonce={nonce} />
104+
<Script src="/flo-client-plugin-polyfills.js" type="module" nonce={nonce} />
105+
<Script src="/flo-client-plugin.js" type="module" nonce={nonce} />
105106
{/* Your component content */}
106107
</>
107108
);

packages/flolegal-decision-tree-client/assets/flo-client-plugin-polyfills.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/flolegal-decision-tree-client/assets/flo-client-plugin.js

Lines changed: 65 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/flolegal-decision-tree-client/assets/flo-client-styles.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/flolegal-decision-tree-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.2",
44
"license": "EUPL-1.2",
55
"author": "Community for NL Design System",
6-
"description": "Flo legal Decision Tree client assets for Utrecht Design System (compatible with flo-client-plugin v1.13.2)",
6+
"description": "Flo legal Decision Tree client assets for Utrecht Design System (compatible with flo-client-plugin v1.17.0)",
77
"main": "dist/index.js",
88
"types": "dist/index.d.ts",
99
"keywords": [
Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/**
22
* Flo Client Plugin Version
3-
* This package is compatible with flo-client-plugin version 1.13.2
3+
* This package is compatible with flo-client-plugin version 1.17.0
44
*/
55
const FLO_CLIENT_SCRIPT = `flo-client-plugin.js`;
6+
const FLO_CLIENT_POLYFILLS_SCRIPT = `flo-client-plugin-polyfills.js`;
67

78
export interface LoadScriptOptions {
89
nonce?: string;
@@ -17,19 +18,32 @@ export const loadFloClientScript = (basePath?: string, options: LoadScriptOption
1718
}
1819

1920
const base = basePath ? new URL(basePath, window.location.origin).href : window.location.origin;
20-
const src = new URL(FLO_CLIENT_SCRIPT, base).href;
21-
if (document.querySelector(`script[src="${src}"]`)) {
21+
const polyfillsSrc = new URL(FLO_CLIENT_POLYFILLS_SCRIPT, base).href;
22+
const mainSrc = new URL(FLO_CLIENT_SCRIPT, base).href;
23+
24+
if (document.querySelector(`script[src="${mainSrc}"]`)) {
2225
resolve();
2326
return;
2427
}
2528

26-
const script = document.createElement('script');
27-
script.src = src;
28-
if (options.nonce) script.nonce = options.nonce;
29-
if (options.integrity) script.integrity = options.integrity;
30-
script.onload = () => resolve();
31-
script.onerror = () =>
32-
reject(new Error(`Failed to load ${src}. Make sure the file is available in your static assets.`));
33-
document.head.appendChild(script);
29+
const polyfillsScript = document.createElement('script');
30+
polyfillsScript.src = polyfillsSrc;
31+
polyfillsScript.type = 'module';
32+
if (options.nonce) polyfillsScript.nonce = options.nonce;
33+
if (options.integrity) polyfillsScript.integrity = options.integrity;
34+
polyfillsScript.onerror = () =>
35+
reject(new Error(`Failed to load ${polyfillsSrc}. Make sure the file is available in your static assets.`));
36+
37+
const mainScript = document.createElement('script');
38+
mainScript.src = mainSrc;
39+
mainScript.type = 'module';
40+
if (options.nonce) mainScript.nonce = options.nonce;
41+
if (options.integrity) mainScript.integrity = options.integrity;
42+
mainScript.onload = () => resolve();
43+
mainScript.onerror = () =>
44+
reject(new Error(`Failed to load ${mainSrc}. Make sure the file is available in your static assets.`));
45+
46+
document.head.appendChild(polyfillsScript);
47+
document.head.appendChild(mainScript);
3448
});
3549
};

0 commit comments

Comments
 (0)