@levita-js/angular 0.1.6 → 0.2.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 ADDED
@@ -0,0 +1,7 @@
1
+ # @levita-js/angular
2
+
3
+ Angular wrapper for Levita 3D tilt & parallax.
4
+
5
+ Provides a standalone attribute directive `[levita]` to easily apply 3D tilt effects to any element in your Angular applications.
6
+
7
+ Refer to the main [Levita README](https://github.com/Jeromearsene/levita#readme) for full documentation and examples.
package/dist/index.cjs CHANGED
@@ -16,9 +16,17 @@ function __decorate(decorators, target, key, desc) {
16
16
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17
17
  }
18
18
 
19
+ //#endregion
20
+ //#region \0@oxc-project+runtime@0.112.0/helpers/decorateParam.js
21
+ function __decorateParam(paramIndex, decorator) {
22
+ return function(target, key) {
23
+ decorator(target, key, paramIndex);
24
+ };
25
+ }
26
+
19
27
  //#endregion
20
28
  //#region src/index.ts
21
- var _ref;
29
+ var _ref, _ref2;
22
30
  let LevitaDirective = class LevitaDirective {
23
31
  /** Configuration options for the tilt effect. */
24
32
  options;
@@ -41,11 +49,15 @@ let LevitaDirective = class LevitaDirective {
41
49
  return this.instance;
42
50
  }
43
51
  };
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);
52
+ __decorate([(0, _angular_core.Input)("levita"), __decorateMetadata("design:type", typeof (_ref2 = typeof Partial !== "undefined" && Partial) === "function" ? _ref2 : Object)], LevitaDirective.prototype, "options", void 0);
53
+ LevitaDirective = __decorate([
54
+ (0, _angular_core.Directive)({
55
+ selector: "[levita]",
56
+ standalone: true
57
+ }),
58
+ __decorateParam(0, (0, _angular_core.Inject)(_angular_core.ElementRef)),
59
+ __decorateMetadata("design:paramtypes", [typeof (_ref = typeof _angular_core.ElementRef !== "undefined" && _angular_core.ElementRef) === "function" ? _ref : Object])
60
+ ], LevitaDirective);
49
61
 
50
62
  //#endregion
51
63
  Object.defineProperty(exports, 'LevitaDirective', {
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;AAqBA;;;;;;;;cAIa,eAAA,YAA2B,SAAA,EAAW,SAAA;EAAA,QAMV,EAAA;EANU;EAEjC,OAAA,GAAU,OAAA,CAAQ,aAAA;EAAA,QAE3B,QAAA;cAEgC,EAAA,EAAI,UAAA,CAAW,WAAA;EAEvD,WAAA,CAAY,OAAA,EAAS,aAAA;EAMrB,WAAA,CAAA;EAAA,QAIQ,UAAA;EAhBmB;EAAA,IAsBvB,cAAA,CAAA,GAAkB,MAAA;AAAA"}
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;AAqBA;;;;;;;;cAIa,eAAA,YAA2B,SAAA,EAAW,SAAA;EAAA,QAMV,EAAA;EANU;EAEjC,OAAA,GAAU,OAAA,CAAQ,aAAA;EAAA,QAE3B,QAAA;cAEgC,EAAA,EAAI,UAAA,CAAW,WAAA;EAEvD,WAAA,CAAY,OAAA,EAAS,aAAA;EAMrB,WAAA,CAAA;EAAA,QAIQ,UAAA;EAhBmB;EAAA,IAsBvB,cAAA,CAAA,GAAkB,MAAA;AAAA"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { Directive, Input } from "@angular/core";
1
+ import { Directive, ElementRef, Inject, Input } from "@angular/core";
2
2
  import { Levita, buildOptions } from "levita-js";
3
3
 
4
4
  //#region \0@oxc-project+runtime@0.112.0/helpers/decorateMetadata.js
@@ -15,9 +15,17 @@ function __decorate(decorators, target, key, desc) {
15
15
  return c > 3 && r && Object.defineProperty(target, key, r), r;
16
16
  }
17
17
 
18
+ //#endregion
19
+ //#region \0@oxc-project+runtime@0.112.0/helpers/decorateParam.js
20
+ function __decorateParam(paramIndex, decorator) {
21
+ return function(target, key) {
22
+ decorator(target, key, paramIndex);
23
+ };
24
+ }
25
+
18
26
  //#endregion
19
27
  //#region src/index.ts
20
- var _ref;
28
+ var _ref, _ref2;
21
29
  let LevitaDirective = class LevitaDirective {
22
30
  /** Configuration options for the tilt effect. */
23
31
  options;
@@ -40,11 +48,15 @@ let LevitaDirective = class LevitaDirective {
40
48
  return this.instance;
41
49
  }
42
50
  };
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);
51
+ __decorate([Input("levita"), __decorateMetadata("design:type", typeof (_ref2 = typeof Partial !== "undefined" && Partial) === "function" ? _ref2 : Object)], LevitaDirective.prototype, "options", void 0);
52
+ LevitaDirective = __decorate([
53
+ Directive({
54
+ selector: "[levita]",
55
+ standalone: true
56
+ }),
57
+ __decorateParam(0, Inject(ElementRef)),
58
+ __decorateMetadata("design:paramtypes", [typeof (_ref = typeof ElementRef !== "undefined" && ElementRef) === "function" ? _ref : Object])
59
+ ], LevitaDirective);
48
60
 
49
61
  //#endregion
50
62
  export { LevitaDirective };
@@ -1 +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"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n\tDirective,\n\tElementRef,\n\tInject,\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(@Inject(ElementRef) 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,4BAAM,gBAAgD;;CAE5D,AAAiB;CAEjB,AAAQ;CAER,YAAY,AAA4B,IAA6B;EAA7B;;CAExC,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;;CANhB,UAAU;EACV,UAAU;EACV,YAAY;EACZ,CAAC;oBAOY,OAAO,WAAW"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levita-js/angular",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "Angular wrapper for Levita 3D tilt & parallax",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -23,17 +23,19 @@
23
23
  ],
24
24
  "publishConfig": {
25
25
  "access": "public",
26
- "provenance": false
26
+ "provenance": true
27
27
  },
28
28
  "sideEffects": false,
29
29
  "peerDependencies": {
30
30
  "@angular/core": ">=14.0.0"
31
31
  },
32
32
  "dependencies": {
33
- "levita-js": "0.1.6"
33
+ "levita-js": "0.2.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@angular/core": "^21.2.0",
37
+ "@angular/platform-browser-dynamic": "^21.2.0",
38
+ "reflect-metadata": "^0.2.2",
37
39
  "rxjs": "^7.8.1",
38
40
  "tsdown": "^0.20.3"
39
41
  },
@@ -45,6 +47,7 @@
45
47
  },
46
48
  "homepage": "https://github.com/Jeromearsene/levita#readme",
47
49
  "scripts": {
48
- "build": "tsdown"
50
+ "build": "tsdown",
51
+ "type-check": "tsc --noEmit"
49
52
  }
50
53
  }