Mission Control Dashboard - Initial implementation
This commit is contained in:
19
node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs
generated
vendored
Normal file
19
node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { resolveElements } from '../../utils/resolve-elements.mjs';
|
||||
|
||||
function createSelectorEffect(subjectEffect) {
|
||||
return (subject, values) => {
|
||||
const elements = resolveElements(subject);
|
||||
const subscriptions = [];
|
||||
for (const element of elements) {
|
||||
const remove = subjectEffect(element, values);
|
||||
subscriptions.push(remove);
|
||||
}
|
||||
return () => {
|
||||
for (const remove of subscriptions)
|
||||
remove();
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export { createSelectorEffect };
|
||||
//# sourceMappingURL=create-dom-effect.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create-dom-effect.mjs","sources":["../../../../src/effects/utils/create-dom-effect.ts"],"sourcesContent":["import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { MotionValue } from \"../../value\"\n\nexport function createSelectorEffect<T>(\n subjectEffect: (\n subject: T,\n values: Record<string, MotionValue>\n ) => VoidFunction\n) {\n return (\n subject: ElementOrSelector,\n values: Record<string, MotionValue>\n ) => {\n const elements = resolveElements(subject)\n const subscriptions: VoidFunction[] = []\n\n for (const element of elements) {\n const remove = subjectEffect(element as T, values)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const remove of subscriptions) remove()\n }\n }\n}\n"],"names":[],"mappings":";;AAMM,SAAU,oBAAoB,CAChC,aAGiB,EAAA;AAEjB,IAAA,OAAO,CACH,OAA0B,EAC1B,MAAmC,KACnC;AACA,QAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC;QACzC,MAAM,aAAa,GAAmB,EAAE;AAExC,QAAA,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,MAAM,MAAM,GAAG,aAAa,CAAC,OAAY,EAAE,MAAM,CAAC;AAClD,YAAA,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B;AAEA,QAAA,OAAO,MAAK;YACR,KAAK,MAAM,MAAM,IAAI,aAAa;AAAE,gBAAA,MAAM,EAAE;AAChD,QAAA,CAAC;AACL,IAAA,CAAC;AACL;;;;"}
|
||||
22
node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs
generated
vendored
Normal file
22
node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { MotionValueState } from '../MotionValueState.mjs';
|
||||
|
||||
function createEffect(addValue) {
|
||||
const stateCache = new WeakMap();
|
||||
return (subject, values) => {
|
||||
const state = stateCache.get(subject) ?? new MotionValueState();
|
||||
stateCache.set(subject, state);
|
||||
const subscriptions = [];
|
||||
for (const key in values) {
|
||||
const value = values[key];
|
||||
const remove = addValue(subject, state, key, value);
|
||||
subscriptions.push(remove);
|
||||
}
|
||||
return () => {
|
||||
for (const cancel of subscriptions)
|
||||
cancel();
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export { createEffect };
|
||||
//# sourceMappingURL=create-effect.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create-effect.mjs","sources":["../../../../src/effects/utils/create-effect.ts"],"sourcesContent":["import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nexport function createEffect<Subject extends object>(\n addValue: (\n subject: Subject,\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => VoidFunction\n) {\n const stateCache = new WeakMap<Subject, MotionValueState>()\n\n return (\n subject: Subject,\n values: Record<string, MotionValue>\n ): VoidFunction => {\n const state = stateCache.get(subject) ?? new MotionValueState()\n\n stateCache.set(subject, state)\n\n const subscriptions: VoidFunction[] = []\n\n for (const key in values) {\n const value = values[key]\n const remove = addValue(subject, state, key, value)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const cancel of subscriptions) cancel()\n }\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,YAAY,CACxB,QAKiB,EAAA;AAEjB,IAAA,MAAM,UAAU,GAAG,IAAI,OAAO,EAA6B;AAE3D,IAAA,OAAO,CACH,OAAgB,EAChB,MAAmC,KACrB;AACd,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,gBAAgB,EAAE;AAE/D,QAAA,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC;QAE9B,MAAM,aAAa,GAAmB,EAAE;AAExC,QAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;AACtB,YAAA,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;AACzB,YAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC;AACnD,YAAA,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B;AAEA,QAAA,OAAO,MAAK;YACR,KAAK,MAAM,MAAM,IAAI,aAAa;AAAE,gBAAA,MAAM,EAAE;AAChD,QAAA,CAAC;AACL,IAAA,CAAC;AACL;;;;"}
|
||||
Reference in New Issue
Block a user