@viveksinghind/narrative-form-core 1.0.0 → 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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. 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 ADDED
@@ -0,0 +1,33 @@
1
+ # @viveksinghind/narrative-form-core
2
+
3
+ Core logic and state management for Narrative Form, a dynamic typewriter-style sign-up flow.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @viveksinghind/narrative-form-core
9
+ ```
10
+
11
+ ## Usage
12
+
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.
14
+
15
+ If you're building a custom integration for a new framework:
16
+
17
+ ```ts
18
+ import { FormStateEngine } from "@viveksinghind/narrative-form-core";
19
+
20
+ const engine = new FormStateEngine(config);
21
+ engine.start();
22
+
23
+ // Subscribe to state changes
24
+ const unsubscribe = engine.subscribe((snapshot) => {
25
+ console.log("Current state:", snapshot);
26
+ });
27
+ ```
28
+
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.0",
4
- "description": "Core logic 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": ["dist"],
12
- "exports": {
13
- ".": {
14
- "types": "./dist/index.d.ts",
15
- "import": "./dist/index.mjs",
16
- "require": "./dist/index.cjs"
17
- }
18
- },
19
- "scripts": {
20
- "build": "tsup",
21
- "dev": "tsup --watch",
22
- "typecheck": "tsc --noEmit",
23
- "clean": "rimraf dist"
24
- },
25
- "devDependencies": {
26
- "tsup": "^8.0.2",
27
- "typescript": "^5.4.5",
28
- "rimraf": "^5.0.5"
29
- },
30
- "keywords": [
31
- "narrative-form",
32
- "typewriter",
33
- "form",
34
- "onboarding",
35
- "signup",
36
- "typescript"
37
- ],
38
- "repository": {
39
- "type": "git",
40
- "url": "https://github.com/vivekSinghInd/narrative-form.git",
41
- "directory": "packages/core"
42
- },
43
- "homepage": "https://github.com/vivekSinghInd/narrative-form#readme",
44
- "bugs": {
45
- "url": "https://github.com/vivekSinghInd/narrative-form/issues"
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
+ }