@bookklik/pivo-plate 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +46 -2
- package/THIRD_PARTY_NOTICES.md +22 -0
- package/docs/licenses/fflate-MIT.txt +21 -0
- package/docs/licenses/lucide-ISC-and-Feather-MIT.txt +43 -0
- package/docs/licenses/outfit-OFL-1.1.txt +93 -0
- package/docs/licenses/pako-MIT-and-Zlib.txt +43 -0
- package/docs/licenses/three-MIT.txt +21 -0
- package/docs/npm.md +113 -0
- package/lib/build.json +22 -0
- package/lib/chunks/chunk-C4CNHGLY.js +0 -0
- package/lib/chunks/chunk-PPDBMDTW.js +1170 -0
- package/lib/chunks/chunk-ZZLZL64O.js +664 -0
- package/lib/core.d.ts +165 -0
- package/lib/core.js +75 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.js +133 -0
- package/lib/io.d.ts +40 -0
- package/lib/io.js +23 -0
- package/lib/types/png-XcN3Et0R.d.ts +122 -0
- package/package.json +132 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bookklik Technologies
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PiVo Plate
|
|
2
|
+
|
|
3
|
+
A local-first browser tile-to-3D modeling editor.
|
|
4
|
+
|
|
5
|
+
[Open app](https://bookklik-technologies.github.io/pivo-plate/) · [Documentation](https://bookklik-technologies.github.io/pivo-plate/docs/)
|
|
6
|
+
|
|
7
|
+

|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
## npm and headless SDK
|
|
10
|
+
|
|
11
|
+
For the full visual editor without its suite header or recovery startup, load `?embed=1`. Use `?recovery=off` to keep the header but disable browser recovery. Existing backups are preserved; see [browser embedding options](docs/npm.md#browser-embedding-and-recovery-options).
|
|
12
|
+
|
|
13
|
+
Embed custom UIs or Node jobs with `createHeadlessEditor` from the root or `/headless` entry. It isolates documents and validates synchronous transactions; see [the embedding API](docs/npm.md#embed-with-a-custom-ui-or-no-ui).
|
|
14
|
+
|
|
15
|
+
ESM library for Node.js 24+, with generated TypeScript declarations. After publication, install with `npm install @bookklik/pivo-plate` and import from `@bookklik/pivo-plate/headless`, `@bookklik/pivo-plate/core` or `@bookklik/pivo-plate/io`. No CLI or browser is required for the documented portable operations.
|
|
16
|
+
|
|
17
|
+
See [SDK usage, supported operations and manual publishing](docs/npm.md). Build with `npm run build:lib`; validate an isolated production install with `npm run check:consumer`. These commands do not run the unit suite.
|
|
18
|
+
|
|
19
|
+
## Run locally
|
|
20
|
+
|
|
21
|
+
Use Node.js 24 and npm.
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm ci
|
|
25
|
+
npm run dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Open the local URL printed by Vite. Requires a current desktop browser with WebGL2. Projects stay in your browser; save downloaded project files as backups.
|
|
29
|
+
|
|
30
|
+
## Build and documentation
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
npm run build # production app in dist/
|
|
34
|
+
npm run docs:dev # local documentation server
|
|
35
|
+
npm run docs:build # static docs in docs/.vitepress/dist/
|
|
36
|
+
npm run docs:preview # preview docs after building
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
See the [tutorials](https://bookklik-technologies.github.io/pivo-plate/docs/tutorials/), [limitations](docs/limitations.md), and [verification](docs/verification.md) for usage, supported features, and recorded checks.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
Released under the [MIT License](LICENSE). See [third-party notices](THIRD_PARTY_NOTICES.md) for dependency licenses.
|
|
44
|
+
|
|
45
|
+
## Production readiness
|
|
46
|
+
|
|
47
|
+
See [readiness findings and release procedure](docs/production-readiness.md) for the browser app and [npm release checks](docs/npm.md) for the SDK. Unit tests remain manual; package CI validates builds, dependencies and isolated consumers without executing unit suites.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
Installed direct dependencies (the lockfile is authoritative):
|
|
4
|
+
|
|
5
|
+
| Package | Installed version | License | Role |
|
|
6
|
+
|---|---|---|---|
|
|
7
|
+
| three | 0.180.0 | MIT | Runtime renderer, controls and independent loaders |
|
|
8
|
+
| fflate | 0.8.3 | MIT | Runtime ZIP encoding/decoding |
|
|
9
|
+
| pako | 2.2.0 | MIT AND Zlib | Bounded streaming PNG zlib/Adler validation |
|
|
10
|
+
| @types/pako | 2.0.4 | MIT | Development types |
|
|
11
|
+
| lucide | 1.54.0 | ISC, plus upstream Feather MIT notices | Locally bundled interface icons |
|
|
12
|
+
| @fontsource-variable/outfit | 5.3.0 | SIL Open Font License 1.1 | Locally bundled Outfit variable UI font |
|
|
13
|
+
| @types/three | 0.180.0 | MIT | Development types |
|
|
14
|
+
| typescript | 5.9.3 | Apache-2.0 | Compiler |
|
|
15
|
+
| vite | 7.3.7 | MIT | Development server/build |
|
|
16
|
+
| vitest | 3.2.7 | MIT | Unit tests |
|
|
17
|
+
| @vitest/coverage-v8 | 3.2.7 | MIT | Optional coverage reporting |
|
|
18
|
+
| @playwright/test | 1.64.0 | Apache-2.0 | Browser test automation |
|
|
19
|
+
|
|
20
|
+
Transitive dependencies and their license metadata are listed in package-lock.json and their upstream distributions. Preserve upstream notices when distributing compiled code. Full license texts for Three.js, fflate, pako (including its upstream Zlib notice), Lucide (including Feather-derived icon notices), and Outfit OFL font notices are included in docs/licenses and the standalone build. Development-tool licenses can be found in their installed package distributions.
|
|
21
|
+
|
|
22
|
+
Source license: MIT — see LICENSE. This notice documents dependencies only. It does not restate or replace the project license.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arjun Barrett
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
The following Lucide icons are derived from the Feather project:
|
|
20
|
+
|
|
21
|
+
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
22
|
+
|
|
23
|
+
The MIT License (MIT) (for the icons listed above)
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2013-present Cole Bemis
|
|
26
|
+
|
|
27
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
28
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
29
|
+
in the Software without restriction, including without limitation the rights
|
|
30
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
31
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
32
|
+
furnished to do so, subject to the following conditions:
|
|
33
|
+
|
|
34
|
+
The above copyright notice and this permission notice shall be included in all
|
|
35
|
+
copies or substantial portions of the Software.
|
|
36
|
+
|
|
37
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
38
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
39
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
40
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
41
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
42
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
43
|
+
SOFTWARE.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2021 The Outfit Project Authors (https://github.com/Outfitio/Outfit-Fonts)
|
|
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,43 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Upstream zlib notice from pako/lib/zlib/inflate.js:
|
|
25
|
+
|
|
26
|
+
(C) 1995-2013 Jean-loup Gailly and Mark Adler
|
|
27
|
+
(C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
|
28
|
+
|
|
29
|
+
This software is provided 'as-is', without any express or implied
|
|
30
|
+
warranty. In no event will the authors be held liable for any damages
|
|
31
|
+
arising from the use of this software.
|
|
32
|
+
|
|
33
|
+
Permission is granted to anyone to use this software for any purpose,
|
|
34
|
+
including commercial applications, and to alter it and redistribute it
|
|
35
|
+
freely, subject to the following restrictions:
|
|
36
|
+
|
|
37
|
+
1. The origin of this software must not be misrepresented; you must not
|
|
38
|
+
claim that you wrote the original software. If you use this software
|
|
39
|
+
in a product, an acknowledgment in the product documentation would be
|
|
40
|
+
appreciated but is not required.
|
|
41
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
42
|
+
misrepresented as being the original software.
|
|
43
|
+
3. This notice may not be removed or altered from any source distribution.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2010-2025 three.js authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/docs/npm.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# PiVo plate: npm and headless SDK
|
|
2
|
+
|
|
3
|
+
## Installation and runtime
|
|
4
|
+
|
|
5
|
+
After the first manual publication:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @bookklik/pivo-plate
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Node.js 24 or newer. This is an ESM-only package with bundled public TypeScript declarations. CommonJS require and a CLI/--headless switch are not supported; headless means the programmatic SDK below. Use dynamic import from CommonJS if needed. Library consumers do not need Vite, TypeScript loaders, a browser or the editor source tree.
|
|
12
|
+
|
|
13
|
+
## Public entry points
|
|
14
|
+
|
|
15
|
+
| Import | API |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `@bookklik/pivo-plate` | Combined portable core and IO |
|
|
18
|
+
| `@bookklik/pivo-plate/headless` | Alias of the combined API |
|
|
19
|
+
| `@bookklik/pivo-plate/core` | Data types, validation and editing |
|
|
20
|
+
| `@bookklik/pivo-plate/io` | Portable serialization/encoding/export |
|
|
21
|
+
|
|
22
|
+
Only documented entries are public. Source paths, lib chunks and editor internals are not exported. Generated declarations are included for each entry. Browser download/storage helpers are not exported by the SDK.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { createProject, decodeProject, encodeProject, exportGLB } from '@bookklik/pivo-plate/headless';
|
|
28
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
29
|
+
|
|
30
|
+
const empty = createProject('Tiles');
|
|
31
|
+
await writeFile('empty.pvp', await encodeProject(empty));
|
|
32
|
+
const project = await decodeProject(new Uint8Array(await readFile('model.pvp')));
|
|
33
|
+
await writeFile('model.glb', await exportGLB(project));
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Supported headless behavior
|
|
37
|
+
|
|
38
|
+
Headless support includes project editing, bounded PNG validation, native .pvp save/open and OBJ/GLB model export. Fractional PNG alpha is inspected portably, including indexed transparency, 16-bit samples and Adam7 passes; GLB selects BLEND for fractional alpha and MASK for cutouts. exportGLB(project, alphaModes?) and exportOBJ(project, alphaModes?) accept an optional Map of atlas ID to 'opaque', 'cutout' or 'blend'; default inspection does not need canvas/DOM. Browser autosave, downloads, Vite workers and progress UI are deliberately excluded. Empty projects can be saved but model export needs visible geometry.
|
|
39
|
+
|
|
40
|
+
Calls do not open windows, start servers, contact remote services or access browser storage. You control filesystem access by reading/writing the returned bytes. Preserve native project files as editable backups. Codec/export validation errors reject invalid or unsupported data; do not ignore thrown errors or rejected promises.
|
|
41
|
+
|
|
42
|
+
The SDK uses the existing bounded project/PNG/codec validators. Headless calls execute in the caller's thread: Promise-returning APIs do not imply background workers. For untrusted batches, isolate work in your own Node worker/process with memory/time budgets and terminate the worker for cancellation. There is no built-in Node worker/progress adapter. Model capture, browser PWA/recovery, and UI interactions remain editor features, not implicit headless capabilities.
|
|
43
|
+
|
|
44
|
+
## Browser embedding and recovery options
|
|
45
|
+
|
|
46
|
+
These URL options apply to the full browser editor and standalone HTML, not the UI-free SDK:
|
|
47
|
+
|
|
48
|
+
| URL option | Header | Editor workspace | Browser recovery |
|
|
49
|
+
| --- | --- | --- | --- |
|
|
50
|
+
| No option | Visible | Mounted | Enabled |
|
|
51
|
+
| `?recovery=off` | Visible | Mounted | Disabled |
|
|
52
|
+
| `?embed=1` | Hidden | Mounted | Disabled |
|
|
53
|
+
|
|
54
|
+
For example, load `/pivo-plate/?embed=1` directly or as an iframe's `src`. Keep the iframe sized to the space allocated by the host. If the URL already has a query string, append `&embed=1` instead. This is visual embedding, distinct from importing the headless SDK.
|
|
55
|
+
|
|
56
|
+
Embedded mode hides only `.suite-header` and removes its layout space. Document/mode tabs, context toolbars, side panels, canvas, timeline where applicable, and status UI remain mounted. The hidden header is excluded from layout, accessibility navigation, and keyboard focus; its internal DOM is retained so existing editor command wiring stays intact. Native keyboard shortcuts, including Ctrl/Cmd+S for project downloads, continue to work. This option does not add a cross-origin postMessage/host-control bridge.
|
|
57
|
+
|
|
58
|
+
`?recovery=off` disables discovery, legacy migration, recovery prompts, background autosaves, and recovery reads/writes/deletions for that page session. It does not erase existing backups. The status strip shows **Browser recovery disabled**. Remove the option and reload to resume normal recovery. `recovery=false` and `recovery=0` are aliases; `embed=true` and `embed=on` enable embedded mode. Embedded mode always disables recovery, even with `recovery=on` in the same URL.
|
|
59
|
+
|
|
60
|
+
Unsaved-change warnings remain active. PWA updates are blocked while unsaved documents have no recovery copy; download all current projects before updating. Theme, workspace, tutorial preferences, and PWA asset caching are separate features and are not disabled by the recovery flag. This is not a private/incognito or storage-free browsing mode.
|
|
61
|
+
|
|
62
|
+
The headless SDK already performs no browser recovery lookup or automatic persistence and needs neither URL option. To validate the browser modes after `npm run build`, use `npm run test:embed`; it exercises desktop and compact Chromium layouts, hidden-header spacing, native keyboard saving, and absence of recovery storage access. Set `PIVO_BROWSERS=chromium,firefox,webkit` to run the same checks in all three engines.
|
|
63
|
+
|
|
64
|
+
## Embed with a custom UI or no UI
|
|
65
|
+
|
|
66
|
+
The root and `/headless` entries export `createHeadlessEditor` and the `HeadlessEditor` TypeScript interface. Each instance owns an isolated project; it does not mount the editor, touch the DOM/storage, register service workers, start a server, or render a viewport. Use it in your host application's framework or a Node job, with the existing core operations and IO exporters.
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
import { createHeadlessEditor, createProject } from '@bookklik/pivo-plate/headless';
|
|
70
|
+
|
|
71
|
+
const editor = createHeadlessEditor(createProject());
|
|
72
|
+
editor.transact(draft => {
|
|
73
|
+
draft.name = 'Embedded project';
|
|
74
|
+
});
|
|
75
|
+
const project = editor.getProject();
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- `getProject()` returns a detached snapshot, including Craft pixel buffers. Mutating it does not edit the instance.
|
|
79
|
+
- `transact(callback)` edits a private draft and validates before atomically adopting a detached copy. Throws, invalid documents, Promise/thenable callbacks, and reentrant mutations leave the previous project intact. Callbacks must be synchronous; await external work before opening a transaction. Late writes to a retained draft cannot change committed state.
|
|
80
|
+
- `replace(project)` validates and detaches a replacement before adopting it. The seed and replacement remain caller-owned.
|
|
81
|
+
|
|
82
|
+
Call your renderer or framework's state setter with `editor.getProject()` after a successful edit. Export that snapshot using this package's IO APIs. Persistence, rendering, subscriptions, undo/redo, and worker scheduling are explicit host responsibilities; the adapter does not silently persist changes or retain an undo history. Existing lower-level history/store APIs remain available separately. For React, create one instance per mounted editor rather than one on every render. For servers, create one instance per document/job, never a shared global editor for multiple tenants.
|
|
83
|
+
|
|
84
|
+
The adapter is headless application logic, not an iframe bridge, a DOM editor widget, an HTTP API, or a CLI flag. Large validation/export calls still run in the calling thread. For untrusted input, use worker/process isolation and external memory/time limits in addition to the built-in format budgets. Embedded browser hosts must bundle the ESM package and its production dependencies; the browser UI and its PWA/recovery code are not needed.
|
|
85
|
+
|
|
86
|
+
## Build and artifact validation
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
npm ci --ignore-scripts
|
|
90
|
+
npm run build:lib
|
|
91
|
+
npm run check:package
|
|
92
|
+
npm run check:consumer
|
|
93
|
+
npm run release:check
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The browser build remains npm run build and writes dist/. The separate SDK build writes lib/; prepack rebuilds it automatically. Do not publish dist/ as the library. Runtime dependencies exclude browser-only fonts/icons/frameworks. Required dependency licenses/notices are included in the allowlisted tarball.
|
|
97
|
+
|
|
98
|
+
check:package inspects the exact npm pack inventory and public imports. check:consumer creates a real tarball, installs it outside the repo with production dependencies only, exercises basic portable operations, and strictly compiles/emits NodeNext consumer declarations with no DOM library. Its temporary directory is removed even on failure. These are package/consumer smoke checks, not the unit suite. release:check also checks dependencies and builds the browser app/docs. No listed check invokes npm test or browser suites; ask before running unit tests.
|
|
99
|
+
|
|
100
|
+
## Manual publication (one project at a time)
|
|
101
|
+
|
|
102
|
+
From this project's root:
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
npm run release:check
|
|
106
|
+
npm pack
|
|
107
|
+
npm publish --dry-run --access public
|
|
108
|
+
npm publish --access public
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Only run the final command when you intend to publish. No workflow publishes automatically. Confirm npm login, package-name ownership and version availability first; registry E404 does not guarantee ownership. Before later releases, choose an unused semver version. prepublishOnly rejects any current npm audit vulnerability; prepack builds/checks the artifact and never runs unit tests. If publishing a previously created tarball rather than the project directory, run the release checks before packing: npm cannot rebuild a tarball for you. Configure provenance/trusted publishing according to your npm account if desired; no credentials are stored here.
|
|
112
|
+
|
|
113
|
+
The npm archive intentionally includes lib/, this document, README, LICENSE and the relevant third-party notices. Source, tests, tooling, app dist/ and standalone HTML are excluded. The root package has no dependency on another PiVo package: each can be published independently.
|
package/lib/build.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bookklik/pivo-plate",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"inputs": [
|
|
5
|
+
"src/core/png.ts",
|
|
6
|
+
"src/core/types.ts",
|
|
7
|
+
"src/core/hierarchy.ts",
|
|
8
|
+
"src/core/editor.ts",
|
|
9
|
+
"sdk/core.ts",
|
|
10
|
+
"sdk/editor.ts",
|
|
11
|
+
"src/io/util.ts",
|
|
12
|
+
"src/io/validate.ts",
|
|
13
|
+
"src/io/container.ts",
|
|
14
|
+
"src/core/geometry.ts",
|
|
15
|
+
"src/io/geometry.ts",
|
|
16
|
+
"src/io/alpha.ts",
|
|
17
|
+
"src/io/gltf.ts",
|
|
18
|
+
"src/io/export.ts",
|
|
19
|
+
"sdk/io.ts",
|
|
20
|
+
"sdk/index.ts"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
File without changes
|