New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@babylonjs/gui

Package Overview
Dependencies
Maintainers
1
Versions
573
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babylonjs/gui - npm Package Compare versions

Comparing version 7.5.0 to 7.6.0

18

2D/advancedDynamicTexture.d.ts

@@ -397,4 +397,5 @@ import type { Nullable } from "@babylonjs/core/types.js";

* @param scaleToSize defines whether to scale to texture to the saved size
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
*/
parseSerializedObject(serializedObject: any, scaleToSize?: boolean): void;
parseSerializedObject(serializedObject: any, scaleToSize?: boolean, urlRewriter?: (url: string) => string): void;
/**

@@ -411,5 +412,6 @@ * Clones the ADT. If no mesh is defined, the GUI will be considered as a fullscreen GUI

* @param scaleToSize defines whether to scale to texture to the saved size
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @deprecated Please use parseSerializedObject instead
*/
parseContent: (serializedObject: any, scaleToSize?: boolean) => void;
parseContent: (serializedObject: any, scaleToSize?: boolean, urlRewriter?: ((url: string) => string) | undefined) => void;
/**

@@ -420,5 +422,6 @@ * Recreate the content of the ADT from a snippet saved by the GUI editor

* @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns a promise that will resolve on success
*/
static ParseFromSnippetAsync(snippetId: string, scaleToSize?: boolean, appendToAdt?: AdvancedDynamicTexture): Promise<AdvancedDynamicTexture>;
static ParseFromSnippetAsync(snippetId: string, scaleToSize?: boolean, appendToAdt?: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture>;
/**

@@ -428,5 +431,6 @@ * Recreate the content of the ADT from a snippet saved by the GUI editor

* @param scaleToSize defines whether to scale to texture to the saved size
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns a promise that will resolve on success
*/
parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean): Promise<AdvancedDynamicTexture>;
parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture>;
/**

@@ -437,5 +441,6 @@ * Recreate the content of the ADT from a url json

* @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns a promise that will resolve on success
*/
static ParseFromFileAsync(url: string, scaleToSize?: boolean, appendToAdt?: AdvancedDynamicTexture): Promise<AdvancedDynamicTexture>;
static ParseFromFileAsync(url: string, scaleToSize?: boolean, appendToAdt?: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture>;
/**

@@ -445,5 +450,6 @@ * Recreate the content of the ADT from a url json

* @param scaleToSize defines whether to scale to texture to the saved size
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns a promise that will resolve on success
*/
parseFromURLAsync(url: string, scaleToSize?: boolean): Promise<AdvancedDynamicTexture>;
parseFromURLAsync(url: string, scaleToSize?: boolean, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture>;
private static _LoadURLContentAsync;

@@ -450,0 +456,0 @@ /**

@@ -367,2 +367,3 @@ import { Observable } from "@babylonjs/core/Misc/observable.js";

* @param scaleToSize defines whether to scale to texture to the saved size
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @deprecated Please use parseSerializedObject instead

@@ -1153,5 +1154,6 @@ */

* @param scaleToSize defines whether to scale to texture to the saved size
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
*/
parseSerializedObject(serializedObject, scaleToSize) {
this._rootContainer = Control.Parse(serializedObject.root, this);
parseSerializedObject(serializedObject, scaleToSize, urlRewriter) {
this._rootContainer = Control.Parse(serializedObject.root, this, urlRewriter);
if (scaleToSize) {

@@ -1202,5 +1204,6 @@ const width = serializedObject.width;

* @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns a promise that will resolve on success
*/
static async ParseFromSnippetAsync(snippetId, scaleToSize, appendToAdt) {
static async ParseFromSnippetAsync(snippetId, scaleToSize, appendToAdt, urlRewriter) {
const adt = appendToAdt ?? AdvancedDynamicTexture.CreateFullscreenUI("ADT from snippet");

@@ -1211,3 +1214,3 @@ if (snippetId === "_BLANK") {

const serialized = await AdvancedDynamicTexture._LoadURLContentAsync(AdvancedDynamicTexture.SnippetUrl + "/" + snippetId.replace(/#/g, "/"), true);
adt.parseSerializedObject(serialized, scaleToSize);
adt.parseSerializedObject(serialized, scaleToSize, urlRewriter);
return adt;

@@ -1219,6 +1222,7 @@ }

* @param scaleToSize defines whether to scale to texture to the saved size
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns a promise that will resolve on success
*/
parseFromSnippetAsync(snippetId, scaleToSize) {
return AdvancedDynamicTexture.ParseFromSnippetAsync(snippetId, scaleToSize, this);
parseFromSnippetAsync(snippetId, scaleToSize, urlRewriter) {
return AdvancedDynamicTexture.ParseFromSnippetAsync(snippetId, scaleToSize, this, urlRewriter);
}

@@ -1230,8 +1234,9 @@ /**

* @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns a promise that will resolve on success
*/
static async ParseFromFileAsync(url, scaleToSize, appendToAdt) {
static async ParseFromFileAsync(url, scaleToSize, appendToAdt, urlRewriter) {
const adt = appendToAdt ?? AdvancedDynamicTexture.CreateFullscreenUI("ADT from URL");
const serialized = await AdvancedDynamicTexture._LoadURLContentAsync(url);
adt.parseSerializedObject(serialized, scaleToSize);
adt.parseSerializedObject(serialized, scaleToSize, urlRewriter);
return adt;

@@ -1243,6 +1248,7 @@ }

* @param scaleToSize defines whether to scale to texture to the saved size
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns a promise that will resolve on success
*/
parseFromURLAsync(url, scaleToSize) {
return AdvancedDynamicTexture.ParseFromFileAsync(url, scaleToSize, this);
parseFromURLAsync(url, scaleToSize, urlRewriter) {
return AdvancedDynamicTexture.ParseFromFileAsync(url, scaleToSize, this, urlRewriter);
}

@@ -1249,0 +1255,0 @@ static _LoadURLContentAsync(url, snippet = false) {

@@ -177,4 +177,4 @@ import type { Nullable } from "@babylonjs/core/types.js";

*/
_parseFromContent(serializedObject: any, host: AdvancedDynamicTexture): void;
_parseFromContent(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): void;
isReady(): boolean;
}

@@ -567,4 +567,4 @@ import { __decorate } from "@babylonjs/core/tslib.es6.js";

*/
_parseFromContent(serializedObject, host) {
super._parseFromContent(serializedObject, host);
_parseFromContent(serializedObject, host, urlRewriter) {
super._parseFromContent(serializedObject, host, urlRewriter);
this._link(host);

@@ -581,3 +581,3 @@ // Gradient

for (const childData of serializedObject.children) {
this.addControl(Control.Parse(childData, host));
this.addControl(Control.Parse(childData, host, urlRewriter));
}

@@ -584,0 +584,0 @@ }

@@ -18,2 +18,3 @@ import type { Nullable } from "@babylonjs/core/types.js";

import type { BaseGradient } from "./gradient/BaseGradient";
import type { AbstractEngine } from "@babylonjs/core/Engines/abstractEngine.js";
/**

@@ -117,2 +118,4 @@ * Root class used for all 2D controls

protected _rebuildLayout: boolean;
/** @internal */
protected _urlRewriter?: (url: string) => string;
/**

@@ -824,5 +827,6 @@ * Observable that fires when the control's enabled state changes

* @param host the texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns this control
*/
parse(serializedObject: any, host?: AdvancedDynamicTexture): Control;
parse(serializedObject: any, host?: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Control;
/**

@@ -838,3 +842,3 @@ * Serializes the current control

*/
_parseFromContent(serializedObject: any, host: AdvancedDynamicTexture): void;
_parseFromContent(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): void;
/** Releases associated resources */

@@ -864,3 +868,3 @@ dispose(): void;

*/
static _GetFontOffset(font: string): {
static _GetFontOffset(font: string, engineToUse?: AbstractEngine): {
ascent: number;

@@ -874,5 +878,6 @@ height: number;

* @param host defines the hosting AdvancedDynamicTexture
* @param urlRewriter defines an url rewriter to update urls before sending them to the controls
* @returns a new Control
*/
static Parse(serializedObject: any, host: AdvancedDynamicTexture): Control;
static Parse(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Control;
static AddHeader: (control: Control, text: string, size: string | number, options: {

@@ -879,0 +884,0 @@ isHorizontal: boolean;

@@ -372,2 +372,5 @@ import { __decorate } from "@babylonjs/core/tslib.es6.js";

set source(value) {
if (this._urlRewriter && value) {
value = this._urlRewriter(value);
}
if (this._source === value) {

@@ -374,0 +377,0 @@ return;

@@ -808,3 +808,3 @@ import { __decorate } from "@babylonjs/core/tslib.es6.js";

if (!this._fontOffset || this._wasDirty) {
this._fontOffset = Control._GetFontOffset(context.font);
this._fontOffset = Control._GetFontOffset(context.font, this._host.getScene()?.getEngine());
}

@@ -811,0 +811,0 @@ // Text

@@ -479,3 +479,3 @@ import { __decorate } from "@babylonjs/core/tslib.es6.js";

if (!this._fontOffset || this._wasDirty) {
this._fontOffset = Control._GetFontOffset(context.font);
this._fontOffset = Control._GetFontOffset(context.font, this._host.getScene()?.getEngine());
}

@@ -482,0 +482,0 @@ let text = this._beforeRenderText(this._textWrapper).text;

@@ -290,3 +290,3 @@ import { __decorate } from "@babylonjs/core/tslib.es6.js";

if (!this._fontOffset || this.isDirty) {
this._fontOffset = Control._GetFontOffset(context.font);
this._fontOffset = Control._GetFontOffset(context.font, this._host.getScene()?.getEngine());
}

@@ -564,3 +564,3 @@ super._processMeasures(parentMeasure, context);

if (!this._fontOffset) {
this._fontOffset = Control._GetFontOffset(context.font);
this._fontOffset = Control._GetFontOffset(context.font, this._host.getScene()?.getEngine());
}

@@ -567,0 +567,0 @@ const lines = this._lines

{
"name": "@babylonjs/gui",
"version": "7.5.0",
"version": "7.6.0",
"main": "index.js",

@@ -21,3 +21,3 @@ "module": "index.js",

"devDependencies": {
"@babylonjs/core": "^7.5.0",
"@babylonjs/core": "^7.6.0",
"@dev/build-tools": "^1.0.0",

@@ -24,0 +24,0 @@ "@lts/gui": "1.0.0"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc