@brilo/base-blocks 0.1.21 → 0.1.22

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 (28) hide show
  1. package/build/.tsbuildinfo +1 -1
  2. package/build/blocks/form/form-field/SelectOptionsRepeater.d.ts +10 -0
  3. package/build/blocks/form/form-field/SelectOptionsRepeater.d.ts.map +1 -0
  4. package/build/blocks/form/form-field/SelectOptionsRepeater.js +20 -0
  5. package/build/blocks/form/form-field/constants.d.ts +8 -0
  6. package/build/blocks/form/form-field/constants.d.ts.map +1 -1
  7. package/build/blocks/form/form-field/constants.js +5 -0
  8. package/build/blocks/form/form-field/edit.d.ts.map +1 -1
  9. package/build/blocks/form/form-field/edit.js +20 -11
  10. package/build/blocks/form/form-field/factory.d.ts.map +1 -1
  11. package/build/blocks/form/form-field/factory.js +1 -0
  12. package/build/blocks/form/form-field/normalizeOptions.d.ts +18 -0
  13. package/build/blocks/form/form-field/normalizeOptions.d.ts.map +1 -0
  14. package/build/blocks/form/form-field/normalizeOptions.js +39 -0
  15. package/build/blocks/form/form-field/types.d.ts +9 -2
  16. package/build/blocks/form/form-field/types.d.ts.map +1 -1
  17. package/build/blocks/signpost/signpost-group/constants.d.ts +1 -1
  18. package/build/blocks/signpost/signpost-group/constants.d.ts.map +1 -1
  19. package/build/blocks/signpost/signpost-group/constants.js +1 -1
  20. package/package.json +5 -2
  21. package/src/blocks/form/form-field/SelectOptionsRepeater.tsx +111 -0
  22. package/src/blocks/form/form-field/constants.ts +7 -0
  23. package/src/blocks/form/form-field/edit.tsx +42 -16
  24. package/src/blocks/form/form-field/editor.scss +28 -0
  25. package/src/blocks/form/form-field/factory.tsx +1 -0
  26. package/src/blocks/form/form-field/normalizeOptions.ts +58 -0
  27. package/src/blocks/form/form-field/types.ts +6 -2
  28. package/src/blocks/signpost/signpost-group/constants.ts +1 -1
@@ -1,8 +1,11 @@
1
- import {FIELD_TEXT_TYPES, FIELD_TEXT_TYPE_VALUES, FIELD_TYPE_VALUES} from './constants'
1
+ import {FIELD_SELECT_MODE_VALUES, FIELD_TEXT_TYPES, FIELD_TEXT_TYPE_VALUES, FIELD_TYPE_VALUES} from './constants'
2
2
  import type {BriloBlockType} from '~/types'
3
3
 
4
4
  export type FormFieldType = (typeof FIELD_TYPE_VALUES)[number]
5
5
  export type FormFieldTextType = (typeof FIELD_TEXT_TYPE_VALUES)[number]
6
+ export type FormFieldSelectMode = (typeof FIELD_SELECT_MODE_VALUES)[number]
7
+
8
+ export type FormFieldOption = string | {label?: string; value?: string; email?: string}
6
9
 
7
10
  export interface FormFieldAttributes extends Record<string, unknown> {
8
11
  type: FormFieldType
@@ -12,7 +15,8 @@ export interface FormFieldAttributes extends Record<string, unknown> {
12
15
  name: string
13
16
  placeholder: string
14
17
  required: boolean
15
- options: string[]
18
+ options: FormFieldOption[]
19
+ selectMode: FormFieldSelectMode
16
20
  defaultValue: string
17
21
  value: string
18
22
  }
@@ -1,6 +1,6 @@
1
1
  import {__} from '@wordpress/i18n'
2
2
 
3
- export const COLUMNS = [5, 4, 3, 2] as const
3
+ export const COLUMNS = [4, 3, 2] as const
4
4
  export const RATIOS = ['4:3', '3:2', '16:9', '1:1', '2:1', '3:4'] as const
5
5
  export const HEADING_LEVELS = [2, 3, 4] as const
6
6