@soleil-se/config-svelte 1.27.12 → 1.27.14
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 +24 -24
- 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 +19 -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
|
@@ -69,7 +69,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
69
69
|
|
|
70
70
|
## [1.26.1] - 2024-05-22
|
|
71
71
|
|
|
72
|
-
- Update `@soleil
|
|
72
|
+
- Update `@soleil/config-validate` dependency to 1.2.0.
|
|
73
73
|
|
|
74
74
|
## [1.26.0] - 2024-05-21
|
|
75
75
|
|
|
@@ -96,8 +96,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
96
96
|
|
|
97
97
|
## [1.23.0] - 2024-03-07
|
|
98
98
|
|
|
99
|
-
- List item templating in `CustomList` with [CustomListItemTemplate](/packages/
|
|
100
|
-
- Trigger manual update of `CustomList` with [triggerUpdate](/packages/
|
|
99
|
+
- List item templating in `CustomList` with [CustomListItemTemplate](/packages/config-svelte/components/customlist/#list-item-template).
|
|
100
|
+
- Trigger manual update of `CustomList` with [triggerUpdate](/packages/config-svelte/components/customlist/#dynamic-content) function.
|
|
101
101
|
|
|
102
102
|
## [1.22.0] - 2024-02-13
|
|
103
103
|
|
|
@@ -106,17 +106,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
106
106
|
|
|
107
107
|
## [1.21.0] - 2023-10-13
|
|
108
108
|
|
|
109
|
-
- Add `legendVisuallyHidden` prop for [RadioGroup](/packages/
|
|
110
|
-
- Add `class` prop for [Panel](/packages/
|
|
111
|
-
- Add `removable` prop for [CustomSelector](/packages/
|
|
109
|
+
- Add `legendVisuallyHidden` prop for [RadioGroup](/packages/config-svelte/components/radiogroup) and [CheckboxGroup](/packages/config-svelte/components/checkboxgroup).
|
|
110
|
+
- Add `class` prop for [Panel](/packages/config-svelte/components/panel).
|
|
111
|
+
- Add `removable` prop for [CustomSelector](/packages/config-svelte/components/customselector).
|
|
112
112
|
|
|
113
113
|
## [1.20.1] - 2023-09-25
|
|
114
114
|
|
|
115
|
-
- Fix element containting title in [Modal](/packages/
|
|
115
|
+
- Fix element containting title in [Modal](/packages/config-svelte/components/modal).
|
|
116
116
|
|
|
117
117
|
## [1.20.0] - 2023-09-25
|
|
118
118
|
|
|
119
|
-
- Add footer slot in [Modal](/packages/
|
|
119
|
+
- Add footer slot in [Modal](/packages/config-svelte/components/modal).
|
|
120
120
|
|
|
121
121
|
## [1.19.0] - 2023-05-17
|
|
122
122
|
|
|
@@ -132,19 +132,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
132
132
|
|
|
133
133
|
## [1.18.0] - 2023-01-20
|
|
134
134
|
|
|
135
|
-
- Option templating in [CustomSelector](/packages/
|
|
135
|
+
- Option templating in [CustomSelector](/packages/config-svelte/components/customselector).
|
|
136
136
|
- Add global Select2 styling.
|
|
137
137
|
- Modal now closes open Select2 dropdowns.
|
|
138
138
|
|
|
139
139
|
## [1.17.0] - 2022-12-01
|
|
140
140
|
|
|
141
|
-
- New component: [RepositoryNodeSelector](/packages/
|
|
142
|
-
- New utility API: [getAppContext](/packages/
|
|
143
|
-
- New server API: [createAppContext](/packages/
|
|
141
|
+
- New component: [RepositoryNodeSelector](/packages/config-svelte/components/repositorynodeselector).
|
|
142
|
+
- New utility API: [getAppContext](/packages/config-svelte#getappcontext).
|
|
143
|
+
- New server API: [createAppContext](/packages/config-svelte#context)
|
|
144
144
|
|
|
145
145
|
## [1.16.2] - 2022-11-24
|
|
146
146
|
|
|
147
|
-
- [ListSelector](/packages/
|
|
147
|
+
- [ListSelector](/packages/config-svelte/components/listselector) now works properly in [CustomList](/packages/config-svelte/components/customlist).
|
|
148
148
|
|
|
149
149
|
## [1.16.1] - 2022-11-18
|
|
150
150
|
|
|
@@ -152,17 +152,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
152
152
|
|
|
153
153
|
## [1.16.0] - 2022-11-09
|
|
154
154
|
|
|
155
|
-
- Add singular and plural suffix support for [NumberSpinner](/packages/
|
|
155
|
+
- Add singular and plural suffix support for [NumberSpinner](/packages/config-svelte/components/numberspinner)
|
|
156
156
|
|
|
157
157
|
## [1.15.0] - 2022-09-15
|
|
158
158
|
|
|
159
|
-
- Required was not re-evaluated properly in [InputField](/packages/
|
|
159
|
+
- Required was not re-evaluated properly in [InputField](/packages/config-svelte/components/inputfield), [NodeSelector](/packages/config-svelte/components/nodeselector) and [TagSelector](/packages/config-svelte/components/tagselector).
|
|
160
160
|
- Add `show` prop for all components to toggle visibility without re-rendering.
|
|
161
161
|
|
|
162
162
|
## [1.14.0] - 2022-07-07
|
|
163
163
|
|
|
164
|
-
- Add default slot for [ImageSelector](/packages/
|
|
165
|
-
- Margin fix for [RadioGroup](/packages/
|
|
164
|
+
- Add default slot for [ImageSelector](/packages/config-svelte/components/imageselector).
|
|
165
|
+
- Margin fix for [RadioGroup](/packages/config-svelte/components/radiogroup).
|
|
166
166
|
|
|
167
167
|
## [1.13.0] - 2022-06-23
|
|
168
168
|
|
|
@@ -174,22 +174,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
174
174
|
|
|
175
175
|
## [1.12.0] - 2022-05-23
|
|
176
176
|
|
|
177
|
-
- New component: [Modal](/packages/
|
|
178
|
-
- New component: [CustomList](/packages/
|
|
177
|
+
- New component: [Modal](/packages/config-svelte/components/modal).
|
|
178
|
+
- New component: [CustomList](/packages/config-svelte/components/customlist).
|
|
179
179
|
|
|
180
180
|
## [1.10.1] - 2022-03-08
|
|
181
181
|
|
|
182
|
-
- Cast saved value to Number in [NumberSpinner](/packages/
|
|
183
|
-
- Fix reactivity for `suffix` prop in [NumberSpinner](/packages/
|
|
182
|
+
- Cast saved value to Number in [NumberSpinner](/packages/config-svelte/components/numberspinner).
|
|
183
|
+
- Fix reactivity for `suffix` prop in [NumberSpinner](/packages/config-svelte/components/numberspinner).
|
|
184
184
|
|
|
185
185
|
## [1.10.0] - 2022-03-07
|
|
186
186
|
|
|
187
|
-
- Added `multiple` prop for [CustomSelector](/packages/
|
|
188
|
-
- First value is always selected in [RadioGroup](/packages/
|
|
187
|
+
- Added `multiple` prop for [CustomSelector](/packages/config-svelte/components/customselector).
|
|
188
|
+
- First value is always selected in [RadioGroup](/packages/config-svelte/components/radiogroup) if nothing is selected.
|
|
189
189
|
|
|
190
190
|
## [1.9.0] - 2021-12-06
|
|
191
191
|
|
|
192
|
-
- Added [CustomSelector](/packages/
|
|
192
|
+
- Added [CustomSelector](/packages/config-svelte/components/customselector)
|
|
193
193
|
|
|
194
194
|
## [1.8.4] - 2021-12-03
|
|
195
195
|
|
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/config-svelte/) | [Changelog](https://docs.soleil.se/packages/config-svelte//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,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/config-svelte",
|
|
3
|
-
"
|
|
3
|
+
"description": "A collection of Svelte components and utilities for WebApp, RESTApp and Widget configurations.",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"sitevision",
|
|
6
|
+
"webapp",
|
|
7
|
+
"restapp",
|
|
8
|
+
"widget",
|
|
9
|
+
"svelte"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://docs.soleil.se/packages/config-svelte",
|
|
12
|
+
"version": "1.27.14",
|
|
4
13
|
"main": "./index.js",
|
|
5
14
|
"module": "./index.js",
|
|
6
15
|
"svelte": "./index.js",
|
|
@@ -30,15 +39,11 @@
|
|
|
30
39
|
"svelte": "^3.46.0 || ^4.0.0 || ^5.0.0-next || ^5.0.0"
|
|
31
40
|
},
|
|
32
41
|
"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",
|
|
42
|
+
"@soleil-se/eslint-config": "^6.0.2",
|
|
43
|
+
"@soleil-se/stylelint-config": "^4.3.0",
|
|
44
|
+
"eslint": "^9.18.0",
|
|
40
45
|
"glob": "^11.0.0",
|
|
41
|
-
"stylelint": "^16.
|
|
46
|
+
"stylelint": "^16.14.1",
|
|
42
47
|
"sveld": "^0.20.2",
|
|
43
48
|
"svelte": "^4.2.19",
|
|
44
49
|
"svelte-preprocess": "^6.0.3"
|
|
@@ -48,16 +53,11 @@
|
|
|
48
53
|
"a11y-dialog": "8.1.1",
|
|
49
54
|
"svelte-dnd-action": "^0.9.51"
|
|
50
55
|
},
|
|
51
|
-
"homepage": "https://docs.soleil.se/packages/config-svelte",
|
|
52
56
|
"scripts": {
|
|
53
57
|
"create-type-definitions": "node ./createTypeDefinitions.js"
|
|
54
58
|
},
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"Widget",
|
|
61
|
-
"Svelte"
|
|
62
|
-
]
|
|
63
|
-
}
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "ba3b41b4576cfeac5928b9836ae5a05ccda0dd75"
|
|
63
|
+
}
|
|
@@ -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