@openfairygui/functions 0.2.0-alpha.2 → 0.2.0-alpha.21
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.
- package/README.md +48 -6
- package/dist/atlas-C6tbl7nn.d.ts +193 -0
- package/dist/atlas-CHsu2Y8i.d.cts +193 -0
- package/dist/index.cjs +16 -3603
- package/dist/index.d.cts +5 -294
- package/dist/index.d.ts +5 -294
- package/dist/index.js +3 -3594
- package/dist/node.cjs +256 -0
- package/dist/node.d.cts +36 -0
- package/dist/node.d.ts +36 -0
- package/dist/node.js +254 -0
- package/dist/publish-BJ_eelME.js +3267 -0
- package/dist/publish-xFWT9Slz.cjs +3338 -0
- package/dist/restore-BW2xacB3.cjs +936 -0
- package/dist/restore-BeWaJNjR.d.cts +288 -0
- package/dist/restore-Clk62n0O.js +931 -0
- package/dist/restore-Dh0-Nvms.d.ts +288 -0
- package/dist/uam-transaction.cjs +44 -1
- package/dist/uam-transaction.d.cts +16 -1
- package/dist/uam-transaction.d.ts +16 -1
- package/dist/uam-transaction.js +44 -1
- package/dist/web.cjs +274 -0
- package/dist/web.d.cts +41 -0
- package/dist/web.d.ts +41 -0
- package/dist/web.js +273 -0
- package/package.json +28 -4
- package/src/adapters/node/plugins.ts +82 -0
- package/src/adapters/node/publish.ts +130 -0
- package/src/adapters/node/restore.ts +187 -0
- package/src/adapters/web/publish.ts +159 -0
- package/src/adapters/web/raster.ts +251 -0
- package/src/atlas/font.ts +95 -0
- package/src/atlas/inputs.ts +515 -0
- package/src/atlas/jta.ts +211 -0
- package/src/atlas/packing.ts +767 -0
- package/src/atlas.ts +116 -1221
- package/src/codegen.ts +106 -67
- package/src/index.ts +43 -3
- package/src/node.ts +8 -0
- package/src/plugins/types.ts +56 -0
- package/src/publish/contracts.ts +80 -0
- package/src/publish/external-resources.ts +117 -0
- package/src/publish/options.ts +180 -0
- package/src/publish/package-context.ts +608 -0
- package/src/publish/resource-references.ts +210 -0
- package/src/publish.ts +290 -968
- package/src/restore-internals/font.ts +100 -0
- package/src/restore-internals/movie-clip.ts +104 -0
- package/src/restore-internals/output-transaction.ts +164 -0
- package/src/restore.ts +112 -311
- package/src/shared-types.ts +4 -8
- package/src/uam-transaction.ts +68 -0
- package/src/utils.ts +28 -0
- package/src/web.ts +11 -0
package/src/utils.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { Transform } from '@openfairygui/core';
|
|
2
2
|
|
|
3
|
+
export type TextureSetMode =
|
|
4
|
+
| { kind: 'auto'; raw: string }
|
|
5
|
+
| { kind: 'standalone'; raw: string; sizeMode: 'default' | 'npot' | 'multipleOf4' }
|
|
6
|
+
| { kind: 'page'; raw: string; pageIndex: number };
|
|
7
|
+
|
|
3
8
|
/**
|
|
4
9
|
* Wraps a transform function, assigning it a name for the transform stack.
|
|
5
10
|
*/
|
|
@@ -7,3 +12,26 @@ export function createTransform(name: string, fn: Transform): Transform {
|
|
|
7
12
|
Object.defineProperty(fn, 'name', { value: name });
|
|
8
13
|
return fn;
|
|
9
14
|
}
|
|
15
|
+
|
|
16
|
+
export function parseTextureSetMode(value: string | null | undefined): TextureSetMode {
|
|
17
|
+
const raw = value?.trim() ?? '';
|
|
18
|
+
if (!raw) {
|
|
19
|
+
return { kind: 'auto', raw: '' };
|
|
20
|
+
}
|
|
21
|
+
if (raw === 'alone') {
|
|
22
|
+
return { kind: 'standalone', raw, sizeMode: 'default' };
|
|
23
|
+
}
|
|
24
|
+
if (raw === 'alone_npot') {
|
|
25
|
+
return { kind: 'standalone', raw, sizeMode: 'npot' };
|
|
26
|
+
}
|
|
27
|
+
if (raw === 'alone_mof') {
|
|
28
|
+
return { kind: 'standalone', raw, sizeMode: 'multipleOf4' };
|
|
29
|
+
}
|
|
30
|
+
if (/^\d+$/.test(raw)) {
|
|
31
|
+
const pageIndex = Number(raw);
|
|
32
|
+
if (pageIndex >= 0 && pageIndex <= 10) {
|
|
33
|
+
return { kind: 'page', raw, pageIndex };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return { kind: 'auto', raw };
|
|
37
|
+
}
|
package/src/web.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export {
|
|
2
|
+
publishBrowser,
|
|
3
|
+
type BrowserPublishedFile,
|
|
4
|
+
type BrowserPublishAtlasOptions,
|
|
5
|
+
type BrowserPublishDiagnostic,
|
|
6
|
+
type BrowserPublishOptions,
|
|
7
|
+
type BrowserPublishProjectType,
|
|
8
|
+
type BrowserPublishResult,
|
|
9
|
+
type BrowserPublishOutputFileSystem,
|
|
10
|
+
type BrowserPublishSourceFileSystem,
|
|
11
|
+
} from './adapters/web/publish.js';
|