@tialro2/rnbokit 1.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/README.md +243 -0
- package/dist/RNBO.css +113 -0
- package/dist/RNBO.svelte +230 -0
- package/dist/RNBO.svelte.d.ts +97 -0
- package/dist/RNBOcomponents/AudioDropIn.svelte +133 -0
- package/dist/RNBOcomponents/AudioDropIn.svelte.d.ts +17 -0
- package/dist/RNBOcomponents/ExtMidiIn.svelte +93 -0
- package/dist/RNBOcomponents/ExtMidiIn.svelte.d.ts +13 -0
- package/dist/RNBOcomponents/ExtMidiOut.svelte +93 -0
- package/dist/RNBOcomponents/ExtMidiOut.svelte.d.ts +13 -0
- package/dist/RNBOcomponents/MicIn.svelte +88 -0
- package/dist/RNBOcomponents/MicIn.svelte.d.ts +17 -0
- package/dist/RNBOcomponents/RNBOInlet.svelte +66 -0
- package/dist/RNBOcomponents/RNBOInlet.svelte.d.ts +55 -0
- package/dist/RNBOcomponents/RNBOInport.svelte +21 -0
- package/dist/RNBOcomponents/RNBOInport.svelte.d.ts +13 -0
- package/dist/RNBOcomponents/RNBOMidiIn.svelte +63 -0
- package/dist/RNBOcomponents/RNBOMidiIn.svelte.d.ts +31 -0
- package/dist/RNBOcomponents/RNBOMidiOut.svelte +38 -0
- package/dist/RNBOcomponents/RNBOMidiOut.svelte.d.ts +27 -0
- package/dist/RNBOcomponents/RNBOOutport.svelte +36 -0
- package/dist/RNBOcomponents/RNBOOutport.svelte.d.ts +21 -0
- package/dist/RNBOcomponents/RNBOParam.svelte +37 -0
- package/dist/RNBOcomponents/RNBOParam.svelte.d.ts +15 -0
- package/dist/RNBOcomponents/XYMidiIn.svelte +101 -0
- package/dist/RNBOcomponents/XYMidiIn.svelte.d.ts +17 -0
- package/dist/UIcomponents/Controls.svelte +12 -0
- package/dist/UIcomponents/Controls.svelte.d.ts +7 -0
- package/dist/UIcomponents/FileDropZone.svelte +118 -0
- package/dist/UIcomponents/FileDropZone.svelte.d.ts +37 -0
- package/dist/UIcomponents/ProgressBar.svelte +50 -0
- package/dist/UIcomponents/ProgressBar.svelte.d.ts +17 -0
- package/dist/UIcomponents/RadioGroup.svelte +35 -0
- package/dist/UIcomponents/RadioGroup.svelte.d.ts +13 -0
- package/dist/UIcomponents/RadioItem.svelte +96 -0
- package/dist/UIcomponents/RadioItem.svelte.d.ts +21 -0
- package/dist/UIcomponents/RangeSlider.svelte +38 -0
- package/dist/UIcomponents/RangeSlider.svelte.d.ts +21 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +20 -0
- package/package.json +72 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Object} Props
|
|
4
|
+
* @property {any} group
|
|
5
|
+
* @property {any} name
|
|
6
|
+
* @property {any} value
|
|
7
|
+
* @property {string} [title]
|
|
8
|
+
* @property {string} [label]
|
|
9
|
+
* @property {import('svelte').Snippet} [children]
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** @type {Props} */
|
|
13
|
+
let {
|
|
14
|
+
group = $bindable(),
|
|
15
|
+
name,
|
|
16
|
+
value,
|
|
17
|
+
title = '',
|
|
18
|
+
label = '',
|
|
19
|
+
onkeydown,
|
|
20
|
+
onkeyup,
|
|
21
|
+
onkeypress,
|
|
22
|
+
onclick,
|
|
23
|
+
onchange,
|
|
24
|
+
children
|
|
25
|
+
} = $props();
|
|
26
|
+
let elemInput = $state();
|
|
27
|
+
function onKeyDown(event) {
|
|
28
|
+
if (['Enter', 'Space'].includes(event.code)) {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
elemInput.click();
|
|
31
|
+
}
|
|
32
|
+
onkeydown();
|
|
33
|
+
}
|
|
34
|
+
let checked = $derived(value === group);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<label>
|
|
38
|
+
<!-- A11y attributes are not allowed on <label> -->
|
|
39
|
+
<div
|
|
40
|
+
class="RNBOradio-item {checked ? 'RNBOchecked' : 'RNBOhover'}"
|
|
41
|
+
data-testid="radio-item"
|
|
42
|
+
role="radio"
|
|
43
|
+
aria-checked={checked}
|
|
44
|
+
aria-label={label}
|
|
45
|
+
tabindex="0"
|
|
46
|
+
{title}
|
|
47
|
+
onkeydown={onKeyDown}
|
|
48
|
+
{onkeyup}
|
|
49
|
+
{onkeypress}
|
|
50
|
+
>
|
|
51
|
+
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
52
|
+
<div class="RNBOradio-input">
|
|
53
|
+
<input
|
|
54
|
+
bind:this={elemInput}
|
|
55
|
+
type="radio"
|
|
56
|
+
bind:group
|
|
57
|
+
{name}
|
|
58
|
+
{value}
|
|
59
|
+
tabindex="-1"
|
|
60
|
+
{onclick}
|
|
61
|
+
{onchange}
|
|
62
|
+
id="test"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
{@render children?.()}
|
|
66
|
+
</div>
|
|
67
|
+
</label>
|
|
68
|
+
|
|
69
|
+
<style>
|
|
70
|
+
.RNBOradio-item {
|
|
71
|
+
font-size: 1rem;
|
|
72
|
+
line-height: 1.5rem;
|
|
73
|
+
text-align: center;
|
|
74
|
+
flex: 1 1 auto;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
padding: 0.2rem;
|
|
77
|
+
padding-left: 0.75rem;
|
|
78
|
+
padding-right: 0.75rem;
|
|
79
|
+
margin: 0.25rem;
|
|
80
|
+
background-color: rgba(var(--local-accent-color), 0);
|
|
81
|
+
border-radius: var(--local-rounded-base);
|
|
82
|
+
}
|
|
83
|
+
.RNBOhover:hover {
|
|
84
|
+
background-color: rgba(var(--local-accent-color), 0.2);
|
|
85
|
+
transition: var(--local-animation) var(--local-animation-duration);
|
|
86
|
+
}
|
|
87
|
+
.RNBOchecked {
|
|
88
|
+
background-color: rgba(var(--local-accent-color), 1);
|
|
89
|
+
transition: var(--local-animation) var(--local-animation-duration);
|
|
90
|
+
}
|
|
91
|
+
.RNBOradio-input {
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
width: 0;
|
|
94
|
+
height: 0;
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default RadioItem;
|
|
2
|
+
type RadioItem = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const RadioItem: import("svelte").Component<{
|
|
7
|
+
group: any;
|
|
8
|
+
name: any;
|
|
9
|
+
value: any;
|
|
10
|
+
title?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
children?: import("svelte").Snippet;
|
|
13
|
+
}, {}, "group">;
|
|
14
|
+
type Props = {
|
|
15
|
+
group: any;
|
|
16
|
+
name: any;
|
|
17
|
+
value: any;
|
|
18
|
+
title?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
children?: import("svelte").Snippet;
|
|
21
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Object} Props
|
|
4
|
+
* @property {any} name
|
|
5
|
+
* @property {number} [value]
|
|
6
|
+
* @property {number} [min]
|
|
7
|
+
* @property {number} [max]
|
|
8
|
+
* @property {number} [step]
|
|
9
|
+
* @property {string} [label]
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** @type {Props} */
|
|
13
|
+
let {
|
|
14
|
+
name,
|
|
15
|
+
value = $bindable(0),
|
|
16
|
+
min = 0,
|
|
17
|
+
max = 100,
|
|
18
|
+
step = 0.01,
|
|
19
|
+
label = '',
|
|
20
|
+
onclick,
|
|
21
|
+
onchange,
|
|
22
|
+
onblur
|
|
23
|
+
} = $props();
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<input
|
|
27
|
+
type="range"
|
|
28
|
+
{name}
|
|
29
|
+
class="RNBOslider"
|
|
30
|
+
aria-label={label}
|
|
31
|
+
{min}
|
|
32
|
+
{max}
|
|
33
|
+
{step}
|
|
34
|
+
bind:value
|
|
35
|
+
{onclick}
|
|
36
|
+
{onchange}
|
|
37
|
+
{onblur}
|
|
38
|
+
/>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default RangeSlider;
|
|
2
|
+
type RangeSlider = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const RangeSlider: import("svelte").Component<{
|
|
7
|
+
name: any;
|
|
8
|
+
value?: number;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
step?: number;
|
|
12
|
+
label?: string;
|
|
13
|
+
}, {}, "value">;
|
|
14
|
+
type Props = {
|
|
15
|
+
name: any;
|
|
16
|
+
value?: number;
|
|
17
|
+
min?: number;
|
|
18
|
+
max?: number;
|
|
19
|
+
step?: number;
|
|
20
|
+
label?: string;
|
|
21
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as RNBO } from "./RNBO.svelte";
|
|
2
|
+
export { default as RNBOParam } from "./RNBOcomponents/RNBOParam.svelte";
|
|
3
|
+
export { default as RNBOMidiIn } from "./RNBOcomponents/RNBOMidiIn.svelte";
|
|
4
|
+
export { default as RNBOInlet } from "./RNBOcomponents/RNBOInlet.svelte";
|
|
5
|
+
export { default as RNBOInport } from "./RNBOcomponents/RNBOInport.svelte";
|
|
6
|
+
export { default as RNBOOutport } from "./RNBOcomponents/RNBOOutport.svelte";
|
|
7
|
+
export { default as XYMidiIn } from "./RNBOcomponents/XYMidiIn.svelte";
|
|
8
|
+
export { default as ExtMidiIn } from "./RNBOcomponents/ExtMidiIn.svelte";
|
|
9
|
+
export { default as MicIn } from "./RNBOcomponents/MicIn.svelte";
|
|
10
|
+
export { default as AudioDropIn } from "./RNBOcomponents/AudioDropIn.svelte";
|
|
11
|
+
export { default as FileDropZone } from "./UIcomponents/FileDropZone.svelte";
|
|
12
|
+
export { default as ProgressBar } from "./UIcomponents/ProgressBar.svelte";
|
|
13
|
+
export { default as RadioGroup } from "./UIcomponents/RadioGroup.svelte";
|
|
14
|
+
export { default as RadioItem } from "./UIcomponents/RadioItem.svelte";
|
|
15
|
+
export { default as RangeSlider } from "./UIcomponents/RangeSlider.svelte";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Reexport your entry components here
|
|
2
|
+
export { default as RNBO } from './RNBO.svelte';
|
|
3
|
+
export { default as RNBOParam } from './RNBOcomponents/RNBOParam.svelte';
|
|
4
|
+
export { default as RNBOMidiIn } from './RNBOcomponents/RNBOMidiIn.svelte';
|
|
5
|
+
// export { default as RNBOMidiOut } from './RNBOcomponents/RNBOMidiOut.svelte';
|
|
6
|
+
export { default as RNBOInlet } from './RNBOcomponents/RNBOInlet.svelte';
|
|
7
|
+
export { default as RNBOInport } from './RNBOcomponents/RNBOInport.svelte';
|
|
8
|
+
export { default as RNBOOutport } from './RNBOcomponents/RNBOOutport.svelte';
|
|
9
|
+
|
|
10
|
+
export { default as XYMidiIn } from './RNBOcomponents/XYMidiIn.svelte';
|
|
11
|
+
export { default as ExtMidiIn } from './RNBOcomponents/ExtMidiIn.svelte';
|
|
12
|
+
// export { default as ExtMidiOut } from './RNBOcomponents/ExtMidiOut.svelte';
|
|
13
|
+
export { default as MicIn } from './RNBOcomponents/MicIn.svelte';
|
|
14
|
+
export { default as AudioDropIn } from './RNBOcomponents/AudioDropIn.svelte';
|
|
15
|
+
|
|
16
|
+
export { default as FileDropZone } from './UIcomponents/FileDropZone.svelte';
|
|
17
|
+
export { default as ProgressBar } from './UIcomponents/ProgressBar.svelte';
|
|
18
|
+
export { default as RadioGroup } from './UIcomponents/RadioGroup.svelte';
|
|
19
|
+
export { default as RadioItem } from './UIcomponents/RadioItem.svelte';
|
|
20
|
+
export { default as RangeSlider } from './UIcomponents/RangeSlider.svelte';
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tialro2/rnbokit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"exports": {
|
|
5
|
+
".": {
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"svelte": "./dist/index.js"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"!dist/**/*.test.*",
|
|
13
|
+
"!dist/**/*.spec.*"
|
|
14
|
+
],
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"svelte": "^5.0.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@playwright/test": "^1.56.0",
|
|
20
|
+
"@sveltejs/adapter-auto": "^6.1.1",
|
|
21
|
+
"@sveltejs/kit": "^2.46.4",
|
|
22
|
+
"@sveltejs/package": "^2.5.4",
|
|
23
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
24
|
+
"eslint": "^9.37.0",
|
|
25
|
+
"eslint-config-prettier": "^10.1.8",
|
|
26
|
+
"eslint-plugin-svelte": "^3.12.4",
|
|
27
|
+
"prettier": "^3.6.2",
|
|
28
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
29
|
+
"publint": "^0.3.14",
|
|
30
|
+
"svelte": "^5.39.11",
|
|
31
|
+
"svelte-check": "^4.3.3",
|
|
32
|
+
"tslib": "^2.8.1",
|
|
33
|
+
"typescript": "^5.9.3",
|
|
34
|
+
"vite": "^7.1.9",
|
|
35
|
+
"vitest": "^3.2.4"
|
|
36
|
+
},
|
|
37
|
+
"svelte": "./dist/index.js",
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"type": "module",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@rnbo/js": "^1.4.1",
|
|
42
|
+
"@types/path-browserify": "^1.0.3",
|
|
43
|
+
"path-browserify": "^1.0.1"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/TiAlRo/RNBOKit.git"
|
|
48
|
+
},
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"keywords": [
|
|
51
|
+
"svelte",
|
|
52
|
+
"sveltekit",
|
|
53
|
+
"svelte-kit",
|
|
54
|
+
"Max",
|
|
55
|
+
"Cycling74",
|
|
56
|
+
"RNBO",
|
|
57
|
+
"RNBO~",
|
|
58
|
+
"RNBOkit"
|
|
59
|
+
],
|
|
60
|
+
"scripts": {
|
|
61
|
+
"dev": "vite dev",
|
|
62
|
+
"build": "vite build && npm run package",
|
|
63
|
+
"preview": "vite preview",
|
|
64
|
+
"package": "svelte-kit sync && svelte-package && publint",
|
|
65
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
|
66
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
|
67
|
+
"test": "playwright test",
|
|
68
|
+
"test:unit": "vitest",
|
|
69
|
+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
|
70
|
+
"format": "prettier --plugin-search-dir . --write ."
|
|
71
|
+
}
|
|
72
|
+
}
|