pixelkiln 0.30.0 → 0.31.0
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/dist/cli.js +33 -7
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +33 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +33 -7
- package/dist/index.js.map +1 -1
- package/docs/CLI.md +7 -4
- package/docs/GETTING_STARTED.md +2 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9364,6 +9364,7 @@ function renderGallery(snapshot, opts = {}) {
|
|
|
9364
9364
|
.sheet.editor-host { width:min(1400px, 96vw); grid-template-rows:auto 1fr; }
|
|
9365
9365
|
.sheet.editor-host .rbar b { font:650 12.5px/1.4 var(--mono); color:var(--text); }
|
|
9366
9366
|
.sheet.editor-host .rbar .acts { margin-left:auto; display:flex; gap:8px; align-items:center; }
|
|
9367
|
+
.sheet.editor-host .rbar .chip { color:var(--dim); font-size:12.5px; display:inline-flex; align-items:center; gap:5px; margin-right:6px; }
|
|
9367
9368
|
.sheet.editor-host .rbar .st { display:inline-flex; align-items:center; gap:6px; font:650 11.5px/1 var(--mono); }
|
|
9368
9369
|
.sheet.editor-host .rbar .msg { color:var(--bad); font-size:12.5px; }
|
|
9369
9370
|
.sheet.editor-host .stage { position:relative; min-height:0; }
|
|
@@ -9892,11 +9893,16 @@ function openEditorSheet(item) {
|
|
|
9892
9893
|
const status = el('span', 'st');
|
|
9893
9894
|
const acts = el('div', 'acts');
|
|
9894
9895
|
const msg = el('span', 'msg');
|
|
9896
|
+
const compare = el('label', 'chip'); compare.hidden = true;
|
|
9897
|
+
compare.title = 'The generated art on a locked layer at 50%, for comparison; never part of the saved file';
|
|
9898
|
+
const compareBox = el('input'); compareBox.type = 'checkbox'; compareBox.checked = true;
|
|
9899
|
+
compareBox.onchange = () => showReference(compareBox.checked);
|
|
9900
|
+
compare.append(compareBox, document.createTextNode(' show generated'));
|
|
9895
9901
|
const save = el('button', 'primary', 'Save to project'); save.type = 'button';
|
|
9896
9902
|
save.onclick = () => requestEditorSave(false);
|
|
9897
9903
|
const saveClose = el('button', null, 'Save & close'); saveClose.type = 'button';
|
|
9898
9904
|
saveClose.onclick = () => requestEditorSave(true);
|
|
9899
|
-
acts.append(msg, save, saveClose);
|
|
9905
|
+
acts.append(msg, compare, save, saveClose);
|
|
9900
9906
|
bar.append(close, title, status, acts);
|
|
9901
9907
|
const stage = el('div', 'stage');
|
|
9902
9908
|
const frame = el('iframe');
|
|
@@ -9909,7 +9915,7 @@ function openEditorSheet(item) {
|
|
|
9909
9915
|
stage.append(frame, loading);
|
|
9910
9916
|
panel.append(bar, stage);
|
|
9911
9917
|
host.append(scrim, panel);
|
|
9912
|
-
SHEET = { item, frame, loading, status, msg, save, saveClose, dirty: false, opened: false, ready: null, pending: null, requests: 0, source: src, sentProject: false, roles: null };
|
|
9918
|
+
SHEET = { item, frame, loading, status, msg, save, saveClose, compare, dirty: false, opened: false, ready: null, pending: null, requests: 0, source: src, sentProject: false, sentReference: false, reference: false, roles: null };
|
|
9913
9919
|
sheetStatus('cool', 'loading');
|
|
9914
9920
|
sheetButtons();
|
|
9915
9921
|
close.focus({ preventScroll: true });
|
|
@@ -9929,7 +9935,11 @@ async function sendOpen() {
|
|
|
9929
9935
|
sheetStatus('bad', 'unsupported');
|
|
9930
9936
|
return;
|
|
9931
9937
|
}
|
|
9938
|
+
// When an edit is being opened, the generated art rides along as a
|
|
9939
|
+
// reference layer: what the editor shows through at 50% for comparison.
|
|
9940
|
+
const referenceFiles = sources.fromEdit && SHEET.ready.version >= 4 && item.outputs.every((o) => o.exists && o.url) ? item.outputs : null;
|
|
9932
9941
|
const pngs = [];
|
|
9942
|
+
const reference = [];
|
|
9933
9943
|
let pxo = null;
|
|
9934
9944
|
try {
|
|
9935
9945
|
for (const file of sources.files) {
|
|
@@ -9941,6 +9951,10 @@ async function sendOpen() {
|
|
|
9941
9951
|
const p = await fetch(projectUrl, { cache: 'no-store' });
|
|
9942
9952
|
if (p.ok) pxo = await p.arrayBuffer();
|
|
9943
9953
|
}
|
|
9954
|
+
for (const file of referenceFiles || []) {
|
|
9955
|
+
const res = await fetch(file.url, { cache: 'no-store' });
|
|
9956
|
+
if (res.ok) reference.push({ role: file.role || null, png: await res.arrayBuffer() });
|
|
9957
|
+
}
|
|
9944
9958
|
} catch (err) {
|
|
9945
9959
|
if (SHEET) { SHEET.msg.textContent = 'Could not load the image: ' + err.message; sheetStatus('bad', 'failed'); }
|
|
9946
9960
|
return;
|
|
@@ -9965,9 +9979,18 @@ async function sendOpen() {
|
|
|
9965
9979
|
transfer.push(message.png);
|
|
9966
9980
|
}
|
|
9967
9981
|
if (pxo) { message.pxo = pxo; transfer.push(pxo); }
|
|
9982
|
+
if (reference.length === (referenceFiles || []).length && reference.length) {
|
|
9983
|
+
message.reference = reference;
|
|
9984
|
+
for (const r of reference) transfer.push(r.png);
|
|
9985
|
+
}
|
|
9986
|
+
SHEET.sentReference = !!message.reference;
|
|
9968
9987
|
SHEET.frame.contentWindow.postMessage(message, location.origin, transfer);
|
|
9969
9988
|
sheetStatus('cool', 'opening');
|
|
9970
9989
|
}
|
|
9990
|
+
function showReference(visible) {
|
|
9991
|
+
if (!SHEET || !SHEET.opened || !SHEET.reference) return;
|
|
9992
|
+
SHEET.frame.contentWindow.postMessage({ type: 'pixelkiln:reference', visible }, location.origin);
|
|
9993
|
+
}
|
|
9971
9994
|
function requestEditorSave(close) {
|
|
9972
9995
|
if (!SHEET || !SHEET.opened || SHEET.pending) return;
|
|
9973
9996
|
const request = 'save-' + (++SHEET.requests);
|
|
@@ -9991,10 +10014,13 @@ async function onEditorMessage(m) {
|
|
|
9991
10014
|
case 'pixelkiln:opened':
|
|
9992
10015
|
SHEET.opened = true;
|
|
9993
10016
|
SHEET.loading.remove();
|
|
10017
|
+
SHEET.reference = !!m.reference;
|
|
10018
|
+
SHEET.compare.hidden = !SHEET.reference;
|
|
9994
10019
|
if (m.source === 'pxo') sheetStatus('ok', 'editing the edit file' + (m.frames > 1 ? 's' : '') + ' with ' + (m.layers === 1 ? 'the layer' : m.layers + ' layers') + (m.frames > 1 ? ' and ' + m.frames + ' ' + memberNoun(SHEET.item, m.frames) : '') + ' restored');
|
|
9995
10020
|
else if (SHEET.sentProject) sheetStatus('warn', 'editing the flattened edit file' + (m.frames > 1 ? 's' : '') + '; the layer file could not be opened');
|
|
9996
10021
|
else if (m.source === 'frames') sheetStatus('ok', (SHEET.item.edits.length ? 'editing the edit files' : 'editing a copy of the generated ' + memberNoun(SHEET.item, m.frames)) + ' as ' + m.frames + ' frames' + (isFrameSet(SHEET.item) ? '' : ', one per ' + memberNoun(SHEET.item, 1)));
|
|
9997
10022
|
else sheetStatus('ok', SHEET.item.edit && SHEET.item.edit.exists ? 'editing the edit file' : 'editing a copy of the generated art');
|
|
10023
|
+
if (SHEET.reference) SHEET.status.append(document.createTextNode(' \xB7 generated art shown through at 50%'));
|
|
9998
10024
|
sheetButtons();
|
|
9999
10025
|
break;
|
|
10000
10026
|
case 'pixelkiln:dirty':
|
|
@@ -11992,8 +12018,8 @@ var pin_default = {
|
|
|
11992
12018
|
pixelorama: "v1.2.2",
|
|
11993
12019
|
godot: "4.7.2",
|
|
11994
12020
|
extensionsApi: 9,
|
|
11995
|
-
protocol:
|
|
11996
|
-
release: "editor-pixelorama-v1.2.2-pk.
|
|
12021
|
+
protocol: 4,
|
|
12022
|
+
release: "editor-pixelorama-v1.2.2-pk.18",
|
|
11997
12023
|
files: {
|
|
11998
12024
|
"index.apple-touch-icon.png": {
|
|
11999
12025
|
sha256: "ee5434873e0fed91e9a888c3ea5a8b79beac25999308be7a6eb41bf4ce640d27",
|
|
@@ -12008,7 +12034,7 @@ var pin_default = {
|
|
|
12008
12034
|
bytes: 7298
|
|
12009
12035
|
},
|
|
12010
12036
|
"index.html": {
|
|
12011
|
-
sha256: "
|
|
12037
|
+
sha256: "d9adf06036660c4b76ef5386e872bc03dc0d5b0628fd6ac660d480893ee1f47a",
|
|
12012
12038
|
bytes: 5442
|
|
12013
12039
|
},
|
|
12014
12040
|
"index.icon.png": {
|
|
@@ -12020,8 +12046,8 @@ var pin_default = {
|
|
|
12020
12046
|
bytes: 279815
|
|
12021
12047
|
},
|
|
12022
12048
|
"index.pck": {
|
|
12023
|
-
sha256: "
|
|
12024
|
-
bytes:
|
|
12049
|
+
sha256: "a41d9c3a39aa99ea5ee49ddcedfeb8b092006aa75c0de67139f13297c17f42e4",
|
|
12050
|
+
bytes: 6431692
|
|
12025
12051
|
},
|
|
12026
12052
|
"index.png": {
|
|
12027
12053
|
sha256: "6e3ca3eb4a99e4c07bdd89ebc873b440ec0ffd66ce1955160da9e7ed80d538d7",
|