Merge remote-tracking branch 'origin/main' into HEAD

This commit is contained in:
bflatastic
2026-10-29 23:21:59 +07:00
310 changed files with 14537 additions and 6017 deletions
+8
View File
@@ -209,6 +209,14 @@ const SHAPE_PROPS: &[(&str, &str, &str)] = &[
("twist", "angle", "ADBE Vector Twist Angle"),
("twist", "center", "ADBE Vector Twist Center"),
("merge", "mode", "ADBE Vector Merge Type"),
("wiggle", "size", "ADBE Vector Roughen Size"),
("wiggle", "detail", "ADBE Vector Roughen Detail"),
("wiggle", "points", "ADBE Vector Roughen Points"),
("wiggle", "speed", "ADBE Vector Temporal Freq"),
("wiggle", "correlation", "ADBE Vector Correlation"),
("wiggle", "phase", "ADBE Vector Temporal Phase"),
("wiggle", "spatialPhase", "ADBE Vector Spatial Phase"),
("wiggle", "seed", "ADBE Vector Random Seed"),
];
/// Effects: our effect id → AE match name (the documented ones; the rest keep our id).
+8 -3
View File
@@ -189,7 +189,12 @@ BridgeTalk.pump = function () { return false; };
// ------------------------------------------------------------------ File / Folder
function __join(a, b) { return a.replace(/[\/\\]+$/, "") + "/" + b; }
function __trimPathSeparators(path) {
var end = path.length;
while (end > 0 && (path.charAt(end - 1) === "/" || path.charAt(end - 1) === "\\")) end--;
return path.slice(0, end);
}
function __join(a, b) { return __trimPathSeparators(a) + "/" + b; }
function File(path) {
if (!(this instanceof File)) return new File(path);
@@ -292,9 +297,9 @@ Folder.prototype = {
get fsName() { return this.__path; },
get fullName() { return this.__path; },
get absoluteURI() { return this.__path; },
get name() { return this.__path.replace(/[\/\\]+$/, "").split(/[\/\\]/).pop(); },
get name() { return __trimPathSeparators(this.__path).split(/[\/\\]/).pop(); },
get displayName() { return this.name; },
get path() { var p = this.__path.replace(/[\/\\]+$/, "").split(/[\/\\]/); p.pop(); return p.join("/"); },
get path() { var p = __trimPathSeparators(this.__path).split(/[\/\\]/); p.pop(); return p.join("/"); },
get parent() { return new Folder(this.path); },
get exists() { return JSON.parse(__file("isDir", this.__path)) === true; },
toString: function () { return this.__path; },
+1 -1
View File
@@ -55,7 +55,7 @@ mod imp {
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};
use super::*;
use super::{J, err, json};
enum Sock {
Stream { s: TcpStream, buf: Vec<u8>, eof: bool },
+70
View File
@@ -270,6 +270,44 @@ fn an_undefined_name_mentioned_earlier_reports_its_use_in_the_reading_function()
assert_eq!(e.line, Some(6), "{e:?}");
}
/// Scripts reach Wiggle Paths' properties, Spatial Phase included, by their match names.
#[test]
fn wiggle_paths_properties_by_match_name() {
let mut s = session();
let o = ok(
&mut s,
r#"
var c = app.project.items.addComp("W", 200, 200, 1, 2, 30);
var sh = c.layers.addShape();
var w = sh.property("ADBE Root Vectors Group").addProperty("ADBE Vector Filter - Roughen");
w.property("ADBE Vector Spatial Phase").setValue(45);
var names = [];
for (var i = 1; i <= w.numProperties; i++) names.push(w.property(i).matchName);
[w.matchName, w.property("ADBE Vector Spatial Phase").name, names]
"#,
);
assert_eq!(
o.result,
json!([
"ADBE Vector Filter - Roughen",
"Spatial Phase",
[
"ADBE Vector Roughen Size",
"ADBE Vector Roughen Detail",
"ADBE Vector Roughen Points",
"ADBE Vector Temporal Freq",
"ADBE Vector Correlation",
"ADBE Vector Temporal Phase",
"ADBE Vector Spatial Phase",
"ADBE Vector Random Seed"
]
])
);
let (_, c) = comp_named(&s, "W");
let sh = c.layers.iter().find(|l| l.props.sub("contents").is_some()).unwrap();
assert_eq!(sh.props.prop("contents/wiggle/spatialPhase").unwrap().value, KV::Scalar(45.0));
}
#[test]
fn match_names_and_lookups() {
let mut s = session();
@@ -456,6 +494,38 @@ fn layers_items_and_markers() {
);
}
#[test]
fn folder_paths_trim_trailing_separators() {
let mut s = session();
let o = ok(
&mut s,
r#"
var paths = ['', '/', '///', 'a/b/', 'a\\b\\/', 'a/b', 'a/\n'];
var result = paths.map(function (path) {
var folder = new Folder(path);
return [folder.name, folder.path, __join(path, 'child')];
});
// A long run followed by a non-separator used to cause quadratic regex backtracking.
var longPath = Array(20001).join('/') + 'x';
result.push([new Folder(longPath).name, new Folder(longPath).path.length, __join(longPath, 'child').length]);
result
"#,
);
assert_eq!(
o.result,
json!([
["", "", "/child"],
["", "", "/child"],
["", "", "/child"],
["b", "a", "a/b/child"],
["b", "a", "a\\b/child"],
["b", "a", "a/b/child"],
["\n", "a", "a/\n/child"],
["x", 19999, 20007]
])
);
}
#[test]
fn security_gate_for_files() {
let dir = std::env::temp_dir().join(format!("ec-script-gate-{}", std::process::id()));