@shulya/liquid-glass 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +336 -2
- package/dist/angular.cjs +78 -0
- package/dist/angular.mjs +76 -0
- package/dist/core.cjs +1119 -0
- package/dist/core.mjs +1119 -0
- package/dist/index.cjs +17 -0
- package/dist/index.mjs +15 -0
- package/dist/react.cjs +105 -0
- package/dist/react.mjs +106 -0
- package/dist/solid.cjs +82 -0
- package/dist/solid.mjs +80 -0
- package/dist/svelte.cjs +29 -0
- package/dist/svelte.mjs +27 -0
- package/dist/tables.cjs +14 -0
- package/dist/tables.mjs +14 -0
- package/dist/vue.cjs +94 -0
- package/dist/vue.mjs +92 -0
- package/example/README.md +37 -0
- package/example/index.html +15 -0
- package/example/package.json +27 -0
- package/example/src/App.jsx +353 -0
- package/example/src/main.jsx +10 -0
- package/example/src/styles.css +155 -0
- package/example/vite.config.js +22 -0
- package/package.json +115 -4
- package/screen.png +0 -0
- package/src/angular.js +76 -0
- package/src/core.js +1119 -0
- package/src/index.js +15 -0
- package/src/react.js +106 -0
- package/src/solid.js +80 -0
- package/src/svelte.js +27 -0
- package/src/tables.js +14 -0
- package/src/vue.js +92 -0
- package/tables/optical_calibration_matrix.csv +257 -0
- package/tables/optical_calibration_matrix.xlsx +0 -0
- package/types/angular.d.ts +24 -0
- package/types/index.d.ts +80 -0
- package/types/react.d.ts +29 -0
- package/types/solid.d.ts +14 -0
- package/types/svelte.d.ts +15 -0
- package/types/vue.d.ts +19 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [react()],
|
|
10
|
+
resolve: {
|
|
11
|
+
alias: {
|
|
12
|
+
'@shulya/liquid-glass/react': path.resolve(__dirname, '../dist/react.mjs'),
|
|
13
|
+
'@shulya/liquid-glass': path.resolve(__dirname, '../dist/index.mjs'),
|
|
14
|
+
'liquid-glass-ui/react': path.resolve(__dirname, '../dist/react.mjs'),
|
|
15
|
+
'liquid-glass-ui': path.resolve(__dirname, '../dist/index.mjs')
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
server: {
|
|
19
|
+
port: 5173,
|
|
20
|
+
open: false
|
|
21
|
+
}
|
|
22
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,117 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shulya/liquid-glass",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "High-performance, zero-WebGL Liquid Glass optical UI engine with pre-computed empirical lookup tables for React, Vue, Svelte, Angular, SolidJS, and Vanilla JS.",
|
|
5
|
+
"author": "Shulya (https://shulya.tech)",
|
|
6
|
+
"homepage": "https://liquid.shulya.tech",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/shulya-tech/liquid-glass.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/shulya-tech/liquid-glass/issues"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"liquid-glass",
|
|
16
|
+
"glassmorphism",
|
|
17
|
+
"optical-ui",
|
|
18
|
+
"refraction",
|
|
19
|
+
"apple-glass",
|
|
20
|
+
"react",
|
|
21
|
+
"vue",
|
|
22
|
+
"svelte",
|
|
23
|
+
"angular",
|
|
24
|
+
"solidjs",
|
|
25
|
+
"zero-webgl"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.mjs",
|
|
30
|
+
"types": "./types/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./types/index.d.ts",
|
|
34
|
+
"import": "./dist/index.mjs",
|
|
35
|
+
"require": "./dist/index.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./react": {
|
|
38
|
+
"types": "./types/react.d.ts",
|
|
39
|
+
"import": "./dist/react.mjs",
|
|
40
|
+
"require": "./dist/react.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./vue": {
|
|
43
|
+
"types": "./types/vue.d.ts",
|
|
44
|
+
"import": "./dist/vue.mjs",
|
|
45
|
+
"require": "./dist/vue.cjs"
|
|
46
|
+
},
|
|
47
|
+
"./svelte": {
|
|
48
|
+
"types": "./types/svelte.d.ts",
|
|
49
|
+
"import": "./dist/svelte.mjs",
|
|
50
|
+
"require": "./dist/svelte.cjs"
|
|
51
|
+
},
|
|
52
|
+
"./angular": {
|
|
53
|
+
"types": "./types/angular.d.ts",
|
|
54
|
+
"import": "./dist/angular.mjs",
|
|
55
|
+
"require": "./dist/angular.cjs"
|
|
56
|
+
},
|
|
57
|
+
"./solid": {
|
|
58
|
+
"types": "./types/solid.d.ts",
|
|
59
|
+
"import": "./dist/solid.mjs",
|
|
60
|
+
"require": "./dist/solid.cjs"
|
|
61
|
+
},
|
|
62
|
+
"./tables": {
|
|
63
|
+
"import": "./dist/tables.mjs",
|
|
64
|
+
"require": "./dist/tables.cjs"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"files": [
|
|
68
|
+
"dist",
|
|
69
|
+
"src",
|
|
70
|
+
"types",
|
|
71
|
+
"example/index.html",
|
|
72
|
+
"example/package.json",
|
|
73
|
+
"example/vite.config.js",
|
|
74
|
+
"example/README.md",
|
|
75
|
+
"example/src",
|
|
76
|
+
"tables/optical_calibration_matrix.xlsx",
|
|
77
|
+
"tables/optical_calibration_matrix.csv",
|
|
78
|
+
"screen.png",
|
|
79
|
+
"README.md",
|
|
80
|
+
"LICENSE"
|
|
81
|
+
],
|
|
82
|
+
"publishConfig": {
|
|
83
|
+
"access": "public"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"build": "node build.mjs",
|
|
87
|
+
"example": "cd example && npm install && npm run dev",
|
|
88
|
+
"prepublishOnly": "node build.mjs"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"@angular/core": ">=14.0.0",
|
|
92
|
+
"react": ">=17.0.0",
|
|
93
|
+
"solid-js": ">=1.5.0",
|
|
94
|
+
"svelte": ">=3.0.0",
|
|
95
|
+
"vue": ">=3.0.0"
|
|
96
|
+
},
|
|
97
|
+
"peerDependenciesMeta": {
|
|
98
|
+
"@angular/core": {
|
|
99
|
+
"optional": true
|
|
100
|
+
},
|
|
101
|
+
"react": {
|
|
102
|
+
"optional": true
|
|
103
|
+
},
|
|
104
|
+
"solid-js": {
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
107
|
+
"svelte": {
|
|
108
|
+
"optional": true
|
|
109
|
+
},
|
|
110
|
+
"vue": {
|
|
111
|
+
"optional": true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"sideEffects": false,
|
|
115
|
+
"license": "MIT"
|
|
116
|
+
}
|
|
117
|
+
|
package/screen.png
ADDED
|
Binary file
|
package/src/angular.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular Adapter for Liquid Glass UI
|
|
3
|
+
*/
|
|
4
|
+
import { LiquidGlassController, OPTICAL_DEFAULTS, OPTICAL_LIMITS } from './core.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Framework-agnostic Angular Directive Controller Class
|
|
8
|
+
* Can be used directly with Angular's @Directive({ selector: '[liquidGlass]', standalone: true })
|
|
9
|
+
* or instantiated via ElementRef in any Angular component.
|
|
10
|
+
*/
|
|
11
|
+
export class LiquidGlassDirective {
|
|
12
|
+
/**
|
|
13
|
+
* @param {{ nativeElement: HTMLElement } | HTMLElement} elementRef
|
|
14
|
+
*/
|
|
15
|
+
constructor(elementRef) {
|
|
16
|
+
this.el = elementRef && elementRef.nativeElement ? elementRef.nativeElement : elementRef;
|
|
17
|
+
this.rim = OPTICAL_DEFAULTS.rim;
|
|
18
|
+
this.ior = OPTICAL_DEFAULTS.ior;
|
|
19
|
+
this.height = OPTICAL_DEFAULTS.height;
|
|
20
|
+
this.frosted = OPTICAL_DEFAULTS.frosted;
|
|
21
|
+
this.fusion = OPTICAL_DEFAULTS.fusion;
|
|
22
|
+
this.borderRadius = null;
|
|
23
|
+
this.liquidGlass = null;
|
|
24
|
+
this._controller = null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
ngOnInit() {
|
|
28
|
+
const opts =
|
|
29
|
+
typeof this.liquidGlass === 'object' && this.liquidGlass !== null
|
|
30
|
+
? this.liquidGlass
|
|
31
|
+
: {
|
|
32
|
+
rim: this.rim,
|
|
33
|
+
ior: this.ior,
|
|
34
|
+
height: this.height,
|
|
35
|
+
frosted: this.frosted,
|
|
36
|
+
fusion: this.fusion,
|
|
37
|
+
borderRadius: this.borderRadius
|
|
38
|
+
};
|
|
39
|
+
this._controller = new LiquidGlassController(this.el, opts);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
ngOnChanges() {
|
|
43
|
+
if (this._controller) {
|
|
44
|
+
const opts =
|
|
45
|
+
typeof this.liquidGlass === 'object' && this.liquidGlass !== null
|
|
46
|
+
? this.liquidGlass
|
|
47
|
+
: {
|
|
48
|
+
rim: this.rim,
|
|
49
|
+
ior: this.ior,
|
|
50
|
+
height: this.height,
|
|
51
|
+
frosted: this.frosted,
|
|
52
|
+
fusion: this.fusion,
|
|
53
|
+
borderRadius: this.borderRadius
|
|
54
|
+
};
|
|
55
|
+
this._controller.update(opts);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
ngOnDestroy() {
|
|
60
|
+
if (this._controller) {
|
|
61
|
+
this._controller.destroy();
|
|
62
|
+
this._controller = null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Helper to attach LiquidGlass directly inside Angular ngAfterViewInit
|
|
69
|
+
*/
|
|
70
|
+
export function attachAngularLiquidGlass(elementRef, options = {}) {
|
|
71
|
+
const el = elementRef && elementRef.nativeElement ? elementRef.nativeElement : elementRef;
|
|
72
|
+
return new LiquidGlassController(el, options);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { LiquidGlassController, OPTICAL_DEFAULTS, OPTICAL_LIMITS };
|
|
76
|
+
export default LiquidGlassDirective;
|