Mission Control Dashboard - Initial implementation
This commit is contained in:
21
node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs
generated
vendored
Normal file
21
node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { MotionGlobalConfig } from 'motion-utils';
|
||||
import { isWillChangeMotionValue } from './is.mjs';
|
||||
|
||||
function addValueToWillChange(visualElement, key) {
|
||||
const willChange = visualElement.getValue("willChange");
|
||||
/**
|
||||
* It could be that a user has set willChange to a regular MotionValue,
|
||||
* in which case we can't add the value to it.
|
||||
*/
|
||||
if (isWillChangeMotionValue(willChange)) {
|
||||
return willChange.add(key);
|
||||
}
|
||||
else if (!willChange && MotionGlobalConfig.WillChange) {
|
||||
const newWillChange = new MotionGlobalConfig.WillChange("auto");
|
||||
visualElement.addValue("willChange", newWillChange);
|
||||
newWillChange.add(key);
|
||||
}
|
||||
}
|
||||
|
||||
export { addValueToWillChange };
|
||||
//# sourceMappingURL=add-will-change.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"add-will-change.mjs","sources":["../../../../src/value/will-change/add-will-change.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,oBAAoB,CAChC,aAA4B,EAC5B,GAAW,EAAA;IAEX,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC;AAEvD;;;AAGG;AACH,IAAA,IAAI,uBAAuB,CAAC,UAAU,CAAC,EAAE;AACrC,QAAA,OAAO,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;IAC9B;AAAO,SAAA,IAAI,CAAC,UAAU,IAAI,kBAAkB,CAAC,UAAU,EAAE;QACrD,MAAM,aAAa,GAAG,IAAI,kBAAkB,CAAC,UAAU,CAAC,MAAM,CAAC;AAE/D,QAAA,aAAa,CAAC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;AACnD,QAAA,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC;IAC1B;AACJ;;;;"}
|
||||
8
node_modules/motion-dom/dist/es/value/will-change/is.mjs
generated
vendored
Normal file
8
node_modules/motion-dom/dist/es/value/will-change/is.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { isMotionValue } from '../utils/is-motion-value.mjs';
|
||||
|
||||
function isWillChangeMotionValue(value) {
|
||||
return Boolean(isMotionValue(value) && value.add);
|
||||
}
|
||||
|
||||
export { isWillChangeMotionValue };
|
||||
//# sourceMappingURL=is.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/value/will-change/is.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/value/will-change/is.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"is.mjs","sources":["../../../../src/value/will-change/is.ts"],"sourcesContent":["import { isMotionValue } from \"../utils/is-motion-value\"\nimport type { WillChange } from \"./types\"\n\nexport function isWillChangeMotionValue(value: any): value is WillChange {\n return Boolean(isMotionValue(value) && (value as WillChange).add)\n}\n"],"names":[],"mappings":";;AAGM,SAAU,uBAAuB,CAAC,KAAU,EAAA;IAC9C,OAAO,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,IAAK,KAAoB,CAAC,GAAG,CAAC;AACrE;;;;"}
|
||||
Reference in New Issue
Block a user