@feltmaps/js-sdk 1.7.0-next.16 → 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.
@@ -8864,6 +8864,22 @@ declare const uiSelectElementSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
8864
8864
  * ```
8865
8865
  *
8866
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
8867
8883
  * #### with search
8868
8884
  * ```typescript
8869
8885
  * {
@@ -9413,7 +9429,7 @@ declare const placementForUiElementSchema: z.ZodUnion<[z.ZodObject<{
9413
9429
  at: "start" | "end";
9414
9430
  }>]>;
9415
9431
  /**
9416
- * 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
9417
9433
  * and in {@link UiController.createPanelElements} to specify the position of an element in a panel.
9418
9434
  *
9419
9435
  * In both cases, the default value is `{ at: "end" }`.
@@ -9446,7 +9462,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9446
9462
  /**
9447
9463
  * The elements to add to the panel body.
9448
9464
  */
9449
- body: z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">;
9465
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
9450
9466
  /**
9451
9467
  * The elements to add to the panel footer.
9452
9468
  */
@@ -9461,7 +9477,6 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9461
9477
  }>, "strip", z.ZodTypeAny, {
9462
9478
  type: "Panel";
9463
9479
  id: string;
9464
- body: UIPanelElement[];
9465
9480
  onCreate?: ((args_0: {
9466
9481
  id: string;
9467
9482
  }, ...args: unknown[]) => void) | undefined;
@@ -9469,6 +9484,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9469
9484
  id: string;
9470
9485
  }, ...args: unknown[]) => void) | undefined;
9471
9486
  title?: string | undefined;
9487
+ body?: UIPanelElement[] | undefined;
9472
9488
  footer?: UIPanelElement[] | undefined;
9473
9489
  onClickClose?: ((args_0: {
9474
9490
  id: string;
@@ -9476,7 +9492,6 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9476
9492
  }, {
9477
9493
  type: "Panel";
9478
9494
  id: string;
9479
- body: UIPanelElement[];
9480
9495
  onCreate?: ((args_0: {
9481
9496
  id: string;
9482
9497
  }, ...args: unknown[]) => void) | undefined;
@@ -9484,6 +9499,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9484
9499
  id: string;
9485
9500
  }, ...args: unknown[]) => void) | undefined;
9486
9501
  title?: string | undefined;
9502
+ body?: UIPanelElement[] | undefined;
9487
9503
  footer?: UIPanelElement[] | undefined;
9488
9504
  onClickClose?: ((args_0: {
9489
9505
  id: string;
@@ -9491,7 +9507,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9491
9507
  }>;
9492
9508
  /**
9493
9509
  * Represents a panel in the UI.
9494
- * 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.
9495
9511
  *
9496
9512
  * A panel is a container for other UI elements.
9497
9513
  * It can have a title, a body, a footer as well as a close button.
@@ -9555,11 +9571,18 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9555
9571
  * ```
9556
9572
  *
9557
9573
  */
9558
- 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;
9559
9582
  /**
9560
9583
  * The elements to add to the panel body.
9561
9584
  */
9562
- body: UIPanelElement[];
9585
+ body?: UIPanelElement[];
9563
9586
  /**
9564
9587
  * The elements to add to the panel footer.
9565
9588
  */
@@ -9577,7 +9600,7 @@ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onC
9577
9600
  declare const uiPanelCreateSchema: {
9578
9601
  params: z.ZodObject<z.objectUtil.extendShape<Omit<{
9579
9602
  type: z.ZodOptional<z.ZodLiteral<"Panel">>;
9580
- id: z.ZodOptional<z.ZodString>;
9603
+ id: z.ZodString;
9581
9604
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9582
9605
  id: z.ZodString;
9583
9606
  }, "strip", z.ZodTypeAny, {
@@ -9593,7 +9616,7 @@ declare const uiPanelCreateSchema: {
9593
9616
  id: string;
9594
9617
  }>], z.ZodUnknown>, z.ZodVoid>>;
9595
9618
  title: z.ZodOptional<z.ZodString>;
9596
- body: z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">;
9619
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
9597
9620
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
9598
9621
  onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9599
9622
  id: z.ZodString;
@@ -9603,12 +9626,11 @@ declare const uiPanelCreateSchema: {
9603
9626
  id: string;
9604
9627
  }>], z.ZodUnknown>, z.ZodVoid>>;
9605
9628
  }, "body" | "footer">, {
9606
- body: z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">;
9629
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
9607
9630
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
9608
9631
  }>, "strip", z.ZodTypeAny, {
9609
- body: UIPanelElementCreate[];
9632
+ id: string;
9610
9633
  type?: "Panel" | undefined;
9611
- id?: string | undefined;
9612
9634
  onCreate?: ((args_0: {
9613
9635
  id: string;
9614
9636
  }, ...args: unknown[]) => void) | undefined;
@@ -9616,14 +9638,14 @@ declare const uiPanelCreateSchema: {
9616
9638
  id: string;
9617
9639
  }, ...args: unknown[]) => void) | undefined;
9618
9640
  title?: string | undefined;
9641
+ body?: UIPanelElementCreate[] | undefined;
9619
9642
  footer?: UIPanelElementCreate[] | undefined;
9620
9643
  onClickClose?: ((args_0: {
9621
9644
  id: string;
9622
9645
  }, ...args: unknown[]) => void) | undefined;
9623
9646
  }, {
9624
- body: UIPanelElementCreate[];
9647
+ id: string;
9625
9648
  type?: "Panel" | undefined;
9626
- id?: string | undefined;
9627
9649
  onCreate?: ((args_0: {
9628
9650
  id: string;
9629
9651
  }, ...args: unknown[]) => void) | undefined;
@@ -9631,51 +9653,21 @@ declare const uiPanelCreateSchema: {
9631
9653
  id: string;
9632
9654
  }, ...args: unknown[]) => void) | undefined;
9633
9655
  title?: string | undefined;
9656
+ body?: UIPanelElementCreate[] | undefined;
9634
9657
  footer?: UIPanelElementCreate[] | undefined;
9635
9658
  onClickClose?: ((args_0: {
9636
9659
  id: string;
9637
9660
  }, ...args: unknown[]) => void) | undefined;
9638
9661
  }>;
9639
- clonable: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<Omit<{
9662
+ clonable: z.ZodObject<z.objectUtil.extendShape<{
9640
9663
  type: z.ZodOptional<z.ZodLiteral<"Panel">>;
9641
- id: z.ZodOptional<z.ZodString>;
9642
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9643
- id: z.ZodString;
9644
- }, "strip", z.ZodTypeAny, {
9645
- id: string;
9646
- }, {
9647
- id: string;
9648
- }>], z.ZodUnknown>, z.ZodVoid>>;
9649
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9650
- id: z.ZodString;
9651
- }, "strip", z.ZodTypeAny, {
9652
- id: string;
9653
- }, {
9654
- id: string;
9655
- }>], z.ZodUnknown>, z.ZodVoid>>;
9664
+ id: z.ZodString;
9665
+ onCreate: z.ZodOptional<z.ZodString>;
9666
+ onDestroy: z.ZodOptional<z.ZodString>;
9656
9667
  title: z.ZodOptional<z.ZodString>;
9657
- body: z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">;
9658
- footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
9659
- onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9660
- id: z.ZodString;
9661
- }, "strip", z.ZodTypeAny, {
9662
- id: string;
9663
- }, {
9664
- id: string;
9665
- }>], z.ZodUnknown>, z.ZodVoid>>;
9666
- }, "body" | "footer">, {
9667
- body: z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">;
9668
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
9668
9669
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
9669
- }>, z.objectUtil.extendShape<{
9670
- id: z.ZodOptional<z.ZodString>;
9671
- onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9672
- id: z.ZodString;
9673
- }, "strip", z.ZodTypeAny, {
9674
- id: string;
9675
- }, {
9676
- id: string;
9677
- }>], z.ZodUnknown>, z.ZodVoid>>;
9678
- onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9670
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
9679
9671
  id: z.ZodString;
9680
9672
  }, "strip", z.ZodTypeAny, {
9681
9673
  id: string;
@@ -9683,46 +9675,40 @@ declare const uiPanelCreateSchema: {
9683
9675
  id: string;
9684
9676
  }>], z.ZodUnknown>, z.ZodVoid>>;
9685
9677
  }, {
9686
- onCreate: z.ZodOptional<z.ZodString>;
9687
- onDestroy: z.ZodOptional<z.ZodString>;
9688
- }>>, {
9689
9678
  onClickClose: z.ZodOptional<z.ZodString>;
9690
- body: z.ZodArray<z.ZodType<UIPanelElementCreateClonable, z.ZodTypeDef, UIPanelElementCreateClonable>, "many">;
9679
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreateClonable, z.ZodTypeDef, UIPanelElementCreateClonable>, "many">>;
9691
9680
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreateClonable, z.ZodTypeDef, UIPanelElementCreateClonable>, "many">>;
9692
9681
  }>, "strip", z.ZodTypeAny, {
9693
- body: UIPanelElementCreateClonable[];
9682
+ id: string;
9694
9683
  type?: "Panel" | undefined;
9695
- id?: string | undefined;
9696
9684
  onCreate?: string | undefined;
9697
9685
  onDestroy?: string | undefined;
9698
9686
  title?: string | undefined;
9687
+ body?: UIPanelElementCreateClonable[] | undefined;
9699
9688
  footer?: UIPanelElementCreateClonable[] | undefined;
9700
9689
  onClickClose?: string | undefined;
9701
9690
  }, {
9702
- body: UIPanelElementCreateClonable[];
9691
+ id: string;
9703
9692
  type?: "Panel" | undefined;
9704
- id?: string | undefined;
9705
9693
  onCreate?: string | undefined;
9706
9694
  onDestroy?: string | undefined;
9707
9695
  title?: string | undefined;
9696
+ body?: UIPanelElementCreateClonable[] | undefined;
9708
9697
  footer?: UIPanelElementCreateClonable[] | undefined;
9709
9698
  onClickClose?: string | undefined;
9710
9699
  }>;
9711
9700
  };
9712
9701
  /**
9713
- * The parameters for creating a panel by using {@link UiController.createPanel}.
9702
+ * The parameters for creating a panel by using {@link UiController.createOrUpdatePanel}.
9714
9703
  *
9715
9704
  * @see {@link UIPanel} for more information about panels.
9716
- *
9717
- * @remarks
9718
- * `id` is optional but recommended if you want to be able to perform updates.
9719
9705
  */
9720
- interface UIPanelCreate extends Omit<UIPanel, "id" | "body" | "footer" | "type">, UIElementBaseCreateParams {
9706
+ interface UIPanelCreateOrUpdate extends Omit<UIPanel, "body" | "footer" | "type">, Omit<UIElementBaseCreateParams, "id"> {
9721
9707
  type?: "Panel";
9722
9708
  /**
9723
9709
  * The elements to add to the panel body.
9724
9710
  */
9725
- body: UIPanelElementCreate[];
9711
+ body?: UIPanelElementCreate[];
9726
9712
  /**
9727
9713
  * The elements to add to the panel footer.
9728
9714
  */
@@ -10117,10 +10103,10 @@ declare const UpdateActionTriggerParamsSchema: z.ZodObject<{
10117
10103
  interface UpdateActionTriggerParams extends Omit<Partial<UIActionTriggerCreate>, "id"> {
10118
10104
  id: zInfer<typeof UpdateActionTriggerParamsSchema>["id"];
10119
10105
  }
10120
- declare const CreatePanelParamsSchema: z.ZodObject<{
10106
+ declare const CreateOrUpdatePanelParamsSchema: z.ZodObject<{
10121
10107
  panel: z.ZodObject<z.objectUtil.extendShape<Omit<{
10122
10108
  type: z.ZodOptional<z.ZodLiteral<"Panel">>;
10123
- id: z.ZodOptional<z.ZodString>;
10109
+ id: z.ZodString;
10124
10110
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10125
10111
  id: z.ZodString;
10126
10112
  }, "strip", z.ZodTypeAny, {
@@ -10136,7 +10122,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10136
10122
  id: string;
10137
10123
  }>], z.ZodUnknown>, z.ZodVoid>>;
10138
10124
  title: z.ZodOptional<z.ZodString>;
10139
- body: z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">;
10125
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
10140
10126
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElement, z.ZodTypeDef, UIPanelElement>, "many">>;
10141
10127
  onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
10142
10128
  id: z.ZodString;
@@ -10146,12 +10132,11 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10146
10132
  id: string;
10147
10133
  }>], z.ZodUnknown>, z.ZodVoid>>;
10148
10134
  }, "body" | "footer">, {
10149
- body: z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">;
10135
+ body: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
10150
10136
  footer: z.ZodOptional<z.ZodArray<z.ZodType<UIPanelElementCreate, z.ZodTypeDef, UIPanelElementCreate>, "many">>;
10151
10137
  }>, "strip", z.ZodTypeAny, {
10152
- body: UIPanelElementCreate[];
10138
+ id: string;
10153
10139
  type?: "Panel" | undefined;
10154
- id?: string | undefined;
10155
10140
  onCreate?: ((args_0: {
10156
10141
  id: string;
10157
10142
  }, ...args: unknown[]) => void) | undefined;
@@ -10159,14 +10144,14 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10159
10144
  id: string;
10160
10145
  }, ...args: unknown[]) => void) | undefined;
10161
10146
  title?: string | undefined;
10147
+ body?: UIPanelElementCreate[] | undefined;
10162
10148
  footer?: UIPanelElementCreate[] | undefined;
10163
10149
  onClickClose?: ((args_0: {
10164
10150
  id: string;
10165
10151
  }, ...args: unknown[]) => void) | undefined;
10166
10152
  }, {
10167
- body: UIPanelElementCreate[];
10153
+ id: string;
10168
10154
  type?: "Panel" | undefined;
10169
- id?: string | undefined;
10170
10155
  onCreate?: ((args_0: {
10171
10156
  id: string;
10172
10157
  }, ...args: unknown[]) => void) | undefined;
@@ -10174,6 +10159,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10174
10159
  id: string;
10175
10160
  }, ...args: unknown[]) => void) | undefined;
10176
10161
  title?: string | undefined;
10162
+ body?: UIPanelElementCreate[] | undefined;
10177
10163
  footer?: UIPanelElementCreate[] | undefined;
10178
10164
  onClickClose?: ((args_0: {
10179
10165
  id: string;
@@ -10200,9 +10186,8 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10200
10186
  }>]>>;
10201
10187
  }, "strip", z.ZodTypeAny, {
10202
10188
  panel: {
10203
- body: UIPanelElementCreate[];
10189
+ id: string;
10204
10190
  type?: "Panel" | undefined;
10205
- id?: string | undefined;
10206
10191
  onCreate?: ((args_0: {
10207
10192
  id: string;
10208
10193
  }, ...args: unknown[]) => void) | undefined;
@@ -10210,6 +10195,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10210
10195
  id: string;
10211
10196
  }, ...args: unknown[]) => void) | undefined;
10212
10197
  title?: string | undefined;
10198
+ body?: UIPanelElementCreate[] | undefined;
10213
10199
  footer?: UIPanelElementCreate[] | undefined;
10214
10200
  onClickClose?: ((args_0: {
10215
10201
  id: string;
@@ -10224,9 +10210,8 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10224
10210
  } | undefined;
10225
10211
  }, {
10226
10212
  panel: {
10227
- body: UIPanelElementCreate[];
10213
+ id: string;
10228
10214
  type?: "Panel" | undefined;
10229
- id?: string | undefined;
10230
10215
  onCreate?: ((args_0: {
10231
10216
  id: string;
10232
10217
  }, ...args: unknown[]) => void) | undefined;
@@ -10234,6 +10219,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10234
10219
  id: string;
10235
10220
  }, ...args: unknown[]) => void) | undefined;
10236
10221
  title?: string | undefined;
10222
+ body?: UIPanelElementCreate[] | undefined;
10237
10223
  footer?: UIPanelElementCreate[] | undefined;
10238
10224
  onClickClose?: ((args_0: {
10239
10225
  id: string;
@@ -10248,26 +10234,21 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
10248
10234
  } | undefined;
10249
10235
  }>;
10250
10236
  /**
10251
- * 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}.
10252
10238
  *
10253
10239
  * @public
10254
10240
  */
10255
- interface CreatePanelParams extends zInfer<typeof CreatePanelParamsSchema> {
10241
+ interface CreateOrUpdatePanelParams extends zInfer<typeof CreateOrUpdatePanelParamsSchema> {
10256
10242
  /**
10257
10243
  * The panel to add.
10258
10244
  */
10259
- panel: UIPanelCreate;
10245
+ panel: UIPanelCreateOrUpdate;
10260
10246
  /**
10261
10247
  * The placement of the panel on the right sidebar stack.
10262
10248
  *
10263
10249
  * @defaultValue `{ at: "end" }`
10264
10250
  */
10265
- placement?: PlacementForUIElement;
10266
- }
10267
- /**
10268
- * @public
10269
- */
10270
- interface UpdatePanelParams extends Omit<Partial<UIPanelCreate>, "id">, UIElementBase {
10251
+ initialPlacement?: PlacementForUIElement;
10271
10252
  }
10272
10253
  declare const CreatePanelElementsParamsSchema: z.ZodObject<{
10273
10254
  panelId: z.ZodString;
@@ -11433,29 +11414,44 @@ interface UiController {
11433
11414
  */
11434
11415
  deleteActionTrigger(id: string): void;
11435
11416
  /**
11436
- * Creates a panel on map's right sidebar.
11417
+ * Creates a panel ID.
11437
11418
  *
11438
- * Panels are useful to extend Felt UI for your own use cases (e.g. a form, a settings panel, etc.)
11439
- * by using Felt UI elements (e.g. Text, Button, etc.). This way the user experience is consistent
11440
- * with the rest of Felt.
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.
11433
+ *
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.
11441
11436
  *
11442
11437
  * Panels have two sections:
11443
11438
  * - `body` - Body of the panel, scrollable.
11444
11439
  * - `footer` - It sticks to the bottom of the panel, useful to add submit buttons.
11445
11440
  *
11446
- * By default, the panel will be added to the end of the stack but you can
11447
- * specify a placement to add it at a specific position in the stack.
11448
- *
11449
- * Once created, you can add elements to the panel by using the {@link createPanelElements} method or
11450
- * perform partial updates of elements by using the {@link updatePanelElements} method.
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.
11451
11444
  *
11452
- * When adding a panel, its id is optional as well as its elements' ids.
11453
- * 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
11454
11446
  * it easier to update or delete them later.
11455
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
+ *
11456
11452
  * @param args - The arguments for the method.
11457
11453
  * @param args.panel - The panel to add.
11458
- * @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" }`.
11459
11455
  * - `{ at: "start" }` - Add the panel to the start of the stack.
11460
11456
  * - `{ at: "end" }` - Add the panel to the end of the stack.
11461
11457
  * - `{ after: "panel-1" }` - Add the panel after the panel with the id `panel-1`.
@@ -11463,9 +11459,11 @@ interface UiController {
11463
11459
  *
11464
11460
  * @example
11465
11461
  * ```typescript
11466
- * await felt.createPanel({
11462
+ * const id = await felt.createPanelId();
11463
+ *
11464
+ * await felt.createOrUpdatePanel({
11467
11465
  * panel: {
11468
- * id: "panel-1", // not required but useful for further updates
11466
+ * id,
11469
11467
  * title: "My Panel",
11470
11468
  * body: [
11471
11469
  * {
@@ -11488,32 +11486,11 @@ interface UiController {
11488
11486
  * },
11489
11487
  * ],
11490
11488
  * },
11491
- * placement: { at: "start" }, // add the panel to the start of the stack
11492
- * });
11493
- * ```
11494
- */
11495
- createPanel(args: CreatePanelParams): Promise<UIPanel>;
11496
- /**
11497
- * Updates a panel.
11498
- *
11499
- * Panel to update is identified by the `id` property.
11500
- *
11501
- * @remarks
11502
- * Properties provided will override the existing properties.
11503
- * Override is done at Panel level, so if you want to update a specific element,
11504
- * you need to provide the entire element. For partial updates of elements, use
11505
- * {@link updatePanelElements} instead.
11506
- *
11507
- * @param panel - The panel to update.
11508
- * @example
11509
- * ```typescript
11510
- * await felt.updatePanel({
11511
- * id: "panel-1",
11512
- * 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
11513
11490
  * });
11514
11491
  * ```
11515
11492
  */
11516
- updatePanel(panel: UpdatePanelParams): Promise<UIPanel>;
11493
+ createOrUpdatePanel(args: CreateOrUpdatePanelParams): Promise<UIPanel>;
11517
11494
  /**
11518
11495
  * Deletes a panel.
11519
11496
  *
@@ -11549,7 +11526,7 @@ interface UiController {
11549
11526
  * @example
11550
11527
  * ```typescript
11551
11528
  * await felt.createPanelElements({
11552
- * panelId: "panel-1",
11529
+ * panelId,
11553
11530
  * elements: [
11554
11531
  * {
11555
11532
  * element: { type: "Text", content: "Hello, world!" },
@@ -11571,7 +11548,7 @@ interface UiController {
11571
11548
  * @example
11572
11549
  * ```typescript
11573
11550
  * await felt.updatePanelElements({
11574
- * panelId: "panel-1",
11551
+ * panelId,
11575
11552
  * elements: [
11576
11553
  * {
11577
11554
  * element: {
@@ -11594,7 +11571,7 @@ interface UiController {
11594
11571
  * @example
11595
11572
  * ```typescript
11596
11573
  * await felt.deletePanelElements({
11597
- * panelId: "panel-1",
11574
+ * panelId,
11598
11575
  * elements: ["element-1", "element-2"],
11599
11576
  * });
11600
11577
  * ```
@@ -12018,4 +11995,4 @@ interface FeltController extends ViewportController, UiController, LayersControl
12018
11995
  iframe: HTMLIFrameElement | null;
12019
11996
  }
12020
11997
 
12021
- 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 ViewportConstraints 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 UIFlexibleSpaceElement as bG, type UIFlexibleSpaceElementCreate as bH, type UIFlexibleSpaceElementUpdate as bI, type UIDividerElement as bJ, type UIDividerElementCreate as bK, type UIDividerElementUpdate as bL, type UITextInputElement as bM, type UITextInputElementCreate as bN, type UITextInputElementUpdate as bO, type UISelectElement as bP, type UISelectElementCreate as bQ, type UISelectElementUpdate as bR, type UIPanelElement as bS, type UIPanelElementCreate as bT, type UIPanelElementUpdate as bU, type UIGridContainerElement as bV, type UIGridContainerElementCreate as bW, type UIGridContainerElementUpdate as bX, type UIActionTriggerCreate as bY, type UiController as bZ, type SetViewportCenterZoomParams 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 ViewportFitBoundsParams as c0, type ViewportState as c1, type ViewportController as c2, type UnwrapPromise as c3, uiActionTriggerSchema as c4, type UIPanelElementCreateClonable as c5, uiPanelCreateSchema as c6, type UIButtonElementCreateClonable as c7, type MakeClonableSchema as c8, type PromiseOrNot as c9, type UnionToIntersection as ca, 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 };