@feltmaps/js-sdk 1.7.0-next.15 → 1.7.0-next.17

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.
@@ -8562,245 +8562,7 @@ interface UIButtonElementCreateClonable extends MakeClonableSchema<UIButtonEleme
8562
8562
  interface UIButtonElementUpdate extends MakeUpdateSchema<UIButtonElement, UIButtonElementCreate> {
8563
8563
  }
8564
8564
 
8565
- declare const uiFlexibleSpaceElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
8566
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8567
- id: z.ZodString;
8568
- }, "strip", z.ZodTypeAny, {
8569
- id: string;
8570
- }, {
8571
- id: string;
8572
- }>], z.ZodUnknown>, z.ZodVoid>>;
8573
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8574
- id: z.ZodString;
8575
- }, "strip", z.ZodTypeAny, {
8576
- id: string;
8577
- }, {
8578
- id: string;
8579
- }>], z.ZodUnknown>, z.ZodVoid>>;
8580
- }, {
8581
- id: z.ZodString;
8582
- }>, {
8583
- type: z.ZodLiteral<"FlexibleSpace">;
8584
- }>, "strip", z.ZodTypeAny, {
8585
- type: "FlexibleSpace";
8586
- id: string;
8587
- onCreate?: ((args_0: {
8588
- id: string;
8589
- }, ...args: unknown[]) => void) | undefined;
8590
- onDestroy?: ((args_0: {
8591
- id: string;
8592
- }, ...args: unknown[]) => void) | undefined;
8593
- }, {
8594
- type: "FlexibleSpace";
8595
- id: string;
8596
- onCreate?: ((args_0: {
8597
- id: string;
8598
- }, ...args: unknown[]) => void) | undefined;
8599
- onDestroy?: ((args_0: {
8600
- id: string;
8601
- }, ...args: unknown[]) => void) | undefined;
8602
- }>;
8603
- /**
8604
- * Represents a flexible space element in a container.
8605
- *
8606
- * When rendered...
8607
- *
8608
- * - inside {@link UIGridContainerElement}, it will add extra gap between items. It can be controlled by `grid` property.
8609
- * - inside {@link UIPanelElement} `body` or `footer`, since they work as vertically stacks, it will add extra gap between items.
8610
- * - inside {@link UIButtonGroupElement}, it will take the remaining space.
8611
- *
8612
- * @example
8613
- * Buttons with a flexible space between makes them more visually separated.
8614
- * ```typescript
8615
- * {
8616
- * type: "ButtonGroup",
8617
- * items: [
8618
- * { type: "Button", label: "Button 1", onClick: () => {} },
8619
- * { type: "FlexibleSpace" },
8620
- * { type: "Button", label: "Button 2", onClick: () => {} },
8621
- * ],
8622
- * }
8623
- * ```
8624
- *
8625
- * @example
8626
- * Paragraphs with a flexible space between makes them more visually separated.
8627
- * ```typescript
8628
- * {
8629
- * type: "Panel",
8630
- * body: [
8631
- * { type: "Paragraph", text: "Paragraph 1" },
8632
- * { type: "FlexibleSpace" },
8633
- * { type: "Paragraph", text: "Paragraph 2" },
8634
- * ],
8635
- * }
8636
- * ```
8637
- *
8638
- * @example
8639
- * Horizontal stack of buttons with a flexible space between makes them more visually separated.
8640
- * ```typescript
8641
- * {
8642
- * type: "Grid",
8643
- * grid: "auto-flow / auto 1fr auto",
8644
- * items: [
8645
- * { type: "Button", label: "Button 1", onClick: () => {} },
8646
- * { type: "FlexibleSpace" },
8647
- * { type: "Button", label: "Button 2", onClick: () => {} },
8648
- * ],
8649
- * }
8650
- * ```
8651
- */
8652
- interface UIFlexibleSpaceElement extends UIElementBase, Omit<zInfer<typeof uiFlexibleSpaceElementSchema>, "onCreate" | "onDestroy"> {
8653
- }
8654
- /**
8655
- * The parameters for creating a flexible space element.
8656
- *
8657
- * @remarks
8658
- * `id` is optional but recommended if you want to be able to perform updates.
8659
- */
8660
- interface UIFlexibleSpaceElementCreate extends Omit<UIFlexibleSpaceElement, "id">, UIElementBaseCreateParams {
8661
- }
8662
- type UIFlexibleSpaceElementCreateClonable = MakeClonableSchema<UIFlexibleSpaceElementCreate>;
8663
- /**
8664
- * The parameters for updating a flexible space element.
8665
- *
8666
- * See {@link UIFlexibleSpaceElement} for more details.
8667
- *
8668
- * @remarks
8669
- * `id` and `type` are required to identify the element to update.
8670
- */
8671
- interface UIFlexibleSpaceElementUpdate extends MakeUpdateSchema<UIFlexibleSpaceElement, UIFlexibleSpaceElementCreate> {
8672
- }
8673
-
8674
- declare const uiTextElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
8675
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8676
- id: z.ZodString;
8677
- }, "strip", z.ZodTypeAny, {
8678
- id: string;
8679
- }, {
8680
- id: string;
8681
- }>], z.ZodUnknown>, z.ZodVoid>>;
8682
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8683
- id: z.ZodString;
8684
- }, "strip", z.ZodTypeAny, {
8685
- id: string;
8686
- }, {
8687
- id: string;
8688
- }>], z.ZodUnknown>, z.ZodVoid>>;
8689
- }, {
8690
- id: z.ZodString;
8691
- }>, {
8692
- type: z.ZodLiteral<"Text">;
8693
- /**
8694
- * The text to display in the element.
8695
- */
8696
- content: z.ZodString;
8697
- }>, "strip", z.ZodTypeAny, {
8698
- type: "Text";
8699
- id: string;
8700
- content: string;
8701
- onCreate?: ((args_0: {
8702
- id: string;
8703
- }, ...args: unknown[]) => void) | undefined;
8704
- onDestroy?: ((args_0: {
8705
- id: string;
8706
- }, ...args: unknown[]) => void) | undefined;
8707
- }, {
8708
- type: "Text";
8709
- id: string;
8710
- content: string;
8711
- onCreate?: ((args_0: {
8712
- id: string;
8713
- }, ...args: unknown[]) => void) | undefined;
8714
- onDestroy?: ((args_0: {
8715
- id: string;
8716
- }, ...args: unknown[]) => void) | undefined;
8717
- }>;
8718
- /**
8719
- * Represents a text element in a panel.
8720
- * Markdown is supported.
8721
- *
8722
- * @example
8723
- * #### simple
8724
- * ```typescript
8725
- * {
8726
- * type: "Text",
8727
- * content: "Hello, world!",
8728
- * }
8729
- * ```
8730
- *
8731
- * @example
8732
- * #### with links
8733
- * ```typescript
8734
- * {
8735
- * type: "Text",
8736
- * content: "Fill the form https://www.google.com.",
8737
- * }
8738
- * ```
8739
- *
8740
- * @example
8741
- * #### markdown
8742
- * ```typescript
8743
- * {
8744
- * type: "Text",
8745
- * content: "**Hello**, _world_!",
8746
- * }
8747
- * ```
8748
- *
8749
- * @example
8750
- * #### complex markdown
8751
- * Complex markdown syntax is supported like tables, images, quotes, etc.
8752
- * ```typescript
8753
- * {
8754
- * type: "Text",
8755
- * content: `
8756
- *
8757
- * ## Heading
8758
- *
8759
- * This is a paragraph.
8760
- *
8761
- * ### Subheading
8762
- *
8763
- * This is a paragraph.
8764
- *
8765
- * | Name | Age |
8766
- * | ---- | --- |
8767
- * | John | 25 |
8768
- * | Jane | 30 |
8769
- *
8770
- * ![Image](https://via.placeholder.com/150)
8771
- *
8772
- * > This is a quote.
8773
- *
8774
- * [Link](https://www.google.com)
8775
- * `,
8776
- * }
8777
- * ```
8778
- */
8779
- interface UITextElement extends UIElementBase, Omit<zInfer<typeof uiTextElementSchema>, "onCreate" | "onDestroy"> {
8780
- }
8781
- /**
8782
- * The parameters for creating a text element.
8783
- *
8784
- * See {@link UITextElement} for more details.
8785
- *
8786
- * @remarks
8787
- * `id` is optional but recommended if you want to be able to perform updates.
8788
- */
8789
- interface UITextElementCreate extends Omit<UITextElement, "id">, UIElementBaseCreateParams {
8790
- }
8791
- type UITextElementCreateClonable = MakeClonableSchema<UITextElementCreate>;
8792
- /**
8793
- * The parameters for updating a text element.
8794
- *
8795
- * See {@link UITextElement} for more details.
8796
- *
8797
- * @remarks
8798
- * `id` and `type` are required to identify the element to update.
8799
- */
8800
- interface UITextElementUpdate extends MakeUpdateSchema<UITextElement, UITextElementCreate> {
8801
- }
8802
-
8803
- declare const uiButtonGroupElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
8565
+ declare const uiDividerElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
8804
8566
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8805
8567
  id: z.ZodString;
8806
8568
  }, "strip", z.ZodTypeAny, {
@@ -8818,239 +8580,19 @@ declare const uiButtonGroupElementSchema: z.ZodObject<z.objectUtil.extendShape<z
8818
8580
  }, {
8819
8581
  id: z.ZodString;
8820
8582
  }>, {
8821
- type: z.ZodLiteral<"ButtonGroup">;
8822
- /**
8823
- * The alignment of the button group.
8824
- *
8825
- * @defaultValue `"end"`
8826
- */
8827
- align: z.ZodOptional<z.ZodEnum<["start", "end"]>>;
8828
- items: z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
8829
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8830
- id: z.ZodString;
8831
- }, "strip", z.ZodTypeAny, {
8832
- id: string;
8833
- }, {
8834
- id: string;
8835
- }>], z.ZodUnknown>, z.ZodVoid>>;
8836
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8837
- id: z.ZodString;
8838
- }, "strip", z.ZodTypeAny, {
8839
- id: string;
8840
- }, {
8841
- id: string;
8842
- }>], z.ZodUnknown>, z.ZodVoid>>;
8843
- }, {
8844
- id: z.ZodString;
8845
- }>, {
8846
- type: z.ZodLiteral<"Button">;
8847
- label: z.ZodString;
8848
- variant: z.ZodOptional<z.ZodEnum<["filled", "transparent", "outlined"]>>;
8849
- tint: z.ZodOptional<z.ZodEnum<["default", "primary", "accent", "danger"]>>;
8850
- disabled: z.ZodOptional<z.ZodBoolean>;
8851
- onClick: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8852
- id: z.ZodString;
8853
- }, "strip", z.ZodTypeAny, {
8854
- id: string;
8855
- }, {
8856
- id: string;
8857
- }>], z.ZodUnknown>, z.ZodVoid>;
8858
- }>, "strip", z.ZodTypeAny, {
8859
- type: "Button";
8860
- id: string;
8861
- label: string;
8862
- onClick: (args_0: {
8863
- id: string;
8864
- }, ...args: unknown[]) => void;
8865
- onCreate?: ((args_0: {
8866
- id: string;
8867
- }, ...args: unknown[]) => void) | undefined;
8868
- onDestroy?: ((args_0: {
8869
- id: string;
8870
- }, ...args: unknown[]) => void) | undefined;
8871
- disabled?: boolean | undefined;
8872
- variant?: "filled" | "transparent" | "outlined" | undefined;
8873
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
8874
- }, {
8875
- type: "Button";
8876
- id: string;
8877
- label: string;
8878
- onClick: (args_0: {
8879
- id: string;
8880
- }, ...args: unknown[]) => void;
8881
- onCreate?: ((args_0: {
8882
- id: string;
8883
- }, ...args: unknown[]) => void) | undefined;
8884
- onDestroy?: ((args_0: {
8885
- id: string;
8886
- }, ...args: unknown[]) => void) | undefined;
8887
- disabled?: boolean | undefined;
8888
- variant?: "filled" | "transparent" | "outlined" | undefined;
8889
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
8890
- }>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
8891
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8892
- id: z.ZodString;
8893
- }, "strip", z.ZodTypeAny, {
8894
- id: string;
8895
- }, {
8896
- id: string;
8897
- }>], z.ZodUnknown>, z.ZodVoid>>;
8898
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8899
- id: z.ZodString;
8900
- }, "strip", z.ZodTypeAny, {
8901
- id: string;
8902
- }, {
8903
- id: string;
8904
- }>], z.ZodUnknown>, z.ZodVoid>>;
8905
- }, {
8906
- id: z.ZodString;
8907
- }>, {
8908
- type: z.ZodLiteral<"Text">;
8909
- content: z.ZodString;
8910
- }>, "strip", z.ZodTypeAny, {
8911
- type: "Text";
8912
- id: string;
8913
- content: string;
8914
- onCreate?: ((args_0: {
8915
- id: string;
8916
- }, ...args: unknown[]) => void) | undefined;
8917
- onDestroy?: ((args_0: {
8918
- id: string;
8919
- }, ...args: unknown[]) => void) | undefined;
8920
- }, {
8921
- type: "Text";
8922
- id: string;
8923
- content: string;
8924
- onCreate?: ((args_0: {
8925
- id: string;
8926
- }, ...args: unknown[]) => void) | undefined;
8927
- onDestroy?: ((args_0: {
8928
- id: string;
8929
- }, ...args: unknown[]) => void) | undefined;
8930
- }>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
8931
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8932
- id: z.ZodString;
8933
- }, "strip", z.ZodTypeAny, {
8934
- id: string;
8935
- }, {
8936
- id: string;
8937
- }>], z.ZodUnknown>, z.ZodVoid>>;
8938
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8939
- id: z.ZodString;
8940
- }, "strip", z.ZodTypeAny, {
8941
- id: string;
8942
- }, {
8943
- id: string;
8944
- }>], z.ZodUnknown>, z.ZodVoid>>;
8945
- }, {
8946
- id: z.ZodString;
8947
- }>, {
8948
- type: z.ZodLiteral<"FlexibleSpace">;
8949
- }>, "strip", z.ZodTypeAny, {
8950
- type: "FlexibleSpace";
8951
- id: string;
8952
- onCreate?: ((args_0: {
8953
- id: string;
8954
- }, ...args: unknown[]) => void) | undefined;
8955
- onDestroy?: ((args_0: {
8956
- id: string;
8957
- }, ...args: unknown[]) => void) | undefined;
8958
- }, {
8959
- type: "FlexibleSpace";
8960
- id: string;
8961
- onCreate?: ((args_0: {
8962
- id: string;
8963
- }, ...args: unknown[]) => void) | undefined;
8964
- onDestroy?: ((args_0: {
8965
- id: string;
8966
- }, ...args: unknown[]) => void) | undefined;
8967
- }>]>, "many">;
8583
+ type: z.ZodLiteral<"Divider">;
8968
8584
  }>, "strip", z.ZodTypeAny, {
8969
- type: "ButtonGroup";
8585
+ type: "Divider";
8970
8586
  id: string;
8971
- items: ({
8972
- type: "Button";
8973
- id: string;
8974
- label: string;
8975
- onClick: (args_0: {
8976
- id: string;
8977
- }, ...args: unknown[]) => void;
8978
- onCreate?: ((args_0: {
8979
- id: string;
8980
- }, ...args: unknown[]) => void) | undefined;
8981
- onDestroy?: ((args_0: {
8982
- id: string;
8983
- }, ...args: unknown[]) => void) | undefined;
8984
- disabled?: boolean | undefined;
8985
- variant?: "filled" | "transparent" | "outlined" | undefined;
8986
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
8987
- } | {
8988
- type: "Text";
8989
- id: string;
8990
- content: string;
8991
- onCreate?: ((args_0: {
8992
- id: string;
8993
- }, ...args: unknown[]) => void) | undefined;
8994
- onDestroy?: ((args_0: {
8995
- id: string;
8996
- }, ...args: unknown[]) => void) | undefined;
8997
- } | {
8998
- type: "FlexibleSpace";
8999
- id: string;
9000
- onCreate?: ((args_0: {
9001
- id: string;
9002
- }, ...args: unknown[]) => void) | undefined;
9003
- onDestroy?: ((args_0: {
9004
- id: string;
9005
- }, ...args: unknown[]) => void) | undefined;
9006
- })[];
9007
- align?: "start" | "end" | undefined;
9008
8587
  onCreate?: ((args_0: {
9009
8588
  id: string;
9010
8589
  }, ...args: unknown[]) => void) | undefined;
9011
8590
  onDestroy?: ((args_0: {
9012
8591
  id: string;
9013
- }, ...args: unknown[]) => void) | undefined;
9014
- }, {
9015
- type: "ButtonGroup";
9016
- id: string;
9017
- items: ({
9018
- type: "Button";
9019
- id: string;
9020
- label: string;
9021
- onClick: (args_0: {
9022
- id: string;
9023
- }, ...args: unknown[]) => void;
9024
- onCreate?: ((args_0: {
9025
- id: string;
9026
- }, ...args: unknown[]) => void) | undefined;
9027
- onDestroy?: ((args_0: {
9028
- id: string;
9029
- }, ...args: unknown[]) => void) | undefined;
9030
- disabled?: boolean | undefined;
9031
- variant?: "filled" | "transparent" | "outlined" | undefined;
9032
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
9033
- } | {
9034
- type: "Text";
9035
- id: string;
9036
- content: string;
9037
- onCreate?: ((args_0: {
9038
- id: string;
9039
- }, ...args: unknown[]) => void) | undefined;
9040
- onDestroy?: ((args_0: {
9041
- id: string;
9042
- }, ...args: unknown[]) => void) | undefined;
9043
- } | {
9044
- type: "FlexibleSpace";
9045
- id: string;
9046
- onCreate?: ((args_0: {
9047
- id: string;
9048
- }, ...args: unknown[]) => void) | undefined;
9049
- onDestroy?: ((args_0: {
9050
- id: string;
9051
- }, ...args: unknown[]) => void) | undefined;
9052
- })[];
9053
- align?: "start" | "end" | undefined;
8592
+ }, ...args: unknown[]) => void) | undefined;
8593
+ }, {
8594
+ type: "Divider";
8595
+ id: string;
9054
8596
  onCreate?: ((args_0: {
9055
8597
  id: string;
9056
8598
  }, ...args: unknown[]) => void) | undefined;
@@ -9059,60 +8601,50 @@ declare const uiButtonGroupElementSchema: z.ZodObject<z.objectUtil.extendShape<z
9059
8601
  }, ...args: unknown[]) => void) | undefined;
9060
8602
  }>;
9061
8603
  /**
9062
- * Represents a button group element in a panel.
9063
- * A button group is an horizontal container of buttons and text elements.
8604
+ * Represents a divider element in a panel.
8605
+ * This element is used to separate other elements in a panel.
8606
+ * It is rendered as a gray horizontal line of 1px height.
9064
8607
  *
9065
8608
  * @example
9066
- * Thanks to the FlexibleSpace element, button 1 and text 1 are aligned to the start of the panel,
9067
- * while button 2 is aligned to the end.
9068
- *
8609
+ * Divider element is useful to separate sections of a panel.
9069
8610
  * ```typescript
9070
8611
  * {
9071
- * type: "ButtonGroup",
9072
- * items: [
9073
- * { type: "Button", label: "Button 1", onClick: () => {} },
9074
- * { type: "Text", content: "Text 1" },
9075
- * { type: "FlexibleSpace" },
9076
- * { type: "Button", label: "Button 2", onClick: () => {} },
8612
+ * body: [
8613
+ * { type: "Text", content: "Contact" },
8614
+ * { type: "TextInput", placeholder: "Enter your name", ... },
8615
+ * { type: "TextInput", placeholder: "Enter your email", ... },
8616
+ * { type: "Divider" },
8617
+ * { type: "Text", content: "Address" },
8618
+ * { type: "TextInput", placeholder: "Enter your address", ... },
9077
8619
  * ],
9078
8620
  * }
9079
8621
  * ```
9080
8622
  */
9081
- interface UIButtonGroupElement extends UIElementBase, Omit<zInfer<typeof uiButtonGroupElementSchema>, "onCreate" | "onDestroy"> {
9082
- /**
9083
- * The items to add to the button group.
9084
- */
9085
- items: Array<UIButtonElement | UITextElement | UIFlexibleSpaceElement>;
8623
+ interface UIDividerElement extends UIElementBase, Omit<zInfer<typeof uiDividerElementSchema>, "onCreate" | "onDestroy"> {
9086
8624
  }
9087
8625
  /**
9088
- * The parameters for creating a button group element.
8626
+ * The parameters for creating a divider element.
9089
8627
  *
9090
- * See {@link UIButtonGroupElement} for more details.
8628
+ * See {@link UIDividerElement} for more details.
9091
8629
  *
9092
8630
  * @remarks
9093
- * `id` is optional but recommended if you want to be able to perform updates.
8631
+ * `id` is optional but recommended if you want to be able to delete the element.
9094
8632
  */
9095
- interface UIButtonGroupElementCreate extends Omit<UIButtonGroupElement, "id" | "items">, UIElementBaseCreateParams {
9096
- /**
9097
- * The items to add to the button group.
9098
- */
9099
- items: Array<UIButtonElementCreate | UITextElementCreate | UIFlexibleSpaceElementCreate>;
8633
+ interface UIDividerElementCreate extends Omit<UIDividerElement, "id">, UIElementBaseCreateParams {
9100
8634
  }
9101
- type UIButtonGroupElementCreateClonable = Omit<MakeClonableSchema<UIButtonGroupElementCreate>, "items"> & {
9102
- items: Array<UIButtonElementCreateClonable | UITextElementCreateClonable | UIFlexibleSpaceElementCreateClonable>;
9103
- };
8635
+ type UIDividerElementCreateClonable = MakeClonableSchema<UIDividerElementCreate>;
9104
8636
  /**
9105
- * The parameters for updating a button group element.
8637
+ * The parameters for updating a divider element.
9106
8638
  *
9107
- * See {@link UIButtonGroupElement} for more details.
8639
+ * See {@link UIDividerElement} for more details.
9108
8640
  *
9109
8641
  * @remarks
9110
- * `id` and `type` are required to update the button group element.
8642
+ * `id` and `type` are required to identify the element to update.
9111
8643
  */
9112
- interface UIButtonGroupElementUpdate extends MakeUpdateSchema<UIButtonGroupElement, UIButtonGroupElementCreate> {
8644
+ interface UIDividerElementUpdate extends MakeUpdateSchema<UIDividerElement, UIDividerElementCreate> {
9113
8645
  }
9114
8646
 
9115
- declare const uiDividerElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
8647
+ declare const uiFlexibleSpaceElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
9116
8648
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9117
8649
  id: z.ZodString;
9118
8650
  }, "strip", z.ZodTypeAny, {
@@ -9130,9 +8662,9 @@ declare const uiDividerElementSchema: z.ZodObject<z.objectUtil.extendShape<z.obj
9130
8662
  }, {
9131
8663
  id: z.ZodString;
9132
8664
  }>, {
9133
- type: z.ZodLiteral<"Divider">;
8665
+ type: z.ZodLiteral<"FlexibleSpace">;
9134
8666
  }>, "strip", z.ZodTypeAny, {
9135
- type: "Divider";
8667
+ type: "FlexibleSpace";
9136
8668
  id: string;
9137
8669
  onCreate?: ((args_0: {
9138
8670
  id: string;
@@ -9141,7 +8673,7 @@ declare const uiDividerElementSchema: z.ZodObject<z.objectUtil.extendShape<z.obj
9141
8673
  id: string;
9142
8674
  }, ...args: unknown[]) => void) | undefined;
9143
8675
  }, {
9144
- type: "Divider";
8676
+ type: "FlexibleSpace";
9145
8677
  id: string;
9146
8678
  onCreate?: ((args_0: {
9147
8679
  id: string;
@@ -9151,47 +8683,60 @@ declare const uiDividerElementSchema: z.ZodObject<z.objectUtil.extendShape<z.obj
9151
8683
  }, ...args: unknown[]) => void) | undefined;
9152
8684
  }>;
9153
8685
  /**
9154
- * Represents a divider element in a panel.
9155
- * This element is used to separate other elements in a panel.
9156
- * It is rendered as a gray horizontal line of 1px height.
8686
+ * Represents a flexible space element in a container.
8687
+ *
8688
+ * When rendered...
8689
+ *
8690
+ * - inside {@link UIGridContainerElement}, it will add extra gap between items. It can be controlled by `grid` property.
8691
+ * - inside {@link UIPanelElement} `body` or `footer`, since they work as vertically stacks, it will add extra gap between items.
9157
8692
  *
9158
8693
  * @example
9159
- * Divider element is useful to separate sections of a panel.
8694
+ * Paragraphs with a flexible space between makes them more visually separated.
9160
8695
  * ```typescript
9161
8696
  * {
8697
+ * type: "Panel",
9162
8698
  * body: [
9163
- * { type: "Text", content: "Contact" },
9164
- * { type: "TextInput", placeholder: "Enter your name", ... },
9165
- * { type: "TextInput", placeholder: "Enter your email", ... },
9166
- * { type: "Divider" },
9167
- * { type: "Text", content: "Address" },
9168
- * { type: "TextInput", placeholder: "Enter your address", ... },
8699
+ * { type: "Paragraph", text: "Paragraph 1" },
8700
+ * { type: "FlexibleSpace" },
8701
+ * { type: "Paragraph", text: "Paragraph 2" },
8702
+ * ],
8703
+ * }
8704
+ * ```
8705
+ *
8706
+ * @example
8707
+ * Horizontal stack of buttons with a flexible space between makes them more visually separated.
8708
+ * ```typescript
8709
+ * {
8710
+ * type: "Grid",
8711
+ * grid: "auto-flow / auto 1fr auto",
8712
+ * items: [
8713
+ * { type: "Button", label: "Button 1", onClick: () => {} },
8714
+ * { type: "FlexibleSpace" },
8715
+ * { type: "Button", label: "Button 2", onClick: () => {} },
9169
8716
  * ],
9170
8717
  * }
9171
8718
  * ```
9172
8719
  */
9173
- interface UIDividerElement extends UIElementBase, Omit<zInfer<typeof uiDividerElementSchema>, "onCreate" | "onDestroy"> {
8720
+ interface UIFlexibleSpaceElement extends UIElementBase, Omit<zInfer<typeof uiFlexibleSpaceElementSchema>, "onCreate" | "onDestroy"> {
9174
8721
  }
9175
8722
  /**
9176
- * The parameters for creating a divider element.
9177
- *
9178
- * See {@link UIDividerElement} for more details.
8723
+ * The parameters for creating a flexible space element.
9179
8724
  *
9180
8725
  * @remarks
9181
- * `id` is optional but recommended if you want to be able to delete the element.
8726
+ * `id` is optional but recommended if you want to be able to perform updates.
9182
8727
  */
9183
- interface UIDividerElementCreate extends Omit<UIDividerElement, "id">, UIElementBaseCreateParams {
8728
+ interface UIFlexibleSpaceElementCreate extends Omit<UIFlexibleSpaceElement, "id">, UIElementBaseCreateParams {
9184
8729
  }
9185
- type UIDividerElementCreateClonable = MakeClonableSchema<UIDividerElementCreate>;
8730
+ type UIFlexibleSpaceElementCreateClonable = MakeClonableSchema<UIFlexibleSpaceElementCreate>;
9186
8731
  /**
9187
- * The parameters for updating a divider element.
8732
+ * The parameters for updating a flexible space element.
9188
8733
  *
9189
- * See {@link UIDividerElement} for more details.
8734
+ * See {@link UIFlexibleSpaceElement} for more details.
9190
8735
  *
9191
8736
  * @remarks
9192
8737
  * `id` and `type` are required to identify the element to update.
9193
8738
  */
9194
- interface UIDividerElementUpdate extends MakeUpdateSchema<UIDividerElement, UIDividerElementCreate> {
8739
+ interface UIFlexibleSpaceElementUpdate extends MakeUpdateSchema<UIFlexibleSpaceElement, UIFlexibleSpaceElementCreate> {
9195
8740
  }
9196
8741
 
9197
8742
  declare const uiSelectElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
@@ -9319,6 +8864,22 @@ declare const uiSelectElementSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
9319
8864
  * ```
9320
8865
  *
9321
8866
  * @example
8867
+ * #### with label
8868
+ * `label` is displayed above the select and used for screen readers.
8869
+ * `placeholder` is displayed in the select when no value is selected.
8870
+ *
8871
+ * ```typescript
8872
+ * {
8873
+ * type: "Select",
8874
+ * label: "Fruit",
8875
+ * options: [{ label: "Apple", value: "apple" }, { label: "Banana", value: "banana" }],
8876
+ * value: undefined,
8877
+ * placeholder: "Select a fruit",
8878
+ * onChange: (args) => console.log(args.value),
8879
+ * }
8880
+ * ```
8881
+ *
8882
+ * @example
9322
8883
  * #### with search
9323
8884
  * ```typescript
9324
8885
  * {
@@ -9493,72 +9054,201 @@ declare const uiTextInputElementSchema: z.ZodObject<z.objectUtil.extendShape<z.o
9493
9054
  * ```
9494
9055
  *
9495
9056
  * @example
9496
- * #### with label
9057
+ * #### with label
9058
+ * ```typescript
9059
+ * {
9060
+ * type: "TextInput",
9061
+ * label: "Name",
9062
+ * value: "Hello",
9063
+ * onChange: (args) => console.log(args.value),
9064
+ * placeholder: "Enter your name",
9065
+ * }
9066
+ * ```
9067
+ */
9068
+ interface UITextInputElement extends UILabelReadyElement, Omit<zInfer<typeof uiTextInputElementSchema>, "onChange" | "onBlur" | "onFocus" | "onCreate" | "onDestroy"> {
9069
+ /**
9070
+ * The function to call when the value of the input changes.
9071
+ *
9072
+ * @param args - The arguments passed to the function.
9073
+ * @param args.value - The value of the input.
9074
+ * @param args.id - The id of the input element.
9075
+ */
9076
+ onChange?: (args: {
9077
+ value: string;
9078
+ id: string;
9079
+ }) => void;
9080
+ /**
9081
+ * The function to call when the input is blurred.
9082
+ *
9083
+ * @param args - The arguments passed to the function.
9084
+ * @param args.value - The value of the input.
9085
+ * @param args.id - The id of the input element.
9086
+ */
9087
+ onBlur?: (args: {
9088
+ value: string;
9089
+ id: string;
9090
+ }) => void;
9091
+ /**
9092
+ * The function to call when the input is focused.
9093
+ *
9094
+ * @param args - The arguments passed to the function.
9095
+ * @param args.value - The value of the input.
9096
+ * @param args.id - The id of the input element.
9097
+ */
9098
+ onFocus?: (args: {
9099
+ value: string;
9100
+ id: string;
9101
+ }) => void;
9102
+ }
9103
+ /**
9104
+ * The parameters for creating a text input element.
9105
+ *
9106
+ * See {@link UITextInputElement} for more details.
9107
+ *
9108
+ * @remarks
9109
+ * `id` is optional but recommended if you want to be able to perform updates.
9110
+ */
9111
+ interface UITextInputElementCreate extends Omit<UITextInputElement, "id">, UILabelReadyElementCreateParams {
9112
+ }
9113
+ type UITextInputElementCreateClonable = MakeClonableSchema<UITextInputElementCreate>;
9114
+ /**
9115
+ * The parameters for updating a text input element.
9116
+ *
9117
+ * See {@link UITextInputElement} for more details.
9118
+ *
9119
+ * @remarks
9120
+ * `id` and `type` are required to identify the element to update.
9121
+ */
9122
+ interface UITextInputElementUpdate extends MakeUpdateSchema<UITextInputElement, UITextInputElementCreate> {
9123
+ }
9124
+
9125
+ declare const uiTextElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
9126
+ onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9127
+ id: z.ZodString;
9128
+ }, "strip", z.ZodTypeAny, {
9129
+ id: string;
9130
+ }, {
9131
+ id: string;
9132
+ }>], z.ZodUnknown>, z.ZodVoid>>;
9133
+ onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9134
+ id: z.ZodString;
9135
+ }, "strip", z.ZodTypeAny, {
9136
+ id: string;
9137
+ }, {
9138
+ id: string;
9139
+ }>], z.ZodUnknown>, z.ZodVoid>>;
9140
+ }, {
9141
+ id: z.ZodString;
9142
+ }>, {
9143
+ type: z.ZodLiteral<"Text">;
9144
+ /**
9145
+ * The text to display in the element.
9146
+ */
9147
+ content: z.ZodString;
9148
+ }>, "strip", z.ZodTypeAny, {
9149
+ type: "Text";
9150
+ id: string;
9151
+ content: string;
9152
+ onCreate?: ((args_0: {
9153
+ id: string;
9154
+ }, ...args: unknown[]) => void) | undefined;
9155
+ onDestroy?: ((args_0: {
9156
+ id: string;
9157
+ }, ...args: unknown[]) => void) | undefined;
9158
+ }, {
9159
+ type: "Text";
9160
+ id: string;
9161
+ content: string;
9162
+ onCreate?: ((args_0: {
9163
+ id: string;
9164
+ }, ...args: unknown[]) => void) | undefined;
9165
+ onDestroy?: ((args_0: {
9166
+ id: string;
9167
+ }, ...args: unknown[]) => void) | undefined;
9168
+ }>;
9169
+ /**
9170
+ * Represents a text element in a panel.
9171
+ * Markdown is supported.
9172
+ *
9173
+ * @example
9174
+ * #### simple
9175
+ * ```typescript
9176
+ * {
9177
+ * type: "Text",
9178
+ * content: "Hello, world!",
9179
+ * }
9180
+ * ```
9181
+ *
9182
+ * @example
9183
+ * #### with links
9184
+ * ```typescript
9185
+ * {
9186
+ * type: "Text",
9187
+ * content: "Fill the form https://www.google.com.",
9188
+ * }
9189
+ * ```
9190
+ *
9191
+ * @example
9192
+ * #### markdown
9193
+ * ```typescript
9194
+ * {
9195
+ * type: "Text",
9196
+ * content: "**Hello**, _world_!",
9197
+ * }
9198
+ * ```
9199
+ *
9200
+ * @example
9201
+ * #### complex markdown
9202
+ * Complex markdown syntax is supported like tables, images, quotes, etc.
9497
9203
  * ```typescript
9498
9204
  * {
9499
- * type: "TextInput",
9500
- * label: "Name",
9501
- * value: "Hello",
9502
- * onChange: (args) => console.log(args.value),
9503
- * placeholder: "Enter your name",
9205
+ * type: "Text",
9206
+ * content: `
9207
+ *
9208
+ * ## Heading
9209
+ *
9210
+ * This is a paragraph.
9211
+ *
9212
+ * ### Subheading
9213
+ *
9214
+ * This is a paragraph.
9215
+ *
9216
+ * | Name | Age |
9217
+ * | ---- | --- |
9218
+ * | John | 25 |
9219
+ * | Jane | 30 |
9220
+ *
9221
+ * ![Image](https://via.placeholder.com/150)
9222
+ *
9223
+ * > This is a quote.
9224
+ *
9225
+ * [Link](https://www.google.com)
9226
+ * `,
9504
9227
  * }
9505
9228
  * ```
9506
9229
  */
9507
- interface UITextInputElement extends UILabelReadyElement, Omit<zInfer<typeof uiTextInputElementSchema>, "onChange" | "onBlur" | "onFocus" | "onCreate" | "onDestroy"> {
9508
- /**
9509
- * The function to call when the value of the input changes.
9510
- *
9511
- * @param args - The arguments passed to the function.
9512
- * @param args.value - The value of the input.
9513
- * @param args.id - The id of the input element.
9514
- */
9515
- onChange?: (args: {
9516
- value: string;
9517
- id: string;
9518
- }) => void;
9519
- /**
9520
- * The function to call when the input is blurred.
9521
- *
9522
- * @param args - The arguments passed to the function.
9523
- * @param args.value - The value of the input.
9524
- * @param args.id - The id of the input element.
9525
- */
9526
- onBlur?: (args: {
9527
- value: string;
9528
- id: string;
9529
- }) => void;
9530
- /**
9531
- * The function to call when the input is focused.
9532
- *
9533
- * @param args - The arguments passed to the function.
9534
- * @param args.value - The value of the input.
9535
- * @param args.id - The id of the input element.
9536
- */
9537
- onFocus?: (args: {
9538
- value: string;
9539
- id: string;
9540
- }) => void;
9230
+ interface UITextElement extends UIElementBase, Omit<zInfer<typeof uiTextElementSchema>, "onCreate" | "onDestroy"> {
9541
9231
  }
9542
9232
  /**
9543
- * The parameters for creating a text input element.
9233
+ * The parameters for creating a text element.
9544
9234
  *
9545
- * See {@link UITextInputElement} for more details.
9235
+ * See {@link UITextElement} for more details.
9546
9236
  *
9547
9237
  * @remarks
9548
9238
  * `id` is optional but recommended if you want to be able to perform updates.
9549
9239
  */
9550
- interface UITextInputElementCreate extends Omit<UITextInputElement, "id">, UILabelReadyElementCreateParams {
9240
+ interface UITextElementCreate extends Omit<UITextElement, "id">, UIElementBaseCreateParams {
9551
9241
  }
9552
- type UITextInputElementCreateClonable = MakeClonableSchema<UITextInputElementCreate>;
9242
+ type UITextElementCreateClonable = MakeClonableSchema<UITextElementCreate>;
9553
9243
  /**
9554
- * The parameters for updating a text input element.
9244
+ * The parameters for updating a text element.
9555
9245
  *
9556
- * See {@link UITextInputElement} for more details.
9246
+ * See {@link UITextElement} for more details.
9557
9247
  *
9558
9248
  * @remarks
9559
9249
  * `id` and `type` are required to identify the element to update.
9560
9250
  */
9561
- interface UITextInputElementUpdate extends MakeUpdateSchema<UITextInputElement, UITextInputElementCreate> {
9251
+ interface UITextElementUpdate extends MakeUpdateSchema<UITextElement, UITextElementCreate> {
9562
9252
  }
9563
9253
 
9564
9254
  type ItemCreateClonableType = Exclude<UIPanelElementCreateClonable, {
@@ -9702,22 +9392,22 @@ type UIGridContainerElementCreateClonable = Omit<MakeClonableSchema<UIGridContai
9702
9392
  interface UIGridContainerElementUpdate extends MakeUpdateSchema<UIGridContainerElement, UIGridContainerElementCreate> {
9703
9393
  }
9704
9394
 
9705
- type UIPanelElement = UIButtonElement | UITextElement | UIButtonGroupElement | UIDividerElement | UITextInputElement | UISelectElement | UIFlexibleSpaceElement | UIGridContainerElement;
9395
+ type UIPanelElement = UIButtonElement | UITextElement | UIDividerElement | UITextInputElement | UISelectElement | UIFlexibleSpaceElement | UIGridContainerElement;
9706
9396
  /**
9707
9397
  * This is a union of all the possible elements that can be created inside panel's body or footer.
9708
9398
  *
9709
9399
  * @remarks
9710
9400
  * For the sake of convenience, `id` is optional but recommended if you want to be able to perform updates.
9711
9401
  */
9712
- type UIPanelElementCreate = UIButtonElementCreate | UITextElementCreate | UIButtonGroupElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIGridContainerElementCreate;
9713
- type UIPanelElementCreateClonable = UIButtonElementCreateClonable | UITextElementCreateClonable | UIButtonGroupElementCreateClonable | UIDividerElementCreateClonable | UITextInputElementCreateClonable | UISelectElementCreateClonable | UIFlexibleSpaceElementCreateClonable | UIGridContainerElementCreateClonable;
9402
+ type UIPanelElementCreate = UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIGridContainerElementCreate;
9403
+ type UIPanelElementCreateClonable = UIButtonElementCreateClonable | UITextElementCreateClonable | UIDividerElementCreateClonable | UITextInputElementCreateClonable | UISelectElementCreateClonable | UIFlexibleSpaceElementCreateClonable | UIGridContainerElementCreateClonable;
9714
9404
  /**
9715
9405
  * This is a union of all the possible elements that can be updated inside panel's body or footer (excluding Divider and FlexibleSpace elements because they cannot be updated).
9716
9406
  *
9717
9407
  * @remarks
9718
9408
  * `id` and `type` are required to identify the element to update.
9719
9409
  */
9720
- type UIPanelElementUpdate = UIButtonElementUpdate | UITextElementUpdate | UIButtonGroupElementUpdate | UITextInputElementUpdate | UISelectElementUpdate | UIDividerElementUpdate | UIGridContainerElementUpdate | UIFlexibleSpaceElementUpdate;
9410
+ type UIPanelElementUpdate = UIButtonElementUpdate | UITextElementUpdate | UITextInputElementUpdate | UISelectElementUpdate | UIDividerElementUpdate | UIGridContainerElementUpdate | UIFlexibleSpaceElementUpdate;
9721
9411
 
9722
9412
  declare const placementForUiElementSchema: z.ZodUnion<[z.ZodObject<{
9723
9413
  after: z.ZodString;
@@ -9739,7 +9429,7 @@ declare const placementForUiElementSchema: z.ZodUnion<[z.ZodObject<{
9739
9429
  at: "start" | "end";
9740
9430
  }>]>;
9741
9431
  /**
9742
- * Used in {@link UiController.createPanel} to specify the position of a panel in the stack
9432
+ * Used in {@link UiController.createOrUpdatePanel} to specify the position of a panel in the stack
9743
9433
  * and in {@link UiController.createPanelElements} to specify the position of an element in a panel.
9744
9434
  *
9745
9435
  * In both cases, the default value is `{ at: "end" }`.
@@ -9772,7 +9462,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9772
9462
  /**
9773
9463
  * The elements to add to the panel body.
9774
9464
  */
9775
- body: z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">;
9465
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
9776
9466
  /**
9777
9467
  * The elements to add to the panel footer.
9778
9468
  */
@@ -9787,7 +9477,6 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9787
9477
  }>, "strip", z.ZodTypeAny, {
9788
9478
  type: "Panel";
9789
9479
  id: string;
9790
- body: UIPanelElement[];
9791
9480
  onCreate?: ((args_0: {
9792
9481
  id: string;
9793
9482
  }, ...args: unknown[]) => void) | undefined;
@@ -9795,6 +9484,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9795
9484
  id: string;
9796
9485
  }, ...args: unknown[]) => void) | undefined;
9797
9486
  title?: string | undefined;
9487
+ body?: UIPanelElement[] | undefined;
9798
9488
  footer?: UIPanelElement[] | undefined;
9799
9489
  onClickClose?: ((args_0: {
9800
9490
  id: string;
@@ -9802,7 +9492,6 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9802
9492
  }, {
9803
9493
  type: "Panel";
9804
9494
  id: string;
9805
- body: UIPanelElement[];
9806
9495
  onCreate?: ((args_0: {
9807
9496
  id: string;
9808
9497
  }, ...args: unknown[]) => void) | undefined;
@@ -9810,6 +9499,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9810
9499
  id: string;
9811
9500
  }, ...args: unknown[]) => void) | undefined;
9812
9501
  title?: string | undefined;
9502
+ body?: UIPanelElement[] | undefined;
9813
9503
  footer?: UIPanelElement[] | undefined;
9814
9504
  onClickClose?: ((args_0: {
9815
9505
  id: string;
@@ -9817,7 +9507,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9817
9507
  }>;
9818
9508
  /**
9819
9509
  * Represents a panel in the UI.
9820
- * It can be added to the map by using the {@link UiController.createPanel} method.
9510
+ * It can be added to the map by using the {@link UiController.createOrUpdatePanel} method.
9821
9511
  *
9822
9512
  * A panel is a container for other UI elements.
9823
9513
  * It can have a title, a body, a footer as well as a close button.
@@ -9835,8 +9525,6 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9835
9525
  *
9836
9526
  * #### Footer
9837
9527
  * Footer is sticky to the bottom of the panel, and can be used to add actions to the panel (e.g. save, cancel, etc.).
9838
- * Normally, it should contain a `ButtonGroup` element with a `Cancel` and `Save` button. Using `ButtonGroup` is recommended
9839
- * because it will automatically align the buttons to the end of the panel giving it a nice look.
9840
9528
  *
9841
9529
  * @example
9842
9530
  * #### basic
@@ -9869,20 +9557,32 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9869
9557
  * { type: "TextInput", label: "Last name", value: "", placeholder: "Doe", onChange: (value) => setLastName(value) },
9870
9558
  * ],
9871
9559
  * footer: [
9872
- * { type: "ButtonGroup", items: [
9873
- * { type: "Button", label: "Reset", onClick: () => alert("Reset") },
9874
- * { type: "Button", label: "Save", onClick: () => alert("Save") },
9875
- * ] },
9560
+ * {
9561
+ * type: "Grid",
9562
+ * grid: "auto-flow / 1fr auto auto",
9563
+ * items: [
9564
+ * { type: "FlexibleSpace" }, // this will make the buttons to be aligned to the end of the panel
9565
+ * { type: "Button", label: "Reset", onClick: () => alert("Reset") },
9566
+ * { type: "Button", label: "Save", onClick: () => alert("Save") },
9567
+ * ],
9568
+ * },
9876
9569
  * ],
9877
9570
  * }
9878
9571
  * ```
9879
9572
  *
9880
9573
  */
9881
- interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClickClose" | "body" | "footer" | "onCreate" | "onDestroy"> {
9574
+ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClickClose" | "body" | "footer" | "onCreate" | "onDestroy" | "id"> {
9575
+ /**
9576
+ * The ID of the panel obtained from {@link UiController.createPanelId}.
9577
+ *
9578
+ * @remarks
9579
+ * Custom IDs are not supported.
9580
+ */
9581
+ id: string;
9882
9582
  /**
9883
9583
  * The elements to add to the panel body.
9884
9584
  */
9885
- body: UIPanelElement[];
9585
+ body?: UIPanelElement[];
9886
9586
  /**
9887
9587
  * The elements to add to the panel footer.
9888
9588
  */
@@ -9900,7 +9600,7 @@ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onC
9900
9600
  declare const uiPanelCreateSchema: {
9901
9601
  params: z.ZodObject<z.objectUtil.extendShape<Omit<{
9902
9602
  type: z.ZodOptional<z.ZodLiteral<"Panel">>;
9903
- id: z.ZodOptional<z.ZodString>;
9603
+ id: z.ZodString;
9904
9604
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9905
9605
  id: z.ZodString;
9906
9606
  }, "strip", z.ZodTypeAny, {
@@ -9916,7 +9616,7 @@ declare const uiPanelCreateSchema: {
9916
9616
  id: string;
9917
9617
  }>], z.ZodUnknown>, z.ZodVoid>>;
9918
9618
  title: z.ZodOptional<z.ZodString>;
9919
- body: z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">;
9619
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
9920
9620
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
9921
9621
  onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9922
9622
  id: z.ZodString;
@@ -9926,12 +9626,11 @@ declare const uiPanelCreateSchema: {
9926
9626
  id: string;
9927
9627
  }>], z.ZodUnknown>, z.ZodVoid>>;
9928
9628
  }, "body" | "footer">, {
9929
- body: z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">;
9629
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
9930
9630
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
9931
9631
  }>, "strip", z.ZodTypeAny, {
9932
- body: UIPanelElementCreate[];
9632
+ id: string;
9933
9633
  type?: "Panel" | undefined;
9934
- id?: string | undefined;
9935
9634
  onCreate?: ((args_0: {
9936
9635
  id: string;
9937
9636
  }, ...args: unknown[]) => void) | undefined;
@@ -9939,14 +9638,14 @@ declare const uiPanelCreateSchema: {
9939
9638
  id: string;
9940
9639
  }, ...args: unknown[]) => void) | undefined;
9941
9640
  title?: string | undefined;
9641
+ body?: UIPanelElementCreate[] | undefined;
9942
9642
  footer?: UIPanelElementCreate[] | undefined;
9943
9643
  onClickClose?: ((args_0: {
9944
9644
  id: string;
9945
9645
  }, ...args: unknown[]) => void) | undefined;
9946
9646
  }, {
9947
- body: UIPanelElementCreate[];
9647
+ id: string;
9948
9648
  type?: "Panel" | undefined;
9949
- id?: string | undefined;
9950
9649
  onCreate?: ((args_0: {
9951
9650
  id: string;
9952
9651
  }, ...args: unknown[]) => void) | undefined;
@@ -9954,51 +9653,21 @@ declare const uiPanelCreateSchema: {
9954
9653
  id: string;
9955
9654
  }, ...args: unknown[]) => void) | undefined;
9956
9655
  title?: string | undefined;
9656
+ body?: UIPanelElementCreate[] | undefined;
9957
9657
  footer?: UIPanelElementCreate[] | undefined;
9958
9658
  onClickClose?: ((args_0: {
9959
9659
  id: string;
9960
9660
  }, ...args: unknown[]) => void) | undefined;
9961
9661
  }>;
9962
- clonable: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<Omit<{
9662
+ clonable: z.ZodObject<z.objectUtil.extendShape<{
9963
9663
  type: z.ZodOptional<z.ZodLiteral<"Panel">>;
9964
- id: z.ZodOptional<z.ZodString>;
9965
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9966
- id: z.ZodString;
9967
- }, "strip", z.ZodTypeAny, {
9968
- id: string;
9969
- }, {
9970
- id: string;
9971
- }>], z.ZodUnknown>, z.ZodVoid>>;
9972
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9973
- id: z.ZodString;
9974
- }, "strip", z.ZodTypeAny, {
9975
- id: string;
9976
- }, {
9977
- id: string;
9978
- }>], z.ZodUnknown>, z.ZodVoid>>;
9664
+ id: z.ZodString;
9665
+ onCreate: z.ZodOptional<z.ZodString>;
9666
+ onDestroy: z.ZodOptional<z.ZodString>;
9979
9667
  title: z.ZodOptional<z.ZodString>;
9980
- body: z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">;
9981
- footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
9982
- onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9983
- id: z.ZodString;
9984
- }, "strip", z.ZodTypeAny, {
9985
- id: string;
9986
- }, {
9987
- id: string;
9988
- }>], z.ZodUnknown>, z.ZodVoid>>;
9989
- }, "body" | "footer">, {
9990
- body: z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">;
9668
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
9991
9669
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
9992
- }>, z.objectUtil.extendShape<{
9993
- id: z.ZodOptional<z.ZodString>;
9994
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9995
- id: z.ZodString;
9996
- }, "strip", z.ZodTypeAny, {
9997
- id: string;
9998
- }, {
9999
- id: string;
10000
- }>], z.ZodUnknown>, z.ZodVoid>>;
10001
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9670
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10002
9671
  id: z.ZodString;
10003
9672
  }, "strip", z.ZodTypeAny, {
10004
9673
  id: string;
@@ -10006,46 +9675,40 @@ declare const uiPanelCreateSchema: {
10006
9675
  id: string;
10007
9676
  }>], z.ZodUnknown>, z.ZodVoid>>;
10008
9677
  }, {
10009
- onCreate: z.ZodOptional<z.ZodString>;
10010
- onDestroy: z.ZodOptional<z.ZodString>;
10011
- }>>, {
10012
9678
  onClickClose: z.ZodOptional<z.ZodString>;
10013
- body: z.ZodArray<z.ZodType<UIPanelElementCreateClonable, z.ZodTypeDef, UIPanelElementCreateClonable>, "many">;
9679
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreateClonable, z.ZodTypeDef, UIPanelElementCreateClonable>, "many">>;
10014
9680
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreateClonable, z.ZodTypeDef, UIPanelElementCreateClonable>, "many">>;
10015
9681
  }>, "strip", z.ZodTypeAny, {
10016
- body: UIPanelElementCreateClonable[];
9682
+ id: string;
10017
9683
  type?: "Panel" | undefined;
10018
- id?: string | undefined;
10019
9684
  onCreate?: string | undefined;
10020
9685
  onDestroy?: string | undefined;
10021
9686
  title?: string | undefined;
9687
+ body?: UIPanelElementCreateClonable[] | undefined;
10022
9688
  footer?: UIPanelElementCreateClonable[] | undefined;
10023
9689
  onClickClose?: string | undefined;
10024
9690
  }, {
10025
- body: UIPanelElementCreateClonable[];
9691
+ id: string;
10026
9692
  type?: "Panel" | undefined;
10027
- id?: string | undefined;
10028
9693
  onCreate?: string | undefined;
10029
9694
  onDestroy?: string | undefined;
10030
9695
  title?: string | undefined;
9696
+ body?: UIPanelElementCreateClonable[] | undefined;
10031
9697
  footer?: UIPanelElementCreateClonable[] | undefined;
10032
9698
  onClickClose?: string | undefined;
10033
9699
  }>;
10034
9700
  };
10035
9701
  /**
10036
- * The parameters for creating a panel by using {@link UiController.createPanel}.
9702
+ * The parameters for creating a panel by using {@link UiController.createOrUpdatePanel}.
10037
9703
  *
10038
9704
  * @see {@link UIPanel} for more information about panels.
10039
- *
10040
- * @remarks
10041
- * `id` is optional but recommended if you want to be able to perform updates.
10042
9705
  */
10043
- interface UIPanelCreate extends Omit<UIPanel, "id" | "body" | "footer" | "type">, UIElementBaseCreateParams {
9706
+ interface UIPanelCreateOrUpdate extends Omit<UIPanel, "body" | "footer" | "type">, Omit<UIElementBaseCreateParams, "id"> {
10044
9707
  type?: "Panel";
10045
9708
  /**
10046
9709
  * The elements to add to the panel body.
10047
9710
  */
10048
- body: UIPanelElementCreate[];
9711
+ body?: UIPanelElementCreate[];
10049
9712
  /**
10050
9713
  * The elements to add to the panel footer.
10051
9714
  */
@@ -10440,10 +10103,10 @@ declare const UpdateActionTriggerParamsSchema: z.ZodObject<{
10440
10103
  interface UpdateActionTriggerParams extends Omit<Partial<UIActionTriggerCreate>, "id"> {
10441
10104
  id: zInfer<typeof UpdateActionTriggerParamsSchema>["id"];
10442
10105
  }
10443
- declare const CreatePanelParamsSchema: z.ZodObject<{
10106
+ declare const CreateOrUpdatePanelParamsSchema: z.ZodObject<{
10444
10107
  panel: z.ZodObject<z.objectUtil.extendShape<Omit<{
10445
10108
  type: z.ZodOptional<z.ZodLiteral<"Panel">>;
10446
- id: z.ZodOptional<z.ZodString>;
10109
+ id: z.ZodString;
10447
10110
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10448
10111
  id: z.ZodString;
10449
10112
  }, "strip", z.ZodTypeAny, {
@@ -10459,7 +10122,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10459
10122
  id: string;
10460
10123
  }>], z.ZodUnknown>, z.ZodVoid>>;
10461
10124
  title: z.ZodOptional<z.ZodString>;
10462
- body: z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">;
10125
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
10463
10126
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
10464
10127
  onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10465
10128
  id: z.ZodString;
@@ -10469,12 +10132,11 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10469
10132
  id: string;
10470
10133
  }>], z.ZodUnknown>, z.ZodVoid>>;
10471
10134
  }, "body" | "footer">, {
10472
- body: z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">;
10135
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
10473
10136
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
10474
10137
  }>, "strip", z.ZodTypeAny, {
10475
- body: UIPanelElementCreate[];
10138
+ id: string;
10476
10139
  type?: "Panel" | undefined;
10477
- id?: string | undefined;
10478
10140
  onCreate?: ((args_0: {
10479
10141
  id: string;
10480
10142
  }, ...args: unknown[]) => void) | undefined;
@@ -10482,14 +10144,14 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10482
10144
  id: string;
10483
10145
  }, ...args: unknown[]) => void) | undefined;
10484
10146
  title?: string | undefined;
10147
+ body?: UIPanelElementCreate[] | undefined;
10485
10148
  footer?: UIPanelElementCreate[] | undefined;
10486
10149
  onClickClose?: ((args_0: {
10487
10150
  id: string;
10488
10151
  }, ...args: unknown[]) => void) | undefined;
10489
10152
  }, {
10490
- body: UIPanelElementCreate[];
10153
+ id: string;
10491
10154
  type?: "Panel" | undefined;
10492
- id?: string | undefined;
10493
10155
  onCreate?: ((args_0: {
10494
10156
  id: string;
10495
10157
  }, ...args: unknown[]) => void) | undefined;
@@ -10497,6 +10159,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10497
10159
  id: string;
10498
10160
  }, ...args: unknown[]) => void) | undefined;
10499
10161
  title?: string | undefined;
10162
+ body?: UIPanelElementCreate[] | undefined;
10500
10163
  footer?: UIPanelElementCreate[] | undefined;
10501
10164
  onClickClose?: ((args_0: {
10502
10165
  id: string;
@@ -10523,9 +10186,8 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10523
10186
  }>]>>;
10524
10187
  }, "strip", z.ZodTypeAny, {
10525
10188
  panel: {
10526
- body: UIPanelElementCreate[];
10189
+ id: string;
10527
10190
  type?: "Panel" | undefined;
10528
- id?: string | undefined;
10529
10191
  onCreate?: ((args_0: {
10530
10192
  id: string;
10531
10193
  }, ...args: unknown[]) => void) | undefined;
@@ -10533,6 +10195,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10533
10195
  id: string;
10534
10196
  }, ...args: unknown[]) => void) | undefined;
10535
10197
  title?: string | undefined;
10198
+ body?: UIPanelElementCreate[] | undefined;
10536
10199
  footer?: UIPanelElementCreate[] | undefined;
10537
10200
  onClickClose?: ((args_0: {
10538
10201
  id: string;
@@ -10547,9 +10210,8 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10547
10210
  } | undefined;
10548
10211
  }, {
10549
10212
  panel: {
10550
- body: UIPanelElementCreate[];
10213
+ id: string;
10551
10214
  type?: "Panel" | undefined;
10552
- id?: string | undefined;
10553
10215
  onCreate?: ((args_0: {
10554
10216
  id: string;
10555
10217
  }, ...args: unknown[]) => void) | undefined;
@@ -10557,6 +10219,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10557
10219
  id: string;
10558
10220
  }, ...args: unknown[]) => void) | undefined;
10559
10221
  title?: string | undefined;
10222
+ body?: UIPanelElementCreate[] | undefined;
10560
10223
  footer?: UIPanelElementCreate[] | undefined;
10561
10224
  onClickClose?: ((args_0: {
10562
10225
  id: string;
@@ -10571,26 +10234,21 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10571
10234
  } | undefined;
10572
10235
  }>;
10573
10236
  /**
10574
- * The parameters for adding a panel to the map by using {@link UiController.createPanel}.
10237
+ * The parameters for creating or updating a panel by using {@link UiController.createOrUpdatePanel}.
10575
10238
  *
10576
10239
  * @public
10577
10240
  */
10578
- interface CreatePanelParams extends zInfer<typeof CreatePanelParamsSchema> {
10241
+ interface CreateOrUpdatePanelParams extends zInfer<typeof CreateOrUpdatePanelParamsSchema> {
10579
10242
  /**
10580
10243
  * The panel to add.
10581
10244
  */
10582
- panel: UIPanelCreate;
10245
+ panel: UIPanelCreateOrUpdate;
10583
10246
  /**
10584
10247
  * The placement of the panel on the right sidebar stack.
10585
10248
  *
10586
10249
  * @defaultValue `{ at: "end" }`
10587
10250
  */
10588
- placement?: PlacementForUIElement;
10589
- }
10590
- /**
10591
- * @public
10592
- */
10593
- interface UpdatePanelParams extends Omit<Partial<UIPanelCreate>, "id">, UIElementBase {
10251
+ initialPlacement?: PlacementForUIElement;
10594
10252
  }
10595
10253
  declare const CreatePanelElementsParamsSchema: z.ZodObject<{
10596
10254
  panelId: z.ZodString;
@@ -10687,7 +10345,7 @@ interface CreatePanelElementsParams extends zInfer<typeof CreatePanelElementsPar
10687
10345
  /**
10688
10346
  * The section of the panel to add the element to.
10689
10347
  * It can be either one of the top-level sections of the panel (`"body"` or `"footer"`)
10690
- * or a specific container (like `ButtonGroup`) in the panel (`{ id: string }`).
10348
+ * or a specific container (like {@link UIGridContainerElement}) in the panel (`{ id: string }`).
10691
10349
  *
10692
10350
  * @defaultValue `"body"`
10693
10351
  */
@@ -10806,286 +10464,6 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
10806
10464
  id: string;
10807
10465
  }, ...args: unknown[]) => void) | undefined;
10808
10466
  content?: string | undefined;
10809
- }>, z.ZodObject<{
10810
- type: z.ZodLiteral<"ButtonGroup">;
10811
- id: z.ZodString;
10812
- align: z.ZodOptional<z.ZodOptional<z.ZodEnum<["start", "end"]>>>;
10813
- onCreate: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10814
- id: z.ZodString;
10815
- }, "strip", z.ZodTypeAny, {
10816
- id: string;
10817
- }, {
10818
- id: string;
10819
- }>], z.ZodUnknown>, z.ZodVoid>>>;
10820
- onDestroy: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10821
- id: z.ZodString;
10822
- }, "strip", z.ZodTypeAny, {
10823
- id: string;
10824
- }, {
10825
- id: string;
10826
- }>], z.ZodUnknown>, z.ZodVoid>>>;
10827
- items: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
10828
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10829
- id: z.ZodString;
10830
- }, "strip", z.ZodTypeAny, {
10831
- id: string;
10832
- }, {
10833
- id: string;
10834
- }>], z.ZodUnknown>, z.ZodVoid>>;
10835
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10836
- id: z.ZodString;
10837
- }, "strip", z.ZodTypeAny, {
10838
- id: string;
10839
- }, {
10840
- id: string;
10841
- }>], z.ZodUnknown>, z.ZodVoid>>;
10842
- }, {
10843
- id: z.ZodString;
10844
- }>, {
10845
- type: z.ZodLiteral<"Button">;
10846
- label: z.ZodString;
10847
- variant: z.ZodOptional<z.ZodEnum<["filled", "transparent", "outlined"]>>;
10848
- tint: z.ZodOptional<z.ZodEnum<["default", "primary", "accent", "danger"]>>;
10849
- disabled: z.ZodOptional<z.ZodBoolean>;
10850
- onClick: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10851
- id: z.ZodString;
10852
- }, "strip", z.ZodTypeAny, {
10853
- id: string;
10854
- }, {
10855
- id: string;
10856
- }>], z.ZodUnknown>, z.ZodVoid>;
10857
- }>, {
10858
- id: z.ZodOptional<z.ZodString>;
10859
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10860
- id: z.ZodString;
10861
- }, "strip", z.ZodTypeAny, {
10862
- id: string;
10863
- }, {
10864
- id: string;
10865
- }>], z.ZodUnknown>, z.ZodVoid>>;
10866
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10867
- id: z.ZodString;
10868
- }, "strip", z.ZodTypeAny, {
10869
- id: string;
10870
- }, {
10871
- id: string;
10872
- }>], z.ZodUnknown>, z.ZodVoid>>;
10873
- }>, "strip", z.ZodTypeAny, {
10874
- type: "Button";
10875
- label: string;
10876
- onClick: (args_0: {
10877
- id: string;
10878
- }, ...args: unknown[]) => void;
10879
- id?: string | undefined;
10880
- onCreate?: ((args_0: {
10881
- id: string;
10882
- }, ...args: unknown[]) => void) | undefined;
10883
- onDestroy?: ((args_0: {
10884
- id: string;
10885
- }, ...args: unknown[]) => void) | undefined;
10886
- disabled?: boolean | undefined;
10887
- variant?: "filled" | "transparent" | "outlined" | undefined;
10888
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
10889
- }, {
10890
- type: "Button";
10891
- label: string;
10892
- onClick: (args_0: {
10893
- id: string;
10894
- }, ...args: unknown[]) => void;
10895
- id?: string | undefined;
10896
- onCreate?: ((args_0: {
10897
- id: string;
10898
- }, ...args: unknown[]) => void) | undefined;
10899
- onDestroy?: ((args_0: {
10900
- id: string;
10901
- }, ...args: unknown[]) => void) | undefined;
10902
- disabled?: boolean | undefined;
10903
- variant?: "filled" | "transparent" | "outlined" | undefined;
10904
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
10905
- }>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
10906
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10907
- id: z.ZodString;
10908
- }, "strip", z.ZodTypeAny, {
10909
- id: string;
10910
- }, {
10911
- id: string;
10912
- }>], z.ZodUnknown>, z.ZodVoid>>;
10913
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10914
- id: z.ZodString;
10915
- }, "strip", z.ZodTypeAny, {
10916
- id: string;
10917
- }, {
10918
- id: string;
10919
- }>], z.ZodUnknown>, z.ZodVoid>>;
10920
- }, {
10921
- id: z.ZodString;
10922
- }>, {
10923
- type: z.ZodLiteral<"Text">;
10924
- content: z.ZodString;
10925
- }>, {
10926
- id: z.ZodOptional<z.ZodString>;
10927
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10928
- id: z.ZodString;
10929
- }, "strip", z.ZodTypeAny, {
10930
- id: string;
10931
- }, {
10932
- id: string;
10933
- }>], z.ZodUnknown>, z.ZodVoid>>;
10934
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10935
- id: z.ZodString;
10936
- }, "strip", z.ZodTypeAny, {
10937
- id: string;
10938
- }, {
10939
- id: string;
10940
- }>], z.ZodUnknown>, z.ZodVoid>>;
10941
- }>, "strip", z.ZodTypeAny, {
10942
- type: "Text";
10943
- content: string;
10944
- id?: string | undefined;
10945
- onCreate?: ((args_0: {
10946
- id: string;
10947
- }, ...args: unknown[]) => void) | undefined;
10948
- onDestroy?: ((args_0: {
10949
- id: string;
10950
- }, ...args: unknown[]) => void) | undefined;
10951
- }, {
10952
- type: "Text";
10953
- content: string;
10954
- id?: string | undefined;
10955
- onCreate?: ((args_0: {
10956
- id: string;
10957
- }, ...args: unknown[]) => void) | undefined;
10958
- onDestroy?: ((args_0: {
10959
- id: string;
10960
- }, ...args: unknown[]) => void) | undefined;
10961
- }>, z.ZodObject<{
10962
- type: z.ZodLiteral<"FlexibleSpace">;
10963
- id: z.ZodOptional<z.ZodString>;
10964
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10965
- id: z.ZodString;
10966
- }, "strip", z.ZodTypeAny, {
10967
- id: string;
10968
- }, {
10969
- id: string;
10970
- }>], z.ZodUnknown>, z.ZodVoid>>;
10971
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10972
- id: z.ZodString;
10973
- }, "strip", z.ZodTypeAny, {
10974
- id: string;
10975
- }, {
10976
- id: string;
10977
- }>], z.ZodUnknown>, z.ZodVoid>>;
10978
- }, "strip", z.ZodTypeAny, {
10979
- type: "FlexibleSpace";
10980
- id?: string | undefined;
10981
- onCreate?: ((args_0: {
10982
- id: string;
10983
- }, ...args: unknown[]) => void) | undefined;
10984
- onDestroy?: ((args_0: {
10985
- id: string;
10986
- }, ...args: unknown[]) => void) | undefined;
10987
- }, {
10988
- type: "FlexibleSpace";
10989
- id?: string | undefined;
10990
- onCreate?: ((args_0: {
10991
- id: string;
10992
- }, ...args: unknown[]) => void) | undefined;
10993
- onDestroy?: ((args_0: {
10994
- id: string;
10995
- }, ...args: unknown[]) => void) | undefined;
10996
- }>]>, "many">>;
10997
- }, z.UnknownKeysParam, z.ZodTypeAny, {
10998
- type: "ButtonGroup";
10999
- id: string;
11000
- align?: "start" | "end" | undefined;
11001
- items?: ({
11002
- type: "Button";
11003
- label: string;
11004
- onClick: (args_0: {
11005
- id: string;
11006
- }, ...args: unknown[]) => void;
11007
- id?: string | undefined;
11008
- onCreate?: ((args_0: {
11009
- id: string;
11010
- }, ...args: unknown[]) => void) | undefined;
11011
- onDestroy?: ((args_0: {
11012
- id: string;
11013
- }, ...args: unknown[]) => void) | undefined;
11014
- disabled?: boolean | undefined;
11015
- variant?: "filled" | "transparent" | "outlined" | undefined;
11016
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
11017
- } | {
11018
- type: "Text";
11019
- content: string;
11020
- id?: string | undefined;
11021
- onCreate?: ((args_0: {
11022
- id: string;
11023
- }, ...args: unknown[]) => void) | undefined;
11024
- onDestroy?: ((args_0: {
11025
- id: string;
11026
- }, ...args: unknown[]) => void) | undefined;
11027
- } | {
11028
- type: "FlexibleSpace";
11029
- id?: string | undefined;
11030
- onCreate?: ((args_0: {
11031
- id: string;
11032
- }, ...args: unknown[]) => void) | undefined;
11033
- onDestroy?: ((args_0: {
11034
- id: string;
11035
- }, ...args: unknown[]) => void) | undefined;
11036
- })[] | undefined;
11037
- onCreate?: ((args_0: {
11038
- id: string;
11039
- }, ...args: unknown[]) => void) | undefined;
11040
- onDestroy?: ((args_0: {
11041
- id: string;
11042
- }, ...args: unknown[]) => void) | undefined;
11043
- }, {
11044
- type: "ButtonGroup";
11045
- id: string;
11046
- align?: "start" | "end" | undefined;
11047
- items?: ({
11048
- type: "Button";
11049
- label: string;
11050
- onClick: (args_0: {
11051
- id: string;
11052
- }, ...args: unknown[]) => void;
11053
- id?: string | undefined;
11054
- onCreate?: ((args_0: {
11055
- id: string;
11056
- }, ...args: unknown[]) => void) | undefined;
11057
- onDestroy?: ((args_0: {
11058
- id: string;
11059
- }, ...args: unknown[]) => void) | undefined;
11060
- disabled?: boolean | undefined;
11061
- variant?: "filled" | "transparent" | "outlined" | undefined;
11062
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
11063
- } | {
11064
- type: "Text";
11065
- content: string;
11066
- id?: string | undefined;
11067
- onCreate?: ((args_0: {
11068
- id: string;
11069
- }, ...args: unknown[]) => void) | undefined;
11070
- onDestroy?: ((args_0: {
11071
- id: string;
11072
- }, ...args: unknown[]) => void) | undefined;
11073
- } | {
11074
- type: "FlexibleSpace";
11075
- id?: string | undefined;
11076
- onCreate?: ((args_0: {
11077
- id: string;
11078
- }, ...args: unknown[]) => void) | undefined;
11079
- onDestroy?: ((args_0: {
11080
- id: string;
11081
- }, ...args: unknown[]) => void) | undefined;
11082
- })[] | undefined;
11083
- onCreate?: ((args_0: {
11084
- id: string;
11085
- }, ...args: unknown[]) => void) | undefined;
11086
- onDestroy?: ((args_0: {
11087
- id: string;
11088
- }, ...args: unknown[]) => void) | undefined;
11089
10467
  }>, z.ZodObject<{
11090
10468
  type: z.ZodLiteral<"TextInput">;
11091
10469
  value: z.ZodOptional<z.ZodString>;
@@ -11355,11 +10733,11 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11355
10733
  id: string;
11356
10734
  }>], z.ZodUnknown>, z.ZodVoid>>>;
11357
10735
  grid: z.ZodOptional<z.ZodOptional<z.ZodString>>;
11358
- items: z.ZodOptional<z.ZodType<(UIButtonElementCreate | UITextElementCreate | UIButtonGroupElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[], z.ZodTypeDef, (UIButtonElementCreate | UITextElementCreate | UIButtonGroupElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[]>>;
10736
+ items: z.ZodOptional<z.ZodType<(UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[], z.ZodTypeDef, (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[]>>;
11359
10737
  }, z.UnknownKeysParam, z.ZodTypeAny, {
11360
10738
  type: "Grid";
11361
10739
  id: string;
11362
- items?: (UIButtonElementCreate | UITextElementCreate | UIButtonGroupElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
10740
+ items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
11363
10741
  onCreate?: ((args_0: {
11364
10742
  id: string;
11365
10743
  }, ...args: unknown[]) => void) | undefined;
@@ -11370,7 +10748,7 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11370
10748
  }, {
11371
10749
  type: "Grid";
11372
10750
  id: string;
11373
- items?: (UIButtonElementCreate | UITextElementCreate | UIButtonGroupElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
10751
+ items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
11374
10752
  onCreate?: ((args_0: {
11375
10753
  id: string;
11376
10754
  }, ...args: unknown[]) => void) | undefined;
@@ -11406,52 +10784,6 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11406
10784
  id: string;
11407
10785
  }, ...args: unknown[]) => void) | undefined;
11408
10786
  content?: string | undefined;
11409
- } | {
11410
- type: "ButtonGroup";
11411
- id: string;
11412
- align?: "start" | "end" | undefined;
11413
- items?: ({
11414
- type: "Button";
11415
- label: string;
11416
- onClick: (args_0: {
11417
- id: string;
11418
- }, ...args: unknown[]) => void;
11419
- id?: string | undefined;
11420
- onCreate?: ((args_0: {
11421
- id: string;
11422
- }, ...args: unknown[]) => void) | undefined;
11423
- onDestroy?: ((args_0: {
11424
- id: string;
11425
- }, ...args: unknown[]) => void) | undefined;
11426
- disabled?: boolean | undefined;
11427
- variant?: "filled" | "transparent" | "outlined" | undefined;
11428
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
11429
- } | {
11430
- type: "Text";
11431
- content: string;
11432
- id?: string | undefined;
11433
- onCreate?: ((args_0: {
11434
- id: string;
11435
- }, ...args: unknown[]) => void) | undefined;
11436
- onDestroy?: ((args_0: {
11437
- id: string;
11438
- }, ...args: unknown[]) => void) | undefined;
11439
- } | {
11440
- type: "FlexibleSpace";
11441
- id?: string | undefined;
11442
- onCreate?: ((args_0: {
11443
- id: string;
11444
- }, ...args: unknown[]) => void) | undefined;
11445
- onDestroy?: ((args_0: {
11446
- id: string;
11447
- }, ...args: unknown[]) => void) | undefined;
11448
- })[] | undefined;
11449
- onCreate?: ((args_0: {
11450
- id: string;
11451
- }, ...args: unknown[]) => void) | undefined;
11452
- onDestroy?: ((args_0: {
11453
- id: string;
11454
- }, ...args: unknown[]) => void) | undefined;
11455
10787
  } | {
11456
10788
  type: "TextInput";
11457
10789
  id: string;
@@ -11518,7 +10850,7 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11518
10850
  } | {
11519
10851
  type: "Grid";
11520
10852
  id: string;
11521
- items?: (UIButtonElementCreate | UITextElementCreate | UIButtonGroupElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
10853
+ items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
11522
10854
  onCreate?: ((args_0: {
11523
10855
  id: string;
11524
10856
  }, ...args: unknown[]) => void) | undefined;
@@ -11554,52 +10886,6 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11554
10886
  id: string;
11555
10887
  }, ...args: unknown[]) => void) | undefined;
11556
10888
  content?: string | undefined;
11557
- } | {
11558
- type: "ButtonGroup";
11559
- id: string;
11560
- align?: "start" | "end" | undefined;
11561
- items?: ({
11562
- type: "Button";
11563
- label: string;
11564
- onClick: (args_0: {
11565
- id: string;
11566
- }, ...args: unknown[]) => void;
11567
- id?: string | undefined;
11568
- onCreate?: ((args_0: {
11569
- id: string;
11570
- }, ...args: unknown[]) => void) | undefined;
11571
- onDestroy?: ((args_0: {
11572
- id: string;
11573
- }, ...args: unknown[]) => void) | undefined;
11574
- disabled?: boolean | undefined;
11575
- variant?: "filled" | "transparent" | "outlined" | undefined;
11576
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
11577
- } | {
11578
- type: "Text";
11579
- content: string;
11580
- id?: string | undefined;
11581
- onCreate?: ((args_0: {
11582
- id: string;
11583
- }, ...args: unknown[]) => void) | undefined;
11584
- onDestroy?: ((args_0: {
11585
- id: string;
11586
- }, ...args: unknown[]) => void) | undefined;
11587
- } | {
11588
- type: "FlexibleSpace";
11589
- id?: string | undefined;
11590
- onCreate?: ((args_0: {
11591
- id: string;
11592
- }, ...args: unknown[]) => void) | undefined;
11593
- onDestroy?: ((args_0: {
11594
- id: string;
11595
- }, ...args: unknown[]) => void) | undefined;
11596
- })[] | undefined;
11597
- onCreate?: ((args_0: {
11598
- id: string;
11599
- }, ...args: unknown[]) => void) | undefined;
11600
- onDestroy?: ((args_0: {
11601
- id: string;
11602
- }, ...args: unknown[]) => void) | undefined;
11603
10889
  } | {
11604
10890
  type: "TextInput";
11605
10891
  id: string;
@@ -11666,7 +10952,7 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11666
10952
  } | {
11667
10953
  type: "Grid";
11668
10954
  id: string;
11669
- items?: (UIButtonElementCreate | UITextElementCreate | UIButtonGroupElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
10955
+ items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
11670
10956
  onCreate?: ((args_0: {
11671
10957
  id: string;
11672
10958
  }, ...args: unknown[]) => void) | undefined;
@@ -11705,52 +10991,6 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11705
10991
  id: string;
11706
10992
  }, ...args: unknown[]) => void) | undefined;
11707
10993
  content?: string | undefined;
11708
- } | {
11709
- type: "ButtonGroup";
11710
- id: string;
11711
- align?: "start" | "end" | undefined;
11712
- items?: ({
11713
- type: "Button";
11714
- label: string;
11715
- onClick: (args_0: {
11716
- id: string;
11717
- }, ...args: unknown[]) => void;
11718
- id?: string | undefined;
11719
- onCreate?: ((args_0: {
11720
- id: string;
11721
- }, ...args: unknown[]) => void) | undefined;
11722
- onDestroy?: ((args_0: {
11723
- id: string;
11724
- }, ...args: unknown[]) => void) | undefined;
11725
- disabled?: boolean | undefined;
11726
- variant?: "filled" | "transparent" | "outlined" | undefined;
11727
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
11728
- } | {
11729
- type: "Text";
11730
- content: string;
11731
- id?: string | undefined;
11732
- onCreate?: ((args_0: {
11733
- id: string;
11734
- }, ...args: unknown[]) => void) | undefined;
11735
- onDestroy?: ((args_0: {
11736
- id: string;
11737
- }, ...args: unknown[]) => void) | undefined;
11738
- } | {
11739
- type: "FlexibleSpace";
11740
- id?: string | undefined;
11741
- onCreate?: ((args_0: {
11742
- id: string;
11743
- }, ...args: unknown[]) => void) | undefined;
11744
- onDestroy?: ((args_0: {
11745
- id: string;
11746
- }, ...args: unknown[]) => void) | undefined;
11747
- })[] | undefined;
11748
- onCreate?: ((args_0: {
11749
- id: string;
11750
- }, ...args: unknown[]) => void) | undefined;
11751
- onDestroy?: ((args_0: {
11752
- id: string;
11753
- }, ...args: unknown[]) => void) | undefined;
11754
10994
  } | {
11755
10995
  type: "TextInput";
11756
10996
  id: string;
@@ -11817,7 +11057,7 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11817
11057
  } | {
11818
11058
  type: "Grid";
11819
11059
  id: string;
11820
- items?: (UIButtonElementCreate | UITextElementCreate | UIButtonGroupElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
11060
+ items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
11821
11061
  onCreate?: ((args_0: {
11822
11062
  id: string;
11823
11063
  }, ...args: unknown[]) => void) | undefined;
@@ -11856,52 +11096,6 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11856
11096
  id: string;
11857
11097
  }, ...args: unknown[]) => void) | undefined;
11858
11098
  content?: string | undefined;
11859
- } | {
11860
- type: "ButtonGroup";
11861
- id: string;
11862
- align?: "start" | "end" | undefined;
11863
- items?: ({
11864
- type: "Button";
11865
- label: string;
11866
- onClick: (args_0: {
11867
- id: string;
11868
- }, ...args: unknown[]) => void;
11869
- id?: string | undefined;
11870
- onCreate?: ((args_0: {
11871
- id: string;
11872
- }, ...args: unknown[]) => void) | undefined;
11873
- onDestroy?: ((args_0: {
11874
- id: string;
11875
- }, ...args: unknown[]) => void) | undefined;
11876
- disabled?: boolean | undefined;
11877
- variant?: "filled" | "transparent" | "outlined" | undefined;
11878
- tint?: "default" | "primary" | "accent" | "danger" | undefined;
11879
- } | {
11880
- type: "Text";
11881
- content: string;
11882
- id?: string | undefined;
11883
- onCreate?: ((args_0: {
11884
- id: string;
11885
- }, ...args: unknown[]) => void) | undefined;
11886
- onDestroy?: ((args_0: {
11887
- id: string;
11888
- }, ...args: unknown[]) => void) | undefined;
11889
- } | {
11890
- type: "FlexibleSpace";
11891
- id?: string | undefined;
11892
- onCreate?: ((args_0: {
11893
- id: string;
11894
- }, ...args: unknown[]) => void) | undefined;
11895
- onDestroy?: ((args_0: {
11896
- id: string;
11897
- }, ...args: unknown[]) => void) | undefined;
11898
- })[] | undefined;
11899
- onCreate?: ((args_0: {
11900
- id: string;
11901
- }, ...args: unknown[]) => void) | undefined;
11902
- onDestroy?: ((args_0: {
11903
- id: string;
11904
- }, ...args: unknown[]) => void) | undefined;
11905
11099
  } | {
11906
11100
  type: "TextInput";
11907
11101
  id: string;
@@ -11968,7 +11162,7 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
11968
11162
  } | {
11969
11163
  type: "Grid";
11970
11164
  id: string;
11971
- items?: (UIButtonElementCreate | UITextElementCreate | UIButtonGroupElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
11165
+ items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate)[] | undefined;
11972
11166
  onCreate?: ((args_0: {
11973
11167
  id: string;
11974
11168
  }, ...args: unknown[]) => void) | undefined;
@@ -12220,29 +11414,44 @@ interface UiController {
12220
11414
  */
12221
11415
  deleteActionTrigger(id: string): void;
12222
11416
  /**
12223
- * Creates a panel on map's right sidebar.
11417
+ * Creates a panel ID.
11418
+ *
11419
+ * In order to create a panel using {@link createOrUpdatePanel}, you need to create a panel ID first.
11420
+ *
11421
+ * @example
11422
+ * ```typescript
11423
+ * const panelId = await felt.createPanelId();
11424
+ * ```
11425
+ */
11426
+ createPanelId(): Promise<string>;
11427
+ /**
11428
+ * Creates or updates a panel.
11429
+ *
11430
+ * Panels are rendered on map's right sidebar and are useful to extend Felt UI for your own use cases
11431
+ * (e.g. a form, a settings panel, etc.) using Felt UI elements (e.g. Text, Button, etc.).
11432
+ * This way it is possible to cover new use cases while keeping the user experience consistent with the rest of Felt.
12224
11433
  *
12225
- * Panels are useful to extend Felt UI for your own use cases (e.g. a form, a settings panel, etc.)
12226
- * by using Felt UI elements (e.g. Text, Button, etc.). This way the user experience is consistent
12227
- * with the rest of Felt.
11434
+ * A panel is identified by its ID and must come from {@link createPanelId}.
11435
+ * Custom IDs are not supported in order to prevent conflicts with other panels.
12228
11436
  *
12229
11437
  * Panels have two sections:
12230
11438
  * - `body` - Body of the panel, scrollable.
12231
11439
  * - `footer` - It sticks to the bottom of the panel, useful to add submit buttons.
12232
11440
  *
12233
- * By default, the panel will be added to the end of the stack but you can
12234
- * specify a placement to add it at a specific position in the stack.
11441
+ * Regarding panel placement, by default it is added to the end of the panels stack but you can
11442
+ * specify a different placement by using the `initialPlacement` parameter.
11443
+ * This placement cannot be updated later.
12235
11444
  *
12236
- * Once created, you can add elements to the panel by using the {@link createPanelElements} method or
12237
- * perform partial updates of elements by using the {@link updatePanelElements} method.
12238
- *
12239
- * When adding a panel, its id is optional as well as its elements' ids.
12240
- * It is recommended to provide an id for the panel and its elements to make
11445
+ * When adding a panel, its elements' ids are optional though it is recommended to make
12241
11446
  * it easier to update or delete them later.
12242
11447
  *
11448
+ * Once created, you can add elements to the panel by using the {@link createPanelElements} method,
11449
+ * perform partial updates of elements by using the {@link updatePanelElements} method or
11450
+ * delete elements by using the {@link deletePanelElements} method.
11451
+ *
12243
11452
  * @param args - The arguments for the method.
12244
11453
  * @param args.panel - The panel to add.
12245
- * @param args.placement - The placement of the panel. Optional. Defaults to `{ at: "end" }`.
11454
+ * @param args.initialPlacement - The placement of the panel when added. Optional. Defaults to `{ at: "end" }`.
12246
11455
  * - `{ at: "start" }` - Add the panel to the start of the stack.
12247
11456
  * - `{ at: "end" }` - Add the panel to the end of the stack.
12248
11457
  * - `{ after: "panel-1" }` - Add the panel after the panel with the id `panel-1`.
@@ -12250,9 +11459,11 @@ interface UiController {
12250
11459
  *
12251
11460
  * @example
12252
11461
  * ```typescript
12253
- * await felt.createPanel({
11462
+ * const id = await felt.createPanelId();
11463
+ *
11464
+ * await felt.createOrUpdatePanel({
12254
11465
  * panel: {
12255
- * id: "panel-1", // not required but useful for further updates
11466
+ * id,
12256
11467
  * title: "My Panel",
12257
11468
  * body: [
12258
11469
  * {
@@ -12275,32 +11486,11 @@ interface UiController {
12275
11486
  * },
12276
11487
  * ],
12277
11488
  * },
12278
- * placement: { at: "start" }, // add the panel to the start of the stack
12279
- * });
12280
- * ```
12281
- */
12282
- createPanel(args: CreatePanelParams): Promise<UIPanel>;
12283
- /**
12284
- * Updates a panel.
12285
- *
12286
- * Panel to update is identified by the `id` property.
12287
- *
12288
- * @remarks
12289
- * Properties provided will override the existing properties.
12290
- * Override is done at Panel level, so if you want to update a specific element,
12291
- * you need to provide the entire element. For partial updates of elements, use
12292
- * {@link updatePanelElements} instead.
12293
- *
12294
- * @param panel - The panel to update.
12295
- * @example
12296
- * ```typescript
12297
- * await felt.updatePanel({
12298
- * id: "panel-1",
12299
- * title: "A new title for my panel", // only title changes
11489
+ * initialPlacement: { at: "start" }, // when added, the panel will be added to the start of the stack
12300
11490
  * });
12301
11491
  * ```
12302
11492
  */
12303
- updatePanel(panel: UpdatePanelParams): Promise<UIPanel>;
11493
+ createOrUpdatePanel(args: CreateOrUpdatePanelParams): Promise<UIPanel>;
12304
11494
  /**
12305
11495
  * Deletes a panel.
12306
11496
  *
@@ -12336,7 +11526,7 @@ interface UiController {
12336
11526
  * @example
12337
11527
  * ```typescript
12338
11528
  * await felt.createPanelElements({
12339
- * panelId: "panel-1",
11529
+ * panelId,
12340
11530
  * elements: [
12341
11531
  * {
12342
11532
  * element: { type: "Text", content: "Hello, world!" },
@@ -12358,7 +11548,7 @@ interface UiController {
12358
11548
  * @example
12359
11549
  * ```typescript
12360
11550
  * await felt.updatePanelElements({
12361
- * panelId: "panel-1",
11551
+ * panelId,
12362
11552
  * elements: [
12363
11553
  * {
12364
11554
  * element: {
@@ -12381,7 +11571,7 @@ interface UiController {
12381
11571
  * @example
12382
11572
  * ```typescript
12383
11573
  * await felt.deletePanelElements({
12384
- * panelId: "panel-1",
11574
+ * panelId,
12385
11575
  * elements: ["element-1", "element-2"],
12386
11576
  * });
12387
11577
  * ```
@@ -12805,4 +11995,4 @@ interface FeltController extends ViewportController, UiController, LayersControl
12805
11995
  iframe: HTMLIFrameElement | null;
12806
11996
  }
12807
11997
 
12808
- export { type LayerChangeCallbackParams as $, type TextElementUpdate as A, type ElementsController as B, type CircleElementCreate as C, type MapInteractionEvent as D, type Element as E, type FeltController as F, type GetElementGroupsConstraint as G, type HighlighterElementCreate as H, type ImageElementCreate as I, type InteractionsController as J, type CreateLayersFromGeoJsonParams as K, type LinkElementRead as L, type MarkerElementCreate as M, type NoteElementCreate as N, type DataOnlyLayer as O, type PathElementCreate as P, type FeltTiledVectorSource as Q, type GeoJsonDataVectorSource as R, type GeoJsonFileVectorSource as S, type TextElementCreate as T, type UiControlsOptions as U, type ViewportCenterZoom as V, type GeoJsonUrlVectorSource as W, type GetLayerGroupsConstraint as X, type GetLayersConstraint as Y, type GetRenderedFeaturesConstraint as Z, type Layer as _, type CircleElementRead as a, type LngLatTuple as a$, type LayerCommon as a0, type LayerGroup as a1, type LayerGroupChangeCallbackParams as a2, type LayerProcessingStatus as a3, type LegendItem as a4, type LegendItemChangeCallbackParams as a5, type LegendItemIdentifier as a6, type LegendItemsConstraint as a7, type RasterBand as a8, type RasterLayer as a9, type GetLayerCategoriesParams as aA, type GetLayerHistogramBin as aB, type GetLayerHistogramParams as aC, type GetLayerPrecomputedCalculationParams as aD, type GridConfig as aE, type GridType as aF, type MultiAggregationConfig as aG, type PrecomputedAggregationMethod as aH, type ValueConfiguration as aI, type LayersController as aJ, type MapDetails as aK, type MiscController as aL, type ElementGroupNode as aM, type ElementNode as aN, type EntityNode as aO, type FeatureNode as aP, type FeatureSelection as aQ, type LayerGroupNode as aR, type LayerNode as aS, type SelectionController as aT, type FeltBoundary as aU, type FeltZoom as aV, type GeoJsonFeature as aW, type GeoJsonGeometry as aX, type GeoJsonProperties as aY, type LatLng as aZ, type LineStringGeometry as a_, type RasterLayerSource as aa, type UpdateLayerParams as ab, type VectorLayer as ac, type LayerFeature as ad, type RasterValue as ae, type LayerSchema as af, type LayerSchemaAttribute as ag, type LayerSchemaBooleanAttribute as ah, type LayerSchemaCommonAttribute as ai, type LayerSchemaDateAttribute as aj, type LayerSchemaDateTimeAttribute as ak, type LayerSchemaNumericAttribute as al, type LayerSchemaTextAttribute as am, type FilterExpression as an, type FilterLogicGate as ao, type FilterTernary as ap, type Filters as aq, type GeometryFilter as ar, type LayerBoundaries as as, type LayerFilters as at, type AggregatedGridConfig as au, type AggregationConfig as av, type AggregationMethod as aw, type CountGridConfig as ax, type GetLayerCalculationParams as ay, type GetLayerCategoriesGroup as az, type CircleElementUpdate as b, type UIActionTriggerCreate as b$, type MultiLineStringGeometry as b0, type MultiPointGeometry as b1, type MultiPolygonGeometry as b2, type PointGeometry as b3, type PolygonGeometry as b4, type SetVisibilityRequest as b5, type SortConfig as b6, type SortDirection as b7, type CircleToolSettings as b8, type ConfigurableToolType as b9, type UIButtonElement as bA, type UIButtonElementCreate as bB, type UIButtonElementUpdate as bC, type UITextElement as bD, type UITextElementCreate as bE, type UITextElementUpdate as bF, type UIButtonGroupElement as bG, type UIButtonGroupElementCreate as bH, type UIButtonGroupElementUpdate as bI, type UIFlexibleSpaceElement as bJ, type UIFlexibleSpaceElementCreate as bK, type UIFlexibleSpaceElementUpdate as bL, type UIDividerElement as bM, type UIDividerElementCreate as bN, type UIDividerElementUpdate as bO, type UITextInputElement as bP, type UITextInputElementCreate as bQ, type UITextInputElementUpdate as bR, type UISelectElement as bS, type UISelectElementCreate as bT, type UISelectElementUpdate as bU, type UIPanelElement as bV, type UIPanelElementCreate as bW, type UIPanelElementUpdate as bX, type UIGridContainerElement as bY, type UIGridContainerElementCreate as bZ, type UIGridContainerElementUpdate as b_, type HighlighterToolSettings as ba, type InputToolSettings as bb, type LineToolSettings as bc, type MarkerToolSettings as bd, type NoteToolSettings as be, type PinToolSettings as bf, type PlaceFrame as bg, type PlaceSymbol as bh, type PolygonToolSettings as bi, type RouteToolSettings as bj, type TextToolSettings as bk, type ToolSettingsChangeEvent as bl, type ToolSettingsMap as bm, type ToolType as bn, type ToolsController as bo, type CreateActionTriggerParams as bp, type CreatePanelElementsParams as bq, type CreatePanelParams as br, type DeletePanelElementsParams as bs, type UiOnMapInteractionsOptions as bt, type UpdateActionTriggerParams as bu, type UpdatePanelElementsParams as bv, type UpdatePanelParams as bw, type PlacementForUIElement as bx, type UIPanel as by, type UIPanelCreate as bz, type ElementChangeCallbackParams as c, type UiController as c0, type SetViewportCenterZoomParams as c1, type ViewportConstraints as c2, type ViewportFitBoundsParams as c3, type ViewportState as c4, type ViewportController as c5, type UnwrapPromise as c6, uiActionTriggerSchema as c7, type UIPanelElementCreateClonable as c8, uiPanelCreateSchema as c9, type UIButtonElementCreateClonable as ca, type MakeClonableSchema as cb, type UIButtonGroupElementCreateClonable as cc, type PromiseOrNot as cd, type UnionToIntersection as ce, type ElementCreate as d, type ElementGroup as e, type ElementGroupChangeCallbackParams as f, type ElementUpdate as g, type GetElementsConstraint as h, type HighlighterElementRead as i, type HighlighterElementUpdate as j, type ImageElementRead as k, type ImageElementUpdate as l, type MarkerElementRead as m, type MarkerElementUpdate as n, type NoteElementRead as o, type NoteElementUpdate as p, type PathElementRead as q, type PathElementUpdate as r, type PlaceElementCreate as s, type PlaceElementRead as t, type PlaceElementUpdate as u, type PolygonElementCreate as v, type PolygonElementRead as w, type PolygonElementUpdate as x, type TextElementRead as y, type zInfer as z };
11998
+ export { type LayerChangeCallbackParams as $, type TextElementUpdate as A, type ElementsController as B, type CircleElementCreate as C, type MapInteractionEvent as D, type Element as E, type FeltController as F, type GetElementGroupsConstraint as G, type HighlighterElementCreate as H, type ImageElementCreate as I, type InteractionsController as J, type CreateLayersFromGeoJsonParams as K, type LinkElementRead as L, type MarkerElementCreate as M, type NoteElementCreate as N, type DataOnlyLayer as O, type PathElementCreate as P, type FeltTiledVectorSource as Q, type GeoJsonDataVectorSource as R, type GeoJsonFileVectorSource as S, type TextElementCreate as T, type UiControlsOptions as U, type ViewportCenterZoom as V, type GeoJsonUrlVectorSource as W, type GetLayerGroupsConstraint as X, type GetLayersConstraint as Y, type GetRenderedFeaturesConstraint as Z, type Layer as _, type CircleElementRead as a, type LngLatTuple as a$, type LayerCommon as a0, type LayerGroup as a1, type LayerGroupChangeCallbackParams as a2, type LayerProcessingStatus as a3, type LegendItem as a4, type LegendItemChangeCallbackParams as a5, type LegendItemIdentifier as a6, type LegendItemsConstraint as a7, type RasterBand as a8, type RasterLayer as a9, type GetLayerCategoriesParams as aA, type GetLayerHistogramBin as aB, type GetLayerHistogramParams as aC, type GetLayerPrecomputedCalculationParams as aD, type GridConfig as aE, type GridType as aF, type MultiAggregationConfig as aG, type PrecomputedAggregationMethod as aH, type ValueConfiguration as aI, type LayersController as aJ, type MapDetails as aK, type MiscController as aL, type ElementGroupNode as aM, type ElementNode as aN, type EntityNode as aO, type FeatureNode as aP, type FeatureSelection as aQ, type LayerGroupNode as aR, type LayerNode as aS, type SelectionController as aT, type FeltBoundary as aU, type FeltZoom as aV, type GeoJsonFeature as aW, type GeoJsonGeometry as aX, type GeoJsonProperties as aY, type LatLng as aZ, type LineStringGeometry as a_, type RasterLayerSource as aa, type UpdateLayerParams as ab, type VectorLayer as ac, type LayerFeature as ad, type RasterValue as ae, type LayerSchema as af, type LayerSchemaAttribute as ag, type LayerSchemaBooleanAttribute as ah, type LayerSchemaCommonAttribute as ai, type LayerSchemaDateAttribute as aj, type LayerSchemaDateTimeAttribute as ak, type LayerSchemaNumericAttribute as al, type LayerSchemaTextAttribute as am, type FilterExpression as an, type FilterLogicGate as ao, type FilterTernary as ap, type Filters as aq, type GeometryFilter as ar, type LayerBoundaries as as, type LayerFilters as at, type AggregatedGridConfig as au, type AggregationConfig as av, type AggregationMethod as aw, type CountGridConfig as ax, type GetLayerCalculationParams as ay, type GetLayerCategoriesGroup as az, type CircleElementUpdate as b, type ViewportFitBoundsParams as b$, type MultiLineStringGeometry as b0, type MultiPointGeometry as b1, type MultiPolygonGeometry as b2, type PointGeometry as b3, type PolygonGeometry as b4, type SetVisibilityRequest as b5, type SortConfig as b6, type SortDirection as b7, type CircleToolSettings as b8, type ConfigurableToolType as b9, type UIButtonElementCreate as bA, type UIButtonElementUpdate as bB, type UITextElement as bC, type UITextElementCreate as bD, type UITextElementUpdate as bE, type UIFlexibleSpaceElement as bF, type UIFlexibleSpaceElementCreate as bG, type UIFlexibleSpaceElementUpdate as bH, type UIDividerElement as bI, type UIDividerElementCreate as bJ, type UIDividerElementUpdate as bK, type UITextInputElement as bL, type UITextInputElementCreate as bM, type UITextInputElementUpdate as bN, type UISelectElement as bO, type UISelectElementCreate as bP, type UISelectElementUpdate as bQ, type UIPanelElement as bR, type UIPanelElementCreate as bS, type UIPanelElementUpdate as bT, type UIGridContainerElement as bU, type UIGridContainerElementCreate as bV, type UIGridContainerElementUpdate as bW, type UIActionTriggerCreate as bX, type UiController as bY, type SetViewportCenterZoomParams as bZ, type ViewportConstraints as b_, type HighlighterToolSettings as ba, type InputToolSettings as bb, type LineToolSettings as bc, type MarkerToolSettings as bd, type NoteToolSettings as be, type PinToolSettings as bf, type PlaceFrame as bg, type PlaceSymbol as bh, type PolygonToolSettings as bi, type RouteToolSettings as bj, type TextToolSettings as bk, type ToolSettingsChangeEvent as bl, type ToolSettingsMap as bm, type ToolType as bn, type ToolsController as bo, type CreateActionTriggerParams as bp, type CreateOrUpdatePanelParams as bq, type CreatePanelElementsParams as br, type DeletePanelElementsParams as bs, type UiOnMapInteractionsOptions as bt, type UpdateActionTriggerParams as bu, type UpdatePanelElementsParams as bv, type PlacementForUIElement as bw, type UIPanel as bx, type UIPanelCreateOrUpdate as by, type UIButtonElement as bz, type ElementChangeCallbackParams as c, type ViewportState as c0, type ViewportController as c1, type UnwrapPromise as c2, uiActionTriggerSchema as c3, type UIPanelElementCreateClonable as c4, uiPanelCreateSchema as c5, type UIButtonElementCreateClonable as c6, type MakeClonableSchema as c7, type PromiseOrNot as c8, type UnionToIntersection as c9, type ElementCreate as d, type ElementGroup as e, type ElementGroupChangeCallbackParams as f, type ElementUpdate as g, type GetElementsConstraint as h, type HighlighterElementRead as i, type HighlighterElementUpdate as j, type ImageElementRead as k, type ImageElementUpdate as l, type MarkerElementRead as m, type MarkerElementUpdate as n, type NoteElementRead as o, type NoteElementUpdate as p, type PathElementRead as q, type PathElementUpdate as r, type PlaceElementCreate as s, type PlaceElementRead as t, type PlaceElementUpdate as u, type PolygonElementCreate as v, type PolygonElementRead as w, type PolygonElementUpdate as x, type TextElementRead as y, type zInfer as z };