partforge 0.74.0 → 0.75.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/package.json
CHANGED
|
@@ -350,11 +350,20 @@ export function attachAnimationControls(viewer, part, {
|
|
|
350
350
|
// even where ResizeObserver is absent.
|
|
351
351
|
let onStructureChanged = null;
|
|
352
352
|
|
|
353
|
+
// Sketch mode takes this slot over: the app floats its own composer where the
|
|
354
|
+
// bar sits, and a frozen sketch over a playing animation is meaningless
|
|
355
|
+
// anyway. Its own flag rather than a straight write to `display`, for the
|
|
356
|
+
// reason mount.js spells out for the view cube's two hide reasons: with one
|
|
357
|
+
// assignment shared between causes, whichever fires last wins, and a view
|
|
358
|
+
// switch back to an animated view would reveal a bar that sketch mode still
|
|
359
|
+
// wants gone.
|
|
360
|
+
let hiddenForSketch = false;
|
|
361
|
+
|
|
353
362
|
// Per-view + per-animation chrome: which chooser shows, the picker's options,
|
|
354
363
|
// title, ⓘ description, pager labels, scrubber ticks. A view with no
|
|
355
364
|
// animations hides the whole bar rather than showing an empty transport.
|
|
356
365
|
function syncStructure() {
|
|
357
|
-
bar.style.display = current ? "" : "none";
|
|
366
|
+
bar.style.display = current && !hiddenForSketch ? "" : "none";
|
|
358
367
|
onStructureChanged?.();
|
|
359
368
|
hideChapterBubble();
|
|
360
369
|
if (!current) return;
|
|
@@ -791,6 +800,15 @@ export function attachAnimationControls(viewer, part, {
|
|
|
791
800
|
playback?.userEdited();
|
|
792
801
|
syncUi();
|
|
793
802
|
},
|
|
803
|
+
// Hide/reveal for SKETCH mode only. `--pf-anim-clear` follows for free:
|
|
804
|
+
// syncStructure notifies the placement pass, which derives the clearance
|
|
805
|
+
// from this same `display` value and publishes 0px for a hidden bar.
|
|
806
|
+
setHidden(hidden) {
|
|
807
|
+
const next = hidden === true;
|
|
808
|
+
if (next === hiddenForSketch) return;
|
|
809
|
+
hiddenForSketch = next;
|
|
810
|
+
syncStructure();
|
|
811
|
+
},
|
|
794
812
|
// Mount calls this from the view-tab onChange, BEFORE it refreshes the
|
|
795
813
|
// view: the outgoing animation's params and opacity overrides must be
|
|
796
814
|
// restored before the incoming view composes its assembly.
|
package/src/framework/mount.js
CHANGED
|
@@ -912,6 +912,21 @@ export function mount(part, { createWorker, elements = {}, onBuild, onPick, onDo
|
|
|
912
912
|
},
|
|
913
913
|
});
|
|
914
914
|
if (animCtl) cleanup.defer(() => animCtl.detach());
|
|
915
|
+
// Sketch mode takes the transport bar's slot: the host floats its own
|
|
916
|
+
// composer there (partforge-cloud's sketch composer), and ink is stored in
|
|
917
|
+
// screen space against the pose it was drawn over — a playing animation
|
|
918
|
+
// under it is meaningless. STOP first, then hide: hiding first leaves a
|
|
919
|
+
// frame where an animation still drives the model beneath a bar that is
|
|
920
|
+
// already gone. Playback does not resume on the way out; "stop" is the
|
|
921
|
+
// contract, and notifyUserEdit is the same pause a user's own control edit
|
|
922
|
+
// performs.
|
|
923
|
+
if (annotateMode && animCtl) {
|
|
924
|
+
cleanup.defer(annotateMode.onModeChange(() => {
|
|
925
|
+
const on = annotateMode.isEnabled();
|
|
926
|
+
if (on) animCtl.notifyUserEdit();
|
|
927
|
+
animCtl.setHidden(on);
|
|
928
|
+
}));
|
|
929
|
+
}
|
|
915
930
|
|
|
916
931
|
// Re-run the active view under the current caching setting, so toggling the
|
|
917
932
|
// ?debug switch updates the readout for the same design without a param change.
|