@octane-xplat/lottie 0.0.1 → 0.9.0

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.
Files changed (58) hide show
  1. package/README.md +36 -2
  2. package/dist/native/cx.mobile.js +11 -0
  3. package/dist/native/escape-props.js +39 -0
  4. package/dist/native/index.js +182 -0
  5. package/dist/native/layout-child.js +38 -0
  6. package/dist/native/octane-client-build.json +8 -0
  7. package/dist/native/vendor/ui-lottie/index.android.js +286 -0
  8. package/dist/native/vendor/ui-lottie/index.ios.js +214 -0
  9. package/dist/native/vendor/ui-lottie/src/lottie/index.common.js +50 -0
  10. package/dist/native/vendor/ui-lottie/src/lottie/utils.js +6 -0
  11. package/dist/web/escape-props.web.js +17 -0
  12. package/dist/web/index.js +332 -0
  13. package/dist/web/layout-child.web.js +47 -0
  14. package/dist/web/octane-client-build.json +8 -0
  15. package/package.json +81 -10
  16. package/platforms/android/include.gradle +7 -0
  17. package/platforms/android/java/com/nativescript/lottie/LottieAnimationView.java +92 -0
  18. package/platforms/android/lottie.aar +0 -0
  19. package/platforms/android/native-api-usage.json +16 -0
  20. package/platforms/ios/Podfile +5 -0
  21. package/src/Lottie.tsrx +161 -0
  22. package/src/Lottie.web.tsrx +135 -0
  23. package/src/cx.mobile.ts +8 -0
  24. package/src/escape-props.ts +65 -0
  25. package/src/escape-props.web.ts +25 -0
  26. package/src/index.ts +2 -0
  27. package/src/index.web.ts +2 -0
  28. package/src/layout-child.ts +57 -0
  29. package/src/layout-child.web.ts +108 -0
  30. package/src/native-elements.d.ts +8 -0
  31. package/src/props.ts +128 -0
  32. package/src/references.d.ts +3 -0
  33. package/src/vendor/ui-lottie/LICENSE.md +21 -0
  34. package/src/vendor/ui-lottie/src/lottie/index.android.ts +447 -0
  35. package/src/vendor/ui-lottie/src/lottie/index.common.ts +84 -0
  36. package/src/vendor/ui-lottie/src/lottie/index.d.ts +133 -0
  37. package/src/vendor/ui-lottie/src/lottie/index.ios.ts +345 -0
  38. package/src/vendor/ui-lottie/src/lottie/typings/android.d.ts +4149 -0
  39. package/src/vendor/ui-lottie/src/lottie/typings/android.nativescript.d.ts +12 -0
  40. package/src/vendor/ui-lottie/src/lottie/typings/dotlottie.ios.d.ts +14 -0
  41. package/src/vendor/ui-lottie/src/lottie/typings/ios.d.ts +384 -0
  42. package/src/vendor/ui-lottie/src/lottie/utils.ts +9 -0
  43. package/types/generated/.tsrx-typegen-manifest.json +18 -0
  44. package/types/generated/Lottie.d.ts +7 -0
  45. package/types/generated/Lottie.web.d.ts +7 -0
  46. package/types/generated/cx.mobile.d.ts +6 -0
  47. package/types/generated/escape-props.d.ts +15 -0
  48. package/types/generated/escape-props.web.d.ts +5 -0
  49. package/types/generated/index.d.ts +2 -0
  50. package/types/generated/index.web.d.ts +2 -0
  51. package/types/generated/layout-child.d.ts +6 -0
  52. package/types/generated/layout-child.web.d.ts +15 -0
  53. package/types/generated/props.d.ts +106 -0
  54. package/types/generated/vendor/ui-lottie/src/lottie/index.common.d.ts +30 -0
  55. package/types/generated/vendor/ui-lottie/src/lottie/index.ios.d.ts +35 -0
  56. package/types/generated/vendor/ui-lottie/src/lottie/utils.d.ts +1 -0
  57. package/index.d.ts +0 -1
  58. package/index.js +0 -2
@@ -0,0 +1,214 @@
1
+ import { LottieViewBase, autoPlayProperty, keyPathColorsProperty, loopProperty, progressProperty, srcProperty, stretchProperty } from "./src/lottie/index.common.js";
2
+ import { clamp } from "./src/lottie/utils.js";
3
+ import { Color, Http, Utils, View, knownFolders, path } from "@nativescript/core";
4
+ //#region src/vendor/ui-lottie/src/lottie/index.ios.ts
5
+ /**********************************************************************************
6
+ * (c) 2017, Nathan Walker.
7
+ * Licensed under the MIT license.
8
+ *
9
+ * Version 1.0.0 walkerrunpdx@gmail.com
10
+ **********************************************************************************/
11
+ var appPath = knownFolders.currentApp().path;
12
+ CompatibleLottieLogger.overrideLottieLogger();
13
+ var LottieView = class LottieView extends LottieViewBase {
14
+ constructor(..._args) {
15
+ super(..._args);
16
+ this._imageSourceAffectsLayout = true;
17
+ }
18
+ createNativeView() {
19
+ return CompatibleAnimationView.new();
20
+ }
21
+ initNativeView() {
22
+ super.initNativeView();
23
+ this.nativeViewProtected.translatesAutoresizingMaskIntoConstraints = true;
24
+ }
25
+ onLoaded() {
26
+ super.onLoaded();
27
+ if (this.autoPlay && !this.isAnimating()) this.playAnimation();
28
+ }
29
+ [keyPathColorsProperty.setNative](value) {
30
+ Object.keys(value).forEach((k) => this.setColor(value[k], k.split("|")));
31
+ }
32
+ [srcProperty.setNative](src) {
33
+ try {
34
+ if (!src) this.nativeViewProtected.compatibleAnimation = null;
35
+ else if (src[0] === "{") this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithJson(src);
36
+ else if (src.startsWith(Utils.RESOURCE_PREFIX)) {
37
+ const resName = src.replace(Utils.RESOURCE_PREFIX, "");
38
+ this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithNameBundle(resName.replace(".json", "").replace(".lottie", ""), NSBundle.mainBundle);
39
+ } else if (/^https?:/i.test(src)) {
40
+ const match = /\.(zip|lottie|json)(?=[?#]|$)/i.exec(src);
41
+ const dest = path.join(knownFolders.temp().path, `lottie-${Date.now()}${match ? match[0].toLowerCase() : ".json"}`);
42
+ Http.getFile(src, dest).then(() => {
43
+ this.src = dest;
44
+ }).catch((error) => {
45
+ console.error(error);
46
+ this.notify({
47
+ eventName: "loadFailed",
48
+ error
49
+ });
50
+ });
51
+ } else {
52
+ if (src[0] === "~") src = `${path.join(appPath, src.substring(2))}`;
53
+ if (!/.(json|zip|lottie)$/.test(src)) src += ".json";
54
+ if (!src.startsWith("file:/") && src[0] !== "/") this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithNameSubdirectoryBundle(src.replace(".json", "").replace(".lottie", ""), null, NSBundle.mainBundle);
55
+ else this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithFilepath(src);
56
+ }
57
+ if (this.keyPathColors) this[keyPathColorsProperty.setNative](this.keyPathColors);
58
+ if (this._imageSourceAffectsLayout) this.requestLayout();
59
+ if (this.autoPlay && !this.isAnimating()) this.playAnimation();
60
+ if (src && !/^https?:/i.test(src)) {
61
+ const view = this.nativeViewProtected;
62
+ setTimeout(() => {
63
+ if (view && view.compatibleAnimation && view.animationDuration >= 0) this.notify({
64
+ eventName: LottieViewBase.compositionLoadedEvent,
65
+ composition: view.compatibleAnimation
66
+ });
67
+ else this.notify({
68
+ eventName: LottieViewBase.loadFailedEvent,
69
+ error: src
70
+ });
71
+ }, 0);
72
+ }
73
+ } catch (error) {
74
+ console.error(error);
75
+ this.notify({
76
+ eventName: LottieViewBase.loadFailedEvent,
77
+ error
78
+ });
79
+ }
80
+ }
81
+ [loopProperty.setNative](loop) {
82
+ this.nativeViewProtected.loopAnimationCount = loop ? -1 : 0;
83
+ }
84
+ [autoPlayProperty.setNative](autoPlay) {
85
+ if (autoPlay) {
86
+ if (!this.isAnimating()) this.playAnimation();
87
+ } else if (this.isAnimating()) this.cancelAnimation();
88
+ }
89
+ setColor(value, keyPath) {
90
+ if (this.nativeView && value && keyPath && keyPath.length) {
91
+ if (keyPath[keyPath.length - 1].toLowerCase() !== "color") {
92
+ keyPath = [...keyPath];
93
+ keyPath.push("Color");
94
+ }
95
+ const color = value instanceof Color ? value : new Color(value);
96
+ this.nativeViewProtected.setColorValueForKeypath(color.ios, CompatibleAnimationKeypath.alloc().initWithKeypath(keyPath.join(".")));
97
+ }
98
+ }
99
+ setOpacity(value, keyPath) {
100
+ if (this.nativeView && value != null && keyPath && keyPath.length) {
101
+ keyPath = [...keyPath];
102
+ if (keyPath[keyPath.length - 1].toLowerCase() !== "opacity") keyPath.push("Opacity");
103
+ this.nativeViewProtected.setFloatValueForKeypath(clamp(value) * 100, CompatibleAnimationKeypath.alloc().initWithKeypath(keyPath.join(".")));
104
+ }
105
+ }
106
+ playAnimation() {
107
+ setTimeout(() => {
108
+ if (this.nativeViewProtected) {
109
+ if (this.completionBlock) this.nativeViewProtected.playWithCompletion((animationFinished) => {
110
+ if (this.completionBlock) this.completionBlock(animationFinished);
111
+ });
112
+ else this.nativeViewProtected.play();
113
+ }
114
+ }, 0);
115
+ }
116
+ playAnimationFromProgressToProgress(startProgress, endProgress) {
117
+ if (this.nativeViewProtected) {
118
+ startProgress = startProgress ? clamp(startProgress) : 0;
119
+ endProgress = endProgress ? clamp(endProgress) : 1;
120
+ if (this.completionBlock) this.nativeViewProtected.playFromProgressToProgressCompletion(startProgress, endProgress, this.completionBlock);
121
+ else this.nativeViewProtected.playFromProgressToProgressCompletion(startProgress, endProgress, null);
122
+ }
123
+ }
124
+ cancelAnimation() {
125
+ if (this.nativeViewProtected) this.nativeViewProtected.pause();
126
+ }
127
+ pauseAnimation() {
128
+ if (this.nativeViewProtected) this.nativeViewProtected.pause();
129
+ }
130
+ resumeAnimation() {
131
+ if (this.nativeViewProtected) this.nativeViewProtected.play();
132
+ }
133
+ isAnimating() {
134
+ return this.nativeView ? this.nativeViewProtected.isAnimationPlaying : false;
135
+ }
136
+ [progressProperty.setNative](value) {
137
+ this.nativeViewProtected.currentProgress = value;
138
+ }
139
+ set speed(value) {
140
+ if (this.nativeView && value) this.nativeViewProtected.animationSpeed = value;
141
+ }
142
+ get speed() {
143
+ return this.nativeView ? this.nativeViewProtected.animationSpeed : void 0;
144
+ }
145
+ get duration() {
146
+ return this.nativeView && this.nativeViewProtected.animationDuration;
147
+ }
148
+ set contentMode(mode) {
149
+ if (this.nativeViewProtected) this.nativeViewProtected.contentMode = mode;
150
+ }
151
+ onMeasure(widthMeasureSpec, heightMeasureSpec) {
152
+ const intrinsicContentSize = this.nativeViewProtected.intrinsicContentSize;
153
+ const width = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
154
+ const widthMode = Utils.layout.getMeasureSpecMode(widthMeasureSpec);
155
+ const height = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
156
+ const heightMode = Utils.layout.getMeasureSpecMode(heightMeasureSpec);
157
+ const nativeWidth = intrinsicContentSize ? Utils.layout.toDevicePixels(intrinsicContentSize.width) : 0;
158
+ const nativeHeight = intrinsicContentSize ? Utils.layout.toDevicePixels(intrinsicContentSize.height) : 0;
159
+ let measureWidth = Math.max(nativeWidth, this.effectiveMinWidth);
160
+ let measureHeight = Math.max(nativeHeight, this.effectiveMinHeight);
161
+ const finiteWidth = widthMode !== Utils.layout.UNSPECIFIED;
162
+ const finiteHeight = heightMode !== Utils.layout.UNSPECIFIED;
163
+ this._imageSourceAffectsLayout = widthMode !== Utils.layout.EXACTLY || heightMode !== Utils.layout.EXACTLY;
164
+ if (nativeWidth !== 0 && nativeHeight !== 0 && (finiteWidth || finiteHeight)) {
165
+ const scale = LottieView.computeScaleFactor(width, height, finiteWidth, finiteHeight, nativeWidth, nativeHeight, this.stretch);
166
+ const resultW = Math.round(nativeWidth * scale.width);
167
+ const resultH = Math.round(nativeHeight * scale.height);
168
+ measureWidth = finiteWidth ? Math.min(resultW, width) : resultW;
169
+ measureHeight = finiteHeight ? Math.min(resultH, height) : resultH;
170
+ }
171
+ const widthAndState = View.resolveSizeAndState(measureWidth, width, widthMode, 0);
172
+ const heightAndState = View.resolveSizeAndState(measureHeight, height, heightMode, 0);
173
+ this.setMeasuredDimension(widthAndState, heightAndState);
174
+ }
175
+ static computeScaleFactor(measureWidth, measureHeight, widthIsFinite, heightIsFinite, nativeWidth, nativeHeight, imageStretch) {
176
+ let scaleW = 1;
177
+ let scaleH = 1;
178
+ if ((imageStretch === "aspectFill" || imageStretch === "aspectFit" || imageStretch === "fill") && (widthIsFinite || heightIsFinite)) {
179
+ scaleW = nativeWidth > 0 ? measureWidth / nativeWidth : 0;
180
+ scaleH = nativeHeight > 0 ? measureHeight / nativeHeight : 0;
181
+ if (!widthIsFinite) scaleW = scaleH;
182
+ else if (!heightIsFinite) scaleH = scaleW;
183
+ else switch (imageStretch) {
184
+ case "aspectFit":
185
+ scaleH = scaleW < scaleH ? scaleW : scaleH;
186
+ scaleW = scaleH;
187
+ break;
188
+ case "aspectFill":
189
+ scaleH = scaleW > scaleH ? scaleW : scaleH;
190
+ scaleW = scaleH;
191
+ }
192
+ }
193
+ return {
194
+ width: scaleW,
195
+ height: scaleH
196
+ };
197
+ }
198
+ [stretchProperty.setNative](value) {
199
+ switch (value) {
200
+ case "aspectFit":
201
+ this.nativeViewProtected.contentMode = UIViewContentMode.ScaleAspectFit;
202
+ break;
203
+ case "aspectFill":
204
+ this.nativeViewProtected.contentMode = UIViewContentMode.ScaleAspectFill;
205
+ break;
206
+ case "fill":
207
+ this.nativeViewProtected.contentMode = UIViewContentMode.ScaleToFill;
208
+ break;
209
+ default: this.nativeViewProtected.contentMode = UIViewContentMode.TopLeft;
210
+ }
211
+ }
212
+ };
213
+ //#endregion
214
+ export { LottieView };
@@ -0,0 +1,50 @@
1
+ import { Property, View, booleanConverter } from "@nativescript/core";
2
+ //#region src/vendor/ui-lottie/src/lottie/index.common.ts
3
+ /**********************************************************************************
4
+ * (c) 2017, Nathan Walker.
5
+ * Licensed under the MIT license.
6
+ *
7
+ * Version 1.0.0 walkerrunpdx@gmail.com
8
+ **********************************************************************************/
9
+ var LottieViewBase = class extends View {
10
+ static {
11
+ this.compositionLoadedEvent = "compositionLoaded";
12
+ }
13
+ static {
14
+ this.loadFailedEvent = "loadFailed";
15
+ }
16
+ };
17
+ var srcProperty = new Property({ name: "src" });
18
+ srcProperty.register(LottieViewBase);
19
+ var asyncProperty = new Property({
20
+ name: "async",
21
+ defaultValue: false,
22
+ valueConverter: booleanConverter
23
+ });
24
+ asyncProperty.register(LottieViewBase);
25
+ var loopProperty = new Property({
26
+ name: "loop",
27
+ defaultValue: false,
28
+ valueConverter: booleanConverter
29
+ });
30
+ loopProperty.register(LottieViewBase);
31
+ var autoPlayProperty = new Property({
32
+ name: "autoPlay",
33
+ defaultValue: false,
34
+ valueConverter: booleanConverter
35
+ });
36
+ autoPlayProperty.register(LottieViewBase);
37
+ var renderModeProperty = new Property({ name: "renderMode" });
38
+ renderModeProperty.register(LottieViewBase);
39
+ var progressProperty = new Property({ name: "progress" });
40
+ progressProperty.register(LottieViewBase);
41
+ var stretchProperty = new Property({
42
+ name: "stretch",
43
+ defaultValue: "aspectFit",
44
+ affectsLayout: global.isIOS
45
+ });
46
+ stretchProperty.register(LottieViewBase);
47
+ var keyPathColorsProperty = new Property({ name: "keyPathColors" });
48
+ keyPathColorsProperty.register(LottieViewBase);
49
+ //#endregion
50
+ export { LottieViewBase, asyncProperty, autoPlayProperty, keyPathColorsProperty, loopProperty, progressProperty, renderModeProperty, srcProperty, stretchProperty };
@@ -0,0 +1,6 @@
1
+ //#region src/vendor/ui-lottie/src/lottie/utils.ts
2
+ function clamp(val, min = 0, max = 1) {
3
+ return val > max ? max : val < min ? min : val;
4
+ }
5
+ //#endregion
6
+ export { clamp };
@@ -0,0 +1,17 @@
1
+ //#region src/escape-props.web.ts
2
+ /** Apply DOM escape props after the primitive's own props. Dash-named keys
3
+ * are attributes; other keys use the DOM property where available. */
4
+ function applyEscapeProps(element, props) {
5
+ if (!element || !props.web) return;
6
+ for (const [key, value] of Object.entries(props.web)) if (key.includes("-")) {
7
+ if (value == null || value === false) element.removeAttribute(key);
8
+ else element.setAttribute(key, value === true ? "" : String(value));
9
+ } else if (key in element) try {
10
+ element[key] = value;
11
+ } catch {
12
+ element.setAttribute(key, String(value));
13
+ }
14
+ else if (value != null) element.setAttribute(key, String(value));
15
+ }
16
+ //#endregion
17
+ export { applyEscapeProps };
@@ -0,0 +1,332 @@
1
+ import { applyEscapeProps } from "./escape-props.web.js";
2
+ import { layoutChildProps } from "./layout-child.web.js";
3
+ import { __s, bagOf, clone, hookSlots, snapshotSpread, template, useEffect, useRef } from "octane";
4
+ import { bindSignalChild, bindSignalHostPropSources, compilerMemoRegion, enableSignalBindings, hookMemoCreate, hookMemoPublishInvariant } from "octane/internal/client";
5
+ import lottie from "lottie-web";
6
+ //#region src/Lottie.web.tsrx
7
+ enableSignalBindings(1, true);
8
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
9
+ var _hs$ = /* @__PURE__ */ hookSlots(8);
10
+ var _rm$1 = [
11
+ "s",
12
+ "o",
13
+ "n"
14
+ ];
15
+ var PRESERVE = {
16
+ contain: "xMidYMid meet",
17
+ cover: "xMidYMid slice",
18
+ fill: "none"
19
+ };
20
+ var clamp01 = (n) => Math.min(1, Math.max(0, n));
21
+ var Lottie = /* @__PURE__ */ __s(function Lottie(props, __s, __extra) {
22
+ const __memoRegion = compilerMemoRegion(__s, _hs$ + 0);
23
+ let __hk = __memoRegion.hooks;
24
+ if (__hk === void 0) __memoRegion.hooks = __hk = hookMemoCreate(2);
25
+ const el = useRef(null, _hs$ + 0);
26
+ const anim = useRef(null, _hs$ + 1);
27
+ const ready = useRef(false, _hs$ + 2);
28
+ const wantPlay = () => props.playing ?? props.autoPlay ?? true;
29
+ const build = (host) => {
30
+ anim.current?.destroy();
31
+ anim.current = null;
32
+ ready.current = false;
33
+ const animationData = props.data ?? (props.src?.startsWith("{") ? JSON.parse(props.src) : void 0);
34
+ const path = animationData ? void 0 : props.src;
35
+ if (!animationData && !path) return;
36
+ const a = lottie.loadAnimation({
37
+ container: host,
38
+ renderer: "svg",
39
+ loop: props.loop ?? false,
40
+ autoplay: false,
41
+ animationData,
42
+ path,
43
+ rendererSettings: { preserveAspectRatio: PRESERVE[props.fit ?? "contain"] }
44
+ });
45
+ anim.current = a;
46
+ a.addEventListener("DOMLoaded", () => {
47
+ ready.current = true;
48
+ if (props.speed !== void 0) a.setSpeed(props.speed);
49
+ if (props.progress !== void 0) seekTo(props.progress);
50
+ props.onLoaded?.({ duration: a.getDuration() * 1e3 });
51
+ if (wantPlay()) a.play();
52
+ });
53
+ a.addEventListener("complete", () => props.onEnded?.());
54
+ a.addEventListener("data_failed", () => props.onError?.({ message: "animation data failed to load" }));
55
+ a.addEventListener("error", () => props.onError?.({ message: "animation failed" }));
56
+ };
57
+ const seekTo = __hk[0] ?? hookMemoPublishInvariant(__hk, 0, (p) => {
58
+ const a = anim.current;
59
+ if (!a) return;
60
+ const frame = clamp01(p) * a.totalFrames;
61
+ if (a.isPaused) a.goToAndStop(frame, true);
62
+ else a.goToAndPlay(frame, true);
63
+ });
64
+ useEffect(() => {
65
+ const host = el.current;
66
+ if (!host) return;
67
+ build(host);
68
+ return () => {
69
+ anim.current?.destroy();
70
+ anim.current = null;
71
+ ready.current = false;
72
+ };
73
+ }, [
74
+ props.src,
75
+ props.data,
76
+ props.fit
77
+ ], _hs$ + 3);
78
+ useEffect(() => {
79
+ if (props.loop !== void 0 && anim.current) anim.current.loop = props.loop;
80
+ }, [props.loop], _hs$ + 4);
81
+ useEffect(() => {
82
+ if (props.playing === void 0 || !anim.current || !ready.current) return;
83
+ if (props.playing) anim.current.play();
84
+ else anim.current.pause();
85
+ }, [props.playing], _hs$ + 5);
86
+ useEffect(() => {
87
+ if (props.progress === void 0) return;
88
+ seekTo(props.progress);
89
+ }, [props.progress], _hs$ + 6);
90
+ useEffect(() => {
91
+ if (props.speed !== void 0) anim.current?.setSpeed(props.speed);
92
+ }, [props.speed], _hs$ + 7);
93
+ const handle = __hk[1] ?? hookMemoPublishInvariant(__hk, 1, (a) => ({
94
+ play: () => a.play(),
95
+ pause: () => a.pause(),
96
+ stop: () => a.stop(),
97
+ seekTo,
98
+ setSpeed: (n) => a.setSpeed(n),
99
+ progress: () => a.totalFrames ? a.currentRawFrame / a.totalFrames : 0,
100
+ duration: () => a.getDuration() * 1e3,
101
+ isPlaying: () => !a.isPaused,
102
+ native: a
103
+ }));
104
+ let _b = __s.slots[0];
105
+ if (_b === void 0) {
106
+ let _m0, _m1, _m2, _m3, _m4, _m5, _m6, _m7, _m8, _m9, _m10, _m11, _m12, _m13, _m14;
107
+ const _root = clone(_t$0);
108
+ _m0 = (v) => {
109
+ el.current = v;
110
+ if (!v) return;
111
+ applyEscapeProps(v, props);
112
+ if (anim.current) props.bind?.(handle(anim.current));
113
+ };
114
+ _m1 = props.id;
115
+ _m2 = props.className;
116
+ _m3 = snapshotSpread(layoutChildProps(props, props.style));
117
+ _m4 = props.accessibilityRole ?? "img";
118
+ _m5 = props.accessibilityLabel;
119
+ _m6 = props.accessible === false ? true : void 0;
120
+ _m7 = props.accessibilityHint;
121
+ _m8 = props.accessibilityValue;
122
+ _m9 = props.accessibilityState?.disabled;
123
+ _m10 = props.accessibilityState?.selected;
124
+ _m11 = props.accessibilityState?.checked;
125
+ _m12 = props.accessibilityLiveRegion === "none" ? "off" : props.accessibilityLiveRegion;
126
+ _m13 = _root;
127
+ _m14 = bindSignalHostPropSources(__s, void 0, _root, [
128
+ [
129
+ false,
130
+ "ref",
131
+ _m0
132
+ ],
133
+ [
134
+ false,
135
+ "id",
136
+ _m1
137
+ ],
138
+ [
139
+ false,
140
+ "className",
141
+ _m2
142
+ ],
143
+ [true, _m3],
144
+ [
145
+ false,
146
+ "role",
147
+ _m4
148
+ ],
149
+ [
150
+ false,
151
+ "aria-label",
152
+ _m5
153
+ ],
154
+ [
155
+ false,
156
+ "aria-hidden",
157
+ _m6
158
+ ],
159
+ [
160
+ false,
161
+ "aria-description",
162
+ _m7
163
+ ],
164
+ [
165
+ false,
166
+ "aria-valuetext",
167
+ _m8
168
+ ],
169
+ [
170
+ false,
171
+ "aria-disabled",
172
+ _m9
173
+ ],
174
+ [
175
+ false,
176
+ "aria-selected",
177
+ _m10
178
+ ],
179
+ [
180
+ false,
181
+ "aria-checked",
182
+ _m11
183
+ ],
184
+ [
185
+ false,
186
+ "aria-live",
187
+ _m12
188
+ ]
189
+ ], "b:e86dca49", false);
190
+ _b = bagOf(__s, _root, {
191
+ a: _m0,
192
+ b: _m1,
193
+ c: _m2,
194
+ d: _m3,
195
+ e: _m4,
196
+ f: _m5,
197
+ g: _m6,
198
+ h: _m7,
199
+ i: _m8,
200
+ j: _m9,
201
+ k: _m10,
202
+ l: _m11,
203
+ m: _m12,
204
+ n: _m13,
205
+ o: _m14,
206
+ p: null,
207
+ q: void 0
208
+ });
209
+ __s.refFields = _rm$1;
210
+ } else {
211
+ {
212
+ const _v = (v) => {
213
+ el.current = v;
214
+ if (!v) return;
215
+ applyEscapeProps(v, props);
216
+ if (anim.current) props.bind?.(handle(anim.current));
217
+ };
218
+ if (_b.a !== _v) _b.a = _v;
219
+ }
220
+ {
221
+ const _v = props.id;
222
+ if (_b.b !== _v) _b.b = _v;
223
+ }
224
+ {
225
+ const _v = props.className;
226
+ if (_b.c !== _v) _b.c = _v;
227
+ }
228
+ _b.d = snapshotSpread(layoutChildProps(props, props.style));
229
+ {
230
+ const _v = props.accessibilityRole ?? "img";
231
+ if (_b.e !== _v) _b.e = _v;
232
+ }
233
+ {
234
+ const _v = props.accessibilityLabel;
235
+ if (_b.f !== _v) _b.f = _v;
236
+ }
237
+ {
238
+ const _v = props.accessible === false ? true : void 0;
239
+ if (_b.g !== _v) _b.g = _v;
240
+ }
241
+ {
242
+ const _v = props.accessibilityHint;
243
+ if (_b.h !== _v) _b.h = _v;
244
+ }
245
+ {
246
+ const _v = props.accessibilityValue;
247
+ if (_b.i !== _v) _b.i = _v;
248
+ }
249
+ {
250
+ const _v = props.accessibilityState?.disabled;
251
+ if (_b.j !== _v) _b.j = _v;
252
+ }
253
+ {
254
+ const _v = props.accessibilityState?.selected;
255
+ if (_b.k !== _v) _b.k = _v;
256
+ }
257
+ {
258
+ const _v = props.accessibilityState?.checked;
259
+ if (_b.l !== _v) _b.l = _v;
260
+ }
261
+ {
262
+ const _v = props.accessibilityLiveRegion === "none" ? "off" : props.accessibilityLiveRegion;
263
+ if (_b.m !== _v) _b.m = _v;
264
+ }
265
+ _b.o = bindSignalHostPropSources(__s, _b.o, _b.n, [
266
+ [
267
+ false,
268
+ "ref",
269
+ _b.a
270
+ ],
271
+ [
272
+ false,
273
+ "id",
274
+ _b.b
275
+ ],
276
+ [
277
+ false,
278
+ "className",
279
+ _b.c
280
+ ],
281
+ [true, _b.d],
282
+ [
283
+ false,
284
+ "role",
285
+ _b.e
286
+ ],
287
+ [
288
+ false,
289
+ "aria-label",
290
+ _b.f
291
+ ],
292
+ [
293
+ false,
294
+ "aria-hidden",
295
+ _b.g
296
+ ],
297
+ [
298
+ false,
299
+ "aria-description",
300
+ _b.h
301
+ ],
302
+ [
303
+ false,
304
+ "aria-valuetext",
305
+ _b.i
306
+ ],
307
+ [
308
+ false,
309
+ "aria-disabled",
310
+ _b.j
311
+ ],
312
+ [
313
+ false,
314
+ "aria-selected",
315
+ _b.k
316
+ ],
317
+ [
318
+ false,
319
+ "aria-checked",
320
+ _b.l
321
+ ],
322
+ [
323
+ false,
324
+ "aria-live",
325
+ _b.m
326
+ ]
327
+ ], "b:e86dca49", false);
328
+ }
329
+ _b.r = bindSignalChild(__s, _b.r, 1, _b.n, Object.prototype.propertyIsEnumerable.call(_b.o.resolved, "children") ? _b.o.resolved.children : void 0, "b:e86dca49", null, void 0, void 0, void 0, true);
330
+ });
331
+ //#endregion
332
+ export { Lottie };
@@ -0,0 +1,47 @@
1
+ //#region src/layout-child.web.ts
2
+ /** The shared contract is "numbers are dips" (RN semantics), but octane's DOM
3
+ * renderer keeps React's unitless list — lineHeight is unitless there, so
4
+ * `style={{lineHeight: 40}}` would render a 40× multiplier instead of 40px.
5
+ * lineHeight is the one unitless-in-React prop that is a length in the
6
+ * shared vocabulary; force the px suffix. */
7
+ function normStyle(style) {
8
+ if (style && typeof style.lineHeight === "number") return {
9
+ ...style,
10
+ lineHeight: style.lineHeight + "px"
11
+ };
12
+ return style;
13
+ }
14
+ var FLEX_JUSTIFY = {
15
+ start: "flex-start",
16
+ end: "flex-end"
17
+ };
18
+ var FLEX_ALIGN = {
19
+ start: "flex-start",
20
+ end: "flex-end"
21
+ };
22
+ /** Convert parent-layout metadata to CSS on the web leaf. Native's `dock`
23
+ * attribute has no CSS equivalent and is ignored on web. Grid indices are
24
+ * zero-based in the shared API, matching NativeScript. */
25
+ function layoutChildProps(props, baseStyle = props.style) {
26
+ const style = { ...normStyle(baseStyle) };
27
+ if (props.row !== void 0) style.gridRow = `${props.row + 1} / span ${props.rowSpan ?? 1}`;
28
+ else if (props.rowSpan !== void 0) style.gridRow = `span ${props.rowSpan}`;
29
+ if (props.col !== void 0) style.gridColumn = `${props.col + 1} / span ${props.colSpan ?? 1}`;
30
+ else if (props.colSpan !== void 0) style.gridColumn = `span ${props.colSpan}`;
31
+ if (props.left !== void 0) style.left = props.left;
32
+ if (props.top !== void 0) style.top = props.top;
33
+ if (props.flexGrow !== void 0) style.flexGrow = props.flexGrow;
34
+ if (props.flexShrink !== void 0) style.flexShrink = props.flexShrink;
35
+ if (props.alignSelf !== void 0) style.alignSelf = props.alignSelf;
36
+ if (props.order !== void 0) style.order = props.order;
37
+ if (props.justifyContent !== void 0) style.justifyContent = FLEX_JUSTIFY[props.justifyContent] ?? props.justifyContent;
38
+ if (props.alignItems !== void 0) style.alignItems = FLEX_ALIGN[props.alignItems] ?? props.alignItems;
39
+ if (props.flexWrap !== void 0) style.flexWrap = props.flexWrap === true ? "wrap" : props.flexWrap === false ? "nowrap" : props.flexWrap;
40
+ if (props.gap !== void 0) style.gap = props.gap;
41
+ if (props.rowGap !== void 0) style.rowGap = props.rowGap;
42
+ if (props.columnGap !== void 0) style.columnGap = props.columnGap;
43
+ if (typeof style.lineHeight === "number") style.lineHeight = style.lineHeight + "px";
44
+ return { style };
45
+ }
46
+ //#endregion
47
+ export { layoutChildProps, normStyle };
@@ -0,0 +1,8 @@
1
+ {
2
+ "version": 1,
3
+ "buildId": "7f9f4346-2bc0-44b2-b7a5-74cb52d2702e",
4
+ "mode": "production",
5
+ "capabilities": {
6
+ "independentHydration": false
7
+ }
8
+ }