This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=ICanvas.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ICanvas.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
//# sourceMappingURL=ICanvas.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ICanvas.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=ICanvasRenderingContext2D.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ICanvasRenderingContext2D.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
//# sourceMappingURL=ICanvasRenderingContext2D.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ICanvasRenderingContext2D.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,22 @@
"use strict";
const BrowserAdapter = {
/**
* Creates a canvas element of the given size.
* This canvas is created using the browser's native canvas element.
* @param width - width of the canvas
* @param height - height of the canvas
*/
createCanvas: (width, height) => {
const canvas = document.createElement("canvas");
return canvas.width = width, canvas.height = height, canvas;
},
getCanvasRenderingContext2D: () => CanvasRenderingContext2D,
getWebGLRenderingContext: () => WebGLRenderingContext,
getNavigator: () => navigator,
getBaseUrl: () => document.baseURI ?? window.location.href,
getFontFaceSet: () => document.fonts,
fetch: (url, options) => fetch(url, options),
parseXML: (xml) => new DOMParser().parseFromString(xml, "text/xml")
};
exports.BrowserAdapter = BrowserAdapter;
//# sourceMappingURL=adapter.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"adapter.js","sources":["../src/adapter.ts"],"sourcesContent":["import type { ICanvas } from './ICanvas';\nimport type { ICanvasRenderingContext2D } from './ICanvasRenderingContext2D';\n\n/**\n * This interface describes all the DOM dependent calls that Pixi makes throughout its codebase.\n * Implementations of this interface can be used to make sure Pixi will work in any environment,\n * such as browser, Web Workers, and Node.js.\n * @memberof PIXI\n */\nexport interface IAdapter\n{\n /** Returns a canvas object that can be used to create a webgl context. */\n createCanvas: (width?: number, height?: number) => ICanvas;\n /** Returns a 2D rendering context. */\n getCanvasRenderingContext2D: () => { prototype: ICanvasRenderingContext2D; };\n /** Returns a WebGL rendering context. */\n getWebGLRenderingContext: () => typeof WebGLRenderingContext;\n /** Returns a partial implementation of the browsers window.navigator */\n getNavigator: () => { userAgent: string };\n /** Returns the current base URL For browser environments this is either the document.baseURI or window.location.href */\n getBaseUrl: () => string;\n getFontFaceSet: () => FontFaceSet | null;\n fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;\n parseXML: (xml: string) => Document;\n}\n\nexport const BrowserAdapter = {\n /**\n * Creates a canvas element of the given size.\n * This canvas is created using the browser's native canvas element.\n * @param width - width of the canvas\n * @param height - height of the canvas\n */\n createCanvas: (width: number, height: number): HTMLCanvasElement =>\n {\n const canvas = document.createElement('canvas');\n\n canvas.width = width;\n canvas.height = height;\n\n return canvas;\n },\n getCanvasRenderingContext2D: () => CanvasRenderingContext2D,\n getWebGLRenderingContext: () => WebGLRenderingContext,\n getNavigator: () => navigator,\n getBaseUrl: () => (document.baseURI ?? window.location.href),\n getFontFaceSet: () => document.fonts,\n fetch: (url: RequestInfo, options?: RequestInit) => fetch(url, options),\n parseXML: (xml: string) =>\n {\n const parser = new DOMParser();\n\n return parser.parseFromString(xml, 'text/xml');\n },\n} as IAdapter;\n"],"names":[],"mappings":";AA0BO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1B,cAAc,CAAC,OAAe,WAC9B;AACU,UAAA,SAAS,SAAS,cAAc,QAAQ;AAE9C,WAAA,OAAO,QAAQ,OACf,OAAO,SAAS,QAET;AAAA,EACX;AAAA,EACA,6BAA6B,MAAM;AAAA,EACnC,0BAA0B,MAAM;AAAA,EAChC,cAAc,MAAM;AAAA,EACpB,YAAY,MAAO,SAAS,WAAW,OAAO,SAAS;AAAA,EACvD,gBAAgB,MAAM,SAAS;AAAA,EAC/B,OAAO,CAAC,KAAkB,YAA0B,MAAM,KAAK,OAAO;AAAA,EACtE,UAAU,CAAC,QAEQ,IAAI,UAEL,EAAA,gBAAgB,KAAK,UAAU;AAErD;;"}

View File

@@ -0,0 +1,23 @@
const BrowserAdapter = {
/**
* Creates a canvas element of the given size.
* This canvas is created using the browser's native canvas element.
* @param width - width of the canvas
* @param height - height of the canvas
*/
createCanvas: (width, height) => {
const canvas = document.createElement("canvas");
return canvas.width = width, canvas.height = height, canvas;
},
getCanvasRenderingContext2D: () => CanvasRenderingContext2D,
getWebGLRenderingContext: () => WebGLRenderingContext,
getNavigator: () => navigator,
getBaseUrl: () => document.baseURI ?? window.location.href,
getFontFaceSet: () => document.fonts,
fetch: (url, options) => fetch(url, options),
parseXML: (xml) => new DOMParser().parseFromString(xml, "text/xml")
};
export {
BrowserAdapter
};
//# sourceMappingURL=adapter.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"adapter.mjs","sources":["../src/adapter.ts"],"sourcesContent":["import type { ICanvas } from './ICanvas';\nimport type { ICanvasRenderingContext2D } from './ICanvasRenderingContext2D';\n\n/**\n * This interface describes all the DOM dependent calls that Pixi makes throughout its codebase.\n * Implementations of this interface can be used to make sure Pixi will work in any environment,\n * such as browser, Web Workers, and Node.js.\n * @memberof PIXI\n */\nexport interface IAdapter\n{\n /** Returns a canvas object that can be used to create a webgl context. */\n createCanvas: (width?: number, height?: number) => ICanvas;\n /** Returns a 2D rendering context. */\n getCanvasRenderingContext2D: () => { prototype: ICanvasRenderingContext2D; };\n /** Returns a WebGL rendering context. */\n getWebGLRenderingContext: () => typeof WebGLRenderingContext;\n /** Returns a partial implementation of the browsers window.navigator */\n getNavigator: () => { userAgent: string };\n /** Returns the current base URL For browser environments this is either the document.baseURI or window.location.href */\n getBaseUrl: () => string;\n getFontFaceSet: () => FontFaceSet | null;\n fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;\n parseXML: (xml: string) => Document;\n}\n\nexport const BrowserAdapter = {\n /**\n * Creates a canvas element of the given size.\n * This canvas is created using the browser's native canvas element.\n * @param width - width of the canvas\n * @param height - height of the canvas\n */\n createCanvas: (width: number, height: number): HTMLCanvasElement =>\n {\n const canvas = document.createElement('canvas');\n\n canvas.width = width;\n canvas.height = height;\n\n return canvas;\n },\n getCanvasRenderingContext2D: () => CanvasRenderingContext2D,\n getWebGLRenderingContext: () => WebGLRenderingContext,\n getNavigator: () => navigator,\n getBaseUrl: () => (document.baseURI ?? window.location.href),\n getFontFaceSet: () => document.fonts,\n fetch: (url: RequestInfo, options?: RequestInit) => fetch(url, options),\n parseXML: (xml: string) =>\n {\n const parser = new DOMParser();\n\n return parser.parseFromString(xml, 'text/xml');\n },\n} as IAdapter;\n"],"names":[],"mappings":"AA0BO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1B,cAAc,CAAC,OAAe,WAC9B;AACU,UAAA,SAAS,SAAS,cAAc,QAAQ;AAE9C,WAAA,OAAO,QAAQ,OACf,OAAO,SAAS,QAET;AAAA,EACX;AAAA,EACA,6BAA6B,MAAM;AAAA,EACnC,0BAA0B,MAAM;AAAA,EAChC,cAAc,MAAM;AAAA,EACpB,YAAY,MAAO,SAAS,WAAW,OAAO,SAAS;AAAA,EACvD,gBAAgB,MAAM,SAAS;AAAA,EAC/B,OAAO,CAAC,KAAkB,YAA0B,MAAM,KAAK,OAAO;AAAA,EACtE,UAAU,CAAC,QAEQ,IAAI,UAEL,EAAA,gBAAgB,KAAK,UAAU;AAErD;"}

View File

@@ -0,0 +1,9 @@
"use strict";
var adapter = require("./adapter.js");
require("./ICanvas.js");
require("./ICanvasRenderingContext2D.js");
var settings = require("./settings.js"), isMobile = require("./utils/isMobile.js");
exports.BrowserAdapter = adapter.BrowserAdapter;
exports.settings = settings.settings;
exports.isMobile = isMobile.isMobile;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}

View File

@@ -0,0 +1,11 @@
import { BrowserAdapter } from "./adapter.mjs";
import "./ICanvas.mjs";
import "./ICanvasRenderingContext2D.mjs";
import { settings } from "./settings.mjs";
import { isMobile } from "./utils/isMobile.mjs";
export {
BrowserAdapter,
isMobile,
settings
};
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}

View File

@@ -0,0 +1,47 @@
"use strict";
var adapter = require("./adapter.js");
const settings = {
/**
* This adapter is used to call methods that are platform dependent.
* For example `document.createElement` only runs on the web but fails in node environments.
* This allows us to support more platforms by abstracting away specific implementations per platform.
*
* By default the adapter is set to work in the browser. However you can create your own
* by implementing the `IAdapter` interface. See `IAdapter` for more information.
* @name ADAPTER
* @memberof PIXI.settings
* @type {PIXI.IAdapter}
* @default PIXI.BrowserAdapter
*/
ADAPTER: adapter.BrowserAdapter,
/**
* Default resolution / device pixel ratio of the renderer.
* @static
* @name RESOLUTION
* @memberof PIXI.settings
* @type {number}
* @default 1
*/
RESOLUTION: 1,
/**
* Enables bitmap creation before image load. This feature is experimental.
* @static
* @name CREATE_IMAGE_BITMAP
* @memberof PIXI.settings
* @type {boolean}
* @default false
*/
CREATE_IMAGE_BITMAP: !1,
/**
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
* Advantages can include sharper image quality (like text) and faster rendering on canvas.
* The main disadvantage is movement of objects may appear less smooth.
* @static
* @memberof PIXI.settings
* @type {boolean}
* @default false
*/
ROUND_PIXELS: !1
};
exports.settings = settings;
//# sourceMappingURL=settings.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.js","sources":["../src/settings.ts"],"sourcesContent":["import { BrowserAdapter } from './adapter';\n\nimport type { IAdapter } from './adapter';\n\ninterface ISettings\n{\n ADAPTER: IAdapter;\n RESOLUTION: number;\n CREATE_IMAGE_BITMAP: boolean;\n ROUND_PIXELS: boolean;\n}\n\n/**\n * User's customizable globals for overriding the default PIXI settings, such\n * as a renderer's default resolution, framerate, float precision, etc.\n * @example\n * import { settings, ENV } from 'pixi.js';\n *\n * // Use the native window resolution as the default resolution\n * // will support high-density displays when rendering\n * settings.RESOLUTION = window.devicePixelRatio;\n *\n * // Used for older v1 WebGL devices for backwards compatibility\n * settings.PREFER_ENV = ENV.WEBGL_LEGACY;\n * @namespace PIXI.settings\n */\nexport const settings: ISettings & Partial<GlobalMixins.Settings> = {\n /**\n * This adapter is used to call methods that are platform dependent.\n * For example `document.createElement` only runs on the web but fails in node environments.\n * This allows us to support more platforms by abstracting away specific implementations per platform.\n *\n * By default the adapter is set to work in the browser. However you can create your own\n * by implementing the `IAdapter` interface. See `IAdapter` for more information.\n * @name ADAPTER\n * @memberof PIXI.settings\n * @type {PIXI.IAdapter}\n * @default PIXI.BrowserAdapter\n */\n ADAPTER: BrowserAdapter,\n\n /**\n * Default resolution / device pixel ratio of the renderer.\n * @static\n * @name RESOLUTION\n * @memberof PIXI.settings\n * @type {number}\n * @default 1\n */\n RESOLUTION: 1,\n\n /**\n * Enables bitmap creation before image load. This feature is experimental.\n * @static\n * @name CREATE_IMAGE_BITMAP\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\n CREATE_IMAGE_BITMAP: false,\n\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * @static\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\n ROUND_PIXELS: false,\n};\n"],"names":["BrowserAdapter"],"mappings":";;AA0BO,MAAM,WAAuD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAahE,SAASA,QAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUT,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUZ,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrB,cAAc;AAClB;;"}

View File

@@ -0,0 +1,48 @@
import { BrowserAdapter } from "./adapter.mjs";
const settings = {
/**
* This adapter is used to call methods that are platform dependent.
* For example `document.createElement` only runs on the web but fails in node environments.
* This allows us to support more platforms by abstracting away specific implementations per platform.
*
* By default the adapter is set to work in the browser. However you can create your own
* by implementing the `IAdapter` interface. See `IAdapter` for more information.
* @name ADAPTER
* @memberof PIXI.settings
* @type {PIXI.IAdapter}
* @default PIXI.BrowserAdapter
*/
ADAPTER: BrowserAdapter,
/**
* Default resolution / device pixel ratio of the renderer.
* @static
* @name RESOLUTION
* @memberof PIXI.settings
* @type {number}
* @default 1
*/
RESOLUTION: 1,
/**
* Enables bitmap creation before image load. This feature is experimental.
* @static
* @name CREATE_IMAGE_BITMAP
* @memberof PIXI.settings
* @type {boolean}
* @default false
*/
CREATE_IMAGE_BITMAP: !1,
/**
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
* Advantages can include sharper image quality (like text) and faster rendering on canvas.
* The main disadvantage is movement of objects may appear less smooth.
* @static
* @memberof PIXI.settings
* @type {boolean}
* @default false
*/
ROUND_PIXELS: !1
};
export {
settings
};
//# sourceMappingURL=settings.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.mjs","sources":["../src/settings.ts"],"sourcesContent":["import { BrowserAdapter } from './adapter';\n\nimport type { IAdapter } from './adapter';\n\ninterface ISettings\n{\n ADAPTER: IAdapter;\n RESOLUTION: number;\n CREATE_IMAGE_BITMAP: boolean;\n ROUND_PIXELS: boolean;\n}\n\n/**\n * User's customizable globals for overriding the default PIXI settings, such\n * as a renderer's default resolution, framerate, float precision, etc.\n * @example\n * import { settings, ENV } from 'pixi.js';\n *\n * // Use the native window resolution as the default resolution\n * // will support high-density displays when rendering\n * settings.RESOLUTION = window.devicePixelRatio;\n *\n * // Used for older v1 WebGL devices for backwards compatibility\n * settings.PREFER_ENV = ENV.WEBGL_LEGACY;\n * @namespace PIXI.settings\n */\nexport const settings: ISettings & Partial<GlobalMixins.Settings> = {\n /**\n * This adapter is used to call methods that are platform dependent.\n * For example `document.createElement` only runs on the web but fails in node environments.\n * This allows us to support more platforms by abstracting away specific implementations per platform.\n *\n * By default the adapter is set to work in the browser. However you can create your own\n * by implementing the `IAdapter` interface. See `IAdapter` for more information.\n * @name ADAPTER\n * @memberof PIXI.settings\n * @type {PIXI.IAdapter}\n * @default PIXI.BrowserAdapter\n */\n ADAPTER: BrowserAdapter,\n\n /**\n * Default resolution / device pixel ratio of the renderer.\n * @static\n * @name RESOLUTION\n * @memberof PIXI.settings\n * @type {number}\n * @default 1\n */\n RESOLUTION: 1,\n\n /**\n * Enables bitmap creation before image load. This feature is experimental.\n * @static\n * @name CREATE_IMAGE_BITMAP\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\n CREATE_IMAGE_BITMAP: false,\n\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * @static\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\n ROUND_PIXELS: false,\n};\n"],"names":[],"mappings":";AA0BO,MAAM,WAAuD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAahE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUT,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUZ,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrB,cAAc;AAClB;"}

View File

@@ -0,0 +1,5 @@
"use strict";
var isMobileJs = require("ismobilejs");
const isMobileCall = isMobileJs.default ?? isMobileJs, isMobile = isMobileCall(globalThis.navigator);
exports.isMobile = isMobile;
//# sourceMappingURL=isMobile.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isMobile.js","sources":["../../src/utils/isMobile.ts"],"sourcesContent":["import isMobileJs from 'ismobilejs';\n\n// ismobilejs have different import behavior for CJS and ESM, so here is the hack\ntype isMobileJsType = typeof isMobileJs & { default?: typeof isMobileJs };\nconst isMobileCall = (isMobileJs as isMobileJsType).default ?? isMobileJs;\n\nexport type isMobileResult = {\n apple: {\n phone: boolean;\n ipod: boolean;\n tablet: boolean;\n universal: boolean;\n device: boolean;\n };\n amazon: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n android: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n windows: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n other: {\n blackberry: boolean;\n blackberry10: boolean;\n opera: boolean;\n firefox: boolean;\n chrome: boolean;\n device: boolean;\n };\n phone: boolean;\n tablet: boolean;\n any: boolean;\n};\n\nexport const isMobile: isMobileResult = isMobileCall(globalThis.navigator);\n"],"names":[],"mappings":";;AAIA,MAAM,eAAgB,WAA8B,WAAW,YAsClD,WAA2B,aAAa,WAAW,SAAS;;"}

View File

@@ -0,0 +1,6 @@
import isMobileJs from "ismobilejs";
const isMobileCall = isMobileJs.default ?? isMobileJs, isMobile = isMobileCall(globalThis.navigator);
export {
isMobile
};
//# sourceMappingURL=isMobile.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isMobile.mjs","sources":["../../src/utils/isMobile.ts"],"sourcesContent":["import isMobileJs from 'ismobilejs';\n\n// ismobilejs have different import behavior for CJS and ESM, so here is the hack\ntype isMobileJsType = typeof isMobileJs & { default?: typeof isMobileJs };\nconst isMobileCall = (isMobileJs as isMobileJsType).default ?? isMobileJs;\n\nexport type isMobileResult = {\n apple: {\n phone: boolean;\n ipod: boolean;\n tablet: boolean;\n universal: boolean;\n device: boolean;\n };\n amazon: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n android: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n windows: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n other: {\n blackberry: boolean;\n blackberry10: boolean;\n opera: boolean;\n firefox: boolean;\n chrome: boolean;\n device: boolean;\n };\n phone: boolean;\n tablet: boolean;\n any: boolean;\n};\n\nexport const isMobile: isMobileResult = isMobileCall(globalThis.navigator);\n"],"names":[],"mappings":";AAIA,MAAM,eAAgB,WAA8B,WAAW,YAsClD,WAA2B,aAAa,WAAW,SAAS;"}