customforge 0.1.0-alpha.2 → 0.1.1

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 (47) hide show
  1. package/CHANGELOG.md +91 -56
  2. package/LICENSES/NunitoSans-OFL.txt +93 -93
  3. package/LICENSES/plain-mug-CC-BY-4.0.txt +11 -0
  4. package/README.md +592 -461
  5. package/README.zh-CN.md +587 -459
  6. package/dist/{ProductCustomizer-rMRyWe7L.js → ProductCustomizer-BnjY3v7d.js} +898 -156
  7. package/dist/ProductCustomizer-BnjY3v7d.js.map +1 -0
  8. package/dist/bridge/TextureBridge.d.ts +1 -1
  9. package/dist/core/api.d.ts +94 -0
  10. package/dist/core/api.d.ts.map +1 -0
  11. package/dist/core/config.d.ts +3 -12
  12. package/dist/core/config.d.ts.map +1 -1
  13. package/dist/core/design.d.ts.map +1 -1
  14. package/dist/core/types.d.ts +183 -5
  15. package/dist/core/types.d.ts.map +1 -1
  16. package/dist/core/uv.d.ts +8 -0
  17. package/dist/core/uv.d.ts.map +1 -0
  18. package/dist/cup_decal_small_margins.glb +0 -0
  19. package/dist/customizer/ProductCustomizer.d.ts +98 -9
  20. package/dist/customizer/ProductCustomizer.d.ts.map +1 -1
  21. package/dist/editor/DesignEditor.d.ts +118 -10
  22. package/dist/editor/DesignEditor.d.ts.map +1 -1
  23. package/dist/editor/uvBounds.d.ts +15 -0
  24. package/dist/editor/uvBounds.d.ts.map +1 -0
  25. package/dist/index.d.ts +4 -2
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/style.css +2120 -1327
  30. package/dist/viewer/ProductViewer.d.ts +37 -6
  31. package/dist/viewer/ProductViewer.d.ts.map +1 -1
  32. package/dist/viewer/uvLayout.d.ts +11 -0
  33. package/dist/viewer/uvLayout.d.ts.map +1 -0
  34. package/dist/workbench/CustomForgeWorkbench.d.ts +85 -8
  35. package/dist/workbench/CustomForgeWorkbench.d.ts.map +1 -1
  36. package/dist/workbench/config.d.ts +42 -1
  37. package/dist/workbench/config.d.ts.map +1 -1
  38. package/dist/workbench/icons.d.ts.map +1 -1
  39. package/dist/workbench/index.d.ts +3 -3
  40. package/dist/workbench/index.d.ts.map +1 -1
  41. package/dist/workbench/template.d.ts.map +1 -1
  42. package/dist/workbench/types.d.ts +261 -13
  43. package/dist/workbench/types.d.ts.map +1 -1
  44. package/dist/workbench.js +1248 -116
  45. package/dist/workbench.js.map +1 -1
  46. package/package.json +27 -20
  47. package/dist/ProductCustomizer-rMRyWe7L.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,61 +1,96 @@
1
- # Changelog
2
-
3
- All notable changes to CustomForge will be documented in this file
4
-
5
- ## [Unreleased]
6
-
7
- ## [0.1.0-alpha.2] - 2026-08-27
8
-
9
- ### Added
10
-
11
- - Optional configurable Workbench UI exported from `customforge/workbench`
12
- - Public object querying, selection, removal, naming, visibility, locking, and layer ordering APIs
13
- - Object names, visibility, and locking state in backward-compatible Design JSON version 1 documents
14
- - Undo and redo history with keyboard shortcuts and public history state APIs
15
- - Text composition Dialog with replaceable typography presets
16
- - Image Dialog with upload, configurable background, and decorative element catalogs
17
- - Custom branding, labels, theme tokens, icon visibility, and semantic icon overrides
18
- - Design background images that persist in Design JSON and remain locked at the bottom layer
19
-
20
- ### Changed
21
-
22
- - Built-in demo now consumes the same public Workbench available to package users
23
- - Workbench presentation uses a quieter responsive studio layout with clearer control hierarchy
24
- - Default controls now use softer neutral surfaces, light selection states, and restrained 7px radii
25
- - Workbench now bundles the rounded Nunito Sans UI font with system font fallbacks
1
+ # Changelog
2
+
3
+ All notable changes to CustomForge will be documented in this file
4
+
5
+ ## [Unreleased]
6
+
7
+ ## [0.1.1] - 2026-09-21
8
+
9
+ ### Fixed
10
+
11
+ - Keep the 3D product visible at the maximum zoom-out distance by aligning the camera far clipping plane with the OrbitControls distance limit
12
+
13
+ ## [0.1.0] - 2026-09-21
14
+
15
+ ### Added
16
+
17
+ - Display the active Mesh UV printable region and boundary as a non-exported editor overlay
18
+ - Add an Office-style contextual text formatting bar with font, size, color, highlight, emphasis, alignment, line-height, and letter-spacing controls
19
+ - Persist rich text formatting in backward-compatible Design JSON version 1 documents and expose `updateText()`, `editText()`, and `clearSelection()` APIs
20
+ - Add stable `ProductCustomizerApi` and `CustomForgeWorkbenchApi` contracts for headless and default-UI integrations
21
+ - Expose state snapshots, printable bounds, multi-selection, object transforms, PNG Data URL and Blob output, and 3D view persistence
22
+ - Add instance-scoped Workbench classes, runtime theme access, and configurable editor and viewer drawing appearance
23
+ - Add validated Workbench extension buttons with stable global, editor, selection, and layer action placements
24
+ - Add stable-release metadata checks, independent tarball consumers, and a packaged browser smoke gate
25
+ - Add continuous integration and provenance-enabled npm release workflows
26
+
27
+ ### Changed
28
+
29
+ - Replaced the procedural demo cup with the bundled `cup_decal_small_margins.glb` model, separating `MugBody` from the customizable `PrintArea` overlay
30
+ - Keep the design canvas and printable overlay transparent when no base texture is configured
31
+ - Replace the shadow-casting viewer setup with balanced non-shadow studio lighting and remove the floor and fixed scene background
32
+ - Adjust the initial and reset camera framing for a smaller, more front-facing product view
33
+ - Seed the demo with the built-in CustomForge logo and 22px project-name text
34
+ - Publish the first non-prerelease version through npm's default `latest` channel without imposing a Node.js engine on browser consumers
35
+
36
+ ### Fixed
37
+
38
+ - Keep Fabric selection borders and transform controls out of the live 3D texture
39
+ - Keep compact layer actions beside the type label so they never cover the layer name
40
+ - Present the design canvas as a clean gridded artboard with a restrained UV boundary
41
+
42
+ ## [0.1.0-alpha.2] - 2026-08-27
43
+
44
+ ### Added
45
+
46
+ - Optional configurable Workbench UI exported from `customforge/workbench`
47
+ - Public object querying, selection, removal, naming, visibility, locking, and layer ordering APIs
48
+ - Object names, visibility, and locking state in backward-compatible Design JSON version 1 documents
49
+ - Undo and redo history with keyboard shortcuts and public history state APIs
50
+ - Text composition Dialog with replaceable typography presets
51
+ - Image Dialog with upload, configurable background, and decorative element catalogs
52
+ - Custom branding, labels, theme tokens, icon visibility, and semantic icon overrides
53
+ - Design background images that persist in Design JSON and remain locked at the bottom layer
54
+
55
+ ### Changed
56
+
57
+ - Built-in demo now consumes the same public Workbench available to package users
58
+ - Workbench presentation uses a quieter responsive studio layout with clearer control hierarchy
59
+ - Default controls now use softer neutral surfaces, light selection states, and restrained 7px radii
60
+ - Workbench now bundles the rounded Nunito Sans UI font with system font fallbacks
26
61
  - Solid accent buttons now consistently use the configured high-contrast text color
27
62
  - Layer selection and Dialog transitions now use subtle motion with reduced-motion support
28
63
  - Nunito Sans is emitted as a cacheable font asset instead of being inlined into the stylesheet
29
64
  - Package verification now parses actual ESM imports without matching examples inside bundled strings
30
65
  - The bundled CustomForge logo is now the default Workbench brand mark
31
- - Successful product changes reset design history while preserving current design objects
32
-
33
- ## [0.1.0-alpha.1] - 2026-08-27
34
-
35
- ### Changed
36
-
37
- - Fabric.js and Three.js are installed automatically as runtime dependencies
38
- - Consumers no longer need to install Fabric.js and Three.js separately
39
- - Library builds continue to keep both engines external
40
-
41
- ## [0.1.0-alpha.0] - 2026-08-27
42
-
43
- ### Added
44
-
45
- - ESM Library build configuration with source maps
46
- - TypeScript declaration and declaration map generation
47
- - Namespaced core stylesheet exported as `customforge/style.css`
48
- - Local package verification and npm consumer example
49
- - Versioned, Fabric-independent Design JSON types and runtime validation
50
- - Public `saveDesign()` and transactional `loadDesign()` methods
51
- - Design JSON save and load controls in the built-in and npm consumer demos
52
-
53
- ### Changed
54
-
55
- - Fabric.js and Three.js are peer dependencies for Library consumers
56
- - Demo-only Lucide icons are development dependencies
57
- - `ProductCustomizer` no longer exposes its Fabric.js editor or Three.js viewer instances
58
- - Package version `0.1.0-alpha.0` is published publicly under the `alpha` dist-tag
59
- - Text and image objects remain fully inside the editor canvas while being added or transformed
60
- - The built-in demo product no longer includes the obstructive torus handle
61
- - Blob URL images are converted to persistent Data URLs when added
66
+ - Successful product changes reset design history while preserving current design objects
67
+
68
+ ## [0.1.0-alpha.1] - 2026-08-27
69
+
70
+ ### Changed
71
+
72
+ - Fabric.js and Three.js are installed automatically as runtime dependencies
73
+ - Consumers no longer need to install Fabric.js and Three.js separately
74
+ - Library builds continue to keep both engines external
75
+
76
+ ## [0.1.0-alpha.0] - 2026-08-27
77
+
78
+ ### Added
79
+
80
+ - ESM Library build configuration with source maps
81
+ - TypeScript declaration and declaration map generation
82
+ - Namespaced core stylesheet exported as `customforge/style.css`
83
+ - Local package verification and npm consumer example
84
+ - Versioned, Fabric-independent Design JSON types and runtime validation
85
+ - Public `saveDesign()` and transactional `loadDesign()` methods
86
+ - Design JSON save and load controls in the built-in and npm consumer demos
87
+
88
+ ### Changed
89
+
90
+ - Fabric.js and Three.js are peer dependencies for Library consumers
91
+ - Demo-only Lucide icons are development dependencies
92
+ - `ProductCustomizer` no longer exposes its Fabric.js editor or Three.js viewer instances
93
+ - Package version `0.1.0-alpha.0` is published publicly under the `alpha` dist-tag
94
+ - Text and image objects remain fully inside the editor canvas while being added or transformed
95
+ - The built-in demo product no longer includes the obstructive torus handle
96
+ - Blob URL images are converted to persistent Data URLs when added
@@ -1,93 +1,93 @@
1
- Copyright 2016 The Nunito Sans Project Authors (https://github.com/Fonthausen/NunitoSans)
2
-
3
- This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
- This license is copied below, and is also available with a FAQ at:
5
- http://scripts.sil.org/OFL
6
-
7
-
8
- -----------------------------------------------------------
9
- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
- -----------------------------------------------------------
11
-
12
- PREAMBLE
13
- The goals of the Open Font License (OFL) are to stimulate worldwide
14
- development of collaborative font projects, to support the font creation
15
- efforts of academic and linguistic communities, and to provide a free and
16
- open framework in which fonts may be shared and improved in partnership
17
- with others.
18
-
19
- The OFL allows the licensed fonts to be used, studied, modified and
20
- redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
22
- redistributed and/or sold with any software provided that any reserved
23
- names are not used by derivative works. The fonts and derivatives,
24
- however, cannot be released under any other type of license. The
25
- requirement for fonts to remain under this license does not apply
26
- to any document created using the fonts or their derivatives.
27
-
28
- DEFINITIONS
29
- "Font Software" refers to the set of files released by the Copyright
30
- Holder(s) under this license and clearly marked as such. This may
31
- include source files, build scripts and documentation.
32
-
33
- "Reserved Font Name" refers to any names specified as such after the
34
- copyright statement(s).
35
-
36
- "Original Version" refers to the collection of Font Software components as
37
- distributed by the Copyright Holder(s).
38
-
39
- "Modified Version" refers to any derivative made by adding to, deleting,
40
- or substituting -- in part or in whole -- any of the components of the
41
- Original Version, by changing formats or by porting the Font Software to a
42
- new environment.
43
-
44
- "Author" refers to any designer, engineer, programmer, technical
45
- writer or other person who contributed to the Font Software.
46
-
47
- PERMISSION & CONDITIONS
48
- Permission is hereby granted, free of charge, to any person obtaining
49
- a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
- redistribute, and sell modified and unmodified copies of the Font
51
- Software, subject to the following conditions:
52
-
53
- 1) Neither the Font Software nor any of its individual components,
54
- in Original or Modified Versions, may be sold by itself.
55
-
56
- 2) Original or Modified Versions of the Font Software may be bundled,
57
- redistributed and/or sold with any software, provided that each copy
58
- contains the above copyright notice and this license. These can be
59
- included either as stand-alone text files, human-readable headers or
60
- in the appropriate machine-readable metadata fields within text or
61
- binary files as long as those fields can be easily viewed by the user.
62
-
63
- 3) No Modified Version of the Font Software may use the Reserved Font
64
- Name(s) unless explicit written permission is granted by the corresponding
65
- Copyright Holder. This restriction only applies to the primary font name as
66
- presented to the users.
67
-
68
- 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
- Software shall not be used to promote, endorse or advertise any
70
- Modified Version, except to acknowledge the contribution(s) of the
71
- Copyright Holder(s) and the Author(s) or with their explicit written
72
- permission.
73
-
74
- 5) The Font Software, modified or unmodified, in part or in whole,
75
- must be distributed entirely under this license, and must not be
76
- distributed under any other license. The requirement for fonts to
77
- remain under this license does not apply to any document created
78
- using the Font Software.
79
-
80
- TERMINATION
81
- This license becomes null and void if any of the above conditions are
82
- not met.
83
-
84
- DISCLAIMER
85
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
- COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
- INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
- DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
- FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
- OTHER DEALINGS IN THE FONT SOFTWARE.
1
+ Copyright 2016 The Nunito Sans Project Authors (https://github.com/Fonthausen/NunitoSans)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,11 @@
1
+ Plain Mug
2
+
3
+ Author: LightSwitch (https://sketchfab.com/edwardlewis450)
4
+ Source: https://sketchfab.com/3d-models/plain-mug-19c8fe5702b544d0a1409d3dac1cf90e
5
+ License: Creative Commons Attribution 4.0 International (CC BY 4.0)
6
+ License URL: https://creativecommons.org/licenses/by/4.0/
7
+
8
+ The bundled cup_decal_small_margins.glb is adapted from the original model. The
9
+ original cup geometry is retained as MugBody, and CustomForge adds a separately
10
+ named PrintArea overlay with its own UV layout and material for printable-area
11
+ customization.