@lionrapid/core 0.1.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 (302) hide show
  1. package/README.md +106 -0
  2. package/dist/base/event-emitter.d.ts +91 -0
  3. package/dist/base/event-emitter.d.ts.map +1 -0
  4. package/dist/base/event-emitter.js +330 -0
  5. package/dist/base/event-emitter.js.map +1 -0
  6. package/dist/base/index.d.ts +5 -0
  7. package/dist/base/index.d.ts.map +1 -0
  8. package/dist/base/index.js +5 -0
  9. package/dist/base/index.js.map +1 -0
  10. package/dist/browser/auto-init.d.ts +57 -0
  11. package/dist/browser/auto-init.d.ts.map +1 -0
  12. package/dist/browser/auto-init.js +304 -0
  13. package/dist/browser/auto-init.js.map +1 -0
  14. package/dist/browser/auto-translator.d.ts +98 -0
  15. package/dist/browser/auto-translator.d.ts.map +1 -0
  16. package/dist/browser/auto-translator.js +218 -0
  17. package/dist/browser/auto-translator.js.map +1 -0
  18. package/dist/browser/block-extractor.d.ts +26 -0
  19. package/dist/browser/block-extractor.d.ts.map +1 -0
  20. package/dist/browser/block-extractor.js +143 -0
  21. package/dist/browser/block-extractor.js.map +1 -0
  22. package/dist/browser/dom-observer.d.ts +42 -0
  23. package/dist/browser/dom-observer.d.ts.map +1 -0
  24. package/dist/browser/dom-observer.js +109 -0
  25. package/dist/browser/dom-observer.js.map +1 -0
  26. package/dist/browser/editor/editor-api.d.ts +67 -0
  27. package/dist/browser/editor/editor-api.d.ts.map +1 -0
  28. package/dist/browser/editor/editor-api.js +233 -0
  29. package/dist/browser/editor/editor-api.js.map +1 -0
  30. package/dist/browser/editor/editor-init.d.ts +11 -0
  31. package/dist/browser/editor/editor-init.d.ts.map +1 -0
  32. package/dist/browser/editor/editor-init.js +181 -0
  33. package/dist/browser/editor/editor-init.js.map +1 -0
  34. package/dist/browser/editor/editor-styles.d.ts +6 -0
  35. package/dist/browser/editor/editor-styles.d.ts.map +1 -0
  36. package/dist/browser/editor/editor-styles.js +419 -0
  37. package/dist/browser/editor/editor-styles.js.map +1 -0
  38. package/dist/browser/editor/inspector.d.ts +22 -0
  39. package/dist/browser/editor/inspector.d.ts.map +1 -0
  40. package/dist/browser/editor/inspector.js +125 -0
  41. package/dist/browser/editor/inspector.js.map +1 -0
  42. package/dist/browser/editor/key-resolver.d.ts +19 -0
  43. package/dist/browser/editor/key-resolver.d.ts.map +1 -0
  44. package/dist/browser/editor/key-resolver.js +49 -0
  45. package/dist/browser/editor/key-resolver.js.map +1 -0
  46. package/dist/browser/editor/live-preview.d.ts +10 -0
  47. package/dist/browser/editor/live-preview.d.ts.map +1 -0
  48. package/dist/browser/editor/live-preview.js +57 -0
  49. package/dist/browser/editor/live-preview.js.map +1 -0
  50. package/dist/browser/editor/sidebar.d.ts +50 -0
  51. package/dist/browser/editor/sidebar.d.ts.map +1 -0
  52. package/dist/browser/editor/sidebar.js +353 -0
  53. package/dist/browser/editor/sidebar.js.map +1 -0
  54. package/dist/browser/editor/toolbar.d.ts +29 -0
  55. package/dist/browser/editor/toolbar.d.ts.map +1 -0
  56. package/dist/browser/editor/toolbar.js +131 -0
  57. package/dist/browser/editor/toolbar.js.map +1 -0
  58. package/dist/browser/exclude-filter.d.ts +21 -0
  59. package/dist/browser/exclude-filter.d.ts.map +1 -0
  60. package/dist/browser/exclude-filter.js +51 -0
  61. package/dist/browser/exclude-filter.js.map +1 -0
  62. package/dist/browser/index.d.ts +32 -0
  63. package/dist/browser/index.d.ts.map +1 -0
  64. package/dist/browser/index.js +28 -0
  65. package/dist/browser/index.js.map +1 -0
  66. package/dist/browser/language-switcher.d.ts +70 -0
  67. package/dist/browser/language-switcher.d.ts.map +1 -0
  68. package/dist/browser/language-switcher.js +339 -0
  69. package/dist/browser/language-switcher.js.map +1 -0
  70. package/dist/browser/lionrapid.auto.dev.js +5757 -0
  71. package/dist/browser/lionrapid.auto.dev.js.map +7 -0
  72. package/dist/browser/lionrapid.auto.js +5757 -0
  73. package/dist/browser/lionrapid.auto.js.map +7 -0
  74. package/dist/browser/lionrapid.auto.min.js +80 -0
  75. package/dist/browser/lionrapid.auto.min.js.map +7 -0
  76. package/dist/browser/lionrapid.editor.js +1869 -0
  77. package/dist/browser/lionrapid.editor.js.map +7 -0
  78. package/dist/browser/lionrapid.editor.min.js +415 -0
  79. package/dist/browser/lionrapid.editor.min.js.map +7 -0
  80. package/dist/browser/lionrapid.esm.js +4786 -0
  81. package/dist/browser/lionrapid.esm.js.map +7 -0
  82. package/dist/browser/lionrapid.esm.min.js +3 -0
  83. package/dist/browser/lionrapid.esm.min.js.map +7 -0
  84. package/dist/browser/lionrapid.iife.dev.js +4809 -0
  85. package/dist/browser/lionrapid.iife.dev.js.map +7 -0
  86. package/dist/browser/lionrapid.iife.js +4809 -0
  87. package/dist/browser/lionrapid.iife.js.map +7 -0
  88. package/dist/browser/lionrapid.iife.min.js +3 -0
  89. package/dist/browser/lionrapid.iife.min.js.map +7 -0
  90. package/dist/browser/lionrapid.umd.js +4822 -0
  91. package/dist/browser/lionrapid.umd.js.map +7 -0
  92. package/dist/browser/lionrapid.umd.min.js +18 -0
  93. package/dist/browser/lionrapid.umd.min.js.map +7 -0
  94. package/dist/browser/markup-parser.d.ts +13 -0
  95. package/dist/browser/markup-parser.d.ts.map +1 -0
  96. package/dist/browser/markup-parser.js +56 -0
  97. package/dist/browser/markup-parser.js.map +1 -0
  98. package/dist/browser/md5.d.ts +16 -0
  99. package/dist/browser/md5.d.ts.map +1 -0
  100. package/dist/browser/md5.js +145 -0
  101. package/dist/browser/md5.js.map +1 -0
  102. package/dist/browser/storage/cache-storage-repository.d.ts +44 -0
  103. package/dist/browser/storage/cache-storage-repository.d.ts.map +1 -0
  104. package/dist/browser/storage/cache-storage-repository.js +186 -0
  105. package/dist/browser/storage/cache-storage-repository.js.map +1 -0
  106. package/dist/browser/storage/localstorage-repository.d.ts +51 -0
  107. package/dist/browser/storage/localstorage-repository.d.ts.map +1 -0
  108. package/dist/browser/storage/localstorage-repository.js +270 -0
  109. package/dist/browser/storage/localstorage-repository.js.map +1 -0
  110. package/dist/builder.d.ts +24 -0
  111. package/dist/builder.d.ts.map +1 -0
  112. package/dist/builder.js +169 -0
  113. package/dist/builder.js.map +1 -0
  114. package/dist/cache/CacheManager.d.ts +132 -0
  115. package/dist/cache/CacheManager.d.ts.map +1 -0
  116. package/dist/cache/CacheManager.js +277 -0
  117. package/dist/cache/CacheManager.js.map +1 -0
  118. package/dist/cache/index.d.ts +6 -0
  119. package/dist/cache/index.d.ts.map +1 -0
  120. package/dist/cache/index.js +5 -0
  121. package/dist/cache/index.js.map +1 -0
  122. package/dist/config/index.d.ts +6 -0
  123. package/dist/config/index.d.ts.map +1 -0
  124. package/dist/config/index.js +6 -0
  125. package/dist/config/index.js.map +1 -0
  126. package/dist/config/lionrapid.config.d.ts +12 -0
  127. package/dist/config/lionrapid.config.d.ts.map +1 -0
  128. package/dist/config/lionrapid.config.js +2 -0
  129. package/dist/config/lionrapid.config.js.map +1 -0
  130. package/dist/config/logger.config.d.ts +19 -0
  131. package/dist/config/logger.config.d.ts.map +1 -0
  132. package/dist/config/logger.config.js +9 -0
  133. package/dist/config/logger.config.js.map +1 -0
  134. package/dist/config/repository.config.d.ts +87 -0
  135. package/dist/config/repository.config.d.ts.map +1 -0
  136. package/dist/config/repository.config.js +5 -0
  137. package/dist/config/repository.config.js.map +1 -0
  138. package/dist/content/index.d.ts +20 -0
  139. package/dist/content/index.d.ts.map +1 -0
  140. package/dist/content/index.js +13 -0
  141. package/dist/content/index.js.map +1 -0
  142. package/dist/content/parser/IParser.d.ts +33 -0
  143. package/dist/content/parser/IParser.d.ts.map +1 -0
  144. package/dist/content/parser/IParser.js +6 -0
  145. package/dist/content/parser/IParser.js.map +1 -0
  146. package/dist/content/parser/MarkupParser.d.ts +67 -0
  147. package/dist/content/parser/MarkupParser.d.ts.map +1 -0
  148. package/dist/content/parser/MarkupParser.js +231 -0
  149. package/dist/content/parser/MarkupParser.js.map +1 -0
  150. package/dist/content/serializer/HTMLSerializer.d.ts +61 -0
  151. package/dist/content/serializer/HTMLSerializer.d.ts.map +1 -0
  152. package/dist/content/serializer/HTMLSerializer.js +100 -0
  153. package/dist/content/serializer/HTMLSerializer.js.map +1 -0
  154. package/dist/content/serializer/ISerializer.d.ts +33 -0
  155. package/dist/content/serializer/ISerializer.d.ts.map +1 -0
  156. package/dist/content/serializer/ISerializer.js +6 -0
  157. package/dist/content/serializer/ISerializer.js.map +1 -0
  158. package/dist/content/style-mapper/DefaultStyleMapper.d.ts +59 -0
  159. package/dist/content/style-mapper/DefaultStyleMapper.d.ts.map +1 -0
  160. package/dist/content/style-mapper/DefaultStyleMapper.js +128 -0
  161. package/dist/content/style-mapper/DefaultStyleMapper.js.map +1 -0
  162. package/dist/content/style-mapper/IStyleMapper.d.ts +50 -0
  163. package/dist/content/style-mapper/IStyleMapper.d.ts.map +1 -0
  164. package/dist/content/style-mapper/IStyleMapper.js +6 -0
  165. package/dist/content/style-mapper/IStyleMapper.js.map +1 -0
  166. package/dist/content/types.d.ts +39 -0
  167. package/dist/content/types.d.ts.map +1 -0
  168. package/dist/content/types.js +6 -0
  169. package/dist/content/types.js.map +1 -0
  170. package/dist/content/validator/ContentValidator.d.ts +57 -0
  171. package/dist/content/validator/ContentValidator.d.ts.map +1 -0
  172. package/dist/content/validator/ContentValidator.js +215 -0
  173. package/dist/content/validator/ContentValidator.js.map +1 -0
  174. package/dist/content/validator/IValidator.d.ts +82 -0
  175. package/dist/content/validator/IValidator.d.ts.map +1 -0
  176. package/dist/content/validator/IValidator.js +6 -0
  177. package/dist/content/validator/IValidator.js.map +1 -0
  178. package/dist/errors/translation-errors.d.ts +55 -0
  179. package/dist/errors/translation-errors.d.ts.map +1 -0
  180. package/dist/errors/translation-errors.js +85 -0
  181. package/dist/errors/translation-errors.js.map +1 -0
  182. package/dist/handlers/async-storage-handler.d.ts +77 -0
  183. package/dist/handlers/async-storage-handler.d.ts.map +1 -0
  184. package/dist/handlers/async-storage-handler.js +239 -0
  185. package/dist/handlers/async-storage-handler.js.map +1 -0
  186. package/dist/handlers/handler-chain.d.ts +79 -0
  187. package/dist/handlers/handler-chain.d.ts.map +1 -0
  188. package/dist/handlers/handler-chain.js +366 -0
  189. package/dist/handlers/handler-chain.js.map +1 -0
  190. package/dist/handlers/index.d.ts +7 -0
  191. package/dist/handlers/index.d.ts.map +1 -0
  192. package/dist/handlers/index.js +7 -0
  193. package/dist/handlers/index.js.map +1 -0
  194. package/dist/handlers/network-handler.d.ts +90 -0
  195. package/dist/handlers/network-handler.d.ts.map +1 -0
  196. package/dist/handlers/network-handler.js +283 -0
  197. package/dist/handlers/network-handler.js.map +1 -0
  198. package/dist/handlers/sync-storage-handler.d.ts +88 -0
  199. package/dist/handlers/sync-storage-handler.d.ts.map +1 -0
  200. package/dist/handlers/sync-storage-handler.js +270 -0
  201. package/dist/handlers/sync-storage-handler.js.map +1 -0
  202. package/dist/index.d.ts +37 -0
  203. package/dist/index.d.ts.map +1 -0
  204. package/dist/index.js +30 -0
  205. package/dist/index.js.map +1 -0
  206. package/dist/interfaces/emitter.interface.d.ts +33 -0
  207. package/dist/interfaces/emitter.interface.d.ts.map +1 -0
  208. package/dist/interfaces/emitter.interface.js +2 -0
  209. package/dist/interfaces/emitter.interface.js.map +1 -0
  210. package/dist/interfaces/handler.interface.d.ts +50 -0
  211. package/dist/interfaces/handler.interface.d.ts.map +1 -0
  212. package/dist/interfaces/handler.interface.js +5 -0
  213. package/dist/interfaces/handler.interface.js.map +1 -0
  214. package/dist/interfaces/index.d.ts +8 -0
  215. package/dist/interfaces/index.d.ts.map +1 -0
  216. package/dist/interfaces/index.js +8 -0
  217. package/dist/interfaces/index.js.map +1 -0
  218. package/dist/interfaces/plugin.interface.d.ts +49 -0
  219. package/dist/interfaces/plugin.interface.d.ts.map +1 -0
  220. package/dist/interfaces/plugin.interface.js +6 -0
  221. package/dist/interfaces/plugin.interface.js.map +1 -0
  222. package/dist/interfaces/repository.interface.d.ts +56 -0
  223. package/dist/interfaces/repository.interface.d.ts.map +1 -0
  224. package/dist/interfaces/repository.interface.js +2 -0
  225. package/dist/interfaces/repository.interface.js.map +1 -0
  226. package/dist/lionRapid.d.ts +225 -0
  227. package/dist/lionRapid.d.ts.map +1 -0
  228. package/dist/lionRapid.js +596 -0
  229. package/dist/lionRapid.js.map +1 -0
  230. package/dist/repositories/index.d.ts +3 -0
  231. package/dist/repositories/index.d.ts.map +1 -0
  232. package/dist/repositories/index.js +3 -0
  233. package/dist/repositories/index.js.map +1 -0
  234. package/dist/repositories/memory-repository.d.ts +30 -0
  235. package/dist/repositories/memory-repository.d.ts.map +1 -0
  236. package/dist/repositories/memory-repository.js +100 -0
  237. package/dist/repositories/memory-repository.js.map +1 -0
  238. package/dist/repositories/network-repository.d.ts +138 -0
  239. package/dist/repositories/network-repository.d.ts.map +1 -0
  240. package/dist/repositories/network-repository.js +516 -0
  241. package/dist/repositories/network-repository.js.map +1 -0
  242. package/dist/sync/missing-translation-queue.d.ts +64 -0
  243. package/dist/sync/missing-translation-queue.d.ts.map +1 -0
  244. package/dist/sync/missing-translation-queue.js +184 -0
  245. package/dist/sync/missing-translation-queue.js.map +1 -0
  246. package/dist/types/cache.types.d.ts +62 -0
  247. package/dist/types/cache.types.d.ts.map +1 -0
  248. package/dist/types/cache.types.js +6 -0
  249. package/dist/types/cache.types.js.map +1 -0
  250. package/dist/types/event-payloads.types.d.ts +46 -0
  251. package/dist/types/event-payloads.types.d.ts.map +1 -0
  252. package/dist/types/event-payloads.types.js +6 -0
  253. package/dist/types/event-payloads.types.js.map +1 -0
  254. package/dist/types/generated.types.d.ts +31 -0
  255. package/dist/types/generated.types.d.ts.map +1 -0
  256. package/dist/types/generated.types.js +6 -0
  257. package/dist/types/generated.types.js.map +1 -0
  258. package/dist/types/index.d.ts +7 -0
  259. package/dist/types/index.d.ts.map +1 -0
  260. package/dist/types/index.js +7 -0
  261. package/dist/types/index.js.map +1 -0
  262. package/dist/types/lionRapid.types.d.ts +169 -0
  263. package/dist/types/lionRapid.types.d.ts.map +1 -0
  264. package/dist/types/lionRapid.types.js +8 -0
  265. package/dist/types/lionRapid.types.js.map +1 -0
  266. package/dist/types/parameters.types.d.ts +36 -0
  267. package/dist/types/parameters.types.d.ts.map +1 -0
  268. package/dist/types/parameters.types.js +6 -0
  269. package/dist/types/parameters.types.js.map +1 -0
  270. package/dist/types/translation-data.types.d.ts +54 -0
  271. package/dist/types/translation-data.types.d.ts.map +1 -0
  272. package/dist/types/translation-data.types.js +6 -0
  273. package/dist/types/translation-data.types.js.map +1 -0
  274. package/dist/types/translation.types.d.ts +94 -0
  275. package/dist/types/translation.types.d.ts.map +1 -0
  276. package/dist/types/translation.types.js +5 -0
  277. package/dist/types/translation.types.js.map +1 -0
  278. package/dist/utils/context-utils.d.ts +23 -0
  279. package/dist/utils/context-utils.d.ts.map +1 -0
  280. package/dist/utils/context-utils.js +36 -0
  281. package/dist/utils/context-utils.js.map +1 -0
  282. package/dist/utils/index.d.ts +10 -0
  283. package/dist/utils/index.d.ts.map +1 -0
  284. package/dist/utils/index.js +19 -0
  285. package/dist/utils/index.js.map +1 -0
  286. package/dist/utils/logger.d.ts +229 -0
  287. package/dist/utils/logger.d.ts.map +1 -0
  288. package/dist/utils/logger.js +345 -0
  289. package/dist/utils/logger.js.map +1 -0
  290. package/dist/utils/namespace-utils.d.ts +30 -0
  291. package/dist/utils/namespace-utils.d.ts.map +1 -0
  292. package/dist/utils/namespace-utils.js +56 -0
  293. package/dist/utils/namespace-utils.js.map +1 -0
  294. package/dist/utils/translation-flow.d.ts +18 -0
  295. package/dist/utils/translation-flow.d.ts.map +1 -0
  296. package/dist/utils/translation-flow.js +74 -0
  297. package/dist/utils/translation-flow.js.map +1 -0
  298. package/dist/utils/translation-value-utils.d.ts +57 -0
  299. package/dist/utils/translation-value-utils.d.ts.map +1 -0
  300. package/dist/utils/translation-value-utils.js +194 -0
  301. package/dist/utils/translation-value-utils.js.map +1 -0
  302. package/package.json +76 -0
@@ -0,0 +1,277 @@
1
+ /**
2
+ * CacheManager - TanStack Query-inspired cache management
3
+ *
4
+ * Provides unified cache invalidation and optimistic update patterns.
5
+ */
6
+ /**
7
+ * CacheManager - Unified cache API inspired by TanStack Query
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // Invalidate by namespace
12
+ * await i18n.cache.invalidate({ namespace: 'app' });
13
+ *
14
+ * // Optimistic update
15
+ * const previous = i18n.cache.get('en:app:welcome');
16
+ * i18n.cache.set('en:app:welcome', 'New value');
17
+ * // ... if error, rollback:
18
+ * i18n.cache.set('en:app:welcome', previous.value);
19
+ * ```
20
+ */
21
+ export class CacheManager {
22
+ handlerChain;
23
+ bus;
24
+ currentLocale;
25
+ loadNamespaces;
26
+ constructor(handlerChain, bus, getCurrentLocale, loadNamespaces) {
27
+ this.handlerChain = handlerChain;
28
+ this.bus = bus;
29
+ this.currentLocale = getCurrentLocale;
30
+ this.loadNamespaces = loadNamespaces;
31
+ }
32
+ /**
33
+ * Get a cached translation entry
34
+ *
35
+ * @param key - Full cache key (e.g., 'en:app:welcome')
36
+ * @returns Cache entry with value and styles, or null if not found
37
+ */
38
+ get(key) {
39
+ const entries = this.handlerChain.getEntries();
40
+ // Search through all handler entries
41
+ for (const handlerName in entries) {
42
+ const handlerEntries = entries[handlerName];
43
+ if (handlerEntries && typeof handlerEntries === 'object') {
44
+ if (key in handlerEntries) {
45
+ const rawValue = handlerEntries[key];
46
+ // Parse ContentUnit JSON (stored as { text, styles })
47
+ try {
48
+ if (typeof rawValue === 'string') {
49
+ const parsed = JSON.parse(rawValue);
50
+ if (typeof parsed === 'object' && 'text' in parsed) {
51
+ return {
52
+ value: String(parsed.text),
53
+ styles: parsed.styles || undefined,
54
+ };
55
+ }
56
+ // Legacy plain string
57
+ return { value: rawValue, styles: undefined };
58
+ }
59
+ // Already an object
60
+ return {
61
+ value: JSON.stringify(rawValue),
62
+ styles: undefined,
63
+ };
64
+ }
65
+ catch {
66
+ // If parse fails, treat as plain string
67
+ return {
68
+ value: typeof rawValue === 'string' ? rawValue : JSON.stringify(rawValue),
69
+ styles: undefined,
70
+ };
71
+ }
72
+ }
73
+ }
74
+ }
75
+ return null;
76
+ }
77
+ /**
78
+ * Set a cache entry (for optimistic updates)
79
+ *
80
+ * @param key - Full cache key (e.g., 'en:app:welcome')
81
+ * @param value - Translation value
82
+ * @param styles - Optional styles for indexed tags
83
+ */
84
+ set(key, value, styles) {
85
+ // Parse the key to get locale, namespace, and translation key
86
+ const [locale, namespace, ...keyParts] = key.split(':');
87
+ const translationKey = keyParts.join(':');
88
+ if (!locale || !namespace || !translationKey) {
89
+ throw new Error(`Invalid cache key format: "${key}". Expected format: "locale:namespace:key"`);
90
+ }
91
+ // Use the handler chain's setCache method for optimistic updates
92
+ this.handlerChain.setCache(key, value, styles);
93
+ // Emit cache:set event
94
+ this.bus.emit('cache:set', {
95
+ payload: {
96
+ key,
97
+ value,
98
+ styles,
99
+ optimistic: true,
100
+ },
101
+ });
102
+ }
103
+ /**
104
+ * Check if a key exists in cache
105
+ *
106
+ * @param key - Full cache key (e.g., 'en:app:welcome')
107
+ * @returns true if key is cached
108
+ */
109
+ has(key) {
110
+ return this.get(key) !== null;
111
+ }
112
+ /**
113
+ * Invalidate cache entries and optionally refetch
114
+ *
115
+ * Like TanStack Query's invalidateQueries, this clears matching cache entries
116
+ * and triggers background refetch by default.
117
+ *
118
+ * @param options - Filter options for invalidation
119
+ *
120
+ * @example
121
+ * ```typescript
122
+ * // Invalidate all
123
+ * await cache.invalidate();
124
+ *
125
+ * // Invalidate by namespace
126
+ * await cache.invalidate({ namespace: 'app' });
127
+ *
128
+ * // Invalidate by locale
129
+ * await cache.invalidate({ locale: 'es' });
130
+ *
131
+ * // Invalidate specific key
132
+ * await cache.invalidate({ key: 'en:app:welcome' });
133
+ *
134
+ * // Invalidate with predicate
135
+ * await cache.invalidate({ predicate: (k) => k.includes('common:') });
136
+ *
137
+ * // Invalidate without refetch
138
+ * await cache.invalidate({ namespace: 'app', refetch: false });
139
+ * ```
140
+ */
141
+ async invalidate(options = {}) {
142
+ const { namespace, locale, key, predicate, refetch = true } = options;
143
+ const currentLocale = this.currentLocale();
144
+ let keysCleared = 0;
145
+ // Determine what to clear
146
+ if (key) {
147
+ // Clear specific key
148
+ const [keyLocale, keyNamespace] = key.split(':');
149
+ if (keyLocale && keyNamespace) {
150
+ this.handlerChain.clearNamespace(keyLocale, keyNamespace);
151
+ keysCleared = 1;
152
+ }
153
+ }
154
+ else if (namespace && locale) {
155
+ // Clear specific locale + namespace
156
+ this.handlerChain.clearNamespace(locale, namespace);
157
+ keysCleared = this.countClearedKeys(locale, namespace);
158
+ }
159
+ else if (namespace) {
160
+ // Clear namespace for current locale
161
+ this.handlerChain.clearNamespace(currentLocale, namespace);
162
+ keysCleared = this.countClearedKeys(currentLocale, namespace);
163
+ }
164
+ else if (locale) {
165
+ // Clear all namespaces for a specific locale
166
+ const entries = this.handlerChain.getEntries();
167
+ const namespacesToClear = new Set();
168
+ for (const handlerName in entries) {
169
+ const handlerEntries = entries[handlerName];
170
+ if (handlerEntries && typeof handlerEntries === 'object') {
171
+ for (const entryKey of Object.keys(handlerEntries)) {
172
+ if (entryKey.startsWith(`${locale}:`) || entryKey.startsWith(`@${locale}:`)) {
173
+ const parts = entryKey.replace('@', '').split(':');
174
+ if (parts[1]) {
175
+ namespacesToClear.add(parts[1]);
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ for (const ns of namespacesToClear) {
182
+ this.handlerChain.clearNamespace(locale, ns);
183
+ keysCleared++;
184
+ }
185
+ }
186
+ else if (predicate) {
187
+ // Clear with custom predicate
188
+ const entries = this.handlerChain.getEntries();
189
+ const toClear = new Map(); // locale -> namespaces
190
+ for (const handlerName in entries) {
191
+ const handlerEntries = entries[handlerName];
192
+ if (handlerEntries && typeof handlerEntries === 'object') {
193
+ for (const entryKey of Object.keys(handlerEntries)) {
194
+ if (predicate(entryKey)) {
195
+ const parts = entryKey.replace('@', '').split(':');
196
+ const entryLocale = parts[0];
197
+ const entryNs = parts[1];
198
+ if (entryLocale && entryNs) {
199
+ if (!toClear.has(entryLocale)) {
200
+ toClear.set(entryLocale, new Set());
201
+ }
202
+ toClear.get(entryLocale).add(entryNs);
203
+ keysCleared++;
204
+ }
205
+ }
206
+ }
207
+ }
208
+ }
209
+ for (const [loc, namespaces] of toClear) {
210
+ for (const ns of namespaces) {
211
+ this.handlerChain.clearNamespace(loc, ns);
212
+ }
213
+ }
214
+ }
215
+ else {
216
+ // Clear all
217
+ this.handlerChain.clearCache();
218
+ keysCleared = -1; // Indicates all cleared
219
+ }
220
+ // Emit invalidate event
221
+ this.bus.emit('cache:invalidate', {
222
+ payload: {
223
+ filter: options,
224
+ keysCleared,
225
+ refetch,
226
+ },
227
+ });
228
+ // Refetch if requested
229
+ if (refetch) {
230
+ await this.refetchAfterInvalidate(options);
231
+ }
232
+ }
233
+ /**
234
+ * Count keys that would be cleared (for event reporting)
235
+ */
236
+ countClearedKeys(locale, namespace) {
237
+ const entries = this.handlerChain.getEntries();
238
+ let count = 0;
239
+ const prefix = `${locale}:${namespace}:`;
240
+ const namespaceKey = `@${locale}:${namespace}`;
241
+ for (const handlerName in entries) {
242
+ const handlerEntries = entries[handlerName];
243
+ if (handlerEntries && typeof handlerEntries === 'object') {
244
+ for (const key of Object.keys(handlerEntries)) {
245
+ if (key.startsWith(prefix) || key === namespaceKey) {
246
+ count++;
247
+ }
248
+ }
249
+ }
250
+ }
251
+ return count;
252
+ }
253
+ /**
254
+ * Refetch data after invalidation
255
+ */
256
+ async refetchAfterInvalidate(options) {
257
+ const { namespace, locale, key } = options;
258
+ const currentLocale = this.currentLocale();
259
+ if (key) {
260
+ // Refetch specific namespace from key
261
+ const [keyLocale, keyNamespace] = key.split(':');
262
+ if (keyLocale && keyNamespace) {
263
+ await this.loadNamespaces(keyLocale, [keyNamespace]);
264
+ }
265
+ }
266
+ else if (namespace) {
267
+ // Refetch namespace for specific or current locale
268
+ await this.loadNamespaces(locale || currentLocale, [namespace]);
269
+ }
270
+ else if (locale) {
271
+ // For locale-wide invalidation, we can't easily know which namespaces to reload
272
+ // The app will lazy-load them as needed
273
+ }
274
+ // For full cache clear, lazy loading will handle refetch
275
+ }
276
+ }
277
+ //# sourceMappingURL=CacheManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheManager.js","sourceRoot":"","sources":["../../src/cache/CacheManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkDH;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,YAAY;IACf,YAAY,CAAe;IAC3B,GAAG,CAAe;IAClB,aAAa,CAAe;IAC5B,cAAc,CAA0D;IAEhF,YACE,YAA0B,EAC1B,GAAiB,EACjB,gBAA8B,EAC9B,cAAuE;QAEvE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,gBAAgB,CAAC;QACtC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,GAAW;QACb,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;QAE/C,qCAAqC;QACrC,KAAK,MAAM,WAAW,IAAI,OAAO,EAAE,CAAC;YAClC,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;gBACzD,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;oBAC1B,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;oBAErC,sDAAsD;oBACtD,IAAI,CAAC;wBACH,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;4BACjC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;4BACpC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI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,GAAG,EAAE,CAAC;YACR,sCAAsC;YACtC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACjD,IAAI,SAAS,IAAI,YAAY,EAAE,CAAC;gBAC9B,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;aAAM,IAAI,SAAS,EAAE,CAAC;YACrB,mDAAmD;YACnD,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,IAAI,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QAClE,CAAC;aAAM,IAAI,MAAM,EAAE,CAAC;YAClB,gFAAgF;YAChF,wCAAwC;QAC1C,CAAC;QACD,yDAAyD;IAC3D,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Cache module exports
3
+ */
4
+ export { CacheManager } from './CacheManager.js';
5
+ export type { CacheEntry as CacheManagerEntry, CacheEventPayloads, InvalidateOptions, } from './CacheManager.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EACV,UAAU,IAAI,iBAAiB,EAC/B,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Cache module exports
3
+ */
4
+ export { CacheManager } from './CacheManager.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * All configuration exports
3
+ */
4
+ export * from './lionrapid.config.js';
5
+ export * from './repository.config.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * All configuration exports
3
+ */
4
+ export * from './lionrapid.config.js';
5
+ export * from './repository.config.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Core LionRapid configuration - only built-in features
3
+ */
4
+ export interface LionRapidCoreConfig {
5
+ defaultLocale?: string;
6
+ fallbackLocale?: string;
7
+ namespace?: string;
8
+ debugMode?: boolean;
9
+ maxRetries?: number;
10
+ options?: Record<string, unknown>;
11
+ }
12
+ //# sourceMappingURL=lionrapid.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lionrapid.config.d.ts","sourceRoot":"","sources":["../../src/config/lionrapid.config.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=lionrapid.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lionrapid.config.js","sourceRoot":"","sources":["../../src/config/lionrapid.config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ export declare enum LogLevel {
2
+ DEBUG = 0,
3
+ INFO = 1,
4
+ WARN = 2,
5
+ ERROR = 3,
6
+ NONE = 4
7
+ }
8
+ export interface LoggerConfig {
9
+ level?: LogLevel;
10
+ enabled?: boolean;
11
+ prefix?: string;
12
+ showLineNumbers?: boolean;
13
+ useColors?: boolean;
14
+ }
15
+ export interface PackageLoggerConfig extends LoggerConfig {
16
+ packageName?: string;
17
+ packageEmoji?: string;
18
+ }
19
+ //# sourceMappingURL=logger.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.config.d.ts","sourceRoot":"","sources":["../../src/config/logger.config.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;IACT,IAAI,IAAI;CACT;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,9 @@
1
+ export var LogLevel;
2
+ (function (LogLevel) {
3
+ LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
4
+ LogLevel[LogLevel["INFO"] = 1] = "INFO";
5
+ LogLevel[LogLevel["WARN"] = 2] = "WARN";
6
+ LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
7
+ LogLevel[LogLevel["NONE"] = 4] = "NONE";
8
+ })(LogLevel || (LogLevel = {}));
9
+ //# sourceMappingURL=logger.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.config.js","sourceRoot":"","sources":["../../src/config/logger.config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAQ,CAAA;AACV,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Handler configuration types
3
+ */
4
+ /**
5
+ * Base configuration for all handlers
6
+ */
7
+ /**
8
+ * Memory handler specific configuration
9
+ */
10
+ export interface MemoryRepositoryConfig {
11
+ enabled?: boolean;
12
+ priority?: number;
13
+ options?: {
14
+ /** Maximum number of translations to cache */
15
+ maxSize?: number;
16
+ /** TTL for cache entries in milliseconds */
17
+ ttl?: number;
18
+ [key: string]: unknown;
19
+ };
20
+ }
21
+ export interface StorageRepositoryConfig {
22
+ enabled?: boolean;
23
+ priority?: number;
24
+ options?: {
25
+ prefix?: string;
26
+ persistent?: boolean;
27
+ ttl?: number;
28
+ priority?: number;
29
+ [key: string]: unknown;
30
+ };
31
+ }
32
+ export interface PreloadNamespaces {
33
+ locale: string;
34
+ namespace: string;
35
+ eager?: boolean;
36
+ }
37
+ /**
38
+ * Missing translation sync configuration
39
+ */
40
+ export interface SyncMissingConfig {
41
+ /** Enable automatic syncing of missing translations */
42
+ enabled: boolean;
43
+ /** Debounce delay in milliseconds before syncing (default: 500) */
44
+ debounceMs: number;
45
+ /** Maximum batch size before forcing immediate flush (default: 50) */
46
+ batchSize: number;
47
+ }
48
+ /**
49
+ * Network Repository endpoint configuration
50
+ * Supports placeholder syntax: :key, :locale, :namespace
51
+ */
52
+ export interface NetworkEndpoints {
53
+ /** GET single translation - default: '/api/integrations/translations/:key' */
54
+ getTranslation?: string;
55
+ /** GET namespace translations - default: '/api/integrations/translations/:locale/:namespace' */
56
+ getNamespace?: string;
57
+ /** PUT single translation - default: '/api/integrations/sync/:key' */
58
+ setTranslation?: string;
59
+ /** PUT namespace translations - default: '/api/integrations/sync/:locale/:namespace' */
60
+ setNamespace?: string;
61
+ /** POST batch translations - default: '/api/integrations/sync/batch' */
62
+ setBatch?: string;
63
+ /** DELETE single translation - default: '/api/integrations/sync/:key' */
64
+ removeTranslation?: string;
65
+ /** DELETE all translations - default: '/translations' */
66
+ clearTranslations?: string;
67
+ }
68
+ /**
69
+ * Network Repository specific configuration
70
+ */
71
+ export interface NetworkRepositoryConfig {
72
+ enabled?: boolean;
73
+ priority?: number;
74
+ options?: {
75
+ baseUrl: string;
76
+ timeout?: number;
77
+ retries?: number;
78
+ retryDelay?: number;
79
+ headers?: Record<string, string>;
80
+ apiKey?: string;
81
+ endpoints?: NetworkEndpoints;
82
+ preloadNamespaces?: Array<PreloadNamespaces>;
83
+ syncMissing?: SyncMissingConfig;
84
+ [key: string]: unknown;
85
+ };
86
+ }
87
+ //# sourceMappingURL=repository.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.config.d.ts","sourceRoot":"","sources":["../../src/config/repository.config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AASH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE;QACR,8CAA8C;QAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,4CAA4C;QAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;QAEb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,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AAC;QAGhB,SAAS,CAAC,EAAE,gBAAgB,CAAC;QAG7B,iBAAiB,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAG7C,WAAW,CAAC,EAAE,iBAAiB,CAAC;QAGhC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Handler configuration types
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=repository.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.config.js","sourceRoot":"","sources":["../../src/config/repository.config.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Content module - Unified Content Architecture for LionRapid
3
+ *
4
+ * Provides types, interfaces, and utilities for handling styled content
5
+ * with indexed tags and ICU MessageFormat support.
6
+ *
7
+ * @module content
8
+ */
9
+ export type { ContentUnit } from './types.js';
10
+ export type { IParser } from './parser/IParser.js';
11
+ export { MarkupParser } from './parser/MarkupParser.js';
12
+ export type { MarkupParserOptions } from './parser/MarkupParser.js';
13
+ export type { ISerializer } from './serializer/ISerializer.js';
14
+ export { HTMLSerializer } from './serializer/HTMLSerializer.js';
15
+ export type { HTMLSerializerOptions } from './serializer/HTMLSerializer.js';
16
+ export type { IValidator, ValidationResult, ValidationError, ValidationWarning, ValidationErrorCode, ValidationWarningCode, } from './validator/IValidator.js';
17
+ export { ContentValidator } from './validator/ContentValidator.js';
18
+ export type { IStyleMapper, ElementMapping } from './style-mapper/IStyleMapper.js';
19
+ export { DefaultStyleMapper } from './style-mapper/DefaultStyleMapper.js';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/content/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpE,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,YAAY,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAG5E,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Content module - Unified Content Architecture for LionRapid
3
+ *
4
+ * Provides types, interfaces, and utilities for handling styled content
5
+ * with indexed tags and ICU MessageFormat support.
6
+ *
7
+ * @module content
8
+ */
9
+ export { MarkupParser } from './parser/MarkupParser.js';
10
+ export { HTMLSerializer } from './serializer/HTMLSerializer.js';
11
+ export { ContentValidator } from './validator/ContentValidator.js';
12
+ export { DefaultStyleMapper } from './style-mapper/DefaultStyleMapper.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/content/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKxD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAYhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Parser interface for converting platform-specific input to ContentUnit
3
+ * @module content/parser/IParser
4
+ */
5
+ import type { ContentUnit } from '../types.js';
6
+ /**
7
+ * Generic parser interface
8
+ *
9
+ * Implementations:
10
+ * - MarkupParser: HTML string → ContentUnit (core)
11
+ * - JSXParser: ReactNode → ContentUnit (react package)
12
+ *
13
+ * @typeParam TInput - Platform-specific input type
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * class MarkupParser implements IParser<string> {
18
+ * parse(html: string): ContentUnit {
19
+ * // Convert <b>, <a>, etc. to indexed tags
20
+ * }
21
+ * }
22
+ * ```
23
+ */
24
+ export interface IParser<TInput> {
25
+ /**
26
+ * Parse input into ContentUnit
27
+ *
28
+ * @param input - Platform-specific input (string, ReactNode, etc.)
29
+ * @returns Normalized ContentUnit with indexed tags and styles
30
+ */
31
+ parse(input: TInput): ContentUnit;
32
+ }
33
+ //# sourceMappingURL=IParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IParser.d.ts","sourceRoot":"","sources":["../../../src/content/parser/IParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,OAAO,CAAC,MAAM;IAC7B;;;;;OAKG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC;CACnC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Parser interface for converting platform-specific input to ContentUnit
3
+ * @module content/parser/IParser
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=IParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IParser.js","sourceRoot":"","sources":["../../../src/content/parser/IParser.ts"],"names":[],"mappings":"AAAA;;;GAGG"}