@lmvz-ds/components 0.12.5 → 0.13.1
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/cjs/assets-CJzJZPzV.js +26 -0
- package/dist/{esm/Effect-BhQLGXPs.js → cjs/icons-FIfJEo6G.js} +1708 -5205
- package/dist/cjs/{index-CVw4GUo6.js → index-Bp6Dd2i1.js} +4 -2
- package/dist/cjs/{index-9ZJx0550.js → index-D3BMpL5w.js} +0 -3
- package/dist/cjs/index.cjs.js +4 -6
- package/dist/cjs/lmvz-action.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-button.cjs.entry.js +7 -10
- package/dist/cjs/lmvz-card.cjs.entry.js +4 -5
- package/dist/cjs/lmvz-chip.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-components.cjs.js +1 -1
- package/dist/cjs/lmvz-header.cjs.entry.js +13 -12
- package/dist/cjs/lmvz-icon.cjs.entry.js +8 -10
- package/dist/cjs/lmvz-input.cjs.entry.js +8 -11
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +5 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/reactive-controller-host-BMDEj1kX.js +168 -0
- package/dist/collection/components/lmvz-button/lmvz-button.js +3 -3
- package/dist/collection/components/lmvz-card/lmvz-card.js +3 -4
- package/dist/collection/components/lmvz-header/lmvz-header.js +11 -8
- package/dist/collection/components/lmvz-icon/icons.js +2 -2
- package/dist/collection/components/lmvz-icon/lmvz-icon.js +2 -2
- package/dist/collection/components/lmvz-icon/test/icons.unit.js +21 -12
- package/dist/collection/components/lmvz-input/lmvz-input.css +5 -2
- package/dist/collection/components/lmvz-input/lmvz-input.js +3 -3
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +3 -3
- package/dist/collection/integration/header-integration.js +3 -1
- package/dist/collection/utils/{validation → aria}/aria-validation-controller.js +15 -34
- package/dist/collection/utils/{list-keyboard-controller.js → aria/list-keyboard-controller.js} +1 -1
- package/dist/collection/utils/assets.js +9 -6
- package/dist/collection/utils/http.js +2 -2
- package/dist/collection/utils/{http.test.js → http.unit.js} +8 -7
- package/dist/collection/utils/validation/svg.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-action.js +1 -1
- package/dist/components/lmvz-button.js +1 -1
- package/dist/components/lmvz-card.js +1 -1
- package/dist/components/lmvz-chip.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/lmvz-input.js +1 -1
- package/dist/components/lmvz-menuitem.js +1 -1
- package/dist/components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/components/p-BsS3QvWn.js +1 -0
- package/dist/components/p-CMteT-Yo.js +1 -0
- package/dist/components/p-CdYWDK7m.js +1 -0
- package/dist/components/p-vi4YzJmv.js +1 -0
- package/dist/esm/assets-BelZNJ1W.js +23 -0
- package/dist/{cjs/Effect-CNhHt4Xb.js → esm/icons-CM7lsnuO.js} +1751 -5457
- package/dist/esm/{index-Bt32KzDW.js → index-BfTCfPZ1.js} +3 -1
- package/dist/esm/{index-smGPjoDX.js → index-T5ljELGS.js} +1 -3
- package/dist/esm/index.js +4 -5
- package/dist/esm/lmvz-action.entry.js +1 -1
- package/dist/esm/lmvz-button.entry.js +5 -8
- package/dist/esm/lmvz-card.entry.js +4 -5
- package/dist/esm/lmvz-chip.entry.js +1 -1
- package/dist/esm/lmvz-components.js +2 -2
- package/dist/esm/lmvz-header.entry.js +11 -10
- package/dist/esm/lmvz-icon.entry.js +5 -7
- package/dist/esm/lmvz-input.entry.js +6 -9
- package/dist/esm/lmvz-menuitem.entry.js +3 -5
- package/dist/esm/loader.js +2 -2
- package/dist/esm/reactive-controller-host-CZ3dGAjR.js +165 -0
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-16878d4c.entry.js +1 -0
- package/dist/lmvz-components/p-6e3314ab.entry.js +1 -0
- package/dist/lmvz-components/p-8ea1a349.entry.js +1 -0
- package/dist/lmvz-components/{p-d4b68381.entry.js → p-980688a0.entry.js} +1 -1
- package/dist/lmvz-components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/lmvz-components/p-BoR31cjC.js +1 -0
- package/dist/lmvz-components/p-CVf2C8dL.js +1 -0
- package/dist/lmvz-components/p-CZ3dGAjR.js +1 -0
- package/dist/lmvz-components/p-T5ljELGS.js +2 -0
- package/dist/lmvz-components/p-a34542fa.entry.js +1 -0
- package/dist/lmvz-components/p-d2bf6a3f.entry.js +1 -0
- package/dist/lmvz-components/p-d9dc29a1.entry.js +1 -0
- package/dist/lmvz-components/{p-9faac8f3.entry.js → p-feda2ec5.entry.js} +1 -1
- package/dist/manifest.json +1 -1
- package/dist/types/components/lmvz-button/lmvz-button.d.ts +2 -2
- package/dist/types/components/lmvz-header/lmvz-header.d.ts +5 -4
- package/dist/types/components/lmvz-icon/lmvz-icon.d.ts +1 -1
- package/dist/types/components/lmvz-input/lmvz-input.d.ts +1 -1
- package/dist/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +2 -2
- package/dist/types/utils/{validation → aria}/aria-validation-controller.d.ts +1 -5
- package/dist/types/utils/{element-activation-controller.d.ts → aria/element-activation-controller.d.ts} +2 -2
- package/dist/types/utils/{list-keyboard-controller.d.ts → aria/list-keyboard-controller.d.ts} +1 -1
- package/dist/types/utils/assets.d.ts +1 -8
- package/dist/types/utils/http.d.ts +3 -3
- package/dist/types/utils/validation/svg.d.ts +2 -2
- package/hydrate/index.js +3608 -54447
- package/hydrate/index.mjs +3608 -54447
- package/package.json +17 -18
- package/readme.md +18 -0
- package/dist/cjs/MutableQueue-Bk9tBfaK.js +0 -462
- package/dist/cjs/_commonjsHelpers-CFO10eej.js +0 -7
- package/dist/cjs/aria-validation-controller-B3hMkau3.js +0 -2930
- package/dist/cjs/assets-BguFB3wV.js +0 -71
- package/dist/cjs/axe-BNqwbBGU.js +0 -32834
- package/dist/cjs/icons-7wUEcWEo.js +0 -607
- package/dist/components/p-3I3wZmp8.js +0 -1
- package/dist/components/p-B85MJLTf.js +0 -1
- package/dist/components/p-BaPwpeMs.js +0 -1
- package/dist/components/p-CAi33KTt.js +0 -1
- package/dist/components/p-CdofjRtQ.js +0 -1
- package/dist/components/p-D1HbKFuh.js +0 -12
- package/dist/components/p-UwhTS2ue.js +0 -1
- package/dist/esm/MutableQueue-CNlEFklh.js +0 -431
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/esm/aria-validation-controller-iA4YWFG-.js +0 -2927
- package/dist/esm/assets-Iu8neKuE.js +0 -67
- package/dist/esm/axe-cRQ9Ux1I.js +0 -32832
- package/dist/esm/icons-Bx1wWPM2.js +0 -603
- package/dist/lmvz-components/p-1a10fcbd.entry.js +0 -1
- package/dist/lmvz-components/p-274c36df.entry.js +0 -1
- package/dist/lmvz-components/p-2ba68483.entry.js +0 -1
- package/dist/lmvz-components/p-4XIjw3k8.js +0 -1
- package/dist/lmvz-components/p-51Fb_qqD.js +0 -1
- package/dist/lmvz-components/p-77e26e71.entry.js +0 -1
- package/dist/lmvz-components/p-B85MJLTf.js +0 -1
- package/dist/lmvz-components/p-BhQLGXPs.js +0 -1
- package/dist/lmvz-components/p-CXWyvf0D.js +0 -1
- package/dist/lmvz-components/p-D1HbKFuh.js +0 -12
- package/dist/lmvz-components/p-D7I-Bc5i.js +0 -1
- package/dist/lmvz-components/p-a5fe62b6.entry.js +0 -1
- package/dist/lmvz-components/p-c8b78793.entry.js +0 -1
- package/dist/lmvz-components/p-smGPjoDX.js +0 -2
- /package/dist/collection/utils/{element-activation-controller.js → aria/element-activation-controller.js} +0 -0
- /package/dist/types/utils/{http.test.d.ts → http.unit.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
"name": "@lmvz-ds/components",
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.13.1",
|
|
6
6
|
"description": "The components of the design system",
|
|
7
7
|
"author": "Patrick Nemenz <patrick.nemenz@adesso.at>",
|
|
8
8
|
"volta": {
|
|
9
9
|
"extends": "../../package.json"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
|
-
"access": "public"
|
|
13
|
-
"registry": "https://registry.npmjs.org/"
|
|
12
|
+
"access": "public"
|
|
14
13
|
},
|
|
15
14
|
"lerna": {
|
|
16
15
|
"command": {
|
|
@@ -116,9 +115,8 @@
|
|
|
116
115
|
"build:components": "stencil build --docs --prod --config stencil.config.prod.ts",
|
|
117
116
|
"build:debug": "node --inspect-brk ../../node_modules/.bin/stencil build --debug --docs --config ./stencil.config.dev.ts",
|
|
118
117
|
"build:integration": "stencil build --config stencil.config.integration.ts",
|
|
119
|
-
"test": "
|
|
120
|
-
"test
|
|
121
|
-
"test.e2e": "playwright test",
|
|
118
|
+
"test": "stencil-test",
|
|
119
|
+
"test:watch": "stencil-test --watch",
|
|
122
120
|
"lint": "concurrently 'eslint \"src/**\"' 'stylelint \"src/**/*.css\" --config ./stylelint.config.mjs'",
|
|
123
121
|
"generate": "stencil generate",
|
|
124
122
|
"update": "npx npm-check-updates -u",
|
|
@@ -129,10 +127,14 @@
|
|
|
129
127
|
"nx": {
|
|
130
128
|
"targets": {
|
|
131
129
|
"start:integration": {
|
|
132
|
-
"dependsOn": [
|
|
130
|
+
"dependsOn": [
|
|
131
|
+
"^build"
|
|
132
|
+
]
|
|
133
133
|
},
|
|
134
134
|
"start:dev": {
|
|
135
|
-
"dependsOn": [
|
|
135
|
+
"dependsOn": [
|
|
136
|
+
"^build"
|
|
137
|
+
]
|
|
136
138
|
},
|
|
137
139
|
"build:css": {
|
|
138
140
|
"cache": true,
|
|
@@ -184,26 +186,22 @@
|
|
|
184
186
|
}
|
|
185
187
|
},
|
|
186
188
|
"dependencies": {
|
|
189
|
+
"@lmvz-ds/aria-validation": "^0.13.1",
|
|
187
190
|
"classnames": "^2.5.1",
|
|
188
191
|
"effect": "3.19.14"
|
|
189
192
|
},
|
|
190
193
|
"devDependencies": {
|
|
191
|
-
"@lmvz-ds/design-tokens": "^0.
|
|
192
|
-
"@playwright/test": "^1.55.0",
|
|
194
|
+
"@lmvz-ds/design-tokens": "^0.13.1",
|
|
193
195
|
"@stencil-community/postcss": "^2.2.0",
|
|
194
196
|
"@stencil/angular-output-target": "1.3.0",
|
|
195
197
|
"@stencil/core": "4.43.2",
|
|
196
|
-
"@stencil/playwright": "^0.2.1",
|
|
197
198
|
"@stencil/react-output-target": "^1.2.0",
|
|
198
199
|
"@stencil/utils": "0.0.5",
|
|
200
|
+
"@stencil/vitest": "^1.7.0",
|
|
199
201
|
"@stencil/vue-output-target": "^0.11.8",
|
|
200
|
-
"@types/jest": "^30.0.0",
|
|
201
202
|
"@types/postcss-import": "^14.0.3",
|
|
202
|
-
"axe-core": "^4.11.1",
|
|
203
203
|
"concurrently": "^9.2.1",
|
|
204
|
-
"
|
|
205
|
-
"jest-cli": "^30.2.0",
|
|
206
|
-
"jest-stencil-runner": "^0.0.19",
|
|
204
|
+
"happy-dom": "^20.8.4",
|
|
207
205
|
"postcss-import": "^16.1.1",
|
|
208
206
|
"rollup-plugin-postcss": "^4.0.2",
|
|
209
207
|
"stylelint": "^17.0.0",
|
|
@@ -211,7 +209,8 @@
|
|
|
211
209
|
"stylelint-value-no-unknown-custom-properties": "^6.1.1",
|
|
212
210
|
"ts-deepmerge": "^7.0.3",
|
|
213
211
|
"tsx": "^4.21.0",
|
|
214
|
-
"vite": "^7.3.1"
|
|
212
|
+
"vite": "^7.3.1",
|
|
213
|
+
"vitest": "^4.1.0"
|
|
215
214
|
},
|
|
216
|
-
"gitHead": "
|
|
215
|
+
"gitHead": "36452c3cc8d6e493adb9806bc4a60bdf0f0f48da"
|
|
217
216
|
}
|
package/readme.md
CHANGED
|
@@ -75,6 +75,24 @@ In a web app, import components directly (`import LmvzCard from '.../components/
|
|
|
75
75
|
Use the CDN version (cdn.js) for direct browser inclusion via <script> tags.
|
|
76
76
|
The loader is essential when integrating Stencil components into non-Stencil projects (React, Angular, plain HTML) to ensure custom elements are defined and polyfills loaded.
|
|
77
77
|
|
|
78
|
+
### Runtime ARIA Validation (Opt-in)
|
|
79
|
+
|
|
80
|
+
ARIA validation is disabled by default and can be enabled on demand with a separate runtime import:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
import '@lmvz-ds/components/ariaValidation';
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This import enables validation globally for all LMVZ components, independent of integration mode.
|
|
87
|
+
|
|
88
|
+
To disable it again at runtime:
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import { disableAriaValidation } from '@lmvz-ds/components/ariaValidation';
|
|
92
|
+
|
|
93
|
+
disableAriaValidation();
|
|
94
|
+
```
|
|
95
|
+
|
|
78
96
|
### Styles
|
|
79
97
|
|
|
80
98
|
Always import one of the available themes as early in your application as possible in your main CSS file:
|
|
@@ -1,462 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var Effect = require('./Effect-CNhHt4Xb.js');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new `Deferred`.
|
|
7
|
-
*
|
|
8
|
-
* @since 2.0.0
|
|
9
|
-
* @category constructors
|
|
10
|
-
*/
|
|
11
|
-
const make$1 = Effect.deferredMake;
|
|
12
|
-
const _await = Effect.deferredAwait;
|
|
13
|
-
/**
|
|
14
|
-
* Exits the `Deferred` with the specified `Exit` value, which will be
|
|
15
|
-
* propagated to all fibers waiting on the value of the `Deferred`.
|
|
16
|
-
*
|
|
17
|
-
* @since 2.0.0
|
|
18
|
-
* @category utils
|
|
19
|
-
*/
|
|
20
|
-
const done = Effect.deferredDone;
|
|
21
|
-
/**
|
|
22
|
-
* Fails the `Deferred` with the specified `Cause`, which will be propagated to
|
|
23
|
-
* all fibers waiting on the value of the `Deferred`.
|
|
24
|
-
*
|
|
25
|
-
* @since 2.0.0
|
|
26
|
-
* @category utils
|
|
27
|
-
*/
|
|
28
|
-
const failCause$1 = Effect.deferredFailCause;
|
|
29
|
-
/**
|
|
30
|
-
* Completes the `Deferred` with interruption. This will interrupt all fibers
|
|
31
|
-
* waiting on the value of the `Deferred` with the `FiberId` of the fiber
|
|
32
|
-
* calling this method.
|
|
33
|
-
*
|
|
34
|
-
* @since 2.0.0
|
|
35
|
-
* @category utils
|
|
36
|
-
*/
|
|
37
|
-
const interrupt = Effect.deferredInterrupt;
|
|
38
|
-
/**
|
|
39
|
-
* Returns `true` if this `Deferred` has already been completed with a value or
|
|
40
|
-
* an error, `false` otherwise.
|
|
41
|
-
*
|
|
42
|
-
* @since 2.0.0
|
|
43
|
-
* @category getters
|
|
44
|
-
*/
|
|
45
|
-
const isDone = Effect.deferredIsDone;
|
|
46
|
-
/**
|
|
47
|
-
* Completes the `Deferred` with the specified value.
|
|
48
|
-
*
|
|
49
|
-
* @since 2.0.0
|
|
50
|
-
* @category utils
|
|
51
|
-
*/
|
|
52
|
-
const succeed$1 = Effect.deferredSucceed;
|
|
53
|
-
/**
|
|
54
|
-
* Unsafely creates a new `Deferred` from the specified `FiberId`.
|
|
55
|
-
*
|
|
56
|
-
* @since 2.0.0
|
|
57
|
-
* @category unsafe
|
|
58
|
-
*/
|
|
59
|
-
const unsafeMake = Effect.deferredUnsafeMake;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Returns `true` if the specified `Exit` is a `Failure`, `false` otherwise.
|
|
63
|
-
*
|
|
64
|
-
* @since 2.0.0
|
|
65
|
-
* @category refinements
|
|
66
|
-
*/
|
|
67
|
-
const isFailure = Effect.exitIsFailure;
|
|
68
|
-
/**
|
|
69
|
-
* Returns `true` if the specified `Exit` is a `Success`, `false` otherwise.
|
|
70
|
-
*
|
|
71
|
-
* @since 2.0.0
|
|
72
|
-
* @category refinements
|
|
73
|
-
*/
|
|
74
|
-
const isSuccess = Effect.exitIsSuccess;
|
|
75
|
-
/**
|
|
76
|
-
* Collects all of the specified exit values into a `Some<Exit<List<A>, E>>`. If
|
|
77
|
-
* the provided iterable contains no elements, `None` will be returned.
|
|
78
|
-
*
|
|
79
|
-
* @since 2.0.0
|
|
80
|
-
* @category constructors
|
|
81
|
-
*/
|
|
82
|
-
const all = Effect.exitCollectAll;
|
|
83
|
-
/**
|
|
84
|
-
* Constructs a new `Exit.Failure` from the specified unrecoverable defect.
|
|
85
|
-
*
|
|
86
|
-
* @since 2.0.0
|
|
87
|
-
* @category constructors
|
|
88
|
-
*/
|
|
89
|
-
const die = Effect.exitDie;
|
|
90
|
-
/**
|
|
91
|
-
* Constructs a new `Exit.Failure` from the specified recoverable error of type
|
|
92
|
-
* `E`.
|
|
93
|
-
*
|
|
94
|
-
* @since 2.0.0
|
|
95
|
-
* @category constructors
|
|
96
|
-
*/
|
|
97
|
-
const fail = Effect.exitFail;
|
|
98
|
-
/**
|
|
99
|
-
* Constructs a new `Exit.Failure` from the specified `Cause` of type `E`.
|
|
100
|
-
*
|
|
101
|
-
* @since 2.0.0
|
|
102
|
-
* @category constructors
|
|
103
|
-
*/
|
|
104
|
-
const failCause = Effect.exitFailCause;
|
|
105
|
-
/**
|
|
106
|
-
* Maps over the `Success` value of the specified exit using the provided
|
|
107
|
-
* function.
|
|
108
|
-
*
|
|
109
|
-
* @since 2.0.0
|
|
110
|
-
* @category mapping
|
|
111
|
-
*/
|
|
112
|
-
const map = Effect.exitMap;
|
|
113
|
-
/**
|
|
114
|
-
* @since 2.0.0
|
|
115
|
-
* @category folding
|
|
116
|
-
*/
|
|
117
|
-
const match = Effect.exitMatch;
|
|
118
|
-
/**
|
|
119
|
-
* Constructs a new `Exit.Success` containing the specified value of type `A`.
|
|
120
|
-
*
|
|
121
|
-
* @since 2.0.0
|
|
122
|
-
* @category constructors
|
|
123
|
-
*/
|
|
124
|
-
const succeed = Effect.exitSucceed;
|
|
125
|
-
const void_ = Effect.exitVoid;
|
|
126
|
-
/**
|
|
127
|
-
* Sequentially zips the this result with the specified result or else returns
|
|
128
|
-
* the failed `Cause<E | E2>`.
|
|
129
|
-
*
|
|
130
|
-
* @since 2.0.0
|
|
131
|
-
* @category zipping
|
|
132
|
-
*/
|
|
133
|
-
const zip = Effect.exitZip;
|
|
134
|
-
/**
|
|
135
|
-
* Sequentially zips the this result with the specified result discarding the
|
|
136
|
-
* first element of the tuple or else returns the failed `Cause<E | E2>`.
|
|
137
|
-
*
|
|
138
|
-
* @since 2.0.0
|
|
139
|
-
* @category zipping
|
|
140
|
-
*/
|
|
141
|
-
const zipRight = Effect.exitZipRight;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* @since 2.0.0
|
|
145
|
-
*/
|
|
146
|
-
const TypeId$1 = /*#__PURE__*/Symbol.for("effect/MutableList");
|
|
147
|
-
const MutableListProto = {
|
|
148
|
-
[TypeId$1]: TypeId$1,
|
|
149
|
-
[Symbol.iterator]() {
|
|
150
|
-
let done = false;
|
|
151
|
-
let head = this.head;
|
|
152
|
-
return {
|
|
153
|
-
next() {
|
|
154
|
-
if (done) {
|
|
155
|
-
return this.return();
|
|
156
|
-
}
|
|
157
|
-
if (head == null) {
|
|
158
|
-
done = true;
|
|
159
|
-
return this.return();
|
|
160
|
-
}
|
|
161
|
-
const value = head.value;
|
|
162
|
-
head = head.next;
|
|
163
|
-
return {
|
|
164
|
-
done,
|
|
165
|
-
value
|
|
166
|
-
};
|
|
167
|
-
},
|
|
168
|
-
return(value) {
|
|
169
|
-
if (!done) {
|
|
170
|
-
done = true;
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
done: true,
|
|
174
|
-
value
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
},
|
|
179
|
-
toString() {
|
|
180
|
-
return Effect.format(this.toJSON());
|
|
181
|
-
},
|
|
182
|
-
toJSON() {
|
|
183
|
-
return {
|
|
184
|
-
_id: "MutableList",
|
|
185
|
-
values: Array.from(this).map(Effect.toJSON)
|
|
186
|
-
};
|
|
187
|
-
},
|
|
188
|
-
[Effect.NodeInspectSymbol]() {
|
|
189
|
-
return this.toJSON();
|
|
190
|
-
},
|
|
191
|
-
pipe() {
|
|
192
|
-
return Effect.pipeArguments(this, arguments);
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
/** @internal */
|
|
196
|
-
const makeNode = value => ({
|
|
197
|
-
value,
|
|
198
|
-
removed: false,
|
|
199
|
-
prev: undefined,
|
|
200
|
-
next: undefined
|
|
201
|
-
});
|
|
202
|
-
/**
|
|
203
|
-
* Creates an empty `MutableList`.
|
|
204
|
-
*
|
|
205
|
-
* @since 2.0.0
|
|
206
|
-
* @category constructors
|
|
207
|
-
*/
|
|
208
|
-
const empty = () => {
|
|
209
|
-
const list = Object.create(MutableListProto);
|
|
210
|
-
list.head = undefined;
|
|
211
|
-
list.tail = undefined;
|
|
212
|
-
list._length = 0;
|
|
213
|
-
return list;
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* Returns `true` if the list contains zero elements, `false`, otherwise.
|
|
217
|
-
*
|
|
218
|
-
* @since 2.0.0
|
|
219
|
-
* @category getters
|
|
220
|
-
*/
|
|
221
|
-
const isEmpty$1 = self => length$1(self) === 0;
|
|
222
|
-
/**
|
|
223
|
-
* Returns the length of the list.
|
|
224
|
-
*
|
|
225
|
-
* @since 2.0.0
|
|
226
|
-
* @category getters
|
|
227
|
-
*/
|
|
228
|
-
const length$1 = self => self._length;
|
|
229
|
-
/**
|
|
230
|
-
* Appends the specified element to the end of the `MutableList`.
|
|
231
|
-
*
|
|
232
|
-
* @category concatenating
|
|
233
|
-
* @since 2.0.0
|
|
234
|
-
*/
|
|
235
|
-
const append = /*#__PURE__*/Effect.dual(2, (self, value) => {
|
|
236
|
-
const node = makeNode(value);
|
|
237
|
-
if (self.head === undefined) {
|
|
238
|
-
self.head = node;
|
|
239
|
-
}
|
|
240
|
-
if (self.tail === undefined) {
|
|
241
|
-
self.tail = node;
|
|
242
|
-
} else {
|
|
243
|
-
self.tail.next = node;
|
|
244
|
-
node.prev = self.tail;
|
|
245
|
-
self.tail = node;
|
|
246
|
-
}
|
|
247
|
-
self._length += 1;
|
|
248
|
-
return self;
|
|
249
|
-
});
|
|
250
|
-
/**
|
|
251
|
-
* Removes the first value from the list and returns it, if it exists.
|
|
252
|
-
*
|
|
253
|
-
* @since 0.0.1
|
|
254
|
-
*/
|
|
255
|
-
const shift = self => {
|
|
256
|
-
const head = self.head;
|
|
257
|
-
if (head !== undefined) {
|
|
258
|
-
remove(self, head);
|
|
259
|
-
return head.value;
|
|
260
|
-
}
|
|
261
|
-
return undefined;
|
|
262
|
-
};
|
|
263
|
-
const remove = (self, node) => {
|
|
264
|
-
if (node.removed) {
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
node.removed = true;
|
|
268
|
-
if (node.prev !== undefined && node.next !== undefined) {
|
|
269
|
-
node.prev.next = node.next;
|
|
270
|
-
node.next.prev = node.prev;
|
|
271
|
-
} else if (node.prev !== undefined) {
|
|
272
|
-
self.tail = node.prev;
|
|
273
|
-
node.prev.next = undefined;
|
|
274
|
-
} else if (node.next !== undefined) {
|
|
275
|
-
self.head = node.next;
|
|
276
|
-
node.next.prev = undefined;
|
|
277
|
-
} else {
|
|
278
|
-
self.tail = undefined;
|
|
279
|
-
self.head = undefined;
|
|
280
|
-
}
|
|
281
|
-
if (self._length > 0) {
|
|
282
|
-
self._length -= 1;
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* @since 2.0.0
|
|
288
|
-
*/
|
|
289
|
-
const TypeId = /*#__PURE__*/Symbol.for("effect/MutableQueue");
|
|
290
|
-
/**
|
|
291
|
-
* @since 2.0.0
|
|
292
|
-
* @category symbol
|
|
293
|
-
*/
|
|
294
|
-
const EmptyMutableQueue = /*#__PURE__*/Symbol.for("effect/mutable/MutableQueue/Empty");
|
|
295
|
-
const MutableQueueProto = {
|
|
296
|
-
[TypeId]: TypeId,
|
|
297
|
-
[Symbol.iterator]() {
|
|
298
|
-
return Array.from(this.queue)[Symbol.iterator]();
|
|
299
|
-
},
|
|
300
|
-
toString() {
|
|
301
|
-
return Effect.format(this.toJSON());
|
|
302
|
-
},
|
|
303
|
-
toJSON() {
|
|
304
|
-
return {
|
|
305
|
-
_id: "MutableQueue",
|
|
306
|
-
values: Array.from(this).map(Effect.toJSON)
|
|
307
|
-
};
|
|
308
|
-
},
|
|
309
|
-
[Effect.NodeInspectSymbol]() {
|
|
310
|
-
return this.toJSON();
|
|
311
|
-
},
|
|
312
|
-
pipe() {
|
|
313
|
-
return Effect.pipeArguments(this, arguments);
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
const make = capacity => {
|
|
317
|
-
const queue = Object.create(MutableQueueProto);
|
|
318
|
-
queue.queue = empty();
|
|
319
|
-
queue.capacity = capacity;
|
|
320
|
-
return queue;
|
|
321
|
-
};
|
|
322
|
-
/**
|
|
323
|
-
* Creates a new bounded `MutableQueue`.
|
|
324
|
-
*
|
|
325
|
-
* @since 2.0.0
|
|
326
|
-
* @category constructors
|
|
327
|
-
*/
|
|
328
|
-
const bounded = capacity => make(capacity);
|
|
329
|
-
/**
|
|
330
|
-
* Creates a new unbounded `MutableQueue`.
|
|
331
|
-
*
|
|
332
|
-
* @since 2.0.0
|
|
333
|
-
* @category constructors
|
|
334
|
-
*/
|
|
335
|
-
const unbounded = () => make(undefined);
|
|
336
|
-
/**
|
|
337
|
-
* Returns the current number of elements in the queue.
|
|
338
|
-
*
|
|
339
|
-
* @since 2.0.0
|
|
340
|
-
* @category getters
|
|
341
|
-
*/
|
|
342
|
-
const length = self => length$1(self.queue);
|
|
343
|
-
/**
|
|
344
|
-
* Returns `true` if the queue is empty, `false` otherwise.
|
|
345
|
-
*
|
|
346
|
-
* @since 2.0.0
|
|
347
|
-
* @category getters
|
|
348
|
-
*/
|
|
349
|
-
const isEmpty = self => isEmpty$1(self.queue);
|
|
350
|
-
/**
|
|
351
|
-
* The **maximum** number of elements that a queue can hold.
|
|
352
|
-
*
|
|
353
|
-
* **Note**: unbounded queues can still implement this interface with
|
|
354
|
-
* `capacity = Infinity`.
|
|
355
|
-
*
|
|
356
|
-
* @since 2.0.0
|
|
357
|
-
* @category getters
|
|
358
|
-
*/
|
|
359
|
-
const capacity = self => self.capacity === undefined ? Infinity : self.capacity;
|
|
360
|
-
/**
|
|
361
|
-
* Offers an element to the queue.
|
|
362
|
-
*
|
|
363
|
-
* Returns whether the enqueue was successful or not.
|
|
364
|
-
*
|
|
365
|
-
* @since 2.0.0
|
|
366
|
-
*/
|
|
367
|
-
const offer = /*#__PURE__*/Effect.dual(2, (self, value) => {
|
|
368
|
-
const queueLength = length$1(self.queue);
|
|
369
|
-
if (self.capacity !== undefined && queueLength === self.capacity) {
|
|
370
|
-
return false;
|
|
371
|
-
}
|
|
372
|
-
append(value)(self.queue);
|
|
373
|
-
return true;
|
|
374
|
-
});
|
|
375
|
-
/**
|
|
376
|
-
* Enqueues a collection of values into the queue.
|
|
377
|
-
*
|
|
378
|
-
* Returns a `Chunk` of the values that were **not** able to be enqueued.
|
|
379
|
-
*
|
|
380
|
-
* @since 2.0.0
|
|
381
|
-
*/
|
|
382
|
-
const offerAll = /*#__PURE__*/Effect.dual(2, (self, values) => {
|
|
383
|
-
const iterator = values[Symbol.iterator]();
|
|
384
|
-
let next;
|
|
385
|
-
let remainder = Effect.empty$2();
|
|
386
|
-
let offering = true;
|
|
387
|
-
while (offering && (next = iterator.next()) && !next.done) {
|
|
388
|
-
offering = offer(next.value)(self);
|
|
389
|
-
}
|
|
390
|
-
while (next != null && !next.done) {
|
|
391
|
-
remainder = Effect.prepend(next.value)(remainder);
|
|
392
|
-
next = iterator.next();
|
|
393
|
-
}
|
|
394
|
-
return Effect.reverse(remainder);
|
|
395
|
-
});
|
|
396
|
-
/**
|
|
397
|
-
* Dequeues an element from the queue.
|
|
398
|
-
*
|
|
399
|
-
* Returns either an element from the queue, or the `def` param.
|
|
400
|
-
*
|
|
401
|
-
* **Note**: if there is no meaningful default for your type, you can always
|
|
402
|
-
* use `poll(MutableQueue.EmptyMutableQueue)`.
|
|
403
|
-
*
|
|
404
|
-
* @since 2.0.0
|
|
405
|
-
*/
|
|
406
|
-
const poll = /*#__PURE__*/Effect.dual(2, (self, def) => {
|
|
407
|
-
if (isEmpty$1(self.queue)) {
|
|
408
|
-
return def;
|
|
409
|
-
}
|
|
410
|
-
return shift(self.queue);
|
|
411
|
-
});
|
|
412
|
-
/**
|
|
413
|
-
* Dequeues up to `n` elements from the queue.
|
|
414
|
-
*
|
|
415
|
-
* Returns a `List` of up to `n` elements.
|
|
416
|
-
*
|
|
417
|
-
* @since 2.0.0
|
|
418
|
-
*/
|
|
419
|
-
const pollUpTo = /*#__PURE__*/Effect.dual(2, (self, n) => {
|
|
420
|
-
let result = Effect.empty$2();
|
|
421
|
-
let count = 0;
|
|
422
|
-
while (count < n) {
|
|
423
|
-
const element = poll(EmptyMutableQueue)(self);
|
|
424
|
-
if (element === EmptyMutableQueue) {
|
|
425
|
-
break;
|
|
426
|
-
}
|
|
427
|
-
result = Effect.prepend(element)(result);
|
|
428
|
-
count += 1;
|
|
429
|
-
}
|
|
430
|
-
return Effect.reverse(result);
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
exports.EmptyMutableQueue = EmptyMutableQueue;
|
|
434
|
-
exports._await = _await;
|
|
435
|
-
exports.all = all;
|
|
436
|
-
exports.bounded = bounded;
|
|
437
|
-
exports.capacity = capacity;
|
|
438
|
-
exports.die = die;
|
|
439
|
-
exports.done = done;
|
|
440
|
-
exports.fail = fail;
|
|
441
|
-
exports.failCause = failCause;
|
|
442
|
-
exports.failCause$1 = failCause$1;
|
|
443
|
-
exports.interrupt = interrupt;
|
|
444
|
-
exports.isDone = isDone;
|
|
445
|
-
exports.isEmpty = isEmpty;
|
|
446
|
-
exports.isFailure = isFailure;
|
|
447
|
-
exports.isSuccess = isSuccess;
|
|
448
|
-
exports.length = length;
|
|
449
|
-
exports.make = make$1;
|
|
450
|
-
exports.map = map;
|
|
451
|
-
exports.match = match;
|
|
452
|
-
exports.offer = offer;
|
|
453
|
-
exports.offerAll = offerAll;
|
|
454
|
-
exports.poll = poll;
|
|
455
|
-
exports.pollUpTo = pollUpTo;
|
|
456
|
-
exports.succeed = succeed;
|
|
457
|
-
exports.succeed$1 = succeed$1;
|
|
458
|
-
exports.unbounded = unbounded;
|
|
459
|
-
exports.unsafeMake = unsafeMake;
|
|
460
|
-
exports.void_ = void_;
|
|
461
|
-
exports.zip = zip;
|
|
462
|
-
exports.zipRight = zipRight;
|