@stablyai/electron-native-loaders 0.0.0-stage → 0.1.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.
package/README.md CHANGED
@@ -1,3 +1,50 @@
1
- # Temporary Holding Version
1
+ # @stablyai/electron-native-loaders
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Zero-CPU OS-compositor loading spinners for [`stablyai/electron`](https://github.com/stablyai/electron) (macOS CoreAnimation, Windows DirectComposition, Linux Viz-only GPU) with automatic CSS fallback on stock Electron and web browsers.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @stablyai/electron-native-loaders
9
+ ```
10
+
11
+ ## Quickstart (React)
12
+
13
+ ```tsx
14
+ import { NativeLoader } from '@stablyai/electron-native-loaders'
15
+ import '@stablyai/electron-native-loaders/styles.css'
16
+
17
+ export function WorkingBadge() {
18
+ return <NativeLoader kind="arc" size={14} color="#eab308" speed="normal" />
19
+ }
20
+ ```
21
+
22
+ Supported primitives: `arc`, `grid`, `bars`, `dots`, `pulse`, `shimmer`, `sprite`.
23
+
24
+ ## Headless Usage (Custom Tailwind / Existing Components)
25
+
26
+ Use the zero-React `/protocol` export when you already have your own styled spinner markup:
27
+
28
+ ```ts
29
+ import {
30
+ NATIVE_SENTINEL,
31
+ getNativeLoaderStyle,
32
+ hasNativeLoaders
33
+ } from '@stablyai/electron-native-loaders/protocol'
34
+
35
+ const native = hasNativeLoaders(window.api?.platform?.get?.()?.nativeLoaders)
36
+ const style = native ? getNativeLoaderStyle(NATIVE_SENTINEL.spin('normal')) : undefined
37
+ ```
38
+
39
+ ## Electron Setup
40
+
41
+ 1. Install a [`stablyai/electron`](https://github.com/stablyai/electron/releases) binary (`ELECTRON_MIRROR` + `ELECTRON_CUSTOM_DIR` + `electron_use_remote_checksums=1`).
42
+ 2. On Windows, enable delegated compositing in your main process:
43
+ ```ts
44
+ if (process.platform === 'win32' && (process.versions as Record<string, string>).nativeLoaders === '1') {
45
+ app.commandLine.appendSwitch('enable-features', 'DelegatedCompositing:mode/full')
46
+ }
47
+ ```
48
+ 3. In your preload script, expose `process.versions.nativeLoaders === '1'` to the renderer (or set `window.__NATIVE_LOADERS__ = true`).
49
+
50
+ > **macOS `backdrop-filter` note:** Avoid wrapping a native loader inside an ancestor with CSS `backdrop-filter` / `backdrop-blur` — Chromium's `CALayerOverlayProcessor` flattens blurred subtrees into a single texture. Apply blur to a sibling background layer (`::before`) instead.
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import { type LoaderSpeed, type SpriteFrames } from './protocol.js';
3
+ export type NativeLoaderProps = {
4
+ kind: 'arc';
5
+ size?: number;
6
+ color?: string;
7
+ speed?: LoaderSpeed;
8
+ className?: string;
9
+ forceFallback?: boolean;
10
+ nativeSupported?: boolean;
11
+ } | {
12
+ kind: 'grid';
13
+ rows?: number;
14
+ cols?: number;
15
+ cellSize?: number;
16
+ gap?: number;
17
+ color?: string;
18
+ className?: string;
19
+ forceFallback?: boolean;
20
+ nativeSupported?: boolean;
21
+ } | {
22
+ kind: 'bars';
23
+ count?: number;
24
+ width?: number;
25
+ height?: number;
26
+ color?: string;
27
+ className?: string;
28
+ forceFallback?: boolean;
29
+ nativeSupported?: boolean;
30
+ } | {
31
+ kind: 'dots';
32
+ count?: number;
33
+ size?: number;
34
+ color?: string;
35
+ className?: string;
36
+ forceFallback?: boolean;
37
+ nativeSupported?: boolean;
38
+ } | {
39
+ kind: 'pulse';
40
+ size?: number;
41
+ color?: string;
42
+ speed?: LoaderSpeed;
43
+ className?: string;
44
+ forceFallback?: boolean;
45
+ nativeSupported?: boolean;
46
+ } | {
47
+ kind: 'shimmer';
48
+ width?: number;
49
+ height?: number;
50
+ color?: string;
51
+ speed?: LoaderSpeed;
52
+ className?: string;
53
+ forceFallback?: boolean;
54
+ nativeSupported?: boolean;
55
+ } | {
56
+ kind: 'sprite';
57
+ size?: number;
58
+ frames?: SpriteFrames;
59
+ spriteUrl: string;
60
+ className?: string;
61
+ forceFallback?: boolean;
62
+ nativeSupported?: boolean;
63
+ };
64
+ /**
65
+ * Drop-in React loader component that offloads animation to the OS compositor on Stably Electron
66
+ * and automatically falls back to CSS animations on stock Electron and web browsers.
67
+ *
68
+ * Import `@stablyai/electron-native-loaders/styles.css` once in your app for the CSS fallback.
69
+ */
70
+ export declare function NativeLoader(props: NativeLoaderProps): React.JSX.Element;
71
+ //# sourceMappingURL=NativeLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeLoader.d.ts","sourceRoot":"","sources":["../src/NativeLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAA;AAEtB,MAAM,MAAM,iBAAiB,GACzB;IACE,IAAI,EAAE,KAAK,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,GACD;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,GACD;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MA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WL;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsNxE"}
@@ -0,0 +1,134 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getNativeLoaderStyle, hasNativeLoaders, NATIVE_SENTINEL } from './protocol.js';
3
+ const SPIN_DUR = { fast: '0.65s', normal: '0.95s', slow: '1.5s' };
4
+ const PULSE_DUR = { fast: '0.9s', normal: '1.3s', slow: '2.0s' };
5
+ const SHIMMER_DUR = { fast: '0.8s', normal: '1.2s', slow: '1.8s' };
6
+ const BASE_PROMOTED = {
7
+ contain: 'strict',
8
+ willChange: 'transform'
9
+ };
10
+ /**
11
+ * Drop-in React loader component that offloads animation to the OS compositor on Stably Electron
12
+ * and automatically falls back to CSS animations on stock Electron and web browsers.
13
+ *
14
+ * Import `@stablyai/electron-native-loaders/styles.css` once in your app for the CSS fallback.
15
+ */
16
+ export function NativeLoader(props) {
17
+ const native = !props.forceFallback && hasNativeLoaders(props.nativeSupported);
18
+ switch (props.kind) {
19
+ case 'arc': {
20
+ const sz = props.size ?? 16;
21
+ const speed = props.speed ?? 'normal';
22
+ return (_jsx("span", { className: props.className, "data-native-loader": native ? 'arc' : undefined, style: {
23
+ display: 'inline-flex',
24
+ width: sz,
25
+ height: sz,
26
+ color: props.color ?? 'currentColor',
27
+ ...(native
28
+ ? getNativeLoaderStyle(NATIVE_SENTINEL.spin(speed))
29
+ : { ...BASE_PROMOTED, animation: `nl-spin ${SPIN_DUR[speed]} linear infinite` })
30
+ }, children: _jsx("svg", { width: sz, height: sz, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", children: _jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) }));
31
+ }
32
+ case 'grid': {
33
+ const rows = props.rows ?? 3;
34
+ const cols = props.cols ?? 3;
35
+ const cell = props.cellSize ?? 4;
36
+ const gap = props.gap ?? 2;
37
+ const color = props.color ?? 'currentColor';
38
+ return (_jsx("span", { className: props.className, "data-native-loader": native ? 'grid' : undefined, style: { display: 'inline-grid', gridTemplateColumns: `repeat(${cols}, ${cell}px)`, gap }, children: Array.from({ length: rows * cols }, (_, idx) => {
39
+ const r = Math.floor(idx / cols);
40
+ const c = idx % cols;
41
+ const step = (r + c) % 16;
42
+ return (_jsx("span", { style: {
43
+ width: cell,
44
+ height: cell,
45
+ borderRadius: Math.max(1, cell * 0.2),
46
+ backgroundColor: color,
47
+ ...(native
48
+ ? getNativeLoaderStyle(NATIVE_SENTINEL.gridPhase(step))
49
+ : { ...BASE_PROMOTED, animation: `nl-grid 1.2s ease-in-out ${step * 0.1}s infinite` })
50
+ } }, idx));
51
+ }) }));
52
+ }
53
+ case 'bars': {
54
+ const count = props.count ?? 5;
55
+ const w = props.width ?? 3;
56
+ const h = props.height ?? 16;
57
+ const color = props.color ?? 'currentColor';
58
+ return (_jsx("span", { className: props.className, "data-native-loader": native ? 'bars' : undefined, style: { display: 'inline-flex', alignItems: 'center', gap: Math.max(2, w) }, children: Array.from({ length: count }, (_, i) => (_jsx("span", { style: {
59
+ width: w,
60
+ height: h,
61
+ borderRadius: w / 2,
62
+ backgroundColor: color,
63
+ ...(native
64
+ ? getNativeLoaderStyle(NATIVE_SENTINEL.barsPhase((i * 2) % 16))
65
+ : { ...BASE_PROMOTED, animation: `nl-bars 0.9s ease-in-out ${i * 0.12}s infinite` })
66
+ } }, i))) }));
67
+ }
68
+ case 'dots': {
69
+ const count = props.count ?? 3;
70
+ const sz = props.size ?? 6;
71
+ const color = props.color ?? 'currentColor';
72
+ return (_jsx("span", { className: props.className, "data-native-loader": native ? 'dots' : undefined, style: { display: 'inline-flex', alignItems: 'center', gap: sz }, children: Array.from({ length: count }, (_, i) => (_jsx("span", { style: {
73
+ width: sz,
74
+ height: sz,
75
+ borderRadius: '50%',
76
+ backgroundColor: color,
77
+ ...(native
78
+ ? getNativeLoaderStyle(NATIVE_SENTINEL.dotsPhase((i * 3) % 16))
79
+ : { ...BASE_PROMOTED, animation: `nl-dots 0.84s ease-in-out ${i * 0.14}s infinite` })
80
+ } }, i))) }));
81
+ }
82
+ case 'pulse': {
83
+ const sz = props.size ?? 16;
84
+ const speed = props.speed ?? 'normal';
85
+ const color = props.color ?? '#58d6a3';
86
+ return (_jsxs("span", { className: props.className, "data-native-loader": native ? 'pulse' : undefined, style: { position: 'relative', display: 'inline-grid', placeItems: 'center', width: sz, height: sz }, children: [_jsx("span", { style: {
87
+ position: 'absolute',
88
+ inset: 0,
89
+ borderRadius: '50%',
90
+ border: `2px solid ${color}`,
91
+ ...(native
92
+ ? getNativeLoaderStyle(NATIVE_SENTINEL.pulse(speed))
93
+ : { ...BASE_PROMOTED, animation: `nl-pulse ${PULSE_DUR[speed]} ease-out infinite` })
94
+ } }), _jsx("span", { style: { width: sz * 0.35, height: sz * 0.35, borderRadius: '50%', backgroundColor: color } })] }));
95
+ }
96
+ case 'shimmer': {
97
+ const w = props.width ?? 120;
98
+ const h = props.height ?? 6;
99
+ const speed = props.speed ?? 'normal';
100
+ const color = props.color ?? '#be8cff';
101
+ return (_jsx("span", { className: props.className, "data-native-loader": native ? 'shimmer' : undefined, style: {
102
+ display: 'inline-block',
103
+ width: w,
104
+ height: h,
105
+ borderRadius: h / 2,
106
+ background: 'rgba(255,255,255,0.12)',
107
+ overflow: 'hidden',
108
+ position: 'relative'
109
+ }, children: _jsx("span", { style: {
110
+ display: 'block',
111
+ width: w * 0.4,
112
+ height: h,
113
+ borderRadius: h / 2,
114
+ backgroundColor: color,
115
+ ...(native
116
+ ? getNativeLoaderStyle(NATIVE_SENTINEL.shimmer(speed))
117
+ : { ...BASE_PROMOTED, animation: `nl-shimmer ${SHIMMER_DUR[speed]} ease-in-out infinite` })
118
+ } }) }));
119
+ }
120
+ case 'sprite': {
121
+ const sz = props.size ?? 16;
122
+ const frames = props.frames ?? 10;
123
+ return (_jsx("span", { className: props.className, "data-native-loader": native ? 'sprite' : undefined, style: { display: 'inline-block', width: sz, height: sz, overflow: 'hidden', position: 'relative' }, children: _jsx("img", { src: props.spriteUrl, alt: "", style: {
124
+ width: sz * frames,
125
+ height: sz,
126
+ maxWidth: 'none',
127
+ ...(native
128
+ ? getNativeLoaderStyle(NATIVE_SENTINEL.sprite(frames))
129
+ : { ...BASE_PROMOTED, animation: `nl-shimmer ${frames * 0.1}s steps(${frames}) infinite` })
130
+ } }) }));
131
+ }
132
+ }
133
+ }
134
+ //# sourceMappingURL=NativeLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeLoader.js","sourceRoot":"","sources":["../src/NativeLoader.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EAGhB,MAAM,eAAe,CAAA;AAuEtB,MAAM,QAAQ,GAAgC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9F,MAAM,SAAS,GAAgC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AAC7F,MAAM,WAAW,GAAgC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AAE/F,MAAM,aAAa,GAAwB;IACzC,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,WAAW;CACxB,CAAA;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,aAAa,IAAI,gBAAgB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;IAE9E,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAA;YAC3B,MAA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CAAA;QACH,CAAC;QAED,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAA;YAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAA;YACjC,OAAO,CACL,eACE,SAAS,EAAE,KAAK,CAAC,SAAS,wBACN,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EACjD,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,YAEnG,cACE,GAAG,EAAE,KAAK,CAAC,SAAS,EACpB,GAAG,EAAC,EAAE,EACN,KAAK,EAAE;wBACL,KAAK,EAAE,EAAE,GAAG,MAAM;wBAClB,MAAM,EAAE,EAAE;wBACV,QAAQ,EAAE,MAAM;wBAChB,GAAG,CAAC,MAAM;4BACR,CAAC,CAAC,oBAAoB,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;4BACtD,CAAC,CAAC,EAAE,GAAG,aAAa,EAAE,SAAS,EAAE,cAAc,MAAM,GAAG,GAAG,WAAW,MAAM,YAAY,EAAE,CAAC;qBAC9F,GACD,GACG,CACR,CAAA;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { NATIVE_SENTINEL, getNativeLoaderStyle, hasNativeLoaders, setNativeLoadersOverride, type LoaderSpeed, type SpriteFrames } from './protocol.js';
2
+ export { NativeLoader, type NativeLoaderProps } from './NativeLoader.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { NATIVE_SENTINEL, getNativeLoaderStyle, hasNativeLoaders, setNativeLoadersOverride } from './protocol.js';
2
+ export { NativeLoader } from './NativeLoader.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EAGzB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,YAAY,EAA0B,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,34 @@
1
+ export type LoaderSpeed = 'fast' | 'normal' | 'slow';
2
+ export type SpriteFrames = 8 | 10 | 12;
3
+ /**
4
+ * Internal sentinel opacity values recognized by Stably Electron's 3-file Chromium Viz patch.
5
+ * Viz immediately restores the layer's real opacity to 1.0 and attaches a native OS-compositor
6
+ * animation (CoreAnimation on macOS, DirectComposition on Windows, Viz-only GPU on Linux).
7
+ *
8
+ * These are protocol markers, not visual opacity settings — use the helpers below rather than
9
+ * tweaking floats manually.
10
+ */
11
+ export declare const NATIVE_SENTINEL: {
12
+ readonly spin: (speed?: LoaderSpeed) => number;
13
+ readonly gridPhase: (step0to15: number) => number;
14
+ readonly barsPhase: (step0to15: number) => number;
15
+ readonly dotsPhase: (step0to15: number) => number;
16
+ readonly pulse: (speed?: LoaderSpeed) => number;
17
+ readonly shimmer: (speed?: LoaderSpeed) => number;
18
+ readonly sprite: (frames?: SpriteFrames) => number;
19
+ };
20
+ /** Force-enable or force-disable native loaders at runtime (useful for A/B benchmarks and tests). */
21
+ export declare function setNativeLoadersOverride(enabled: boolean | undefined): void;
22
+ /**
23
+ * Returns true when running inside Stably Electron (`process.versions.nativeLoaders === "1"`).
24
+ * Pass `detected` if your preload bridge exposes the flag under a custom property
25
+ * (e.g. `hasNativeLoaders(window.api?.platform?.get?.()?.nativeLoaders)`).
26
+ */
27
+ export declare function hasNativeLoaders(detected?: boolean): boolean;
28
+ /** CSS properties required to promote a DOM element so Viz attaches the native OS animation. */
29
+ export declare function getNativeLoaderStyle(sentinelOpacity: number): {
30
+ contain: 'strict';
31
+ willChange: 'transform';
32
+ opacity: number;
33
+ };
34
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAA;AAEtC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;4BACZ,WAAW,KAAc,MAAM;oCAEtB,MAAM,KAAG,MAAM;oCAEf,MAAM,KAAG,MAAM;oCAEf,MAAM,KAAG,MAAM;6BAEvB,WAAW,KAAc,MAAM;+BAE7B,WAAW,KAAc,MAAM;+BAE/B,YAAY,KAAQ,MAAM;CAEnC,CAAA;AAIV,qGAAqG;AACrG,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CA4B5D;AAED,gGAAgG;AAChG,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,GAAG;IAC7D,OAAO,EAAE,QAAQ,CAAA;IACjB,UAAU,EAAE,WAAW,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;CAChB,CAMA"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Internal sentinel opacity values recognized by Stably Electron's 3-file Chromium Viz patch.
3
+ * Viz immediately restores the layer's real opacity to 1.0 and attaches a native OS-compositor
4
+ * animation (CoreAnimation on macOS, DirectComposition on Windows, Viz-only GPU on Linux).
5
+ *
6
+ * These are protocol markers, not visual opacity settings — use the helpers below rather than
7
+ * tweaking floats manually.
8
+ */
9
+ export const NATIVE_SENTINEL = {
10
+ spin: (speed = 'normal') => speed === 'fast' ? 0.996 : speed === 'slow' ? 0.9964 : 0.9962,
11
+ gridPhase: (step0to15) => Number((0.991 + Math.max(0, Math.min(15, step0to15)) * 0.0002).toFixed(4)),
12
+ barsPhase: (step0to15) => Number((0.986 + Math.max(0, Math.min(15, step0to15)) * 0.0002).toFixed(4)),
13
+ dotsPhase: (step0to15) => Number((0.981 + Math.max(0, Math.min(15, step0to15)) * 0.0002).toFixed(4)),
14
+ pulse: (speed = 'normal') => speed === 'fast' ? 0.978 : speed === 'slow' ? 0.9784 : 0.9782,
15
+ shimmer: (speed = 'normal') => speed === 'fast' ? 0.975 : speed === 'slow' ? 0.9754 : 0.9752,
16
+ sprite: (frames = 10) => frames === 8 ? 0.972 : frames === 12 ? 0.9724 : 0.9722
17
+ };
18
+ let runtimeOverride;
19
+ /** Force-enable or force-disable native loaders at runtime (useful for A/B benchmarks and tests). */
20
+ export function setNativeLoadersOverride(enabled) {
21
+ runtimeOverride = enabled;
22
+ }
23
+ /**
24
+ * Returns true when running inside Stably Electron (`process.versions.nativeLoaders === "1"`).
25
+ * Pass `detected` if your preload bridge exposes the flag under a custom property
26
+ * (e.g. `hasNativeLoaders(window.api?.platform?.get?.()?.nativeLoaders)`).
27
+ */
28
+ export function hasNativeLoaders(detected) {
29
+ if (typeof runtimeOverride === 'boolean') {
30
+ return runtimeOverride;
31
+ }
32
+ if (typeof window === 'undefined') {
33
+ return false;
34
+ }
35
+ const g = window;
36
+ if (typeof g.__NATIVE_LOADERS_OVERRIDE__ === 'boolean') {
37
+ return g.__NATIVE_LOADERS_OVERRIDE__;
38
+ }
39
+ if (typeof g.__ORCA_NATIVE_LOADERS_OVERRIDE__ === 'boolean') {
40
+ return g.__ORCA_NATIVE_LOADERS_OVERRIDE__;
41
+ }
42
+ if (typeof detected === 'boolean') {
43
+ return detected;
44
+ }
45
+ return Boolean(g.__NATIVE_LOADERS__ ||
46
+ g.__ORCA_NATIVE_LOADERS__ ||
47
+ g.process?.versions?.nativeLoaders === '1');
48
+ }
49
+ /** CSS properties required to promote a DOM element so Viz attaches the native OS animation. */
50
+ export function getNativeLoaderStyle(sentinelOpacity) {
51
+ return {
52
+ contain: 'strict',
53
+ willChange: 'transform',
54
+ opacity: sentinelOpacity
55
+ };
56
+ }
57
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,CAAC,QAAqB,QAAQ,EAAU,EAAE,CAC9C,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;IAC/D,SAAS,EAAE,CAAC,SAAiB,EAAU,EAAE,CACvC,MAAM,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5E,SAAS,EAAE,CAAC,SAAiB,EAAU,EAAE,CACvC,MAAM,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5E,SAAS,EAAE,CAAC,SAAiB,EAAU,EAAE,CACvC,MAAM,CAAC,CAAC,KAAK,GAAG,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gC,KAAK,SAAS,EAAE,CAAC;QAC5D,OAAO,CAAC,CAAC,gCAAgC,CAAA;IAC3C,CAAC;IACD,IAAI,OAAO,QAAQ,KAAK,SAAS,EAAE,CAAC;QAClC,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,OAAO,CACZ,CAAC,CAAC,kBAAkB;QAClB,CAAC,CAAC,uBAAuB;QACzB,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,KAAK,GAAG,CAC7C,CAAA;AACH,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,oBAAoB,CAAC,eAAuB;IAK1D,OAAO;QACL,OAAO,EAAE,QAAQ;QACjB,UAAU,EAAE,WAAW;QACvB,OAAO,EAAE,eAAe;KACzB,CAAA;AACH,CAAC"}
@@ -0,0 +1,60 @@
1
+ @keyframes nl-spin {
2
+ to {
3
+ transform: rotate(360deg);
4
+ }
5
+ }
6
+
7
+ @keyframes nl-grid {
8
+ 0%, 100% {
9
+ opacity: 0.15;
10
+ }
11
+ 50% {
12
+ opacity: 1;
13
+ }
14
+ }
15
+
16
+ @keyframes nl-bars {
17
+ 0%, 100% {
18
+ transform: scaleY(0.25);
19
+ }
20
+ 50% {
21
+ transform: scaleY(1);
22
+ }
23
+ }
24
+
25
+ @keyframes nl-dots {
26
+ 0%, 100% {
27
+ transform: translateY(-6px);
28
+ }
29
+ 50% {
30
+ transform: translateY(6px);
31
+ }
32
+ }
33
+
34
+ @keyframes nl-pulse {
35
+ 0% {
36
+ transform: scale(0.4);
37
+ opacity: 0.9;
38
+ }
39
+ 100% {
40
+ transform: scale(1.35);
41
+ opacity: 0;
42
+ }
43
+ }
44
+
45
+ @keyframes nl-shimmer {
46
+ 0% {
47
+ transform: translateX(-100%);
48
+ }
49
+ 100% {
50
+ transform: translateX(250%);
51
+ }
52
+ }
53
+
54
+ @media (prefers-reduced-motion: reduce) {
55
+ [data-native-loader],
56
+ [data-native-loader] * {
57
+ animation: none !important;
58
+ opacity: 1 !important;
59
+ }
60
+ }
package/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "@stablyai/electron-native-loaders",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Zero-CPU OS-compositor loading spinners for Electron (CoreAnimation, DirectComposition, Linux Viz) with automatic CSS fallback.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/stablyai/electron.git",
13
+ "directory": "packages/electron-native-loaders"
14
+ },
15
+ "homepage": "https://github.com/stablyai/electron#readme",
16
+ "keywords": [
17
+ "electron",
18
+ "spinner",
19
+ "loader",
20
+ "performance",
21
+ "coreanimation",
22
+ "directcomposition",
23
+ "react"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ },
30
+ "./protocol": {
31
+ "types": "./dist/protocol.d.ts",
32
+ "import": "./dist/protocol.js"
33
+ },
34
+ "./styles.css": "./dist/styles.css"
35
+ },
36
+ "main": "./dist/index.js",
37
+ "types": "./dist/index.d.ts",
38
+ "files": [
39
+ "dist",
40
+ "README.md"
41
+ ],
42
+ "sideEffects": [
43
+ "*.css"
44
+ ],
45
+ "peerDependencies": {
46
+ "react": ">=18.0.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "react": {
50
+ "optional": true
51
+ }
52
+ },
53
+ "devDependencies": {
54
+ "@types/react": "^19.0.0",
55
+ "react": "^19.0.0",
56
+ "typescript": "^5.8.0"
57
+ },
58
+ "scripts": {
59
+ "build": "tsc -p tsconfig.json && cp src/styles.css dist/styles.css",
60
+ "prepublishOnly": "npm run build"
61
+ }
62
+ }