@osdk/react-components 0.21.1-main-d0845dd9e4d107ea7509f700e3366b4bf7d1576e → 0.22.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 (61) hide show
  1. package/CHANGELOG.md +10 -9
  2. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  3. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js +1 -0
  4. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
  5. package/build/browser/util/UserAgent.js +1 -1
  6. package/build/browser/util/UserAgent.js.map +1 -1
  7. package/build/cjs/{chunk-N4O7OZCM.cjs → chunk-5OTHYCAN.cjs} +5 -4
  8. package/build/cjs/chunk-5OTHYCAN.cjs.map +1 -0
  9. package/build/cjs/{chunk-2IMFSZMF.cjs → chunk-6JJVLART.cjs} +4 -4
  10. package/build/cjs/{chunk-2IMFSZMF.cjs.map → chunk-6JJVLART.cjs.map} +1 -1
  11. package/build/cjs/chunk-A3TEU5AA.cjs +11 -0
  12. package/build/cjs/{chunk-N3FIKGMN.cjs.map → chunk-A3TEU5AA.cjs.map} +1 -1
  13. package/build/cjs/chunk-AJQTGMS6.cjs +11 -0
  14. package/build/cjs/{chunk-IP6FXZSP.cjs.map → chunk-AJQTGMS6.cjs.map} +1 -1
  15. package/build/cjs/{chunk-XMZJJRNP.cjs → chunk-B6AIDSEZ.cjs} +4 -4
  16. package/build/cjs/{chunk-XMZJJRNP.cjs.map → chunk-B6AIDSEZ.cjs.map} +1 -1
  17. package/build/cjs/{chunk-P6NELDSR.cjs → chunk-O3L7F3SI.cjs} +3 -3
  18. package/build/cjs/chunk-O3L7F3SI.cjs.map +1 -0
  19. package/build/cjs/chunk-QWVW5PEX.cjs +11 -0
  20. package/build/cjs/{chunk-5GMWXEC3.cjs.map → chunk-QWVW5PEX.cjs.map} +1 -1
  21. package/build/cjs/chunk-RVEV2776.cjs +11 -0
  22. package/build/cjs/{chunk-DYIFCP5P.cjs.map → chunk-RVEV2776.cjs.map} +1 -1
  23. package/build/cjs/chunk-SBENFO5U.cjs +11 -0
  24. package/build/cjs/{chunk-4KUMHNMZ.cjs.map → chunk-SBENFO5U.cjs.map} +1 -1
  25. package/build/cjs/{chunk-FAN2UBZ4.cjs → chunk-V3TF4PWW.cjs} +4 -4
  26. package/build/cjs/{chunk-FAN2UBZ4.cjs.map → chunk-V3TF4PWW.cjs.map} +1 -1
  27. package/build/cjs/{chunk-ISAAJAOX.cjs → chunk-WWOD2EMG.cjs} +4 -4
  28. package/build/cjs/{chunk-ISAAJAOX.cjs.map → chunk-WWOD2EMG.cjs.map} +1 -1
  29. package/build/cjs/{chunk-O5FG6IEL.cjs → chunk-XUVWBVTL.cjs} +4 -4
  30. package/build/cjs/{chunk-O5FG6IEL.cjs.map → chunk-XUVWBVTL.cjs.map} +1 -1
  31. package/build/cjs/{chunk-QKZ4PT7F.cjs → chunk-XZI3NYBD.cjs} +4 -4
  32. package/build/cjs/{chunk-QKZ4PT7F.cjs.map → chunk-XZI3NYBD.cjs.map} +1 -1
  33. package/build/cjs/public/experimental/action-form.cjs +4 -4
  34. package/build/cjs/public/experimental/action-form.d.cts +1 -1
  35. package/build/cjs/public/experimental/document-viewer.cjs +4 -4
  36. package/build/cjs/public/experimental/email-viewer.cjs +3 -3
  37. package/build/cjs/public/experimental/excel-viewer.cjs +3 -3
  38. package/build/cjs/public/experimental/filter-list.cjs +14 -14
  39. package/build/cjs/public/experimental/image-viewer.cjs +3 -3
  40. package/build/cjs/public/experimental/markdown-renderer.cjs +3 -3
  41. package/build/cjs/public/experimental/object-table.cjs +8 -8
  42. package/build/cjs/public/experimental/pdf-viewer.cjs +7 -7
  43. package/build/cjs/public/experimental/tiff-renderer.cjs +3 -3
  44. package/build/cjs/public/experimental/video-viewer.cjs +3 -3
  45. package/build/cjs/public/experimental/xml-viewer.cjs +3 -3
  46. package/build/cjs/public/experimental.cjs +47 -47
  47. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  48. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js +1 -0
  49. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
  50. package/build/esm/util/UserAgent.js +1 -1
  51. package/build/esm/util/UserAgent.js.map +1 -1
  52. package/build/types/action-form/FormFieldApi.d.ts +1 -1
  53. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  54. package/package.json +8 -8
  55. package/build/cjs/chunk-4KUMHNMZ.cjs +0 -11
  56. package/build/cjs/chunk-5GMWXEC3.cjs +0 -11
  57. package/build/cjs/chunk-DYIFCP5P.cjs +0 -11
  58. package/build/cjs/chunk-IP6FXZSP.cjs +0 -11
  59. package/build/cjs/chunk-N3FIKGMN.cjs +0 -11
  60. package/build/cjs/chunk-N4O7OZCM.cjs.map +0 -1
  61. package/build/cjs/chunk-P6NELDSR.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,17 +1,18 @@
1
1
  # @osdk/react-components
2
2
 
3
- ## 0.21.1-main-d0845dd9e4d107ea7509f700e3366b4bf7d1576e
3
+ ## 0.22.0
4
4
 
5
- ### Patch Changes
5
+ ### Minor Changes
6
6
 
7
7
  - d209762: Reset datetime picker time to the current wall-clock time when clicking Today.
8
- - Updated dependencies [8965bdf]
9
- - Updated dependencies [8965bdf]
10
- - Updated dependencies [643c450]
11
- - Updated dependencies [d0845dd]
12
- - @osdk/client@2.25.0-main-d0845dd9e4d107ea7509f700e3366b4bf7d1576e
13
- - @osdk/react@2.25.0-main-d0845dd9e4d107ea7509f700e3366b4bf7d1576e
14
- - @osdk/api@2.25.0-main-d0845dd9e4d107ea7509f700e3366b4bf7d1576e
8
+ - bd90dba: Add end-to-end support for `scenarioReference` action parameters:
9
+ - `@osdk/api` adds `"scenarioReference"` to `ActionMetadata.DataType.BaseActionParameterTypes` and a matching `scenarioReference: ScenarioClient` entry in `DataValueClientToWire` (structurally typed as `{ getScenarioReference(): { scenarioRid } }` to avoid a circular dep on `@osdk/client`).
10
+ - `@osdk/generator-converters` maps the wire `scenarioReference` variant into the primitive type.
11
+ - Generated SDKs now emit `ActionParam.PrimitiveType<"scenarioReference">` (resolves to `ScenarioClient`) for scenarioReference parameters, instead of throwing at SDK build time.
12
+ - `@osdk/client`'s `toDataValue` accepts a `ScenarioClient` and serializes it to the rid string the platform expects.
13
+ - `@osdk/react-components`'s ActionForm renders scenarioReference parameters as `UNSUPPORTED` for now.
14
+
15
+ Enables `client(ScenarioMerge).applyAction({ scenario })` end-to-end in generated SDKs.
15
16
 
16
17
  ## 0.21.0
17
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldApi.js","names":[],"sources":["FormFieldApi.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n CompileTimeMetadata,\n DataValueClientToWire,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n} from \"@osdk/api\";\nimport type React from \"react\";\n\nimport type {\n DatePickerProps,\n DateRangePickerProps,\n} from \"../shared/calendar/index.js\";\nimport type { PortalContainer } from \"../shared/PortalDismissLayer.js\";\n\nexport type { PortalContainer };\n\n/**\n * A form field definition specifies configuration for a single field.\n * Implemented as a distributed mapped type so `fieldComponent` narrows\n * `fieldComponentProps` to the matching component prop type.\n */\nexport type FormFieldDefinition<\n Q extends ActionDefinition<unknown>,\n K extends FieldKey<Q> = FieldKey<Q>,\n> = K extends unknown ? {\n // Distribute over each field key so a field's key, value type, and allowed\n // components stay correlated when K is the default union of all keys.\n [C in ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]: {\n /**\n * The field's unique key\n */\n fieldKey: K;\n\n /**\n * Display label for the field\n */\n label: string;\n\n /**\n * Default value of the field\n */\n defaultValue?: FieldValueType<Q, K>;\n\n /**\n * Whether the field is required\n */\n isRequired?: boolean;\n\n /**\n * Placeholder text\n */\n placeholder?: string;\n\n /**\n * Additional information to display on this field.\n * Accepts plain text or rich content (e.g. JSX with links or formatting).\n * Rendered as a tooltip icon next to the label by default, or below the\n * label when helperTextPlacement is \"bottom\".\n */\n helperText?: React.ReactNode;\n\n /**\n * The placement of the helper text either below the field or in a tooltip\n *\n * @default \"tooltip\"\n */\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n\n /**\n * A callback to customize error messages when a built-in validation rule fails.\n * Receives a discriminated union with the constraint data (e.g., the min value\n * that was exceeded) so the message can reference the threshold.\n *\n * Return a string to override the default message, or `undefined` to keep it.\n */\n onValidationError?: (error: ValidationError) => string | undefined;\n\n /**\n * Additional function to validate the field.\n *\n * Return `undefined` if valid, or an error message string if invalid.\n */\n validate?: (\n value: FieldValueType<Q, K>,\n ) => Promise<string | undefined>;\n\n /**\n * The form field component type to render\n */\n fieldComponent: C;\n\n /**\n * The component props for the form field.\n * Excludes runtime props (value, onChange) which are managed by ActionForm.\n */\n fieldComponentProps: DistributiveOmit<\n FormFieldPropsByType[C],\n FormManagedProps<C>\n >;\n };\n }[ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]\n : never;\n\n/**\n * A discriminated union describing which validation rule failed and the\n * constraint data the user needs to build a meaningful error message.\n */\nexport type ValidationError =\n | { type: \"required\" }\n | { type: \"min\"; min: number | Date }\n | { type: \"max\"; max: number | Date }\n | { type: \"minLength\"; minLength: number }\n | { type: \"maxLength\"; maxLength: number }\n | { type: \"maxSize\"; maxSize: number }\n | { type: \"validate\"; message: string };\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATE_RANGE_INPUT: DateRangePickerProps;\n DATETIME_PICKER: DatePickerProps;\n DROPDOWN: DropdownFieldProps<unknown, boolean>;\n FILE_PICKER: FilePickerProps;\n NUMBER_INPUT: NumberInputFieldProps;\n OBJECT_SELECT: ObjectSelectFieldProps<ObjectTypeDefinition>;\n OBJECT_SET: ObjectSetFieldProps<ObjectTypeDefinition>;\n RADIO_BUTTONS: RadioButtonsFieldProps<unknown>;\n SWITCH: SwitchFieldProps;\n TEXT_AREA: TextAreaFieldProps;\n TEXT_INPUT: TextInputFieldProps;\n CUSTOM: CustomFieldProps<unknown>;\n UNSUPPORTED: UnsupportedFieldProps;\n}\n\n/**\n * Dropdown field props with selectable items\n */\nexport interface DropdownFieldProps<V, Multiple extends boolean = false>\n extends BaseFormFieldProps<Multiple extends true ? V[] : V>\n{\n /**\n * Available items for the dropdown\n */\n items: V[];\n\n /**\n * Converts an item to searchable text and the default visual label. Defaults to `String()`.\n * Use `renderItemLabel` when the visible label needs rich React content.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Renders an item label with custom React content.\n * `itemToStringLabel` is still used for search, accessibility, and fallback keys.\n */\n renderItemLabel?: (item: V) => React.ReactNode;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected\n */\n isMultiple?: Multiple;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n\n /**\n * Element that receives the dropdown portal. Use this when rendering inside\n * modal dialogs so popups stay in the dialog's stacking and focus context\n * instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n\n /**\n * Controlled search input value. Must be provided together with `onQueryChange`.\n */\n query?: string;\n\n /**\n * Callback when the search input value changes.\n * Can be used standalone as an event listener or together with `query`\n * for fully controlled search state.\n */\n onQueryChange?: (query: string) => void;\n\n /**\n * When true, disables the combobox's built-in client-side filtering.\n * Use when items are already filtered server-side (e.g. via `onQueryChange`).\n *\n * @default false\n */\n disableClientSideFiltering?: boolean;\n\n /**\n * Status message rendered below the search input and above the item list\n * inside the popup. Use for loading/error/empty messages.\n */\n popupStatus?: React.ReactNode;\n\n /**\n * A React node to render after the item list.\n * Use for infinite scroll sentinels, \"load more\" buttons, etc.\n */\n trailingItem?: React.ReactNode;\n\n /**\n * Whether the dropdown locks page scroll and renders a full-viewport\n * dismiss layer when open. Set to `false` when the dropdown is not\n * inside a `<label>` to allow normal page scrolling.\n *\n * @default true\n */\n modal?: boolean;\n}\n\nexport interface FilePickerProps extends BaseFormFieldProps<File | File[]> {\n /**\n * Whether multiple files can be selected\n */\n isMulti?: boolean;\n\n /**\n * Accepted file types (e.g., \"image/*\", \".pdf\")\n */\n accept?: string | string[];\n\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n\n /**\n * The text displayed when no file is selected.\n *\n * @default \"No file chosen\"\n */\n text?: string;\n\n /**\n * The text displayed on the browse button.\n *\n * @default \"Browse\"\n */\n buttonText?: string;\n}\n\n/**\n * Text area field props\n */\nexport interface TextAreaFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | \"rows\"\n | \"wrap\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\nexport interface TextInputFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\n/**\n * Number input field props\n */\nexport interface NumberInputFieldProps extends BaseFormFieldProps<number> {\n /**\n * Minimum allowed value.\n */\n min?: number;\n\n /**\n * Maximum allowed value.\n */\n max?: number;\n\n /**\n * Step increment for the input. Used by the stepper buttons and ArrowUp/ArrowDown keyboard stepping.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Placeholder text shown when the input is empty.\n */\n placeholder?: string;\n}\n\n/**\n * Radio buttons field props\n */\nexport interface RadioButtonsFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Available options for radio buttons.\n *\n * Values are compared by reference equality (`===`). When options contain\n * non-primitive values, pass the same object references for `value` and\n * the corresponding option entry.\n */\n options: Option<V>[];\n\n /**\n * Controls the layout direction of the radio buttons.\n *\n * - `\"vertical\"` (default): options are stacked in a column\n * - `\"horizontal\"`: options are laid out in a row, wrapping when needed\n */\n orientation?: \"horizontal\" | \"vertical\";\n}\n\n/**\n * Switch field props for boolean values.\n */\nexport type SwitchFieldProps = BaseFormFieldProps<boolean>;\n\n/**\n * Option interface for radio button options\n */\nexport interface Option<V> {\n label: string;\n value: V;\n}\n\n/**\n * Object set field displays the summary of the count of the given object set\n */\nexport interface ObjectSetFieldProps<T extends ObjectTypeDefinition>\n extends Pick<BaseFormFieldProps<ObjectSet<T>>, \"id\" | \"value\" | \"disabled\">\n{\n /**\n * Message displayed when no object set is provided.\n *\n * @default \"Object set is not defined\"\n */\n emptyMessage?: string;\n}\n\ntype ObjectSelectDataSource<Q extends ObjectTypeDefinition> =\n | {\n /**\n * The object type definition to search across.\n */\n objectType: Q;\n objectSet?: never;\n }\n | {\n /**\n * A pre-scoped object set to search within.\n *\n * Use this when selectable options should be limited to a subset of\n * objects. User-entered search text is applied within this set.\n */\n objectSet: ObjectSet<Q>;\n objectType?: never;\n };\n\n/**\n * Object select field props for selecting object instances from the ontology.\n * Used for action parameters that accept a single object or multiple objects.\n *\n * Extends DropdownFieldProps with props that ObjectSelectField\n * manages internally (items, search, filtering) omitted from the public surface.\n */\nexport type ObjectSelectFieldProps<\n Q extends ObjectTypeDefinition = ObjectTypeDefinition,\n> =\n & Omit<\n DropdownFieldProps<Osdk.Instance<Q>>,\n | \"items\"\n | \"itemToStringLabel\"\n | \"itemToKey\"\n | \"isItemEqual\"\n | \"isSearchable\"\n | \"query\"\n | \"onQueryChange\"\n | \"disableClientSideFiltering\"\n | \"renderItemList\"\n >\n & ObjectSelectDataSource<Q>;\n\n/**\n * Custom field props for user-defined renderers\n */\nexport interface CustomFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Custom renderer function\n */\n customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;\n}\n\nexport interface UnsupportedFieldProps\n extends Pick<BaseFormFieldProps<string>, \"id\" | \"error\">\n{}\n\nexport interface BaseFormFieldProps<V> {\n /**\n * The HTML `id` attribute for the field input element.\n * Used for `<label htmlFor>` association.\n */\n id?: string;\n\n /**\n * The validation error message for this field, if any.\n * When set, the field should display a visual error state.\n */\n error?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n\n /**\n * The default value of the form field.\n */\n defaultValue?: V;\n\n /**\n * Whether the field is disabled.\n *\n * Disabled fields keep their current value in form state and submit payloads,\n * but built-in renderers block user edits and remove disabled controls from\n * keyboard navigation.\n */\n disabled?: boolean;\n\n /**\n * Called when the field value changes.\n *\n * ActionForm internally wraps this to pass the key to `onFieldValueChange`:\n * ```\n * <DropdownField\n * {...fieldDef}\n * onChange={(value) => onFieldValueChange(fieldDef.key, value)}\n * />\n * ```\n *\n * @param value The new value of the form field\n */\n onChange?: (value: V | null) => void;\n}\n\nexport type FieldKey<Q extends ActionDefinition<unknown>> =\n keyof ActionParameters<Q>;\n\n/**\n * Extracts parameters from an ActionDefinition\n */\nexport type ActionParameters<Q extends ActionDefinition<unknown>> =\n CompileTimeMetadata<Q>[\"parameters\"];\n\n/**\n * Extracts the value type for a specific parameter\n */\nexport type FieldValueType<\n Q extends ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"] extends\n ActionMetadata.DataType.Object<infer T> ? ActionParam.ObjectType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.ObjectSet<\n infer T\n > ? ActionParam.ObjectSetType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Interface<\n infer T\n > ? ActionParam.InterfaceType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Struct<\n infer T\n > ? ActionParam.StructType<T>\n : ActionParameters<Q>[K][\"type\"] extends keyof DataValueClientToWire\n ? DataValueClientToWire[ActionParameters<Q>[K][\"type\"]]\n : never;\n\n/**\n * Extracts the parameter type descriptor for a specific action parameter.\n */\nexport type FieldDescriptorType<\n Q extends ActionDefinition<unknown> = ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"];\n\n/**\n * Available form field component types\n */\nexport type FieldComponent =\n | \"DATE_RANGE_INPUT\"\n | \"DATETIME_PICKER\"\n | \"DROPDOWN\"\n | \"FILE_PICKER\"\n | \"NUMBER_INPUT\"\n | \"OBJECT_SELECT\"\n | \"OBJECT_SET\"\n | \"RADIO_BUTTONS\"\n | \"SWITCH\"\n | \"TEXT_AREA\"\n | \"TEXT_INPUT\"\n | \"CUSTOM\"\n | \"UNSUPPORTED\";\n\n/**\n * Describes the data type of a form field, independent of OSDK.\n * Mirrors ActionMetadata.DataType to keep the rendering layer OSDK-agnostic.\n */\nexport type FieldType =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\"\n | \"geoshape\"\n | \"geohash\"\n | { type: \"object\"; object: string }\n | { type: \"objectSet\"; objectSet: string }\n | { type: \"interface\"; interface: string }\n | { type: \"struct\"; struct: Record<string, string> };\n\n/**\n * Props managed by form state infrastructure (FieldBridge / RHF).\n * Fields with onChange participate in form state → value and onChange are managed\n * externally. Read-only fields (no onChange, e.g. ObjectSetField) keep value in\n * fieldComponentProps so it bypasses form state cloning.\n */\ntype FormManagedProps<K extends FieldComponent> = \"onChange\" extends\n keyof FormFieldPropsByType[K] ? \"value\" | \"onChange\" | \"disabled\"\n : \"onChange\" | \"disabled\";\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<\n T,\n Extract<keyof T, K>\n >\n : never;\n\n/**\n * An OSDK-agnostic field definition used by BaseForm and FormFieldRenderer.\n * Contains only the information needed to render a single field — no generics,\n * no compile-time parameter constraints.\n *\n * Implemented as a distributed mapped type: switching on `fieldComponent`\n * narrows `fieldComponentProps` to the correct props type automatically.\n */\nexport type RendererFieldDefinition = {\n [K in FieldComponent]: {\n fieldKey: string;\n fieldComponent: K;\n fieldType?: FieldType;\n label: string;\n isRequired?: boolean;\n placeholder?: string;\n helperText?: React.ReactNode;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n disabled?: boolean;\n validate?: (value: unknown) => Promise<string | undefined>;\n onValidationError?: (error: ValidationError) => string | undefined;\n fieldComponentProps: DistributiveOmit<\n FormFieldPropsByType[K],\n FormManagedProps<K>\n >;\n };\n}[FieldComponent];\n\n/**\n * Gets valid form field types for a given property type\n */\nexport type ValidFormFieldForPropertyType<P extends FieldDescriptorType> =\n | \"CUSTOM\"\n | (P extends { type: \"objectSet\" } ? \"OBJECT_SET\"\n : P extends { type: \"object\" } ? \"OBJECT_SELECT\"\n : P extends { type: \"interface\" } ? \"UNSUPPORTED\"\n : P extends { type: \"struct\" } ? \"UNSUPPORTED\"\n : P extends \"mediaReference\" | \"attachment\" ? \"FILE_PICKER\"\n : P extends \"boolean\" ? \"RADIO_BUTTONS\" | \"DROPDOWN\" | \"SWITCH\"\n : P extends \"string\" ? \"TEXT_INPUT\" | \"TEXT_AREA\"\n : P extends \"datetime\" | \"timestamp\" ? \"DATETIME_PICKER\"\n : P extends \"marking\" | \"geohash\" | \"geoshape\" | \"objectType\"\n ? \"UNSUPPORTED\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_INPUT\"\n : never);\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"FormFieldApi.js","names":[],"sources":["FormFieldApi.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n CompileTimeMetadata,\n DataValueClientToWire,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n} from \"@osdk/api\";\nimport type React from \"react\";\n\nimport type {\n DatePickerProps,\n DateRangePickerProps,\n} from \"../shared/calendar/index.js\";\nimport type { PortalContainer } from \"../shared/PortalDismissLayer.js\";\n\nexport type { PortalContainer };\n\n/**\n * A form field definition specifies configuration for a single field.\n * Implemented as a distributed mapped type so `fieldComponent` narrows\n * `fieldComponentProps` to the matching component prop type.\n */\nexport type FormFieldDefinition<\n Q extends ActionDefinition<unknown>,\n K extends FieldKey<Q> = FieldKey<Q>,\n> = K extends unknown ? {\n // Distribute over each field key so a field's key, value type, and allowed\n // components stay correlated when K is the default union of all keys.\n [C in ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]: {\n /**\n * The field's unique key\n */\n fieldKey: K;\n\n /**\n * Display label for the field\n */\n label: string;\n\n /**\n * Default value of the field\n */\n defaultValue?: FieldValueType<Q, K>;\n\n /**\n * Whether the field is required\n */\n isRequired?: boolean;\n\n /**\n * Placeholder text\n */\n placeholder?: string;\n\n /**\n * Additional information to display on this field.\n * Accepts plain text or rich content (e.g. JSX with links or formatting).\n * Rendered as a tooltip icon next to the label by default, or below the\n * label when helperTextPlacement is \"bottom\".\n */\n helperText?: React.ReactNode;\n\n /**\n * The placement of the helper text either below the field or in a tooltip\n *\n * @default \"tooltip\"\n */\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n\n /**\n * A callback to customize error messages when a built-in validation rule fails.\n * Receives a discriminated union with the constraint data (e.g., the min value\n * that was exceeded) so the message can reference the threshold.\n *\n * Return a string to override the default message, or `undefined` to keep it.\n */\n onValidationError?: (error: ValidationError) => string | undefined;\n\n /**\n * Additional function to validate the field.\n *\n * Return `undefined` if valid, or an error message string if invalid.\n */\n validate?: (\n value: FieldValueType<Q, K>,\n ) => Promise<string | undefined>;\n\n /**\n * The form field component type to render\n */\n fieldComponent: C;\n\n /**\n * The component props for the form field.\n * Excludes runtime props (value, onChange) which are managed by ActionForm.\n */\n fieldComponentProps: DistributiveOmit<\n FormFieldPropsByType[C],\n FormManagedProps<C>\n >;\n };\n }[ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]\n : never;\n\n/**\n * A discriminated union describing which validation rule failed and the\n * constraint data the user needs to build a meaningful error message.\n */\nexport type ValidationError =\n | { type: \"required\" }\n | { type: \"min\"; min: number | Date }\n | { type: \"max\"; max: number | Date }\n | { type: \"minLength\"; minLength: number }\n | { type: \"maxLength\"; maxLength: number }\n | { type: \"maxSize\"; maxSize: number }\n | { type: \"validate\"; message: string };\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATE_RANGE_INPUT: DateRangePickerProps;\n DATETIME_PICKER: DatePickerProps;\n DROPDOWN: DropdownFieldProps<unknown, boolean>;\n FILE_PICKER: FilePickerProps;\n NUMBER_INPUT: NumberInputFieldProps;\n OBJECT_SELECT: ObjectSelectFieldProps<ObjectTypeDefinition>;\n OBJECT_SET: ObjectSetFieldProps<ObjectTypeDefinition>;\n RADIO_BUTTONS: RadioButtonsFieldProps<unknown>;\n SWITCH: SwitchFieldProps;\n TEXT_AREA: TextAreaFieldProps;\n TEXT_INPUT: TextInputFieldProps;\n CUSTOM: CustomFieldProps<unknown>;\n UNSUPPORTED: UnsupportedFieldProps;\n}\n\n/**\n * Dropdown field props with selectable items\n */\nexport interface DropdownFieldProps<V, Multiple extends boolean = false>\n extends BaseFormFieldProps<Multiple extends true ? V[] : V>\n{\n /**\n * Available items for the dropdown\n */\n items: V[];\n\n /**\n * Converts an item to searchable text and the default visual label. Defaults to `String()`.\n * Use `renderItemLabel` when the visible label needs rich React content.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Renders an item label with custom React content.\n * `itemToStringLabel` is still used for search, accessibility, and fallback keys.\n */\n renderItemLabel?: (item: V) => React.ReactNode;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected\n */\n isMultiple?: Multiple;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n\n /**\n * Element that receives the dropdown portal. Use this when rendering inside\n * modal dialogs so popups stay in the dialog's stacking and focus context\n * instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n\n /**\n * Controlled search input value. Must be provided together with `onQueryChange`.\n */\n query?: string;\n\n /**\n * Callback when the search input value changes.\n * Can be used standalone as an event listener or together with `query`\n * for fully controlled search state.\n */\n onQueryChange?: (query: string) => void;\n\n /**\n * When true, disables the combobox's built-in client-side filtering.\n * Use when items are already filtered server-side (e.g. via `onQueryChange`).\n *\n * @default false\n */\n disableClientSideFiltering?: boolean;\n\n /**\n * Status message rendered below the search input and above the item list\n * inside the popup. Use for loading/error/empty messages.\n */\n popupStatus?: React.ReactNode;\n\n /**\n * A React node to render after the item list.\n * Use for infinite scroll sentinels, \"load more\" buttons, etc.\n */\n trailingItem?: React.ReactNode;\n\n /**\n * Whether the dropdown locks page scroll and renders a full-viewport\n * dismiss layer when open. Set to `false` when the dropdown is not\n * inside a `<label>` to allow normal page scrolling.\n *\n * @default true\n */\n modal?: boolean;\n}\n\nexport interface FilePickerProps extends BaseFormFieldProps<File | File[]> {\n /**\n * Whether multiple files can be selected\n */\n isMulti?: boolean;\n\n /**\n * Accepted file types (e.g., \"image/*\", \".pdf\")\n */\n accept?: string | string[];\n\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n\n /**\n * The text displayed when no file is selected.\n *\n * @default \"No file chosen\"\n */\n text?: string;\n\n /**\n * The text displayed on the browse button.\n *\n * @default \"Browse\"\n */\n buttonText?: string;\n}\n\n/**\n * Text area field props\n */\nexport interface TextAreaFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | \"rows\"\n | \"wrap\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\nexport interface TextInputFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\n/**\n * Number input field props\n */\nexport interface NumberInputFieldProps extends BaseFormFieldProps<number> {\n /**\n * Minimum allowed value.\n */\n min?: number;\n\n /**\n * Maximum allowed value.\n */\n max?: number;\n\n /**\n * Step increment for the input. Used by the stepper buttons and ArrowUp/ArrowDown keyboard stepping.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Placeholder text shown when the input is empty.\n */\n placeholder?: string;\n}\n\n/**\n * Radio buttons field props\n */\nexport interface RadioButtonsFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Available options for radio buttons.\n *\n * Values are compared by reference equality (`===`). When options contain\n * non-primitive values, pass the same object references for `value` and\n * the corresponding option entry.\n */\n options: Option<V>[];\n\n /**\n * Controls the layout direction of the radio buttons.\n *\n * - `\"vertical\"` (default): options are stacked in a column\n * - `\"horizontal\"`: options are laid out in a row, wrapping when needed\n */\n orientation?: \"horizontal\" | \"vertical\";\n}\n\n/**\n * Switch field props for boolean values.\n */\nexport type SwitchFieldProps = BaseFormFieldProps<boolean>;\n\n/**\n * Option interface for radio button options\n */\nexport interface Option<V> {\n label: string;\n value: V;\n}\n\n/**\n * Object set field displays the summary of the count of the given object set\n */\nexport interface ObjectSetFieldProps<T extends ObjectTypeDefinition>\n extends Pick<BaseFormFieldProps<ObjectSet<T>>, \"id\" | \"value\" | \"disabled\">\n{\n /**\n * Message displayed when no object set is provided.\n *\n * @default \"Object set is not defined\"\n */\n emptyMessage?: string;\n}\n\ntype ObjectSelectDataSource<Q extends ObjectTypeDefinition> =\n | {\n /**\n * The object type definition to search across.\n */\n objectType: Q;\n objectSet?: never;\n }\n | {\n /**\n * A pre-scoped object set to search within.\n *\n * Use this when selectable options should be limited to a subset of\n * objects. User-entered search text is applied within this set.\n */\n objectSet: ObjectSet<Q>;\n objectType?: never;\n };\n\n/**\n * Object select field props for selecting object instances from the ontology.\n * Used for action parameters that accept a single object or multiple objects.\n *\n * Extends DropdownFieldProps with props that ObjectSelectField\n * manages internally (items, search, filtering) omitted from the public surface.\n */\nexport type ObjectSelectFieldProps<\n Q extends ObjectTypeDefinition = ObjectTypeDefinition,\n> =\n & Omit<\n DropdownFieldProps<Osdk.Instance<Q>>,\n | \"items\"\n | \"itemToStringLabel\"\n | \"itemToKey\"\n | \"isItemEqual\"\n | \"isSearchable\"\n | \"query\"\n | \"onQueryChange\"\n | \"disableClientSideFiltering\"\n | \"renderItemList\"\n >\n & ObjectSelectDataSource<Q>;\n\n/**\n * Custom field props for user-defined renderers\n */\nexport interface CustomFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Custom renderer function\n */\n customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;\n}\n\nexport interface UnsupportedFieldProps\n extends Pick<BaseFormFieldProps<string>, \"id\" | \"error\">\n{}\n\nexport interface BaseFormFieldProps<V> {\n /**\n * The HTML `id` attribute for the field input element.\n * Used for `<label htmlFor>` association.\n */\n id?: string;\n\n /**\n * The validation error message for this field, if any.\n * When set, the field should display a visual error state.\n */\n error?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n\n /**\n * The default value of the form field.\n */\n defaultValue?: V;\n\n /**\n * Whether the field is disabled.\n *\n * Disabled fields keep their current value in form state and submit payloads,\n * but built-in renderers block user edits and remove disabled controls from\n * keyboard navigation.\n */\n disabled?: boolean;\n\n /**\n * Called when the field value changes.\n *\n * ActionForm internally wraps this to pass the key to `onFieldValueChange`:\n * ```\n * <DropdownField\n * {...fieldDef}\n * onChange={(value) => onFieldValueChange(fieldDef.key, value)}\n * />\n * ```\n *\n * @param value The new value of the form field\n */\n onChange?: (value: V | null) => void;\n}\n\nexport type FieldKey<Q extends ActionDefinition<unknown>> =\n keyof ActionParameters<Q>;\n\n/**\n * Extracts parameters from an ActionDefinition\n */\nexport type ActionParameters<Q extends ActionDefinition<unknown>> =\n CompileTimeMetadata<Q>[\"parameters\"];\n\n/**\n * Extracts the value type for a specific parameter\n */\nexport type FieldValueType<\n Q extends ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"] extends\n ActionMetadata.DataType.Object<infer T> ? ActionParam.ObjectType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.ObjectSet<\n infer T\n > ? ActionParam.ObjectSetType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Interface<\n infer T\n > ? ActionParam.InterfaceType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Struct<\n infer T\n > ? ActionParam.StructType<T>\n : ActionParameters<Q>[K][\"type\"] extends keyof DataValueClientToWire\n ? DataValueClientToWire[ActionParameters<Q>[K][\"type\"]]\n : never;\n\n/**\n * Extracts the parameter type descriptor for a specific action parameter.\n */\nexport type FieldDescriptorType<\n Q extends ActionDefinition<unknown> = ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"];\n\n/**\n * Available form field component types\n */\nexport type FieldComponent =\n | \"DATE_RANGE_INPUT\"\n | \"DATETIME_PICKER\"\n | \"DROPDOWN\"\n | \"FILE_PICKER\"\n | \"NUMBER_INPUT\"\n | \"OBJECT_SELECT\"\n | \"OBJECT_SET\"\n | \"RADIO_BUTTONS\"\n | \"SWITCH\"\n | \"TEXT_AREA\"\n | \"TEXT_INPUT\"\n | \"CUSTOM\"\n | \"UNSUPPORTED\";\n\n/**\n * Describes the data type of a form field, independent of OSDK.\n * Mirrors ActionMetadata.DataType to keep the rendering layer OSDK-agnostic.\n */\nexport type FieldType =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\"\n | \"geoshape\"\n | \"geohash\"\n | \"scenarioReference\"\n | { type: \"object\"; object: string }\n | { type: \"objectSet\"; objectSet: string }\n | { type: \"interface\"; interface: string }\n | { type: \"struct\"; struct: Record<string, string> };\n\n/**\n * Props managed by form state infrastructure (FieldBridge / RHF).\n * Fields with onChange participate in form state → value and onChange are managed\n * externally. Read-only fields (no onChange, e.g. ObjectSetField) keep value in\n * fieldComponentProps so it bypasses form state cloning.\n */\ntype FormManagedProps<K extends FieldComponent> = \"onChange\" extends\n keyof FormFieldPropsByType[K] ? \"value\" | \"onChange\" | \"disabled\"\n : \"onChange\" | \"disabled\";\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<\n T,\n Extract<keyof T, K>\n >\n : never;\n\n/**\n * An OSDK-agnostic field definition used by BaseForm and FormFieldRenderer.\n * Contains only the information needed to render a single field — no generics,\n * no compile-time parameter constraints.\n *\n * Implemented as a distributed mapped type: switching on `fieldComponent`\n * narrows `fieldComponentProps` to the correct props type automatically.\n */\nexport type RendererFieldDefinition = {\n [K in FieldComponent]: {\n fieldKey: string;\n fieldComponent: K;\n fieldType?: FieldType;\n label: string;\n isRequired?: boolean;\n placeholder?: string;\n helperText?: React.ReactNode;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n disabled?: boolean;\n validate?: (value: unknown) => Promise<string | undefined>;\n onValidationError?: (error: ValidationError) => string | undefined;\n fieldComponentProps: DistributiveOmit<\n FormFieldPropsByType[K],\n FormManagedProps<K>\n >;\n };\n}[FieldComponent];\n\n/**\n * Gets valid form field types for a given property type\n */\nexport type ValidFormFieldForPropertyType<P extends FieldDescriptorType> =\n | \"CUSTOM\"\n | (P extends { type: \"objectSet\" } ? \"OBJECT_SET\"\n : P extends { type: \"object\" } ? \"OBJECT_SELECT\"\n : P extends { type: \"interface\" } ? \"UNSUPPORTED\"\n : P extends { type: \"struct\" } ? \"UNSUPPORTED\"\n : P extends \"mediaReference\" | \"attachment\" ? \"FILE_PICKER\"\n : P extends \"boolean\" ? \"RADIO_BUTTONS\" | \"DROPDOWN\" | \"SWITCH\"\n : P extends \"string\" ? \"TEXT_INPUT\" | \"TEXT_AREA\"\n : P extends \"datetime\" | \"timestamp\" ? \"DATETIME_PICKER\"\n : P extends \"marking\" | \"geohash\" | \"geoshape\" | \"objectType\"\n ? \"UNSUPPORTED\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_INPUT\"\n : never);\n"],"mappings":"","ignoreList":[]}
@@ -83,6 +83,7 @@ function buildFieldDefinition(key, param) {
83
83
  case "geohash":
84
84
  case "geoshape":
85
85
  case "objectType":
86
+ case "scenarioReference":
86
87
  return {
87
88
  ...base,
88
89
  fieldComponent: "UNSUPPORTED",
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultFieldDefinitions.js","names":["assertUnreachable","getDefaultFieldDefinitions","metadata","Object","entries","parameters","map","key","param","buildFieldDefinition","base","fieldKey","label","isRequired","nullable","fieldType","type","paramType","fieldComponent","fieldComponentProps","value","objectType","apiName","object","options"],"sources":["getDefaultFieldDefinitions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ActionMetadata } from \"@osdk/api\";\nimport { assertUnreachable } from \"../../shared/assertUnreachable.js\";\nimport type { RendererFieldDefinition } from \"../FormFieldApi.js\";\n\n/**\n * Derives default field definitions from ActionMetadata.\n *\n * Each parameter type maps to a concrete RendererFieldDefinition with the\n * correct fieldComponent and default fieldComponentProps.\n */\nexport function getDefaultFieldDefinitions(\n metadata: ActionMetadata,\n): ReadonlyArray<RendererFieldDefinition> {\n return Object.entries(metadata.parameters).map(\n ([key, param]) => buildFieldDefinition(key, param),\n );\n}\n\n/**\n * Maps a single action parameter to its default RendererFieldDefinition.\n *\n * Switches on the parameter's data type to select both the field component\n * and its required default props.\n */\nfunction buildFieldDefinition(\n key: string,\n param: ActionMetadata.Parameter,\n): RendererFieldDefinition {\n const base = {\n fieldKey: key,\n label: key,\n isRequired: !param.nullable,\n fieldType: param.type,\n };\n\n const paramType = param.type;\n\n if (typeof paramType === \"object\") {\n switch (paramType.type) {\n case \"objectSet\":\n return {\n ...base,\n fieldComponent: \"OBJECT_SET\",\n fieldComponentProps: { value: null },\n };\n case \"object\":\n return {\n ...base,\n fieldComponent: \"OBJECT_SELECT\",\n fieldComponentProps: {\n // Construct a minimal ObjectTypeDefinition from the action\n // parameter metadata. At runtime useOsdkObjects only reads\n // type + apiName from the definition.\n objectType: {\n type: \"object\" as const,\n apiName: paramType.object,\n },\n },\n };\n case \"interface\":\n case \"struct\":\n return {\n ...base,\n fieldComponent: \"UNSUPPORTED\",\n fieldComponentProps: {},\n };\n }\n }\n\n switch (paramType) {\n case \"string\":\n return {\n ...base,\n fieldComponent: \"TEXT_INPUT\",\n fieldComponentProps: {},\n };\n case \"marking\":\n case \"geohash\":\n case \"geoshape\":\n case \"objectType\":\n return {\n ...base,\n fieldComponent: \"UNSUPPORTED\",\n fieldComponentProps: {},\n };\n case \"boolean\":\n return {\n ...base,\n fieldComponent: \"RADIO_BUTTONS\",\n fieldComponentProps: {\n options: [{ label: \"True\", value: true }, {\n label: \"False\",\n value: false,\n }],\n },\n };\n case \"integer\":\n case \"double\":\n case \"long\":\n return {\n ...base,\n fieldComponent: \"NUMBER_INPUT\",\n fieldComponentProps: {},\n };\n case \"datetime\":\n case \"timestamp\":\n return {\n ...base,\n fieldComponent: \"DATETIME_PICKER\",\n fieldComponentProps: {},\n };\n case \"attachment\":\n case \"mediaReference\":\n return {\n ...base,\n fieldComponent: \"FILE_PICKER\",\n fieldComponentProps: {},\n };\n default:\n return assertUnreachable(paramType);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,iBAAiB,QAAQ,mCAAmC;AAGrE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CACxCC,QAAwB,EACgB;EACxC,OAAOC,MAAM,CAACC,OAAO,CAACF,QAAQ,CAACG,UAAU,CAAC,CAACC,GAAG,CAC5C,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAKC,oBAAoB,CAACF,GAAG,EAAEC,KAAK,CACnD,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,oBAAoBA,CAC3BF,GAAW,EACXC,KAA+B,EACN;EACzB,MAAME,IAAI,GAAG;IACXC,QAAQ,EAAEJ,GAAG;IACbK,KAAK,EAAEL,GAAG;IACVM,UAAU,EAAE,CAACL,KAAK,CAACM,QAAQ;IAC3BC,SAAS,EAAEP,KAAK,CAACQ;EACnB,CAAC;EAED,MAAMC,SAAS,GAAGT,KAAK,CAACQ,IAAI;EAE5B,IAAI,OAAOC,SAAS,KAAK,QAAQ,EAAE;IACjC,QAAQA,SAAS,CAACD,IAAI;MACpB,KAAK,WAAW;QACd,OAAO;UACL,GAAGN,IAAI;UACPQ,cAAc,EAAE,YAAY;UAC5BC,mBAAmB,EAAE;YAAEC,KAAK,EAAE;UAAK;QACrC,CAAC;MACH,KAAK,QAAQ;QACX,OAAO;UACL,GAAGV,IAAI;UACPQ,cAAc,EAAE,eAAe;UAC/BC,mBAAmB,EAAE;YACnB;YACA;YACA;YACAE,UAAU,EAAE;cACVL,IAAI,EAAE,QAAiB;cACvBM,OAAO,EAAEL,SAAS,CAACM;YACrB;UACF;QACF,CAAC;MACH,KAAK,WAAW;MAChB,KAAK,QAAQ;QACX,OAAO;UACL,GAAGb,IAAI;UACPQ,cAAc,EAAE,aAAa;UAC7BC,mBAAmB,EAAE,CAAC;QACxB,CAAC;IACL;EACF;EAEA,QAAQF,SAAS;IACf,KAAK,QAAQ;MACX,OAAO;QACL,GAAGP,IAAI;QACPQ,cAAc,EAAE,YAAY;QAC5BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,UAAU;IACf,KAAK,YAAY;MACf,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,aAAa;QAC7BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,SAAS;MACZ,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,eAAe;QAC/BC,mBAAmB,EAAE;UACnBK,OAAO,EAAE,CAAC;YAAEZ,KAAK,EAAE,MAAM;YAAEQ,KAAK,EAAE;UAAK,CAAC,EAAE;YACxCR,KAAK,EAAE,OAAO;YACdQ,KAAK,EAAE;UACT,CAAC;QACH;MACF,CAAC;IACH,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,MAAM;MACT,OAAO;QACL,GAAGV,IAAI;QACPQ,cAAc,EAAE,cAAc;QAC9BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,UAAU;IACf,KAAK,WAAW;MACd,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,iBAAiB;QACjCC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,YAAY;IACjB,KAAK,gBAAgB;MACnB,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,aAAa;QAC7BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH;MACE,OAAOnB,iBAAiB,CAACiB,SAAS,CAAC;EACvC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"getDefaultFieldDefinitions.js","names":["assertUnreachable","getDefaultFieldDefinitions","metadata","Object","entries","parameters","map","key","param","buildFieldDefinition","base","fieldKey","label","isRequired","nullable","fieldType","type","paramType","fieldComponent","fieldComponentProps","value","objectType","apiName","object","options"],"sources":["getDefaultFieldDefinitions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ActionMetadata } from \"@osdk/api\";\nimport { assertUnreachable } from \"../../shared/assertUnreachable.js\";\nimport type { RendererFieldDefinition } from \"../FormFieldApi.js\";\n\n/**\n * Derives default field definitions from ActionMetadata.\n *\n * Each parameter type maps to a concrete RendererFieldDefinition with the\n * correct fieldComponent and default fieldComponentProps.\n */\nexport function getDefaultFieldDefinitions(\n metadata: ActionMetadata,\n): ReadonlyArray<RendererFieldDefinition> {\n return Object.entries(metadata.parameters).map(\n ([key, param]) => buildFieldDefinition(key, param),\n );\n}\n\n/**\n * Maps a single action parameter to its default RendererFieldDefinition.\n *\n * Switches on the parameter's data type to select both the field component\n * and its required default props.\n */\nfunction buildFieldDefinition(\n key: string,\n param: ActionMetadata.Parameter,\n): RendererFieldDefinition {\n const base = {\n fieldKey: key,\n label: key,\n isRequired: !param.nullable,\n fieldType: param.type,\n };\n\n const paramType = param.type;\n\n if (typeof paramType === \"object\") {\n switch (paramType.type) {\n case \"objectSet\":\n return {\n ...base,\n fieldComponent: \"OBJECT_SET\",\n fieldComponentProps: { value: null },\n };\n case \"object\":\n return {\n ...base,\n fieldComponent: \"OBJECT_SELECT\",\n fieldComponentProps: {\n // Construct a minimal ObjectTypeDefinition from the action\n // parameter metadata. At runtime useOsdkObjects only reads\n // type + apiName from the definition.\n objectType: {\n type: \"object\" as const,\n apiName: paramType.object,\n },\n },\n };\n case \"interface\":\n case \"struct\":\n return {\n ...base,\n fieldComponent: \"UNSUPPORTED\",\n fieldComponentProps: {},\n };\n }\n }\n\n switch (paramType) {\n case \"string\":\n return {\n ...base,\n fieldComponent: \"TEXT_INPUT\",\n fieldComponentProps: {},\n };\n case \"marking\":\n case \"geohash\":\n case \"geoshape\":\n case \"objectType\":\n case \"scenarioReference\":\n return {\n ...base,\n fieldComponent: \"UNSUPPORTED\",\n fieldComponentProps: {},\n };\n case \"boolean\":\n return {\n ...base,\n fieldComponent: \"RADIO_BUTTONS\",\n fieldComponentProps: {\n options: [{ label: \"True\", value: true }, {\n label: \"False\",\n value: false,\n }],\n },\n };\n case \"integer\":\n case \"double\":\n case \"long\":\n return {\n ...base,\n fieldComponent: \"NUMBER_INPUT\",\n fieldComponentProps: {},\n };\n case \"datetime\":\n case \"timestamp\":\n return {\n ...base,\n fieldComponent: \"DATETIME_PICKER\",\n fieldComponentProps: {},\n };\n case \"attachment\":\n case \"mediaReference\":\n return {\n ...base,\n fieldComponent: \"FILE_PICKER\",\n fieldComponentProps: {},\n };\n default:\n return assertUnreachable(paramType);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,iBAAiB,QAAQ,mCAAmC;AAGrE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CACxCC,QAAwB,EACgB;EACxC,OAAOC,MAAM,CAACC,OAAO,CAACF,QAAQ,CAACG,UAAU,CAAC,CAACC,GAAG,CAC5C,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAKC,oBAAoB,CAACF,GAAG,EAAEC,KAAK,CACnD,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,oBAAoBA,CAC3BF,GAAW,EACXC,KAA+B,EACN;EACzB,MAAME,IAAI,GAAG;IACXC,QAAQ,EAAEJ,GAAG;IACbK,KAAK,EAAEL,GAAG;IACVM,UAAU,EAAE,CAACL,KAAK,CAACM,QAAQ;IAC3BC,SAAS,EAAEP,KAAK,CAACQ;EACnB,CAAC;EAED,MAAMC,SAAS,GAAGT,KAAK,CAACQ,IAAI;EAE5B,IAAI,OAAOC,SAAS,KAAK,QAAQ,EAAE;IACjC,QAAQA,SAAS,CAACD,IAAI;MACpB,KAAK,WAAW;QACd,OAAO;UACL,GAAGN,IAAI;UACPQ,cAAc,EAAE,YAAY;UAC5BC,mBAAmB,EAAE;YAAEC,KAAK,EAAE;UAAK;QACrC,CAAC;MACH,KAAK,QAAQ;QACX,OAAO;UACL,GAAGV,IAAI;UACPQ,cAAc,EAAE,eAAe;UAC/BC,mBAAmB,EAAE;YACnB;YACA;YACA;YACAE,UAAU,EAAE;cACVL,IAAI,EAAE,QAAiB;cACvBM,OAAO,EAAEL,SAAS,CAACM;YACrB;UACF;QACF,CAAC;MACH,KAAK,WAAW;MAChB,KAAK,QAAQ;QACX,OAAO;UACL,GAAGb,IAAI;UACPQ,cAAc,EAAE,aAAa;UAC7BC,mBAAmB,EAAE,CAAC;QACxB,CAAC;IACL;EACF;EAEA,QAAQF,SAAS;IACf,KAAK,QAAQ;MACX,OAAO;QACL,GAAGP,IAAI;QACPQ,cAAc,EAAE,YAAY;QAC5BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,UAAU;IACf,KAAK,YAAY;IACjB,KAAK,mBAAmB;MACtB,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,aAAa;QAC7BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,SAAS;MACZ,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,eAAe;QAC/BC,mBAAmB,EAAE;UACnBK,OAAO,EAAE,CAAC;YAAEZ,KAAK,EAAE,MAAM;YAAEQ,KAAK,EAAE;UAAK,CAAC,EAAE;YACxCR,KAAK,EAAE,OAAO;YACdQ,KAAK,EAAE;UACT,CAAC;QACH;MACF,CAAC;IACH,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,MAAM;MACT,OAAO;QACL,GAAGV,IAAI;QACPQ,cAAc,EAAE,cAAc;QAC9BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,UAAU;IACf,KAAK,WAAW;MACd,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,iBAAiB;QACjCC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH,KAAK,YAAY;IACjB,KAAK,gBAAgB;MACnB,OAAO;QACL,GAAGT,IAAI;QACPQ,cAAc,EAAE,aAAa;QAC7BC,mBAAmB,EAAE,CAAC;MACxB,CAAC;IACH;MACE,OAAOnB,iBAAiB,CAACiB,SAAS,CAAC;EACvC;AACF","ignoreList":[]}
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- const PACKAGE_USER_AGENT = `osdk-react-components/${"0.21.1-main-d0845dd9e4d107ea7509f700e3366b4bf7d1576e"}`;
17
+ const PACKAGE_USER_AGENT = `osdk-react-components/${"0.22.0"}`;
18
18
  export function componentUserAgent(componentName) {
19
19
  return `${PACKAGE_USER_AGENT}/${componentName}`;
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,iFAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
1
+ {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,mCAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
@@ -7,7 +7,7 @@ var chunkHNBSGCSZ_cjs = require('./chunk-HNBSGCSZ.cjs');
7
7
  var chunk7LXS66DW_cjs = require('./chunk-7LXS66DW.cjs');
8
8
  var chunkMD4KDE44_cjs = require('./chunk-MD4KDE44.cjs');
9
9
  var chunkUCTQICPR_cjs = require('./chunk-UCTQICPR.cjs');
10
- var chunkP6NELDSR_cjs = require('./chunk-P6NELDSR.cjs');
10
+ var chunkO3L7F3SI_cjs = require('./chunk-O3L7F3SI.cjs');
11
11
  var react = require('@osdk/react');
12
12
  var React17 = require('react');
13
13
  var icons = require('@blueprintjs/icons');
@@ -1689,6 +1689,7 @@ function buildFieldDefinition(key, param) {
1689
1689
  case "geohash":
1690
1690
  case "geoshape":
1691
1691
  case "objectType":
1692
+ case "scenarioReference":
1692
1693
  return {
1693
1694
  ...base,
1694
1695
  fieldComponent: "UNSUPPORTED",
@@ -1852,9 +1853,9 @@ var ActionForm = chunk3S52UDZM_cjs.typedReactMemo(function ActionFormFn({
1852
1853
  });
1853
1854
 
1854
1855
  // src/public/experimental/action-form.ts
1855
- var ActionForm2 = chunkP6NELDSR_cjs.withOsdkMetrics(ActionForm, "ActionForm");
1856
+ var ActionForm2 = chunkO3L7F3SI_cjs.withOsdkMetrics(ActionForm, "ActionForm");
1856
1857
 
1857
1858
  exports.ActionForm = ActionForm2;
1858
1859
  exports.BaseForm = BaseForm;
1859
- //# sourceMappingURL=chunk-N4O7OZCM.cjs.map
1860
- //# sourceMappingURL=chunk-N4O7OZCM.cjs.map
1860
+ //# sourceMappingURL=chunk-5OTHYCAN.cjs.map
1861
+ //# sourceMappingURL=chunk-5OTHYCAN.cjs.map