hermium 0.1.9 → 0.2.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 (209) hide show
  1. package/README.md +56 -0
  2. package/bin/hermium.mjs +185 -164
  3. package/dist/api.mjs +3513 -0
  4. package/dist/public/assets/css/index-Dfs9RUU9.css +1 -0
  5. package/dist/public/assets/css/styles-B8p6jk5Z.css +1 -0
  6. package/dist/public/assets/js/ChatInputBlock-Bw7AL70H.js +1 -0
  7. package/dist/public/assets/js/MarkdownMessage-8d7Y6VL-.js +1 -0
  8. package/dist/public/assets/js/base-ui-BvQbAt_1.js +1 -0
  9. package/dist/public/assets/js/chat._sessionId-BG6lVraH.js +1 -0
  10. package/dist/public/assets/js/chat.index-D2zdMPTT.js +1 -0
  11. package/dist/public/assets/js/index-C0AK45FU.js +60 -0
  12. package/dist/public/assets/js/index-Cx5En4FK.js +1 -0
  13. package/dist/public/assets/js/memory-CeSRdTkW.js +3 -0
  14. package/dist/public/assets/js/router-8uDKazL-.js +1 -0
  15. package/dist/public/assets/js/settings-Bc3Y5zXO.js +1 -0
  16. package/dist/public/assets/js/skills-DZv7sA_5.js +1 -0
  17. package/dist/public/assets/js/theme-CPkdkpaj.js +1 -0
  18. package/dist/public/assets/js/usage-DXQsT9_b.js +1 -0
  19. package/dist/public/assets/woff2/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  20. package/dist/public/assets/woff2/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  21. package/dist/public/assets/woff2/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  22. package/dist/public/assets/woff2/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  23. package/dist/public/assets/woff2/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  24. package/dist/public/favicon.ico +0 -0
  25. package/dist/public/logo.png +0 -0
  26. package/package.json +1 -1
  27. package/dist/public/assets/IconAlertCircle-BHkmI3j7.js +0 -1
  28. package/dist/public/assets/IconAlertTriangle-wCJudlVg.js +0 -1
  29. package/dist/public/assets/IconCheck-CFuEh_p7.js +0 -1
  30. package/dist/public/assets/IconLoader2-BIx3OuF9.js +0 -1
  31. package/dist/public/assets/IconRefresh-Dgm93w3T.js +0 -1
  32. package/dist/public/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  33. package/dist/public/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  34. package/dist/public/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  35. package/dist/public/assets/index-Bbz3abmO.js +0 -14
  36. package/dist/public/assets/index-CWUaRwcE.js +0 -1
  37. package/dist/public/assets/index-CinLq3cd.js +0 -1
  38. package/dist/public/assets/index-CrQs9n6q.js +0 -29
  39. package/dist/public/assets/index-CtacpN3I.js +0 -1
  40. package/dist/public/assets/index-DY7aE-9s.js +0 -2
  41. package/dist/public/assets/index-DkYGodJj.js +0 -94
  42. package/dist/public/assets/index-DvDLadUx.js +0 -1
  43. package/dist/public/assets/index-U6RcWedt.js +0 -1
  44. package/dist/public/assets/index-_6iFZ0fh.js +0 -1
  45. package/dist/public/assets/index-enFS26SU.js +0 -1
  46. package/dist/public/assets/input-eNcwlDHp.js +0 -1
  47. package/dist/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  48. package/dist/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  49. package/dist/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  50. package/dist/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  51. package/dist/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  52. package/dist/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  53. package/dist/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  54. package/dist/public/assets/queries-iHRgZzw2.js +0 -1
  55. package/dist/public/assets/styles-KcflDlA_.css +0 -1
  56. package/dist/public/assets/switch-B1DcZLwL.js +0 -1
  57. package/dist/public/assets/syntax-highlighter-DWPF-A_h.js +0 -6
  58. package/dist/public/assets/textarea-Di_syYTS.js +0 -1
  59. package/dist/public/favicon.png +0 -0
  60. package/dist/public/nous-logo.png +0 -0
  61. package/dist/server/index.mjs +0 -244
  62. package/dist/web-server/__23tanstack-start-plugin-adapters-Cwee5PKy.mjs +0 -6
  63. package/dist/web-server/_chunks/ssr-renderer.mjs +0 -22
  64. package/dist/web-server/_libs/babel__runtime.mjs +0 -237
  65. package/dist/web-server/_libs/bail.mjs +0 -8
  66. package/dist/web-server/_libs/base-ui__react.mjs +0 -9554
  67. package/dist/web-server/_libs/base-ui__utils.mjs +0 -1101
  68. package/dist/web-server/_libs/ccount.mjs +0 -16
  69. package/dist/web-server/_libs/character-entities-legacy.mjs +0 -111
  70. package/dist/web-server/_libs/character-entities.mjs +0 -2130
  71. package/dist/web-server/_libs/character-reference-invalid.mjs +0 -33
  72. package/dist/web-server/_libs/class-variance-authority.mjs +0 -44
  73. package/dist/web-server/_libs/clsx.mjs +0 -16
  74. package/dist/web-server/_libs/comma-separated-tokens.mjs +0 -31
  75. package/dist/web-server/_libs/cookie-es.mjs +0 -44
  76. package/dist/web-server/_libs/croner.mjs +0 -1
  77. package/dist/web-server/_libs/crossws.mjs +0 -1
  78. package/dist/web-server/_libs/decode-named-character-reference+[...].mjs +0 -8
  79. package/dist/web-server/_libs/devlop.mjs +0 -8
  80. package/dist/web-server/_libs/escape-string-regexp.mjs +0 -9
  81. package/dist/web-server/_libs/estree-util-is-identifier-name.mjs +0 -11
  82. package/dist/web-server/_libs/extend.mjs +0 -97
  83. package/dist/web-server/_libs/fault.mjs +0 -1
  84. package/dist/web-server/_libs/floating-ui__core.mjs +0 -663
  85. package/dist/web-server/_libs/floating-ui__dom.mjs +0 -624
  86. package/dist/web-server/_libs/floating-ui__react-dom.mjs +0 -279
  87. package/dist/web-server/_libs/floating-ui__utils.mjs +0 -322
  88. package/dist/web-server/_libs/format.mjs +0 -1
  89. package/dist/web-server/_libs/h3.mjs +0 -408
  90. package/dist/web-server/_libs/hast-util-parse-selector.mjs +0 -39
  91. package/dist/web-server/_libs/hast-util-to-jsx-runtime.mjs +0 -388
  92. package/dist/web-server/_libs/hast-util-whitespace.mjs +0 -10
  93. package/dist/web-server/_libs/hastscript.mjs +0 -200
  94. package/dist/web-server/_libs/highlight.js.mjs +0 -1
  95. package/dist/web-server/_libs/hookable.mjs +0 -1
  96. package/dist/web-server/_libs/html-url-attributes.mjs +0 -26
  97. package/dist/web-server/_libs/inline-style-parser.mjs +0 -142
  98. package/dist/web-server/_libs/is-alphabetical.mjs +0 -7
  99. package/dist/web-server/_libs/is-alphanumerical.mjs +0 -8
  100. package/dist/web-server/_libs/is-decimal.mjs +0 -7
  101. package/dist/web-server/_libs/is-hexadecimal.mjs +0 -7
  102. package/dist/web-server/_libs/is-plain-obj.mjs +0 -10
  103. package/dist/web-server/_libs/isbot.mjs +0 -21
  104. package/dist/web-server/_libs/longest-streak.mjs +0 -25
  105. package/dist/web-server/_libs/lowlight.mjs +0 -1
  106. package/dist/web-server/_libs/markdown-table.mjs +0 -142
  107. package/dist/web-server/_libs/mdast-util-find-and-replace.mjs +0 -109
  108. package/dist/web-server/_libs/mdast-util-from-markdown.mjs +0 -717
  109. package/dist/web-server/_libs/mdast-util-gfm-autolink-literal+[...].mjs +0 -156
  110. package/dist/web-server/_libs/mdast-util-gfm-footnote.mjs +0 -117
  111. package/dist/web-server/_libs/mdast-util-gfm-strikethrough.mjs +0 -54
  112. package/dist/web-server/_libs/mdast-util-gfm-table.mjs +0 -157
  113. package/dist/web-server/_libs/mdast-util-gfm-task-list-item.mjs +0 -77
  114. package/dist/web-server/_libs/mdast-util-gfm.mjs +0 -29
  115. package/dist/web-server/_libs/mdast-util-phrasing.mjs +0 -30
  116. package/dist/web-server/_libs/mdast-util-to-hast.mjs +0 -710
  117. package/dist/web-server/_libs/mdast-util-to-markdown.mjs +0 -798
  118. package/dist/web-server/_libs/mdast-util-to-string.mjs +0 -38
  119. package/dist/web-server/_libs/micromark-core-commonmark.mjs +0 -2259
  120. package/dist/web-server/_libs/micromark-extension-gfm-autolink-literal+[...].mjs +0 -344
  121. package/dist/web-server/_libs/micromark-extension-gfm-footnote+[...].mjs +0 -279
  122. package/dist/web-server/_libs/micromark-extension-gfm-strikethrough+[...].mjs +0 -98
  123. package/dist/web-server/_libs/micromark-extension-gfm-table.mjs +0 -491
  124. package/dist/web-server/_libs/micromark-extension-gfm-tagfilter+[...].mjs +0 -1
  125. package/dist/web-server/_libs/micromark-extension-gfm-task-list-item+[...].mjs +0 -77
  126. package/dist/web-server/_libs/micromark-extension-gfm.mjs +0 -18
  127. package/dist/web-server/_libs/micromark-factory-destination.mjs +0 -94
  128. package/dist/web-server/_libs/micromark-factory-label.mjs +0 -63
  129. package/dist/web-server/_libs/micromark-factory-space.mjs +0 -24
  130. package/dist/web-server/_libs/micromark-factory-title.mjs +0 -65
  131. package/dist/web-server/_libs/micromark-factory-whitespace.mjs +0 -22
  132. package/dist/web-server/_libs/micromark-util-character.mjs +0 -44
  133. package/dist/web-server/_libs/micromark-util-chunked.mjs +0 -36
  134. package/dist/web-server/_libs/micromark-util-classify-character+[...].mjs +0 -12
  135. package/dist/web-server/_libs/micromark-util-combine-extensions+[...].mjs +0 -41
  136. package/dist/web-server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +0 -19
  137. package/dist/web-server/_libs/micromark-util-decode-string.mjs +0 -21
  138. package/dist/web-server/_libs/micromark-util-encode.mjs +0 -1
  139. package/dist/web-server/_libs/micromark-util-html-tag-name.mjs +0 -69
  140. package/dist/web-server/_libs/micromark-util-normalize-identifier+[...].mjs +0 -6
  141. package/dist/web-server/_libs/micromark-util-resolve-all.mjs +0 -15
  142. package/dist/web-server/_libs/micromark-util-sanitize-uri.mjs +0 -41
  143. package/dist/web-server/_libs/micromark-util-subtokenize.mjs +0 -346
  144. package/dist/web-server/_libs/micromark.mjs +0 -906
  145. package/dist/web-server/_libs/ocache.mjs +0 -1
  146. package/dist/web-server/_libs/ohash.mjs +0 -1
  147. package/dist/web-server/_libs/parse-entities.mjs +0 -245
  148. package/dist/web-server/_libs/property-information.mjs +0 -1210
  149. package/dist/web-server/_libs/react-dom.mjs +0 -10779
  150. package/dist/web-server/_libs/react-markdown.mjs +0 -147
  151. package/dist/web-server/_libs/react-syntax-highlighter.mjs +0 -941
  152. package/dist/web-server/_libs/react.mjs +0 -513
  153. package/dist/web-server/_libs/refractor.mjs +0 -2425
  154. package/dist/web-server/_libs/remark-gfm.mjs +0 -20
  155. package/dist/web-server/_libs/remark-parse.mjs +0 -19
  156. package/dist/web-server/_libs/remark-rehype.mjs +0 -21
  157. package/dist/web-server/_libs/reselect.mjs +0 -1
  158. package/dist/web-server/_libs/rou3.mjs +0 -8
  159. package/dist/web-server/_libs/seroval-plugins.mjs +0 -58
  160. package/dist/web-server/_libs/seroval.mjs +0 -1775
  161. package/dist/web-server/_libs/space-separated-tokens.mjs +0 -11
  162. package/dist/web-server/_libs/srvx.mjs +0 -781
  163. package/dist/web-server/_libs/style-to-js.mjs +0 -72
  164. package/dist/web-server/_libs/style-to-object.mjs +0 -38
  165. package/dist/web-server/_libs/tabler__icons-react.mjs +0 -230
  166. package/dist/web-server/_libs/tanstack__history.mjs +0 -204
  167. package/dist/web-server/_libs/tanstack__query-core.mjs +0 -2552
  168. package/dist/web-server/_libs/tanstack__react-query.mjs +0 -190
  169. package/dist/web-server/_libs/tanstack__react-router.mjs +0 -1120
  170. package/dist/web-server/_libs/tanstack__react-store.mjs +0 -2
  171. package/dist/web-server/_libs/tanstack__router-core.mjs +0 -4288
  172. package/dist/web-server/_libs/tanstack__store.mjs +0 -1
  173. package/dist/web-server/_libs/trim-lines.mjs +0 -41
  174. package/dist/web-server/_libs/trough.mjs +0 -85
  175. package/dist/web-server/_libs/ufo.mjs +0 -54
  176. package/dist/web-server/_libs/unctx.mjs +0 -1
  177. package/dist/web-server/_libs/ungap__structured-clone.mjs +0 -224
  178. package/dist/web-server/_libs/unified.mjs +0 -661
  179. package/dist/web-server/_libs/unist-util-is.mjs +0 -100
  180. package/dist/web-server/_libs/unist-util-position.mjs +0 -27
  181. package/dist/web-server/_libs/unist-util-stringify-position.mjs +0 -27
  182. package/dist/web-server/_libs/unist-util-visit-parents.mjs +0 -83
  183. package/dist/web-server/_libs/unist-util-visit.mjs +0 -24
  184. package/dist/web-server/_libs/unstorage.mjs +0 -1
  185. package/dist/web-server/_libs/use-sync-external-store.mjs +0 -139
  186. package/dist/web-server/_libs/vfile-message.mjs +0 -138
  187. package/dist/web-server/_libs/vfile.mjs +0 -467
  188. package/dist/web-server/_libs/zod.mjs +0 -3915
  189. package/dist/web-server/_libs/zustand.mjs +0 -343
  190. package/dist/web-server/_libs/zwitch.mjs +0 -1
  191. package/dist/web-server/_ssr/index-0n2Z3BPQ.mjs +0 -369
  192. package/dist/web-server/_ssr/index-6itDALOw.mjs +0 -339
  193. package/dist/web-server/_ssr/index-BIRTrOmp.mjs +0 -449
  194. package/dist/web-server/_ssr/index-BPzfADac.mjs +0 -66
  195. package/dist/web-server/_ssr/index-BQE3bF14.mjs +0 -1870
  196. package/dist/web-server/_ssr/index-C5HpvlUP.mjs +0 -190
  197. package/dist/web-server/_ssr/index-C_ZxnypN.mjs +0 -213
  198. package/dist/web-server/_ssr/index-Ca8JFH8f.mjs +0 -612
  199. package/dist/web-server/_ssr/index-DNVESZiA.mjs +0 -513
  200. package/dist/web-server/_ssr/index.mjs +0 -1558
  201. package/dist/web-server/_ssr/input-CqXjTRQg.mjs +0 -20
  202. package/dist/web-server/_ssr/queries-3H_19mUt.mjs +0 -16
  203. package/dist/web-server/_ssr/router-sbsNus0Y.mjs +0 -2093
  204. package/dist/web-server/_ssr/start-HYkvq4Ni.mjs +0 -4
  205. package/dist/web-server/_ssr/switch-usf2F1UM.mjs +0 -33
  206. package/dist/web-server/_ssr/syntax-highlighter-5vezNTce.mjs +0 -62
  207. package/dist/web-server/_ssr/textarea-DfRheWY0.mjs +0 -18
  208. package/dist/web-server/_tanstack-start-manifest_v-DqW-pKEH.mjs +0 -4
  209. package/dist/web-server/index.mjs +0 -597
@@ -1,388 +0,0 @@
1
- import { s as stringify } from "./comma-separated-tokens.mjs";
2
- import { o as ok } from "./devlop.mjs";
3
- import { s as svg, h as html, f as find, a as hastToReact } from "./property-information.mjs";
4
- import { s as stringify$1 } from "./space-separated-tokens.mjs";
5
- import { s as styleToJs } from "./style-to-js.mjs";
6
- import { w as whitespace } from "./hast-util-whitespace.mjs";
7
- import { n as name } from "./estree-util-is-identifier-name.mjs";
8
- import { V as VFileMessage } from "./vfile-message.mjs";
9
- import { p as pointStart } from "./unist-util-position.mjs";
10
- const own = {}.hasOwnProperty;
11
- const emptyMap = /* @__PURE__ */ new Map();
12
- const cap = /[A-Z]/g;
13
- const tableElements = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]);
14
- const tableCellElement = /* @__PURE__ */ new Set(["td", "th"]);
15
- const docs = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
16
- function toJsxRuntime(tree, options) {
17
- if (!options || options.Fragment === void 0) {
18
- throw new TypeError("Expected `Fragment` in options");
19
- }
20
- const filePath = options.filePath || void 0;
21
- let create;
22
- if (options.development) {
23
- if (typeof options.jsxDEV !== "function") {
24
- throw new TypeError(
25
- "Expected `jsxDEV` in options when `development: true`"
26
- );
27
- }
28
- create = developmentCreate(filePath, options.jsxDEV);
29
- } else {
30
- if (typeof options.jsx !== "function") {
31
- throw new TypeError("Expected `jsx` in production options");
32
- }
33
- if (typeof options.jsxs !== "function") {
34
- throw new TypeError("Expected `jsxs` in production options");
35
- }
36
- create = productionCreate(filePath, options.jsx, options.jsxs);
37
- }
38
- const state = {
39
- Fragment: options.Fragment,
40
- ancestors: [],
41
- components: options.components || {},
42
- create,
43
- elementAttributeNameCase: options.elementAttributeNameCase || "react",
44
- evaluater: options.createEvaluater ? options.createEvaluater() : void 0,
45
- filePath,
46
- ignoreInvalidStyle: options.ignoreInvalidStyle || false,
47
- passKeys: options.passKeys !== false,
48
- passNode: options.passNode || false,
49
- schema: options.space === "svg" ? svg : html,
50
- stylePropertyNameCase: options.stylePropertyNameCase || "dom",
51
- tableCellAlignToStyle: options.tableCellAlignToStyle !== false
52
- };
53
- const result = one(state, tree, void 0);
54
- if (result && typeof result !== "string") {
55
- return result;
56
- }
57
- return state.create(
58
- tree,
59
- state.Fragment,
60
- { children: result || void 0 },
61
- void 0
62
- );
63
- }
64
- function one(state, node, key) {
65
- if (node.type === "element") {
66
- return element(state, node, key);
67
- }
68
- if (node.type === "mdxFlowExpression" || node.type === "mdxTextExpression") {
69
- return mdxExpression(state, node);
70
- }
71
- if (node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") {
72
- return mdxJsxElement(state, node, key);
73
- }
74
- if (node.type === "mdxjsEsm") {
75
- return mdxEsm(state, node);
76
- }
77
- if (node.type === "root") {
78
- return root(state, node, key);
79
- }
80
- if (node.type === "text") {
81
- return text(state, node);
82
- }
83
- }
84
- function element(state, node, key) {
85
- const parentSchema = state.schema;
86
- let schema = parentSchema;
87
- if (node.tagName.toLowerCase() === "svg" && parentSchema.space === "html") {
88
- schema = svg;
89
- state.schema = schema;
90
- }
91
- state.ancestors.push(node);
92
- const type = findComponentFromName(state, node.tagName, false);
93
- const props = createElementProps(state, node);
94
- let children = createChildren(state, node);
95
- if (tableElements.has(node.tagName)) {
96
- children = children.filter(function(child) {
97
- return typeof child === "string" ? !whitespace(child) : true;
98
- });
99
- }
100
- addNode(state, props, type, node);
101
- addChildren(props, children);
102
- state.ancestors.pop();
103
- state.schema = parentSchema;
104
- return state.create(node, type, props, key);
105
- }
106
- function mdxExpression(state, node) {
107
- if (node.data && node.data.estree && state.evaluater) {
108
- const program = node.data.estree;
109
- const expression = program.body[0];
110
- ok(expression.type === "ExpressionStatement");
111
- return (
112
- /** @type {Child | undefined} */
113
- state.evaluater.evaluateExpression(expression.expression)
114
- );
115
- }
116
- crashEstree(state, node.position);
117
- }
118
- function mdxEsm(state, node) {
119
- if (node.data && node.data.estree && state.evaluater) {
120
- return (
121
- /** @type {Child | undefined} */
122
- state.evaluater.evaluateProgram(node.data.estree)
123
- );
124
- }
125
- crashEstree(state, node.position);
126
- }
127
- function mdxJsxElement(state, node, key) {
128
- const parentSchema = state.schema;
129
- let schema = parentSchema;
130
- if (node.name === "svg" && parentSchema.space === "html") {
131
- schema = svg;
132
- state.schema = schema;
133
- }
134
- state.ancestors.push(node);
135
- const type = node.name === null ? state.Fragment : findComponentFromName(state, node.name, true);
136
- const props = createJsxElementProps(state, node);
137
- const children = createChildren(state, node);
138
- addNode(state, props, type, node);
139
- addChildren(props, children);
140
- state.ancestors.pop();
141
- state.schema = parentSchema;
142
- return state.create(node, type, props, key);
143
- }
144
- function root(state, node, key) {
145
- const props = {};
146
- addChildren(props, createChildren(state, node));
147
- return state.create(node, state.Fragment, props, key);
148
- }
149
- function text(_, node) {
150
- return node.value;
151
- }
152
- function addNode(state, props, type, node) {
153
- if (typeof type !== "string" && type !== state.Fragment && state.passNode) {
154
- props.node = node;
155
- }
156
- }
157
- function addChildren(props, children) {
158
- if (children.length > 0) {
159
- const value = children.length > 1 ? children : children[0];
160
- if (value) {
161
- props.children = value;
162
- }
163
- }
164
- }
165
- function productionCreate(_, jsx, jsxs) {
166
- return create;
167
- function create(_2, type, props, key) {
168
- const isStaticChildren = Array.isArray(props.children);
169
- const fn = isStaticChildren ? jsxs : jsx;
170
- return key ? fn(type, props, key) : fn(type, props);
171
- }
172
- }
173
- function developmentCreate(filePath, jsxDEV) {
174
- return create;
175
- function create(node, type, props, key) {
176
- const isStaticChildren = Array.isArray(props.children);
177
- const point = pointStart(node);
178
- return jsxDEV(
179
- type,
180
- props,
181
- key,
182
- isStaticChildren,
183
- {
184
- columnNumber: point ? point.column - 1 : void 0,
185
- fileName: filePath,
186
- lineNumber: point ? point.line : void 0
187
- },
188
- void 0
189
- );
190
- }
191
- }
192
- function createElementProps(state, node) {
193
- const props = {};
194
- let alignValue;
195
- let prop;
196
- for (prop in node.properties) {
197
- if (prop !== "children" && own.call(node.properties, prop)) {
198
- const result = createProperty(state, prop, node.properties[prop]);
199
- if (result) {
200
- const [key, value] = result;
201
- if (state.tableCellAlignToStyle && key === "align" && typeof value === "string" && tableCellElement.has(node.tagName)) {
202
- alignValue = value;
203
- } else {
204
- props[key] = value;
205
- }
206
- }
207
- }
208
- }
209
- if (alignValue) {
210
- const style = (
211
- /** @type {Style} */
212
- props.style || (props.style = {})
213
- );
214
- style[state.stylePropertyNameCase === "css" ? "text-align" : "textAlign"] = alignValue;
215
- }
216
- return props;
217
- }
218
- function createJsxElementProps(state, node) {
219
- const props = {};
220
- for (const attribute of node.attributes) {
221
- if (attribute.type === "mdxJsxExpressionAttribute") {
222
- if (attribute.data && attribute.data.estree && state.evaluater) {
223
- const program = attribute.data.estree;
224
- const expression = program.body[0];
225
- ok(expression.type === "ExpressionStatement");
226
- const objectExpression = expression.expression;
227
- ok(objectExpression.type === "ObjectExpression");
228
- const property = objectExpression.properties[0];
229
- ok(property.type === "SpreadElement");
230
- Object.assign(
231
- props,
232
- state.evaluater.evaluateExpression(property.argument)
233
- );
234
- } else {
235
- crashEstree(state, node.position);
236
- }
237
- } else {
238
- const name2 = attribute.name;
239
- let value;
240
- if (attribute.value && typeof attribute.value === "object") {
241
- if (attribute.value.data && attribute.value.data.estree && state.evaluater) {
242
- const program = attribute.value.data.estree;
243
- const expression = program.body[0];
244
- ok(expression.type === "ExpressionStatement");
245
- value = state.evaluater.evaluateExpression(expression.expression);
246
- } else {
247
- crashEstree(state, node.position);
248
- }
249
- } else {
250
- value = attribute.value === null ? true : attribute.value;
251
- }
252
- props[name2] = /** @type {Props[keyof Props]} */
253
- value;
254
- }
255
- }
256
- return props;
257
- }
258
- function createChildren(state, node) {
259
- const children = [];
260
- let index = -1;
261
- const countsByName = state.passKeys ? /* @__PURE__ */ new Map() : emptyMap;
262
- while (++index < node.children.length) {
263
- const child = node.children[index];
264
- let key;
265
- if (state.passKeys) {
266
- const name2 = child.type === "element" ? child.tagName : child.type === "mdxJsxFlowElement" || child.type === "mdxJsxTextElement" ? child.name : void 0;
267
- if (name2) {
268
- const count = countsByName.get(name2) || 0;
269
- key = name2 + "-" + count;
270
- countsByName.set(name2, count + 1);
271
- }
272
- }
273
- const result = one(state, child, key);
274
- if (result !== void 0) children.push(result);
275
- }
276
- return children;
277
- }
278
- function createProperty(state, prop, value) {
279
- const info = find(state.schema, prop);
280
- if (value === null || value === void 0 || typeof value === "number" && Number.isNaN(value)) {
281
- return;
282
- }
283
- if (Array.isArray(value)) {
284
- value = info.commaSeparated ? stringify(value) : stringify$1(value);
285
- }
286
- if (info.property === "style") {
287
- let styleObject = typeof value === "object" ? value : parseStyle(state, String(value));
288
- if (state.stylePropertyNameCase === "css") {
289
- styleObject = transformStylesToCssCasing(styleObject);
290
- }
291
- return ["style", styleObject];
292
- }
293
- return [
294
- state.elementAttributeNameCase === "react" && info.space ? hastToReact[info.property] || info.property : info.attribute,
295
- value
296
- ];
297
- }
298
- function parseStyle(state, value) {
299
- try {
300
- return styleToJs(value, { reactCompat: true });
301
- } catch (error) {
302
- if (state.ignoreInvalidStyle) {
303
- return {};
304
- }
305
- const cause = (
306
- /** @type {Error} */
307
- error
308
- );
309
- const message = new VFileMessage("Cannot parse `style` attribute", {
310
- ancestors: state.ancestors,
311
- cause,
312
- ruleId: "style",
313
- source: "hast-util-to-jsx-runtime"
314
- });
315
- message.file = state.filePath || void 0;
316
- message.url = docs + "#cannot-parse-style-attribute";
317
- throw message;
318
- }
319
- }
320
- function findComponentFromName(state, name$1, allowExpression) {
321
- let result;
322
- if (!allowExpression) {
323
- result = { type: "Literal", value: name$1 };
324
- } else if (name$1.includes(".")) {
325
- const identifiers = name$1.split(".");
326
- let index = -1;
327
- let node;
328
- while (++index < identifiers.length) {
329
- const prop = name(identifiers[index]) ? { type: "Identifier", name: identifiers[index] } : { type: "Literal", value: identifiers[index] };
330
- node = node ? {
331
- type: "MemberExpression",
332
- object: node,
333
- property: prop,
334
- computed: Boolean(index && prop.type === "Literal"),
335
- optional: false
336
- } : prop;
337
- }
338
- result = node;
339
- } else {
340
- result = name(name$1) && !/^[a-z]/.test(name$1) ? { type: "Identifier", name: name$1 } : { type: "Literal", value: name$1 };
341
- }
342
- if (result.type === "Literal") {
343
- const name2 = (
344
- /** @type {string | number} */
345
- result.value
346
- );
347
- return own.call(state.components, name2) ? state.components[name2] : name2;
348
- }
349
- if (state.evaluater) {
350
- return state.evaluater.evaluateExpression(result);
351
- }
352
- crashEstree(state);
353
- }
354
- function crashEstree(state, place) {
355
- const message = new VFileMessage(
356
- "Cannot handle MDX estrees without `createEvaluater`",
357
- {
358
- ancestors: state.ancestors,
359
- place,
360
- ruleId: "mdx-estree",
361
- source: "hast-util-to-jsx-runtime"
362
- }
363
- );
364
- message.file = state.filePath || void 0;
365
- message.url = docs + "#cannot-handle-mdx-estrees-without-createevaluater";
366
- throw message;
367
- }
368
- function transformStylesToCssCasing(domCasing) {
369
- const cssCasing = {};
370
- let from;
371
- for (from in domCasing) {
372
- if (own.call(domCasing, from)) {
373
- cssCasing[transformStyleToCssCasing(from)] = domCasing[from];
374
- }
375
- }
376
- return cssCasing;
377
- }
378
- function transformStyleToCssCasing(from) {
379
- let to = from.replace(cap, toDash);
380
- if (to.slice(0, 3) === "ms-") to = "-" + to;
381
- return to;
382
- }
383
- function toDash($0) {
384
- return "-" + $0.toLowerCase();
385
- }
386
- export {
387
- toJsxRuntime as t
388
- };
@@ -1,10 +0,0 @@
1
- const re = /[ \t\n\f\r]/g;
2
- function whitespace(thing) {
3
- return typeof thing === "object" ? thing.type === "text" ? empty(thing.value) : false : empty(thing);
4
- }
5
- function empty(value) {
6
- return value.replace(re, "") === "";
7
- }
8
- export {
9
- whitespace as w
10
- };
@@ -1,200 +0,0 @@
1
- import { f as find, n as normalize, h as html, s as svg } from "./property-information.mjs";
2
- import { p as parse$1 } from "./comma-separated-tokens.mjs";
3
- import { p as parse } from "./space-separated-tokens.mjs";
4
- import { p as parseSelector } from "./hast-util-parse-selector.mjs";
5
- function createH(schema, defaultTagName, caseSensitive) {
6
- const adjust = caseSensitive ? createAdjustMap(caseSensitive) : void 0;
7
- function h2(selector, properties, ...children) {
8
- let node;
9
- if (selector === null || selector === void 0) {
10
- node = { type: "root", children: [] };
11
- const child = (
12
- /** @type {Child} */
13
- properties
14
- );
15
- children.unshift(child);
16
- } else {
17
- node = parseSelector(selector, defaultTagName);
18
- const lower = node.tagName.toLowerCase();
19
- const adjusted = adjust ? adjust.get(lower) : void 0;
20
- node.tagName = adjusted || lower;
21
- if (isChild(properties)) {
22
- children.unshift(properties);
23
- } else {
24
- for (const [key, value] of Object.entries(properties)) {
25
- addProperty(schema, node.properties, key, value);
26
- }
27
- }
28
- }
29
- for (const child of children) {
30
- addChild(node.children, child);
31
- }
32
- if (node.type === "element" && node.tagName === "template") {
33
- node.content = { type: "root", children: node.children };
34
- node.children = [];
35
- }
36
- return node;
37
- }
38
- return h2;
39
- }
40
- function isChild(value) {
41
- if (value === null || typeof value !== "object" || Array.isArray(value)) {
42
- return true;
43
- }
44
- if (typeof value.type !== "string") return false;
45
- const record = (
46
- /** @type {Record<string, unknown>} */
47
- value
48
- );
49
- const keys = Object.keys(value);
50
- for (const key of keys) {
51
- const value2 = record[key];
52
- if (value2 && typeof value2 === "object") {
53
- if (!Array.isArray(value2)) return true;
54
- const list = (
55
- /** @type {ReadonlyArray<unknown>} */
56
- value2
57
- );
58
- for (const item of list) {
59
- if (typeof item !== "number" && typeof item !== "string") {
60
- return true;
61
- }
62
- }
63
- }
64
- }
65
- if ("children" in value && Array.isArray(value.children)) {
66
- return true;
67
- }
68
- return false;
69
- }
70
- function addProperty(schema, properties, key, value) {
71
- const info = find(schema, key);
72
- let result;
73
- if (value === null || value === void 0) return;
74
- if (typeof value === "number") {
75
- if (Number.isNaN(value)) return;
76
- result = value;
77
- } else if (typeof value === "boolean") {
78
- result = value;
79
- } else if (typeof value === "string") {
80
- if (info.spaceSeparated) {
81
- result = parse(value);
82
- } else if (info.commaSeparated) {
83
- result = parse$1(value);
84
- } else if (info.commaOrSpaceSeparated) {
85
- result = parse(parse$1(value).join(" "));
86
- } else {
87
- result = parsePrimitive(info, info.property, value);
88
- }
89
- } else if (Array.isArray(value)) {
90
- result = [...value];
91
- } else {
92
- result = info.property === "style" ? style(value) : String(value);
93
- }
94
- if (Array.isArray(result)) {
95
- const finalResult = [];
96
- for (const item of result) {
97
- finalResult.push(
98
- /** @type {number | string} */
99
- parsePrimitive(info, info.property, item)
100
- );
101
- }
102
- result = finalResult;
103
- }
104
- if (info.property === "className" && Array.isArray(properties.className)) {
105
- result = properties.className.concat(
106
- /** @type {Array<number | string> | number | string} */
107
- result
108
- );
109
- }
110
- properties[info.property] = result;
111
- }
112
- function addChild(nodes, value) {
113
- if (value === null || value === void 0) ;
114
- else if (typeof value === "number" || typeof value === "string") {
115
- nodes.push({ type: "text", value: String(value) });
116
- } else if (Array.isArray(value)) {
117
- for (const child of value) {
118
- addChild(nodes, child);
119
- }
120
- } else if (typeof value === "object" && "type" in value) {
121
- if (value.type === "root") {
122
- addChild(nodes, value.children);
123
- } else {
124
- nodes.push(value);
125
- }
126
- } else {
127
- throw new Error("Expected node, nodes, or string, got `" + value + "`");
128
- }
129
- }
130
- function parsePrimitive(info, name, value) {
131
- if (typeof value === "string") {
132
- if (info.number && value && !Number.isNaN(Number(value))) {
133
- return Number(value);
134
- }
135
- if ((info.boolean || info.overloadedBoolean) && (value === "" || normalize(value) === normalize(name))) {
136
- return true;
137
- }
138
- }
139
- return value;
140
- }
141
- function style(styles) {
142
- const result = [];
143
- for (const [key, value] of Object.entries(styles)) {
144
- result.push([key, value].join(": "));
145
- }
146
- return result.join("; ");
147
- }
148
- function createAdjustMap(values) {
149
- const result = /* @__PURE__ */ new Map();
150
- for (const value of values) {
151
- result.set(value.toLowerCase(), value);
152
- }
153
- return result;
154
- }
155
- const svgCaseSensitiveTagNames = [
156
- "altGlyph",
157
- "altGlyphDef",
158
- "altGlyphItem",
159
- "animateColor",
160
- "animateMotion",
161
- "animateTransform",
162
- "clipPath",
163
- "feBlend",
164
- "feColorMatrix",
165
- "feComponentTransfer",
166
- "feComposite",
167
- "feConvolveMatrix",
168
- "feDiffuseLighting",
169
- "feDisplacementMap",
170
- "feDistantLight",
171
- "feDropShadow",
172
- "feFlood",
173
- "feFuncA",
174
- "feFuncB",
175
- "feFuncG",
176
- "feFuncR",
177
- "feGaussianBlur",
178
- "feImage",
179
- "feMerge",
180
- "feMergeNode",
181
- "feMorphology",
182
- "feOffset",
183
- "fePointLight",
184
- "feSpecularLighting",
185
- "feSpotLight",
186
- "feTile",
187
- "feTurbulence",
188
- "foreignObject",
189
- "glyphRef",
190
- "linearGradient",
191
- "radialGradient",
192
- "solidColor",
193
- "textArea",
194
- "textPath"
195
- ];
196
- const h = createH(html, "div");
197
- createH(svg, "g", svgCaseSensitiveTagNames);
198
- export {
199
- h
200
- };
@@ -1 +0,0 @@
1
-
@@ -1,26 +0,0 @@
1
- const urlAttributes = {
2
- action: ["form"],
3
- cite: ["blockquote", "del", "ins", "q"],
4
- data: ["object"],
5
- formAction: ["button", "input"],
6
- href: ["a", "area", "base", "link"],
7
- icon: ["menuitem"],
8
- itemId: null,
9
- manifest: ["html"],
10
- ping: ["a", "area"],
11
- poster: ["video"],
12
- src: [
13
- "audio",
14
- "embed",
15
- "iframe",
16
- "img",
17
- "input",
18
- "script",
19
- "source",
20
- "track",
21
- "video"
22
- ]
23
- };
24
- export {
25
- urlAttributes as u
26
- };