Skip to content

Commit e427cfb

Browse files
committed
Version 7.0.0 (autocommit)
1 parent 8a0cda3 commit e427cfb

File tree

44 files changed

+898
-811
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+898
-811
lines changed

community/src/lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
33
"useNx": true,
44
"useWorkspaces": true,
5-
"version": "6.2.1"
5+
"version": "7.0.0"
66
}

community/src/package-lock.json

Lines changed: 316 additions & 270 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

community/src/packages/apps/example-viewer/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-form-builder/example-viewer",
3-
"version": "6.2.1",
3+
"version": "7.0.0",
44
"license": "MIT",
55
"private": true,
66
"main": "src/index.tsx",
@@ -21,8 +21,8 @@
2121
"dev": "vite -c ../../../vite.config.ts --host"
2222
},
2323
"dependencies": {
24-
"@react-form-builder/components-rsuite": "^6.2.1",
25-
"@react-form-builder/core": "^6.2.1",
24+
"@react-form-builder/components-rsuite": "^7.0.0",
25+
"@react-form-builder/core": "^7.0.0",
2626
"react": "^17.0.2",
2727
"react-dom": "^17.0.2"
2828
},

community/src/packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@react-form-builder/core",
33
"description": "React hook form alternative.",
4-
"version": "6.2.1",
4+
"version": "7.0.0",
55
"license": "MIT",
66
"private": false,
77
"author": "Optimajet",

community/src/packages/core/src/features/components/screenMeta.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,4 @@ export const screenMeta = new Meta(
1515
screenStyleProperties,
1616
[],
1717
modules,
18-
undefined,
19-
undefined,
20-
'container'
2118
)

community/src/packages/core/src/features/define/types.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,7 @@ import type {ActionDefinition, ActionEventHandler, DefineActionHelper, EventName
99
*/
1010
export type ActionsInitializer = (props: ComponentStore['props'], def: DefineActionHelper) => Record<EventName, ActionEventHandler | ActionDefinition>
1111

12-
/**
13-
* @deprecated Use the built-in 'slot' component.
14-
*/
15-
export type DeprecatedSlotComponentKind = 'slot'
16-
17-
/**
18-
* @deprecated Use the {@link definePreset} function instead.
19-
*/
20-
export type DeprecatedPresetComponentKind = 'preset'
21-
2212
/**
2313
* The component kind type.
2414
*/
2515
export type ComponentKind = 'container' | 'component' | 'template' | 'repeater'
26-
| DeprecatedSlotComponentKind | DeprecatedPresetComponentKind

community/src/packages/core/src/features/define/utils/BuilderView.ts

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type {Annotation} from '../../annotation/types/annotations/Annotation'
21
import {internalErrorMeta} from '../../components/internalErrorMeta'
32
import {screenMeta} from '../../components/screenMeta'
43
import {modalMeta} from '../../modal/modalMeta'
@@ -23,8 +22,6 @@ const modalCategoryName = 'modal'
2322
*/
2423
export class BuilderView extends View {
2524
#metaMap = new Map<string, Meta>()
26-
#tooltipsMeta = new Map<string, Meta>()
27-
#errorMeta = new Map<string, Meta>()
2825

2926
/**
3027
* The function for filtering components on the component palette.
@@ -68,68 +65,6 @@ export class BuilderView extends View {
6865
return this.#metaMap.get(type)
6966
}
7067

71-
/**
72-
* @deprecated
73-
* Returns the array of metadata properties of the tooltip component.
74-
* @param name the name of the tooltip component type.
75-
* @returns the array of metadata properties of the tooltip component.
76-
*/
77-
getTooltipAnnotations(name: string): Annotation[] | undefined {
78-
return this.#tooltipsMeta.get(name)?.properties
79-
}
80-
81-
/**
82-
* @deprecated
83-
* Returns the array of metadata properties of the error component.
84-
* @param name the name of the error component type.
85-
* @returns the array of metadata properties of the error component.
86-
*/
87-
getErrorAnnotations(name: string): Annotation[] | undefined {
88-
return this.#errorMeta.get(name)?.properties
89-
}
90-
91-
/**
92-
* @deprecated
93-
* @returns the array of strings with the names of the component types of the tooltip.
94-
*/
95-
get tooltips() {
96-
return Array.from(this.#tooltipsMeta.keys())
97-
}
98-
99-
/**
100-
* @deprecated
101-
* @returns the array of strings with the names of the component types of the error.
102-
*/
103-
get errors() {
104-
return Array.from(this.#errorMeta.keys())
105-
}
106-
107-
/**
108-
* @deprecated use the {@link Definer.componentRole}('tooltip') instead.
109-
* Sets the metadata of the component that displays the form's tooltips.
110-
* @param builderComponent the metadata of the component that displays the form's tooltips.
111-
* @returns the instance of the {@link BuilderView} class.
112-
*/
113-
withTooltipMeta(builderComponent: BuilderComponent): this {
114-
const {model, meta} = builderComponent
115-
this.define(model)
116-
this.#tooltipsMeta.set(model.type, meta)
117-
return this
118-
}
119-
120-
/**
121-
* @deprecated use the {@link Definer.componentRole}('error-message') instead.
122-
* Sets the metadata of the component that displays form's errors.
123-
* @param builderComponent the metadata of the component that displays the form's errors.
124-
* @returns the instance of the {@link BuilderView} class.
125-
*/
126-
withErrorMeta(builderComponent: BuilderComponent): this {
127-
const {model, meta} = builderComponent
128-
this.define(model)
129-
this.#errorMeta.set(model.type, meta)
130-
return this
131-
}
132-
13368
/**
13469
* Creates metadata for the form builder for templates from the specified template names.
13570
* @param templates the array of template names.

community/src/packages/core/src/features/define/utils/Definer.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export class Definer<T extends object> {
118118
if (!name) throw Error('Anonymous components are not allowed!')
119119
const PresetComponent = () => null
120120
const definer = new Definer(PresetComponent)
121-
.kind('preset')
122121
.addFeature(cfComponentIsPreset, true)
123122
.type(name)
124123
.name(name)
@@ -325,7 +324,6 @@ export class Definer<T extends object> {
325324
modules,
326325
this.data.customPreview,
327326
valuedAn,
328-
this.data.kind,
329327
this.data.initialJson,
330328
this.data.eventListeners,
331329
this.data.icon,
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type {ComponentType, ReactNode} from 'react'
22
import type {Annotation} from '../../annotation/types/annotations/Annotation'
3-
import type {ComponentKind} from '../types'
43
import type {ComponentMetadataEventListeners} from './ComponentMetadataEventListeners'
54
import type {InsertRestrictionFn} from './InsertRestrictionFn'
65

@@ -9,11 +8,6 @@ import type {InsertRestrictionFn} from './InsertRestrictionFn'
98
*/
109
export class Meta {
1110

12-
/**
13-
* @deprecated the component kind. Use the {@link Model.kind}.
14-
*/
15-
readonly kind: ComponentKind
16-
1711
/**
1812
* Creates the component metadata for the form builder.
1913
* @param type the component type name.
@@ -23,7 +17,6 @@ export class Meta {
2317
* @param modules common metadata for the component.
2418
* @param customPreview the custom ReactNode to be drawn on the toolbar.
2519
* @param valuedAn the metadata for the component value.
26-
* @param kind the component kind.
2720
* @param initialJson the JSON source for the component (instance of {@link ComponentStore} class serialised to JSON).
2821
* @param eventListeners the component metadata event listeners.
2922
* @param icon the component icon.
@@ -37,12 +30,10 @@ export class Meta {
3730
readonly modules: Annotation[],
3831
readonly customPreview?: ReactNode,
3932
readonly valuedAn?: Annotation,
40-
kind: ComponentKind = 'component',
4133
readonly initialJson?: string,
4234
readonly eventListeners?: ComponentMetadataEventListeners,
4335
readonly icon?: ComponentType,
4436
readonly insertRestriction?: InsertRestrictionFn,
4537
) {
46-
this.kind = kind
4738
}
4839
}

community/src/packages/core/src/features/event/consts/actions.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,16 @@ export const commonActions: ActionValues = {
1515
}, {
1616
failOnError: 'boolean',
1717
}),
18-
clear: ActionDefinition.functionalAction(e => e.store.form.componentTree.clear()),
19-
reset: ActionDefinition.functionalAction(e => e.store.form.componentTree.reset()),
18+
clear: ActionDefinition.functionalAction((e, args) => {
19+
e.store.form.componentTree.clear(args.clearInitialData)
20+
}, {
21+
clearInitialData: 'boolean',
22+
}),
23+
reset: ActionDefinition.functionalAction((e, args) => {
24+
e.store.form.componentTree.reset(args.clearInitialData)
25+
}, {
26+
clearInitialData: 'boolean',
27+
}),
2028
addRow: addRowAction,
2129
removeRow: removeRowAction,
2230
openModal,

0 commit comments

Comments
 (0)