diff --git a/lib/block_kit.atd b/lib/block_kit.atd index 7d00112..505e476 100644 --- a/lib/block_kit.atd +++ b/lib/block_kit.atd @@ -83,7 +83,7 @@ type multi_static_select_menu = { ?action_id : string nullable ; ?options : option_object list nullable ; ?option_groups : option_group list nullable ; - ?inital_options : options list nullable; + ?initial_option : option_object list nullable; ?confirm : confirmation_dialog_object nullable; ?max_selected_items : int nullable ; ?focus_on_load : bool nullable; @@ -103,7 +103,7 @@ type static_select_menu = { ?action_id : string nullable ; ?options : option_object list nullable; ?option_groups : option_group list nullable; - ?initial_option : options nullable; + ?initial_option: option_object nullable; ?confirm : confirmation_dialog_object nullable; ?focus_on_load : bool nullable; ?place_holder : text_object nullable @@ -124,10 +124,10 @@ type confirmation_dialog_object = { ?style : style nullable; } -type options = [ - | Option_object of option_object - | Option_group of option_group -] +(* type options = [ *) +(* | Option_object of option_object *) +(* | Option_group of option_group *) +(* ] *) type option_object = { text : text_object; diff --git a/lib/block_kit_safe.ml b/lib/block_kit_safe.ml index 2d0cb21..b5d5853 100644 --- a/lib/block_kit_safe.ml +++ b/lib/block_kit_safe.ml @@ -65,16 +65,15 @@ let make_multi_static_select_menu ?action_id ~(options : option_object list) ) place_holder in - let initial_option = Option.map (fun v -> List.map (fun o -> Option_object o) v) initial_option in Block_kit_j.( Multi_static_select_menu - (make_multi_static_select_menu ?action_id ~options ?inital_options:initial_option ?confirm ?max_selected_items - ?focus_on_load ?place_holder () + (make_multi_static_select_menu ?action_id ~options ?initial_option ?confirm ?max_selected_items ?focus_on_load + ?place_holder () ) ) let make_multi_static_select_menu_group ?action_id ~(option_groups : option_group list) - ?(initial_option : option_group list option) ?confirm ?max_selected_items ?focus_on_load + ?(initial_option : option_object list option) ?confirm ?max_selected_items ?focus_on_load ?(place_holder : plain_text option) () = let place_holder = @@ -86,11 +85,10 @@ let make_multi_static_select_menu_group ?action_id ~(option_groups : option_grou ) place_holder in - let initial_option = Option.map (fun v -> List.map (fun o -> Option_group o) v) initial_option in Block_kit_j.( Multi_static_select_menu - (make_multi_static_select_menu ?action_id ~option_groups ?inital_options:initial_option ?confirm - ?max_selected_items ?focus_on_load ?place_holder () + (make_multi_static_select_menu ?action_id ~option_groups ?initial_option ?confirm ?max_selected_items + ?focus_on_load ?place_holder () ) ) @@ -107,14 +105,13 @@ let make_static_select_menu ?action_id ~(options : option_object list) ?(initial ) place_holder in - let initial_option = Option.map (fun o -> Option_object o) initial_option in Block_kit_j.( Static_select_menu (make_static_select_menu ?action_id ~options ?initial_option ?confirm ?focus_on_load ?place_holder ()) ) let make_static_select_menu_group ?action_id ~(option_groups : option_group list) - ?(initial_option : option_group option) ?confirm ?focus_on_load ?(place_holder : plain_text option) () + ?(initial_option : option_object option) ?confirm ?focus_on_load ?(place_holder : plain_text option) () = if List.length option_groups > 100 then raise (Invalid_argument "option objects limit 100 exceeded"); let place_holder = @@ -126,7 +123,6 @@ let make_static_select_menu_group ?action_id ~(option_groups : option_group list ) place_holder in - let initial_option = Option.map (fun o -> Option_group o) initial_option in Block_kit_j.( Static_select_menu (make_static_select_menu ?action_id ~option_groups ?initial_option ?confirm ?focus_on_load ?place_holder ()) diff --git a/lib_test/test_block_kit.ml b/lib_test/test_block_kit.ml index a4446db..2bcdd39 100644 --- a/lib_test/test_block_kit.ml +++ b/lib_test/test_block_kit.ml @@ -28,7 +28,8 @@ let make_modal_v2 (todo_list_options : todo_list_option list) = ) todo_list_options in - make_static_select_menu ~options () + let initial_option = List.hd options in + make_static_select_menu ~initial_option ~options () in let label = make_plain_text ~text:"Todo-list" () in make_input ~label ~element:static_select_menu ()