@altano/textfit 1.0.1 → 1.0.2
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 +1 -1
- package/dist/index.d.ts +26 -26
- package/package.json +18 -13
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2014 Samuel Reed <samuel.trace.reed@gmail.com> (http://strml.net/)
|
|
4
|
-
Copyright (c) 2022 Alan Norbauer <
|
|
4
|
+
Copyright (c) 2022 Alan Norbauer <alan@norbauer.com> (https://alan.norbauer.com/)
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/index.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
//#region src/index.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* textFit v2.3.1
|
|
4
|
-
* Previously known as jQuery.textFit
|
|
5
|
-
* 11/2014 by STRML (strml.github.com)
|
|
6
|
-
* MIT License
|
|
7
|
-
*
|
|
8
|
-
* To use: textFit(document.getElementById('target-div'), options);
|
|
9
|
-
*
|
|
10
|
-
* Will make the *text* content inside a container scale to fit the container
|
|
11
|
-
* The container is required to have a set width and height
|
|
12
|
-
* Uses binary search to fit text with minimal layout calls.
|
|
13
|
-
* Version 2.0 does not use jQuery.
|
|
14
|
-
*/
|
|
3
|
+
* textFit v2.3.1
|
|
4
|
+
* Previously known as jQuery.textFit
|
|
5
|
+
* 11/2014 by STRML (strml.github.com)
|
|
6
|
+
* MIT License
|
|
7
|
+
*
|
|
8
|
+
* To use: textFit(document.getElementById('target-div'), options);
|
|
9
|
+
*
|
|
10
|
+
* Will make the *text* content inside a container scale to fit the container
|
|
11
|
+
* The container is required to have a set width and height
|
|
12
|
+
* Uses binary search to fit text with minimal layout calls.
|
|
13
|
+
* Version 2.0 does not use jQuery.
|
|
14
|
+
*/
|
|
15
15
|
interface Options {
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
* if true, textFit will not set white-space: no-wrap
|
|
18
|
+
*/
|
|
19
19
|
multiLine?: boolean;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
* disable to turn off automatic multi-line sensing
|
|
22
|
+
*/
|
|
23
23
|
detectMultiLine?: boolean;
|
|
24
24
|
minFontSize?: number;
|
|
25
25
|
maxFontSize?: number;
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
* if true, textFit will re-process already-fit nodes. Set to 'false' for
|
|
28
|
+
* better performance
|
|
29
|
+
*/
|
|
30
30
|
reProcess?: boolean;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
* if true, textFit will fit text to element width, regardless of text height
|
|
33
|
+
*/
|
|
34
34
|
widthOnly?: boolean;
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
* if true, textFit will use flexbox for vertical alignment
|
|
37
|
+
*/
|
|
38
38
|
alignVertWithFlexbox?: boolean;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
* Sets the final size to the max multiple of this. Useful when a font
|
|
41
|
+
* requires the font size to be a multiple of a number for optimal rendering.
|
|
42
|
+
*/
|
|
43
43
|
sizeMultipleOf?: number;
|
|
44
44
|
}
|
|
45
45
|
declare function textFit(elements: HTMLElement | HTMLElement[], options?: Options): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altano/textfit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fit",
|
|
@@ -14,9 +14,13 @@
|
|
|
14
14
|
"directory": "packages/textfit"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
|
-
"author": "Alan Norbauer <
|
|
17
|
+
"author": "Alan Norbauer <alan@norbauer.com> (https://alan.norbauer.com/)",
|
|
18
18
|
"contributors": [
|
|
19
|
-
|
|
19
|
+
{
|
|
20
|
+
"name": "Samuel Reed",
|
|
21
|
+
"email": "samuel.trace.reed@gmail.com",
|
|
22
|
+
"url": "http://strml.net"
|
|
23
|
+
}
|
|
20
24
|
],
|
|
21
25
|
"sideEffects": false,
|
|
22
26
|
"type": "module",
|
|
@@ -27,29 +31,30 @@
|
|
|
27
31
|
"dist/**/*.d.ts"
|
|
28
32
|
],
|
|
29
33
|
"devDependencies": {
|
|
30
|
-
"@arethetypeswrong/cli": "^0.18.
|
|
31
|
-
"@playwright/test": "1.
|
|
32
|
-
"@types/node": "^
|
|
34
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
35
|
+
"@playwright/test": "1.59.1",
|
|
36
|
+
"@types/node": "^26.1.1",
|
|
33
37
|
"depcheck": "^1.4.7",
|
|
34
|
-
"tsdown": "^0.
|
|
35
|
-
"typescript": "^
|
|
36
|
-
"vite": "^
|
|
37
|
-
"vitest": "^4.1.
|
|
38
|
+
"tsdown": "^0.22.13",
|
|
39
|
+
"typescript": "^6.0.3",
|
|
40
|
+
"vite": "^8.1.5",
|
|
41
|
+
"vitest": "^4.1.10",
|
|
38
42
|
"@altano/build-config": "0.0.1",
|
|
43
|
+
"@altano/testing": "0.0.1",
|
|
39
44
|
"@altano/tsconfig": "0.0.1"
|
|
40
45
|
},
|
|
41
46
|
"publishConfig": {
|
|
42
47
|
"access": "public"
|
|
43
48
|
},
|
|
44
49
|
"scripts": {
|
|
45
|
-
"build": "tsdown
|
|
50
|
+
"build": "tsdown",
|
|
46
51
|
"check:exports": "attw --pack . --profile esm-only --quiet",
|
|
47
52
|
"check:types:src": "tsc --noEmit",
|
|
48
53
|
"check:types:test": "tsc --noEmit --project ./tests/tsconfig.json",
|
|
49
54
|
"check:unused-dependencies": "depcheck",
|
|
50
55
|
"dev": "pnpm run build --watch",
|
|
51
|
-
"format": "prettier --check
|
|
52
|
-
"format:fix": "prettier --write
|
|
56
|
+
"format": "prettier --check .",
|
|
57
|
+
"format:fix": "prettier --write .",
|
|
53
58
|
"lint": "eslint",
|
|
54
59
|
"lint:fix": "TIMING=1 pnpm lint --fix",
|
|
55
60
|
"lint:timing": "TIMING=1 pnpm lint",
|