@bpmn-io/form-js-editor 1.3.3 → 1.4.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.
Files changed (47) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +152 -116
  3. package/dist/assets/form-js-editor-base.css +821 -797
  4. package/dist/assets/form-js-editor.css +46 -17
  5. package/dist/assets/properties-panel.css +6 -1
  6. package/dist/index.cjs +1011 -855
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.es.js +1045 -894
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/types/FormEditor.d.ts +1 -0
  11. package/dist/types/features/palette/components/Palette.d.ts +35 -5
  12. package/dist/types/features/palette/components/PaletteEntry.d.ts +1 -0
  13. package/dist/types/features/properties-panel/PropertiesPanelHeaderProvider.d.ts +1 -1
  14. package/dist/types/features/properties-panel/PropertiesPanelRenderer.d.ts +17 -0
  15. package/dist/types/features/properties-panel/PropertiesProvider.d.ts +10 -0
  16. package/dist/types/features/properties-panel/Util.d.ts +2 -0
  17. package/dist/types/features/properties-panel/entries/ActionEntry.d.ts +1 -0
  18. package/dist/types/features/properties-panel/entries/AdornerEntry.d.ts +1 -0
  19. package/dist/types/features/properties-panel/entries/AltTextEntry.d.ts +1 -0
  20. package/dist/types/features/properties-panel/entries/DateTimeConstraintsEntry.d.ts +1 -0
  21. package/dist/types/features/properties-panel/entries/DateTimeEntry.d.ts +1 -0
  22. package/dist/types/features/properties-panel/entries/DateTimeSerializationEntry.d.ts +1 -0
  23. package/dist/types/features/properties-panel/entries/DefaultValueEntry.d.ts +11 -1
  24. package/dist/types/features/properties-panel/entries/DescriptionEntry.d.ts +1 -0
  25. package/dist/types/features/properties-panel/entries/DisabledEntry.d.ts +1 -0
  26. package/dist/types/features/properties-panel/entries/GroupEntries.d.ts +1 -0
  27. package/dist/types/features/properties-panel/entries/IdEntry.d.ts +1 -0
  28. package/dist/types/features/properties-panel/entries/ImageSourceEntry.d.ts +1 -0
  29. package/dist/types/features/properties-panel/entries/KeyEntry.d.ts +1 -0
  30. package/dist/types/features/properties-panel/entries/LabelEntry.d.ts +1 -0
  31. package/dist/types/features/properties-panel/entries/NumberEntries.d.ts +1 -0
  32. package/dist/types/features/properties-panel/entries/NumberSerializationEntry.d.ts +1 -0
  33. package/dist/types/features/properties-panel/entries/ReadonlyEntry.d.ts +1 -0
  34. package/dist/types/features/properties-panel/entries/SelectEntries.d.ts +1 -0
  35. package/dist/types/features/properties-panel/entries/SpacerEntry.d.ts +1 -0
  36. package/dist/types/features/properties-panel/entries/TextEntry.d.ts +1 -0
  37. package/dist/types/features/properties-panel/entries/factories/simpleBoolEntryFactory.d.ts +1 -0
  38. package/dist/types/features/properties-panel/groups/AppearanceGroup.d.ts +1 -0
  39. package/dist/types/features/properties-panel/groups/ConstraintsGroup.d.ts +1 -0
  40. package/dist/types/features/properties-panel/groups/GeneralGroup.d.ts +17 -1
  41. package/dist/types/features/properties-panel/groups/SerializationGroup.d.ts +1 -0
  42. package/dist/types/features/properties-panel/groups/ValidationGroup.d.ts +1 -0
  43. package/dist/types/features/properties-panel/groups/ValuesGroups.d.ts +1 -1
  44. package/dist/types/features/properties-panel/index.d.ts +2 -0
  45. package/dist/types/index.d.ts +2 -0
  46. package/dist/types/types.d.ts +28 -28
  47. package/package.json +4 -4
@@ -150,6 +150,7 @@ export default class FormEditor {
150
150
  __depends__: any[];
151
151
  __init__: string[];
152
152
  propertiesPanel: (string | typeof import("./features/properties-panel/PropertiesPanelRenderer").default)[];
153
+ propertiesProvider: (string | typeof import("./features/properties-panel/PropertiesProvider").default)[];
153
154
  } | {
154
155
  __init__: string[];
155
156
  renderInjector: (string | typeof import("./features/render-injection/RenderInjector").default)[];
@@ -1,10 +1,40 @@
1
1
  export default function Palette(props: any): import("preact").JSX.Element;
2
- export const PALETTE_ENTRIES: {
3
- label: any;
4
- type: string;
5
- group: any;
6
- }[];
2
+ /**
3
+ * Returns a list of palette entries.
4
+ *
5
+ * @param {FormFields} formFields
6
+ * @returns {Array<PaletteEntry>}
7
+ */
8
+ export function collectPaletteEntries(formFields: FormFields): Array<PaletteEntry>;
9
+ /**
10
+ * There are various options to specify an icon for a palette entry.
11
+ *
12
+ * a) via `iconUrl` property in a form field config
13
+ * b) via `icon` property in a form field config
14
+ * c) via statically defined iconsByType (fallback)
15
+ */
16
+ export function getPaletteIcon(entry: any): any;
17
+ /**
18
+ * @typedef { import('@bpmn-io/form-js-viewer').FormFields } FormFields
19
+ *
20
+ * @typedef { {
21
+ * label: string,
22
+ * type: string,
23
+ * group: ('basic-input'|'selection'|'presentation'|'action'),
24
+ * icon: preact.FunctionalComponent,
25
+ * iconUrl: string
26
+ * } } PaletteEntry
27
+ */
7
28
  export const PALETTE_GROUPS: {
8
29
  label: string;
9
30
  id: string;
10
31
  }[];
32
+ export type FormFields = import('@bpmn-io/form-js-viewer').FormFields;
33
+ export type PaletteEntry = {
34
+ label: string;
35
+ type: string;
36
+ group: ('basic-input' | 'selection' | 'presentation' | 'action');
37
+ icon: preact.FunctionalComponent;
38
+ iconUrl: string;
39
+ };
40
+ import PaletteEntry from './PaletteEntry';
@@ -0,0 +1 @@
1
+ export default function PaletteEntry(props: any): import("preact").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  export namespace PropertiesPanelHeaderProvider {
2
2
  function getElementLabel(field: any): any;
3
- function getElementIcon(field: any): () => import("preact").JSX.Element;
3
+ function getElementIcon(field: any): any;
4
4
  function getTypeLabel(field: any): any;
5
5
  }
@@ -2,6 +2,7 @@
2
2
  * @typedef { { parent: Element } } PropertiesPanelConfig
3
3
  * @typedef { import('../../core/EventBus').default } EventBus
4
4
  * @typedef { import('../../types').Injector } Injector
5
+ * @typedef { { getGroups: ({ formField, editFormField }) => ({ groups}) => Array } } PropertiesProvider
5
6
  */
6
7
  /**
7
8
  * @param {PropertiesPanelConfig} propertiesPanelConfig
@@ -25,6 +26,14 @@ declare class PropertiesPanelRenderer {
25
26
  detach(): void;
26
27
  _render(): void;
27
28
  _destroy(): void;
29
+ /**
30
+ * Register a new properties provider to the properties panel.
31
+ *
32
+ * @param {PropertiesProvider} provider
33
+ * @param {Number} [priority]
34
+ */
35
+ registerProvider(provider: PropertiesProvider, priority?: number): void;
36
+ _getProviders(): any;
28
37
  }
29
38
  declare namespace PropertiesPanelRenderer {
30
39
  const $inject: string[];
@@ -35,3 +44,11 @@ export type PropertiesPanelConfig = {
35
44
  };
36
45
  export type EventBus = import('../../core/EventBus').default;
37
46
  export type Injector = import('../../types').Injector;
47
+ export type PropertiesProvider = {
48
+ getGroups: ({ formField, editFormField }: {
49
+ formField: any;
50
+ editFormField: any;
51
+ }) => ({ groups }: {
52
+ groups: any;
53
+ }) => any[];
54
+ };
@@ -0,0 +1,10 @@
1
+ declare class PropertiesProvider {
2
+ constructor(propertiesPanel: any, injector: any);
3
+ _injector: any;
4
+ _filterVisibleEntries(groups: any, field: any, getService: any): any;
5
+ getGroups(field: any, editField: any): (groups: any) => any;
6
+ }
7
+ declare namespace PropertiesProvider {
8
+ const $inject: string[];
9
+ }
10
+ export default PropertiesProvider;
@@ -6,5 +6,7 @@ export function isValidNumber(value: any): boolean;
6
6
  export function stopPropagation(listener: any): (event: any) => void;
7
7
  export function textToLabel(text: any): string;
8
8
  export function isValidDotPath(path: any): boolean;
9
+ export function hasEntryConfigured(formFieldDefinition: any, entryId: any): any;
10
+ export function hasValuesGroupsConfigured(formFieldDefinition: any): any;
9
11
  export const INPUTS: string[];
10
12
  export const VALUES_INPUTS: string[];
@@ -4,6 +4,7 @@ export default function ActionEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function Action(props: any): any;
9
10
  export {};
@@ -6,6 +6,7 @@ export default function AdornerEntry(props: any): {
6
6
  field: any;
7
7
  onChange: (key: any) => (value: any) => void;
8
8
  getValue: (key: any) => () => any;
9
+ isDefaultVisible: {};
9
10
  }[];
10
11
  declare function PrefixAdorner(props: any): any;
11
12
  export {};
@@ -4,6 +4,7 @@ export default function AltTextEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function AltText(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function DateTimeConstraintsEntry(props: any): {
4
4
  isEdited: any;
5
5
  editField: any;
6
6
  field: any;
7
+ isDefaultVisible: (field: any) => any;
7
8
  }[];
8
9
  declare function TimeIntervalSelect(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function DateTimeEntry(props: any): {
4
4
  isEdited: any;
5
5
  editField: any;
6
6
  field: any;
7
+ isDefaultVisible: (field: any) => boolean;
7
8
  }[];
8
9
  declare function DateTimeSubtypeSelect(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function DateTimeFormatEntry(props: any): {
4
4
  isEdited: any;
5
5
  editField: any;
6
6
  field: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function TimeFormatSelect(props: any): any;
9
10
  export {};
@@ -1,2 +1,12 @@
1
- export default function DefaultOptionEntry(props: any): any[];
1
+ export default function DefaultOptionEntry(props: any): {
2
+ component: typeof DefaultValueCheckbox;
3
+ isEdited: any;
4
+ isDefaultVisible: (field: any) => any;
5
+ editField: any;
6
+ field: any;
7
+ id: string;
8
+ label: string;
9
+ }[];
2
10
  export const EMPTY_OPTION: any;
11
+ declare function DefaultValueCheckbox(props: any): any;
12
+ export {};
@@ -4,6 +4,7 @@ export default function DescriptionEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function Description(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function DisabledEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function Disabled(props: any): any;
9
10
  export {};
@@ -7,4 +7,5 @@ export default function GroupEntries(props: any): {
7
7
  description: any;
8
8
  component: (props: any) => any;
9
9
  isEdited: any;
10
+ isDefaultVisible: any;
10
11
  }[];
@@ -4,6 +4,7 @@ export default function IdEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function Id(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function SourceEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function Source(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function KeyEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function Key(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function LabelEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function DateLabel(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function NumberEntries(props: any): {
4
4
  isEdited: any;
5
5
  editField: any;
6
6
  field: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function NumberDecimalDigits(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function NumberSerializationEntry(props: any): {
4
4
  isEdited: any;
5
5
  editField: any;
6
6
  field: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function SerializeToString(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function ReadonlyEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function Readonly(props: any): any;
9
10
  export {};
@@ -7,4 +7,5 @@ export default function SelectEntries(props: any): {
7
7
  description: any;
8
8
  component: (props: any) => any;
9
9
  isEdited: any;
10
+ isDefaultVisible: any;
10
11
  }[];
@@ -4,6 +4,7 @@ export default function SpacerEntry(props: any): {
4
4
  isEdited: any;
5
5
  editField: any;
6
6
  field: any;
7
+ isDefaultVisible: {};
7
8
  }[];
8
9
  declare function SpacerHeight(props: any): any;
9
10
  export {};
@@ -4,6 +4,7 @@ export default function TextEntry(props: any): {
4
4
  editField: any;
5
5
  field: any;
6
6
  isEdited: any;
7
+ isDefaultVisible: (field: any) => boolean;
7
8
  }[];
8
9
  declare function Text(props: any): any;
9
10
  export {};
@@ -7,4 +7,5 @@ export default function simpleBoolEntryFactory(options: any): {
7
7
  description: any;
8
8
  component: (props: any) => any;
9
9
  isEdited: any;
10
+ isDefaultVisible: any;
10
11
  };
@@ -9,5 +9,6 @@ export default function AppearanceGroup(field: any, editField: any): {
9
9
  field: any;
10
10
  onChange: (key: any) => (value: any) => void;
11
11
  getValue: (key: any) => () => any;
12
+ isDefaultVisible: {};
12
13
  }[];
13
14
  };
@@ -7,5 +7,6 @@ export default function ConstraintsGroup(field: any, editField: any): {
7
7
  isEdited: any;
8
8
  editField: any;
9
9
  field: any;
10
+ isDefaultVisible: (field: any) => any;
10
11
  }[];
11
12
  };
@@ -1,5 +1,21 @@
1
1
  export default function GeneralGroup(field: any, editField: any, getService: any): {
2
2
  id: string;
3
3
  label: string;
4
- entries: any[];
4
+ entries: ({
5
+ id: string;
6
+ component: (props: any) => any;
7
+ editField: any;
8
+ field: any;
9
+ isEdited: any;
10
+ } | {
11
+ id: any;
12
+ label: any;
13
+ path: any;
14
+ field: any;
15
+ editField: any;
16
+ description: any;
17
+ component: (props: any) => any;
18
+ isEdited: any;
19
+ isDefaultVisible: any;
20
+ })[];
5
21
  };
@@ -7,5 +7,6 @@ export default function SerializationGroup(field: any, editField: any): {
7
7
  isEdited: any;
8
8
  editField: any;
9
9
  field: any;
10
+ isDefaultVisible: {};
10
11
  }[];
11
12
  };
@@ -8,6 +8,7 @@ export default function ValidationGroup(field: any, editField: any): {
8
8
  field: any;
9
9
  isEdited: any;
10
10
  onChange: (key: any) => (value: any) => void;
11
+ isDefaultVisible: (field: any) => boolean;
11
12
  }[];
12
13
  };
13
14
  declare function Required(props: any): any;
@@ -1 +1 @@
1
- export default function ValuesGroups(field: any, editField: any): any[];
1
+ export default function ValuesGroups(field: any, editField: any, getService: any): any[];
@@ -2,6 +2,8 @@ declare namespace _default {
2
2
  const __depends__: any[];
3
3
  const __init__: string[];
4
4
  const propertiesPanel: (string | typeof PropertiesPanelModule)[];
5
+ const propertiesProvider: (string | typeof PropertiesProvider)[];
5
6
  }
6
7
  export default _default;
7
8
  import PropertiesPanelModule from './PropertiesPanelRenderer';
9
+ import PropertiesProvider from './PropertiesProvider';
@@ -13,3 +13,5 @@ export type CreateFormEditorOptions = import('./types').CreateFormEditorOptions;
13
13
  import FormEditor from './FormEditor';
14
14
  import { schemaVersion } from '@bpmn-io/form-js-viewer';
15
15
  export { FormEditor, schemaVersion };
16
+ export { useDebounce, usePrevious, useService } from "./render/hooks";
17
+ export { useService as usePropertiesPanelService, useVariables } from "./features/properties-panel/hooks";
@@ -1,29 +1,29 @@
1
- import { Injector } from 'didi';
2
-
3
- export type Module = any;
4
- export type Schema = any;
5
-
6
- export interface FormEditorProperties {
7
- [x: string]: any
8
- }
9
-
10
- export interface FormEditorOptions {
11
- additionalModules?: Module[];
12
- container?: Element | null | string;
13
- exporter?: {
14
- name: string,
15
- version: string
16
- };
17
- injector?: Injector;
18
- modules?: Module[];
19
- properties?: FormEditorProperties;
20
- [x:string]: any;
21
- }
22
-
23
- export interface CreateFormEditorOptions extends FormEditorOptions {
24
- schema?: Schema
25
- }
26
-
27
- export {
28
- Injector
1
+ import { Injector } from 'didi';
2
+
3
+ export type Module = any;
4
+ export type Schema = any;
5
+
6
+ export interface FormEditorProperties {
7
+ [x: string]: any
8
+ }
9
+
10
+ export interface FormEditorOptions {
11
+ additionalModules?: Module[];
12
+ container?: Element | null | string;
13
+ exporter?: {
14
+ name: string,
15
+ version: string
16
+ };
17
+ injector?: Injector;
18
+ modules?: Module[];
19
+ properties?: FormEditorProperties;
20
+ [x:string]: any;
21
+ }
22
+
23
+ export interface CreateFormEditorOptions extends FormEditorOptions {
24
+ schema?: Schema
25
+ }
26
+
27
+ export {
28
+ Injector
29
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/form-js-editor",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
4
4
  "description": "Edit forms - powered by bpmn.io",
5
5
  "exports": {
6
6
  ".": {
@@ -47,8 +47,8 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@bpmn-io/draggle": "^4.0.0",
50
- "@bpmn-io/form-js-viewer": "^1.3.3",
51
- "@bpmn-io/properties-panel": "^3.8.0",
50
+ "@bpmn-io/form-js-viewer": "^1.4.0",
51
+ "@bpmn-io/properties-panel": "^3.11.0",
52
52
  "array-move": "^3.0.1",
53
53
  "big.js": "^6.2.1",
54
54
  "ids": "^1.0.0",
@@ -62,5 +62,5 @@
62
62
  "files": [
63
63
  "dist"
64
64
  ],
65
- "gitHead": "b3d1acdc9e22089409e11b8a84ad8cc615d8732d"
65
+ "gitHead": "cf256b38f256abf7b4d676ea5cd2bdf796b08f31"
66
66
  }