@bpmn-io/form-js-viewer 1.6.4 → 1.7.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 (97) hide show
  1. package/dist/assets/form-js-base.css +20 -10
  2. package/dist/assets/form-js.css +20 -9
  3. package/dist/index.cjs +3173 -2862
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.es.js +3161 -2860
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/types/Form.d.ts +1 -1
  8. package/dist/types/core/EventBus.d.ts +1 -1
  9. package/dist/types/core/FieldFactory.d.ts +2 -3
  10. package/dist/types/core/FormFieldRegistry.d.ts +2 -3
  11. package/dist/types/core/FormLayouter.d.ts +2 -3
  12. package/dist/types/core/Importer.d.ts +11 -12
  13. package/dist/types/core/PathRegistry.d.ts +2 -3
  14. package/dist/types/core/Validator.d.ts +2 -3
  15. package/dist/types/core/index.d.ts +9 -10
  16. package/dist/types/features/expressionLanguage/ConditionChecker.d.ts +2 -3
  17. package/dist/types/features/expressionLanguage/FeelExpressionLanguage.d.ts +2 -3
  18. package/dist/types/features/expressionLanguage/FeelersTemplating.d.ts +4 -3
  19. package/dist/types/features/expressionLanguage/index.d.ts +4 -5
  20. package/dist/types/features/index.d.ts +4 -4
  21. package/dist/types/features/markdown/MarkdownRenderer.d.ts +2 -3
  22. package/dist/types/features/markdown/index.d.ts +2 -3
  23. package/dist/types/features/repeatRender/RepeatRenderManager.d.ts +2 -3
  24. package/dist/types/features/repeatRender/index.d.ts +2 -3
  25. package/dist/types/features/viewerCommands/ViewerCommands.d.ts +3 -4
  26. package/dist/types/features/viewerCommands/cmd/UpdateFieldValidationHandler.d.ts +2 -3
  27. package/dist/types/features/viewerCommands/index.d.ts +2 -3
  28. package/dist/types/index.d.ts +2 -2
  29. package/dist/types/render/FormFields.d.ts +1 -1
  30. package/dist/types/render/Renderer.d.ts +6 -7
  31. package/dist/types/render/components/Description.d.ts +1 -1
  32. package/dist/types/render/components/Errors.d.ts +1 -1
  33. package/dist/types/render/components/FormComponent.d.ts +1 -1
  34. package/dist/types/render/components/FormField.d.ts +1 -1
  35. package/dist/types/render/components/Label.d.ts +1 -1
  36. package/dist/types/render/components/PoweredBy.d.ts +1 -1
  37. package/dist/types/render/components/Sanitizer.d.ts +0 -18
  38. package/dist/types/render/components/form-fields/Button.d.ts +3 -3
  39. package/dist/types/render/components/form-fields/Checkbox.d.ts +3 -3
  40. package/dist/types/render/components/form-fields/Checklist.d.ts +3 -3
  41. package/dist/types/render/components/form-fields/Datetime.d.ts +3 -3
  42. package/dist/types/render/components/form-fields/Default.d.ts +2 -3
  43. package/dist/types/render/components/form-fields/DynamicList.d.ts +2 -3
  44. package/dist/types/render/components/form-fields/Group.d.ts +2 -3
  45. package/dist/types/render/components/form-fields/Html.d.ts +14 -0
  46. package/dist/types/render/components/form-fields/IFrame.d.ts +8 -4
  47. package/dist/types/render/components/form-fields/Image.d.ts +3 -3
  48. package/dist/types/render/components/form-fields/Number.d.ts +3 -3
  49. package/dist/types/render/components/form-fields/Radio.d.ts +3 -3
  50. package/dist/types/render/components/form-fields/Select.d.ts +3 -3
  51. package/dist/types/render/components/form-fields/Separator.d.ts +3 -3
  52. package/dist/types/render/components/form-fields/Spacer.d.ts +3 -3
  53. package/dist/types/render/components/form-fields/Table.d.ts +22 -19
  54. package/dist/types/render/components/form-fields/Taglist.d.ts +3 -3
  55. package/dist/types/render/components/form-fields/Text.d.ts +3 -3
  56. package/dist/types/render/components/form-fields/Textarea.d.ts +3 -3
  57. package/dist/types/render/components/form-fields/Textfield.d.ts +3 -3
  58. package/dist/types/render/components/form-fields/parts/ChildrenRenderer.d.ts +1 -1
  59. package/dist/types/render/components/form-fields/parts/Datepicker.d.ts +1 -1
  60. package/dist/types/render/components/form-fields/parts/DropdownList.d.ts +1 -1
  61. package/dist/types/render/components/form-fields/parts/InputAdorner.d.ts +1 -1
  62. package/dist/types/render/components/form-fields/parts/SearchableSelect.d.ts +1 -1
  63. package/dist/types/render/components/form-fields/parts/SimpleSelect.d.ts +1 -1
  64. package/dist/types/render/components/form-fields/parts/SkipLink.d.ts +1 -1
  65. package/dist/types/render/components/form-fields/parts/TemplatedInputAdorner.d.ts +1 -1
  66. package/dist/types/render/components/form-fields/parts/Timepicker.d.ts +1 -1
  67. package/dist/types/render/components/index.d.ts +28 -26
  68. package/dist/types/render/components/util/domUtil.d.ts +9 -0
  69. package/dist/types/render/components/util/sanitizerUtil.d.ts +24 -0
  70. package/dist/types/render/context/FormContext.d.ts +2 -2
  71. package/dist/types/render/context/FormRenderContext.d.ts +1 -2
  72. package/dist/types/render/context/LocalExpressionContext.d.ts +1 -2
  73. package/dist/types/render/context/index.d.ts +3 -3
  74. package/dist/types/render/hooks/index.d.ts +18 -11
  75. package/dist/types/render/hooks/useCleanupMultiSelectValue.d.ts +1 -0
  76. package/dist/types/render/hooks/useCleanupSingleSelectValue.d.ts +1 -1
  77. package/dist/types/render/hooks/useCondition.d.ts +1 -1
  78. package/dist/types/render/hooks/useDangerousHTMLWrapper.d.ts +16 -0
  79. package/dist/types/render/hooks/useDeepCompareState.d.ts +1 -1
  80. package/dist/types/render/hooks/useExpressionEvaluation.d.ts +1 -1
  81. package/dist/types/render/hooks/useFilteredFormData.d.ts +1 -1
  82. package/dist/types/render/hooks/useFlushDebounce.d.ts +1 -2
  83. package/dist/types/render/hooks/useKeyDownAction.d.ts +1 -1
  84. package/dist/types/render/hooks/useOptionsAsync.d.ts +1 -1
  85. package/dist/types/render/hooks/usePrevious.d.ts +1 -1
  86. package/dist/types/render/hooks/useReadonly.d.ts +1 -1
  87. package/dist/types/render/hooks/useScrollIntoView.d.ts +1 -1
  88. package/dist/types/render/hooks/useSecurityAttributesMap.d.ts +7 -0
  89. package/dist/types/render/hooks/useService.d.ts +1 -1
  90. package/dist/types/render/hooks/useSingleLineTemplateEvaluation.d.ts +1 -1
  91. package/dist/types/render/hooks/useTemplateEvaluation.d.ts +3 -1
  92. package/dist/types/render/index.d.ts +3 -4
  93. package/dist/types/util/constants/IFrameConstants.d.ts +8 -0
  94. package/dist/types/util/constants/index.d.ts +1 -0
  95. package/dist/types/util/structure.d.ts +1 -1
  96. package/package.json +5 -5
  97. package/dist/types/render/hooks/useCleanupMultiSelectValues.d.ts +0 -1
@@ -1,5 +1,5 @@
1
- declare function Radio(props: any): import("preact").JSX.Element;
2
- declare namespace Radio {
1
+ export function Radio(props: any): import("preact").JSX.Element;
2
+ export namespace Radio {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
@@ -10,7 +10,7 @@ declare namespace Radio {
10
10
  export { createEmptyOptions as create };
11
11
  }
12
12
  }
13
- export default Radio;
14
13
  declare const type: "radio";
15
14
  import { sanitizeSingleSelectValue } from '../util/sanitizerUtil';
16
15
  import { createEmptyOptions } from '../util/optionsUtil';
16
+ export {};
@@ -1,5 +1,5 @@
1
- declare function Select(props: any): import("preact").JSX.Element;
2
- declare namespace Select {
1
+ export function Select(props: any): import("preact").JSX.Element;
2
+ export namespace Select {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
@@ -10,7 +10,7 @@ declare namespace Select {
10
10
  export { createEmptyOptions as create };
11
11
  }
12
12
  }
13
- export default Select;
14
13
  declare const type: "select";
15
14
  import { sanitizeSingleSelectValue } from '../util/sanitizerUtil';
16
15
  import { createEmptyOptions } from '../util/optionsUtil';
16
+ export {};
@@ -1,5 +1,5 @@
1
- declare function Separator(): import("preact").JSX.Element;
2
- declare namespace Separator {
1
+ export function Separator(): import("preact").JSX.Element;
2
+ export namespace Separator {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
@@ -8,5 +8,5 @@ declare namespace Separator {
8
8
  export function create(options?: {}): {};
9
9
  }
10
10
  }
11
- export default Separator;
12
11
  declare const type: "separator";
12
+ export {};
@@ -1,5 +1,5 @@
1
- declare function Spacer(props: any): import("preact").JSX.Element;
2
- declare namespace Spacer {
1
+ export function Spacer(props: any): import("preact").JSX.Element;
2
+ export namespace Spacer {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
@@ -10,5 +10,5 @@ declare namespace Spacer {
10
10
  };
11
11
  }
12
12
  }
13
- export default Spacer;
14
13
  declare const type: "spacer";
14
+ export {};
@@ -9,20 +9,22 @@
9
9
  * @property {string} label
10
10
  * @property {string} key
11
11
  *
12
+ * @typedef Field
13
+ * @property {string} id
14
+ * @property {Array<Column>} [columns]
15
+ * @property {string} [columnsExpression]
16
+ * @property {string} [label]
17
+ * @property {number} [rowCount]
18
+ * @property {string} [dataSource]
19
+ *
12
20
  * @typedef Props
13
- * @property {Object} field
14
- * @property {string} field.id
15
- * @property {Array<Column>} [field.columns]
16
- * @property {string} [field.columnsExpression]
17
- * @property {string} [field.label]
18
- * @property {number} [field.rowCount]
19
- * @property {string} [field.dataSource]
21
+ * @property {Field} field
20
22
  *
21
23
  * @param {Props} props
22
24
  * @returns {import("preact").JSX.Element}
23
25
  */
24
- declare function Table(props: Props): import("preact").JSX.Element;
25
- declare namespace Table {
26
+ export function Table(props: Props): import("preact").JSX.Element;
27
+ export namespace Table {
26
28
  namespace config {
27
29
  export { type };
28
30
  export let keyed: boolean;
@@ -41,14 +43,13 @@ declare namespace Table {
41
43
  key: string;
42
44
  }[];
43
45
  };
44
- export let initialDemoData: {
46
+ export function generateInitialDemoData(field: Field): {
45
47
  id: number;
46
48
  name: string;
47
49
  date: string;
48
50
  }[];
49
51
  }
50
52
  }
51
- export default Table;
52
53
  export type Direction = ('asc' | 'desc');
53
54
  export type Sorting = {
54
55
  key: string;
@@ -58,14 +59,16 @@ export type Column = {
58
59
  label: string;
59
60
  key: string;
60
61
  };
62
+ export type Field = {
63
+ id: string;
64
+ columns?: Array<Column>;
65
+ columnsExpression?: string;
66
+ label?: string;
67
+ rowCount?: number;
68
+ dataSource?: string;
69
+ };
61
70
  export type Props = {
62
- field: {
63
- id: string;
64
- columns?: Array<Column>;
65
- columnsExpression?: string;
66
- label?: string;
67
- rowCount?: number;
68
- dataSource?: string;
69
- };
71
+ field: Field;
70
72
  };
71
73
  declare const type: "table";
74
+ export {};
@@ -1,5 +1,5 @@
1
- declare function Taglist(props: any): import("preact").JSX.Element;
2
- declare namespace Taglist {
1
+ export function Taglist(props: any): import("preact").JSX.Element;
2
+ export namespace Taglist {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
@@ -10,7 +10,7 @@ declare namespace Taglist {
10
10
  export { createEmptyOptions as create };
11
11
  }
12
12
  }
13
- export default Taglist;
14
13
  declare const type: "taglist";
15
14
  import { sanitizeMultiSelectValue } from '../util/sanitizerUtil';
16
15
  import { createEmptyOptions } from '../util/optionsUtil';
16
+ export {};
@@ -1,5 +1,5 @@
1
- declare function Text(props: any): import("preact").JSX.Element;
2
- declare namespace Text {
1
+ export function Text(props: any): import("preact").JSX.Element;
2
+ export namespace Text {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
@@ -10,5 +10,5 @@ declare namespace Text {
10
10
  };
11
11
  }
12
12
  }
13
- export default Text;
14
13
  declare const type: "text";
14
+ export {};
@@ -1,5 +1,5 @@
1
- declare function Textarea(props: any): import("preact").JSX.Element;
2
- declare namespace Textarea {
1
+ export function Textarea(props: any): import("preact").JSX.Element;
2
+ export namespace Textarea {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
@@ -12,5 +12,5 @@ declare namespace Textarea {
12
12
  export function create(options?: {}): {};
13
13
  }
14
14
  }
15
- export default Textarea;
16
15
  declare const type: "textarea";
16
+ export {};
@@ -1,5 +1,5 @@
1
- declare function Textfield(props: any): import("preact").JSX.Element;
2
- declare namespace Textfield {
1
+ export function Textfield(props: any): import("preact").JSX.Element;
2
+ export namespace Textfield {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
@@ -12,5 +12,5 @@ declare namespace Textfield {
12
12
  export function create(options?: {}): {};
13
13
  }
14
14
  }
15
- export default Textfield;
16
15
  declare const type: "textfield";
16
+ export {};
@@ -1 +1 @@
1
- export default function ChildrenRenderer(props: any): import("preact").JSX.Element;
1
+ export function ChildrenRenderer(props: any): import("preact").JSX.Element;
@@ -1 +1 @@
1
- export default function Datepicker(props: any): import("preact").JSX.Element;
1
+ export function Datepicker(props: any): import("preact").JSX.Element;
@@ -1 +1 @@
1
- export default function DropdownList(props: any): import("preact").JSX.Element;
1
+ export function DropdownList(props: any): import("preact").JSX.Element;
@@ -1 +1 @@
1
- export default function InputAdorner(props: any): import("preact").JSX.Element;
1
+ export function InputAdorner(props: any): import("preact").JSX.Element;
@@ -1 +1 @@
1
- export default function SearchableSelect(props: any): import("preact").JSX.Element;
1
+ export function SearchableSelect(props: any): import("preact").JSX.Element;
@@ -1 +1 @@
1
- export default function SimpleSelect(props: any): import("preact").JSX.Element;
1
+ export function SimpleSelect(props: any): import("preact").JSX.Element;
@@ -1 +1 @@
1
- export default function SkipLink(props: any): import("preact").JSX.Element;
1
+ export function SkipLink(props: any): import("preact").JSX.Element;
@@ -1 +1 @@
1
- export default function TemplatedInputAdorner(props: any): import("preact").JSX.Element;
1
+ export function TemplatedInputAdorner(props: any): import("preact").JSX.Element;
@@ -1 +1 @@
1
- export default function Timepicker(props: any): import("preact").JSX.Element;
1
+ export function Timepicker(props: any): import("preact").JSX.Element;
@@ -1,28 +1,30 @@
1
- export const formFields: (typeof Default | typeof Group | typeof IFrame)[];
1
+ export const formFields: (typeof Default | typeof Group | typeof Image)[];
2
2
  export * from "./icons";
3
3
  export * from "./Sanitizer";
4
- import Label from './Label';
5
- import Description from './Description';
6
- import Errors from './Errors';
7
- import Button from './form-fields/Button';
8
- import Checkbox from './form-fields/Checkbox';
9
- import Checklist from './form-fields/Checklist';
10
- import Default from './form-fields/Default';
11
- import Datetime from './form-fields/Datetime';
12
- import FormComponent from './FormComponent';
13
- import FormField from './FormField';
14
- import Group from './form-fields/Group';
15
- import IFrame from './form-fields/IFrame';
16
- import DynamicList from './form-fields/DynamicList';
17
- import Image from './form-fields/Image';
18
- import Numberfield from './form-fields/Number';
19
- import Radio from './form-fields/Radio';
20
- import Select from './form-fields/Select';
21
- import Separator from './form-fields/Separator';
22
- import Spacer from './form-fields/Spacer';
23
- import Taglist from './form-fields/Taglist';
24
- import Text from './form-fields/Text';
25
- import Textfield from './form-fields/Textfield';
26
- import Textarea from './form-fields/Textarea';
27
- import Table from './form-fields/Table';
28
- export { Label, Description, Errors, Button, Checkbox, Checklist, Default, Datetime, FormComponent, FormField, Group, IFrame, DynamicList, Image, Numberfield, Radio, Select, Separator, Spacer, Taglist, Text, Textfield, Textarea, Table };
4
+ export * from "./util/sanitizerUtil";
5
+ import { Label } from './Label';
6
+ import { Description } from './Description';
7
+ import { Errors } from './Errors';
8
+ import { Button } from './form-fields/Button';
9
+ import { Checkbox } from './form-fields/Checkbox';
10
+ import { Checklist } from './form-fields/Checklist';
11
+ import { Default } from './form-fields/Default';
12
+ import { Datetime } from './form-fields/Datetime';
13
+ import { FormComponent } from './FormComponent';
14
+ import { FormField } from './FormField';
15
+ import { Group } from './form-fields/Group';
16
+ import { IFrame } from './form-fields/IFrame';
17
+ import { DynamicList } from './form-fields/DynamicList';
18
+ import { Image } from './form-fields/Image';
19
+ import { Numberfield } from './form-fields/Number';
20
+ import { Radio } from './form-fields/Radio';
21
+ import { Select } from './form-fields/Select';
22
+ import { Separator } from './form-fields/Separator';
23
+ import { Spacer } from './form-fields/Spacer';
24
+ import { Taglist } from './form-fields/Taglist';
25
+ import { Text } from './form-fields/Text';
26
+ import { Html } from './form-fields/Html';
27
+ import { Textfield } from './form-fields/Textfield';
28
+ import { Textarea } from './form-fields/Textarea';
29
+ import { Table } from './form-fields/Table';
30
+ export { Label, Description, Errors, Button, Checkbox, Checklist, Default, Datetime, FormComponent, FormField, Group, IFrame, DynamicList, Image, Numberfield, Radio, Select, Separator, Spacer, Taglist, Text, Html, Textfield, Textarea, Table };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Wrap CSS styles with a given prefix.
3
+ *
4
+ * @param {HTMLElement} rootNode
5
+ * @param {string} prefix
6
+ *
7
+ * @returns {HTMLElement}
8
+ */
9
+ export function wrapCSSStyles(rootNode: HTMLElement, prefix: string): HTMLElement;
@@ -2,3 +2,27 @@ export function sanitizeDateTimePickerValue(options: any): string;
2
2
  export function hasEqualValue(value: any, array: any): boolean;
3
3
  export function sanitizeSingleSelectValue(options: any): any;
4
4
  export function sanitizeMultiSelectValue(options: any): any;
5
+ /**
6
+ * Sanitizes an image source to ensure we only allow for data URI and links
7
+ * that start with http(s).
8
+ *
9
+ * Note: Most browsers anyway do not support script execution in <img> elements.
10
+ *
11
+ * @param {string} src
12
+ * @returns {string}
13
+ */
14
+ export function sanitizeImageSource(src: string): string;
15
+ /**
16
+ * Sanitizes an iframe source to ensure we only allow for links
17
+ * that start with http(s).
18
+ *
19
+ * @param {string} src
20
+ * @returns {string}
21
+ */
22
+ export function sanitizeIFrameSource(src: string): string;
23
+ /**
24
+ * Escapes HTML and returns pure text.
25
+ * @param {string} html
26
+ * @returns {string}
27
+ */
28
+ export function escapeHTML(html: string): string;
@@ -1,5 +1,4 @@
1
- export default FormContext;
2
- declare const FormContext: import("preact").Context<{
1
+ export const FormContext: import("preact").Context<{
3
2
  getService: typeof getService;
4
3
  formId: any;
5
4
  }>;
@@ -10,3 +9,4 @@ declare const FormContext: import("preact").Context<{
10
9
  * @returns {any}
11
10
  */
12
11
  declare function getService(type: string, strict?: boolean): any;
12
+ export {};
@@ -1,5 +1,4 @@
1
- export default FormRenderContext;
2
- declare const FormRenderContext: import("preact").Context<{
1
+ export const FormRenderContext: import("preact").Context<{
3
2
  Empty: (props: any) => any;
4
3
  Hidden: (props: any) => any;
5
4
  Children: (props: any) => import("preact").JSX.Element;
@@ -1,5 +1,4 @@
1
- export default LocalExpressionContext;
2
- declare const LocalExpressionContext: import("preact").Context<{
1
+ export const LocalExpressionContext: import("preact").Context<{
3
2
  data: any;
4
3
  this: any;
5
4
  parent: any;
@@ -1,3 +1,3 @@
1
- export { default as FormRenderContext } from "./FormRenderContext";
2
- export { default as LocalExpressionContext } from "./LocalExpressionContext";
3
- export { default as FormContext } from "./FormContext";
1
+ export { FormRenderContext } from "./FormRenderContext";
2
+ export { LocalExpressionContext } from "./LocalExpressionContext";
3
+ export { FormContext } from "./FormContext";
@@ -1,11 +1,18 @@
1
- export { default as useCondition } from "./useCondition";
2
- export { default as useScrollIntoView } from "./useScrollIntoView";
3
- export { default as useExpressionEvaluation } from "./useExpressionEvaluation";
4
- export { default as useFilteredFormData } from "./useFilteredFormData";
5
- export { default as useKeyDownAction } from "./useKeyDownAction";
6
- export { default as useReadonly } from "./useReadonly";
7
- export { default as useService } from "./useService";
8
- export { default as usePrevious } from "./usePrevious";
9
- export { default as useDeepCompareState } from "./useDeepCompareState";
10
- export { default as useSingleLineTemplateEvaluation } from "./useSingleLineTemplateEvaluation";
11
- export { default as useTemplateEvaluation } from "./useTemplateEvaluation";
1
+ export { useCondition } from "./useCondition";
2
+ export { useDangerousHTMLWrapper } from "./useDangerousHTMLWrapper";
3
+ export { useSecurityAttributesMap } from "./useSecurityAttributesMap";
4
+ export { useGetLabelCorrelation } from "./useGetLabelCorrelation";
5
+ export { useScrollIntoView } from "./useScrollIntoView";
6
+ export { useExpressionEvaluation } from "./useExpressionEvaluation";
7
+ export { useFilteredFormData } from "./useFilteredFormData";
8
+ export { useKeyDownAction } from "./useKeyDownAction";
9
+ export { useReadonly } from "./useReadonly";
10
+ export { useService } from "./useService";
11
+ export { usePrevious } from "./usePrevious";
12
+ export { useFlushDebounce } from "./useFlushDebounce";
13
+ export { useDeepCompareState } from "./useDeepCompareState";
14
+ export { useSingleLineTemplateEvaluation } from "./useSingleLineTemplateEvaluation";
15
+ export { useTemplateEvaluation } from "./useTemplateEvaluation";
16
+ export { useCleanupSingleSelectValue } from "./useCleanupSingleSelectValue";
17
+ export { useCleanupMultiSelectValue } from "./useCleanupMultiSelectValue";
18
+ export { useOptionsAsync, LOAD_STATES } from "./useOptionsAsync";
@@ -0,0 +1 @@
1
+ export function useCleanupMultiSelectValue(props: any): void;
@@ -1 +1 @@
1
- export default function _default(props: any): void;
1
+ export function useCleanupSingleSelectValue(props: any): void;
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * @returns {boolean} true if condition is met or no condition or condition checker exists
7
7
  */
8
- export default function useCondition(condition: string | undefined): boolean;
8
+ export function useCondition(condition: string | undefined): boolean;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Wrap HTML content in a configuration object for dangerouslySetInnerHTML
3
+ * @param {Object} props
4
+ * @param {string} props.html
5
+ * @param {Function} [props.transform]
6
+ * @param {boolean} [props.sanitize = true]
7
+ * @param {boolean} [props.sanitizeStyleTags = true]
8
+ */
9
+ export function useDangerousHTMLWrapper(props: {
10
+ html: string;
11
+ transform?: Function;
12
+ sanitize?: boolean;
13
+ sanitizeStyleTags?: boolean;
14
+ }): {
15
+ __html: any;
16
+ };
@@ -5,4 +5,4 @@
5
5
  * @param {any} defaultValue - The initial default value for the state.
6
6
  * @returns {any} - Returns the current state.
7
7
  */
8
- export default function useDeepCompareState(value: any, defaultValue: any): any;
8
+ export function useDeepCompareState(value: any, defaultValue: any): any;
@@ -6,4 +6,4 @@
6
6
  * @param {string} value - The string to evaluate.
7
7
  * @returns {any} - Evaluated value or the original value if not an expression.
8
8
  */
9
- export default function useExpressionEvaluation(value: string): any;
9
+ export function useExpressionEvaluation(value: string): any;
@@ -4,4 +4,4 @@
4
4
  *
5
5
  * Warning: costly operation, use with care
6
6
  */
7
- export default function useFilteredFormData(): any;
7
+ export function useFilteredFormData(): any;
@@ -1,2 +1 @@
1
- export default useFlushDebounce;
2
- declare function useFlushDebounce(func: any, additionalDeps?: any[]): ((...args: any[]) => void)[];
1
+ export function useFlushDebounce(func: any): ((...args: any[]) => void)[];
@@ -1 +1 @@
1
- export default function useKeyDownAction(targetKey: any, action: any, listenerElement?: Window & typeof globalThis): void;
1
+ export function useKeyDownAction(targetKey: any, action: any, listenerElement?: Window & typeof globalThis): void;
@@ -9,7 +9,7 @@
9
9
  * @param {Object} field - The form field to handle options for
10
10
  * @return {OptionsGetter} optionsGetter - A options getter object providing loading state and options
11
11
  */
12
- export default function _default(field: any): OptionsGetter;
12
+ export function useOptionsAsync(field: any): OptionsGetter;
13
13
  export type LOAD_STATES = string;
14
14
  export namespace LOAD_STATES {
15
15
  let LOADING: string;
@@ -1 +1 @@
1
- export default function usePrevious(value: any, defaultValue: any, dependencies: any): any;
1
+ export function usePrevious(value: any, defaultValue?: any): any;
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * @returns {boolean}
11
11
  */
12
- export default function useReadonly(formField: any, properties?: FormProperties): boolean;
12
+ export function useReadonly(formField: any, properties?: FormProperties): boolean;
13
13
  /**
14
14
  * Retrieve readonly value of a form field, given it can be an
15
15
  * expression optionally or configured globally.
@@ -10,7 +10,7 @@
10
10
  * @param {Number} [scrollOptions.offset=0] - An offset that is added to the scroll position.
11
11
  * @param {Boolean} [scrollOptions.scrollIfVisible=false] - Whether to scroll even if the element is visible.
12
12
  */
13
- export default function useScrollIntoView(targetRef: any, deps: any[], scrollOptions?: {
13
+ export function useScrollIntoView(targetRef: any, deps: any[], scrollOptions?: {
14
14
  align?: string;
15
15
  behavior?: string;
16
16
  offset?: number;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A custom hook to build up security attributes from form configuration.
3
+ *
4
+ * @param {Object} security - The security configuration.
5
+ * @returns {Array} - Returns a tuple with sandbox and allow attributes.
6
+ */
7
+ export function useSecurityAttributesMap(security: any): any[];
@@ -1 +1 @@
1
- export default function useService(type: any, strict: any): any;
1
+ export function useService(type: any, strict: any): any;
@@ -10,7 +10,7 @@
10
10
  * @param {Function} [options.buildDebugString]
11
11
  *
12
12
  */
13
- export default function useSingleLineTemplateEvaluation(value: string, options?: {
13
+ export function useSingleLineTemplateEvaluation(value: string, options?: {
14
14
  debug?: boolean;
15
15
  strict?: boolean;
16
16
  buildDebugString?: Function;
@@ -6,11 +6,13 @@
6
6
  * @param {Object} options
7
7
  * @param {boolean} [options.debug = false]
8
8
  * @param {boolean} [options.strict = false]
9
+ * @param {Function} [options.sanitizer]
9
10
  * @param {Function} [options.buildDebugString]
10
11
  *
11
12
  */
12
- export default function useTemplateEvaluation(value: string, options?: {
13
+ export function useTemplateEvaluation(value: string, options?: {
13
14
  debug?: boolean;
14
15
  strict?: boolean;
16
+ sanitizer?: Function;
15
17
  buildDebugString?: Function;
16
18
  }): any;
@@ -1,12 +1,11 @@
1
1
  export { FormFields };
2
2
  export * from "./components";
3
3
  export * from "./context";
4
- declare namespace _default {
4
+ export namespace RenderModule {
5
5
  let __init__: string[];
6
6
  let formFields: (string | typeof FormFields)[];
7
7
  let renderer: (string | typeof Renderer)[];
8
8
  }
9
- export default _default;
10
- import FormFields from './FormFields';
11
- import Renderer from './Renderer';
9
+ import { FormFields } from './FormFields';
10
+ import { Renderer } from './Renderer';
12
11
  export { useExpressionEvaluation, useSingleLineTemplateEvaluation, useTemplateEvaluation } from "./hooks";
@@ -0,0 +1,8 @@
1
+ export const SANDBOX_ATTRIBUTE: "sandbox";
2
+ export const ALLOW_ATTRIBUTE: "allow";
3
+ export const SECURITY_ATTRIBUTES_DEFINITIONS: {
4
+ attribute: string;
5
+ directive: string;
6
+ property: string;
7
+ label: string;
8
+ }[];
@@ -1,2 +1,3 @@
1
1
  export * from "./DatetimeConstants";
2
2
  export * from "./OptionsSourceConstants";
3
+ export * from "./IFrameConstants";
@@ -1 +1 @@
1
- export function getAncestryList(formFieldId: string, formFieldRegistry: import('../core/FormFieldRegistry').default): Array<string>;
1
+ export function getAncestryList(formFieldId: string, formFieldRegistry: import('../core/FormFieldRegistry').FormFieldRegistry): Array<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/form-js-viewer",
3
- "version": "1.6.4",
3
+ "version": "1.7.0",
4
4
  "description": "View forms - powered by bpmn.io",
5
5
  "exports": {
6
6
  ".": {
@@ -48,14 +48,14 @@
48
48
  "big.js": "^6.2.1",
49
49
  "classnames": "^2.3.1",
50
50
  "didi": "^10.0.1",
51
- "feelers": "^1.2.0",
51
+ "dompurify": "^3.0.8",
52
+ "feelers": "^1.3.0",
52
53
  "feelin": "^3.0.0",
53
54
  "flatpickr": "^4.6.13",
54
55
  "ids": "^1.0.0",
55
56
  "lodash": "^4.5.0",
56
- "min-dash": "^4.0.0",
57
+ "min-dash": "^4.2.1",
57
58
  "preact": "^10.5.14",
58
- "preact-markup": "^2.1.1",
59
59
  "showdown": "^2.1.0"
60
60
  },
61
61
  "sideEffects": [
@@ -64,5 +64,5 @@
64
64
  "files": [
65
65
  "dist"
66
66
  ],
67
- "gitHead": "81778692a8965f1bc6aadb3ff6a94df4202099e8"
67
+ "gitHead": "8e289cb810b1fe7bea10b625263a67d9502d47bc"
68
68
  }
@@ -1 +0,0 @@
1
- export default function _default(props: any): void;