@optiaxiom/proteus 0.2.5 → 0.2.7

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 (23) hide show
  1. package/dist/esm/assets/src/proteus-chart/{ProteusChart.css.ts.vanilla-DnNIn_rc.css → ProteusChart.css.ts.vanilla-BO0-TwP_.css} +2 -2
  2. package/dist/esm/assets/src/proteus-chart/{ProteusChartTooltipContent.css.ts.vanilla-DoWJUTMo.css → ProteusChartTooltipContent.css.ts.vanilla-ETMXhILd.css} +2 -2
  3. package/dist/esm/assets/src/proteus-document/{ProteusDocumentShell.css.ts.vanilla-DcaxxIIv.css → ProteusDocumentShell.css.ts.vanilla-CDxANCyw.css} +2 -2
  4. package/dist/esm/assets/src/proteus-image-carousel/{ProteusImageCarousel.css.ts.vanilla-DasQYQWd.css → ProteusImageCarousel.css.ts.vanilla-CVLALefb.css} +2 -2
  5. package/dist/esm/assets/src/proteus-question/{ProteusQuestion.css.ts.vanilla-DyMq_aV3.css → ProteusQuestion.css.ts.vanilla-DKDk8HIF.css} +2 -2
  6. package/dist/esm/hooks/useObserveValue.js +33 -0
  7. package/dist/esm/index.js +1 -0
  8. package/dist/esm/proteus-chart/ProteusChart-css.js +1 -1
  9. package/dist/esm/proteus-chart/ProteusChart.js +1 -1
  10. package/dist/esm/proteus-chart/ProteusChartTooltipContent-css.js +1 -1
  11. package/dist/esm/proteus-data-table/ProteusDataTable.js +1 -1
  12. package/dist/esm/proteus-document/ProteusDocumentShell-css.js +1 -1
  13. package/dist/esm/proteus-document/ProteusDocumentShell.js +2 -0
  14. package/dist/esm/proteus-document/resolveProteusValue.js +18 -6
  15. package/dist/esm/proteus-element/ProteusElement.js +3 -0
  16. package/dist/esm/proteus-file-upload/ProteusFileUpload.js +94 -0
  17. package/dist/esm/proteus-image-carousel/ProteusImageCarousel-css.js +1 -1
  18. package/dist/esm/proteus-question/ProteusQuestion-css.js +1 -1
  19. package/dist/esm/schema/public-schema.json.js +104 -1
  20. package/dist/esm/schema/runtime-schema.json.js +101 -1
  21. package/dist/index.d.ts +45 -8
  22. package/dist/spec.d.ts +865 -747
  23. package/package.json +4 -3
@@ -1,5 +1,5 @@
1
- @layer optiaxiom._1l0xsvj;
2
- @layer optiaxiom._1l0xsvj {
1
+ @layer optiaxiom._1fgw1dd;
2
+ @layer optiaxiom._1fgw1dd {
3
3
  .ProteusChart__jmlqij1 {
4
4
  border-radius: 16px;
5
5
  }
@@ -1,5 +1,5 @@
1
- @layer optiaxiom._1l0xsvj;
2
- @layer optiaxiom._1l0xsvj {
1
+ @layer optiaxiom._1fgw1dd;
2
+ @layer optiaxiom._1fgw1dd {
3
3
  .ProteusChartTooltipContent__1gsvq810 {
4
4
  min-width: 128px;
5
5
  position: absolute;
@@ -1,5 +1,5 @@
1
- @layer optiaxiom._1l0xsvj;
2
- @layer optiaxiom._1l0xsvj {
1
+ @layer optiaxiom._1fgw1dd;
2
+ @layer optiaxiom._1fgw1dd {
3
3
  .ProteusDocumentShell__vpuvfj1 {
4
4
  margin: -4px;
5
5
  }
@@ -1,5 +1,5 @@
1
- @layer optiaxiom._1l0xsvj;
2
- @layer optiaxiom._1l0xsvj {
1
+ @layer optiaxiom._1fgw1dd;
2
+ @layer optiaxiom._1fgw1dd {
3
3
  .ProteusImageCarousel__1t6qej70 {
4
4
  outline: none;
5
5
  user-select: none;
@@ -1,5 +1,5 @@
1
- @layer optiaxiom._1l0xsvj;
2
- @layer optiaxiom._1l0xsvj {
1
+ @layer optiaxiom._1fgw1dd;
2
+ @layer optiaxiom._1fgw1dd {
3
3
  .ProteusQuestion__8f590p0 {
4
4
  outline: none;
5
5
  }
@@ -0,0 +1,33 @@
1
+ import { useEffect } from 'react';
2
+
3
+ const useObserveValue = (inputRef, setValue) => {
4
+ useEffect(() => {
5
+ const input = inputRef.current;
6
+ if (!input) {
7
+ return;
8
+ }
9
+ const descriptor = Object.getOwnPropertyDescriptor(
10
+ input.constructor.prototype,
11
+ "value"
12
+ );
13
+ Object.defineProperty(input, "value", {
14
+ configurable: true,
15
+ enumerable: true,
16
+ get: function() {
17
+ return descriptor?.get?.call(input);
18
+ },
19
+ set: function(value) {
20
+ descriptor?.set?.call(input, value);
21
+ }
22
+ });
23
+ }, [inputRef, setValue]);
24
+ return (value) => {
25
+ if (!inputRef.current) {
26
+ return;
27
+ }
28
+ inputRef.current.value = value;
29
+ inputRef.current.dispatchEvent(new Event("change", { bubbles: true }));
30
+ };
31
+ };
32
+
33
+ export { useObserveValue };
package/dist/esm/index.js CHANGED
@@ -5,6 +5,7 @@ export { ProteusDataTable } from './proteus-data-table/ProteusDataTable.js';
5
5
  export { ProteusDocumentRenderer } from './proteus-document/ProteusDocumentRenderer.js';
6
6
  export { ProteusDocumentShell } from './proteus-document/ProteusDocumentShell.js';
7
7
  export { safeParseDocument } from './proteus-document/schemas.js';
8
+ export { ProteusFileUpload } from './proteus-file-upload/ProteusFileUpload.js';
8
9
  export { ProteusImage } from './proteus-image/ProteusImage.js';
9
10
  export { ProteusImageCarousel } from './proteus-image-carousel/ProteusImageCarousel.js';
10
11
  export { ProteusInput } from './proteus-input/ProteusInput.js';
@@ -1,4 +1,4 @@
1
- import './../assets/src/proteus-chart/ProteusChart.css.ts.vanilla-DnNIn_rc.css';
1
+ import './../assets/src/proteus-chart/ProteusChart.css.ts.vanilla-BO0-TwP_.css';
2
2
  import { recipe } from '@optiaxiom/react/css-runtime';
3
3
 
4
4
  var chart = recipe({base:[{border:'1',borderColor:'border.tertiary',fontSize:'sm',p:'16'},'ProteusChart__jmlqij1','ProteusChart__jmlqij0']});
@@ -69,7 +69,7 @@ const ProteusChart = ({
69
69
  portal: document.body
70
70
  }
71
71
  ),
72
- series.map((s, i) => /* @__PURE__ */ jsx(
72
+ series?.map((s, i) => /* @__PURE__ */ jsx(
73
73
  Chart,
74
74
  {
75
75
  dataKey: (row) => get(row, "/" + s.dataKey),
@@ -1,4 +1,4 @@
1
- import './../assets/src/proteus-chart/ProteusChartTooltipContent.css.ts.vanilla-DoWJUTMo.css';
1
+ import './../assets/src/proteus-chart/ProteusChartTooltipContent.css.ts.vanilla-ETMXhILd.css';
2
2
  import { recipe } from '@optiaxiom/react/css-runtime';
3
3
 
4
4
  var tooltip = recipe({base:[{bg:'bg.default',border:'1',borderColor:'border.secondary',display:'grid',fontSize:'sm',gap:'6',pointerEvents:'none',px:'8',py:'10',rounded:'lg',shadow:'lg',transition:'all',z:'popover'},'ProteusChartTooltipContent__1gsvq810']});
@@ -8,7 +8,7 @@ import { applyFormatter } from '../proteus-document/getProteusValue.js';
8
8
  const ProteusDataTable = ({ columns, data }) => {
9
9
  const tableData = data;
10
10
  const columnHelper = createColumnHelper();
11
- const columnDefs = columns.map((col) => {
11
+ const columnDefs = (columns || []).map((col) => {
12
12
  return columnHelper.accessor(
13
13
  (row) => {
14
14
  const value = get(row, "/" + col.accessorKey);
@@ -1,4 +1,4 @@
1
- import './../assets/src/proteus-document/ProteusDocumentShell.css.ts.vanilla-DcaxxIIv.css';
1
+ import './../assets/src/proteus-document/ProteusDocumentShell.css.ts.vanilla-CDxANCyw.css';
2
2
  import { recipe } from '@optiaxiom/react/css-runtime';
3
3
 
4
4
  var body = recipe({base:[{flexDirection:'column',gap:'16'},'ProteusDocumentShell__vpuvfj0'],variants:{truncate:{false:{},true:[{maxH:'sm',overflow:'auto',p:'4'},'ProteusDocumentShell__vpuvfj1']}}});
@@ -21,6 +21,7 @@ function ProteusDocumentShell({
21
21
  onMessage,
22
22
  onOpenChange,
23
23
  onTrack,
24
+ onUpload,
24
25
  open: openProp,
25
26
  readOnly = false,
26
27
  strict,
@@ -101,6 +102,7 @@ function ProteusDocumentShell({
101
102
  onTrack?.(event, properties);
102
103
  }
103
104
  ),
105
+ onUpload,
104
106
  readOnly,
105
107
  strict,
106
108
  useResource,
@@ -88,11 +88,13 @@ function resolveProteusValue(value, data, parentPath, mapIndices = []) {
88
88
  }
89
89
  const resolvedPath = value.path.startsWith("/") ? value.path : `${parentPath}/${value.path}`;
90
90
  const items = array.map(
91
- (_, index) => resolveProteusValue(value.children, data, `${resolvedPath}/${index}`, [
92
- ...mapIndices,
93
- index
94
- ])
95
- );
91
+ (_, index) => resolveProteusValue(
92
+ value.children,
93
+ data,
94
+ `${resolvedPath}/${index}`,
95
+ [...mapIndices, index]
96
+ )
97
+ ).filter((v) => v !== void 0);
96
98
  if ("separator" in value) {
97
99
  const sep = resolveProteusValue(
98
100
  value.separator,
@@ -122,8 +124,18 @@ function resolveProteusValue(value, data, parentPath, mapIndices = []) {
122
124
  (child) => resolveProteusValue(child, data, parentPath, mapIndices)
123
125
  ).filter((v) => v !== void 0).join("");
124
126
  }
127
+ return value;
128
+ }
129
+ if (Array.isArray(value)) {
130
+ return value.map((v) => resolveProteusValue(v, data, parentPath, mapIndices)).filter((v) => v !== void 0);
131
+ }
132
+ const resolved = {};
133
+ for (const [k, v] of Object.entries(value)) {
134
+ const r = resolveProteusValue(v, data, parentPath, mapIndices);
135
+ if (r !== void 0)
136
+ resolved[k] = r;
125
137
  }
126
- return value;
138
+ return resolved;
127
139
  }
128
140
 
129
141
  export { evaluateCondition, resolveProteusValue };
@@ -11,6 +11,7 @@ import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentCo
11
11
  import { useProteusDocumentPathContext } from '../proteus-document/ProteusDocumentPathContext.js';
12
12
  import { resolveProteusProp } from '../proteus-document/resolveProteusProp.js';
13
13
  import { safeParseElement } from '../proteus-document/schemas.js';
14
+ import { ProteusFileUpload } from '../proteus-file-upload/ProteusFileUpload.js';
14
15
  import { ProteusImageCarousel } from '../proteus-image-carousel/ProteusImageCarousel.js';
15
16
  import { ProteusImage } from '../proteus-image/ProteusImage.js';
16
17
  import { ProteusInput } from '../proteus-input/ProteusInput.js';
@@ -97,6 +98,8 @@ const ProteusElement = ({
97
98
  );
98
99
  case "Field":
99
100
  return /* @__PURE__ */ jsx(Field, { ...resolve(element) });
101
+ case "FileUpload":
102
+ return /* @__PURE__ */ jsx(ProteusFileUpload, { ...resolve(element) });
100
103
  case "Group":
101
104
  return /* @__PURE__ */ jsx(Group, { ...resolve(element) });
102
105
  case "Heading":
@@ -0,0 +1,94 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { Flex } from '@optiaxiom/react';
4
+ import { FileUpload, VisuallyHidden, FileUploadList, FileUploadDropzone, FileUploadTrigger } from '@optiaxiom/react/unstable';
5
+ import { useRef, useState, useCallback } from 'react';
6
+ import { useObserveValue } from '../hooks/useObserveValue.js';
7
+ import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
8
+ import { useProteusDocumentPathContext } from '../proteus-document/ProteusDocumentPathContext.js';
9
+
10
+ function ProteusFileUpload({
11
+ accept,
12
+ name,
13
+ required
14
+ }) {
15
+ const { onDataChange, onUpload, readOnly } = useProteusDocumentContext(
16
+ "@optiaxiom/proteus/ProteusFileUpload"
17
+ );
18
+ const { path: parentPath } = useProteusDocumentPathContext(
19
+ "@optiaxiom/proteus/ProteusFileUpload"
20
+ );
21
+ const inputRef = useRef(null);
22
+ const [item, setItem] = useState(null);
23
+ const forceValueChange = useObserveValue(inputRef);
24
+ const writeUrl = useCallback(
25
+ (url) => {
26
+ if (!name)
27
+ return;
28
+ onDataChange?.(`${parentPath}/${name}`, url);
29
+ },
30
+ [name, onDataChange, parentPath]
31
+ );
32
+ const handleFilesDrop = useCallback(
33
+ async (incoming) => {
34
+ if (!onUpload || readOnly || incoming.length === 0) {
35
+ return;
36
+ }
37
+ const file = incoming[0];
38
+ setItem({ file, status: "uploading" });
39
+ writeUrl(null);
40
+ if (inputRef.current) {
41
+ forceValueChange("");
42
+ }
43
+ try {
44
+ const url = await onUpload(file);
45
+ setItem(
46
+ (curr) => curr?.file === file ? { file, status: "complete" } : curr
47
+ );
48
+ writeUrl(url);
49
+ if (inputRef.current) {
50
+ forceValueChange("1");
51
+ }
52
+ } catch {
53
+ setItem(
54
+ (curr) => curr?.file === file ? { file, status: "error" } : curr
55
+ );
56
+ }
57
+ },
58
+ [forceValueChange, onUpload, readOnly, writeUrl]
59
+ );
60
+ const handleRemove = useCallback(() => {
61
+ setItem(null);
62
+ writeUrl(null);
63
+ if (inputRef.current) {
64
+ forceValueChange("");
65
+ }
66
+ }, [forceValueChange, writeUrl]);
67
+ return /* @__PURE__ */ jsxs(
68
+ FileUpload,
69
+ {
70
+ accept,
71
+ disabled: !onUpload || readOnly,
72
+ onFilesDrop: handleFilesDrop,
73
+ children: [
74
+ /* @__PURE__ */ jsx(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx(
75
+ "input",
76
+ {
77
+ "aria-hidden": true,
78
+ name,
79
+ ref: inputRef,
80
+ required,
81
+ tabIndex: -1
82
+ }
83
+ ) }),
84
+ item ? /* @__PURE__ */ jsxs(Flex, { flexDirection: "column", gap: "8", children: [
85
+ /* @__PURE__ */ jsx(FileUploadList, { items: [item], onRemove: handleRemove }),
86
+ /* @__PURE__ */ jsx(FileUploadDropzone, { overlay: true })
87
+ ] }) : /* @__PURE__ */ jsx(FileUploadDropzone, { children: /* @__PURE__ */ jsx(FileUploadTrigger, {}) })
88
+ ]
89
+ }
90
+ );
91
+ }
92
+ ProteusFileUpload.displayName = "@optiaxiom/proteus/ProteusFileUpload";
93
+
94
+ export { ProteusFileUpload };
@@ -1,4 +1,4 @@
1
- import './../assets/src/proteus-image-carousel/ProteusImageCarousel.css.ts.vanilla-DasQYQWd.css';
1
+ import './../assets/src/proteus-image-carousel/ProteusImageCarousel.css.ts.vanilla-CVLALefb.css';
2
2
  import { recipe } from '@optiaxiom/react/css-runtime';
3
3
 
4
4
  var carousel = recipe({base:[{flexDirection:'column',gap:'12'},'ProteusImageCarousel__1t6qej70']});
@@ -1,4 +1,4 @@
1
- import './../assets/src/proteus-question/ProteusQuestion.css.ts.vanilla-DyMq_aV3.css';
1
+ import './../assets/src/proteus-question/ProteusQuestion.css.ts.vanilla-DKDk8HIF.css';
2
2
  import { recipe } from '@optiaxiom/react/css-runtime';
3
3
 
4
4
  var addon = recipe({base:[{display:'grid',fontWeight:'500',placeItems:'center',rounded:'lg',size:'md',transition:'colors'},'ProteusQuestion__8f590p3'],variants:{cursor:{pointer:{cursor:'pointer'}}}});
@@ -2734,6 +2734,9 @@ var definitions = {
2734
2734
  {
2735
2735
  $ref: "#/definitions/ProteusField"
2736
2736
  },
2737
+ {
2738
+ $ref: "#/definitions/ProteusFileUpload"
2739
+ },
2737
2740
  {
2738
2741
  $ref: "#/definitions/ProteusGroup"
2739
2742
  },
@@ -2833,9 +2836,12 @@ var definitions = {
2833
2836
  },
2834
2837
  {
2835
2838
  type: "string"
2839
+ },
2840
+ {
2841
+ $ref: "#/definitions/ProteusStructuredMessage"
2836
2842
  }
2837
2843
  ],
2838
- description: "Message to send to LLM via sendNewMessage(). Can be a string, a Value reference, or a Map expression."
2844
+ description: "Message to send to LLM via sendNewMessage(). Can be a string, a Value reference, a Map expression, or a structured payload with parts and files."
2839
2845
  }
2840
2846
  },
2841
2847
  required: [
@@ -2932,6 +2938,56 @@ var definitions = {
2932
2938
  ],
2933
2939
  description: "A Proteus node can be a string, number, boolean, null, a single element, or an array of these types (similar to ReactNode)"
2934
2940
  },
2941
+ ProteusStructuredMessage: {
2942
+ additionalProperties: false,
2943
+ description: "Structured message payload that lets file URLs travel as a typed list alongside the text parts, instead of being joined into the text.",
2944
+ properties: {
2945
+ files: {
2946
+ anyOf: [
2947
+ {
2948
+ items: {
2949
+ type: "string"
2950
+ },
2951
+ type: "array"
2952
+ },
2953
+ {
2954
+ $ref: "#/definitions/ProteusExpression"
2955
+ }
2956
+ ],
2957
+ description: "List of file URLs (typically signed URLs from a host upload)."
2958
+ },
2959
+ parts: {
2960
+ items: {
2961
+ additionalProperties: false,
2962
+ properties: {
2963
+ content: {
2964
+ anyOf: [
2965
+ {
2966
+ type: "string"
2967
+ },
2968
+ {
2969
+ $ref: "#/definitions/ProteusExpression"
2970
+ }
2971
+ ]
2972
+ },
2973
+ type: {
2974
+ "const": "text"
2975
+ }
2976
+ },
2977
+ required: [
2978
+ "type",
2979
+ "content"
2980
+ ],
2981
+ type: "object"
2982
+ },
2983
+ type: "array"
2984
+ }
2985
+ },
2986
+ required: [
2987
+ "parts"
2988
+ ],
2989
+ type: "object"
2990
+ },
2935
2991
  ProteusZip: {
2936
2992
  additionalProperties: false,
2937
2993
  description: "Zips multiple parallel arrays into an array of objects. Each key in 'sources' becomes a property in the resulting row objects.",
@@ -5087,6 +5143,53 @@ var definitions = {
5087
5143
  ],
5088
5144
  type: "object"
5089
5145
  },
5146
+ ProteusFileUpload: {
5147
+ additionalProperties: false,
5148
+ examples: [
5149
+ {
5150
+ $type: "FileUpload",
5151
+ name: "value"
5152
+ }
5153
+ ],
5154
+ properties: {
5155
+ $type: {
5156
+ "const": "FileUpload"
5157
+ },
5158
+ accept: {
5159
+ description: "File types to accept; array of MIME types or extensions.",
5160
+ items: {
5161
+ type: "string"
5162
+ },
5163
+ type: "array"
5164
+ },
5165
+ name: {
5166
+ anyOf: [
5167
+ {
5168
+ type: "string"
5169
+ },
5170
+ {
5171
+ $ref: "#/definitions/ProteusExpression"
5172
+ }
5173
+ ],
5174
+ description: "The name of the form control element. The resolved URL is written at parentPath/name in form data."
5175
+ },
5176
+ required: {
5177
+ anyOf: [
5178
+ {
5179
+ type: "boolean"
5180
+ },
5181
+ {
5182
+ $ref: "#/definitions/ProteusExpression"
5183
+ }
5184
+ ],
5185
+ description: "Whether a file is required."
5186
+ }
5187
+ },
5188
+ required: [
5189
+ "$type"
5190
+ ],
5191
+ type: "object"
5192
+ },
5090
5193
  ProteusGroup: {
5091
5194
  additionalProperties: false,
5092
5195
  examples: [
@@ -2722,6 +2722,9 @@ var definitions = {
2722
2722
  {
2723
2723
  $ref: "#/definitions/ProteusField"
2724
2724
  },
2725
+ {
2726
+ $ref: "#/definitions/ProteusFileUpload"
2727
+ },
2725
2728
  {
2726
2729
  $ref: "#/definitions/ProteusGroup"
2727
2730
  },
@@ -2819,9 +2822,12 @@ var definitions = {
2819
2822
  },
2820
2823
  {
2821
2824
  type: "string"
2825
+ },
2826
+ {
2827
+ $ref: "#/definitions/ProteusStructuredMessage"
2822
2828
  }
2823
2829
  ],
2824
- description: "Message to send to LLM via sendNewMessage(). Can be a string, a Value reference, or a Map expression."
2830
+ description: "Message to send to LLM via sendNewMessage(). Can be a string, a Value reference, a Map expression, or a structured payload with parts and files."
2825
2831
  }
2826
2832
  },
2827
2833
  required: [
@@ -2917,6 +2923,54 @@ var definitions = {
2917
2923
  ],
2918
2924
  description: "A Proteus node can be a string, number, boolean, null, a single element, or an array of these types (similar to ReactNode)"
2919
2925
  },
2926
+ ProteusStructuredMessage: {
2927
+ description: "Structured message payload that lets file URLs travel as a typed list alongside the text parts, instead of being joined into the text.",
2928
+ properties: {
2929
+ files: {
2930
+ anyOf: [
2931
+ {
2932
+ items: {
2933
+ type: "string"
2934
+ },
2935
+ type: "array"
2936
+ },
2937
+ {
2938
+ $ref: "#/definitions/ProteusExpression"
2939
+ }
2940
+ ],
2941
+ description: "List of file URLs (typically signed URLs from a host upload)."
2942
+ },
2943
+ parts: {
2944
+ items: {
2945
+ properties: {
2946
+ content: {
2947
+ anyOf: [
2948
+ {
2949
+ type: "string"
2950
+ },
2951
+ {
2952
+ $ref: "#/definitions/ProteusExpression"
2953
+ }
2954
+ ]
2955
+ },
2956
+ type: {
2957
+ "const": "text"
2958
+ }
2959
+ },
2960
+ required: [
2961
+ "type",
2962
+ "content"
2963
+ ],
2964
+ type: "object"
2965
+ },
2966
+ type: "array"
2967
+ }
2968
+ },
2969
+ required: [
2970
+ "parts"
2971
+ ],
2972
+ type: "object"
2973
+ },
2920
2974
  ProteusZip: {
2921
2975
  description: "Zips multiple parallel arrays into an array of objects. Each key in 'sources' becomes a property in the resulting row objects.",
2922
2976
  examples: [
@@ -5056,6 +5110,52 @@ var definitions = {
5056
5110
  ],
5057
5111
  type: "object"
5058
5112
  },
5113
+ ProteusFileUpload: {
5114
+ examples: [
5115
+ {
5116
+ $type: "FileUpload",
5117
+ name: "value"
5118
+ }
5119
+ ],
5120
+ properties: {
5121
+ $type: {
5122
+ "const": "FileUpload"
5123
+ },
5124
+ accept: {
5125
+ description: "File types to accept; array of MIME types or extensions.",
5126
+ items: {
5127
+ type: "string"
5128
+ },
5129
+ type: "array"
5130
+ },
5131
+ name: {
5132
+ anyOf: [
5133
+ {
5134
+ type: "string"
5135
+ },
5136
+ {
5137
+ $ref: "#/definitions/ProteusExpression"
5138
+ }
5139
+ ],
5140
+ description: "The name of the form control element. The resolved URL is written at parentPath/name in form data."
5141
+ },
5142
+ required: {
5143
+ anyOf: [
5144
+ {
5145
+ type: "boolean"
5146
+ },
5147
+ {
5148
+ $ref: "#/definitions/ProteusExpression"
5149
+ }
5150
+ ],
5151
+ description: "Whether a file is required."
5152
+ }
5153
+ },
5154
+ required: [
5155
+ "$type"
5156
+ ],
5157
+ type: "object"
5158
+ },
5059
5159
  ProteusGroup: {
5060
5160
  examples: [
5061
5161
  {