sygnal 4.2.0 → 4.3.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/dist/astro/client.cjs.js +547 -82
- package/dist/astro/client.mjs +547 -82
- package/dist/index.cjs.js +569 -94
- package/dist/index.esm.js +569 -95
- package/dist/jsx-dev-runtime.cjs.js +49 -12
- package/dist/jsx-dev-runtime.esm.js +49 -12
- package/dist/jsx-runtime.cjs.js +49 -12
- package/dist/jsx-runtime.esm.js +49 -12
- package/dist/jsx.cjs.js +49 -12
- package/dist/jsx.esm.js +49 -12
- package/dist/sygnal.min.js +1 -1
- package/package.json +6 -3
- package/src/collection.js +5 -2
- package/src/component.js +278 -79
- package/src/extra/devtools.js +249 -0
- package/src/extra/driverFactories.js +12 -12
- package/src/extra/eventDriver.js +2 -1
- package/src/extra/logDriver.js +3 -0
- package/src/extra/processDrag.js +6 -0
- package/src/extra/processForm.js +3 -0
- package/src/extra/run.js +12 -0
- package/src/index.d.ts +8 -4
- package/src/index.js +1 -0
- package/src/pragma/index.js +21 -9
- package/src/pragma/is.js +27 -2
- package/src/switchable.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sygnal",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "An intuitive framework for building fast and small components or applications based on Cycle.js",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -51,10 +51,12 @@
|
|
|
51
51
|
"src"
|
|
52
52
|
],
|
|
53
53
|
"scripts": {
|
|
54
|
-
"test": "
|
|
54
|
+
"test": "vitest run",
|
|
55
|
+
"test:watch": "vitest",
|
|
55
56
|
"build": "npx rollup -c",
|
|
56
57
|
"build:types": "npx rollup -c rollup.config.dts.mjs",
|
|
57
58
|
"build:all": "npm run build && npm run build:types",
|
|
59
|
+
"build:devtools": "node devtools/build.mjs",
|
|
58
60
|
"start": "npx rollup -c -w"
|
|
59
61
|
},
|
|
60
62
|
"repository": {
|
|
@@ -94,6 +96,7 @@
|
|
|
94
96
|
"rollup": "^3.28.1",
|
|
95
97
|
"rollup-plugin-dts": "^6.1.1",
|
|
96
98
|
"tslib": "^2.6.2",
|
|
97
|
-
"typescript": "^5.4.5"
|
|
99
|
+
"typescript": "^5.4.5",
|
|
100
|
+
"vitest": "^4.0.18"
|
|
98
101
|
}
|
|
99
102
|
}
|
package/src/collection.js
CHANGED
|
@@ -4,9 +4,12 @@ import isolate from '@cycle/isolate'
|
|
|
4
4
|
import { makeCollection } from '@cycle/state'
|
|
5
5
|
import { h } from '@cycle/dom'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
let COLLECTION_COUNT = 0
|
|
8
8
|
|
|
9
9
|
export default function collection(component, stateLense, opts={}) {
|
|
10
|
+
if (typeof component !== 'function') {
|
|
11
|
+
throw new Error('collection: first argument (component) must be a function')
|
|
12
|
+
}
|
|
10
13
|
const {
|
|
11
14
|
combineList = ['DOM'],
|
|
12
15
|
globalList = ['EVENTS'],
|
|
@@ -17,7 +20,7 @@ export default function collection(component, stateLense, opts={}) {
|
|
|
17
20
|
} = opts
|
|
18
21
|
|
|
19
22
|
return (sources) => {
|
|
20
|
-
const key =
|
|
23
|
+
const key = `sygnal-collection-${COLLECTION_COUNT++}`
|
|
21
24
|
const collectionOpts = {
|
|
22
25
|
item: component,
|
|
23
26
|
itemKey: (state, ind) => typeof state.id !== 'undefined' ? state.id : ind,
|