@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.
Files changed (54) hide show
  1. package/README.md +48 -6
  2. package/dist/atlas-C6tbl7nn.d.ts +193 -0
  3. package/dist/atlas-CHsu2Y8i.d.cts +193 -0
  4. package/dist/index.cjs +16 -3603
  5. package/dist/index.d.cts +5 -294
  6. package/dist/index.d.ts +5 -294
  7. package/dist/index.js +3 -3594
  8. package/dist/node.cjs +256 -0
  9. package/dist/node.d.cts +36 -0
  10. package/dist/node.d.ts +36 -0
  11. package/dist/node.js +254 -0
  12. package/dist/publish-BJ_eelME.js +3267 -0
  13. package/dist/publish-xFWT9Slz.cjs +3338 -0
  14. package/dist/restore-BW2xacB3.cjs +936 -0
  15. package/dist/restore-BeWaJNjR.d.cts +288 -0
  16. package/dist/restore-Clk62n0O.js +931 -0
  17. package/dist/restore-Dh0-Nvms.d.ts +288 -0
  18. package/dist/uam-transaction.cjs +44 -1
  19. package/dist/uam-transaction.d.cts +16 -1
  20. package/dist/uam-transaction.d.ts +16 -1
  21. package/dist/uam-transaction.js +44 -1
  22. package/dist/web.cjs +274 -0
  23. package/dist/web.d.cts +41 -0
  24. package/dist/web.d.ts +41 -0
  25. package/dist/web.js +273 -0
  26. package/package.json +28 -4
  27. package/src/adapters/node/plugins.ts +82 -0
  28. package/src/adapters/node/publish.ts +130 -0
  29. package/src/adapters/node/restore.ts +187 -0
  30. package/src/adapters/web/publish.ts +159 -0
  31. package/src/adapters/web/raster.ts +251 -0
  32. package/src/atlas/font.ts +95 -0
  33. package/src/atlas/inputs.ts +515 -0
  34. package/src/atlas/jta.ts +211 -0
  35. package/src/atlas/packing.ts +767 -0
  36. package/src/atlas.ts +116 -1221
  37. package/src/codegen.ts +106 -67
  38. package/src/index.ts +43 -3
  39. package/src/node.ts +8 -0
  40. package/src/plugins/types.ts +56 -0
  41. package/src/publish/contracts.ts +80 -0
  42. package/src/publish/external-resources.ts +117 -0
  43. package/src/publish/options.ts +180 -0
  44. package/src/publish/package-context.ts +608 -0
  45. package/src/publish/resource-references.ts +210 -0
  46. package/src/publish.ts +290 -968
  47. package/src/restore-internals/font.ts +100 -0
  48. package/src/restore-internals/movie-clip.ts +104 -0
  49. package/src/restore-internals/output-transaction.ts +164 -0
  50. package/src/restore.ts +112 -311
  51. package/src/shared-types.ts +4 -8
  52. package/src/uam-transaction.ts +68 -0
  53. package/src/utils.ts +28 -0
  54. 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';