@getcortexlabs/mavis 0.1.0-alpha.6 → 0.1.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/native/collection-motion.d.ts +5 -0
- package/dist/native/collection-motion.d.ts.map +1 -0
- package/dist/native/collection-motion.js +157 -0
- package/dist/native/collection-motion.js.map +1 -0
- package/dist/native/image-effects.d.ts +11 -0
- package/dist/native/image-effects.d.ts.map +1 -0
- package/dist/native/image-effects.js +61 -0
- package/dist/native/image-effects.js.map +1 -0
- package/dist/native/motion-owner.d.ts.map +1 -1
- package/dist/native/motion-owner.js +1 -0
- package/dist/native/motion-owner.js.map +1 -1
- package/dist/native/motion-region.d.ts.map +1 -1
- package/dist/native/motion-region.js +7 -2
- package/dist/native/motion-region.js.map +1 -1
- package/dist/native/motion-surface.d.ts +2 -2
- package/dist/native/motion-surface.d.ts.map +1 -1
- package/dist/native/motion-surface.js +55 -2
- package/dist/native/motion-surface.js.map +1 -1
- package/dist/native/platform-motion.d.ts +5 -0
- package/dist/native/platform-motion.d.ts.map +1 -0
- package/dist/native/platform-motion.js +90 -0
- package/dist/native/platform-motion.js.map +1 -0
- package/dist/native/press.d.ts +2 -0
- package/dist/native/press.d.ts.map +1 -1
- package/dist/native/press.js +6 -0
- package/dist/native/press.js.map +1 -1
- package/dist/native/surface-effects.d.ts +4 -0
- package/dist/native/surface-effects.d.ts.map +1 -0
- package/dist/native/surface-effects.js +31 -0
- package/dist/native/surface-effects.js.map +1 -0
- package/dist/native/visual-effects.d.ts +5 -0
- package/dist/native/visual-effects.d.ts.map +1 -0
- package/dist/native/visual-effects.js +126 -0
- package/dist/native/visual-effects.js.map +1 -0
- package/dist/vue/components/ChoiceControl.d.ts.map +1 -1
- package/dist/vue/components/ChoiceControl.js +20 -5
- package/dist/vue/components/ChoiceControl.js.map +1 -1
- package/dist/vue/components/DateCalendar.d.ts +3 -3
- package/dist/vue/components/LoadingDecoration.d.ts +116 -0
- package/dist/vue/components/LoadingDecoration.d.ts.map +1 -0
- package/dist/vue/components/LoadingDecoration.js +34 -0
- package/dist/vue/components/LoadingDecoration.js.map +1 -0
- package/dist/vue/components/MAlert.d.ts +1 -1
- package/dist/vue/components/MAvatar.d.ts +1 -1
- package/dist/vue/components/MBadge.d.ts +1 -1
- package/dist/vue/components/MButton.d.ts +36 -14
- package/dist/vue/components/MButton.d.ts.map +1 -1
- package/dist/vue/components/MButton.js +29 -2
- package/dist/vue/components/MButton.js.map +1 -1
- package/dist/vue/components/MCard.d.ts +6 -6
- package/dist/vue/components/MChip.d.ts +3 -3
- package/dist/vue/components/MCombobox.d.ts +2 -2
- package/dist/vue/components/MDatePicker.d.ts +16 -16
- package/dist/vue/components/MDialog.d.ts +4 -1
- package/dist/vue/components/MDialog.d.ts.map +1 -1
- package/dist/vue/components/MEmptyState.d.ts +2 -2
- package/dist/vue/components/MFilePicker.d.ts +2 -2
- package/dist/vue/components/MIcon.d.ts +19 -1
- package/dist/vue/components/MIcon.d.ts.map +1 -1
- package/dist/vue/components/MIcon.js +13 -2
- package/dist/vue/components/MIcon.js.map +1 -1
- package/dist/vue/components/MImage.d.ts +203 -0
- package/dist/vue/components/MImage.d.ts.map +1 -0
- package/dist/vue/components/MImage.js +157 -0
- package/dist/vue/components/MImage.js.map +1 -0
- package/dist/vue/components/MInput.d.ts +4 -4
- package/dist/vue/components/MInput.d.ts.map +1 -1
- package/dist/vue/components/MInput.js +9 -5
- package/dist/vue/components/MInput.js.map +1 -1
- package/dist/vue/components/MLink.d.ts +3 -3
- package/dist/vue/components/MListItem.d.ts +1 -1
- package/dist/vue/components/MProgress.d.ts +2 -2
- package/dist/vue/components/MReveal.d.ts +11 -11
- package/dist/vue/components/MScreen.d.ts +11 -1
- package/dist/vue/components/MScreen.d.ts.map +1 -1
- package/dist/vue/components/MScreen.js +26 -4
- package/dist/vue/components/MScreen.js.map +1 -1
- package/dist/vue/components/MSelect.d.ts +1 -1
- package/dist/vue/components/MSheet.d.ts +4 -4
- package/dist/vue/components/MSkeleton.d.ts +11 -0
- package/dist/vue/components/MSkeleton.d.ts.map +1 -1
- package/dist/vue/components/MSkeleton.js +5 -3
- package/dist/vue/components/MSkeleton.js.map +1 -1
- package/dist/vue/components/MStack.d.ts +11 -11
- package/dist/vue/components/MSwitch.d.ts.map +1 -1
- package/dist/vue/components/MSwitch.js +13 -3
- package/dist/vue/components/MSwitch.js.map +1 -1
- package/dist/vue/components/MText.d.ts +15 -4
- package/dist/vue/components/MText.d.ts.map +1 -1
- package/dist/vue/components/MText.js +3 -1
- package/dist/vue/components/MText.js.map +1 -1
- package/dist/vue/components/configurator.d.ts +541 -0
- package/dist/vue/components/configurator.d.ts.map +1 -0
- package/dist/vue/components/configurator.js +24 -0
- package/dist/vue/components/configurator.js.map +1 -0
- package/dist/vue/components/layout.d.ts +35 -24
- package/dist/vue/components/layout.d.ts.map +1 -1
- package/dist/vue/components/layout.js +3 -1
- package/dist/vue/components/layout.js.map +1 -1
- package/dist/vue/components/workflows.d.ts +1 -1
- package/dist/vue/index.d.ts +3 -1
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +6 -1
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/use-choice-paint.d.ts +9 -0
- package/dist/vue/use-choice-paint.d.ts.map +1 -0
- package/dist/vue/use-choice-paint.js +32 -0
- package/dist/vue/use-choice-paint.js.map +1 -0
- package/dist/vue/use-motion-surface.d.ts +1 -1
- package/dist/vue/use-motion-surface.d.ts.map +1 -1
- package/dist/vue/use-motion-surface.js +31 -2
- package/dist/vue/use-motion-surface.js.map +1 -1
- package/package.json +3 -3
- package/src/native/collection-motion.ts +166 -0
- package/src/native/image-effects.ts +71 -0
- package/src/native/motion-owner.ts +1 -0
- package/src/native/motion-region.ts +7 -2
- package/src/native/motion-surface.ts +63 -3
- package/src/native/platform-motion.ts +103 -0
- package/src/native/press.ts +6 -0
- package/src/native/surface-effects.ts +33 -0
- package/src/native/visual-effects.ts +147 -0
- package/src/vue/components/ChoiceControl.ts +25 -5
- package/src/vue/components/LoadingDecoration.ts +38 -0
- package/src/vue/components/MButton.ts +33 -2
- package/src/vue/components/MIcon.ts +14 -2
- package/src/vue/components/MImage.ts +181 -0
- package/src/vue/components/MInput.ts +9 -5
- package/src/vue/components/MScreen.ts +31 -3
- package/src/vue/components/MSkeleton.ts +5 -3
- package/src/vue/components/MSwitch.ts +16 -3
- package/src/vue/components/MText.ts +7 -0
- package/src/vue/components/configurator.ts +27 -0
- package/src/vue/components/layout.ts +3 -0
- package/src/vue/index.ts +8 -0
- package/src/vue/use-choice-paint.ts +39 -0
- package/src/vue/use-motion-surface.ts +32 -1
- package/dist/vue/reveal-motion.d.ts +0 -13
- package/dist/vue/reveal-motion.d.ts.map +0 -1
- package/dist/vue/reveal-motion.js +0 -58
- package/dist/vue/reveal-motion.js.map +0 -1
|
@@ -12,12 +12,20 @@ import { nativeMotionOwner } from '../native/motion-owner.js'
|
|
|
12
12
|
export function useMotionSurface(
|
|
13
13
|
surface: () => MotionSurface | undefined,
|
|
14
14
|
enabled: () => boolean = () => true,
|
|
15
|
+
plainText: () => boolean = () => false,
|
|
16
|
+
afterLayout = false,
|
|
15
17
|
) {
|
|
16
18
|
let view: View | undefined
|
|
17
19
|
let unbind: (() => void) | undefined
|
|
18
20
|
let offPreference: (() => void) | undefined
|
|
19
21
|
let continuous: ReturnType<typeof nativeContinuousSurface> | undefined
|
|
20
22
|
const active = new Map<ReturnType<typeof animate>, MotionFrames>()
|
|
23
|
+
let layoutView: View | undefined
|
|
24
|
+
let layoutQueued = false
|
|
25
|
+
const clearLayout = () => {
|
|
26
|
+
layoutView?.off('layoutChanged', laidOut)
|
|
27
|
+
layoutView = undefined
|
|
28
|
+
}
|
|
21
29
|
const release = () => {
|
|
22
30
|
unbind?.()
|
|
23
31
|
unbind = undefined
|
|
@@ -32,7 +40,21 @@ export function useMotionSurface(
|
|
|
32
40
|
const target = view
|
|
33
41
|
const reference = surface()
|
|
34
42
|
if (!target || !reference) return
|
|
35
|
-
|
|
43
|
+
if (
|
|
44
|
+
afterLayout &&
|
|
45
|
+
(!target.isLayoutValid ||
|
|
46
|
+
target.getActualSize().width <= 0 ||
|
|
47
|
+
target.getActualSize().height <= 0)
|
|
48
|
+
) {
|
|
49
|
+
if (layoutView !== target) {
|
|
50
|
+
clearLayout()
|
|
51
|
+
layoutView = target
|
|
52
|
+
target.on('layoutChanged', laidOut)
|
|
53
|
+
}
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
clearLayout()
|
|
57
|
+
continuous = nativeContinuousSurface(target, enabled, plainText)
|
|
36
58
|
unbind = bindMotionSurface(
|
|
37
59
|
reference,
|
|
38
60
|
nativeMotionOwner(
|
|
@@ -66,7 +88,16 @@ export function useMotionSurface(
|
|
|
66
88
|
if (Object.keys(values).length) set(target, values)
|
|
67
89
|
})
|
|
68
90
|
}
|
|
91
|
+
const laidOut = () => {
|
|
92
|
+
if (layoutQueued) return
|
|
93
|
+
layoutQueued = true
|
|
94
|
+
void Promise.resolve().then(() => {
|
|
95
|
+
layoutQueued = false
|
|
96
|
+
if (view) bind()
|
|
97
|
+
})
|
|
98
|
+
}
|
|
69
99
|
const unloaded = () => {
|
|
100
|
+
clearLayout()
|
|
70
101
|
release()
|
|
71
102
|
view = undefined
|
|
72
103
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { View } from '@nativescript/core';
|
|
2
|
-
type Element = {
|
|
3
|
-
nativeView: View;
|
|
4
|
-
};
|
|
5
|
-
/** Each transition owns its completion; an interrupted leave cannot finish a new entry. */
|
|
6
|
-
export declare function useRevealMotion(): {
|
|
7
|
-
onEnter: (element: Element, done: () => void) => void;
|
|
8
|
-
onLeave: (element: Element, done: () => void) => void;
|
|
9
|
-
onEnterCancelled: ({ nativeView: view }: Element) => void;
|
|
10
|
-
onLeaveCancelled: ({ nativeView: view }: Element) => void;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=reveal-motion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reveal-motion.d.ts","sourceRoot":"","sources":["../../src/vue/reveal-motion.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAI9C,KAAK,OAAO,GAAG;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,CAAA;AAEnC,2FAA2F;AAC3F,wBAAgB,eAAe;uBAcuB,OAAO,QAAQ,MAAM,IAAI;uBAAzB,OAAO,QAAQ,MAAM,IAAI;6CAPvC,OAAO;6CAAP,OAAO;EA+C9C"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { onBeforeUnmount } from 'nativescript-vue';
|
|
2
|
-
import { useMavisTheme } from '@getcortexlabs/mavis-core/vue';
|
|
3
|
-
import { animate, set, onReducedMotion } from '@rafaelaugusto/jolt';
|
|
4
|
-
import { motionRecipe } from '@getcortexlabs/mavis-core';
|
|
5
|
-
/** Each transition owns its completion; an interrupted leave cannot finish a new entry. */
|
|
6
|
-
export function useRevealMotion() {
|
|
7
|
-
const { theme } = useMavisTheme();
|
|
8
|
-
const entered = new WeakSet();
|
|
9
|
-
const active = new Map();
|
|
10
|
-
const cancel = ({ nativeView: view }) => {
|
|
11
|
-
const operation = active.get(view);
|
|
12
|
-
if (!operation)
|
|
13
|
-
return;
|
|
14
|
-
active.delete(view);
|
|
15
|
-
operation.remove();
|
|
16
|
-
operation.handle.stop();
|
|
17
|
-
};
|
|
18
|
-
const run = (phase) => (element, done) => {
|
|
19
|
-
const recipe = motionRecipe(theme.value, phase === 'enter' ? 'enter' : 'exit');
|
|
20
|
-
const view = element.nativeView;
|
|
21
|
-
cancel(element);
|
|
22
|
-
if (phase === 'enter' && !entered.has(view)) {
|
|
23
|
-
entered.add(view);
|
|
24
|
-
set(view, { opacity: 0, y: theme.value.motion.enterOffset });
|
|
25
|
-
}
|
|
26
|
-
const handle = animate(view, phase === 'enter' ? { opacity: 1, y: 0 } : { opacity: 0 }, recipe.transition);
|
|
27
|
-
const unloaded = () => cancel(element);
|
|
28
|
-
const operation = { handle, phase, remove: () => view.off('unloaded', unloaded) };
|
|
29
|
-
active.set(view, operation);
|
|
30
|
-
view.on('unloaded', unloaded);
|
|
31
|
-
void handle.finished.then(() => {
|
|
32
|
-
if (active.get(view) !== operation)
|
|
33
|
-
return;
|
|
34
|
-
active.delete(view);
|
|
35
|
-
operation.remove();
|
|
36
|
-
done();
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
const offPreference = onReducedMotion((reduced) => {
|
|
40
|
-
if (reduced)
|
|
41
|
-
for (const [view, operation] of active) {
|
|
42
|
-
if (operation.phase === 'enter')
|
|
43
|
-
set(view, { y: 0 });
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
onBeforeUnmount(() => {
|
|
47
|
-
offPreference();
|
|
48
|
-
for (const view of active.keys())
|
|
49
|
-
cancel({ nativeView: view });
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
onEnter: run('enter'),
|
|
53
|
-
onLeave: run('leave'),
|
|
54
|
-
onEnterCancelled: cancel,
|
|
55
|
-
onLeaveCancelled: cancel,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=reveal-motion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reveal-motion.js","sourceRoot":"","sources":["../../src/vue/reveal-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAE7D,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAIxD,2FAA2F;AAC3F,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,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