@soleil-se/config-svelte 1.27.12 → 1.27.13
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.
- package/CHANGELOG.md +6 -0
- package/README.md +2 -4
- package/components/Checkbox/README.md +3 -3
- package/components/CheckboxGroup/Component.svelte +9 -6
- package/components/CheckboxGroup/README.md +3 -3
- package/components/CustomList/README.md +6 -6
- package/components/CustomSelector/Component.svelte +5 -5
- package/components/CustomSelector/README.md +4 -4
- package/components/DropdownSelector/README.md +3 -3
- package/components/ImageSelector/Component.svelte +1 -0
- package/components/ImageSelector/README.md +3 -3
- package/components/InputField/README.md +3 -3
- package/components/LinkSelector/README.md +3 -3
- package/components/ListSelector/README.md +3 -3
- package/components/Modal/Component.svelte +1 -1
- package/components/Modal/README.md +4 -4
- package/components/NodeSelector/README.md +3 -3
- package/components/NumberSpinner/README.md +3 -3
- package/components/Panel/Component.svelte +4 -0
- package/components/Panel/README.md +1 -1
- package/components/RadioGroup/README.md +3 -3
- package/components/RepositoryNodeSelector/README.md +4 -4
- package/components/SelectField/README.md +3 -3
- package/components/TagSelector/README.md +3 -3
- package/components/TextList/README.md +3 -3
- package/eslint.config.js +5 -0
- package/package.json +11 -19
- package/prettier.config.js +1 -0
- package/stylelint.config.js +3 -0
- package/utils/createI18n.js +1 -1
- package/utils/getAppContext.js +1 -1
- package/.eslintrc.cjs +0 -4
- package/.prettierrc.cjs +0 -1
- package/.stylelintrc.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file.
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
+
## [1.27.13] - 2025-02-21
|
|
11
|
+
|
|
12
|
+
- Disallow the selection folders in `ImageSelector`.
|
|
13
|
+
- Move data holder in `CheckboxGroup` for correct margins.
|
|
14
|
+
- Fixa margins for help text in form groups.
|
|
15
|
+
|
|
10
16
|
## [1.27.12] - 2025-01-30
|
|
11
17
|
|
|
12
18
|
- Properly clear value in `DropdownSelector`.
|
package/README.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# @soleil-se/config
|
|
1
|
+
# @soleil-se/svelte-config
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[Documentation](https://docs.soleil.se/packages/config-svelte) | [Changelog](https://docs.soleil.se/packages/config-svelte/changelog)
|
|
3
|
+
[Documentation](https://docs.soleil.se/packages/svelte-config) | [Changelog](https://docs.soleil.se/packages/svelte-config/changelog)
|
|
@@ -28,7 +28,7 @@ Use checked attribute if the checkbox should be checked as default
|
|
|
28
28
|
|
|
29
29
|
```svelte
|
|
30
30
|
<script>
|
|
31
|
-
import { Panel, Checkbox } from '@soleil
|
|
31
|
+
import { Panel, Checkbox } from '@soleil/svelte-config';
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<Panel heading="Inställningar">
|
|
@@ -40,8 +40,8 @@ import { Panel, Checkbox } from '@soleil-se/svelte-config';
|
|
|
40
40
|
|
|
41
41
|
```svelte
|
|
42
42
|
<script>
|
|
43
|
-
import { Panel, Checkbox } from '@soleil
|
|
44
|
-
import { onSave } from '@soleil
|
|
43
|
+
import { Panel, Checkbox } from '@soleil/svelte-config';
|
|
44
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
45
45
|
|
|
46
46
|
const values = {
|
|
47
47
|
checkbox: '',
|
|
@@ -49,7 +49,15 @@
|
|
|
49
49
|
[README](https://docs.soleil.se/packages/soleil/svelte-config/components/checkboxgroup/)
|
|
50
50
|
-->
|
|
51
51
|
|
|
52
|
+
|
|
53
|
+
|
|
52
54
|
<fieldset class="form-group {className}" class:hidden={!show}>
|
|
55
|
+
<!-- Need to put values in a select with multiple to make sure the value is an array -->
|
|
56
|
+
<select {name} hidden multiple {value}>
|
|
57
|
+
{#each options as option}
|
|
58
|
+
<option value={option.value ?? option}></option>
|
|
59
|
+
{/each}
|
|
60
|
+
</select>
|
|
53
61
|
<legend class:sr-only={legendVisuallyHidden}>
|
|
54
62
|
<slot name="legend">{legend}</slot>
|
|
55
63
|
</legend>
|
|
@@ -75,12 +83,7 @@
|
|
|
75
83
|
<slot />
|
|
76
84
|
</fieldset>
|
|
77
85
|
|
|
78
|
-
|
|
79
|
-
<select {name} hidden multiple {value}>
|
|
80
|
-
{#each options as option}
|
|
81
|
-
<option value={option.value ?? option}></option>
|
|
82
|
-
{/each}
|
|
83
|
-
</select>
|
|
86
|
+
|
|
84
87
|
|
|
85
88
|
<style lang="scss">
|
|
86
89
|
fieldset {
|
|
@@ -42,7 +42,7 @@ Use the value prop to set a default value when not binding the value:
|
|
|
42
42
|
|
|
43
43
|
```svelte
|
|
44
44
|
<script>
|
|
45
|
-
import { Panel, CheckboxGroup } from '@soleil
|
|
45
|
+
import { Panel, CheckboxGroup } from '@soleil/svelte-config';
|
|
46
46
|
</script>
|
|
47
47
|
|
|
48
48
|
<Panel heading="Inställningar">
|
|
@@ -68,8 +68,8 @@ import { Panel, CheckboxGroup } from '@soleil-se/svelte-config';
|
|
|
68
68
|
|
|
69
69
|
```svelte
|
|
70
70
|
<script>
|
|
71
|
-
import { Panel, CheckboxGroup } from '@soleil
|
|
72
|
-
import { onSave } from '@soleil
|
|
71
|
+
import { Panel, CheckboxGroup } from '@soleil/svelte-config';
|
|
72
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
73
73
|
|
|
74
74
|
const values = {
|
|
75
75
|
checkboxGroup1: [],
|
|
@@ -33,7 +33,7 @@ This id needs to be prefixed to the `name` attribute.
|
|
|
33
33
|
|
|
34
34
|
```svelte
|
|
35
35
|
<script>
|
|
36
|
-
import { Panel, CustomList, InputField, NodeSelector } from '@soleil
|
|
36
|
+
import { Panel, CustomList, InputField, NodeSelector } from '@soleil/svelte-config';
|
|
37
37
|
</script>
|
|
38
38
|
|
|
39
39
|
<Panel>
|
|
@@ -73,7 +73,7 @@ No list of icons is available, but you can inspect an icon in the edit interface
|
|
|
73
73
|
|
|
74
74
|
```svelte
|
|
75
75
|
<script>
|
|
76
|
-
import { Panel, CustomList, InputField, NodeSelector } from '@soleil
|
|
76
|
+
import { Panel, CustomList, InputField, NodeSelector } from '@soleil/svelte-config';
|
|
77
77
|
</script>
|
|
78
78
|
|
|
79
79
|
<Panel>
|
|
@@ -93,7 +93,7 @@ For this to work it's easiest to handle the modal content in a separate componen
|
|
|
93
93
|
```svelte
|
|
94
94
|
// App.svelte
|
|
95
95
|
<script>
|
|
96
|
-
import { Panel, CustomList } from '@soleil
|
|
96
|
+
import { Panel, CustomList } from '@soleil/svelte-config';
|
|
97
97
|
import Settings from './Settings.svelte';
|
|
98
98
|
</script>
|
|
99
99
|
|
|
@@ -107,7 +107,7 @@ For this to work it's easiest to handle the modal content in a separate componen
|
|
|
107
107
|
```svelte
|
|
108
108
|
// Settings.svelte
|
|
109
109
|
<script>
|
|
110
|
-
import { InputField, NodeSelector, CustomListItemTemplate } from '@soleil
|
|
110
|
+
import { InputField, NodeSelector, CustomListItemTemplate } from '@soleil/svelte-config';
|
|
111
111
|
|
|
112
112
|
export let id;
|
|
113
113
|
let name;
|
|
@@ -128,7 +128,7 @@ on mount since the list doesn't know when all data is available.
|
|
|
128
128
|
```svelte
|
|
129
129
|
// App.svelte
|
|
130
130
|
<script>
|
|
131
|
-
import { Panel, CustomList } from '@soleil
|
|
131
|
+
import { Panel, CustomList } from '@soleil/svelte-config';
|
|
132
132
|
import Settings from './Settings.svelte';
|
|
133
133
|
</script>
|
|
134
134
|
|
|
@@ -142,7 +142,7 @@ on mount since the list doesn't know when all data is available.
|
|
|
142
142
|
```svelte
|
|
143
143
|
// Settings.svelte
|
|
144
144
|
<script>
|
|
145
|
-
import { NodeSelector, CustomListItemTemplate } from '@soleil
|
|
145
|
+
import { NodeSelector, CustomListItemTemplate } from '@soleil/svelte-config';
|
|
146
146
|
import { onMount } from 'svelte';
|
|
147
147
|
|
|
148
148
|
export let id;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
/** @type {string | string[]} */
|
|
32
32
|
export let value = multiple ? [] : '';
|
|
33
33
|
|
|
34
|
-
value = !removable && !multiple ? value || options[0]?.value
|
|
34
|
+
value = !removable && !multiple ? (value || (options[0]?.value ?? options[0] ?? '')) : value;
|
|
35
35
|
value = name ? (values[name]?.value ?? values[name] ?? value) : value;
|
|
36
36
|
value = Array.isArray(value) ? value.map((v) => v.value ?? v) : value;
|
|
37
37
|
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
async function triggerChange() {
|
|
44
44
|
await tick();
|
|
45
|
-
jQuery(element).val(value).trigger('change');
|
|
45
|
+
window.jQuery(element).val(value).trigger('change');
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
$: if (element && options) triggerChange();
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
// Need to use == instead of === because of loose comparison of types.
|
|
58
58
|
// eslint-disable-next-line eqeqeq
|
|
59
59
|
const option = options.find((o) => (o.value ?? o) == v);
|
|
60
|
-
return option
|
|
60
|
+
return option?.value ?? option ?? '';
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
onMount(() => {
|
|
65
65
|
// Instansiate select2 ourselves to be able to use more options.
|
|
66
66
|
if (multiple) element.setAttribute('multiple', '');
|
|
67
|
-
jQuery(element)
|
|
67
|
+
window.jQuery(element)
|
|
68
68
|
.select2({
|
|
69
69
|
placeholder,
|
|
70
70
|
width: '100%',
|
|
@@ -113,7 +113,6 @@
|
|
|
113
113
|
</option>
|
|
114
114
|
{/each}
|
|
115
115
|
</select>
|
|
116
|
-
<slot />
|
|
117
116
|
{#if multiple}
|
|
118
117
|
<select {name} hidden multiple {value}>
|
|
119
118
|
{#each options as option}
|
|
@@ -121,4 +120,5 @@
|
|
|
121
120
|
{/each}
|
|
122
121
|
</select>
|
|
123
122
|
{/if}
|
|
123
|
+
<slot />
|
|
124
124
|
</div>
|
|
@@ -28,7 +28,7 @@ export let value = '';
|
|
|
28
28
|
|
|
29
29
|
```svelte
|
|
30
30
|
<script>
|
|
31
|
-
import { Panel, CustomSelector } from '@soleil
|
|
31
|
+
import { Panel, CustomSelector } from '@soleil/svelte-config';
|
|
32
32
|
|
|
33
33
|
const options = [
|
|
34
34
|
{ label: 'Värde 1', value: 'value1' },
|
|
@@ -46,8 +46,8 @@ export let value = '';
|
|
|
46
46
|
|
|
47
47
|
```svelte
|
|
48
48
|
<script>
|
|
49
|
-
import { Panel, CustomSelector } from '@soleil
|
|
50
|
-
import { onSave } from '@soleil
|
|
49
|
+
import { Panel, CustomSelector } from '@soleil/svelte-config';
|
|
50
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
51
51
|
|
|
52
52
|
export let values;
|
|
53
53
|
|
|
@@ -80,7 +80,7 @@ The option is available as slot prop.
|
|
|
80
80
|
|
|
81
81
|
```svelte
|
|
82
82
|
<script>
|
|
83
|
-
import { Panel, CustomSelector } from '@soleil
|
|
83
|
+
import { Panel, CustomSelector } from '@soleil/svelte-config';
|
|
84
84
|
|
|
85
85
|
const options = [
|
|
86
86
|
{ label: 'Värde 1', value: 'value1', type: 'Typ 1' },
|
|
@@ -50,7 +50,7 @@ For `custom-selector` use [CustomSelector](../CustomSelector).
|
|
|
50
50
|
|
|
51
51
|
```svelte
|
|
52
52
|
<script>
|
|
53
|
-
import { Panel, DropdownSelector } from '@soleil
|
|
53
|
+
import { Panel, DropdownSelector } from '@soleil/svelte-config';
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<Panel heading="Inställningar">
|
|
@@ -62,8 +62,8 @@ import { Panel, DropdownSelector } from '@soleil-se/svelte-config';
|
|
|
62
62
|
|
|
63
63
|
```svelte
|
|
64
64
|
<script>
|
|
65
|
-
import { Panel, DropdownSelector } from '@soleil
|
|
66
|
-
import { onSave } from '@soleil
|
|
65
|
+
import { Panel, DropdownSelector } from '@soleil/svelte-config';
|
|
66
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
67
67
|
|
|
68
68
|
const values = {
|
|
69
69
|
metadata: '',
|
|
@@ -55,7 +55,7 @@ export let hideDecorative = false;
|
|
|
55
55
|
|
|
56
56
|
```svelte
|
|
57
57
|
<script>
|
|
58
|
-
import { ImageSelector } from '@soleil
|
|
58
|
+
import { ImageSelector } from '@soleil/svelte-config';
|
|
59
59
|
</script>
|
|
60
60
|
|
|
61
61
|
<ImageSelector name="image" heading="Bild" />
|
|
@@ -68,8 +68,8 @@ export let hideDecorative = false;
|
|
|
68
68
|
|
|
69
69
|
```svelte
|
|
70
70
|
<script>
|
|
71
|
-
import { ImageSelector } from '@soleil
|
|
72
|
-
import { onSave } from '@soleil
|
|
71
|
+
import { ImageSelector } from '@soleil/svelte-config';
|
|
72
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
73
73
|
|
|
74
74
|
const values = window.CONFIG_VALUES || {};
|
|
75
75
|
|
|
@@ -50,7 +50,7 @@ export let value = '';
|
|
|
50
50
|
|
|
51
51
|
```svelte
|
|
52
52
|
<script>
|
|
53
|
-
import { Panel, InputField } from '@soleil
|
|
53
|
+
import { Panel, InputField } from '@soleil/svelte-config';
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<Panel heading="Inställningar">
|
|
@@ -62,8 +62,8 @@ export let value = '';
|
|
|
62
62
|
|
|
63
63
|
```svelte
|
|
64
64
|
<script>
|
|
65
|
-
import { Panel, InputField } from '@soleil
|
|
66
|
-
import { onSave } from '@soleil
|
|
65
|
+
import { Panel, InputField } from '@soleil/svelte-config';
|
|
66
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
67
67
|
|
|
68
68
|
const values = {
|
|
69
69
|
text: '',
|
|
@@ -95,7 +95,7 @@ Top and bottom slots before and after link selector.
|
|
|
95
95
|
|
|
96
96
|
```svelte
|
|
97
97
|
<script>
|
|
98
|
-
import { LinkSelector } from '@soleil
|
|
98
|
+
import { LinkSelector } from '@soleil/svelte-config';
|
|
99
99
|
</script>
|
|
100
100
|
|
|
101
101
|
<LinkSelector name="link" heading="Länk" />
|
|
@@ -106,8 +106,8 @@ Top and bottom slots before and after link selector.
|
|
|
106
106
|
|
|
107
107
|
```svelte
|
|
108
108
|
<script>
|
|
109
|
-
import { LinkSelector } from '@soleil
|
|
110
|
-
import { pluckPrefix, addPrefix, onSave } from '@soleil
|
|
109
|
+
import { LinkSelector } from '@soleil/svelte-config';
|
|
110
|
+
import { pluckPrefix, addPrefix, onSave } from '@soleil/svelte-config/utils';
|
|
111
111
|
|
|
112
112
|
// Plucks object properties with keys prefixed with 'link' and removes the prefix.
|
|
113
113
|
// { linkType, linkValue, linkNewWindow } -> { type, value, newWindow }
|
|
@@ -62,7 +62,7 @@ For `tags-selector` use [TagSelector](../TagSelector).
|
|
|
62
62
|
|
|
63
63
|
```svelte
|
|
64
64
|
<script>
|
|
65
|
-
import { Panel, ListSelector } from '@soleil
|
|
65
|
+
import { Panel, ListSelector } from '@soleil/svelte-config';
|
|
66
66
|
</script>
|
|
67
67
|
|
|
68
68
|
<Panel heading="Inställningar">
|
|
@@ -74,8 +74,8 @@ import { Panel, ListSelector } from '@soleil-se/svelte-config';
|
|
|
74
74
|
|
|
75
75
|
```svelte
|
|
76
76
|
<script>
|
|
77
|
-
import { Panel, ListSelector } from '@soleil
|
|
78
|
-
import { onSave } from '@soleil
|
|
77
|
+
import { Panel, ListSelector } from '@soleil/svelte-config';
|
|
78
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
79
79
|
|
|
80
80
|
const values = {
|
|
81
81
|
pages: '',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
/* eslint svelte/no-unused-svelte-ignore: "off" */
|
|
3
3
|
|
|
4
|
-
import validate from '@soleil
|
|
4
|
+
import validate from '@soleil/config-validate';
|
|
5
5
|
import { onMount, onDestroy, createEventDispatcher } from 'svelte';
|
|
6
6
|
import A11yDialog from 'a11y-dialog';
|
|
7
7
|
import { generateId } from '../../utils';
|
|
@@ -30,7 +30,7 @@ export let element; // Modal DOM element.
|
|
|
30
30
|
|
|
31
31
|
```svelte
|
|
32
32
|
<script>
|
|
33
|
-
import { Panel, Modal, InputField, NodeSelector } from '@soleil
|
|
33
|
+
import { Panel, Modal, InputField, NodeSelector } from '@soleil/svelte-config';
|
|
34
34
|
|
|
35
35
|
let open = false;
|
|
36
36
|
</script>
|
|
@@ -50,8 +50,8 @@ Advanced configs are **not** recommended.
|
|
|
50
50
|
|
|
51
51
|
```svelte
|
|
52
52
|
<script>
|
|
53
|
-
import { Panel, Modal, InputField, NodeSelector } from '@soleil
|
|
54
|
-
import { onSave } from '@soleil
|
|
53
|
+
import { Panel, Modal, InputField, NodeSelector } from '@soleil/svelte-config';
|
|
54
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
55
55
|
|
|
56
56
|
export let values;
|
|
57
57
|
|
|
@@ -87,7 +87,7 @@ Advanced configs are **not** recommended.
|
|
|
87
87
|
|
|
88
88
|
```svelte
|
|
89
89
|
<script>
|
|
90
|
-
import { Modal } from '@soleil
|
|
90
|
+
import { Modal } from '@soleil/svelte-config';
|
|
91
91
|
|
|
92
92
|
let open = false;
|
|
93
93
|
</script>
|
|
@@ -51,7 +51,7 @@ For `tags-selector` use [TagSelector](../TagSelector).
|
|
|
51
51
|
|
|
52
52
|
```svelte
|
|
53
53
|
<script>
|
|
54
|
-
import { Panel, NodeSelector } from '@soleil
|
|
54
|
+
import { Panel, NodeSelector } from '@soleil/svelte-config';
|
|
55
55
|
</script>
|
|
56
56
|
|
|
57
57
|
<Panel heading="Inställningar">
|
|
@@ -67,8 +67,8 @@ For `tags-selector` use [TagSelector](../TagSelector).
|
|
|
67
67
|
|
|
68
68
|
```svelte
|
|
69
69
|
<script>
|
|
70
|
-
import { Panel, NodeSelector } from '@soleil
|
|
71
|
-
import { onSave } from '@soleil
|
|
70
|
+
import { Panel, NodeSelector } from '@soleil/svelte-config';
|
|
71
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
72
72
|
|
|
73
73
|
const values = {
|
|
74
74
|
page: '',
|
|
@@ -27,7 +27,7 @@ export let class = '';
|
|
|
27
27
|
|
|
28
28
|
```svelte
|
|
29
29
|
<script>
|
|
30
|
-
import { Panel, NumberSpinner } from '@soleil
|
|
30
|
+
import { Panel, NumberSpinner } from '@soleil/svelte-config';
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
33
|
<Panel heading="Inställningar">
|
|
@@ -39,8 +39,8 @@ export let class = '';
|
|
|
39
39
|
|
|
40
40
|
```svelte
|
|
41
41
|
<script>
|
|
42
|
-
import { Panel, NumberSpinner } from '@soleil
|
|
43
|
-
import { onSave } from '@soleil
|
|
42
|
+
import { Panel, NumberSpinner } from '@soleil/svelte-config';
|
|
43
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
44
44
|
|
|
45
45
|
const values = {
|
|
46
46
|
spinner: '',
|
|
@@ -28,7 +28,7 @@ export let value = '';
|
|
|
28
28
|
|
|
29
29
|
```svelte
|
|
30
30
|
<script>
|
|
31
|
-
import { Panel, RadioGroup } from '@soleil
|
|
31
|
+
import { Panel, RadioGroup } from '@soleil/svelte-config';
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<Panel heading="Inställningar">
|
|
@@ -51,8 +51,8 @@ import { Panel, RadioGroup } from '@soleil-se/svelte-config';
|
|
|
51
51
|
|
|
52
52
|
```svelte
|
|
53
53
|
<script>
|
|
54
|
-
import { Panel, RadioGroup } from '@soleil
|
|
55
|
-
import { onSave } from '@soleil
|
|
54
|
+
import { Panel, RadioGroup } from '@soleil/svelte-config';
|
|
55
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
56
56
|
|
|
57
57
|
const values = {
|
|
58
58
|
radioGroup: '',
|
|
@@ -79,7 +79,7 @@ The options are fetched using the REST-API and the site name is needed for build
|
|
|
79
79
|
|
|
80
80
|
```js
|
|
81
81
|
import router from '@sitevision/api/common/router';
|
|
82
|
-
import { createAppContext } from '@soleil
|
|
82
|
+
import { createAppContext } from '@soleil/svelte-config/server';
|
|
83
83
|
|
|
84
84
|
router.get('/', (req, res) => {
|
|
85
85
|
createAppContext(res);
|
|
@@ -92,7 +92,7 @@ router.get('/', (req, res) => {
|
|
|
92
92
|
|
|
93
93
|
```svelte
|
|
94
94
|
<script>
|
|
95
|
-
import { Panel, RepositoryNodeSelector } from '@soleil
|
|
95
|
+
import { Panel, RepositoryNodeSelector } from '@soleil/svelte-config';
|
|
96
96
|
</script>
|
|
97
97
|
|
|
98
98
|
<Panel heading="Inställningar">
|
|
@@ -105,8 +105,8 @@ router.get('/', (req, res) => {
|
|
|
105
105
|
|
|
106
106
|
```svelte
|
|
107
107
|
<script>
|
|
108
|
-
import { Panel, RepositoryNodeSelector } from '@soleil
|
|
109
|
-
import { onSave } from '@soleil
|
|
108
|
+
import { Panel, RepositoryNodeSelector } from '@soleil/svelte-config';
|
|
109
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
110
110
|
|
|
111
111
|
export let values;
|
|
112
112
|
|
|
@@ -21,7 +21,7 @@ export let value = '';
|
|
|
21
21
|
|
|
22
22
|
```svelte
|
|
23
23
|
<script>
|
|
24
|
-
import { Panel, SelectField } from '@soleil
|
|
24
|
+
import { Panel, SelectField } from '@soleil/svelte-config';
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<Panel heading="Inställningar">
|
|
@@ -38,8 +38,8 @@ export let value = '';
|
|
|
38
38
|
|
|
39
39
|
```svelte
|
|
40
40
|
<script>
|
|
41
|
-
import { Panel, SelectField } from '@soleil
|
|
42
|
-
import { onSave } from '@soleil
|
|
41
|
+
import { Panel, SelectField } from '@soleil/svelte-config';
|
|
42
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
43
43
|
|
|
44
44
|
const values = {
|
|
45
45
|
select: '',
|
|
@@ -31,7 +31,7 @@ export let value = [];
|
|
|
31
31
|
|
|
32
32
|
```svelte
|
|
33
33
|
<script>
|
|
34
|
-
import { Panel, TagSelector } from '@soleil
|
|
34
|
+
import { Panel, TagSelector } from '@soleil/svelte-config';
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
37
|
<Panel heading="Inställningar">
|
|
@@ -45,8 +45,8 @@ Name prop is required here as well since Sitevision uses this to initialize the
|
|
|
45
45
|
|
|
46
46
|
```svelte
|
|
47
47
|
<script>
|
|
48
|
-
import { Panel, TagSelector } from '@soleil
|
|
49
|
-
import { onSave } from '@soleil
|
|
48
|
+
import { Panel, TagSelector } from '@soleil/svelte-config';
|
|
49
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
50
50
|
|
|
51
51
|
const values = {
|
|
52
52
|
tags: [],
|
|
@@ -34,7 +34,7 @@ Use the value attribute to set a default value:
|
|
|
34
34
|
|
|
35
35
|
```svelte
|
|
36
36
|
<script>
|
|
37
|
-
import { Panel, TextList } from '@soleil
|
|
37
|
+
import { Panel, TextList } from '@soleil/svelte-config';
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
40
|
<Panel heading="Inställningar">
|
|
@@ -49,8 +49,8 @@ import { Panel, TextList } from '@soleil-se/svelte-config';
|
|
|
49
49
|
|
|
50
50
|
```svelte
|
|
51
51
|
<script>
|
|
52
|
-
import { Panel, TextList } from '@soleil
|
|
53
|
-
import { onSave } from '@soleil
|
|
52
|
+
import { Panel, TextList } from '@soleil/svelte-config';
|
|
53
|
+
import { onSave } from '@soleil/svelte-config/utils';
|
|
54
54
|
|
|
55
55
|
const values = {
|
|
56
56
|
textList: '',
|
package/eslint.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/config-svelte",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.13",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"module": "./index.js",
|
|
6
6
|
"svelte": "./index.js",
|
|
@@ -30,15 +30,11 @@
|
|
|
30
30
|
"svelte": "^3.46.0 || ^4.0.0 || ^5.0.0-next || ^5.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@soleil-se/eslint-config": "^
|
|
34
|
-
"@soleil-se/stylelint-config": "^4.
|
|
35
|
-
"eslint": "^
|
|
36
|
-
"eslint-config-airbnb-base": "^15.0.0",
|
|
37
|
-
"eslint-config-prettier": "^9.1.0",
|
|
38
|
-
"eslint-plugin-import": "^2.30.0",
|
|
39
|
-
"eslint-plugin-svelte": "^2.44.1",
|
|
33
|
+
"@soleil-se/eslint-config": "^6.0.2",
|
|
34
|
+
"@soleil-se/stylelint-config": "^4.3.0",
|
|
35
|
+
"eslint": "^9.18.0",
|
|
40
36
|
"glob": "^11.0.0",
|
|
41
|
-
"stylelint": "^16.
|
|
37
|
+
"stylelint": "^16.14.1",
|
|
42
38
|
"sveld": "^0.20.2",
|
|
43
39
|
"svelte": "^4.2.19",
|
|
44
40
|
"svelte-preprocess": "^6.0.3"
|
|
@@ -48,16 +44,12 @@
|
|
|
48
44
|
"a11y-dialog": "8.1.1",
|
|
49
45
|
"svelte-dnd-action": "^0.9.51"
|
|
50
46
|
},
|
|
51
|
-
"homepage": "https://docs.soleil.se/packages/config
|
|
47
|
+
"homepage": "https://docs.soleil.se/packages/soleil/svelte-config",
|
|
52
48
|
"scripts": {
|
|
53
49
|
"create-type-definitions": "node ./createTypeDefinitions.js"
|
|
54
50
|
},
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"Widget",
|
|
61
|
-
"Svelte"
|
|
62
|
-
]
|
|
63
|
-
}
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"gitHead": "3290a06108ae08b6bc2354156a725296792b58f2"
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@soleil-se/eslint-config/prettier';
|
package/utils/createI18n.js
CHANGED
|
@@ -19,7 +19,7 @@ export default function createI18n(messages) {
|
|
|
19
19
|
return (path, values = {}) => {
|
|
20
20
|
let message = get(messages[locale], path);
|
|
21
21
|
if (message == null) {
|
|
22
|
-
console.warn(`[@soleil
|
|
22
|
+
console.warn(`[@soleil/svelte-config/utils/i18n] No translation avaliable for ${path}`);
|
|
23
23
|
return path;
|
|
24
24
|
}
|
|
25
25
|
|
package/utils/getAppContext.js
CHANGED
|
@@ -9,7 +9,7 @@ export default function getAppContext(key) {
|
|
|
9
9
|
console.warn(`App context is not created, add the following in config/index.js:
|
|
10
10
|
|
|
11
11
|
import router from '@sitevision/api/common/router';
|
|
12
|
-
import { createAppContext } from '@soleil
|
|
12
|
+
import { createAppContext } from '@soleil/svelte-config/server';
|
|
13
13
|
|
|
14
14
|
router.get('/', (req, res) => {
|
|
15
15
|
createAppContext(res);
|
package/.eslintrc.cjs
DELETED
package/.prettierrc.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('@soleil/eslint-config-sitevision/svelte.prettier');
|
package/.stylelintrc.js
DELETED