@streamline-pulse/formkrafter-core 0.15.1 → 0.16.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 +2 -2
- package/dist/brick/brick.d.ts +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6910 -37
- package/dist/index.js.map +76 -6
- package/dist/ops/ops.d.ts +4 -4
- package/dist/ops/pointer.d.ts +0 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ The framework-agnostic heart of FormKrafter: form **specs**, immutable **mutatio
|
|
|
4
4
|
|
|
5
5
|
## The spec
|
|
6
6
|
|
|
7
|
-
A form is a tree of `BrickSpec` nodes. Each brick has a `type` (`input`, `panel`, `collection`, `output`, `action`), an `id` (which registered brick renders it), `configs` (with a
|
|
7
|
+
A form is a tree of `BrickSpec` nodes. Each brick has a `type` (`input`, `panel`, `collection`, `output`, `action`), an `id` (which registered brick renders it), `configs` (with a data `key`), plus optional `validations`, `rules`, `styles`, and `children`.
|
|
8
8
|
|
|
9
9
|
```mermaid
|
|
10
10
|
flowchart TD
|
|
@@ -40,7 +40,7 @@ flowchart LR
|
|
|
40
40
|
H -->|redo → apply patches| S1[spec']
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
Available ops: `addBrick`, `removeBrick`, `moveBrick`, `duplicateBrick
|
|
43
|
+
Available ops: `addBrick`, `removeBrick`, `moveBrick`, `duplicateBrick`, `updateBrickConfigs`, `updateBrickStyles`, `updateBrickValidations`, `updateBrickRules`. Addressing helpers: `getBrickAt(spec, path)`, `pointerFromPath(path)`, `iterateBricks(spec)`.
|
|
44
44
|
|
|
45
45
|
Patches are plain RFC 6902 — persist them, sync them, audit them.
|
|
46
46
|
|
package/dist/brick/brick.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ import type { BrickType } from "../utils/brick-type";
|
|
|
8
8
|
import type { BrickBaseConfigs, CommonBrickProps } from "../utils/common-brick-props";
|
|
9
9
|
import type { BrickMoldDropType } from "../utils/drop-type";
|
|
10
10
|
export interface BrickProps<DataType, Configs extends BrickBaseConfigs, Styles> extends CommonBrickProps<Configs, Styles> {
|
|
11
|
-
onConfigsChange?: (configs: BrickBaseConfigs & Record<string, unknown>,
|
|
12
|
-
onStylesChange?: (styles: Record<string, unknown>,
|
|
11
|
+
onConfigsChange?: (configs: BrickBaseConfigs & Record<string, unknown>, path?: string) => void;
|
|
12
|
+
onStylesChange?: (styles: Record<string, unknown>, path?: string) => void;
|
|
13
13
|
data?: DataType;
|
|
14
14
|
dataMap?: Record<string, unknown>;
|
|
15
15
|
rootSpec?: BrickSpec;
|
|
@@ -26,9 +26,9 @@ export interface BrickProps<DataType, Configs extends BrickBaseConfigs, Styles>
|
|
|
26
26
|
brickSpec?: BrickSpec;
|
|
27
27
|
editable?: boolean;
|
|
28
28
|
validations?: Validation[];
|
|
29
|
-
onValidationsChange?: (validations: Validation[],
|
|
29
|
+
onValidationsChange?: (validations: Validation[], path?: string) => void;
|
|
30
30
|
rules?: Rule[];
|
|
31
|
-
onRulesChange?: (rules: Rule[],
|
|
31
|
+
onRulesChange?: (rules: Rule[], path?: string) => void;
|
|
32
32
|
utils: Utils;
|
|
33
33
|
}
|
|
34
34
|
export declare abstract class Brick<DataType, Configs extends BrickBaseConfigs, Styles extends Record<string, unknown>> {
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export { DataSourceService, FetchDataSourceService } from "./services/data_sourc
|
|
|
27
27
|
export { FileLike, UploadedFile, FileUploadService, FileUploadOptions, Base64FileUploadService, UrlFileUploadService, UrlFileUploadDefaults } from "./services/file_upload_service";
|
|
28
28
|
export { LocalizedText, isLocalizedObject, resolveLocalizedText, resolveLocalizedRecord } from "./utils/localized-text";
|
|
29
29
|
export { FkTranslations, setFkTranslations, fkT, fkTOr, frFkTranslations } from "./i18n";
|
|
30
|
-
export { pointerFromPath,
|
|
30
|
+
export { pointerFromPath, getBrickAt } from "./ops/pointer";
|
|
31
31
|
export { SpecUpdate, addBrick, removeBrick, moveBrick, duplicateBrick, updateBrickConfigs, updateBrickStyles, updateBrickValidations, updateBrickRules } from "./ops/ops";
|
|
32
32
|
export { SpecHistory } from "./ops/history";
|
|
33
33
|
export type { Operation } from "fast-json-patch";
|