@ai-matrx/content-ir 0.19.25 → 0.19.27
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/CHANGELOG.md +15 -0
- package/dist/convert.cjs +19 -1
- package/dist/convert.cjs.map +1 -1
- package/dist/convert.js +19 -1
- package/dist/convert.js.map +1 -1
- package/dist/core.cjs +19 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +19 -1
- package/dist/core.js.map +1 -1
- package/dist/directives.cjs +24 -2
- package/dist/directives.cjs.map +1 -1
- package/dist/directives.d.cts +1 -1
- package/dist/directives.d.ts +1 -1
- package/dist/directives.js +24 -2
- package/dist/directives.js.map +1 -1
- package/dist/index.cjs +25 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/dist/text-case.cjs +322 -0
- package/dist/text-case.cjs.map +1 -0
- package/dist/text-case.d.cts +81 -0
- package/dist/text-case.d.ts +81 -0
- package/dist/text-case.js +309 -0
- package/dist/text-case.js.map +1 -0
- package/package.json +11 -1
package/dist/index.js
CHANGED
|
@@ -2122,7 +2122,7 @@ function stripKindDeep(value) {
|
|
|
2122
2122
|
return value;
|
|
2123
2123
|
}
|
|
2124
2124
|
|
|
2125
|
-
//
|
|
2125
|
+
// text-case.ts
|
|
2126
2126
|
var DEFAULT_WORD_REPLACEMENTS = {
|
|
2127
2127
|
// Acronyms & initialisms
|
|
2128
2128
|
"api": "API",
|
|
@@ -2390,6 +2390,29 @@ function formatText(text, options = {}) {
|
|
|
2390
2390
|
}
|
|
2391
2391
|
return result;
|
|
2392
2392
|
}
|
|
2393
|
+
var IDENTIFIER_ACRONYMS = [
|
|
2394
|
+
"ID",
|
|
2395
|
+
"URL",
|
|
2396
|
+
"PDF",
|
|
2397
|
+
"HTML",
|
|
2398
|
+
"JSON",
|
|
2399
|
+
"API",
|
|
2400
|
+
"AI",
|
|
2401
|
+
"UI",
|
|
2402
|
+
"CSV",
|
|
2403
|
+
"SMS",
|
|
2404
|
+
"SEO",
|
|
2405
|
+
"LLM",
|
|
2406
|
+
"MCP",
|
|
2407
|
+
"UUID",
|
|
2408
|
+
"ISO"
|
|
2409
|
+
];
|
|
2410
|
+
var IDENTIFIER_ACRONYM_SET = new Set(IDENTIFIER_ACRONYMS.map((a) => a.toLowerCase()));
|
|
2411
|
+
function humanizeIdentifier(identifier) {
|
|
2412
|
+
return identifier.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[_\-.\s]+/).filter((part) => part.length > 0).map(
|
|
2413
|
+
(part) => IDENTIFIER_ACRONYM_SET.has(part.toLowerCase()) ? part.toUpperCase() : part.charAt(0).toUpperCase() + part.slice(1).toLowerCase()
|
|
2414
|
+
).join(" ");
|
|
2415
|
+
}
|
|
2393
2416
|
|
|
2394
2417
|
// core/schema-structure.ts
|
|
2395
2418
|
function formatBlockLabel(key) {
|
|
@@ -5055,8 +5078,7 @@ function tryDecodeDirectiveContent(content, onError) {
|
|
|
5055
5078
|
|
|
5056
5079
|
// directives/display.ts
|
|
5057
5080
|
function titleCaseToken(token) {
|
|
5058
|
-
|
|
5059
|
-
return words ? words.charAt(0).toUpperCase() + words.slice(1) : token;
|
|
5081
|
+
return humanizeIdentifier(token) || token;
|
|
5060
5082
|
}
|
|
5061
5083
|
var ACTION_BY_CLASS = {
|
|
5062
5084
|
reference: "Reference",
|