Mission Control Dashboard - Initial implementation
This commit is contained in:
4
node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs
generated
vendored
Normal file
4
node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
const compareByDepth = (a, b) => a.depth - b.depth;
|
||||
|
||||
export { compareByDepth };
|
||||
//# sourceMappingURL=compare-by-depth.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"compare-by-depth.mjs","sources":["../../../../src/projection/utils/compare-by-depth.ts"],"sourcesContent":["import type { VisualElement } from \"../../render/VisualElement\"\n\nexport interface WithDepth {\n depth: number\n}\n\nexport const compareByDepth = (a: VisualElement, b: VisualElement) =>\n a.depth - b.depth\n"],"names":[],"mappings":"AAMO,MAAM,cAAc,GAAG,CAAC,CAAgB,EAAE,CAAgB,KAC7D,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;;;;"}
|
||||
6
node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs
generated
vendored
Normal file
6
node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
function eachAxis(callback) {
|
||||
return [callback("x"), callback("y")];
|
||||
}
|
||||
|
||||
export { eachAxis };
|
||||
//# sourceMappingURL=each-axis.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"each-axis.mjs","sources":["../../../../src/projection/utils/each-axis.ts"],"sourcesContent":["type Callback = (axis: \"x\" | \"y\") => void\n\nexport function eachAxis(callback: Callback) {\n return [callback(\"x\"), callback(\"y\")]\n}\n"],"names":[],"mappings":"AAEM,SAAU,QAAQ,CAAC,QAAkB,EAAA;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AACzC;;;;"}
|
||||
25
node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs
generated
vendored
Normal file
25
node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { addUniqueItem, removeItem } from 'motion-utils';
|
||||
import { compareByDepth } from './compare-by-depth.mjs';
|
||||
|
||||
class FlatTree {
|
||||
constructor() {
|
||||
this.children = [];
|
||||
this.isDirty = false;
|
||||
}
|
||||
add(child) {
|
||||
addUniqueItem(this.children, child);
|
||||
this.isDirty = true;
|
||||
}
|
||||
remove(child) {
|
||||
removeItem(this.children, child);
|
||||
this.isDirty = true;
|
||||
}
|
||||
forEach(callback) {
|
||||
this.isDirty && this.children.sort(compareByDepth);
|
||||
this.isDirty = false;
|
||||
this.children.forEach(callback);
|
||||
}
|
||||
}
|
||||
|
||||
export { FlatTree };
|
||||
//# sourceMappingURL=flat-tree.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"flat-tree.mjs","sources":["../../../../src/projection/utils/flat-tree.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { compareByDepth, WithDepth } from \"./compare-by-depth\"\n\nexport class FlatTree {\n private children: WithDepth[] = []\n\n private isDirty: boolean = false\n\n add(child: WithDepth) {\n addUniqueItem(this.children, child)\n this.isDirty = true\n }\n\n remove(child: WithDepth) {\n removeItem(this.children, child)\n this.isDirty = true\n }\n\n forEach(callback: (child: WithDepth) => void) {\n this.isDirty && this.children.sort(compareByDepth)\n this.isDirty = false\n this.children.forEach(callback)\n }\n}\n"],"names":[],"mappings":";;;MAGa,QAAQ,CAAA;AAArB,IAAA,WAAA,GAAA;QACY,IAAA,CAAA,QAAQ,GAAgB,EAAE;QAE1B,IAAA,CAAA,OAAO,GAAY,KAAK;IAiBpC;AAfI,IAAA,GAAG,CAAC,KAAgB,EAAA;AAChB,QAAA,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;AACnC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;IACvB;AAEA,IAAA,MAAM,CAAC,KAAgB,EAAA;AACnB,QAAA,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;AAChC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;IACvB;AAEA,IAAA,OAAO,CAAC,QAAoC,EAAA;QACxC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC;AAClD,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;IACnC;AACH;;;;"}
|
||||
27
node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs
generated
vendored
Normal file
27
node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
function isIdentityScale(scale) {
|
||||
return scale === undefined || scale === 1;
|
||||
}
|
||||
function hasScale({ scale, scaleX, scaleY }) {
|
||||
return (!isIdentityScale(scale) ||
|
||||
!isIdentityScale(scaleX) ||
|
||||
!isIdentityScale(scaleY));
|
||||
}
|
||||
function hasTransform(values) {
|
||||
return (hasScale(values) ||
|
||||
has2DTranslate(values) ||
|
||||
values.z ||
|
||||
values.rotate ||
|
||||
values.rotateX ||
|
||||
values.rotateY ||
|
||||
values.skewX ||
|
||||
values.skewY);
|
||||
}
|
||||
function has2DTranslate(values) {
|
||||
return is2DTranslate(values.x) || is2DTranslate(values.y);
|
||||
}
|
||||
function is2DTranslate(value) {
|
||||
return value && value !== "0%";
|
||||
}
|
||||
|
||||
export { has2DTranslate, hasScale, hasTransform };
|
||||
//# sourceMappingURL=has-transform.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"has-transform.mjs","sources":["../../../../src/projection/utils/has-transform.ts"],"sourcesContent":["import { type AnyResolvedKeyframe } from \"../../animation/types\"\nimport { ResolvedValues } from \"../../render/types\"\n\nfunction isIdentityScale(scale: AnyResolvedKeyframe | undefined) {\n return scale === undefined || scale === 1\n}\n\nexport function hasScale({ scale, scaleX, scaleY }: ResolvedValues) {\n return (\n !isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY)\n )\n}\n\nexport function hasTransform(values: ResolvedValues) {\n return (\n hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY\n )\n}\n\nexport function has2DTranslate(values: ResolvedValues) {\n return is2DTranslate(values.x) || is2DTranslate(values.y)\n}\n\nfunction is2DTranslate(value: AnyResolvedKeyframe | undefined) {\n return value && value !== \"0%\"\n}\n"],"names":[],"mappings":"AAGA,SAAS,eAAe,CAAC,KAAsC,EAAA;AAC3D,IAAA,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,CAAC;AAC7C;AAEM,SAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAkB,EAAA;AAC9D,IAAA,QACI,CAAC,eAAe,CAAC,KAAK,CAAC;QACvB,CAAC,eAAe,CAAC,MAAM,CAAC;AACxB,QAAA,CAAC,eAAe,CAAC,MAAM,CAAC;AAEhC;AAEM,SAAU,YAAY,CAAC,MAAsB,EAAA;AAC/C,IAAA,QACI,QAAQ,CAAC,MAAM,CAAC;QAChB,cAAc,CAAC,MAAM,CAAC;AACtB,QAAA,MAAM,CAAC,CAAC;AACR,QAAA,MAAM,CAAC,MAAM;AACb,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,KAAK;QACZ,MAAM,CAAC,KAAK;AAEpB;AAEM,SAAU,cAAc,CAAC,MAAsB,EAAA;AACjD,IAAA,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7D;AAEA,SAAS,aAAa,CAAC,KAAsC,EAAA;AACzD,IAAA,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI;AAClC;;;;"}
|
||||
18
node_modules/motion-dom/dist/es/projection/utils/measure.mjs
generated
vendored
Normal file
18
node_modules/motion-dom/dist/es/projection/utils/measure.mjs
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';
|
||||
import { translateAxis } from '../geometry/delta-apply.mjs';
|
||||
|
||||
function measureViewportBox(instance, transformPoint) {
|
||||
return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));
|
||||
}
|
||||
function measurePageBox(element, rootProjectionNode, transformPagePoint) {
|
||||
const viewportBox = measureViewportBox(element, transformPagePoint);
|
||||
const { scroll } = rootProjectionNode;
|
||||
if (scroll) {
|
||||
translateAxis(viewportBox.x, scroll.offset.x);
|
||||
translateAxis(viewportBox.y, scroll.offset.y);
|
||||
}
|
||||
return viewportBox;
|
||||
}
|
||||
|
||||
export { measurePageBox, measureViewportBox };
|
||||
//# sourceMappingURL=measure.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"measure.mjs","sources":["../../../../src/projection/utils/measure.ts"],"sourcesContent":["import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n"],"names":[],"mappings":";;;AAOM,SAAU,kBAAkB,CAC9B,QAAqB,EACrB,cAA+B,EAAA;AAE/B,IAAA,OAAO,uBAAuB,CAC1B,kBAAkB,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,cAAc,CAAC,CACvE;AACL;SAEgB,cAAc,CAC1B,OAAoB,EACpB,kBAAuB,EACvB,kBAAmC,EAAA;IAEnC,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC;AACnE,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAErC,IAAI,MAAM,EAAE;QACR,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7C,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD;AAEA,IAAA,OAAO,WAAW;AACtB;;;;"}
|
||||
Reference in New Issue
Block a user