polytypo 1.27.0 → 1.28.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.
- package/dist/{chunk-Q2JM2YKN.js → chunk-6T6NVRNM.js} +2 -2
- package/dist/{chunk-CD5JFQPF.js → chunk-6UZQ5ZZJ.js} +4 -4
- package/dist/{chunk-COL67BR4.js → chunk-BFL7S4HC.js} +2 -2
- package/dist/chunk-BKW4AJZO.cjs +38 -0
- package/dist/{chunk-T33UE3VC.cjs.map → chunk-BKW4AJZO.cjs.map} +1 -1
- package/dist/{chunk-NPO6DMVX.js → chunk-D6PN6Q4M.js} +3 -1
- package/dist/{chunk-NPO6DMVX.js.map → chunk-D6PN6Q4M.js.map} +1 -1
- package/dist/{chunk-TZ2MR452.cjs → chunk-G3O5HW3V.cjs} +4 -4
- package/dist/{chunk-TZ2MR452.cjs.map → chunk-G3O5HW3V.cjs.map} +1 -1
- package/dist/{chunk-2S25DBZB.js → chunk-GM5SALQC.js} +2 -2
- package/dist/chunk-H7HEFRC2.cjs +34 -0
- package/dist/{chunk-PQ2JMNHN.cjs.map → chunk-H7HEFRC2.cjs.map} +1 -1
- package/dist/chunk-KCH6MUBU.cjs +36 -0
- package/dist/{chunk-EC6QGB56.cjs.map → chunk-KCH6MUBU.cjs.map} +1 -1
- package/dist/{chunk-MIG6JI6H.js → chunk-KZYQGRHP.js} +2 -2
- package/dist/{chunk-2BI5UADO.cjs → chunk-LO256TEM.cjs} +3 -3
- package/dist/{chunk-2BI5UADO.cjs.map → chunk-LO256TEM.cjs.map} +1 -1
- package/dist/{chunk-GI5QRYIB.js → chunk-MXAVM7XR.js} +3 -3
- package/dist/{chunk-XFYBTNXK.cjs → chunk-PPRYHZUP.cjs} +23 -23
- package/dist/{chunk-XFYBTNXK.cjs.map → chunk-PPRYHZUP.cjs.map} +1 -1
- package/dist/{chunk-JEZTDT2R.cjs → chunk-R237DJ7C.cjs} +6 -6
- package/dist/{chunk-JEZTDT2R.cjs.map → chunk-R237DJ7C.cjs.map} +1 -1
- package/dist/{chunk-URXHGKPP.cjs → chunk-W547XYZL.cjs} +3 -1
- package/dist/chunk-W547XYZL.cjs.map +1 -0
- package/dist/{chunk-7T2V7TC5.js → chunk-ZLPKCCD2.js} +3 -3
- package/dist/html.cjs +9 -9
- package/dist/html.js +4 -4
- package/dist/index.cjs +17 -17
- package/dist/index.js +7 -7
- package/dist/markdown.cjs +10 -10
- package/dist/markdown.js +5 -5
- package/dist/text.cjs +8 -8
- package/dist/text.js +3 -3
- package/dist/yaml.cjs +9 -9
- package/dist/yaml.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-EC6QGB56.cjs +0 -36
- package/dist/chunk-PQ2JMNHN.cjs +0 -34
- package/dist/chunk-T33UE3VC.cjs +0 -38
- package/dist/chunk-URXHGKPP.cjs.map +0 -1
- /package/dist/{chunk-Q2JM2YKN.js.map → chunk-6T6NVRNM.js.map} +0 -0
- /package/dist/{chunk-CD5JFQPF.js.map → chunk-6UZQ5ZZJ.js.map} +0 -0
- /package/dist/{chunk-COL67BR4.js.map → chunk-BFL7S4HC.js.map} +0 -0
- /package/dist/{chunk-2S25DBZB.js.map → chunk-GM5SALQC.js.map} +0 -0
- /package/dist/{chunk-MIG6JI6H.js.map → chunk-KZYQGRHP.js.map} +0 -0
- /package/dist/{chunk-GI5QRYIB.js.map → chunk-MXAVM7XR.js.map} +0 -0
- /package/dist/{chunk-7T2V7TC5.js.map → chunk-ZLPKCCD2.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PolytypoError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D6PN6Q4M.js";
|
|
4
4
|
|
|
5
5
|
// src/engine/assert-fixed-mode.ts
|
|
6
6
|
function assertFixedMode(mode, fixed, entryPoint) {
|
|
@@ -14,4 +14,4 @@ function assertFixedMode(mode, fixed, entryPoint) {
|
|
|
14
14
|
export {
|
|
15
15
|
assertFixedMode
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-6T6NVRNM.js.map
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
htmlFragmentSpans,
|
|
3
3
|
isSkippedElement,
|
|
4
4
|
wrapParserErrors
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GM5SALQC.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveFrontmatterKeys,
|
|
8
8
|
yamlSpans
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BFL7S4HC.js";
|
|
10
10
|
import {
|
|
11
11
|
PolytypoError,
|
|
12
12
|
analyzeOverUnits,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
planRules,
|
|
17
17
|
resolveNarrowTarget,
|
|
18
18
|
runOverUnits
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-D6PN6Q4M.js";
|
|
20
20
|
|
|
21
21
|
// src/modes/markdown.ts
|
|
22
22
|
import { parse, postprocess, preprocess } from "micromark";
|
|
@@ -394,4 +394,4 @@ export {
|
|
|
394
394
|
runMarkdownPipeline,
|
|
395
395
|
analyzeMarkdownPipeline
|
|
396
396
|
};
|
|
397
|
-
//# sourceMappingURL=chunk-
|
|
397
|
+
//# sourceMappingURL=chunk-6UZQ5ZZJ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PolytypoError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D6PN6Q4M.js";
|
|
4
4
|
|
|
5
5
|
// src/modes/yaml.ts
|
|
6
6
|
var TAB = 9;
|
|
@@ -370,4 +370,4 @@ export {
|
|
|
370
370
|
resolveYamlKeys,
|
|
371
371
|
resolveFrontmatterKeys
|
|
372
372
|
};
|
|
373
|
-
//# sourceMappingURL=chunk-
|
|
373
|
+
//# sourceMappingURL=chunk-BFL7S4HC.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkW547XYZLcjs = require('./chunk-W547XYZL.cjs');
|
|
13
|
+
|
|
14
|
+
// src/engine/text-pipeline.ts
|
|
15
|
+
function runTextPipeline(input, options) {
|
|
16
|
+
const narrowTarget = _chunkW547XYZLcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
17
|
+
const planned = _chunkW547XYZLcjs.planRules.call(void 0, options.rules);
|
|
18
|
+
const locale = _chunkW547XYZLcjs.getLocaleData.call(void 0, options.locale);
|
|
19
|
+
const holes = _chunkW547XYZLcjs.resolveProtect.call(void 0, options.protect, _chunkW547XYZLcjs.toCodePoints.call(void 0, input).length);
|
|
20
|
+
if (holes.length > 0) return _chunkW547XYZLcjs.runProtected.call(void 0, input, holes, planned, locale, narrowTarget);
|
|
21
|
+
return _chunkW547XYZLcjs.fromCodePoints.call(void 0, _chunkW547XYZLcjs.runRules.call(void 0, _chunkW547XYZLcjs.toCodePoints.call(void 0, input), planned, locale, "text", narrowTarget));
|
|
22
|
+
}
|
|
23
|
+
function analyzeTextPipeline(input, options) {
|
|
24
|
+
const narrowTarget = _chunkW547XYZLcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
25
|
+
const planned = _chunkW547XYZLcjs.planRules.call(void 0, options.rules);
|
|
26
|
+
const locale = _chunkW547XYZLcjs.getLocaleData.call(void 0, options.locale);
|
|
27
|
+
const cp = _chunkW547XYZLcjs.toCodePoints.call(void 0, input);
|
|
28
|
+
const holes = _chunkW547XYZLcjs.resolveProtect.call(void 0, options.protect, cp.length);
|
|
29
|
+
if (holes.length > 0) return _chunkW547XYZLcjs.analyzeProtected.call(void 0, input, holes, planned, locale, narrowTarget);
|
|
30
|
+
const origin = cp.map((_value, index) => index);
|
|
31
|
+
return _chunkW547XYZLcjs.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-BKW4AJZO.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-BKW4AJZO.cjs","../src/engine/text-pipeline.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACMO,SAAS,eAAA,CAAgB,KAAA,EAAe,OAAA,EAAmC;AAChF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,MAAM,MAAA,EAAQ,8CAAA,OAAe,CAAQ,OAAA,EAAS,4CAAA,KAAkB,CAAA,CAAE,MAAM,CAAA;AACxE,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,EAAS,CAAA,EAAG,OAAO,4CAAA,KAAa,EAAO,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,YAAY,CAAA;AACrF,EAAA,OAAO,8CAAA,wCAAe,4CAAS,KAAkB,CAAA,EAAG,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAY,CAAC,CAAA;AAC5F;AAGO,SAAS,mBAAA,CAAoB,KAAA,EAAe,OAAA,EAAqC;AACtF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,MAAM,GAAA,EAAK,4CAAA,KAAkB,CAAA;AAC7B,EAAA,MAAM,MAAA,EAAQ,8CAAA,OAAe,CAAQ,OAAA,EAAS,EAAA,CAAG,MAAM,CAAA;AACvD,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,EAAS,CAAA,EAAG,OAAO,gDAAA,KAAiB,EAAO,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,YAAY,CAAA;AACzF,EAAA,MAAM,OAAA,EAAS,EAAA,CAAG,GAAA,CAAI,CAAC,MAAA,EAAQ,KAAA,EAAA,GAAU,KAAK,CAAA;AAC9C,EAAA,OAAO,iDAAA,EAAkB,EAAI,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAA,EAAc,MAAA,EAAQ,EAAA,CAAG,MAAM,CAAA;AACvF;ADNA;AACA;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-BKW4AJZO.cjs","sourcesContent":[null,"import type { Options } from \"../types.js\";\nimport { fromCodePoints, toCodePoints } from \"./codepoints.js\";\nimport type { Change } from \"./origin.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { resolveNarrowTarget } from \"./narrow-target.js\";\nimport { planRules, runRules, runRulesRecording } from \"./rule-runner.js\";\nimport { analyzeProtected, resolveProtect, runProtected } from \"./protect.js\";\n\n/**\n * `text` mode only. Deliberately imports nothing from `../modes/html.js` or\n * `../modes/markdown.js` (or their parser dependencies) — this is what makes `polytypo/text`'s\n * module graph exclude `parse5` and the Micromark stack (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md\n * 5.1).\n *\n * Validation order — `planRules` before `getLocaleData` — mirrors the pre-Stage-5 aggregate\n * `runPipeline` exactly (an unknown-rule error must win over an unknown-locale error when both\n * are present, since that is public, tested behaviour, not an implementation detail this\n * refactor was authorised to change).\n */\nexport function runTextPipeline(input: string, options: Partial<Options>): string {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const holes = resolveProtect(options.protect, toCodePoints(input).length);\n if (holes.length > 0) return runProtected(input, holes, planned, locale, narrowTarget);\n return fromCodePoints(runRules(toCodePoints(input), planned, locale, \"text\", narrowTarget));\n}\n\n/** analyze.md §1: the same pipeline as `runTextPipeline`, reporting instead of applying. */\nexport function analyzeTextPipeline(input: string, options: Partial<Options>): Change[] {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const cp = toCodePoints(input);\n const holes = resolveProtect(options.protect, cp.length);\n if (holes.length > 0) return analyzeProtected(input, holes, planned, locale, narrowTarget);\n const origin = cp.map((_value, index) => index);\n return runRulesRecording(cp, planned, locale, \"text\", narrowTarget, origin, cp.length);\n}\n"]}
|
|
@@ -64,6 +64,7 @@ var KNOWN_LOCALES = [
|
|
|
64
64
|
"lv",
|
|
65
65
|
"nb",
|
|
66
66
|
"nl",
|
|
67
|
+
"nn",
|
|
67
68
|
"pl",
|
|
68
69
|
"pt-BR",
|
|
69
70
|
"pt-PT",
|
|
@@ -103,6 +104,7 @@ var LOCALES = {
|
|
|
103
104
|
lv: { locale: "lv", name: "Latvian", quotes: { primary: { open: "\u201C", close: "\u201D", innerSpace: "none" }, secondary: { open: "\u201C", close: "\u201D", innerSpace: "none" }, elisionIdioms: [], elisionClitics: { before: [], after: [] }, punctuationPlacement: "none" }, dash: { parenthetical: "en-spaced", range: "en-tight" }, ellipsis: { abbreviatedAfterTerminal: false }, hyphen: { prefixes: [], suffixes: [], compounds: [] }, nbsp: { beforePunctuation: [], narrowBeforePunctuation: [], afterShortWords: [], abbreviations: ["u. c.", "u. tml.", "\u0161. g."], beforeUnits: [], spacedUnits: ["%", "\u20AC", "EUR", "km", "\xB0C"], closedUnits: [], beforeNumber: ["Nr."], beforeWord: [], afterSymbols: [], initialBinding: "single" } },
|
|
104
105
|
nb: { locale: "nb", name: "Norwegian Bokm\xE5l", quotes: { primary: { open: "\xAB", close: "\xBB", innerSpace: "none" }, secondary: { open: "\u2018", close: "\u2019", innerSpace: "none" }, elisionIdioms: [], elisionClitics: { before: [], after: [] }, punctuationPlacement: "none" }, dash: { parenthetical: "en-spaced", range: "en-tight" }, ellipsis: { abbreviatedAfterTerminal: false }, hyphen: { prefixes: [], suffixes: [], compounds: [] }, nbsp: { beforePunctuation: [], narrowBeforePunctuation: [], afterShortWords: [], abbreviations: [], beforeUnits: [], spacedUnits: ["%", "kr", "km", "kg", "cm", "\xB0C"], closedUnits: [], beforeNumber: [], beforeWord: [], afterSymbols: [], initialBinding: "none" } },
|
|
105
106
|
nl: { locale: "nl", name: "Dutch", quotes: { primary: { open: "\u201C", close: "\u201D", innerSpace: "none" }, secondary: { open: "\u2018", close: "\u2019", innerSpace: "none" }, elisionIdioms: [], elisionClitics: { before: [], after: ["s", "t", "ns", "k", "m", "em", "r", "et"] }, punctuationPlacement: "none" }, dash: { parenthetical: "en-spaced", range: "none" }, ellipsis: { abbreviatedAfterTerminal: false }, hyphen: { prefixes: [], suffixes: [], compounds: [] }, nbsp: { beforePunctuation: [], narrowBeforePunctuation: [], afterShortWords: [], abbreviations: ["prof. dr."], beforeUnits: ["\xB0C", "km/h", "kWh"], spacedUnits: ["km", "cm", "mm", "kg"], closedUnits: ["%", "\u2030"], beforeNumber: [], beforeWord: [], afterSymbols: ["\u20AC", "$"], initialBinding: "none" } },
|
|
107
|
+
nn: { locale: "nn", name: "Norwegian Nynorsk", quotes: { primary: { open: "\xAB", close: "\xBB", innerSpace: "none" }, secondary: { open: "\u2018", close: "\u2019", innerSpace: "none" }, elisionIdioms: [], elisionClitics: { before: [], after: [] }, punctuationPlacement: "none" }, dash: { parenthetical: "en-spaced", range: "en-tight" }, ellipsis: { abbreviatedAfterTerminal: false }, hyphen: { prefixes: [], suffixes: [], compounds: [] }, nbsp: { beforePunctuation: [], narrowBeforePunctuation: [], afterShortWords: [], abbreviations: [], beforeUnits: [], spacedUnits: ["%", "kr", "km", "kg", "cm", "\xB0C"], closedUnits: [], beforeNumber: [], beforeWord: [], afterSymbols: [], initialBinding: "none" } },
|
|
106
108
|
pl: { locale: "pl", name: "Polish", quotes: { primary: { open: "\u201E", close: "\u201D", innerSpace: "none" }, secondary: { open: "\xBB", close: "\xAB", innerSpace: "none" }, elisionIdioms: [], elisionClitics: { before: [], after: [] }, punctuationPlacement: "none" }, dash: { parenthetical: "en-spaced", range: "en-tight" }, ellipsis: { abbreviatedAfterTerminal: false }, hyphen: { prefixes: [], suffixes: [], compounds: [] }, nbsp: { beforePunctuation: [], narrowBeforePunctuation: [], afterShortWords: ["a", "i", "o", "u", "w", "z"], abbreviations: ["lek. med.", "in\u017C. g\xF3rn.", "bp sufr."], beforeUnits: ["\u2030", "\xB0C"], spacedUnits: ["km", "cm", "mm", "kg", "km/h", "kWh"], closedUnits: ["%"], beforeNumber: [], beforeWord: [], afterSymbols: ["\xA7"], initialBinding: "none" } },
|
|
107
109
|
"pt-BR": { locale: "pt-BR", name: "Portuguese (Brazil)", quotes: { primary: { open: "\u201C", close: "\u201D", innerSpace: "none" }, secondary: { open: "\u2018", close: "\u2019", innerSpace: "none" }, elisionIdioms: [], elisionClitics: { before: ["d", "n", "pel", "m", "t", "lh", "sant"], after: [] }, punctuationPlacement: "none" }, dash: { parenthetical: "en-spaced", range: "none" }, ellipsis: { abbreviatedAfterTerminal: false }, hyphen: { prefixes: [], suffixes: [], compounds: [] }, nbsp: { beforePunctuation: [], narrowBeforePunctuation: [], afterShortWords: [], abbreviations: ["p. ex."], beforeUnits: ["%", "\u2030"], spacedUnits: ["\xB0C", "km", "cm", "mm", "kg", "kW", "kWh", "Hz"], closedUnits: [], beforeNumber: ["p."], beforeWord: [], afterSymbols: [], initialBinding: "none" } },
|
|
108
110
|
"pt-PT": { locale: "pt-PT", name: "Portuguese (Portugal)", quotes: { primary: { open: "\xAB", close: "\xBB", innerSpace: "none" }, secondary: { open: "\u201C", close: "\u201D", innerSpace: "none" }, elisionIdioms: [], elisionClitics: { before: ["d", "n", "pel", "m", "t", "lh", "sant"], after: [] }, punctuationPlacement: "none" }, dash: { parenthetical: "em-spaced", range: "none" }, ellipsis: { abbreviatedAfterTerminal: false }, hyphen: { prefixes: [], suffixes: [], compounds: [] }, nbsp: { beforePunctuation: [], narrowBeforePunctuation: [], afterShortWords: [], abbreviations: ["p. ex."], beforeUnits: ["\u2030", "kWh"], spacedUnits: ["%", "\xB0C", "km", "cm", "mm", "kg", "kW", "Hz"], closedUnits: [], beforeNumber: ["p."], beforeWord: [], afterSymbols: [], initialBinding: "none" } },
|
|
@@ -6564,4 +6566,4 @@ export {
|
|
|
6564
6566
|
runProtected,
|
|
6565
6567
|
analyzeProtected
|
|
6566
6568
|
};
|
|
6567
|
-
//# sourceMappingURL=chunk-
|
|
6569
|
+
//# sourceMappingURL=chunk-D6PN6Q4M.js.map
|