@nodaro/prompts 1.28.0 → 1.29.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/index.cjs +32 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +86 -10
- package/dist/index.d.ts +86 -10
- package/dist/index.js +31 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/fixtures/blended-cut-approved.json +712 -0
- package/src/__tests__/transition-timing-catalogs.test.ts +41 -0
- package/src/__tests__/transitions-blended-cut.test.ts +325 -0
- package/src/__tests__/transitions-scope.test.ts +7 -3
- package/src/picker-catalogs.ts +28 -5
- package/src/transitions.ts +104 -17
package/dist/index.cjs
CHANGED
|
@@ -5159,7 +5159,8 @@ var TRANSITIONS = [
|
|
|
5159
5159
|
description: "Hidden cut disguised by matched motion and color",
|
|
5160
5160
|
promptHint: "hidden seamless transition: the camera motion, color palette, and on-screen motion at the end of the first shot continue exactly across the cut into the second shot, so the boundary is invisible and the two shots feel like one unbroken take",
|
|
5161
5161
|
term: "invisible cut",
|
|
5162
|
-
instant: true
|
|
5162
|
+
instant: true,
|
|
5163
|
+
blendable: true
|
|
5163
5164
|
},
|
|
5164
5165
|
{
|
|
5165
5166
|
id: "whip-pan",
|
|
@@ -5572,7 +5573,8 @@ var TRANSITIONS = [
|
|
|
5572
5573
|
description: "Subject jumps, landing matches into new scene",
|
|
5573
5574
|
promptHint: "the subject launches into a jump, and at the height of the leap the picture cuts to a new place. The camera follows the arc of the jump at the same speed on both sides of the cut, and the subject stays at the same place in the frame. In the second shot the same jump carries on without a break, and the subject comes down and lands in the new place. The shot ends on the subject landed in the second shot, fully resolved",
|
|
5574
5575
|
term: "match cut on a jump",
|
|
5575
|
-
instant: true
|
|
5576
|
+
instant: true,
|
|
5577
|
+
blendable: true
|
|
5576
5578
|
},
|
|
5577
5579
|
{
|
|
5578
5580
|
id: "hand-swipe",
|
|
@@ -5769,6 +5771,14 @@ function isInstantTransition(id) {
|
|
|
5769
5771
|
if (ids.length === 0) return false;
|
|
5770
5772
|
return ids.every((one) => getTransition(one)?.instant === true);
|
|
5771
5773
|
}
|
|
5774
|
+
function isBlendableTransition(id) {
|
|
5775
|
+
const ids = typeof id === "string" ? [id] : id ? [...id] : [];
|
|
5776
|
+
if (ids.length === 0) return false;
|
|
5777
|
+
return ids.every((one) => {
|
|
5778
|
+
const t = getTransition(one);
|
|
5779
|
+
return t?.instant === true && t.blendable === true;
|
|
5780
|
+
});
|
|
5781
|
+
}
|
|
5772
5782
|
var INSTANT_CUT_CLAUSE = "an abrupt single-frame hard cut, no dissolve, crossfade or superimposition; the two images never blend";
|
|
5773
5783
|
var LEADING_LABEL = /^\s*((?:[^\s:,;.()]+\s+){0,4}[^\s:,;.()]+)\s*:\s+/;
|
|
5774
5784
|
var normalizePhrase = (s) => s.trim().toLowerCase().replace(/\s+/g, " ");
|
|
@@ -5777,16 +5787,23 @@ function transitionHintBody(id, term, values2) {
|
|
|
5777
5787
|
const t = normalizePhrase(term);
|
|
5778
5788
|
return hint.split(/,\s*/).filter((item) => normalizePhrase(item) !== t).join(", ").trim();
|
|
5779
5789
|
}
|
|
5780
|
-
function transitionFragment(id,
|
|
5790
|
+
function transitionFragment(id, cutClause, values2) {
|
|
5781
5791
|
const term = getTransitionTerm(id);
|
|
5782
5792
|
if (!term) return "";
|
|
5783
|
-
const inner = [transitionHintBody(id, term, values2),
|
|
5793
|
+
const inner = [transitionHintBody(id, term, values2), cutClause].filter((part) => part.length > 0).join("; ");
|
|
5784
5794
|
return inner.length > 0 && normalizePhrase(inner) !== normalizePhrase(term) ? `${term} (${inner})` : term;
|
|
5785
5795
|
}
|
|
5786
5796
|
function renderTransitionBases(ids, _mode = "full", values2) {
|
|
5797
|
+
return renderBasesWith(ids, INSTANT_CUT_CLAUSE, values2);
|
|
5798
|
+
}
|
|
5799
|
+
function renderBasesWith(ids, cutClause, values2) {
|
|
5787
5800
|
const picked = ids.filter((id) => getTransitionTerm(id).length > 0);
|
|
5788
5801
|
const instant = isInstantTransition(picked);
|
|
5789
|
-
return picked.map((id, i) => transitionFragment(id, instant && i === 0, values2));
|
|
5802
|
+
return picked.map((id, i) => transitionFragment(id, instant && i === 0 ? cutClause : "", values2));
|
|
5803
|
+
}
|
|
5804
|
+
function blendedCutClause(duration3) {
|
|
5805
|
+
const row = TRANSITION_DURATIONS.find((d) => d.id === duration3);
|
|
5806
|
+
return row?.blendsCut ? `instead of a hard cut, the two shots blend into each other over ${row.term}` : "";
|
|
5790
5807
|
}
|
|
5791
5808
|
var TRANSITION_POSITIONS = [
|
|
5792
5809
|
{ id: "auto", label: "Auto", description: "Let the model place it", promptHint: "", term: "" },
|
|
@@ -5798,7 +5815,7 @@ var TRANSITION_POSITIONS = [
|
|
|
5798
5815
|
var TRANSITION_DURATIONS = [
|
|
5799
5816
|
{ id: "auto", label: "Auto", description: "Let the model time it", promptHint: "", term: "" },
|
|
5800
5817
|
{ id: "instant", label: "Instant", description: "No perceptible duration", promptHint: "occurring instantaneously", term: "instantaneous" },
|
|
5801
|
-
{ id: "short", label: "Short (~1s)", description: "Approximately 1 second", promptHint: "lasting approximately 1 second", term: "about 1 second" },
|
|
5818
|
+
{ id: "short", label: "Short (~1s)", description: "Approximately 1 second", promptHint: "lasting approximately 1 second", term: "about 1 second", blendsCut: true },
|
|
5802
5819
|
{ id: "medium", label: "Medium (~2s)", description: "Approximately 2 seconds", promptHint: "lasting approximately 2 seconds", term: "about 2 seconds" },
|
|
5803
5820
|
{ id: "long", label: "Long (~3s)", description: "Approximately 3 seconds", promptHint: "lasting approximately 3 seconds", term: "about 3 seconds" }
|
|
5804
5821
|
];
|
|
@@ -5823,11 +5840,13 @@ var SHOT_POSITION_CLAUSES = Object.fromEntries(
|
|
|
5823
5840
|
);
|
|
5824
5841
|
var DURATION_CLAUSES = clausesOf(TRANSITION_DURATIONS);
|
|
5825
5842
|
var INTENSITY_CLAUSES = clausesOf(TRANSITION_INTENSITIES);
|
|
5826
|
-
function composeTransitionHintFromConnections(transitionId, startHints, endHints, timing,
|
|
5843
|
+
function composeTransitionHintFromConnections(transitionId, startHints, endHints, timing, _mode = "full", options) {
|
|
5827
5844
|
const ids = Array.isArray(transitionId) ? Array.from(new Set(transitionId)).slice(0, 2) : transitionId ? [transitionId] : [];
|
|
5828
|
-
const
|
|
5845
|
+
const contributing = ids.filter((id) => getTransitionTerm(id).length > 0);
|
|
5846
|
+
const instant = isInstantTransition(contributing);
|
|
5847
|
+
const blend = instant && isBlendableTransition(contributing) ? blendedCutClause(timing?.duration) : "";
|
|
5848
|
+
const baseHints = renderBasesWith(ids, blend || INSTANT_CUT_CLAUSE, options?.optionValues);
|
|
5829
5849
|
if (baseHints.length === 0) return "";
|
|
5830
|
-
const instant = isInstantTransition(ids.filter((id) => getTransitionTerm(id).length > 0));
|
|
5831
5850
|
const combinedBase = baseHints.join(", and ");
|
|
5832
5851
|
const parts = [combinedBase];
|
|
5833
5852
|
if (timing?.position && timing.position !== "auto" && !(instant && timing.position === "full")) {
|
|
@@ -21588,6 +21607,8 @@ function toOptions(arr, categoryField) {
|
|
|
21588
21607
|
if (categoryField) opt.category = e[categoryField];
|
|
21589
21608
|
if (e.adultOnly) opt.adultOnly = true;
|
|
21590
21609
|
if (e.instant) opt.instant = true;
|
|
21610
|
+
if (e.blendable) opt.blendable = true;
|
|
21611
|
+
if (e.blendsCut) opt.blendsCut = true;
|
|
21591
21612
|
if (e.options?.length) {
|
|
21592
21613
|
opt.params = e.options.map((o) => ({
|
|
21593
21614
|
field: o.field,
|
|
@@ -47680,6 +47701,7 @@ exports.applyTemplate = applyTemplate;
|
|
|
47680
47701
|
exports.asBodyClauses = asBodyClauses;
|
|
47681
47702
|
exports.assembleImageInput = assembleImageInput;
|
|
47682
47703
|
exports.assembleSunoInput = assembleSunoInput;
|
|
47704
|
+
exports.blendedCutClause = blendedCutClause;
|
|
47683
47705
|
exports.buildActionFxHints = buildActionFxHints;
|
|
47684
47706
|
exports.buildActionFxTerms = buildActionFxTerms;
|
|
47685
47707
|
exports.buildAdCreativeAnalysisUserText = buildAdCreativeAnalysisUserText;
|
|
@@ -47986,6 +48008,7 @@ exports.hasUpstreamCharacter = hasUpstreamCharacter;
|
|
|
47986
48008
|
exports.identityRefsSentence = identityRefsSentence;
|
|
47987
48009
|
exports.insertBeforeStyleSection = insertBeforeStyleSection;
|
|
47988
48010
|
exports.isAnalyzablePicker = isAnalyzablePicker;
|
|
48011
|
+
exports.isBlendableTransition = isBlendableTransition;
|
|
47989
48012
|
exports.isDeniedStyleId = isDeniedStyleId;
|
|
47990
48013
|
exports.isInstantTransition = isInstantTransition;
|
|
47991
48014
|
exports.isInstrumentalVocal = isInstrumentalVocal;
|