@viveksinghind/narrative-form-core 1.0.1 → 1.0.2
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 +21 -0
- package/README.md +18 -12
- package/package.json +49 -47
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vivek Singh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @viveksinghind/narrative-form-core
|
|
2
2
|
|
|
3
|
-
Core logic and state management for Narrative Form, a typewriter-style
|
|
3
|
+
Core logic and state management for Narrative Form, a dynamic typewriter-style sign-up flow.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -8,20 +8,26 @@ Core logic and state management for Narrative Form, a typewriter-style signup fl
|
|
|
8
8
|
npm install @viveksinghind/narrative-form-core
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Usage
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- Robust validation engine with built-in validators (email, required, min length, etc.)
|
|
15
|
-
- Async validation support
|
|
16
|
-
- First-class TypeScript support
|
|
13
|
+
This package is intended to be used as a dependency for the framework-specific packages (`react`, `vue`, `angular`, `native`). It provides the `FormStateEngine` class which manages form state, validation, and field advancement.
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
If you're building a custom integration for a new framework:
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
```ts
|
|
18
|
+
import { FormStateEngine } from "@viveksinghind/narrative-form-core";
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const engine = new FormStateEngine(config);
|
|
21
|
+
engine.start();
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
// Subscribe to state changes
|
|
24
|
+
const unsubscribe = engine.subscribe((snapshot) => {
|
|
25
|
+
console.log("Current state:", snapshot);
|
|
26
|
+
});
|
|
27
|
+
```
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
## Features
|
|
30
|
+
- Framework agnostic state management
|
|
31
|
+
- Advanced validation engine (sync & async)
|
|
32
|
+
- Typewriter timing engine
|
|
33
|
+
- Field dependency graph
|
package/package.json
CHANGED
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@viveksinghind/narrative-form-core",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Core logic and state machine for narrative-form — framework agnostic typewriter form engine",
|
|
5
|
-
"author": "Vivek Singh <vivekSinghInd>",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "dist/index.cjs",
|
|
8
|
-
"module": "dist/index.mjs",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
10
|
-
"sideEffects": false,
|
|
11
|
-
"files": [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
},
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@viveksinghind/narrative-form-core",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Core logic and state machine for narrative-form — framework agnostic typewriter form engine",
|
|
5
|
+
"author": "Vivek Singh <vivekSinghInd>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.mjs",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.mjs",
|
|
18
|
+
"require": "./dist/index.cjs"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"tsup": "^8.0.2",
|
|
23
|
+
"typescript": "^5.4.5",
|
|
24
|
+
"rimraf": "^5.0.5"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"narrative-form",
|
|
28
|
+
"typewriter",
|
|
29
|
+
"form",
|
|
30
|
+
"onboarding",
|
|
31
|
+
"signup",
|
|
32
|
+
"typescript"
|
|
33
|
+
],
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/vivekSinghInd/narrative-form.git",
|
|
37
|
+
"directory": "packages/core"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/vivekSinghInd/narrative-form#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/vivekSinghInd/narrative-form/issues"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup",
|
|
45
|
+
"dev": "tsup --watch",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"clean": "rimraf dist"
|
|
48
|
+
}
|
|
49
|
+
}
|