@levita-js/angular 0.1.6

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jérôme André
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1,56 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _angular_core = require("@angular/core");
3
+ let levita_js = require("levita-js");
4
+
5
+ //#region \0@oxc-project+runtime@0.112.0/helpers/decorateMetadata.js
6
+ function __decorateMetadata(k, v) {
7
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
8
+ }
9
+
10
+ //#endregion
11
+ //#region \0@oxc-project+runtime@0.112.0/helpers/decorate.js
12
+ function __decorate(decorators, target, key, desc) {
13
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
16
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
17
+ }
18
+
19
+ //#endregion
20
+ //#region src/index.ts
21
+ var _ref;
22
+ let LevitaDirective = class LevitaDirective {
23
+ /** Configuration options for the tilt effect. */
24
+ options;
25
+ instance;
26
+ constructor(el) {
27
+ this.el = el;
28
+ }
29
+ ngOnChanges(changes) {
30
+ if (changes.options) this.initialize();
31
+ }
32
+ ngOnDestroy() {
33
+ this.instance?.destroy();
34
+ }
35
+ initialize() {
36
+ this.instance?.destroy();
37
+ this.instance = new levita_js.Levita(this.el.nativeElement, (0, levita_js.buildOptions)(this.options ?? {}));
38
+ }
39
+ /** Access to the underlying Levita instance. */
40
+ get levitaInstance() {
41
+ return this.instance;
42
+ }
43
+ };
44
+ __decorate([(0, _angular_core.Input)("levita"), __decorateMetadata("design:type", typeof (_ref = typeof Partial !== "undefined" && Partial) === "function" ? _ref : Object)], LevitaDirective.prototype, "options", void 0);
45
+ LevitaDirective = __decorate([(0, _angular_core.Directive)({
46
+ selector: "[levita]",
47
+ standalone: true
48
+ }), __decorateMetadata("design:paramtypes", [Object])], LevitaDirective);
49
+
50
+ //#endregion
51
+ Object.defineProperty(exports, 'LevitaDirective', {
52
+ enumerable: true,
53
+ get: function () {
54
+ return LevitaDirective;
55
+ }
56
+ });
@@ -0,0 +1,29 @@
1
+ import { ElementRef, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
2
+ import { Levita, LevitaOptions } from "levita-js";
3
+
4
+ //#region src/index.d.ts
5
+ /**
6
+ * Angular directive that applies the Levita 3D tilt effect to an element.
7
+ *
8
+ * @example
9
+ * ```html
10
+ * <div [levita]="{ glare: true, shadow: true }">
11
+ * <h1>Hello</h1>
12
+ * </div>
13
+ * ```
14
+ */
15
+ declare class LevitaDirective implements OnChanges, OnDestroy {
16
+ private el;
17
+ /** Configuration options for the tilt effect. */
18
+ options?: Partial<LevitaOptions>;
19
+ private instance?;
20
+ constructor(el: ElementRef<HTMLElement>);
21
+ ngOnChanges(changes: SimpleChanges): void;
22
+ ngOnDestroy(): void;
23
+ private initialize;
24
+ /** Access to the underlying Levita instance. */
25
+ get levitaInstance(): Levita | undefined;
26
+ }
27
+ //#endregion
28
+ export { LevitaDirective };
29
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;AAoBA;;;;;;;;cAIa,eAAA,YAA2B,SAAA,EAAW,SAAA;EAAA,QAM9B,EAAA;EAN8B;EAEjC,OAAA,GAAU,OAAA,CAAQ,aAAA;EAAA,QAE3B,QAAA;cAEY,EAAA,EAAI,UAAA,CAAW,WAAA;EAEnC,WAAA,CAAY,OAAA,EAAS,aAAA;EAMrB,WAAA,CAAA;EAAA,QAIQ,UAAA;EAhBmB;EAAA,IAsBvB,cAAA,CAAA,GAAkB,MAAA;AAAA"}
@@ -0,0 +1,29 @@
1
+ import { ElementRef, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
2
+ import { Levita, LevitaOptions } from "levita-js";
3
+
4
+ //#region src/index.d.ts
5
+ /**
6
+ * Angular directive that applies the Levita 3D tilt effect to an element.
7
+ *
8
+ * @example
9
+ * ```html
10
+ * <div [levita]="{ glare: true, shadow: true }">
11
+ * <h1>Hello</h1>
12
+ * </div>
13
+ * ```
14
+ */
15
+ declare class LevitaDirective implements OnChanges, OnDestroy {
16
+ private el;
17
+ /** Configuration options for the tilt effect. */
18
+ options?: Partial<LevitaOptions>;
19
+ private instance?;
20
+ constructor(el: ElementRef<HTMLElement>);
21
+ ngOnChanges(changes: SimpleChanges): void;
22
+ ngOnDestroy(): void;
23
+ private initialize;
24
+ /** Access to the underlying Levita instance. */
25
+ get levitaInstance(): Levita | undefined;
26
+ }
27
+ //#endregion
28
+ export { LevitaDirective };
29
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;AAoBA;;;;;;;;cAIa,eAAA,YAA2B,SAAA,EAAW,SAAA;EAAA,QAM9B,EAAA;EAN8B;EAEjC,OAAA,GAAU,OAAA,CAAQ,aAAA;EAAA,QAE3B,QAAA;cAEY,EAAA,EAAI,UAAA,CAAW,WAAA;EAEnC,WAAA,CAAY,OAAA,EAAS,aAAA;EAMrB,WAAA,CAAA;EAAA,QAIQ,UAAA;EAhBmB;EAAA,IAsBvB,cAAA,CAAA,GAAkB,MAAA;AAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,51 @@
1
+ import { Directive, Input } from "@angular/core";
2
+ import { Levita, buildOptions } from "levita-js";
3
+
4
+ //#region \0@oxc-project+runtime@0.112.0/helpers/decorateMetadata.js
5
+ function __decorateMetadata(k, v) {
6
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
7
+ }
8
+
9
+ //#endregion
10
+ //#region \0@oxc-project+runtime@0.112.0/helpers/decorate.js
11
+ function __decorate(decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16
+ }
17
+
18
+ //#endregion
19
+ //#region src/index.ts
20
+ var _ref;
21
+ let LevitaDirective = class LevitaDirective {
22
+ /** Configuration options for the tilt effect. */
23
+ options;
24
+ instance;
25
+ constructor(el) {
26
+ this.el = el;
27
+ }
28
+ ngOnChanges(changes) {
29
+ if (changes.options) this.initialize();
30
+ }
31
+ ngOnDestroy() {
32
+ this.instance?.destroy();
33
+ }
34
+ initialize() {
35
+ this.instance?.destroy();
36
+ this.instance = new Levita(this.el.nativeElement, buildOptions(this.options ?? {}));
37
+ }
38
+ /** Access to the underlying Levita instance. */
39
+ get levitaInstance() {
40
+ return this.instance;
41
+ }
42
+ };
43
+ __decorate([Input("levita"), __decorateMetadata("design:type", typeof (_ref = typeof Partial !== "undefined" && Partial) === "function" ? _ref : Object)], LevitaDirective.prototype, "options", void 0);
44
+ LevitaDirective = __decorate([Directive({
45
+ selector: "[levita]",
46
+ standalone: true
47
+ }), __decorateMetadata("design:paramtypes", [Object])], LevitaDirective);
48
+
49
+ //#endregion
50
+ export { LevitaDirective };
51
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n\tDirective,\n\ttype ElementRef,\n\tInput,\n\ttype OnChanges,\n\ttype OnDestroy,\n\ttype SimpleChanges,\n} from \"@angular/core\";\nimport { buildOptions, Levita, type LevitaOptions } from \"levita-js\";\n\n/**\n * Angular directive that applies the Levita 3D tilt effect to an element.\n *\n * @example\n * ```html\n * <div [levita]=\"{ glare: true, shadow: true }\">\n * <h1>Hello</h1>\n * </div>\n * ```\n */\n@Directive({\n\tselector: \"[levita]\",\n\tstandalone: true,\n})\nexport class LevitaDirective implements OnChanges, OnDestroy {\n\t/** Configuration options for the tilt effect. */\n\t@Input(\"levita\") options?: Partial<LevitaOptions>;\n\n\tprivate instance?: Levita;\n\n\tconstructor(private el: ElementRef<HTMLElement>) {}\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tif (changes.options) {\n\t\t\tthis.initialize();\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.instance?.destroy();\n\t}\n\n\tprivate initialize(): void {\n\t\tthis.instance?.destroy();\n\t\tthis.instance = new Levita(this.el.nativeElement, buildOptions(this.options ?? {}));\n\t}\n\n\t/** Access to the underlying Levita instance. */\n\tget levitaInstance(): Levita | undefined {\n\t\treturn this.instance;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBO,4BAAM,gBAAgD;;CAE5D,AAAiB;CAEjB,AAAQ;CAER,YAAY,AAAQ,IAA6B;EAA7B;;CAEpB,YAAY,SAA8B;AACzC,MAAI,QAAQ,QACX,MAAK,YAAY;;CAInB,cAAoB;AACnB,OAAK,UAAU,SAAS;;CAGzB,AAAQ,aAAmB;AAC1B,OAAK,UAAU,SAAS;AACxB,OAAK,WAAW,IAAI,OAAO,KAAK,GAAG,eAAe,aAAa,KAAK,WAAW,EAAE,CAAC,CAAC;;;CAIpF,IAAI,iBAAqC;AACxC,SAAO,KAAK;;;YAvBZ,MAAM,SAAS;8BANhB,UAAU;CACV,UAAU;CACV,YAAY;CACZ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@levita-js/angular",
3
+ "version": "0.1.6",
4
+ "description": "Angular wrapper for Levita 3D tilt & parallax",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.mts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.mts",
13
+ "default": "./dist/index.mjs"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public",
26
+ "provenance": false
27
+ },
28
+ "sideEffects": false,
29
+ "peerDependencies": {
30
+ "@angular/core": ">=14.0.0"
31
+ },
32
+ "dependencies": {
33
+ "levita-js": "0.1.6"
34
+ },
35
+ "devDependencies": {
36
+ "@angular/core": "^21.2.0",
37
+ "rxjs": "^7.8.1",
38
+ "tsdown": "^0.20.3"
39
+ },
40
+ "license": "MIT",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/Jeromearsene/levita.git",
44
+ "directory": "packages/angular"
45
+ },
46
+ "homepage": "https://github.com/Jeromearsene/levita#readme",
47
+ "scripts": {
48
+ "build": "tsdown"
49
+ }
50
+ }