@simhub2/justflipit 3.2.2 → 4.0.1

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 (57) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +21 -0
  3. package/README.md +258 -91
  4. package/dist/agent.cjs +63 -0
  5. package/dist/agent.cjs.map +7 -0
  6. package/dist/agent.d.cts +4 -0
  7. package/dist/agent.d.mts +4 -0
  8. package/dist/agent.d.ts +4 -0
  9. package/dist/agent.mjs +43 -0
  10. package/dist/agent.mjs.map +7 -0
  11. package/dist/justFlipIt-combined.js +295 -0
  12. package/dist/justFlipIt-combined.min.js +23 -0
  13. package/dist/justFlipIt-modern.js +271 -476
  14. package/dist/justFlipIt-modern.min.js +23 -1
  15. package/dist/justFlipIt-vanilla.js +272 -343
  16. package/dist/justFlipIt-vanilla.min.js +23 -1
  17. package/dist/justFlipIt.cjs +293 -0
  18. package/dist/justFlipIt.cjs.map +7 -0
  19. package/dist/justFlipIt.d.cts +4 -0
  20. package/dist/justFlipIt.d.mts +38 -0
  21. package/dist/justFlipIt.d.ts +38 -0
  22. package/dist/justFlipIt.js +269 -391
  23. package/dist/justFlipIt.js.map +7 -0
  24. package/dist/justFlipIt.min.js +23 -1
  25. package/dist/justFlipIt.min.js.map +7 -0
  26. package/dist/justFlipIt.mjs +272 -0
  27. package/dist/justFlipIt.mjs.map +7 -0
  28. package/dist/react.cjs +55 -0
  29. package/dist/react.cjs.map +7 -0
  30. package/dist/react.d.cts +3 -0
  31. package/dist/react.d.mts +3 -0
  32. package/dist/react.d.ts +3 -0
  33. package/dist/react.mjs +25 -0
  34. package/dist/react.mjs.map +7 -0
  35. package/dist/svelte.cjs +45 -0
  36. package/dist/svelte.cjs.map +7 -0
  37. package/dist/svelte.d.cts +3 -0
  38. package/dist/svelte.d.mts +3 -0
  39. package/dist/svelte.d.ts +3 -0
  40. package/dist/svelte.mjs +15 -0
  41. package/dist/svelte.mjs.map +7 -0
  42. package/dist/types/justFlipIt.d.ts +36 -59
  43. package/dist/vue.cjs +49 -0
  44. package/dist/vue.cjs.map +7 -0
  45. package/dist/vue.d.cts +3 -0
  46. package/dist/vue.d.mts +3 -0
  47. package/dist/vue.d.ts +3 -0
  48. package/dist/vue.mjs +19 -0
  49. package/dist/vue.mjs.map +7 -0
  50. package/package.json +117 -50
  51. package/src/justFlipIt-combined.js +0 -417
  52. package/src/justFlipIt-combined.min.js +0 -1
  53. package/src/justFlipIt-modern.js +0 -500
  54. package/src/justFlipIt-modern.min.js +0 -1
  55. package/src/justFlipIt-vanilla.js +0 -366
  56. package/src/justFlipIt-vanilla.min.js +0 -1
  57. package/src/justFlipIt.d.ts +0 -61
package/dist/react.mjs ADDED
@@ -0,0 +1,25 @@
1
+ // src/adapters/react.js
2
+ import { useEffect, useRef } from "react";
3
+ import justFlipIt from "@simhub2/justflipit";
4
+ var faces = { front: "[data-flip-front]", back: "[data-flip-back]" };
5
+ function useFlip(options = {}) {
6
+ const ref = useRef(null), controller = useRef(null);
7
+ useEffect(() => {
8
+ if (!ref.current) return;
9
+ const instance = justFlipIt(ref.current, { ...options, Faces: options.Faces || faces });
10
+ controller.current = instance;
11
+ return () => {
12
+ instance.destroy();
13
+ controller.current = null;
14
+ };
15
+ }, []);
16
+ useEffect(() => {
17
+ const { Faces, ...settings } = options;
18
+ controller.current?.update(settings);
19
+ }, [options]);
20
+ return { ref, controller };
21
+ }
22
+ export {
23
+ useFlip
24
+ };
25
+ //# sourceMappingURL=react.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/adapters/react.js"],
4
+ "sourcesContent": ["import { useEffect, useRef } from 'react';\nimport justFlipIt from '@simhub2/justflipit';\nconst faces = { front: '[data-flip-front]', back: '[data-flip-back]' };\nexport function useFlip(options = {}) {\n const ref = useRef(null), controller = useRef(null);\n useEffect(() => {\n if (!ref.current) return;\n const instance = justFlipIt(ref.current, { ...options, Faces: options.Faces || faces });\n controller.current = instance;\n return () => { instance.destroy(); controller.current = null; };\n }, []);\n useEffect(() => { const { Faces, ...settings } = options; controller.current?.update(settings); }, [options]);\n return { ref, controller };\n}\n"],
5
+ "mappings": ";AAAA,SAAS,WAAW,cAAc;AAClC,OAAO,gBAAgB;AACvB,IAAM,QAAQ,EAAE,OAAO,qBAAqB,MAAM,mBAAmB;AAC9D,SAAS,QAAQ,UAAU,CAAC,GAAG;AACpC,QAAM,MAAM,OAAO,IAAI,GAAG,aAAa,OAAO,IAAI;AAClD,YAAU,MAAM;AACd,QAAI,CAAC,IAAI,QAAS;AAClB,UAAM,WAAW,WAAW,IAAI,SAAS,EAAE,GAAG,SAAS,OAAO,QAAQ,SAAS,MAAM,CAAC;AACtF,eAAW,UAAU;AACrB,WAAO,MAAM;AAAE,eAAS,QAAQ;AAAG,iBAAW,UAAU;AAAA,IAAM;AAAA,EAChE,GAAG,CAAC,CAAC;AACL,YAAU,MAAM;AAAE,UAAM,EAAE,OAAO,GAAG,SAAS,IAAI;AAAS,eAAW,SAAS,OAAO,QAAQ;AAAA,EAAG,GAAG,CAAC,OAAO,CAAC;AAC5G,SAAO,EAAE,KAAK,WAAW;AAC3B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,45 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/adapters/svelte.js
30
+ var svelte_exports = {};
31
+ __export(svelte_exports, {
32
+ flip: () => flip
33
+ });
34
+ module.exports = __toCommonJS(svelte_exports);
35
+ var import_justflipit = __toESM(require("@simhub2/justflipit"));
36
+ function flip(node, options = {}) {
37
+ const instance = (0, import_justflipit.default)(node, { ...options, Faces: options.Faces || { front: "[data-flip-front]", back: "[data-flip-back]" } });
38
+ return { update(next = {}) {
39
+ const { Faces, ...settings } = next;
40
+ instance.update(settings);
41
+ }, destroy() {
42
+ instance.destroy();
43
+ } };
44
+ }
45
+ //# sourceMappingURL=svelte.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/adapters/svelte.js"],
4
+ "sourcesContent": ["import justFlipIt from '@simhub2/justflipit';\nexport function flip(node, options = {}) {\n const instance = justFlipIt(node, { ...options, Faces: options.Faces || { front: '[data-flip-front]', back: '[data-flip-back]' } });\n return { update(next = {}) { const { Faces, ...settings } = next; instance.update(settings); }, destroy() { instance.destroy(); } };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AAChB,SAAS,KAAK,MAAM,UAAU,CAAC,GAAG;AACvC,QAAM,eAAW,kBAAAA,SAAW,MAAM,EAAE,GAAG,SAAS,OAAO,QAAQ,SAAS,EAAE,OAAO,qBAAqB,MAAM,mBAAmB,EAAE,CAAC;AAClI,SAAO,EAAE,OAAO,OAAO,CAAC,GAAG;AAAE,UAAM,EAAE,OAAO,GAAG,SAAS,IAAI;AAAM,aAAS,OAAO,QAAQ;AAAA,EAAG,GAAG,UAAU;AAAE,aAAS,QAAQ;AAAA,EAAG,EAAE;AACpI;",
6
+ "names": ["justFlipIt"]
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { Action } from 'svelte/action';
2
+ import type { Options } from './justFlipIt.mjs';
3
+ export const flip: Action<HTMLElement, Options | undefined>;
@@ -0,0 +1,3 @@
1
+ import type { Action } from 'svelte/action';
2
+ import type { Options } from './justFlipIt.mjs';
3
+ export const flip: Action<HTMLElement, Options | undefined>;
@@ -0,0 +1,3 @@
1
+ import type { Action } from 'svelte/action';
2
+ import type { Options } from './justFlipIt';
3
+ export const flip: Action<HTMLElement, Options | undefined>;
@@ -0,0 +1,15 @@
1
+ // src/adapters/svelte.js
2
+ import justFlipIt from "@simhub2/justflipit";
3
+ function flip(node, options = {}) {
4
+ const instance = justFlipIt(node, { ...options, Faces: options.Faces || { front: "[data-flip-front]", back: "[data-flip-back]" } });
5
+ return { update(next = {}) {
6
+ const { Faces, ...settings } = next;
7
+ instance.update(settings);
8
+ }, destroy() {
9
+ instance.destroy();
10
+ } };
11
+ }
12
+ export {
13
+ flip
14
+ };
15
+ //# sourceMappingURL=svelte.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/adapters/svelte.js"],
4
+ "sourcesContent": ["import justFlipIt from '@simhub2/justflipit';\nexport function flip(node, options = {}) {\n const instance = justFlipIt(node, { ...options, Faces: options.Faces || { front: '[data-flip-front]', back: '[data-flip-back]' } });\n return { update(next = {}) { const { Faces, ...settings } = next; instance.update(settings); }, destroy() { instance.destroy(); } };\n}\n"],
5
+ "mappings": ";AAAA,OAAO,gBAAgB;AAChB,SAAS,KAAK,MAAM,UAAU,CAAC,GAAG;AACvC,QAAM,WAAW,WAAW,MAAM,EAAE,GAAG,SAAS,OAAO,QAAQ,SAAS,EAAE,OAAO,qBAAqB,MAAM,mBAAmB,EAAE,CAAC;AAClI,SAAO,EAAE,OAAO,OAAO,CAAC,GAAG;AAAE,UAAM,EAAE,OAAO,GAAG,SAAS,IAAI;AAAM,aAAS,OAAO,QAAQ;AAAA,EAAG,GAAG,UAAU;AAAE,aAAS,QAAQ;AAAA,EAAG,EAAE;AACpI;",
6
+ "names": []
7
+ }
@@ -1,61 +1,38 @@
1
+ export interface Options {
2
+ Template?: string;
3
+ Click?: boolean | string | string[];
4
+ FlipX?: boolean;
5
+ Duration?: number;
6
+ Easing?: string;
7
+ Effect?: 'flip' | 'fade' | 'scale';
8
+ ReducedMotion?: boolean;
9
+ Tilt?: boolean | 'only' | { max?: number; perspective?: number; scale?: number };
10
+ Faces?: { front: string; back: string };
11
+ preserveClasses?: boolean;
12
+ preserveStyles?: boolean;
13
+ Style?: { el: string; style: Partial<CSSStyleDeclaration> }[];
14
+ }
15
+ export interface FlipState { flipped: boolean; destroyed: boolean; effect: 'flip' | 'fade' | 'scale' }
16
+ export class FlipController {
17
+ constructor(element: HTMLElement, options?: Options);
18
+ readonly element: HTMLElement;
19
+ readonly hoverPanel: HTMLElement;
20
+ readonly frontWrapper: HTMLElement;
21
+ readonly backWrapper: HTMLElement;
22
+ readonly flipped: boolean;
23
+ readonly destroyed: boolean;
24
+ readonly managed: boolean;
25
+ flip(value?: boolean): this;
26
+ toggle(): this;
27
+ update(options?: Omit<Options, 'Faces'>): this;
28
+ getState(): FlipState;
29
+ destroy(): void;
30
+ }
31
+ type Targets = string | Iterable<HTMLElement> | ArrayLike<HTMLElement>;
32
+ declare function justFlipIt(target: HTMLElement, options?: Options): FlipController;
33
+ declare function justFlipIt(target: Targets, options?: Options): FlipController[];
1
34
  declare namespace justFlipIt {
2
- interface StyleOption {
3
- el: string;
4
- style: Partial<CSSStyleDeclaration>;
5
- }
6
-
7
- interface Options {
8
- /**
9
- * Template for the back side of the flipped element
10
- */
11
- Template?: string;
12
-
13
- /**
14
- * Click behavior. True for click toggle, selector string for delegated click, false for hover
15
- */
16
- Click?: boolean | string;
17
-
18
- /**
19
- * Flip direction. True for X-axis, false for Y-axis
20
- */
21
- FlipX?: boolean;
22
-
23
- /**
24
- * Custom styles to apply to elements
25
- */
26
- Style?: StyleOption[];
27
-
28
- /**
29
- * If true, all CSS classes from the original element are copied to the flip panel (default: true)
30
- */
31
- preserveClasses?: boolean;
32
-
33
- /**
34
- * If true, all inline styles from the original element are copied to the flip panel (default: true)
35
- */
36
- preserveStyles?: boolean;
37
-
38
- /**
39
- * Enables 3D tilt effect.
40
- * - `true`: Combines flip and tilt.
41
- * - `'only'`: Enables only tilt.
42
- * - `false`: Disables tilt (default).
43
- */
44
- Tilt?: boolean | 'only';
45
- }
46
-
47
- /**
48
- * Destroy flip instances matching the selector
49
- */
50
- function destroy(selector: string | Element | NodeListOf<Element> | HTMLCollection): void;
35
+ function destroy(target: HTMLElement | Targets): void;
36
+ function get(element: HTMLElement): FlipController | undefined;
51
37
  }
52
-
53
- /**
54
- * Initialize flip effect on matching elements
55
- */
56
- declare function justFlipIt(
57
- selector: string | Element | NodeListOf<Element> | HTMLCollection,
58
- options?: justFlipIt.Options
59
- ): any;
60
-
61
- export = justFlipIt;
38
+ export default justFlipIt;
package/dist/vue.cjs ADDED
@@ -0,0 +1,49 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/adapters/vue.js
30
+ var vue_exports = {};
31
+ __export(vue_exports, {
32
+ vFlip: () => vFlip
33
+ });
34
+ module.exports = __toCommonJS(vue_exports);
35
+ var import_justflipit = __toESM(require("@simhub2/justflipit"));
36
+ var vFlip = {
37
+ mounted(element, binding) {
38
+ const options = binding.value || {};
39
+ (0, import_justflipit.default)(element, { ...options, Faces: options.Faces || { front: "[data-flip-front]", back: "[data-flip-back]" } });
40
+ },
41
+ updated(element, binding) {
42
+ const { Faces, ...settings } = binding.value || {};
43
+ import_justflipit.default.get(element)?.update(settings);
44
+ },
45
+ beforeUnmount(element) {
46
+ import_justflipit.default.destroy(element);
47
+ }
48
+ };
49
+ //# sourceMappingURL=vue.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/adapters/vue.js"],
4
+ "sourcesContent": ["import justFlipIt from '@simhub2/justflipit';\nexport const vFlip = {\n mounted(element, binding) { const options = binding.value || {}; justFlipIt(element, { ...options, Faces: options.Faces || { front: '[data-flip-front]', back: '[data-flip-back]' } }); },\n updated(element, binding) { const { Faces, ...settings } = binding.value || {}; justFlipIt.get(element)?.update(settings); },\n beforeUnmount(element) { justFlipIt.destroy(element); }\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AAChB,IAAM,QAAQ;AAAA,EACnB,QAAQ,SAAS,SAAS;AAAE,UAAM,UAAU,QAAQ,SAAS,CAAC;AAAG,0BAAAA,SAAW,SAAS,EAAE,GAAG,SAAS,OAAO,QAAQ,SAAS,EAAE,OAAO,qBAAqB,MAAM,mBAAmB,EAAE,CAAC;AAAA,EAAG;AAAA,EACxL,QAAQ,SAAS,SAAS;AAAE,UAAM,EAAE,OAAO,GAAG,SAAS,IAAI,QAAQ,SAAS,CAAC;AAAG,sBAAAA,QAAW,IAAI,OAAO,GAAG,OAAO,QAAQ;AAAA,EAAG;AAAA,EAC3H,cAAc,SAAS;AAAE,sBAAAA,QAAW,QAAQ,OAAO;AAAA,EAAG;AACxD;",
6
+ "names": ["justFlipIt"]
7
+ }
package/dist/vue.d.cts ADDED
@@ -0,0 +1,3 @@
1
+ import type { ObjectDirective } from 'vue';
2
+ import type { Options } from './justFlipIt.mjs';
3
+ export const vFlip: ObjectDirective<HTMLElement, Options>;
package/dist/vue.d.mts ADDED
@@ -0,0 +1,3 @@
1
+ import type { ObjectDirective } from 'vue';
2
+ import type { Options } from './justFlipIt.mjs';
3
+ export const vFlip: ObjectDirective<HTMLElement, Options>;
package/dist/vue.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { ObjectDirective } from 'vue';
2
+ import type { Options } from './justFlipIt';
3
+ export const vFlip: ObjectDirective<HTMLElement, Options>;
package/dist/vue.mjs ADDED
@@ -0,0 +1,19 @@
1
+ // src/adapters/vue.js
2
+ import justFlipIt from "@simhub2/justflipit";
3
+ var vFlip = {
4
+ mounted(element, binding) {
5
+ const options = binding.value || {};
6
+ justFlipIt(element, { ...options, Faces: options.Faces || { front: "[data-flip-front]", back: "[data-flip-back]" } });
7
+ },
8
+ updated(element, binding) {
9
+ const { Faces, ...settings } = binding.value || {};
10
+ justFlipIt.get(element)?.update(settings);
11
+ },
12
+ beforeUnmount(element) {
13
+ justFlipIt.destroy(element);
14
+ }
15
+ };
16
+ export {
17
+ vFlip
18
+ };
19
+ //# sourceMappingURL=vue.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/adapters/vue.js"],
4
+ "sourcesContent": ["import justFlipIt from '@simhub2/justflipit';\nexport const vFlip = {\n mounted(element, binding) { const options = binding.value || {}; justFlipIt(element, { ...options, Faces: options.Faces || { front: '[data-flip-front]', back: '[data-flip-back]' } }); },\n updated(element, binding) { const { Faces, ...settings } = binding.value || {}; justFlipIt.get(element)?.update(settings); },\n beforeUnmount(element) { justFlipIt.destroy(element); }\n};\n"],
5
+ "mappings": ";AAAA,OAAO,gBAAgB;AAChB,IAAM,QAAQ;AAAA,EACnB,QAAQ,SAAS,SAAS;AAAE,UAAM,UAAU,QAAQ,SAAS,CAAC;AAAG,eAAW,SAAS,EAAE,GAAG,SAAS,OAAO,QAAQ,SAAS,EAAE,OAAO,qBAAqB,MAAM,mBAAmB,EAAE,CAAC;AAAA,EAAG;AAAA,EACxL,QAAQ,SAAS,SAAS;AAAE,UAAM,EAAE,OAAO,GAAG,SAAS,IAAI,QAAQ,SAAS,CAAC;AAAG,eAAW,IAAI,OAAO,GAAG,OAAO,QAAQ;AAAA,EAAG;AAAA,EAC3H,cAAc,SAAS;AAAE,eAAW,QAAQ,OAAO;AAAA,EAAG;AACxD;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,71 +1,139 @@
1
1
  {
2
2
  "name": "@simhub2/justflipit",
3
- "version": "3.2.2",
4
- "description": "A lightweight JavaScript library that allows you to implement CSS3 based flip animations on any DOM elements",
5
- "main": "dist/justFlipIt.js",
6
- "module": "dist/justFlipIt.js",
7
- "browser": "dist/justFlipIt.min.js",
3
+ "version": "4.0.1",
4
+ "description": "Responsive flip and tilt animations with React, Vue, Svelte and agent tool adapters",
5
+ "main": "./dist/justFlipIt.cjs",
6
+ "module": "./dist/justFlipIt.mjs",
7
+ "browser": "./dist/justFlipIt.js",
8
8
  "unpkg": "dist/justFlipIt.min.js",
9
9
  "jsdelivr": "dist/justFlipIt.min.js",
10
- "types": "dist/types/justFlipIt.d.ts",
10
+ "types": "./dist/justFlipIt.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
- "import": "./dist/justFlipIt.js",
14
- "require": "./dist/justFlipIt.js",
15
- "browser": "./dist/justFlipIt.min.js",
16
- "types": "./dist/types/justFlipIt.d.ts"
17
- },
18
- "./vanilla": {
19
- "import": "./dist/justFlipIt-vanilla.js",
20
- "require": "./dist/justFlipIt-vanilla.js",
21
- "browser": "./dist/justFlipIt-vanilla.min.js"
13
+ "import": {
14
+ "types": "./dist/justFlipIt.d.mts",
15
+ "default": "./dist/justFlipIt.mjs"
16
+ },
17
+ "require": {
18
+ "types": "./dist/justFlipIt.d.cts",
19
+ "default": "./dist/justFlipIt.cjs"
20
+ }
22
21
  },
23
22
  "./modern": {
24
- "import": "./dist/justFlipIt-modern.js",
25
- "require": "./dist/justFlipIt-modern.js",
26
- "browser": "./dist/justFlipIt-modern.min.js"
23
+ "import": {
24
+ "types": "./dist/justFlipIt.d.mts",
25
+ "default": "./dist/justFlipIt.mjs"
26
+ },
27
+ "require": {
28
+ "types": "./dist/justFlipIt.d.cts",
29
+ "default": "./dist/justFlipIt.cjs"
30
+ }
31
+ },
32
+ "./vanilla": {
33
+ "import": {
34
+ "types": "./dist/justFlipIt.d.mts",
35
+ "default": "./dist/justFlipIt.mjs"
36
+ },
37
+ "require": {
38
+ "types": "./dist/justFlipIt.d.cts",
39
+ "default": "./dist/justFlipIt.cjs"
40
+ }
27
41
  },
28
42
  "./combined": {
29
- "import": "./dist/justFlipIt.js",
30
- "require": "./dist/justFlipIt.js",
31
- "browser": "./dist/justFlipIt.min.js"
32
- }
43
+ "import": {
44
+ "types": "./dist/justFlipIt.d.mts",
45
+ "default": "./dist/justFlipIt.mjs"
46
+ },
47
+ "require": {
48
+ "types": "./dist/justFlipIt.d.cts",
49
+ "default": "./dist/justFlipIt.cjs"
50
+ }
51
+ },
52
+ "./react": {
53
+ "import": {
54
+ "types": "./dist/react.d.mts",
55
+ "default": "./dist/react.mjs"
56
+ },
57
+ "require": {
58
+ "types": "./dist/react.d.cts",
59
+ "default": "./dist/react.cjs"
60
+ }
61
+ },
62
+ "./vue": {
63
+ "import": {
64
+ "types": "./dist/vue.d.mts",
65
+ "default": "./dist/vue.mjs"
66
+ },
67
+ "require": {
68
+ "types": "./dist/vue.d.cts",
69
+ "default": "./dist/vue.cjs"
70
+ }
71
+ },
72
+ "./svelte": {
73
+ "import": {
74
+ "types": "./dist/svelte.d.mts",
75
+ "default": "./dist/svelte.mjs"
76
+ },
77
+ "require": {
78
+ "types": "./dist/svelte.d.cts",
79
+ "default": "./dist/svelte.cjs"
80
+ }
81
+ },
82
+ "./agent": {
83
+ "import": {
84
+ "types": "./dist/agent.d.mts",
85
+ "default": "./dist/agent.mjs"
86
+ },
87
+ "require": {
88
+ "types": "./dist/agent.d.cts",
89
+ "default": "./dist/agent.cjs"
90
+ }
91
+ },
92
+ "./dist/*": "./dist/*"
33
93
  },
34
94
  "files": [
35
95
  "dist",
36
- "src",
37
96
  "README.md",
38
- "LICENSE"
97
+ "LICENSE",
98
+ "CHANGELOG.md"
39
99
  ],
40
100
  "scripts": {
41
- "build": "npm run build:clean && npm run build:copy",
42
- "build:clean": "rm -rf dist && mkdir -p dist/types",
43
- "build:copy": "npm run build:copy:vanilla && npm run build:copy:modern && npm run build:copy:combined && npm run build:copy:types",
44
- "build:copy:vanilla": "cp src/justFlipIt-vanilla.js dist/ && cp src/justFlipIt-vanilla.min.js dist/",
45
- "build:copy:modern": "cp src/justFlipIt-modern.js dist/ && cp src/justFlipIt-modern.min.js dist/",
46
- "build:copy:combined": "cp src/justFlipIt-combined.js dist/justFlipIt.js && cp src/justFlipIt-combined.min.js dist/justFlipIt.min.js",
47
- "build:copy:types": "cp src/justFlipIt.d.ts dist/types/justFlipIt.d.ts",
48
- "deploy:pages": "./update-gh-pages.sh",
49
- "prepublishOnly": "npm run build",
50
- "test": "node_modules/karma/bin/karma start karma.conf.js"
101
+ "build": "node scripts/build.mjs",
102
+ "test": "npm run build && node --test tests/*.test.mjs",
103
+ "typecheck": "tsc -p tests/tsconfig.json",
104
+ "check": "npm test && npm run typecheck",
105
+ "prepublishOnly": "npm run check",
106
+ "deploy:pages": "./update-gh-pages.sh"
51
107
  },
52
108
  "devDependencies": {
53
- "chai": "^4.1.2",
54
- "karma": "^2.0.0",
55
- "karma-chai": "^0.1.0",
56
- "karma-chrome-launcher": "^2.2.0",
57
- "karma-mocha": "^1.3.0",
58
- "karma-mocha-reporter": "^2.2.5",
59
- "mocha": "^5.0.0"
109
+ "esbuild": "^0.25.0",
110
+ "jsdom": "^26.0.0",
111
+ "typescript": "^5.8.0",
112
+ "react": "^19.0.0",
113
+ "react-dom": "^19.0.0",
114
+ "@types/react": "^19.0.0",
115
+ "vue": "^3.5.0",
116
+ "svelte": "^5.0.0"
60
117
  },
61
118
  "peerDependencies": {
62
- "jquery": ">=1.7.0"
119
+ "react": ">=18",
120
+ "vue": ">=3",
121
+ "svelte": ">=4"
63
122
  },
64
123
  "peerDependenciesMeta": {
65
- "jquery": {
124
+ "react": {
125
+ "optional": true
126
+ },
127
+ "vue": {
128
+ "optional": true
129
+ },
130
+ "svelte": {
66
131
  "optional": true
67
132
  }
68
133
  },
134
+ "publishConfig": {
135
+ "access": "public"
136
+ },
69
137
  "repository": {
70
138
  "type": "git",
71
139
  "url": "git+https://github.com/SimHub/justFlipIt.git"
@@ -79,13 +147,12 @@
79
147
  "keywords": [
80
148
  "flip",
81
149
  "animation",
82
- "css3",
83
- "javascript",
84
- "vanilla",
85
- "transition",
86
- "jquery",
87
- "modern",
150
+ "tilt",
151
+ "react",
152
+ "vue",
153
+ "svelte",
154
+ "agent",
88
155
  "3d",
89
- "transform"
156
+ "typescript"
90
157
  ]
91
158
  }