feat(core): add sys:// support for SF Symbol usage on images with effects (#10555)

This commit is contained in:
Eduardo Speroni
2024-06-26 19:34:24 -03:00
committed by GitHub
parent 84e1a67d6d
commit d678915234
15 changed files with 269 additions and 13 deletions

View File

@@ -8,6 +8,7 @@ export * from './mainthread-helper';
export * from './macrotask-scheduler';
export const RESOURCE_PREFIX = 'res://';
export const SYSTEM_PREFIX = 'sys://';
export const FILE_PREFIX = 'file:///';
export function escapeRegexSymbols(source: string): string {
@@ -75,7 +76,8 @@ export function isFileOrResourcePath(path: string): boolean {
return (
path.indexOf('~/') === 0 || // relative to AppRoot
path.indexOf('/') === 0 || // absolute path
path.indexOf(RESOURCE_PREFIX) === 0
path.indexOf(RESOURCE_PREFIX) === 0 ||
path.indexOf(SYSTEM_PREFIX) === 0
); // resource
}
@@ -215,7 +217,7 @@ export function queueGC(delay = 900, useThrottle?: boolean) {
if (!throttledGC.get(delay)) {
throttledGC.set(
delay,
throttle(() => GC(), delay)
throttle(() => GC(), delay),
);
}
throttledGC.get(delay)();
@@ -226,7 +228,7 @@ export function queueGC(delay = 900, useThrottle?: boolean) {
if (!debouncedGC.get(delay)) {
debouncedGC.set(
delay,
debounce(() => GC(), delay)
debounce(() => GC(), delay),
);
}
debouncedGC.get(delay)();