@appartmint/tsm-mint 0.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.
- package/dist/abstract/attaches-events.cjs.js +1 -0
- package/dist/abstract/attaches-events.d.ts +10 -0
- package/dist/abstract/attaches-events.es.js +29 -0
- package/dist/abstract/index.cjs.js +1 -0
- package/dist/abstract/index.d.ts +1 -0
- package/dist/abstract/index.es.js +4 -0
- package/dist/components/grid.cjs.js +1 -0
- package/dist/components/grid.d.ts +3 -0
- package/dist/components/grid.es.js +10 -0
- package/dist/components/header.cjs.js +1 -0
- package/dist/components/header.d.ts +3 -0
- package/dist/components/header.es.js +10 -0
- package/dist/components/index.cjs.js +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.es.js +10 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +19 -0
- package/dist/types/box.cjs.js +1 -0
- package/dist/types/box.d.ts +2 -0
- package/dist/types/box.es.js +9 -0
- package/dist/types/index.cjs.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.es.js +4 -0
- package/dist/util/async.cjs.js +1 -0
- package/dist/util/async.d.ts +1 -0
- package/dist/util/async.es.js +6 -0
- package/dist/util/index.cjs.js +1 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.es.js +7 -0
- package/dist/util/math.cjs.js +1 -0
- package/dist/util/math.d.ts +15 -0
- package/dist/util/math.es.js +10 -0
- package/package.json +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var v=Object.defineProperty;var r=(t,e,s)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var a=(t,e,s)=>r(t,typeof e!="symbol"?e+"":e,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class c{constructor(){a(this,"events",[])}attachEvent(e,s,n){if(e){let h=this.events.find(i=>i.el===e);h?(h.handlers.push(n),h.events.push(s)):this.events.push({el:e,handlers:[n],events:[s]}),e.addEventListener(s,n)}}detachEvents(){this.events.forEach(e=>{e.handlers.forEach((s,n)=>{var h;(h=e.el)==null||h.removeEventListener(e.events[n],s)})}),this.events=[]}}exports.AttachesEvents=c;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ElementEvents {
|
|
2
|
+
el: HTMLElement | Window | null;
|
|
3
|
+
handlers: EventListener[];
|
|
4
|
+
events: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare abstract class AttachesEvents {
|
|
7
|
+
events: ElementEvents[];
|
|
8
|
+
attachEvent(element: HTMLElement | Window | null | undefined, event: string, handler: EventListener): void;
|
|
9
|
+
detachEvents(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var E = (t, s, e) => s in t ? i(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
|
|
3
|
+
var v = (t, s, e) => E(t, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
class c {
|
|
5
|
+
constructor() {
|
|
6
|
+
v(this, "events", []);
|
|
7
|
+
}
|
|
8
|
+
attachEvent(s, e, n) {
|
|
9
|
+
if (s) {
|
|
10
|
+
let h = this.events.find((a) => a.el === s);
|
|
11
|
+
h ? (h.handlers.push(n), h.events.push(e)) : this.events.push({
|
|
12
|
+
el: s,
|
|
13
|
+
handlers: [n],
|
|
14
|
+
events: [e]
|
|
15
|
+
}), s.addEventListener(e, n);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
detachEvents() {
|
|
19
|
+
this.events.forEach((s) => {
|
|
20
|
+
s.handlers.forEach((e, n) => {
|
|
21
|
+
var h;
|
|
22
|
+
(h = s.el) == null || h.removeEventListener(s.events[n], e);
|
|
23
|
+
});
|
|
24
|
+
}), this.events = [];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
c as AttachesEvents
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./attaches-events.cjs.js");exports.AttachesEvents=t.AttachesEvents;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './attaches-events';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../util/math.cjs.js"),i=1,r=4;function e(t){return u.clamp(t,i,r)}exports.gridNum=e;exports.gridNumMax=r;exports.gridNumMin=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../util/math.cjs.js"),e=1,r=6;function a(t){return u.clamp(t,e,r)}exports.headerNum=a;exports.headerNumMax=r;exports.headerNumMin=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./grid.cjs.js"),r=require("./header.cjs.js");exports.gridNum=e.gridNum;exports.gridNumMax=e.gridNumMax;exports.gridNumMin=e.gridNumMin;exports.headerNum=r.headerNum;exports.headerNumMax=r.headerNumMax;exports.headerNumMin=r.headerNumMin;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { gridNum as m, gridNumMax as d, gridNumMin as u } from "./grid.es.js";
|
|
2
|
+
import { headerNum as a, headerNumMax as i, headerNumMin as o } from "./header.es.js";
|
|
3
|
+
export {
|
|
4
|
+
m as gridNum,
|
|
5
|
+
d as gridNumMax,
|
|
6
|
+
u as gridNumMin,
|
|
7
|
+
a as headerNum,
|
|
8
|
+
i as headerNumMax,
|
|
9
|
+
o as headerNumMin
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./abstract/attaches-events.cjs.js"),e=require("./components/grid.cjs.js"),t=require("./components/header.cjs.js"),a=require("./types/box.cjs.js"),n=require("./util/async.cjs.js"),r=require("./util/math.cjs.js");exports.AttachesEvents=i.AttachesEvents;exports.gridNum=e.gridNum;exports.gridNumMax=e.gridNumMax;exports.gridNumMin=e.gridNumMin;exports.headerNum=t.headerNum;exports.headerNumMax=t.headerNumMax;exports.headerNumMin=t.headerNumMin;exports.boxPositions=a.boxPositions;exports.wait=n.wait;exports.clamp=r.clamp;exports.randomInt=r.randomInt;
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AttachesEvents as e } from "./abstract/attaches-events.es.js";
|
|
2
|
+
import { gridNum as t, gridNumMax as a, gridNumMin as x } from "./components/grid.es.js";
|
|
3
|
+
import { headerNum as d, headerNumMax as p, headerNumMin as f } from "./components/header.es.js";
|
|
4
|
+
import { boxPositions as u } from "./types/box.es.js";
|
|
5
|
+
import { wait as h } from "./util/async.es.js";
|
|
6
|
+
import { clamp as M, randomInt as g } from "./util/math.es.js";
|
|
7
|
+
export {
|
|
8
|
+
e as AttachesEvents,
|
|
9
|
+
u as boxPositions,
|
|
10
|
+
M as clamp,
|
|
11
|
+
t as gridNum,
|
|
12
|
+
a as gridNumMax,
|
|
13
|
+
x as gridNumMin,
|
|
14
|
+
d as headerNum,
|
|
15
|
+
p as headerNumMax,
|
|
16
|
+
f as headerNumMin,
|
|
17
|
+
g as randomInt,
|
|
18
|
+
h as wait
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=["top","right","bottom","left"];exports.boxPositions=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./box.cjs.js");exports.boxPositions=o.boxPositions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './box';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(e){return new Promise(t=>setTimeout(t,e))}exports.wait=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function wait(ms: number): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./async.cjs.js"),t=require("./math.cjs.js");exports.wait=e.wait;exports.clamp=t.clamp;exports.randomInt=t.randomInt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(o,t,r){return Math.max(t,Math.min(o??t,r))}function e(o,t=0){return t=Math.ceil(t),o=Math.floor(o),Math.floor(Math.random()*(o-t)+t)}exports.clamp=a;exports.randomInt=e;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return a number between min and max
|
|
3
|
+
* @param num - the number to clamp
|
|
4
|
+
* @param min - the minimum value
|
|
5
|
+
* @param max - the maximum value
|
|
6
|
+
* @returns a number between min and max
|
|
7
|
+
*/
|
|
8
|
+
export declare function clamp(num: number | null | undefined, min: number, max: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Get a random integer between min and max
|
|
11
|
+
* @param max Maximum value to return
|
|
12
|
+
* @param min Minimum value to return (default is 0)
|
|
13
|
+
* @returns a random integer between min and max
|
|
14
|
+
*/
|
|
15
|
+
export declare function randomInt(max: number, min?: number): number;
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@appartmint/tsm-mint",
|
|
3
|
+
"author": "App Art Mint LLC",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"description": "TypeScript Modules from App Art Mint LLC",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"typescript",
|
|
9
|
+
"modules",
|
|
10
|
+
"app art mint",
|
|
11
|
+
"appartmint"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/App-Art-Mint/tsm-mint#readme",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/App-Art-Mint/tsm-mint.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/App-Art-Mint/tsm-mint/issues"
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"module": "dist/index.es.js",
|
|
23
|
+
"main": "dist/index.cjs.js",
|
|
24
|
+
"types": "dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.es.js",
|
|
29
|
+
"require": "./dist/index.cjs.js",
|
|
30
|
+
"default": "./dist/index.es.js"
|
|
31
|
+
},
|
|
32
|
+
"./*": {
|
|
33
|
+
"types": "./dist/*.d.ts",
|
|
34
|
+
"import": "./dist/*.es.js",
|
|
35
|
+
"require": "./dist/*.cjs.js",
|
|
36
|
+
"default": "./dist/*.es.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist/**/*.{js,d.ts}"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"version": "npm i && git add -A",
|
|
47
|
+
"postversion": "git push && git push --tags && cross-replace gh release create \"v$npm_package_version\" --generate-notes",
|
|
48
|
+
"prepare": "run-s build",
|
|
49
|
+
"build": "run-p test:types build:prod --",
|
|
50
|
+
"build:prod": "vite build",
|
|
51
|
+
"clean": "rimraf dist",
|
|
52
|
+
"test:types": "tsc -b",
|
|
53
|
+
"test:circular": "madge --circular --extensions ts .",
|
|
54
|
+
"lint": "eslint --fix ."
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/node": "^24.9.2",
|
|
58
|
+
"cross-replace": "^0.2.0",
|
|
59
|
+
"eslint": "^9.39.0",
|
|
60
|
+
"glob": "^11.0.3",
|
|
61
|
+
"madge": "^8.0.0",
|
|
62
|
+
"npm-run-all2": "^8.0.4",
|
|
63
|
+
"rimraf": "^6.1.0",
|
|
64
|
+
"typescript": "^5.9.3",
|
|
65
|
+
"typescript-eslint": "^8.46.2",
|
|
66
|
+
"vite": "^6.4.1",
|
|
67
|
+
"vite-plugin-dts": "^4.5.4"
|
|
68
|
+
}
|
|
69
|
+
}
|