polytypo 1.20.0 → 1.21.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.
Files changed (60) hide show
  1. package/dist/{chunk-OHVSJCJP.cjs → chunk-3L5KLKLP.cjs} +23 -23
  2. package/dist/{chunk-OHVSJCJP.cjs.map → chunk-3L5KLKLP.cjs.map} +1 -1
  3. package/dist/{chunk-77SI66RF.cjs → chunk-3WYVUARI.cjs} +6 -6
  4. package/dist/{chunk-77SI66RF.cjs.map → chunk-3WYVUARI.cjs.map} +1 -1
  5. package/dist/{chunk-E6YPYCBO.js → chunk-55LL24PJ.js} +3 -3
  6. package/dist/{chunk-2NY4ZQY2.cjs → chunk-5AEJFYWK.cjs} +3 -3
  7. package/dist/{chunk-2NY4ZQY2.cjs.map → chunk-5AEJFYWK.cjs.map} +1 -1
  8. package/dist/{chunk-BZKXSJJT.js → chunk-5AQIJOPD.js} +4 -4
  9. package/dist/{chunk-HUUDUGW3.cjs → chunk-75BQY5RY.cjs} +153 -98
  10. package/dist/chunk-75BQY5RY.cjs.map +1 -0
  11. package/dist/chunk-AUKI3EXL.cjs +38 -0
  12. package/dist/{chunk-CS2KLHYJ.cjs.map → chunk-AUKI3EXL.cjs.map} +1 -1
  13. package/dist/{chunk-M73SBGHP.cjs → chunk-DHKVVUYY.cjs} +4 -4
  14. package/dist/{chunk-M73SBGHP.cjs.map → chunk-DHKVVUYY.cjs.map} +1 -1
  15. package/dist/chunk-F2CNG4TF.cjs +36 -0
  16. package/dist/{chunk-TBQ7GKSG.cjs.map → chunk-F2CNG4TF.cjs.map} +1 -1
  17. package/dist/{chunk-AGRRKEIV.js → chunk-FEVHV3ED.js} +2 -2
  18. package/dist/{chunk-U53ZPYEE.js → chunk-FV4S3LDM.js} +2 -2
  19. package/dist/{chunk-YMQNFAQG.js → chunk-IBN7DIS5.js} +3 -3
  20. package/dist/{chunk-P3K3WNJD.js → chunk-KY6R54DA.js} +2 -2
  21. package/dist/{chunk-NPGGVNKR.js → chunk-NJXVMN4M.js} +2 -2
  22. package/dist/chunk-QIUGMSFQ.cjs +34 -0
  23. package/dist/{chunk-3PAZ6SRZ.cjs.map → chunk-QIUGMSFQ.cjs.map} +1 -1
  24. package/dist/{chunk-SSRGDNN2.js → chunk-QXUC42OO.js} +153 -98
  25. package/dist/chunk-QXUC42OO.js.map +1 -0
  26. package/dist/{errors-CQz5lyjD.d.ts → errors-CjpOoBlm.d.cts} +10 -4
  27. package/dist/{errors-CQz5lyjD.d.cts → errors-CjpOoBlm.d.ts} +10 -4
  28. package/dist/html.cjs +9 -9
  29. package/dist/html.d.cts +2 -2
  30. package/dist/html.d.ts +2 -2
  31. package/dist/html.js +4 -4
  32. package/dist/index.cjs +17 -17
  33. package/dist/index.d.cts +2 -2
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.js +7 -7
  36. package/dist/markdown.cjs +10 -10
  37. package/dist/markdown.d.cts +2 -2
  38. package/dist/markdown.d.ts +2 -2
  39. package/dist/markdown.js +5 -5
  40. package/dist/text.cjs +8 -8
  41. package/dist/text.d.cts +2 -2
  42. package/dist/text.d.ts +2 -2
  43. package/dist/text.js +3 -3
  44. package/dist/yaml.cjs +9 -9
  45. package/dist/yaml.d.cts +2 -2
  46. package/dist/yaml.d.ts +2 -2
  47. package/dist/yaml.js +4 -4
  48. package/package.json +1 -1
  49. package/dist/chunk-3PAZ6SRZ.cjs +0 -34
  50. package/dist/chunk-CS2KLHYJ.cjs +0 -38
  51. package/dist/chunk-HUUDUGW3.cjs.map +0 -1
  52. package/dist/chunk-SSRGDNN2.js.map +0 -1
  53. package/dist/chunk-TBQ7GKSG.cjs +0 -36
  54. /package/dist/{chunk-E6YPYCBO.js.map → chunk-55LL24PJ.js.map} +0 -0
  55. /package/dist/{chunk-BZKXSJJT.js.map → chunk-5AQIJOPD.js.map} +0 -0
  56. /package/dist/{chunk-AGRRKEIV.js.map → chunk-FEVHV3ED.js.map} +0 -0
  57. /package/dist/{chunk-U53ZPYEE.js.map → chunk-FV4S3LDM.js.map} +0 -0
  58. /package/dist/{chunk-YMQNFAQG.js.map → chunk-IBN7DIS5.js.map} +0 -0
  59. /package/dist/{chunk-P3K3WNJD.js.map → chunk-KY6R54DA.js.map} +0 -0
  60. /package/dist/{chunk-NPGGVNKR.js.map → chunk-NJXVMN4M.js.map} +0 -0
@@ -6,7 +6,7 @@ type Mode = "text" | "html" | "markdown" | "yaml";
6
6
  * invalid MDX, and a heuristic would then silently reclassify an ESM statement as prose.
7
7
  */
8
8
  type Dialect = "commonmark" | "mdx";
9
- type RuleId = "spaces" | "ellipsis" | "dashes" | "ranges" | "hyphen" | "quotes" | "apostrophe" | "symbols" | "nbsp";
9
+ type RuleId = "spaces" | "ellipsis" | "dashes" | "ranges" | "hyphen" | "quotes" | "quote-punctuation" | "apostrophe" | "symbols" | "nbsp";
10
10
  interface Options {
11
11
  /** Required. An unknown locale throws; there is never a fallback to English. */
12
12
  locale: string;
@@ -29,8 +29,8 @@ interface Options {
29
29
  */
30
30
  frontmatterKeys?: readonly string[];
31
31
  /**
32
- * Per-rule override, keyed by `RuleId`. For a default-on rule (every rule except `ranges`),
33
- * `false` disables it and `true` is a no-op. For `ranges` — off by default (spec 0.5.0) —
32
+ * Per-rule override, keyed by `RuleId`. For a default-on rule (every rule except `ranges` and `quote-punctuation`),
33
+ * `false` disables it and `true` is a no-op. For `ranges` (spec 0.5.0) and `quote-punctuation` (spec 1.21.0) — off by default —
34
34
  * `true` explicitly opts in and `false` (or omitting the key) leaves it disabled. Absence of a
35
35
  * key always means "use that rule's own default", never "off".
36
36
  */
@@ -108,6 +108,12 @@ interface LocaleData {
108
108
  * closed set of attaching fragments is classified exactly as spec 1.3.1 classified it.
109
109
  */
110
110
  readonly elisionClitics: ElisionClitics;
111
+ /**
112
+ * `quotes.punctuationPlacement` — spec/rules/quote-punctuation.md §2 (spec 1.21.0). `"inside"`:
113
+ * the locale's cited convention puts a comma or full stop before the closing primary mark.
114
+ * `"none"`: the `quote-punctuation` rule does nothing for this locale.
115
+ */
116
+ readonly punctuationPlacement: "inside" | "none";
111
117
  };
112
118
  readonly dash: {
113
119
  readonly parenthetical: "em-tight" | "em-spaced" | "em-paired" | "en-tight" | "en-spaced" | "none";
@@ -145,7 +151,7 @@ interface LocaleData {
145
151
  interface LocaleSource {
146
152
  /** Rule ids from spec/rules/order.json — note the rule is `dashes`/`ranges` while the field
147
153
  * both read is `dash`. */
148
- readonly rule: "quotes" | "dashes" | "ranges" | "ellipsis" | "hyphen" | "nbsp" | "spaces" | "apostrophe" | "symbols";
154
+ readonly rule: "quotes" | "quote-punctuation" | "dashes" | "ranges" | "ellipsis" | "hyphen" | "nbsp" | "spaces" | "apostrophe" | "symbols";
149
155
  readonly cite: string;
150
156
  readonly url?: string;
151
157
  readonly note?: string;
@@ -6,7 +6,7 @@ type Mode = "text" | "html" | "markdown" | "yaml";
6
6
  * invalid MDX, and a heuristic would then silently reclassify an ESM statement as prose.
7
7
  */
8
8
  type Dialect = "commonmark" | "mdx";
9
- type RuleId = "spaces" | "ellipsis" | "dashes" | "ranges" | "hyphen" | "quotes" | "apostrophe" | "symbols" | "nbsp";
9
+ type RuleId = "spaces" | "ellipsis" | "dashes" | "ranges" | "hyphen" | "quotes" | "quote-punctuation" | "apostrophe" | "symbols" | "nbsp";
10
10
  interface Options {
11
11
  /** Required. An unknown locale throws; there is never a fallback to English. */
12
12
  locale: string;
@@ -29,8 +29,8 @@ interface Options {
29
29
  */
30
30
  frontmatterKeys?: readonly string[];
31
31
  /**
32
- * Per-rule override, keyed by `RuleId`. For a default-on rule (every rule except `ranges`),
33
- * `false` disables it and `true` is a no-op. For `ranges` — off by default (spec 0.5.0) —
32
+ * Per-rule override, keyed by `RuleId`. For a default-on rule (every rule except `ranges` and `quote-punctuation`),
33
+ * `false` disables it and `true` is a no-op. For `ranges` (spec 0.5.0) and `quote-punctuation` (spec 1.21.0) — off by default —
34
34
  * `true` explicitly opts in and `false` (or omitting the key) leaves it disabled. Absence of a
35
35
  * key always means "use that rule's own default", never "off".
36
36
  */
@@ -108,6 +108,12 @@ interface LocaleData {
108
108
  * closed set of attaching fragments is classified exactly as spec 1.3.1 classified it.
109
109
  */
110
110
  readonly elisionClitics: ElisionClitics;
111
+ /**
112
+ * `quotes.punctuationPlacement` — spec/rules/quote-punctuation.md §2 (spec 1.21.0). `"inside"`:
113
+ * the locale's cited convention puts a comma or full stop before the closing primary mark.
114
+ * `"none"`: the `quote-punctuation` rule does nothing for this locale.
115
+ */
116
+ readonly punctuationPlacement: "inside" | "none";
111
117
  };
112
118
  readonly dash: {
113
119
  readonly parenthetical: "em-tight" | "em-spaced" | "em-paired" | "en-tight" | "en-spaced" | "none";
@@ -145,7 +151,7 @@ interface LocaleData {
145
151
  interface LocaleSource {
146
152
  /** Rule ids from spec/rules/order.json — note the rule is `dashes`/`ranges` while the field
147
153
  * both read is `dash`. */
148
- readonly rule: "quotes" | "dashes" | "ranges" | "ellipsis" | "hyphen" | "nbsp" | "spaces" | "apostrophe" | "symbols";
154
+ readonly rule: "quotes" | "quote-punctuation" | "dashes" | "ranges" | "ellipsis" | "hyphen" | "nbsp" | "spaces" | "apostrophe" | "symbols";
149
155
  readonly cite: string;
150
156
  readonly url?: string;
151
157
  readonly note?: string;
package/dist/html.cjs CHANGED
@@ -1,29 +1,29 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunk3PAZ6SRZcjs = require('./chunk-3PAZ6SRZ.cjs');
5
- require('./chunk-M73SBGHP.cjs');
4
+ var _chunkQIUGMSFQcjs = require('./chunk-QIUGMSFQ.cjs');
5
+ require('./chunk-DHKVVUYY.cjs');
6
6
 
7
7
 
8
- var _chunk2NY4ZQY2cjs = require('./chunk-2NY4ZQY2.cjs');
8
+ var _chunk5AEJFYWKcjs = require('./chunk-5AEJFYWK.cjs');
9
9
 
10
10
 
11
- var _chunkHUUDUGW3cjs = require('./chunk-HUUDUGW3.cjs');
11
+ var _chunk75BQY5RYcjs = require('./chunk-75BQY5RY.cjs');
12
12
 
13
13
  // src/index.html.ts
14
14
  function transform(input, options) {
15
15
  const given = _nullishCoalesce(options, () => ( {}));
16
- _chunk2NY4ZQY2cjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
17
- return _chunk3PAZ6SRZcjs.runHtmlPipeline.call(void 0, input, given);
16
+ _chunk5AEJFYWKcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
17
+ return _chunkQIUGMSFQcjs.runHtmlPipeline.call(void 0, input, given);
18
18
  }
19
19
  function analyze(input, options) {
20
20
  const given = _nullishCoalesce(options, () => ( {}));
21
- _chunk2NY4ZQY2cjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
22
- return _chunk3PAZ6SRZcjs.analyzeHtmlPipeline.call(void 0, input, given);
21
+ _chunk5AEJFYWKcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
22
+ return _chunkQIUGMSFQcjs.analyzeHtmlPipeline.call(void 0, input, given);
23
23
  }
24
24
 
25
25
 
26
26
 
27
27
 
28
- exports.PolytypoError = _chunkHUUDUGW3cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
28
+ exports.PolytypoError = _chunk75BQY5RYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
29
29
  //# sourceMappingURL=html.cjs.map
package/dist/html.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options, C as Change } from './errors-CQz5lyjD.cjs';
2
- export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.cjs';
1
+ import { O as Options, C as Change } from './errors-CjpOoBlm.cjs';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.cjs';
3
3
 
4
4
  /**
5
5
  * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the
package/dist/html.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options, C as Change } from './errors-CQz5lyjD.js';
2
- export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.js';
1
+ import { O as Options, C as Change } from './errors-CjpOoBlm.js';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.js';
3
3
 
4
4
  /**
5
5
  * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the
package/dist/html.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  analyzeHtmlPipeline,
3
3
  runHtmlPipeline
4
- } from "./chunk-E6YPYCBO.js";
5
- import "./chunk-P3K3WNJD.js";
4
+ } from "./chunk-55LL24PJ.js";
5
+ import "./chunk-KY6R54DA.js";
6
6
  import {
7
7
  assertFixedMode
8
- } from "./chunk-NPGGVNKR.js";
8
+ } from "./chunk-NJXVMN4M.js";
9
9
  import {
10
10
  PolytypoError
11
- } from "./chunk-SSRGDNN2.js";
11
+ } from "./chunk-QXUC42OO.js";
12
12
 
13
13
  // src/index.html.ts
14
14
  function transform(input, options) {
package/dist/index.cjs CHANGED
@@ -1,30 +1,30 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkCS2KLHYJcjs = require('./chunk-CS2KLHYJ.cjs');
4
+ var _chunkAUKI3EXLcjs = require('./chunk-AUKI3EXL.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunk3PAZ6SRZcjs = require('./chunk-3PAZ6SRZ.cjs');
8
+ var _chunkQIUGMSFQcjs = require('./chunk-QIUGMSFQ.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkOHVSJCJPcjs = require('./chunk-OHVSJCJP.cjs');
13
- require('./chunk-M73SBGHP.cjs');
12
+ var _chunk3L5KLKLPcjs = require('./chunk-3L5KLKLP.cjs');
13
+ require('./chunk-DHKVVUYY.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunkTBQ7GKSGcjs = require('./chunk-TBQ7GKSG.cjs');
18
- require('./chunk-77SI66RF.cjs');
17
+ var _chunkF2CNG4TFcjs = require('./chunk-F2CNG4TF.cjs');
18
+ require('./chunk-3WYVUARI.cjs');
19
19
 
20
20
 
21
- var _chunkHUUDUGW3cjs = require('./chunk-HUUDUGW3.cjs');
21
+ var _chunk75BQY5RYcjs = require('./chunk-75BQY5RY.cjs');
22
22
 
23
23
  // src/engine/pipeline.ts
24
24
  function resolveMode(mode) {
25
25
  if (mode === void 0 || mode === "text") return "text";
26
26
  if (mode === "html" || mode === "markdown" || mode === "yaml") return mode;
27
- throw new (0, _chunkHUUDUGW3cjs.PolytypoError)(
27
+ throw new (0, _chunk75BQY5RYcjs.PolytypoError)(
28
28
  "POLYTYPO_INVALID_MODE",
29
29
  `Unknown mode "${String(mode)}". Expected "text", "html", "markdown" or "yaml".`
30
30
  );
@@ -32,18 +32,18 @@ function resolveMode(mode) {
32
32
  function runPipeline(input, options) {
33
33
  const given = _nullishCoalesce(options, () => ( {}));
34
34
  const mode = resolveMode(given.mode);
35
- if (mode === "text") return _chunkCS2KLHYJcjs.runTextPipeline.call(void 0, input, given);
36
- if (mode === "html") return _chunk3PAZ6SRZcjs.runHtmlPipeline.call(void 0, input, given);
37
- if (mode === "yaml") return _chunkTBQ7GKSGcjs.runYamlPipeline.call(void 0, input, given);
38
- return _chunkOHVSJCJPcjs.runMarkdownPipeline.call(void 0, input, given);
35
+ if (mode === "text") return _chunkAUKI3EXLcjs.runTextPipeline.call(void 0, input, given);
36
+ if (mode === "html") return _chunkQIUGMSFQcjs.runHtmlPipeline.call(void 0, input, given);
37
+ if (mode === "yaml") return _chunkF2CNG4TFcjs.runYamlPipeline.call(void 0, input, given);
38
+ return _chunk3L5KLKLPcjs.runMarkdownPipeline.call(void 0, input, given);
39
39
  }
40
40
  function runAnalyze(input, options) {
41
41
  const given = _nullishCoalesce(options, () => ( {}));
42
42
  const mode = resolveMode(given.mode);
43
- if (mode === "text") return _chunkCS2KLHYJcjs.analyzeTextPipeline.call(void 0, input, given);
44
- if (mode === "html") return _chunk3PAZ6SRZcjs.analyzeHtmlPipeline.call(void 0, input, given);
45
- if (mode === "yaml") return _chunkTBQ7GKSGcjs.analyzeYamlPipeline.call(void 0, input, given);
46
- return _chunkOHVSJCJPcjs.analyzeMarkdownPipeline.call(void 0, input, given);
43
+ if (mode === "text") return _chunkAUKI3EXLcjs.analyzeTextPipeline.call(void 0, input, given);
44
+ if (mode === "html") return _chunkQIUGMSFQcjs.analyzeHtmlPipeline.call(void 0, input, given);
45
+ if (mode === "yaml") return _chunkF2CNG4TFcjs.analyzeYamlPipeline.call(void 0, input, given);
46
+ return _chunk3L5KLKLPcjs.analyzeMarkdownPipeline.call(void 0, input, given);
47
47
  }
48
48
 
49
49
  // src/index.ts
@@ -57,5 +57,5 @@ function analyze(input, options) {
57
57
 
58
58
 
59
59
 
60
- exports.PolytypoError = _chunkHUUDUGW3cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
60
+ exports.PolytypoError = _chunk75BQY5RYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
61
61
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options, C as Change } from './errors-CQz5lyjD.cjs';
2
- export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.cjs';
1
+ import { O as Options, C as Change } from './errors-CjpOoBlm.cjs';
2
+ export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.cjs';
3
3
 
4
4
  declare function transform(input: string, options: Options): string;
5
5
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options, C as Change } from './errors-CQz5lyjD.js';
2
- export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.js';
1
+ import { O as Options, C as Change } from './errors-CjpOoBlm.js';
2
+ export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.js';
3
3
 
4
4
  declare function transform(input: string, options: Options): string;
5
5
  /**
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  analyzeTextPipeline,
3
3
  runTextPipeline
4
- } from "./chunk-AGRRKEIV.js";
4
+ } from "./chunk-FEVHV3ED.js";
5
5
  import {
6
6
  analyzeHtmlPipeline,
7
7
  runHtmlPipeline
8
- } from "./chunk-E6YPYCBO.js";
8
+ } from "./chunk-55LL24PJ.js";
9
9
  import {
10
10
  analyzeMarkdownPipeline,
11
11
  runMarkdownPipeline
12
- } from "./chunk-BZKXSJJT.js";
13
- import "./chunk-P3K3WNJD.js";
12
+ } from "./chunk-5AQIJOPD.js";
13
+ import "./chunk-KY6R54DA.js";
14
14
  import {
15
15
  analyzeYamlPipeline,
16
16
  runYamlPipeline
17
- } from "./chunk-YMQNFAQG.js";
18
- import "./chunk-U53ZPYEE.js";
17
+ } from "./chunk-IBN7DIS5.js";
18
+ import "./chunk-FV4S3LDM.js";
19
19
  import {
20
20
  PolytypoError
21
- } from "./chunk-SSRGDNN2.js";
21
+ } from "./chunk-QXUC42OO.js";
22
22
 
23
23
  // src/engine/pipeline.ts
24
24
  function resolveMode(mode) {
package/dist/markdown.cjs CHANGED
@@ -1,30 +1,30 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkOHVSJCJPcjs = require('./chunk-OHVSJCJP.cjs');
5
- require('./chunk-M73SBGHP.cjs');
6
- require('./chunk-77SI66RF.cjs');
4
+ var _chunk3L5KLKLPcjs = require('./chunk-3L5KLKLP.cjs');
5
+ require('./chunk-DHKVVUYY.cjs');
6
+ require('./chunk-3WYVUARI.cjs');
7
7
 
8
8
 
9
- var _chunk2NY4ZQY2cjs = require('./chunk-2NY4ZQY2.cjs');
9
+ var _chunk5AEJFYWKcjs = require('./chunk-5AEJFYWK.cjs');
10
10
 
11
11
 
12
- var _chunkHUUDUGW3cjs = require('./chunk-HUUDUGW3.cjs');
12
+ var _chunk75BQY5RYcjs = require('./chunk-75BQY5RY.cjs');
13
13
 
14
14
  // src/index.markdown.ts
15
15
  function transform(input, options) {
16
16
  const given = _nullishCoalesce(options, () => ( {}));
17
- _chunk2NY4ZQY2cjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
18
- return _chunkOHVSJCJPcjs.runMarkdownPipeline.call(void 0, input, given);
17
+ _chunk5AEJFYWKcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
18
+ return _chunk3L5KLKLPcjs.runMarkdownPipeline.call(void 0, input, given);
19
19
  }
20
20
  function analyze(input, options) {
21
21
  const given = _nullishCoalesce(options, () => ( {}));
22
- _chunk2NY4ZQY2cjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
23
- return _chunkOHVSJCJPcjs.analyzeMarkdownPipeline.call(void 0, input, given);
22
+ _chunk5AEJFYWKcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
23
+ return _chunk3L5KLKLPcjs.analyzeMarkdownPipeline.call(void 0, input, given);
24
24
  }
25
25
 
26
26
 
27
27
 
28
28
 
29
- exports.PolytypoError = _chunkHUUDUGW3cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
29
+ exports.PolytypoError = _chunk75BQY5RYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
30
30
  //# sourceMappingURL=markdown.cjs.map
@@ -1,5 +1,5 @@
1
- import { O as Options, D as Dialect, C as Change } from './errors-CQz5lyjD.cjs';
2
- export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.cjs';
1
+ import { O as Options, D as Dialect, C as Change } from './errors-CjpOoBlm.cjs';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.cjs';
3
3
 
4
4
  /**
5
5
  * `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX
@@ -1,5 +1,5 @@
1
- import { O as Options, D as Dialect, C as Change } from './errors-CQz5lyjD.js';
2
- export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.js';
1
+ import { O as Options, D as Dialect, C as Change } from './errors-CjpOoBlm.js';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.js';
3
3
 
4
4
  /**
5
5
  * `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX
package/dist/markdown.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  analyzeMarkdownPipeline,
3
3
  runMarkdownPipeline
4
- } from "./chunk-BZKXSJJT.js";
5
- import "./chunk-P3K3WNJD.js";
6
- import "./chunk-U53ZPYEE.js";
4
+ } from "./chunk-5AQIJOPD.js";
5
+ import "./chunk-KY6R54DA.js";
6
+ import "./chunk-FV4S3LDM.js";
7
7
  import {
8
8
  assertFixedMode
9
- } from "./chunk-NPGGVNKR.js";
9
+ } from "./chunk-NJXVMN4M.js";
10
10
  import {
11
11
  PolytypoError
12
- } from "./chunk-SSRGDNN2.js";
12
+ } from "./chunk-QXUC42OO.js";
13
13
 
14
14
  // src/index.markdown.ts
15
15
  function transform(input, options) {
package/dist/text.cjs CHANGED
@@ -1,28 +1,28 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkCS2KLHYJcjs = require('./chunk-CS2KLHYJ.cjs');
4
+ var _chunkAUKI3EXLcjs = require('./chunk-AUKI3EXL.cjs');
5
5
 
6
6
 
7
- var _chunk2NY4ZQY2cjs = require('./chunk-2NY4ZQY2.cjs');
7
+ var _chunk5AEJFYWKcjs = require('./chunk-5AEJFYWK.cjs');
8
8
 
9
9
 
10
- var _chunkHUUDUGW3cjs = require('./chunk-HUUDUGW3.cjs');
10
+ var _chunk75BQY5RYcjs = require('./chunk-75BQY5RY.cjs');
11
11
 
12
12
  // src/index.text.ts
13
13
  function transform(input, options) {
14
14
  const given = _nullishCoalesce(options, () => ( {}));
15
- _chunk2NY4ZQY2cjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
16
- return _chunkCS2KLHYJcjs.runTextPipeline.call(void 0, input, given);
15
+ _chunk5AEJFYWKcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
16
+ return _chunkAUKI3EXLcjs.runTextPipeline.call(void 0, input, given);
17
17
  }
18
18
  function analyze(input, options) {
19
19
  const given = _nullishCoalesce(options, () => ( {}));
20
- _chunk2NY4ZQY2cjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
21
- return _chunkCS2KLHYJcjs.analyzeTextPipeline.call(void 0, input, given);
20
+ _chunk5AEJFYWKcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
21
+ return _chunkAUKI3EXLcjs.analyzeTextPipeline.call(void 0, input, given);
22
22
  }
23
23
 
24
24
 
25
25
 
26
26
 
27
- exports.PolytypoError = _chunkHUUDUGW3cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
27
+ exports.PolytypoError = _chunk75BQY5RYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
28
28
  //# sourceMappingURL=text.cjs.map
package/dist/text.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options, C as Change } from './errors-CQz5lyjD.cjs';
2
- export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.cjs';
1
+ import { O as Options, C as Change } from './errors-CjpOoBlm.cjs';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.cjs';
3
3
 
4
4
  /**
5
5
  * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the
package/dist/text.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options, C as Change } from './errors-CQz5lyjD.js';
2
- export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.js';
1
+ import { O as Options, C as Change } from './errors-CjpOoBlm.js';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.js';
3
3
 
4
4
  /**
5
5
  * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the
package/dist/text.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  analyzeTextPipeline,
3
3
  runTextPipeline
4
- } from "./chunk-AGRRKEIV.js";
4
+ } from "./chunk-FEVHV3ED.js";
5
5
  import {
6
6
  assertFixedMode
7
- } from "./chunk-NPGGVNKR.js";
7
+ } from "./chunk-NJXVMN4M.js";
8
8
  import {
9
9
  PolytypoError
10
- } from "./chunk-SSRGDNN2.js";
10
+ } from "./chunk-QXUC42OO.js";
11
11
 
12
12
  // src/index.text.ts
13
13
  function transform(input, options) {
package/dist/yaml.cjs CHANGED
@@ -1,29 +1,29 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkTBQ7GKSGcjs = require('./chunk-TBQ7GKSG.cjs');
5
- require('./chunk-77SI66RF.cjs');
4
+ var _chunkF2CNG4TFcjs = require('./chunk-F2CNG4TF.cjs');
5
+ require('./chunk-3WYVUARI.cjs');
6
6
 
7
7
 
8
- var _chunk2NY4ZQY2cjs = require('./chunk-2NY4ZQY2.cjs');
8
+ var _chunk5AEJFYWKcjs = require('./chunk-5AEJFYWK.cjs');
9
9
 
10
10
 
11
- var _chunkHUUDUGW3cjs = require('./chunk-HUUDUGW3.cjs');
11
+ var _chunk75BQY5RYcjs = require('./chunk-75BQY5RY.cjs');
12
12
 
13
13
  // src/index.yaml.ts
14
14
  function transform(input, options) {
15
15
  const given = _nullishCoalesce(options, () => ( {}));
16
- _chunk2NY4ZQY2cjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
17
- return _chunkTBQ7GKSGcjs.runYamlPipeline.call(void 0, input, given);
16
+ _chunk5AEJFYWKcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
17
+ return _chunkF2CNG4TFcjs.runYamlPipeline.call(void 0, input, given);
18
18
  }
19
19
  function analyze(input, options) {
20
20
  const given = _nullishCoalesce(options, () => ( {}));
21
- _chunk2NY4ZQY2cjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
22
- return _chunkTBQ7GKSGcjs.analyzeYamlPipeline.call(void 0, input, given);
21
+ _chunk5AEJFYWKcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
22
+ return _chunkF2CNG4TFcjs.analyzeYamlPipeline.call(void 0, input, given);
23
23
  }
24
24
 
25
25
 
26
26
 
27
27
 
28
- exports.PolytypoError = _chunkHUUDUGW3cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
28
+ exports.PolytypoError = _chunk75BQY5RYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
29
29
  //# sourceMappingURL=yaml.cjs.map
package/dist/yaml.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options, C as Change } from './errors-CQz5lyjD.cjs';
2
- export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.cjs';
1
+ import { O as Options, C as Change } from './errors-CjpOoBlm.cjs';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.cjs';
3
3
 
4
4
  /**
5
5
  * `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no
package/dist/yaml.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options, C as Change } from './errors-CQz5lyjD.js';
2
- export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CQz5lyjD.js';
1
+ import { O as Options, C as Change } from './errors-CjpOoBlm.js';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CjpOoBlm.js';
3
3
 
4
4
  /**
5
5
  * `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no
package/dist/yaml.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  analyzeYamlPipeline,
3
3
  runYamlPipeline
4
- } from "./chunk-YMQNFAQG.js";
5
- import "./chunk-U53ZPYEE.js";
4
+ } from "./chunk-IBN7DIS5.js";
5
+ import "./chunk-FV4S3LDM.js";
6
6
  import {
7
7
  assertFixedMode
8
- } from "./chunk-NPGGVNKR.js";
8
+ } from "./chunk-NJXVMN4M.js";
9
9
  import {
10
10
  PolytypoError
11
- } from "./chunk-SSRGDNN2.js";
11
+ } from "./chunk-QXUC42OO.js";
12
12
 
13
13
  // src/index.yaml.ts
14
14
  function transform(input, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polytypo",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Normalize typography across languages: locale-correct quotes, dashes, ellipses and no-break spaces.",
5
5
  "keywords": [
6
6
  "typography",
@@ -1,34 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkM73SBGHPcjs = require('./chunk-M73SBGHP.cjs');
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
- var _chunkHUUDUGW3cjs = require('./chunk-HUUDUGW3.cjs');
12
-
13
- // src/engine/html-pipeline.ts
14
- function runHtmlPipeline(input, options) {
15
- const narrowTarget = _chunkHUUDUGW3cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
16
- const planned = _chunkHUUDUGW3cjs.planRules.call(void 0, options.rules);
17
- const locale = _chunkHUUDUGW3cjs.getLocaleData.call(void 0, options.locale);
18
- _chunkHUUDUGW3cjs.assertNoProtect.call(void 0, options.protect, "html");
19
- const spans = _chunkM73SBGHPcjs.htmlSpans.call(void 0, input);
20
- return _chunkHUUDUGW3cjs.runOverSpans.call(void 0, input, spans, planned, locale, "html", narrowTarget);
21
- }
22
- function analyzeHtmlPipeline(input, options) {
23
- const narrowTarget = _chunkHUUDUGW3cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
24
- const planned = _chunkHUUDUGW3cjs.planRules.call(void 0, options.rules);
25
- const locale = _chunkHUUDUGW3cjs.getLocaleData.call(void 0, options.locale);
26
- _chunkHUUDUGW3cjs.assertNoProtect.call(void 0, options.protect, "html");
27
- return _chunkHUUDUGW3cjs.analyzeOverSpans.call(void 0, input, _chunkM73SBGHPcjs.htmlSpans.call(void 0, input), planned, locale, "html", narrowTarget);
28
- }
29
-
30
-
31
-
32
-
33
- exports.runHtmlPipeline = runHtmlPipeline; exports.analyzeHtmlPipeline = analyzeHtmlPipeline;
34
- //# sourceMappingURL=chunk-3PAZ6SRZ.cjs.map
@@ -1,38 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
- var _chunkHUUDUGW3cjs = require('./chunk-HUUDUGW3.cjs');
13
-
14
- // src/engine/text-pipeline.ts
15
- function runTextPipeline(input, options) {
16
- const narrowTarget = _chunkHUUDUGW3cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
17
- const planned = _chunkHUUDUGW3cjs.planRules.call(void 0, options.rules);
18
- const locale = _chunkHUUDUGW3cjs.getLocaleData.call(void 0, options.locale);
19
- const holes = _chunkHUUDUGW3cjs.resolveProtect.call(void 0, options.protect, _chunkHUUDUGW3cjs.toCodePoints.call(void 0, input).length);
20
- if (holes.length > 0) return _chunkHUUDUGW3cjs.runProtected.call(void 0, input, holes, planned, locale, narrowTarget);
21
- return _chunkHUUDUGW3cjs.fromCodePoints.call(void 0, _chunkHUUDUGW3cjs.runRules.call(void 0, _chunkHUUDUGW3cjs.toCodePoints.call(void 0, input), planned, locale, "text", narrowTarget));
22
- }
23
- function analyzeTextPipeline(input, options) {
24
- const narrowTarget = _chunkHUUDUGW3cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
25
- const planned = _chunkHUUDUGW3cjs.planRules.call(void 0, options.rules);
26
- const locale = _chunkHUUDUGW3cjs.getLocaleData.call(void 0, options.locale);
27
- const cp = _chunkHUUDUGW3cjs.toCodePoints.call(void 0, input);
28
- const holes = _chunkHUUDUGW3cjs.resolveProtect.call(void 0, options.protect, cp.length);
29
- if (holes.length > 0) return _chunkHUUDUGW3cjs.analyzeProtected.call(void 0, input, holes, planned, locale, narrowTarget);
30
- const origin = cp.map((_value, index) => index);
31
- return _chunkHUUDUGW3cjs.runRulesRecording.call(void 0, cp, planned, locale, "text", narrowTarget, origin, cp.length);
32
- }
33
-
34
-
35
-
36
-
37
- exports.runTextPipeline = runTextPipeline; exports.analyzeTextPipeline = analyzeTextPipeline;
38
- //# sourceMappingURL=chunk-CS2KLHYJ.cjs.map