typograf 7.4.4 → 7.6.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.
@@ -3,7 +3,7 @@
3
3
 
4
4
  Для включения необходимо подключить правила `ru/optalign/*`:
5
5
  ```js
6
- var Typograf = require('typograf'),
6
+ const Typograf = require('typograf'),
7
7
  tp = new Typograf({locale: ['ru', 'en-US']});
8
8
 
9
9
  tp.enableRule('ru/optalign/*');
package/docs/api_parts.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Отключение типографирования в участках текста
2
2
  ```js
3
- var tp = new Typograf({locale: ['ru', 'en-US']});
3
+ const tp = new Typograf({locale: ['ru', 'en-US']});
4
4
 
5
5
  // Отключить типографирование внутри тега <no-typography>
6
6
  tp.addSafeTag('<no-typography>', '</no-typography>');
package/docs/api_rules.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Включить или отключить правила
2
2
  ```js
3
- var tp = new Typograf({locale: ['ru', 'en-US']});
3
+ const tp = new Typograf({locale: ['ru', 'en-US']});
4
4
  tp.enableRule('ru/money/ruble'); // Включить правило
5
5
  tp.enableRule('ru/money/*'); // Включить все правила в группе
6
6
  tp.enableRule('*'); // Включить все правила
@@ -12,7 +12,7 @@ tp.disableRule('*'); // Отключить все правила
12
12
 
13
13
  ## Изменить настройку у правила
14
14
  ```js
15
- var tp = new Typograf({locale: ['ru', 'en-US']});
15
+ const tp = new Typograf({locale: ['ru', 'en-US']});
16
16
 
17
17
  // Название правила, название настройки, значение
18
18
 
package/docs/using.md CHANGED
@@ -11,7 +11,7 @@ npm install typograf
11
11
  ```HTML
12
12
  <script src="./node_modules/typograf/dist/typograf.min.js"></script>
13
13
  <script>
14
- var tp = new Typograf({locale: ['ru', 'en-US']});
14
+ const tp = new Typograf({locale: ['ru', 'en-US']});
15
15
  alert(tp.execute(' Мир - мой мир!! '));
16
16
  </script>
17
17
  ```
@@ -35,8 +35,8 @@ npm install typograf
35
35
  <script src="./node_modules/typograf/dist/typograf.min.js"></script>
36
36
  <script>
37
37
  (function() {
38
- var tp = new Typograf({locale: ['ru', 'en-US']});
39
- var elem = document.querySelector('input.my-text');
38
+ const tp = new Typograf({locale: ['ru', 'en-US']});
39
+ const elem = document.querySelector('input.my-text');
40
40
  document.querySelector('button.do').addEventListener('click', function() {
41
41
  elem.value = tp.execute(elem.value);
42
42
  }, false);
@@ -45,6 +45,15 @@ npm install typograf
45
45
  ```
46
46
 
47
47
  ## Node.js
48
+ ESM:
49
+ ```js
50
+ import Typograf from 'typograf';
51
+ const tp = new Typograf({locale: ['ru', 'en-US']});
52
+
53
+ console.log(tp.execute(' Мир - мой мир!! '));
54
+ ```
55
+
56
+ Common.js:
48
57
  ```js
49
58
  const Typograf = require('typograf');
50
59
  const tp = new Typograf({locale: ['ru', 'en-US']});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typograf",
3
3
  "description": "The client and server typography",
4
- "version": "7.4.4",
4
+ "version": "7.6.0",
5
5
  "author": {
6
6
  "name": "Denis Seleznev",
7
7
  "email": "hcodes@yandex.ru",
@@ -38,26 +38,26 @@
38
38
  "CHANGELOG.md"
39
39
  ],
40
40
  "devDependencies": {
41
- "@eslint/js": "^9.26.0",
41
+ "@eslint/js": "^9.37.0",
42
42
  "@rollup/plugin-typescript": "^11.1.6",
43
- "@types/jest": "^29.5.14",
44
- "@typescript-eslint/eslint-plugin": "^8.32.0",
45
- "@typescript-eslint/parser": "^8.32.0",
46
- "cpy-cli": "^5.0.0",
47
- "del-cli": "^6.0.0",
48
- "eslint": "^9.26.0",
49
- "globals": "^16.0.0",
50
- "jest": "^29.7.0",
51
- "postcss": "^8.5.3",
43
+ "@types/jest": "^30.0.0",
44
+ "@typescript-eslint/eslint-plugin": "^8.45.0",
45
+ "@typescript-eslint/parser": "^8.45.0",
46
+ "cpy-cli": "^6.0.0",
47
+ "del-cli": "^7.0.0",
48
+ "eslint": "^9.37.0",
49
+ "globals": "^16.4.0",
50
+ "jest": "^30.2.0",
51
+ "postcss": "^8.5.6",
52
52
  "postcss-cli": "^11.0.1",
53
- "postcss-import": "^16.1.0",
53
+ "postcss-import": "^16.1.1",
54
54
  "postcss-import-ext-glob": "^2.1.1",
55
- "rollup": "^4.40.2",
56
- "sort-keys": "^5.1.0",
57
- "ts-jest": "^29.3.2",
55
+ "rollup": "^4.52.4",
56
+ "sort-keys": "^6.0.0",
57
+ "ts-jest": "^29.4.4",
58
58
  "tslib": "^2.8.1",
59
- "typescript": "^5.8.3",
60
- "typescript-eslint": "^8.32.0",
59
+ "typescript": "^5.9.3",
60
+ "typescript-eslint": "^8.45.0",
61
61
  "uglify-js": "^3.19.3"
62
62
  },
63
63
  "scripts": {