@intlayer/core 7.6.0-canary.0 → 8.0.0-canary.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 (149) hide show
  1. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +1 -1
  2. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
  3. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs +1 -1
  4. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
  5. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs +5 -0
  6. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
  7. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs +1 -1
  8. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
  9. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +1 -1
  10. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
  11. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +1 -1
  12. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
  13. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +1 -1
  14. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
  15. package/dist/cjs/index.cjs +56 -2
  16. package/dist/cjs/interpreter/getContent/deepTransform.cjs +1 -0
  17. package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
  18. package/dist/cjs/interpreter/getContent/getContent.cjs +2 -2
  19. package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -1
  20. package/dist/cjs/interpreter/getContent/plugins.cjs +3 -2
  21. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
  22. package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
  23. package/dist/cjs/interpreter/getHTML.cjs +106 -0
  24. package/dist/cjs/interpreter/getHTML.cjs.map +1 -0
  25. package/dist/cjs/interpreter/getInsertion.cjs +3 -1
  26. package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
  27. package/dist/cjs/interpreter/getTranslation.cjs +2 -2
  28. package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
  29. package/dist/cjs/interpreter/index.cjs +2 -0
  30. package/dist/cjs/localization/getBrowserLocale.cjs +1 -1
  31. package/dist/cjs/localization/getLocale.cjs +4 -3
  32. package/dist/cjs/localization/getLocale.cjs.map +1 -1
  33. package/dist/cjs/markdown/compiler.cjs +806 -0
  34. package/dist/cjs/markdown/compiler.cjs.map +1 -0
  35. package/dist/cjs/markdown/constants.cjs +334 -0
  36. package/dist/cjs/markdown/constants.cjs.map +1 -0
  37. package/dist/cjs/markdown/index.cjs +49 -0
  38. package/dist/cjs/markdown/parser.cjs +73 -0
  39. package/dist/cjs/markdown/parser.cjs.map +1 -0
  40. package/dist/cjs/markdown/renderer.cjs +68 -0
  41. package/dist/cjs/markdown/renderer.cjs.map +1 -0
  42. package/dist/cjs/markdown/types.cjs +0 -0
  43. package/dist/cjs/markdown/utils.cjs +397 -0
  44. package/dist/cjs/markdown/utils.cjs.map +1 -0
  45. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs +15 -0
  46. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +1 -0
  47. package/dist/cjs/transpiler/html/index.cjs +133 -0
  48. package/dist/cjs/transpiler/html/index.cjs.map +1 -0
  49. package/dist/cjs/transpiler/index.cjs +3 -0
  50. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +2 -2
  51. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
  52. package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
  53. package/dist/cjs/utils/intl.cjs +35 -3
  54. package/dist/cjs/utils/intl.cjs.map +1 -1
  55. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs +1 -1
  56. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
  57. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs +1 -1
  58. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
  59. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs +5 -0
  60. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs.map +1 -1
  61. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs +1 -1
  62. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs.map +1 -1
  63. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +1 -1
  64. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
  65. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs +1 -1
  66. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
  67. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs +1 -1
  68. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
  69. package/dist/esm/index.mjs +11 -4
  70. package/dist/esm/interpreter/getContent/deepTransform.mjs +1 -0
  71. package/dist/esm/interpreter/getContent/deepTransform.mjs.map +1 -1
  72. package/dist/esm/interpreter/getContent/getContent.mjs +2 -2
  73. package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -1
  74. package/dist/esm/interpreter/getContent/plugins.mjs +3 -2
  75. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
  76. package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
  77. package/dist/esm/interpreter/getHTML.mjs +105 -0
  78. package/dist/esm/interpreter/getHTML.mjs.map +1 -0
  79. package/dist/esm/interpreter/getInsertion.mjs +3 -1
  80. package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
  81. package/dist/esm/interpreter/getTranslation.mjs +2 -2
  82. package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
  83. package/dist/esm/interpreter/index.mjs +2 -1
  84. package/dist/esm/localization/getBrowserLocale.mjs +1 -1
  85. package/dist/esm/localization/getLocale.mjs +2 -1
  86. package/dist/esm/localization/getLocale.mjs.map +1 -1
  87. package/dist/esm/markdown/compiler.mjs +804 -0
  88. package/dist/esm/markdown/compiler.mjs.map +1 -0
  89. package/dist/esm/markdown/constants.mjs +254 -0
  90. package/dist/esm/markdown/constants.mjs.map +1 -0
  91. package/dist/esm/markdown/index.mjs +7 -0
  92. package/dist/esm/markdown/parser.mjs +73 -0
  93. package/dist/esm/markdown/parser.mjs.map +1 -0
  94. package/dist/esm/markdown/renderer.mjs +67 -0
  95. package/dist/esm/markdown/renderer.mjs.map +1 -0
  96. package/dist/esm/markdown/types.mjs +0 -0
  97. package/dist/esm/markdown/utils.mjs +368 -0
  98. package/dist/esm/markdown/utils.mjs.map +1 -0
  99. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs +15 -0
  100. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +1 -0
  101. package/dist/esm/transpiler/html/index.mjs +131 -0
  102. package/dist/esm/transpiler/html/index.mjs.map +1 -0
  103. package/dist/esm/transpiler/index.mjs +2 -1
  104. package/dist/esm/transpiler/insertion/getInsertionValues.mjs +2 -2
  105. package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
  106. package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
  107. package/dist/esm/utils/intl.mjs +35 -4
  108. package/dist/esm/utils/intl.mjs.map +1 -1
  109. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +11 -10
  110. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -1
  111. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +3 -2
  112. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -1
  113. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +11 -10
  114. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -1
  115. package/dist/types/getStorageAttributes.d.ts.map +1 -1
  116. package/dist/types/index.d.ts +11 -3
  117. package/dist/types/interpreter/getContent/getContent.d.ts +1 -1
  118. package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -1
  119. package/dist/types/interpreter/getContent/index.d.ts +2 -2
  120. package/dist/types/interpreter/getContent/plugins.d.ts +58 -18
  121. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
  122. package/dist/types/interpreter/getEnumeration.d.ts +1 -1
  123. package/dist/types/interpreter/getHTML.d.ts +14 -0
  124. package/dist/types/interpreter/getHTML.d.ts.map +1 -0
  125. package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
  126. package/dist/types/interpreter/index.d.ts +3 -2
  127. package/dist/types/localization/getLocale.d.ts.map +1 -1
  128. package/dist/types/markdown/compiler.d.ts +10 -0
  129. package/dist/types/markdown/compiler.d.ts.map +1 -0
  130. package/dist/types/markdown/constants.d.ts +193 -0
  131. package/dist/types/markdown/constants.d.ts.map +1 -0
  132. package/dist/types/markdown/index.d.ts +7 -0
  133. package/dist/types/markdown/parser.d.ts +17 -0
  134. package/dist/types/markdown/parser.d.ts.map +1 -0
  135. package/dist/types/markdown/renderer.d.ts +23 -0
  136. package/dist/types/markdown/renderer.d.ts.map +1 -0
  137. package/dist/types/markdown/types.d.ts +367 -0
  138. package/dist/types/markdown/types.d.ts.map +1 -0
  139. package/dist/types/markdown/utils.d.ts +141 -0
  140. package/dist/types/markdown/utils.d.ts.map +1 -0
  141. package/dist/types/messageFormat/ICU.d.ts.map +1 -1
  142. package/dist/types/transpiler/html/getHTMLCustomComponents.d.ts +9 -0
  143. package/dist/types/transpiler/html/getHTMLCustomComponents.d.ts.map +1 -0
  144. package/dist/types/transpiler/html/index.d.ts +33 -0
  145. package/dist/types/transpiler/html/index.d.ts.map +1 -0
  146. package/dist/types/transpiler/index.d.ts +2 -1
  147. package/dist/types/utils/intl.d.ts +21 -2
  148. package/dist/types/utils/intl.d.ts.map +1 -1
  149. package/package.json +15 -7
@@ -0,0 +1,141 @@
1
+ import { NestedParser, ParseState, ParserResult, Rule } from "./types.js";
2
+
3
+ //#region src/markdown/utils.d.ts
4
+
5
+ /**
6
+ * Trim trailing whitespace from a string.
7
+ */
8
+ declare const trimEnd: (str: string) => string;
9
+ /**
10
+ * Check if string starts with prefix.
11
+ */
12
+ declare const startsWith: (str: string, prefix: string) => boolean;
13
+ /**
14
+ * Remove symmetrical leading and trailing quotes.
15
+ */
16
+ declare const unquote: (str: string) => string;
17
+ /**
18
+ * Unescape backslash-escaped characters.
19
+ */
20
+ declare const unescapeString: (rawString: string) => string;
21
+ /**
22
+ * Join class names, filtering out falsy values.
23
+ */
24
+ declare const cx: (...args: any[]) => string;
25
+ /**
26
+ * Get a nested property from an object using dot notation.
27
+ */
28
+ declare const get: (src: any, path: string, fb?: any) => any;
29
+ /**
30
+ * Convert a string to a URL-safe slug.
31
+ * Based on https://stackoverflow.com/a/18123682/1141611
32
+ */
33
+ declare const slugify: (str: string) => string;
34
+ /**
35
+ * Sanitize URLs to prevent XSS attacks.
36
+ * Returns null if the URL is unsafe.
37
+ */
38
+ declare const sanitizer: (input: string) => string | null;
39
+ /**
40
+ * Normalize whitespace in source string.
41
+ */
42
+ declare const normalizeWhitespace: (source: string) => string;
43
+ /**
44
+ * Safely remove a uniform leading indentation from lines, but do NOT touch
45
+ * the content inside fenced code blocks (``` or ~~~).
46
+ */
47
+ declare const trimLeadingWhitespaceOutsideFences: (text: string, whitespace: string) => string;
48
+ /**
49
+ * Normalize HTML attribute key to JSX prop name.
50
+ */
51
+ declare const normalizeAttributeKey: (key: string) => string;
52
+ type StyleTuple = [key: string, value: string];
53
+ /**
54
+ * Parse a CSS style string into an array of [key, value] tuples.
55
+ */
56
+ declare const parseStyleAttribute: (styleString: string) => StyleTuple[];
57
+ /**
58
+ * Convert an attribute value to a Node prop value.
59
+ */
60
+ declare const attributeValueToNodePropValue: (tag: string, key: string, value: string, sanitizeUrlFn: (value: string, tag: string, attribute: string) => string | null) => any;
61
+ /**
62
+ * Parse table alignment from a separator row.
63
+ */
64
+ declare const parseTableAlignCapture: (alignCapture: string) => "left" | "right" | "center";
65
+ /**
66
+ * Parse table alignment row.
67
+ */
68
+ declare const parseTableAlign: (source: string) => ("left" | "right" | "center")[];
69
+ /**
70
+ * Parse a single table row.
71
+ */
72
+ declare const parseTableRow: (source: string, parse: NestedParser, state: ParseState, tableOutput: boolean) => ParserResult[][];
73
+ /**
74
+ * Parse table cells (multiple rows).
75
+ */
76
+ declare const parseTableCells: (source: string, parse: NestedParser, state: ParseState) => ParserResult[][][];
77
+ /**
78
+ * Check if a rule qualifies for the current source and state.
79
+ */
80
+ declare const qualifies: (source: string, state: ParseState, qualify: NonNullable<Rule<any>["_qualify"]>) => boolean;
81
+ /**
82
+ * Marks a matcher function as eligible for being run inside an inline context.
83
+ */
84
+ declare const allowInline: <T extends (...args: any[]) => any>(fn: T) => T & {
85
+ inline: 1;
86
+ };
87
+ /**
88
+ * Creates a match function for an inline scoped element from a regex.
89
+ */
90
+ declare const inlineRegex: (regex: RegExp) => ((source: string, state: ParseState) => RegExpMatchArray | null) & {
91
+ inline: 1;
92
+ };
93
+ /**
94
+ * Creates a match function for inline elements except links.
95
+ */
96
+ declare const simpleInlineRegex: (regex: RegExp) => ((source: string, state: ParseState) => RegExpMatchArray | null) & {
97
+ inline: 1;
98
+ };
99
+ /**
100
+ * Creates a match function for a block scoped element from a regex.
101
+ */
102
+ declare const blockRegex: (regex: RegExp) => (source: string, state: ParseState) => RegExpMatchArray | null;
103
+ /**
104
+ * Creates a match function from a regex, ignoring block/inline scope.
105
+ */
106
+ declare const anyScopeRegex: (fn: RegExp | ((source: string, state: ParseState) => RegExpMatchArray | null)) => ((source: string, state: ParseState) => RegExpMatchArray | null) & {
107
+ inline: 1;
108
+ };
109
+ /**
110
+ * Parse inline content (including links).
111
+ */
112
+ declare const parseInline: (parse: NestedParser, children: string, state: ParseState) => ParserResult[];
113
+ /**
114
+ * Parse simple inline content (no links).
115
+ */
116
+ declare const parseSimpleInline: (parse: NestedParser, children: string, state: ParseState) => ParserResult[];
117
+ /**
118
+ * Parse block content.
119
+ */
120
+ declare const parseBlock: (parse: NestedParser, children: string, state?: ParseState) => ParserResult[];
121
+ /**
122
+ * Helper to parse capture group 2 as inline content.
123
+ */
124
+ declare const parseCaptureInline: (capture: RegExpMatchArray, parse: NestedParser, state: ParseState) => {
125
+ children: ParserResult[];
126
+ };
127
+ /**
128
+ * Helper that captures nothing (empty object).
129
+ */
130
+ declare const captureNothing: () => Record<string, never>;
131
+ /**
132
+ * Helper that renders nothing (null).
133
+ */
134
+ declare const renderNothing: () => null;
135
+ /**
136
+ * Check if any regex in a list matches the input.
137
+ */
138
+ declare const some: (regexes: RegExp[], input: string) => boolean;
139
+ //#endregion
140
+ export { allowInline, anyScopeRegex, attributeValueToNodePropValue, blockRegex, captureNothing, cx, get, inlineRegex, normalizeAttributeKey, normalizeWhitespace, parseBlock, parseCaptureInline, parseInline, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, qualifies, renderNothing, sanitizer, simpleInlineRegex, slugify, some, startsWith, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, unquote };
141
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../../src/markdown/utils.ts"],"sourcesContent":[],"mappings":";;;;AAwEA;AAKA;AAsBA;AAyBa,cA7FA,OAwHZ,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,GAAA,MAAA;AASD;AAsBA;AA8DA;AAYK,cAtNQ,UAsNE,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,GAAA,OAAA;AAKf;AAwEA;AAiDA;AAiBa,cA9VA,OAmWZ,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,GAAA,MAAA;AAKD;;;AAKG,cA5VU,cA4VV,EAAA,CAAA,SA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,CAAA,MAAA,EAAA,MAAA,EAAA,GAAA,CAAA,MAAA,GAAA,OAAA,GAAA,QAAA,CAAA,EAAA;;AA4BH;;AAES,cAnQI,aAmQJ,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAjQA,YAiQA,EAAA,KAAA,EAhQA,UAgQA,EAAA,WAAA,EAAA,OAAA,EAAA,GA9PN,YA8PM,EAAA,EAAA;;;;AAWI,cAnNA,eAmNqB,EAAA,CAAA,MAAM,EAAA,MAAA,EAAA,KAAA,EAjN/B,YAiN+B,EAAA,KAAA,EAhN/B,UAgN+B,EAAA,GA/MrC,YA+MqC,EAAA,EAAA,EAAA;AAKxC;AAKA;;cAhMa,mCAEJ,qBACE,YAAY;;;;cAmBV,qDACP,MACH;;;;;;cAQU,qBAAsB,oCACG,eAAa;;;;;;cAWtC,2BAA4B,oCACH,eAAa;;;;;;cAWtC,oBACH,mCACgB,eAAa;;;;cAW1B,oBACP,kCAAkC,eAAe,sDAEjB,eAAa;;;;;;cAUtC,qBACJ,uCAEA,eACN;;;;cAuBU,2BACJ,uCAEA,eACN;;;;cAwBU,oBACJ,wCAEA,eACN;;;;cA4BU,8BACF,yBACF,qBACA;YACM;;;;;cASF,sBAAqB;;;;cAKrB;;;;cAKA,gBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ICU.d.ts","names":[],"sources":["../../../src/messageFormat/ICU.ts"],"sourcesContent":[],"mappings":";;;KA4CY,SAAA,sCAKR;iBACiB;AANrB,CAAA;AAkca,cAAA,sBACF,EAAA,CAAA,OACR,EADQ,UAOV,CAAA,SAAA,CAAA,EAAA,GANE,SAMF;AAEY,cAAA,sBACF,EAAA,CAAA,OACR,EADQ,UAOV,CAAA,SAAA,CAAA,EAAA,GANE,SAMF"}
1
+ {"version":3,"file":"ICU.d.ts","names":[],"sources":["../../../src/messageFormat/ICU.ts"],"sourcesContent":[],"mappings":";;;KA4CY,SAAA,sCAKR;iBACiB;AANrB,CAAA;AAkca,cAAA,sBACF,EAAA,CAAA,OAAA,EAAA,UAOV,CAAA,SAAA,CAAA,EAAA,GANE,SAMF;AAEY,cAAA,sBACF,EAAA,CAAA,OAAA,EAAA,UAOV,CAAA,SAAA,CAAA,EAAA,GANE,SAMF"}
@@ -0,0 +1,9 @@
1
+ //#region src/transpiler/html/getHTMLCustomComponents.d.ts
2
+ /**
3
+ * Extracts custom component names from an HTML string.
4
+ * Custom components are any tags that are not standard HTML tags.
5
+ */
6
+ declare const getHTMLCustomComponents: (content: string) => string[];
7
+ //#endregion
8
+ export { getHTMLCustomComponents };
9
+ //# sourceMappingURL=getHTMLCustomComponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getHTMLCustomComponents.d.ts","names":[],"sources":["../../../../src/transpiler/html/getHTMLCustomComponents.ts"],"sourcesContent":[],"mappings":";;AAMA;;;cAAa"}
@@ -0,0 +1,33 @@
1
+ import { NodeType, TypedNodeModel } from "@intlayer/types";
2
+
3
+ //#region src/transpiler/html/index.d.ts
4
+ type HTMLContentConstructor<Content = string, T extends Record<string, any> = {}> = TypedNodeModel<NodeType.HTML, Content, T>;
5
+ type HTMLContent<Content = string> = HTMLContentConstructor<Content, {
6
+ customComponents: string[];
7
+ }>;
8
+ /**
9
+ * Function intended to be used to build intlayer dictionaries.
10
+ *
11
+ * Allow to parse HTML/JSX-like strings and replace tags with components during interpretation.
12
+ *
13
+ * Usage:
14
+ *
15
+ * ```ts
16
+ * html('Hello <b>World</b>')
17
+ * ```
18
+ *
19
+ */
20
+ declare const html: (content: string) => HTMLContent;
21
+ /**
22
+ * List of standard HTML tags to provide as default components.
23
+ * These allow users to use standard HTML tags in their html() content
24
+ * without having to pass them explicitly.
25
+ *
26
+ * Used by framework-specific plugins (react-intlayer, vue-intlayer, etc.)
27
+ * to create default HTML tag components.
28
+ */
29
+ declare const HTML_TAGS: readonly ["html", "head", "body", "main", "header", "footer", "nav", "aside", "article", "section", "div", "span", "h1", "h2", "h3", "h4", "h5", "h6", "p", "a", "strong", "b", "em", "i", "u", "s", "del", "ins", "mark", "small", "sub", "sup", "code", "pre", "blockquote", "q", "cite", "abbr", "address", "time", "kbd", "samp", "var", "ul", "ol", "li", "dl", "dt", "dd", "table", "thead", "tbody", "tfoot", "tr", "th", "td", "caption", "colgroup", "col", "form", "input", "textarea", "button", "select", "option", "optgroup", "label", "fieldset", "legend", "datalist", "output", "progress", "meter", "img", "video", "audio", "source", "track", "picture", "figure", "figcaption", "iframe", "embed", "object", "canvas", "svg", "details", "summary", "dialog", "br", "hr", "wbr", "ruby", "rt", "rp", "bdi", "bdo", "data", "template", "slot"];
30
+ type HTMLTagDefault = (typeof HTML_TAGS)[number];
31
+ //#endregion
32
+ export { HTMLContent, HTMLContentConstructor, HTMLTagDefault, HTML_TAGS, html };
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/transpiler/html/index.ts"],"sourcesContent":[],"mappings":";;;KAGY,mDAEA,4BACR,eAAe,QAAA,CAAS,MAAM,SAAS;KAE/B,gCAAgC,uBAC1C;EANU,gBAAA,EAAA,MAAA,EAAsB;CAEtB,CAAA;;;;;;AAGZ;AAmBA;AAaA;AAgHA;;;;cA7Ha,2BAA0B;;;;;;;;;cAa1B;KAgHD,cAAA,WAAyB"}
@@ -6,6 +6,7 @@ import { FileContent, FileContentConstructor, file, fileContent } from "./file/f
6
6
  import "./file/index.js";
7
7
  import { Gender, GenderContent, GenderContentStates, gender } from "./gender/gender.js";
8
8
  import "./gender/index.js";
9
+ import { HTMLContent, HTMLContentConstructor, HTMLTagDefault, HTML_TAGS, html } from "./html/index.js";
9
10
  import { getInsertionValues } from "./insertion/getInsertionValues.js";
10
11
  import { InsertionContent, InsertionContentConstructor, insert as insertion } from "./insertion/insertion.js";
11
12
  import "./insertion/index.js";
@@ -16,4 +17,4 @@ import { DotPath, NestedContent, NestedContentState, ValidDotPathsFor, nest as n
16
17
  import "./nesting/index.js";
17
18
  import { TranslationContent, t as translation } from "./translation/translation.js";
18
19
  import "./translation/index.js";
19
- export { ConditionContent, ConditionContentStates, DotPath, EnterFormat, EnumerationContent, EnumerationContentState, FileContent, FileContentConstructor, Gender, GenderContent, GenderContentStates, InsertionContent, InsertionContentConstructor, MarkdownContent, MarkdownContentConstructor, NestedContent, NestedContentState, TranslationContent, ValidDotPathsFor, condition as cond, enumeration as enu, file, fileContent, gender, getInsertionValues, getMarkdownMetadata, insertion as insert, markdown as md, nesting as nest, translation as t };
20
+ export { ConditionContent, ConditionContentStates, DotPath, EnterFormat, EnumerationContent, EnumerationContentState, FileContent, FileContentConstructor, Gender, GenderContent, GenderContentStates, HTMLContent, HTMLContentConstructor, HTMLTagDefault, HTML_TAGS, InsertionContent, InsertionContentConstructor, MarkdownContent, MarkdownContentConstructor, NestedContent, NestedContentState, TranslationContent, ValidDotPathsFor, condition as cond, enumeration as enu, file, fileContent, gender, getInsertionValues, getMarkdownMetadata, html, insertion as insert, markdown as md, nesting as nest, translation as t };
@@ -2,13 +2,32 @@ import { LocalesValues } from "@intlayer/types";
2
2
 
3
3
  //#region src/utils/intl.d.ts
4
4
  type IntlConstructors = { [K in keyof typeof Intl as (typeof Intl)[K] extends (new (...args: any) => any) ? K : never]: (typeof Intl)[K] };
5
- type ReplaceLocaleWithLocalesValues<T> = T extends (new (locales: any, options?: infer Options) => infer Instance) ? new (locales?: LocalesValues, options?: Options) => Instance : T extends (new (locales: any) => infer Instance) ? new (locales?: LocalesValues) => Instance : T;
5
+ type ReplaceLocaleWithLocalesValues<T> = T extends (new (locales: any, options?: infer Options) => infer Instance) ? {
6
+ new (locales?: LocalesValues, options?: Options): Instance;
7
+ new (options?: Options & {
8
+ locale?: LocalesValues;
9
+ }): Instance;
10
+ } : T extends (new (locales: any) => infer Instance) ? {
11
+ new (locales?: LocalesValues): Instance;
12
+ new (options?: {
13
+ locale?: LocalesValues;
14
+ }): Instance;
15
+ } : T;
6
16
  type WrappedIntl = { [K in keyof typeof Intl]: K extends keyof IntlConstructors ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]> : (typeof Intl)[K] };
7
17
  /**
8
18
  * Factory that turns the global `Intl` into a cached clone.
9
19
  */
10
20
  declare const createCachedIntl: () => WrappedIntl;
11
21
  declare const CachedIntl: WrappedIntl;
22
+ /**
23
+ * Creates a proxied Intl object with a preset locale.
24
+ *
25
+ * @example
26
+ * const intl = bindIntl(Locales.FRENCH);
27
+ * new intl.NumberFormat(undefined, { style: 'currency', currency: 'EUR' }).format(10);
28
+ * // Uses 'fr' automatically
29
+ */
30
+ declare const bindIntl: (locale: LocalesValues) => WrappedIntl;
12
31
  //#endregion
13
- export { CachedIntl, CachedIntl as Intl, createCachedIntl };
32
+ export { CachedIntl, CachedIntl as Intl, bindIntl, createCachedIntl };
14
33
  //# sourceMappingURL=intl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"intl.d.ts","names":[],"sources":["../../../src/utils/intl.ts"],"sourcesContent":[],"mappings":";;;KA6BK,gBAAA,wBACgB,gBAAgB,MAAM,yCAGrC,oBACgB,MAAM,IAVkC;KAczD,8BARgB,CAAA,CAAA,CAAA,GAQoB,CARpB,UAAA,KAAA,OAAA,EAAA,GAAA,EAAA,OAAA,CAAA,EAAA,KAAA,QAAA,EAAA,GAAA,KAAA,SAAA,IAAA,KAAA,OAAA,CAAA,EAaL,aAbK,EAAA,OAAA,CAAA,EAcL,OAdK,EAAA,GAeZ,QAfY,GAgBjB,CAhBiB,UAAA,KAAA,OAAA,EAAA,GAAA,EAAA,GAAA,KAAA,SAAA,IAAA,KAAA,OAAA,CAAA,EAoBH,aApBG,EAAA,GAqBV,QArBU,GAsBf,CAtBe;KAyBhB,WAAA,GAzBgC,QAAM,MAAA,OA0BtB,IA1BsB,GA0Bf,CA1Be,SAAA,MA0BC,gBA1BD,GA2BrC,8BA3BqC,CAAA,CAAA,OA2BE,IA3BF,CAAA,CA2BQ,CA3BR,CAAA,CAAA,GAAA,CAAA,OA4B7B,IA5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lB,aAnIkB,EAAA,GAmIF,WAnIE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "7.6.0-canary.0",
3
+ "version": "8.0.0-canary.0",
4
4
  "private": false,
5
5
  "description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
6
6
  "keywords": [
@@ -42,6 +42,11 @@
42
42
  "require": "./dist/cjs/index.cjs",
43
43
  "import": "./dist/esm/index.mjs"
44
44
  },
45
+ "./markdown": {
46
+ "types": "./dist/types/markdown/index.d.ts",
47
+ "require": "./dist/cjs/markdown/index.cjs",
48
+ "import": "./dist/esm/markdown/index.mjs"
49
+ },
45
50
  "./messageFormat": {
46
51
  "types": "./dist/types/messageFormat/index.d.ts",
47
52
  "require": "./dist/cjs/messageFormat/index.cjs",
@@ -72,6 +77,9 @@
72
77
  ".": [
73
78
  "./dist/types/index.d.ts"
74
79
  ],
80
+ "markdown": [
81
+ "./dist/types/markdown/index.d.ts"
82
+ ],
75
83
  "file": [
76
84
  "./dist/types/transpiler/file/file.d.ts"
77
85
  ],
@@ -107,15 +115,15 @@
107
115
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
108
116
  },
109
117
  "dependencies": {
110
- "@intlayer/api": "7.6.0-canary.0",
111
- "@intlayer/config": "7.6.0-canary.0",
112
- "@intlayer/dictionaries-entry": "7.6.0-canary.0",
113
- "@intlayer/types": "7.6.0-canary.0",
114
- "@intlayer/unmerged-dictionaries-entry": "7.6.0-canary.0",
118
+ "@intlayer/api": "8.0.0-canary.0",
119
+ "@intlayer/config": "8.0.0-canary.0",
120
+ "@intlayer/dictionaries-entry": "8.0.0-canary.0",
121
+ "@intlayer/types": "8.0.0-canary.0",
122
+ "@intlayer/unmerged-dictionaries-entry": "8.0.0-canary.0",
115
123
  "defu": "6.1.4"
116
124
  },
117
125
  "devDependencies": {
118
- "@types/node": "25.0.7",
126
+ "@types/node": "25.0.9",
119
127
  "@utils/ts-config": "1.0.4",
120
128
  "@utils/ts-config-types": "1.0.4",
121
129
  "@utils/tsdown-config": "1.0.4",