@minecraft/server-editor 0.1.0-beta.1.21.70-preview.21 → 0.1.0-beta.1.21.70-preview.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +124 -34
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -5280,6 +5280,66 @@ export interface IMenuCreationParams {
5280
5280
  uniqueId?: string;
5281
5281
  }
5282
5282
 
5283
+ /**
5284
+ * A sub pane for modal control elements.
5285
+ */
5286
+ // @ts-ignore Class inheritance allowed for native defined classes
5287
+ export interface IModalControlPane extends IPane {
5288
+ /**
5289
+ * @remarks
5290
+ * Adds a togglable boolean item to the pane.
5291
+ *
5292
+ */
5293
+ addBool(value: IObservableProp<boolean>, options?: IBoolPropertyItemOptions): IBoolPropertyItem;
5294
+ /**
5295
+ * @remarks
5296
+ * Adds a button to the pane and binds the specified action to
5297
+ * the button activation.
5298
+ *
5299
+ */
5300
+ addButton(
5301
+ action: (() => void) | RegisteredAction<NoArgsAction>,
5302
+ options?: IButtonPropertyItemOptions,
5303
+ ): IButtonPropertyItem;
5304
+ /**
5305
+ * @remarks
5306
+ * Adds an divider item to the pane.
5307
+ *
5308
+ */
5309
+ addDivider(): IPropertyItemBase;
5310
+ }
5311
+
5312
+ /**
5313
+ * A modal overlay pane is displayed over a root pane.
5314
+ */
5315
+ // @ts-ignore Class inheritance allowed for native defined classes
5316
+ export interface IModalOverlayPane extends IPane {
5317
+ /**
5318
+ * @remarks
5319
+ * A sub pane that represents content of the modal overlay.
5320
+ *
5321
+ */
5322
+ contentPane: ISubPanePropertyItem;
5323
+ /**
5324
+ * @remarks
5325
+ * A pane that represent modal control elements.
5326
+ *
5327
+ */
5328
+ controlPane: IModalControlPane;
5329
+ }
5330
+
5331
+ /**
5332
+ * The options to create a modal overlay pane.
5333
+ */
5334
+ export interface IModalOverlayPaneOptions {
5335
+ /**
5336
+ * @remarks
5337
+ * Localized title of the modal overlay.
5338
+ *
5339
+ */
5340
+ title?: LocalizedString;
5341
+ }
5342
+
5283
5343
  export interface IModalTool {
5284
5344
  /**
5285
5345
  * @remarks
@@ -5442,6 +5502,36 @@ export interface IObservable<T> {
5442
5502
  set(newValue: T): boolean;
5443
5503
  }
5444
5504
 
5505
+ /**
5506
+ * Pane represents a container for UI components.
5507
+ */
5508
+ export interface IPane {
5509
+ /**
5510
+ * @remarks
5511
+ * Unique identifier for the pane.
5512
+ *
5513
+ */
5514
+ readonly id: string;
5515
+ /**
5516
+ * @remarks
5517
+ * Check visibility of the pane
5518
+ *
5519
+ */
5520
+ visible: boolean;
5521
+ /**
5522
+ * @remarks
5523
+ * Hide the pane.
5524
+ *
5525
+ */
5526
+ hide(): void;
5527
+ /**
5528
+ * @remarks
5529
+ * Show the pane and all of its items.
5530
+ *
5531
+ */
5532
+ show(): void;
5533
+ }
5534
+
5445
5535
  /**
5446
5536
  * Log helper interface for Player.
5447
5537
  */
@@ -5781,31 +5871,20 @@ export interface IPropertyItemOptionsVector3 extends IPropertyItemOptions {
5781
5871
  * with an object and presented with different kind of
5782
5872
  * controls.
5783
5873
  */
5784
- export interface IPropertyPane {
5874
+ // @ts-ignore Class inheritance allowed for native defined classes
5875
+ export interface IPropertyPane extends IPane {
5785
5876
  /**
5786
5877
  * @remarks
5787
5878
  * Pane state for being expanded or collapsed.
5788
5879
  *
5789
5880
  */
5790
5881
  collapsed: boolean;
5791
- /**
5792
- * @remarks
5793
- * Unique ID for the property pane.
5794
- *
5795
- */
5796
- readonly id: string;
5797
5882
  /**
5798
5883
  * @remarks
5799
5884
  * Provides visibility change events
5800
5885
  *
5801
5886
  */
5802
5887
  onPropertyPaneVisibilityUpdated: EventSink<PropertyPaneVisibilityUpdate>;
5803
- /**
5804
- * @remarks
5805
- * Check visibility of the pane
5806
- *
5807
- */
5808
- visible: boolean;
5809
5888
  /**
5810
5889
  * @remarks
5811
5890
  * Adds a block list to the pane.
@@ -5825,6 +5904,8 @@ export interface IPropertyPane {
5825
5904
  addBlockTable(options?: IBlockTablePropertyItemOptions): IBlockTablePropertyItem;
5826
5905
  /**
5827
5906
  * @remarks
5907
+ * Adds a togglable boolean item to the pane.
5908
+ *
5828
5909
  */
5829
5910
  addBool(value: IObservableProp<boolean>, options?: IBoolPropertyItemOptions): IBoolPropertyItem;
5830
5911
  /**
@@ -5910,7 +5991,7 @@ export interface IPropertyPane {
5910
5991
  ): IImagePropertyItem;
5911
5992
  /**
5912
5993
  * @remarks
5913
- * Adds a multiline Text item to the pane.
5994
+ * Adds a Link item to the pane.
5914
5995
  *
5915
5996
  */
5916
5997
  addLink(value: IObservableProp<string>, options?: ILinkPropertyItemOptions): ILinkPropertyItem;
@@ -5938,6 +6019,8 @@ export interface IPropertyPane {
5938
6019
  addProgressIndicator(options?: IProgressIndicatorPropertyItemOptions): IProgressIndicatorPropertyItem;
5939
6020
  /**
5940
6021
  * @remarks
6022
+ * Adds an editable string item to the pane
6023
+ *
5941
6024
  */
5942
6025
  addString(value: IObservableProp<string>, options?: IStringPropertyItemOptions): IStringPropertyItem;
5943
6026
  /**
@@ -6006,22 +6089,10 @@ export interface IPropertyPane {
6006
6089
  createSubPane(options: ISubPanePropertyItemOptions): ISubPanePropertyItem;
6007
6090
  /**
6008
6091
  * @remarks
6009
- * Expand the pane.
6010
- *
6011
- */
6012
- expand(): void;
6013
- /**
6014
- * @remarks
6015
- * Returns property pane title.
6092
+ * Returns pane title.
6016
6093
  *
6017
6094
  */
6018
6095
  getTitle(): LocalizedString | undefined;
6019
- /**
6020
- * @remarks
6021
- * Hide the pane.
6022
- *
6023
- */
6024
- hide(): void;
6025
6096
  /**
6026
6097
  * @remarks
6027
6098
  * Removes an existing sub pane.
@@ -6030,18 +6101,12 @@ export interface IPropertyPane {
6030
6101
  removeSubPane(paneToRemove: IPropertyPane): boolean;
6031
6102
  /**
6032
6103
  * @remarks
6033
- * Updates title of property pane.
6104
+ * Updates title of pane.
6034
6105
  *
6035
6106
  * @param newTitle
6036
6107
  * New title
6037
6108
  */
6038
6109
  setTitle(newTitle: LocalizedString | undefined): void;
6039
- /**
6040
- * @remarks
6041
- * Show the pane and all of its property items.
6042
- *
6043
- */
6044
- show(): void;
6045
6110
  }
6046
6111
 
6047
6112
  /**
@@ -6123,12 +6188,37 @@ export interface IRegisterExtensionOptionalParameters {
6123
6188
  */
6124
6189
  // @ts-ignore Class inheritance allowed for native defined classes
6125
6190
  export interface IRootPropertyPane extends IPropertyPane {
6191
+ /**
6192
+ * @remarks
6193
+ * Register a modal overlay to the root pane. It will be hidden
6194
+ * by default, when shown it will display over the root pane
6195
+ * content. Only one modal overlay can be shown at a time.
6196
+ *
6197
+ * @param options
6198
+ * Creation parameters for modal overlay pane.
6199
+ */
6200
+ createModalOverlayPane(options?: IModalOverlayPaneOptions): IModalOverlayPane;
6201
+ /**
6202
+ * @remarks
6203
+ * @returns
6204
+ * Unique identifier of the active modal overlay
6205
+ */
6206
+ getActiveModalOverlayId(): string | undefined;
6126
6207
  /**
6127
6208
  * @remarks
6128
6209
  * @returns
6129
6210
  * Current visibility state of header action
6130
6211
  */
6131
6212
  isHeaderActionVisible(): boolean;
6213
+ /**
6214
+ * @remarks
6215
+ * Sets registered modal overlay as active, if not found it
6216
+ * will hide the current.
6217
+ *
6218
+ * @param id
6219
+ * Unique id for modal overlay pane.
6220
+ */
6221
+ setActiveModalOverlay(id: string | undefined): void;
6132
6222
  /**
6133
6223
  * @remarks
6134
6224
  * If a header action exists, updates visibility of the button.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.21.70-preview.21",
3
+ "version": "0.1.0-beta.1.21.70-preview.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "dependencies": {
16
16
  "@minecraft/common": "^1.0.0",
17
- "@minecraft/server": "^2.0.0-beta.1.21.70-preview.21"
17
+ "@minecraft/server": "^2.0.0-beta.1.21.70-preview.22"
18
18
  },
19
19
  "license": "MIT"
20
20
  }