@kronos-integration/svelte-components 3.0.1 → 4.0.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.
- package/LICENSE +12 -23
- package/README.md +2 -3
- package/package.json +28 -24
- package/pacman-utils_5.2.2-3_amd64.deb +0 -0
- package/src/ServicesPage.svelte +1 -1
- package/src/components/Connection.svelte +1 -2
- package/src/components/Endpoint.svelte +5 -13
- package/src/components/Interceptor.svelte +5 -14
- package/src/components/Request.svelte +1 -1
- package/src/components/Service.svelte +4 -13
- package/src/components/ServiceCanvas.svelte +15 -22
- package/src/index.svelte +1 -1
- package/src/service-provider.mjs +1 -4
package/LICENSE
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
Copyright (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
15
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
16
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
17
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
18
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
19
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
20
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
21
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
22
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
23
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1
|
+
Copyright (C) 2019-2025 by arlac77
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4
|
+
purpose with or without fee is hereby granted.
|
|
5
|
+
|
|
6
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
8
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
9
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
10
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
11
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
12
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://svelte.dev)
|
|
2
2
|
[](https://www.npmjs.com/package/@kronos-integration/svelte-components)
|
|
3
|
-
[](https://spdx.org/licenses/0BSD.html)
|
|
4
4
|
[](https://bundlejs.com/?q=@kronos-integration/svelte-components)
|
|
5
5
|
[](https://npmjs.org/package/@kronos-integration/svelte-components)
|
|
6
6
|
[](https://github.com/Kronos-Integration/svelte-components/issues)
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
[](https://github.com/prettier/prettier)
|
|
9
9
|
[](http://commitizen.github.io/cz-cli/)
|
|
10
10
|
[](https://snyk.io/test/github/Kronos-Integration/svelte-components)
|
|
11
|
-
[](https://github.com/DevExpress/testcafe)
|
|
11
|
+
[](https://playwright.dev)
|
|
13
12
|
|
|
14
13
|
# API
|
|
15
14
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/svelte-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
7
7
|
},
|
|
8
|
+
"packageManager": "npm@11.6.4+sha512.1118cab46a05a50aee6bff5b1b4fa1df18afff89d57465620a3518035026955db87c5bdf9d207b07b7487d99f2490d450cb774655ad63ec2cba7bf1d0ad25d45",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"svelte": "./src/index.svelte"
|
|
@@ -25,42 +26,44 @@
|
|
|
25
26
|
"email": "markus.felten@gmx.de"
|
|
26
27
|
}
|
|
27
28
|
],
|
|
28
|
-
"license": "
|
|
29
|
+
"license": "0BSD",
|
|
29
30
|
"scripts": {
|
|
30
|
-
"prepare": "
|
|
31
|
+
"prepare": "node --run prepare:vite",
|
|
31
32
|
"prepare:vite": "vite build",
|
|
32
33
|
"start": "vite",
|
|
33
|
-
"test": "
|
|
34
|
-
"test:
|
|
35
|
-
"docs": "documentation readme --section=API ./src
|
|
36
|
-
"lint": "
|
|
37
|
-
"lint:docs": "documentation lint ./src
|
|
34
|
+
"test": "node --run test:playwright",
|
|
35
|
+
"test:playwright": "npx playwright test",
|
|
36
|
+
"docs": "documentation readme --section=API ./src**/*.mjs",
|
|
37
|
+
"lint": "node --run lint:docs",
|
|
38
|
+
"lint:docs": "documentation lint ./src**/*.mjs",
|
|
38
39
|
"preview": "vite preview"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"@kronos-integration/endpoint": "^
|
|
42
|
-
"@kronos-integration/service": "^
|
|
43
|
-
"
|
|
42
|
+
"@kronos-integration/endpoint": "^11.0.5",
|
|
43
|
+
"@kronos-integration/service": "^15.1.1",
|
|
44
|
+
"pacc": "^5.2.0",
|
|
45
|
+
"svelte-guard-history-router": "^6.1.2"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"@
|
|
47
|
-
"@semantic-release/
|
|
48
|
-
"@semantic-release/
|
|
49
|
-
"@semantic-release/
|
|
50
|
-
"@
|
|
48
|
+
"@playwright/test": "^1.57.0",
|
|
49
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
50
|
+
"@semantic-release/exec": "^7.1.0",
|
|
51
|
+
"@semantic-release/github": "^12.0.2",
|
|
52
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
53
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
51
54
|
"documentation": "^14.0.3",
|
|
52
|
-
"npm-pkgbuild": "^
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"vite": "^
|
|
57
|
-
"vite-plugin-compression2": "^
|
|
55
|
+
"npm-pkgbuild": "^19.1.0",
|
|
56
|
+
"playwright": "^1.57.0",
|
|
57
|
+
"semantic-release": "^25.0.2",
|
|
58
|
+
"svelte": "^5.45.8",
|
|
59
|
+
"vite": "^7.2.7",
|
|
60
|
+
"vite-plugin-compression2": "^2.4.0"
|
|
58
61
|
},
|
|
59
62
|
"peerDependencies": {
|
|
60
|
-
"svelte": "^5.
|
|
63
|
+
"svelte": "^5.45.2"
|
|
61
64
|
},
|
|
62
65
|
"optionalDependencies": {
|
|
63
|
-
"mf-hosting-frontend": "^3.
|
|
66
|
+
"mf-hosting-frontend": "^3.9.11"
|
|
64
67
|
},
|
|
65
68
|
"repository": {
|
|
66
69
|
"type": "git",
|
|
@@ -130,6 +133,7 @@
|
|
|
130
133
|
"inheritFrom": [
|
|
131
134
|
"arlac77/template-arlac77-github",
|
|
132
135
|
"arlac77/template-npm-pkgbuild",
|
|
136
|
+
"arlac77/template-playwright",
|
|
133
137
|
"arlac77/template-svelte-component"
|
|
134
138
|
]
|
|
135
139
|
}
|
|
Binary file
|
package/src/ServicesPage.svelte
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { setContext
|
|
2
|
+
import { setContext } from "svelte";
|
|
3
3
|
import { ENDPOINT } from "../util.mjs";
|
|
4
4
|
import Interceptor from "./Interceptor.svelte";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
let { endpoint, endpintAction, interceptorAction } = $props();
|
|
7
7
|
|
|
8
8
|
setContext(ENDPOINT, endpoint);
|
|
9
|
-
|
|
10
|
-
const dispatch = createEventDispatcher();
|
|
11
|
-
|
|
12
|
-
function click() {
|
|
13
|
-
dispatch("endpointAction", {
|
|
14
|
-
endpoint
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
9
|
</script>
|
|
18
10
|
|
|
19
11
|
<g
|
|
@@ -21,14 +13,14 @@
|
|
|
21
13
|
class="endpoint"
|
|
22
14
|
tabindex="0"
|
|
23
15
|
role="button"
|
|
24
|
-
onclick={
|
|
25
|
-
onkeydown={
|
|
16
|
+
onclick={endpintAction}
|
|
17
|
+
onkeydown={endpintAction}
|
|
26
18
|
transform="translate({endpoint.x},{endpoint.y})"
|
|
27
19
|
>
|
|
28
20
|
<text x="-6px" y="1px">{endpoint.name}</text>
|
|
29
21
|
<circle r="3" />
|
|
30
22
|
|
|
31
23
|
{#each endpoint.interceptors as interceptor, i}
|
|
32
|
-
<Interceptor
|
|
24
|
+
<Interceptor {interceptorAction} {interceptor} x={10 + 10 * i} y={0} />
|
|
33
25
|
{/each}
|
|
34
26
|
</g>
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { setContext
|
|
2
|
+
import { setContext } from "svelte";
|
|
3
3
|
import { INTERCEPTOR } from "../util.mjs";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
export let x;
|
|
7
|
-
export let y;
|
|
8
|
-
setContext(INTERCEPTOR, interceptor);
|
|
9
|
-
|
|
10
|
-
const dispatch = createEventDispatcher();
|
|
5
|
+
let { interceptor, x, y, interceptorAction } = $props();
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
dispatch("interceptorAction", {
|
|
14
|
-
interceptor
|
|
15
|
-
});
|
|
16
|
-
}
|
|
7
|
+
setContext(INTERCEPTOR, interceptor);
|
|
17
8
|
|
|
18
9
|
const knownInterceptorTypes = new Set([
|
|
19
10
|
"live-probe",
|
|
@@ -31,8 +22,8 @@
|
|
|
31
22
|
{href}
|
|
32
23
|
{x}
|
|
33
24
|
{y}
|
|
34
|
-
onclick={
|
|
35
|
-
onkeydown={
|
|
25
|
+
onclick={interceptorAction}
|
|
26
|
+
onkeydown={interceptorAction}
|
|
36
27
|
tabindex="0"
|
|
37
28
|
role="button"
|
|
38
29
|
/>
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import {
|
|
3
3
|
setContext,
|
|
4
|
-
createEventDispatcher,
|
|
5
4
|
onMount
|
|
6
5
|
} from "svelte";
|
|
7
6
|
import { SERVICE, connectionPath } from "../util.mjs";
|
|
8
7
|
import { makeDraggable } from "../dragging.mjs";
|
|
9
8
|
import Endpoint from "./Endpoint.svelte";
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
let { service, serviceAction, endpointAction, interceptorAction } = $props();
|
|
12
11
|
|
|
13
12
|
setContext(SERVICE, service);
|
|
14
13
|
|
|
15
|
-
const dispatch = createEventDispatcher();
|
|
16
|
-
|
|
17
|
-
function click(event) {
|
|
18
|
-
dispatch("serviceAction", {
|
|
19
|
-
service
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
14
|
let element;
|
|
24
15
|
|
|
25
16
|
onMount(() => {
|
|
@@ -52,12 +43,12 @@
|
|
|
52
43
|
transform="translate({service.x},{service.y})"
|
|
53
44
|
role="button"
|
|
54
45
|
tabindex="0"
|
|
55
|
-
onclick={
|
|
56
|
-
onkeydown={
|
|
46
|
+
onclick={serviceAction}
|
|
47
|
+
onkeydown={serviceAction}
|
|
57
48
|
>
|
|
58
49
|
<rect width={service.w} height={service.h} rx="4" />
|
|
59
50
|
<text x="8" y="14">{service.name}</text>
|
|
60
51
|
{#each Object.values(service.endpoints) as endpoint}
|
|
61
|
-
<Endpoint
|
|
52
|
+
<Endpoint {endpoint} {endpointAction} {interceptorAction} />
|
|
62
53
|
{/each}
|
|
63
54
|
</g>
|
|
@@ -4,23 +4,21 @@
|
|
|
4
4
|
import Service from "./Service.svelte";
|
|
5
5
|
import Connection from "./Connection.svelte";
|
|
6
6
|
import Request from "./Request.svelte";
|
|
7
|
-
import { getAttributes } from "
|
|
7
|
+
import { getAttributes } from "pacc";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
let { services } = $props();
|
|
10
10
|
|
|
11
11
|
setContext(SERVICES, services);
|
|
12
12
|
|
|
13
|
-
let s;
|
|
14
|
-
|
|
15
|
-
$: {
|
|
16
|
-
s = $services;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
13
|
function serviceAction(event) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
const service = event.detail?.service?.name;
|
|
15
|
+
|
|
16
|
+
if (service) {
|
|
17
|
+
services.serviceStore.set({
|
|
18
|
+
service,
|
|
19
|
+
action: "start"
|
|
20
|
+
});
|
|
21
|
+
}
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
function endpointAction(event) {
|
|
@@ -47,7 +45,7 @@
|
|
|
47
45
|
}
|
|
48
46
|
</script>
|
|
49
47
|
|
|
50
|
-
<svg viewbox="0 0 {
|
|
48
|
+
<svg viewbox="0 0 {services.width} {services.height}">
|
|
51
49
|
<defs>
|
|
52
50
|
<symbol id="interceptor" y="-3">
|
|
53
51
|
<path d="M0 -3L6 6L0 6L6 -3z" />
|
|
@@ -101,24 +99,19 @@
|
|
|
101
99
|
</defs>
|
|
102
100
|
|
|
103
101
|
<g class="services">
|
|
104
|
-
{#each Object.values(
|
|
105
|
-
<Service
|
|
106
|
-
{service}
|
|
107
|
-
on:endpointAction={endpointAction}
|
|
108
|
-
on:interceptorAction={interceptorAction}
|
|
109
|
-
on:serviceAction={serviceAction}
|
|
110
|
-
/>
|
|
102
|
+
{#each Object.values(services.services) as service}
|
|
103
|
+
<Service {service} {endpointAction} {interceptorAction} {serviceAction} />
|
|
111
104
|
{/each}
|
|
112
105
|
</g>
|
|
113
106
|
|
|
114
107
|
<g class="connections">
|
|
115
|
-
{#each
|
|
108
|
+
{#each services.connections as [from, to]}
|
|
116
109
|
<Connection {from} {to} />
|
|
117
110
|
{/each}
|
|
118
111
|
</g>
|
|
119
112
|
|
|
120
113
|
<g class="requests">
|
|
121
|
-
{#each
|
|
114
|
+
{#each services.requests as request}
|
|
122
115
|
<Request {request} />
|
|
123
116
|
{/each}
|
|
124
117
|
</g>
|
package/src/index.svelte
CHANGED
package/src/service-provider.mjs
CHANGED
|
@@ -5,8 +5,6 @@ import {
|
|
|
5
5
|
import { MockService } from "./mock-service.mjs";
|
|
6
6
|
import { MockLogger } from "./mock-logger.mjs";
|
|
7
7
|
|
|
8
|
-
globalThis.process = { env: {} };
|
|
9
|
-
|
|
10
8
|
class NoneWaitingInitializationContext extends InitializationContext {
|
|
11
9
|
async getServiceFactory(type) {
|
|
12
10
|
const f = await super.getServiceFactory(type);
|
|
@@ -56,8 +54,7 @@ export class ServiceProvider extends ServiceProviderMixin(
|
|
|
56
54
|
this.subscriptions.forEach(s => s(this));
|
|
57
55
|
}
|
|
58
56
|
|
|
59
|
-
layout()
|
|
60
|
-
{
|
|
57
|
+
layout() {
|
|
61
58
|
let cx = 0;
|
|
62
59
|
let y = 0;
|
|
63
60
|
|