@kronos-integration/svelte-components 3.0.0 → 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 CHANGED
@@ -1,23 +1,12 @@
1
- Copyright (c) 2019-2024 by Kronos-Integration
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
-
7
- * Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
-
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
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
- [![Svelte v4](https://img.shields.io/badge/svelte-v4-orange.svg)](https://svelte.dev)
1
+ [![Svelte v5](https://img.shields.io/badge/svelte-v5-orange.svg)](https://svelte.dev)
2
2
  [![npm](https://img.shields.io/npm/v/@kronos-integration/svelte-components.svg)](https://www.npmjs.com/package/@kronos-integration/svelte-components)
3
- [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
3
+ [![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
4
4
  [![bundlejs](https://deno.bundlejs.com/?q=@kronos-integration/svelte-components\&badge=detailed)](https://bundlejs.com/?q=@kronos-integration/svelte-components)
5
5
  [![downloads](http://img.shields.io/npm/dm/@kronos-integration/svelte-components.svg?style=flat-square)](https://npmjs.org/package/@kronos-integration/svelte-components)
6
6
  [![GitHub Issues](https://img.shields.io/github/issues/Kronos-Integration/svelte-components.svg?style=flat-square)](https://github.com/Kronos-Integration/svelte-components/issues)
@@ -8,8 +8,7 @@
8
8
  [![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
9
9
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
10
10
  [![Known Vulnerabilities](https://snyk.io/test/github/Kronos-Integration/svelte-components/badge.svg)](https://snyk.io/test/github/Kronos-Integration/svelte-components)
11
- [![Coverage Status](https://coveralls.io/repos/Kronos-Integration/svelte-components/badge.svg)](https://coveralls.io/github/Kronos-Integration/svelte-components)
12
- [![Tested with TestCafe](https://img.shields.io/badge/tested%20with-TestCafe-2fa4cf.svg)](https://github.com/DevExpress/testcafe)
11
+ [![Tested with playwright](https://img.shields.io/badge/tested%20with-playwright-2fa4cf.svg)](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.0.0",
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": "BSD-2-Clause",
29
+ "license": "0BSD",
29
30
  "scripts": {
30
- "prepare": "npm run prepare:vite",
31
+ "prepare": "node --run prepare:vite",
31
32
  "prepare:vite": "vite build",
32
33
  "start": "vite",
33
- "test": "npm run test:cafe",
34
- "test:cafe": "testcafe $BROWSER:headless tests/cafe/*-cafe.mjs --esm -s build/test --page-request-timeout 5000 --app-init-delay 8000 --app vite",
35
- "docs": "documentation readme --section=API ./src/**/*.mjs",
36
- "lint": "npm run lint:docs",
37
- "lint:docs": "documentation lint ./src/**/*.mjs",
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": "^9.5.4",
42
- "@kronos-integration/service": "^10.5.0",
43
- "svelte-guard-history-router": "^6.1.0"
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
- "@semantic-release/commit-analyzer": "^12.0.0",
47
- "@semantic-release/exec": "^6.0.3",
48
- "@semantic-release/github": "^10.0.5",
49
- "@semantic-release/release-notes-generator": "^13.0.0",
50
- "@sveltejs/vite-plugin-svelte": "^3.1.0",
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": "^15.3.16",
53
- "semantic-release": "^23.1.1",
54
- "svelte": "^5.0.0-next.134",
55
- "testcafe": "^3.6.0",
56
- "vite": "^5.2.11",
57
- "vite-plugin-compression2": "^1.1.1"
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.0.0-next.0"
63
+ "svelte": "^5.45.2"
61
64
  },
62
65
  "optionalDependencies": {
63
- "mf-hosting-frontend": "^3.1.0"
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
@@ -1,5 +1,5 @@
1
1
  <script>
2
- export let router;
2
+ let { router } = $props();
3
3
 
4
4
  const route = router.route;
5
5
  const services = $route.value;
@@ -1,7 +1,6 @@
1
1
  <script>
2
2
  import { connectionPath } from "../util.mjs";
3
- export let from;
4
- export let to;
3
+ let { to, from } = $props();
5
4
  </script>
6
5
 
7
6
  <path
@@ -1,19 +1,11 @@
1
1
  <script>
2
- import { setContext, createEventDispatcher } from "svelte";
2
+ import { setContext } from "svelte";
3
3
  import { ENDPOINT } from "../util.mjs";
4
4
  import Interceptor from "./Interceptor.svelte";
5
5
 
6
- export let endpoint;
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={click}
25
- onkeydown={click}
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 on:interceptorAction {interceptor} x={10 + 10 * i} y={0} />
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, createEventDispatcher } from "svelte";
2
+ import { setContext } from "svelte";
3
3
  import { INTERCEPTOR } from "../util.mjs";
4
4
 
5
- export let interceptor;
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
- function click(event) {
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={click}
35
- onkeydown={click}
25
+ onclick={interceptorAction}
26
+ onkeydown={interceptorAction}
36
27
  tabindex="0"
37
28
  role="button"
38
29
  />
@@ -1,5 +1,5 @@
1
1
  <script>
2
- export let request;
2
+ let { request } = $props();
3
3
 
4
4
  const owner = request.endpoint.owner;
5
5
  const x = owner.x + request.endpoint.x + 20;
@@ -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
- export let service;
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={click}
56
- onkeydown={click}
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 on:endpointAction on:interceptorAction {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 "model-attributes";
7
+ import { getAttributes } from "pacc";
8
8
 
9
- export let services;
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
- services.serviceStore.set({
21
- service: event.detail.service.name,
22
- action: "start"
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 {s.width} {s.height}">
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(s.services) as service}
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 s.connections as [from, to]}
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 s.requests as request}
114
+ {#each services.requests as request}
122
115
  <Request {request} />
123
116
  {/each}
124
117
  </g>
package/src/index.svelte CHANGED
@@ -1,4 +1,4 @@
1
- <script context="module">
1
+ <script module>
2
2
  import ServiceCanvas from "./components/ServiceCanvas.svelte";
3
3
  import { ServiceProvider } from "./service-provider.mjs";
4
4
  export { ServiceCanvas, ServiceProvider };
@@ -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